Posts

Showing posts from August, 2013

perl - Regex value comparison -

i want compare 2 numbers isolated sample data: 'gi|112807938|emb|cu075707.1|_xenopus_tropicalis_finished_cdna,_clone_tneu129d01 c1:tcons_00039972(xloc_025068),_12.9045:32.0354,_change:1.3118,_p:0.00025,_q:0.50752 c2:tcons_00045925(xloc_029835),_10.3694:43.8379,_change:2.07985,_p:0.0004,_q:0.333824', 'gi|115528274|gb|bc124894.1|_xenopus_laevis_islet-1,_mrna_(cdna_clone_mgc:154537_image:8320777),_complete_cds c1:tcons_00080221(xloc_049570),_17.9027:40.8136,_change:1.18887,_p:0.00535,_q:0.998852 c2:tcons_00092192(xloc_059015),_17.8995:35.5534,_change:0.990066,_p:0.0355,_q:0.998513', 'gi|118404233|ref|nm_001078963.1|_xenopus_(silurana)_tropicalis_pancreatic_lipase-related_protein_2_(pnliprp2),_mrna c1:tcons_00031955(xloc_019851),_0.944706:5.88717,_change:2.63964,_p:0.01915,_q:0.998852 c2:tcons_00036655(xloc_023660),_2.31819:11.556,_change:2.31757,_p:0.0358,_q:0.998513', using following regex: #!/usr/bin/perl -w use strict; use file::slurp; use data

php - Checking a value in a basic multidimensional array -

this quick 1 of i'm sure, i'm banging head against wall trying teach myself multidimensional arrays. i wish check whether or not $_files["photo"]["name"] contains empty strings, , such code below if statement executed. currently works, else statment (not shown), there has cleaner way of writing this?? many thanks. if (empty($_files["photo"]["name"][0]) && empty($_files["photo"]["name"][1]) && empty($_files["photo"]["name"][2])) { $query = "insert lot (lotnumber, lottitle, lotdescription, datecreated, lastmodified) values" . "('$lotnumber', '$lottitle', '$lotdescription', null, null)"; if (!$mysqli->query($query)) { echo '<p class="warning">error executing insert query: (' . $mysqli->errno . ') ' . $mysqli->error . "</p>"; } else {

javascript - angular js date input formatting -

i trying create date input in angularjs app , have trouble formatting date. have created plnkr illustrate issue: http://plnkr.co/edit/lbqipg?p=preview my issue regardless of date format receiving sql server (i put 2 sample dates in plnkr 2013-07-11t00:00:00.000 , 2013-07-11), javascript date object applying time zone code , affecting display of date in input field displaying 07/10/2013 instead of correct date of 7/11/2013. want date returned database, don't want timezone applied @ all, date relevant me, not time. need create custom directive accurately display date want getting iso date time , assigning date string input? or there better solution. here sample of code thinking might need use format date in directive: var newdate = $scope.databasedata.mydate.toisostring(); newdate = new date(newdate); $scope.databasedata.mydate= new date((newdate.getutcmonth() +1) + "/" +newdate.getutcdate() + "/" + newdate.getutcfullyear()); angularjs uses i

cannot get a vb6 control with a color function to work in vb.net -

i have vb6 ocx control has function takes, among other things, long set color of label component of control. works fine until use control in vb.net 64bit environment longs ints , color different type anyway. i tried changing function take 3 ints rgb , using rgb function color use form not load in vb.net environment control on it. does know how can change control's code in vb6 can used in vb.net? you can use built in method equivalent color value use in application: dim mycolor color = color.red ' translate mycolor ole color. dim wincolor integer = colortranslator.towin32(mycolor) the result int32 long in vb6 so... in vb6 control can expose color property this: public property colorvalue long colorvalue = lblcolor.backcolor end property public property let colorvalue(value long) lblcolor.backcolor = value end property then in vb.net application can set this: mycontrol.colorvalue = colortranslator.towin32(color.red)

c# - Issue with Group By in LinQ Query -

i want make linq query against array , return multiple columns. can't seem working correctly, , i've tried various things. first off, array contains type , version table such as: typeid-------versionid-------text 1 1 "version 1.1" 2 1 "version 2.1" 3 1 "version 3.1" 3 2 "version 3.2" this sql table, , latest version query: select v.* table v v.versionid in (select max(versionid) group typeid) however, want in linq , it's killing me. can't figure out. want values. therefore: public mystruct { public int typeid, public int versionid, public string text } mystruct[] array = new mystruct[4]; array[0].typeid = 1; array[0].versionid = 1; array[0].text = "version 1.1"; array[1].typeid = 2; array[1].versionid = 1; array[1].text = "version 2.1"; array[2].typeid = 3; array[2].versionid =

jquery - PageCreate on Refresh -

ok, new jquery mobile college assignment im using ajax calls pull in data external cms. stands im using ajax call dynamically insert buttons homescreen , create , link relevant pages these buttons.... problem when refresh subpage eg qualifications automatically brings me home... have #home.trigger(pagecreate) within ajax call otherwise buttons wouldn't render proper buttons instead of links... i presume on refresh of subpage whole index.html refreshed , therefore pagecreate triggered again...bringing me home...but url still pointing #qualifications... if navigate section of app, , hit button (data-rel="back") attempts return me #qualifications page though last page displayed homepage... , ends rendering no page @ all.... how might set function catch refresh... navigate previous page (from browser history) , pagecreate correct page...? my apologies if question convoluted... first time posting! , technically im meant graphics guys on project... :) overall im a

Image upload not moving file php mysql -

i'm trying build image upload on site. code i'm using inserts value database, image isn't moved directory? can me on this, or give me advice on how debug this? inputs <label for="picture_1">picture 1 : </label> <input type="file" name="picture_1" id="picture_1" /> </li> <li> <label for="picture_2">picture 2 : </label> <input type="file" name="picture_2" id="picture_2" /> </li> <li> <label for="picture_3">picture 3 : </label> <input type="file" name="picture_3" id="picture_3" /> file upload if(sizeof($_files)){ for($i = 1; $i <= 3; $i++) { $afile = $_files['picture_'.$i]; if(empty($afile['tmp_name'])) continue; # skip empty elements $allowedexts = array("jpg", "jpeg", "gif", "png"

android - Place dynamic view between two views vertically -

here problem: want place view dynamic height calculated @ runtime according width (lets call center view) between 2 views. tricky part top , bottom views should adapt height fit space left after center view measurement , layout, , height shouldn't less minheight. managed put 3 views in vertical linear layout, top , bottom have weight = 1 , center view fixed height, when center view height becomes bigger value covers top , bottom views , minheight param ignored. here part of layout, hope helps: <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <linearlayout android:id="@+id/toplinearlayout" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:minheight="84dp" android:orientation="horizontal" >

jquery - Path JSON to return only the titles? -

hi guys i'm doing first ajax application, got lot, not hit road titles. json in way: "json.query.results.channel.item.title" i return arrays, can not set path title, can me? jquery: var main = function () { var url = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3d'http%3a%2f%2frss.cnn.com%2fservices%2fpodcasting%2fac360%2frss.xml'%20and%20itempath%3d%22%2f%2fchannel%22&format=json&diagnostics=true&callback=?"; $.ajax({ type: 'get', url: url, async: false, jsonpcallback: 'jsoncallback', contenttype: "application/json", datatype: 'jsonp', success: function (json) { console.dir(json.query.results.channel.item); }, error: function (e) { console.log(e.message); } }); var titles = item.map(function (item) { return item.title; }); $

Getting Facebook Access Token from User Id and Facebook App Secret? -

i'm trying understand how facebook api works. end goal able read posts facebook page. if has connected app on facebook can c# application posts public facebook page if knows facebook account id (and has facebook app secret hard coded). if http requests needs make in order access token can used posts, , requests new access token before 1 expires? if provide example in c# (maybe using acebooksdk.net library) great! thanks. the way using "the login flow web (without javascript sdk)" api user access token. user access token required sent graph api queries in order page posts. the first step create app on facebook specify information want program able access via graph api. end user choose accept these permissions later. the program creates web browser frame , navigates https://www.facebook.com/dialog/oauth?client_id={app-id}&redirect_uri=https://www.facebook.com/connect/login_success.html&response_type=token the response type "token&quo

WinForm User Control functionality in Android -

i new android development , working on first android app. i've come across scenario need dynamically add 2 textboxes , checkbox list each object in list. if using winforms use custom user control , handle checkedchanged event inside custom control. i've googled around , been able find tutorials on how build own controls ground up. while helpful, want combine 3 default controls single custom control , having no luck @ in finding tutorial goes through how this. does know if describing possible, , if is, there reference out there shows how this? this tutorial(using xamarin) laid out how accomplish needed.

ios - how to read xml data from website and display the same in UITableView -

i know how make json data , use in displaying json data in uitableview. sample json data @ link http://www.sama-q8.com/sama/getbuildinginfosama.php for new project, client have provided xml data. sample data @ http://sahhtna.hardtask.org/services/mobileservice.asmx/clients?type=1&index=0 i want learn how data in nsarray format (like using json data). i tried searching links, didn't links. links great. i looking @ this example , think not expecting. but confused in format of xml data have @ link http://sahhtna.hardtask.org/services/mobileservice.asmx/clients?type=1&index=0 text "this xml file not appear have style information associated it. document tree shown below." in webpage fine or give me problem while parsing xml data? also format have in above link right or not? please let me know. i understand trying do. xml file same rss feed. infact rss feed xml file. there class called nsxml parser allows parse through xml file, , load

cloud - How do you create a new folder in a Devtable.com project? -

either devtable has huge usability issue, or having mental breakdown... there seems no way create new folders on cloud ide site devtable. default projcet types have folders, there must way, there no button anywhere create new 1 (or these mountain dews starting fry brain. devtable co-founder here, of right pain create new folder, , know it! working on getting support true folders in system. didn't support folders @ all, trying move more modern system of tagging, downstream tools , users absolutely demanded them. our current folder system purely representation of names in file tree, how git works internally. can't represent empty folder, can't create folder ui. when fix former, easy fix latter. that being said, create new folder, , new file goes in simultaneously, add folder name beginning of filename, e.g. new_foldername/index.html . folder represented in ui other. i update post once have empty folder support, , ui creating them. this f

javascript - Pass in parameter to handlebars helper -

so have handlebars helper simple - handlebars.registerhelper('selectrow', (rowindex, selectedids) -> console.log 'row index' console.log rowindex console.log selectedids isselected = _.indexof(rowindex, selectedids) if isselected > -1 return 'class="row-selected"' ) and have handlebars code - <div class="title">{{ title }}</div> <hr/> <table cellspacing="0" cellpadding="0"> <thead> {{#each columns}} <th class="col-heading" data-heading="{{ }}">{{ }}</th> {{/each}} </thead> <tbody> {{#each rows}} <tr {{#selectrow @index selected }}> {{#each this}} <td> {{this}} </td> {{/each}} </tr> {{/selectrow}} {{/each}} </tbody> </table> the selected parameter undefined. if add {{ selected }} an

objective c - Turn Deprecation Warnings Back On -

after creating new target in ios project, there tons of deprecation warnings. i want see these in other targets, too. i've searched whole project deprecated (as this answer indicate) , i've looked -w (as mentioned here ), , found did this: #pragma clang diagnostic ignored "-warc-performselector-leaks" in 1 or 2 places, that's not it. i've looked @ answers regarding suppressing warnings, haven't found shut off. where else might deprecation warnings been shut off? turn warnings on. example this should result in warning: self.numericlabel.linebreakmode = uilinebreakmodeclip;// nslinebreakbyclipping; because comments folded default , missed, elaborating on greg's comment example. deprecation warnings printed if deployment target newer first deprecation of api. example 1: using: [twtweetcomposeviewcontroller cansendtweet] deprecation in apple's document:ns_deprecated(na, na, 5_0, 6_0) deployment target: ios 5.0 ios sdk

java - Adding Days to Calendar -

i'm new site , have started learning java. i'm trying add couple days gregoriancalendar doesn't work. here... (ignore top chunk), adding dates @ bottom annoying. /* * author:matt m * date:8.12.13 * discription: when user inputs deadline, , difficulity of project, * program gives date should start working on */ import java.util.*; public class deadlineplanner{ public static void main(string[] args) { //take information , restart questions if information wrong int month = 0, day = 0 ; { { system.out.println("input month please"); month = (new scanner(system.in).nextint() - 1); system.out.println("input day please"); day = (new scanner(system.in).nextint()); } while (!(month <= 12) || !(month >= 0)); } while (!(day <= 31) || !(month >= 0)); //make new calender , initialize gregoriancalendar setup

c - How to transmit data from an interrupt handler to an user application? -

a device produces interrupt managed handler in kernel. need send message flag, user application receives notification of interruption has occurred, , can perform procedure. example, wake process. how do this? imho posix style solution write device driver receives interrupts in kernel. user space program open device file , icoctl() or read() it, blocking until @ least 1 event had arrived. suggest, user space program should read bit more: how many events have arrived far?) has call blocked (e.g. there no events queued when reading device) this you, see when program misisng events (e.g. because has ben deleayed in previous cycle).

Keep the TRUE non-greedy match using Perl regex -

from following word "tacacatac", want match "cat". seems regex c.*?t should give me this, guess starts first occurrence of "c" , there finds next "t", , thus, matches "cacat". is there way (perhaps using negative lookahead) start looking c before final t? -----edit----- need option work if replace letters strings thanks. try this: my $str = "the cat in cat in hat"; if ($str =~ /(cat(?:(?!cat).)*hat)/) { print $1, "\n"; }

Add value for each year in python list -

this question has answer here: how sum tuples in list first value same? 4 answers given list of [yyy,m,value], need add values corresponding single year. that, a = [ [['2008', '3', '5'],['2008', '4', '35'],['2013', '3', '71']], [['2008', '6', '2'],['2008', '7', '2'],['2008', '8', '4'],['2013', '3', '128']] ] becomes a = [ [['2008', '40'],['2013','71']], [['2008', '8'],['2013','128']] ] what best possible ways? thanks. use defaultdict : from collections import defaultdict b = [] line in a: d = defaultdict(int) entry in line: d[entry[0]] += int(entry[2]) b.append([(k,str(v)) k,v in sorted(d.items(),ke

c# - Cannot Convert Item to its interface exception -

i have following class , interface: public interface ifieldfiller { string content { get; set; } boolean nullable { get; set; } string name { get; set; } } and [datacontract] public class fieldfiller : ifieldfiller { [datamember] public string content { get; set; } [datamember] public boolean nullable { get; set; } [datamember] public string name { get; set; } [datamember] public storedprocedure storedprocedure { get; set; } [datamember] public string namespace { get; set; } } i use following linq statement build list of these objects: fields = temp.merged_fields.select(f => new fieldfiller { name = f.name, namespace = f.@namespace, storedprocedure = new storedprocedure { name = f.sproc1.name, parameters = f.field_params.todictionary(p => p.sprocparam.name, p=>p.value)}}).tolist() and keep getting following exception: error 1 cannot implicitly convert type 'system.collections

Insert multidimensional associative array into multidimensional associative PHP -

hi have following (this example of attempting have allot larger): $array= array(); array_push($array,$var['bookshopname']); $array[$var['bookshopname']]=array('opentime'=>$var1,'closetime'=>$var2); foreach($array $var) { print_r($var); } i get: storename1 array ( [opentime] => 12 [closetime] => 17 ) storename2 array ( [opentime] => 13 [closetime] => 19 ) so if count array there 4 elements if attempted following foreach($array $var) { print_r($var['opentime']); } it breaks on first result (storename1). i want following array( storename1 => array(opentime => ...) storename2 => array(opentime => ...) ) and getting this: array( [0] => storename1[storename1] => array ( [opentime ] =>.... [1] => storename2[storename2] => array ( [opentime ] =>.... ) i cant quite figure out why creates these 2 results names in response oriol when tr

qt - there is an error QApplication: no such file or directory -

i have installed qtcreator 2.7.2 , when try compiling code include qapplication gives me error :error qapplication: no such file or directory. it can compile tutorials code "notepad" smoothly, , can find qapplication in /usr/include/qt4/qtgui/qapplication. here code : #include #include "framework/vision_app.h" int main(int argc, char** argv) { qapplication qapp(argc, argv); visionapp vapp; if (vapp.init(argc, argv)) { return qapp.exec(); } else { return 1; } } to more, don't have .pro file. use cmake package code. here cmakelist: cmake_minimum_required(version 2.4.6) include($env{ros_root}/core/rosbuild/rosbuild.cmake) # set build type. options are: # coverage : w/ debug symbols, w/o optimization, w/ code-coverage # debug : w/ debug symbols, w/o optimization # release : w/o debug symbols, w/ optimization # relwithdebinfo : w/ debug symbols, w/ optimization # mi

Delphi printing to Zebra printer -

i have written function prints out zplii data zebra printer shown below var st : string; startdocument(docname); startpage; try i:=0 datatoprint.count-1 begin st:=formatprintline(i); try escape(printerhandle,passthrough,length(st),pansichar(st),nil); except on e:exception begin getwin32apierrormessage(ferrorcode,ferrortext); raise eprinter.createfmt('printer write error %d'+#13+ 'while printing '+printername+#13+ errortext,[errorcode]); end; end; end; endpage; enddocument; i have tested label data using command prompt print text file , label prints out correctly cannot print application. if pause printer can see job gets sent printer , size of job 2.12kb, size label should be, nothing prints out. light on zebra printer data lights nothing print. have tried 2 of zebra printers own, not printer issue. guess @ point maybe program isn't sending entire label d

javascript - Replace Log In text to say Logged in with jquery -

i new , need making link "login" replaced logged in after clicking submit javascript/jquery. here have on index page. have pop login page , need stop function after clicking word submit , replace login logged in. simple demo site , needs simple code. thank you! <head> <script type='text/javascript' charset='utf-8'> $(document).ready(function(){ $('.popbox').popbox(); }); <div id= "toggle" class='popbox'> <a div id=login class='open' href='#'>login</a> <div class='collapse'> <div class='box'> <div class='arrow'></div> <div class='arrow-border'></div> <form name="myform" action="#" method="post" id="subform"> <div id="fb-root"></div> <script src="http://connect.facebook.net/en_us/all.js"><

jquery - Extract inner content from a string -

here problem facing - having div called ('mydiv'). , have set setinterval function, runs every 2second. want each time when setinterval execute, want rotate div '15deg' extra. i did almost. when doing string manipulation, getting wrong. //here code. //css transform required value = 15ddeg not '15deg' how extract '15deg' 15deg (without qoute) <!doctype html> <html> <head> <script src="http://code.jquery.com/jquery-git2.js"></script> <meta charset=utf-8 /> <script> $(function(){ var foo = setinterval('animatediv()', 2000); var count = 15; function animatediv(){ //console.log(count); count += 10; $('.mydiv').css({'-webkit-transform':'rotate(count + "deg")'}); //console.log(count + "deg"); } }); </script> <title>js bin</title> </head> <body> <div cla

javascript - side menu scroll lags on safari (ios) -

i have mobile website has simple side menu bar scroll, when scrolling menu on safari lags lot (struggle scroll). here html: <body> <div id="menu_background" onclick="togglemenu()"></div> <div id="menu"> <ul> <li> <div>item 1</div> </li> //other items goes here </ul> </div> <div id="global_container"> //some content goes here </div> </body> here css: #menu { position: absolute; top: 0px; bottom: 0px; z-index: 100; overflow: hidden; display:none; width: 0%; padding: 1%; } and javascript : var menushown = false; function togglemenu(){ var menu = document.getelementbyid("menu"); var menubackground = document.getelementbyid("menu_background"); var globalcontainer = document.getelementbyid("global_container&qu

Git Remote Push Fatal Error -

i trying push rails project github mac terminal. keep getting fatal error message. earlier today working on same project, decided restart it. when working on earlier else setup repository , gave me access , able remotely push repo. reason when creating new repo i'm not able push it. i'm not sure how set permisson, when tried github mac app did not work. view of terminal... new-host-5:blogger $ git init initialized empty git repository in /users/evankline/documents/ruby_programs/jumpstart/rails_blogger/blogger/.git/ new-host-5:blogger evankline$ git add . new-host-5:blogger evankline$ git commit -m "first blog commit" [master (root-commit) c4d5702] first blog commit 57 files changed, 867 insertions(+) create mode 100644 .ds_store create mode 100644 .gitignore create mode 100644 gemfile create mode 100644 gemfile.lock create mode 100644 readme.rdoc create mode 100644 rakefile create mode 100644 app/.ds_store create mode 100644 app/assets/.ds_store create mode 100

c# - TaskBarButton middle mouse button event -

i have taskbar buttons. @ taskbar there lot of events, there 1 event @ click of button. taskbar.buttonclick += new system.windows.forms.toolbarbuttonclickeventhandler(this.taskbarbuttonclick); i need event button press taskbar middle mouse button. something if (e.button == mousebuttons.middle) { messagebox.show("middle"); } only taskbar i know example. did that. problem event taskbar. need event button provided on taskbar e.button not of type mousebuttons . of type toolbarbutton . references location on toolbar clicked, not location on mouse used make click. toolbar button if need handle toolbar button clicked reference this example using toolbarbuttonclickeventhandler works. //add buttons. taskbar.buttons.add(new toolbarbutton()); //index 0 taskbar.buttons.add(new toolbarbutton()); //index 1 //add handler taskbar.buttonclick += new toolbarbuttonclickeventhandler ( this.taskbar_buttonclick); private void

java - How to concatenate seperate digits from a loop into one single integer -

okay have assignment says have string of numbers example "1234 4014 5555 7654" credit card number. asking me convert string of digits single integers concatenate them 4 lots of 4 digit integers string "1234 4014 555 7654" example have 4 blocks block 1 1234 converted 1, 2, 3, 4 concatenated 1234 integer have blocks... :( so far.. made loop shown below : public static int toint(string digitstring) { int answer = 0; int num = 0; (int j = 0; j < digitstring.length(); j++){ num = (int) digitstring.charat(j) - '0'; system.out.println(num); } return answer } and can convert string seperate digits have no idea how can concatenate digits 4, 4 digit integers any appreciated :) i'm not going assignment you, i'll tell hint: need know understand , solve problem integer.parseint(s) string s returns s integer, , s.substring(n, n+1) returns (n+1)st character of string. for example string s = &

ruby on rails - Is there a good pattern for combining ActiveRecord results with API data? -

what best way combine 2 data sets different locations? i have 1 set of data activerecord merge/combine data set api. both data sets have unique id common between them merge based on id , avoid duplicate results. since unifying these data display purposes, it's better use helper arrange data structure view needs it. controller: @model_records = armodel.find_my_scope @api_records = apigem.gather_users helper: def all_users ar_prop_filter = [:username, :first_name, :last_name, :current_project] api_prop_filter = ['ranking', 'postcount', 'username', 'first_name', 'last_name'] # reduce hashes model_set = @model_records.map{|rec| ar_prop_filter.inject({}){|acc, f| acc[f] = rec.send(f)} } api_set = @api_records.map{|rec| api_prop_filter.inject({}){|acc, f| acc[f.to_sym] = rec[f]} } # add api data ar data, using ar key model_set.map! |m_rec| api_set[m_rec[:username]].each |k, v| m_rec[k] = v end

.net - Where are the Assemblies for an ASP.NET Web Site When Running IIS Express -

i know dynamic compilation under asp.net web site, code behind files compiled assemblies. these dll's stored when running iis express? in memory only? don't see them in bin folder, or in temp directory (c:\windows\microsoft.net\framework[64]\v4.0.30319). typically generate them when precompiling them whenever publish. in case, though, don't see them. am missing something? thanks. update: i did see dll's under c:\users\administrator\appdata\local\temp\temporary asp.net files\root so i'm thinking stores them there? visual studio 2012, .net 4.5. please refer this: http://msdn.microsoft.com/en-us/library/e22s60h9%28v=vs.85%29.aspx it should in bin folder. this additional info framework 4.5: http://msdn.microsoft.com/en-us/library/hh475319.aspx

mongodb - gdb breakpoint on base class, but failed -

in mongodb, class cursor defined 'cursor : boost::noncopyable', , there many class derived it. want know given operation client, xxxcursor used. want set breakpoint on cursor::cursor. failed. (gdb) b mongo::cursor::cursor class mongo::cursor not have method named cursor hint: try 'mongo::cursor::cursor<tab> or 'mongo::cursor::cursor<esc-?> (note leading single quote.) make breakpoint pending on future shared library load? (y or [n]) n (gdb) ptype mongo::cursor type = class mongo::cursor : private boost::noncopyable_::noncopyable { public: ~cursor(int); virtual bool ok(void); bool eof(void); virtual mongo::record * _current(void); virtual mongo::bsonobj current(void); virtual mongo::diskloc currloc(void); virtual bool advance(void); virtual mongo::bsonobj currkey(void) const; .... } (gdb) list mongo::cursor::cursor **the class mongo::cursor not have method named cursor hint: try 'mongo::cursor::cursor<tab

javascript - How to make jquery knob readonly using jquery? -

i'm using jquery knob plugin. want make knob readonly on button click. (function() { $(".dial").knob({ 'min':0, 'max':360, 'change' : function(degree){ var img = $(".volume_bttn"); if(radioswitchstate == 1) { img.css('-moz-transform', 'rotate('+degree+'deg)'); img.css('-webkit-transform', 'rotate('+degree+'deg)'); img.css('-o-transform', 'rotate('+degree+'deg)'); img.css('-ms-transform', 'rotate('+degree+'deg)'); var vol = ((degree)/360).tofixed(2); //console.log(vol); $("#jquery_jplayer_1").jplayer("volume",(360-vol)); } }, 'fgcolor' : '#460e09',//460e09 'bgcolor' : "transparent",//transparent 'width' : 107, 'thickness' : 0

java - Bluetooth android server client with a headset -

i'm trying create server on android listen on incoming connections ,such specific headset have. i've read many tutorials, posts in stackoverflow , 1 android|developer , , don't seem understand few things . 1) uuid , specific address each bluetooth device ? or shared key need in server , client in order create connection ? guess latter cause there mac address ... 2) when pair headset phone , headset saves mac\uuid of last paired device ? 3) bluetooth chips works in way ? phone connects paired device turned on, guess opens socket each paired device , waits turn on , true ? 4) possible accomplish im trying ? meaning creating bluetoothserversocket accept connection head set ? code example server side: //this may b needs uuid of headset ? or special 1 ? or ? uuid myuuid = uuid.fromstring("0000111e-0000-1000-8000-00805f9b34fb"); private final bluetoothserversocket mserversocket; private bluetoothadapter mbluetoothadapter = bluetoothadapter.getdefaulta

How could I get two urls by the same request in Ruby? -

i want contents of 'a.com/a.html' , 'a.com/b.html' same request , code is uri = uri.parse("http://www.sample.com/sample1.html") http = net::http.new(uri.host, uri.port) request = net::http::get.new(uri.request_uri) # request.initialize_http_header({"user-agent" => "mozilla/5.0 (macintosh; intel mac os x 10_8_4) applewebkit/537.36 (khtml, gecko) chrome/28.0.1500.95 safari/537.36"}) result = http.request(request).body should change path of request?or other idea? you can't fetch multiple resources @ once, can reuse http connection fetch multiple resources same server (one after another): require 'net/http' net::http.start('a.com') |http| result_a = http.get('/a.html').body result_b = http.get('/b.html').body end from docs : ::start creates connection http server kept open duration of block. connection remain open multiple requests in block if server indicates sup

vb.net - SQLiteConnectionStringBuilder generates an invalid connection string -

i'm trying build valid connection string sqliteconnectionstringbuilder (system.data.sqlite v1.0.88.0) using either datasource or uri: dim connectionbuilder = new sqliteconnectionstringbuilder connectionbuilder.datasource = path.combine(datadir, "mydatabase.sqlite") connectionbuilder.version = 3 ' open connection dim connection new sqliteconnection(connectionbuilder.connectionstring) or: dim connectionbuilder = new sqliteconnectionstringbuilder connectionbuilder.uri = new uri(path.combine(datadir, "mydatabase.sqlite")).absolutepath connectionbuilder.version = 3 ' open connection dim connection new sqliteconnection(connectionbuilder.connectionstring) both generate same connection string: uri=file:///c:/users/myusername/documents/visual%20studio%202010/projects/myproject/myproject/bin/debug/data/mydatabase.sqlite;version=3 the uri valid, connection string looks good, when try open connection, gen

qt4 - showing transparent layout over a layout in Qt 4.8.4 -

i show label having animated gif image on listwidget. listwidget in horizontal widget. when trying put label on window aligned horizontally list widget. want show on listwidget transparent view. qmovie *m= new qmovie("loadingimage.gif"); qlabel *l=new qlabel(); ui.mainlayout->add l->setmovie(m); m->start(); l->show(); don’t add transparent widget layout. set window transparent widget’s parent show widget. you’re responsible positioning , resizing transparent widget cover list widget.

javascript - How to convert my Array of data to key & value pair -

i have array this. my array= partnernumber,1044,firstname,rob,rank,302 i represented key , value pair [1]partner number - 1044 [2]first name - rob [3] rank -302 i need post array data , form query on server side control. thanks in advance in modern web browsers, can use useful array.foreach function: var array = ["partnernumber",1044,"firstname","rob","rank",302]; var dictionary = {}; array.foreach(function(item, index) { if(index % 2 === 0) { dictionary[item] = array[index + 1]; } }); document.write("partner number:" + dictionary.partnernumber); try on jsfiddle: http://jsfiddle.net/6dzvb/

cucumber - Clearing all cookies in Watir Webdriver -

in order make test run faster decided open , close browser once. clearing cookies between scenarios. alister scott described here http://watirmelon.com/2012/04/01/five-page-object-anti-patterns/ hooks.rb: browser = watir::browser.new :firefox before @browser = browser end at_exit browser.close end after @browser.cookies.clear end but problem tests checking redirection anothersite.com , @browser.cookies.clear clearing cookies anothersite.com . how clear all cookies without closing browser? at time temporarily (i hope so) add after('@sometag') @browser.goto 'mysite.com' @browser.cookies.clear end try clearing cookies on main browser object , not copy of working with. @browser.cookies.clear becomes browser.cookies.clear . got feeling solve problem.

matlab parfor with arrayfun (sliced variable) -

as title says, want have parfor loop inside usage of arrayfun. created minimal working example problem: having following lines in file called thisparfortest.m function test=thisparfortest(countmax) parfor count=1:countmax test(count).nummer=count; test(count).bisdrei=arrayfun(@(testnum)eq(test(count).nummer,testnum),1:3); end the command mcc('-e','-v','thisparfortest') results in compiler version: 4.18.1 (r2013a) error: file: **************\thisparfortest.m line: 3 column: 5 variable test in parfor cannot classified. see parallel loops in matlab, "overview". processing c:\program files\matlab\r2013a\toolbox\matlab\mcc.enc processing include files... 2 item(s) added. processing directories installed mcr... file mccexcludedfiles.log contains list of functions excluded ctf archive. 0 item(s) added. generating matlab path compiled application... created 43 path items. parsing file "****************\thisparfortest.m&quo

c# - HasMany gives null children -

i'm having trouble defining tree in fluent nhibernate. i've done other hasmany relationships before not self referencing this. no matter try, children == null . entity: public class stockcontainer { public virtual guid id { get; set; } public virtual string name { get; set; } public virtual stockcontainer parent { get; set; } public virtual ilist<stockcontainer> children { get; set; } public virtual void moveto(stockcontainer outercontainer) { parent = outercontainer; } } fluent nhibernate mapping: public class stockcontainermapping : classmap<stockcontainer> { public stockcontainermapping() { table("stockcontainers"); id(x => x.id); map(x => x.name).unique(); references(n => n.parent).lazyload().nullable(); hasmany(n => n.children).keycolumn("parent_id").where(x => x.parent.id == x.id); } } generated table: create table st

image - Problems with imshow update -

why image in figure (ploted imshow ) changing size when updated imshow ? demonstrational code: img = rand(100,100); figure(1); hold on; imshow(img); % plot image pause(1); % pause demonstrational reasons imshow(img); % update image this happening @ first update. figure(1); takes default size , when plot imshow(img) after hold on size gets reduced relative previous figure(1) size. better approach be img = rand(100,100); figure, imshow(img); % plot image hold on; pause(1); % pause demonstrational reasons imshow(img); % update image

node.js - Issue installing npm on my Win7 Machine -

Image
i trying install weinre on win7 machine per instruction given in link http://forums.adobe.com/docs/doc-2623 note: might behind firewall. i installed node.js and then tried install weinre via npm. fails following error please me in installing weinre can go on. thanks in advance help. there several things can find out problem: do nslookup of registry.npmjs.org find out if address can resolved check network settings find out if there proxy configured if so, configure npm use proxy. how can this: npm config set proxy http://proxy.company.com:8080 npm config set https-proxy http://proxy.company.com:8080 credits go https://stackoverflow.com/a/12832637/52568 .

Unexpected result when calling C# code in Node.js -

so have small node.js webserver uses edge.js connect c# written dll. in our c# code(which class library) calling method performs query neo4j. if test in console app, works fine, when run node.js following exception: system.aggregateexception: 1 or more errors occurred. ---> system.typeinitiali zationexception: type initializer 'friendlibrary.api.searching' threw exception. ---> system.nullreferenceexception: object reference not set instance of object. @ friendlibrary.api.searching..cctor() --- end of inner exception stack trace --- @ friendlibrary.api.searching..ctor() @ startup.<<invoke>b__1>d__4.movenext() --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernot ification(task task) @ startup.<<invoke>b__0>d__6.movenext() --- end of stack trace previous location e

php - How to create a key(like FBAppid) automatically for registration? -

i need create auto generated key , send through mail registration process.the key should have atleast 50 characters(like facebook appid) length , must unique . using php technology , mysql data base. i new php , need help. for 50 chars , cryptographically safe string use. openssl_random_pseudo_bytes(50);

iphone - Handling Local Notification in objective C -

i working on iphone app store local(and push) notifications app. there screen on app shows notifications generated app. question can iphone app know when local notification app shown. example, suppose local notification shown, user ignores notification, , not tap on it, in situation, can app somehow find out if local notification shown , processing on it(for example, store notification data in sqlite database). i have tried both " didfinishlaunchingwithoptions " , " didreceivelocalnotificatios ", understanding, invoked when user laucnhes app tapping on notifiaction, there method can have notification data when user not tap on notification. tldr; can iphone app handle(process) local notifications when user not launch app tapping notification. no, app wan't notification whcih user has ignored. app notified when user presses view or tap on notification.

PHP - variable scope inside if statement and while loop -

i know if statement gives result boolean. <?php if (isset($_get['subj'])) { $sel_subj = $_get['subj']; $sel_page = ""; ?> can use $sel_subj or $sel_page outside if statement ? second question in case of while loop ? can use variable outside or considered in local scope ? while ($page = mysql_fetch_array($page_set)) { echo "<li"; if ($page["id"] == $sel_page) { echo " class=\"selected\""; } echo "><a href=\"content.php?page=" . urlencode($page["id"]) . "\">{$page["menu_name"]}</a></li>"; } basically yes, variables defined inside if or while available in scope if or while exists in (as defined in conditional though might not have been set receive undefined warning) so function foo(){ $i=0

ruby - resque @queue variable returns nil during the test environment but within development it works -

in development: 1.9.3p429 :001 > auction::riskprofile.instance_variable_get(:@queue) => :low_priority 1.9.3p429 :002 > resque.queue_from_class(auction::riskprofile) => :low_priority 1.9.3p429 :003 > resque.enqueue(auction::riskprofile) => true but in test environment: resque => resque client connected redis://127.0.0.1:6379/0 auction::riskprofile.instance_variable_get(:@queue) => nil resque.queue_from_class(auction::riskprofile) => false resque.enqueue(auction::riskprofile) resque::noqueueerror: jobs must placed onto queue. from /home/bharani/desktop/catawiki-bundle/ruby/1.9.1/gems/resque-1.24.1 /lib/resque.rb:348:in `validate' i don't know whats difference between development , test environments. please explain one

symfony - Doctrine2 / Symfony2 - Multiple entities on same table -

in symfony2 application have mainbundle , distinct bundles can enabled or not. in mainbundle need have model , basic entity . in otherbundle entity same table name entity in mainbundle . fixtures in mainbundle need loaded or without other bundles mainbundle : mainbundle - model - entity (table name "test") - fixtures otherbundle - entity (table name "test") - fixtures otherbundle2 - entity (table name="test") - fixtures if used @orm\mappedsuperclass model , @orm\entity entity in mainbundle , @orm\entity in otherbundle doctrine2 stop error "table exists". i cant use inheritance table model dont need know other entities in other bundles. @orm\discriminatormap cant point otherbundle . is there way ? as mentioned jasper n. brouwer it's esentially same entity , same table, there no point in doing you're trying do. create entity in bundle named example "sharedentitybundle" , use resolve_target