Posts

Showing posts from August, 2012

vim - dbext seems to think ( is a sql statement terminator -

i have in .sql file in buffer: create table wh.dbo.customer( id integer not null, cust_name varchar(30) not null, phone_nbr varchar(30) null, primary key(id) ); if in normal mode , cursor on table sould able hit either <leader>se or command gvim :dbexecsqlundercursor , statement should executed dbext should find create , ; , execute script in between. following message: last sql: create table whanalysis.dbo.customer( if highlight script , choose execute sql (visual selection) plugin menu runs fine. what going on? setting in _vimrc ?: set nocompatible source $vimruntime/vimrc_example.vim source $vimruntime/mswin.vim behave mswin set diffexpr=mydiff() " use ctrl-s saving, in insert mode :nnoremap <c-s> :<c-u>update<cr> :vnoremap <c-s> :<c-u>update<cr>gv :cnoremap <c-s> <c-c>:update<cr> :inoremap <c-s> <c-o>:updat

java - Subclipse not uploading JRE -

i'm having bit of trouble making subclipse work. i've got working proyect in local computer , i'm trying upload svn. went great, except when other developers check out proyect gets downloaded without jre system library complete proyect shows exclamation mark. how can fix this? thanks! the jre system library entry pointer locally installed jre. if use absolute path library, should change include execution environment, every developer can configure execution environment local path of jre.

jquery loop function; hide div if -

i working on new website (music magazine) , need use handy function; have rough idea how cannot code work. in review section want display 1 main cd review , other cds mentioned titles in sidebar div. don't want main display cd listed in sidebar @ same time. trying write jquery function hide title sidebar matches main display cds title. i guess idea create if function here: if (main cd title) == (sidebar cd title) hide (sidebar contains cd title); has loop through elements automatically. below sample of code affected: html: <div class="grid_12 alpha omega upper2" title="vil"> <div class="grid_8 upper alpha omega" id="vil"> grid_12 main cd , grid_8 sidebar title cd jquery bit: if($('.grid_12').attr('title') == $('.grid_8').attr('title')) { $('.grid_8').attr('title').hide(); } the jquery code wrong idea how wanna it. the suggestion putting unique ids array quit

c - Determining button boundries with terminal IO in non-canonical mode -

i'm trying understand how terminal i/o works. when terminal placed in non-canonical mode (missing error handling): struct termios term_original, term_current; tcgetattr(stdin_fileno, &term_original); term_current = term_original; term_current.c_lflag &= ~(icanon | isig | iexten | echo); term_current.c_iflag &= ~(brkint | icrnl | ignbrk | igncr | inlcr | inpck | istrip | ixon | parmrk); term_current.c_oflag &= ~(opost); term_current.c_cc[vmin] = 1; term_current.c_cc[vtime] = 0; tcsetattr(stdin_fileno, tcsadrain, &term_current); a simple read loop can read in data generated each button press so: char c; while (read(0, &c, 1) != -1) { print_char(c); } now, pressing esc on keyboard generates: 0x1b. pressing f1 generates: 0x1b 0x4f 0x50. pressing f5 generates: 0x1b 0x5b 0x31 0x35 0x7e. in terms of reading , processing input, how 1 determine output 1 button press ends , next 1 begins? find no discernible pattern, , fact esc generates single

c# - loading data into datagridview from List<> customerlist -

i need populating datagridview . when debug can see has records, not shown in datagridview . here code (mind newbie in c#): private void listcustomer_frm_load(object sender, eventargs e) { datagridview custdgv = new datagridview(); customerlist = customerdb.getlistcustomer(); custdgv.datasource = customerlist; cm = (currencymanager)custdgv.bindingcontext[customerlist]; cm.refresh(); } you're creating datagridview @ function scope , never add container. since nothing has reference it, disappears function exits. you need this: this.controls.add(custdgv); // add grid form display before function finishes. this: private void listcustomer_frm_load(object sender, eventargs e) { datagridview custdgv = new datagridview(); this.controls.add(custdgv); // add grid form display customerlist = customerdb.getlistcustomer(); custdgv.datasource = customerlist; cm = (currencymanager)custdgv.bindingcontext[customerlist]; cm.refresh()

sublimetext2 - Ignoring single line marked as incorrect by Sublime CodeIntel -

i'm using sublime python project. have dictionary comprehension so: inv_map = {v:k k, v in map.items()} codeintel marking "invalid syntax" error, correct , runs without trouble. how can tell codeintel ignore specific line? dictionary comprehension (feature using) python 2.7+. inv_map = {v:k k, v in map.items()} internally sublimelinter runs python command line programs called pep8 (pep8 package name pep-8 guideline checks , pyflakes. due architecture of sublimelinter, running them may limited python 2.x targets, python version embedded sublime text. relevant sublimelinter source code here: https://github.com/sublimelinter/sublimelinter/blob/master/sublimelinter/modules/python.py the error in question can come pep8 or pyflakes. pyflakes not offer documentation how make ignore lines. not possible, suggestion in answers of question how pyflakes ignore statement? not use pyflakes. https://pypi.python.org/pypi/pyflakes pep8 offers glo

Android ListView "recycle" doesn't store rows which are not visible initially -

there maybe thousands of posts around web listview , listadapter recycle process couldn't solve problem far. i have custom listview rows , populate items inside rows (textviews, imageviews, etc.) data remote server. screen can show 5 rows maximum @ time , have scroll if have more rows. problem is; adapter stores , recycles first 5 rows' information , if scroll see 6th, 7th, 8th, etc. rows see same 5 rows again , again @ random positions. here code: public class listadapter extends baseadapter { private arraylist<string> id, name, address; private context context; public listadapter(context c, arraylist<string> id, arraylist<string> name, arraylist<string> address,) { this.id = id; this.name = name; this.address = address; this.context = c; } @override public int getcount() { return id.size(); } @override public object getitem(int position) { retu

java - Error with listview in dialog -

i have been on error while. trying open list view in dialog not opening me code. logcast <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.mybasicapp" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="15" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name=".slashscreen" android:label="@string/title_activity_main" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </a

javascript - Function to modify object in arguments, not just a property -

i'm sure has exist somewhere haven't been able find it... i'm trying write function takes object argument , updates reference. not property of reference, , not reassign object, update whole reference. note pubsub in there demonstrate need asynchronicity , flexibility in types of objects passed in , updated. best explained example: //ideally how function work function watch(event, obj) { pubsub.on(event, function(model) { // want update entire object // understand currently, reassigning // know can obj.prop = model, that's not want obj = model; } }; //example usage var myobj = {"name" : "tom"}; watch("anevent", myobj); console.log(myobj.name); //still "tom" // time passes, somewhere pubsub.trigger("anevent", {"name" : "john"}) console.log(myobj.name); // should read "john" is sort of scenario bind() method, e.g. $.bind() or currying u

Location and document path in nginx -

this nginx configuration file: server { listen 80; server_name localhost; location / { root d:/www; index index.html index.htm; } location /js/api/ { root d:/workspace/javascript/maplib/; autoindex on; } } and directory of document this: d:/workspace/javascript/maplib -- v1.0 --main.js -- v1.1 now want access v1.0/main.js http://localhost/js/api/v1.0/main.js . and return 404 error. it seems ngnix tried file through d:/workspace/javascript/maplib/js/api/v1.0/main.js not exist. it seems string path in locaation (in url) must exist @ file system. how fix meet requirement? btw, there not js other kinds of files .gif,.png,.html inside d:/workspace/javascript/maplib/ . use alias . ref: http://nginx.org/en/docs/http/ngx_http_core_module.html#alias that is, replace root d:/workspace/javascript/maplib/; by alias d:/workspace/javascript/maplib/;

c# - How to change label text with click event -

i have label in called "lblnotify" in site.master(asp.net). *<div class = "notification"> <asp:label id="lblnotify" runat="server" text ="0 "></asp:label> </div>* and in code behind file, have method supposed replace text of "lblnotify" another. *public void notificationmanager() { try { string = lblnotify.text; = + "new"; lblnotify.text = ; label1.text = (i); } catch (exception er) { response.write("exception occured: " + er); } }* notificationmanager triggered in submit button in class *protected void btnsubmit_click(object sender, eventargs e) { appsite call = new appsite(); call.notificationmanager(); }* but gives me error object reference not set instance of object

vb.net - How can I click on a button without an ID -

i'm using vb.net , i'm using webbrowser1.document.getelementbyid("submit").invokemember("click") but can't seem find actual id. i'm trying find sign in button id site: http://grooveshark.com/#!/login any solutions? you can buttons this webbrowser1.document.getelementsbytagname("button") it might easier submit form instead. dim form htmlelement = webbrowser1.document.getelementbyid("formid") if form isnot nothing form.invokemember("submit") end if

c++ - Two General CS Questions -

this question has answer here: what effective way float , double comparison? 24 answers when comparing 2 "real" numbers equality, why should not use == operator, , should use instead? what difference between coersion , casting? general assumption casting when force value of type so: int n = 9; return double(n)/5; to answer first question directly: “[why] should not use == operator”? answer because earlier operations have produced rounding errors, , is, in general, impossible compute correct result of function applied incorrect data. if have computed values x , y model exact mathematical values x , y , x , y have been affected rounding errors, there no function of x , y tells whether x equals y . this means impossible compute whether x equals y in these circumstances. not == operator problem. ( == in fact 1 of few floating-point

How to get the parents siblings content Jquery -

below, code. goal is, when user clicks <a> tag in 'siblings_2'. want alert 'hello' in 'sibling_1' content. how can achieve this? <div class="parent"> <div class="sibling_1"> <div class="selections"> <p>hello</p> <p>how you?</p> </div> </div> <div class="sibling_2"> <a href="">click me!</a> </div> </div> you have various ways achieve , 1 way is: $("div.sibling_2 a").click(function(e) { e.preventdefault(); var text = $(this).parent().prev().find("div.selections p:eq(0)").text(); alert(text); }) demo

flex - MXML - Create combobox dynamically on click of button -

need on creating combo box dynamically in flex. how create combobox dynamically on click of button. thanks in advance. for example: public function createcombobox_clickhandler(event:event):void { var mycombobox:combobox = new combobox(); var comboboxdataprovider:arraycollection =new arraycollection([ { name: "box1", value: "value1"}, { name: "box2", value: "value2"}, { name: "box3", value: "value3"}, { name: "box4", value: "value4"} ]); mycombobox.x = 100; mycombobox.y = 100; mycombobox.dataprovider = comboboxdataprovider; mycombobox.labelfield = "name"; mycombobox.addeventlistener(listevent.change, mycombobox_clickhandler); container.addelement(mycombobox); } public function mycombobox_clickha

Bulk Insert into SQL Server from text file adding a uniqueidentifier, or skipping a column -

i need take rows text file , insert table. rows of file similar following: string1 string2 string3 string4 ... my table has 2 columns: uniqueidentifier, stringvalue i bulk insert table grabbing each row text file , adding new uniqueidentifier each 1 (ideally guid, integer counter fine). anyone have tip on how bulk upload? far sql is: bulk insert tablenametoinsertinto 'c:\importlist.txt' ( rowterminator = '\n' ) go try 1 - values: c:\importlist.txt -> string1 string2 string3 string4 format file: c:\importlist.fmt -> 11.0 1 1 sqlchar 0 100 "\r\n" 1 text "" query: create table dbo.testbulk ( rowuid uniqueidentifier default newid() , value varchar(100) ) insert dbo.testbulk (value) select c.[text] openrowset( bulk n'c:\importlist.txt', formatfile = 'c:\importlist.fmt' ) c

html - Building a fluid horizontal navigation -

i'm trying build horizontal navigation using %'s, , cant seem figure out whats going on. have set how want it, whenever specify size or li nothing changes, , therefore, can see silver of background image. <div id=mainwrap> <div id=header> <div id = title> <img src="images/hangaquilt.png" width="483" height="78" alt="hang quilt"> </div> <div id = cartstatus> <p> cart empty </p> </div> <div id=nav> <ul> <li><a href="#">home</a></li> <li><a href="#">products</a></li> <li><a href="#">contact us</a></li> <li><a href="#">view cart</a></li> <li><a href="#">dealers</a></li> </ul> </div> </div>

c# - how reference member comment in Sandcastle -

code sample : //<remarks> // <see cref="class2.dosomething(object)" /> //</remarks> public class class1 { } public class class2 { //<summary>do ...<summary> public void dosomething(object obj) { ... } } i need class1 "remarks" content contain "summary" of class2.dosomething . use include tag put common documentation in separate file.

android - Cannot Disable Broadcast Receiver -

i got logic disable/enable broadcast receiver here . @override public void oncheckedchanged(compoundbutton v, boolean checked) { // todo auto-generated method stub if (v == disableblock) { manageblocksetting(checked); } } private void manageblocksetting(boolean disable) { log.e(tag, "disable : " + disable); int flag = disable ? packagemanager.component_enabled_state_disabled : packagemanager.component_enabled_state_enabled; componentname component = new componentname(settingactivity.this, phonecallreceiver.class); getapplication().getpackagemanager().setcomponentenabledsetting(component, flag, packagemanager.dont_kill_app); editsharedpreferences(storeconstantvalue.setting_disable_block, disable); } and in manifest.xml <receiver android:name="com.vsmart.unocaller.blockingservice.phonecallreceiver" android:enabled="true" >

iphone - Create a View Controller and access labels in iOS -

i have several xibs in have same status bar. status bar composed of view object , in several labels. in spirit of dry, i'd create uiviewcontroller take care of populating status bar, , not repeat in each view controller. from limited ios dev knowledge, best path create subclass (maybe called statusbarviewcontroller) inherits uiviewcontroller, , in interface builder indicate view of class statusbarviewcontroller. in statusbarviewcontroller code, override viewdidload populate labels. my question is, how list of labels within view controller code? better create labels code or ib? (which copy/pasting 1 xib rest). am missing approach? there better way? thanks! what can try in case : create viewcontroller status bar , empty view below covering rest of area use placeholder view other view controllers (say view a) now show viewcontroller add controller on subview like [a addsubview:anotherviewcontroller.view]; and remove [anotherviewcontroller.view rem

python - Django + Postgres Timezones -

i'm trying figure out what's going on timezone conversion that's happening in django. my view code below, filters on date range , groups on day of creation: def stats_ad(request): start_date = datetime.datetime.strptime(request.get.get('start'), '%d/%m/%y %h:%m:%s') end_date = datetime.datetime.strptime(request.get.get('end'), '%d/%m/%y %h:%m:%s') fads = ad.objects.filter(created__range=[start_date, end_date]).extra(select={'created_date': 'created::date'}).values('created_date').annotate(total=count('id')).order_by("created_date") the sql query produced django when set variable of start "01/05/2013 00:00:00" , request end variable "11/05/2013 23:59:00": select (created::date) "created_date", count("ads_ad"."id") "total" "ads_ad" "ads_ad"."created" between e'2013-05-01 00:00:00+1

jquery - multiple Facebook Send Buttons and titles not working + Ruby on Rails -

i have list of partials each include facebook send button addthis. issue i'm running this: facebook send button allows pass in parameter url want show, own of title of page on. specify title of facebook link gets sent whatever want, rather looking @ title in header of layouts/application.html.erb file. each partial in list intended have unique title , url page designated item solely. have 2 specific questions, , welcome advice on subject beyond scope of these questions: question 1: is bad idea, in general, have more 1 facebook send button on page? due issue i'm having, i've assumed intention button used once per page title lookup makes little more sense. way you'd have provide title using content_for helper each page or something. however, still have twitter button , email button each partial well. expensive (too load page, initially)? question 2: would bad idea attempt change title of page every facebook send action purpose of sending correct title

java - Round down a DateTime based on a given Period using Joda-Time -

given period such 3 days, or 5 weeks (a period 1 field type), want round given datetime nearest unit of period (i.e, ignore 5 in '5 days'). examples: example 1: period: 3 days. datetime: wednesday 4:26 utc (2013-05-15t04:26:00z) rounded datetime: wednesday midnight utc (2013-05-15t00:00:00z) example 2: period: 5 weeks. datetime: wednesday 4:26 utc (2013-05-15t04:26:00z) rounded datetime: monday midnight utc (2013-05-13t00:00:00z) my initial idea use period 's durationfieldtype getfieldtypes() method, , every matching field in datetime (below largest field), set them zero. however, don't know how datetimefieldtype s datetime , how compare them durationfieldtype . i prefer not huge if else approach. example bellow solution in case can express period in days (can modified weeks, months etc.). using datetime joda java library. unfortunately rounding require see possible issue. need have starting point in time since when

c++ - Saving a stream while playing it using LibVLC -

using libvlc , i'm trying save stream while playing it. python code: import os import sys import vlc if __name__ == '__main__': filepath = <either-some-url-or-local-path> movie = os.path.expanduser(filepath) if 'http://' not in filepath: if not os.access(movie, os.r_ok): print ( 'error: %s file not readable' % movie ) sys.exit(1) instance = vlc.instance("--sub-source marq --sout=file/ps:example.mpg") try: media = instance.media_new(movie) except nameerror: print ('nameerror: % (%s vs libvlc %s)' % (sys.exc_info()[1], vlc.__version__, vlc.libvlc_get_version())) sys.exit(1) player = instance.media_player_new() player.set_media(media) player.play() #dont exit! while(1): continue it saves video stream file example.mpg . per this doc, command save stream : --sout=file/ps:example.mpg which i'v

iphone - uploading to App store using Application loader then get error? -

Image
we trying upload updated version of app store. upload takes long time , when done, receive following warnings. ... checksum validation failed. ... checksum validation failed. transporter unable update 1 or more software components. please try again later. the upload anyway received apple server , status says "waiting review".! try reject , resend binary , worked me.

javascript - How to refactor directive code in angularJS -

i coming .net world may missing obvious in javascript world in angularjs . writing few directives , have same kind of code need setup same attributes. is possible create function , use function inside link function of angular? thanks ofcourse, not hard javascript. here example code that. (function(){ function commoncode(){ //common code goes here. } var app = angular.module("app"); app.directive("first",function(){ return function(scope,element,attrs){ commoncode(); } }); app.directive("second",function(){ return function(scope,element,attrs){ commoncode(); } }); app.directive("third",function(){ return function(scope,element,attrs){ commoncode(); } }); })(); and easier angularjs. if common code extremely generic, refactor out commoncode service , inject directives .

api - Wordpress Login Customization for External Authentication -

i'm not sure approach best situation need tie admin login external source. mean, wp is: wp-admin ---> check wp database ---> authenticate now need put additional tier, in between: wp-admin ---> check wp database ---> check external api (true/false) ---> authenticate means, need put additional authentication layer in between (similar logic like, apply ldap authentication module) in case own api in-between. so in wp, where/which user/core file handling final true/false call returns in traditional login concept? where need go , make core hack or modification please? you can use wordpress soap authentication plugin . however, make work, need convert external auth service soap-compliant. alternatively, can create own wp plugin based on one, check external source using else soap.

Use communication channel in Wind River VxWorks Simulator -

i have host pc , target hardware. on host pc, have .net application , on target have real time process, target , host communicates using ethernet channel. what want run real time process on vxsim. is there way make process (running on vxsim) communicate .net application runs on same pc. p.s. use vxworks 6.6 , workbench 3.0 you can run vxsim on windows machine , communicate on ip using simnet. see vxworks simulator userguide how set up.

c# - Office Open XML SDK - good Introduction? -

i writing program modifies powerpoint files via office automation. painfully slow , error prone attempting move functionality office open xml sdk. read introductory texts microsoft, lacking understand how whole format works. interested in boundary between excel , powerpoint - planning update charts via office open xml. here link downloadable copy of open xml explained . for updating charts, this docx4j code may of interest; shows how using docx4j; worst case, can translate each step c#/open xml sdk.

oracle - Issues when user input data in sql command -

i have batch files when run calls sql file. sql file prompts user input data store in myperiod( accepts date input ).the output of sql file csv file. here code sql file: prompt enter period accept myperiod prompt 'period: ' set linesize 500 feedback off trimspool on termout off head off pagesize 0 term off spool e:\abc\test\file1_&myperiod.csv select account || ',' || membername || ',' || group || ',' || future1 actual_v@uat1_test key=21 , period_name= '&myperiod' ; spool off exit my queries : when run , file gets generated in location e:\abc\test name file1_12-2012csv.lst. want csv file . if hard code file name(replace &myperiod test) file1_test.csv gets generated perfectly.why code not able create file name user has input..? the output of creates csv file , retrieves accounts db prints 2 line @ top. new query , old query. how redefine code, gets remove automatically. appreciate guys. substitution variab

comet - Jmeter with ZK framework -

i need load test on application built on zk framework. when record script performs below action a. user login b. select role c. open , create record d. log out. when run script multiple users 10 users scripts create 10 records in application. after random duration 4-5 hours later same script not create record though requests shown passed. script records comet request (ajax push) i not able figure out reason. read explains how ids work : http://books.zkoss.org/index.php?title=small_talks/2012/january/execute_a_loading_or_performance_test_on_zk_using_jmeter http://blog.zkoss.org/index.php/2013/08/06/zk-jmeter-plugin/

c# - Farseer physics mass/weight issue -

i have created platformer game using farseer physics player , objects etc having problem mass on objects. the player composed wheel , torso connected joint , works when not setting mass on object. not using mass creates unstable simulation because when changing texture on object, mass increase or decrease strangely. when assigning correct mass , density nothing works supposed , don't know why. increase force , such correspond new weight on stuff when moving player slides , forth , kind of bounce sideways when stopping. , when picking object hacks on screen. so know solution cause i'm stuck? the thing have found far mass of body in farseer physics calculated density of fixtures. hence weight increase/decrease when changing texture. can't work when manually assigning weight. taken box2d manual: the fixture density used compute mass properties of parent body. density can 0 or positive. should use similar densities fixtures. improve stacking stabi

c++ - How to Expose Boost::shared_ptr<T> to Tcl + SWIG interface file? -

i want expose boost::shared_ptr tcl layer using swig. don't know expose this. found out swig/lib folder contains interface file shared_ptr.i . in content found out not use directly. has included after " boost_shared_ptr.i ". there nothing boost_shared_ptr.i in " swig/lib/tcl " folder have similar interface include in java. when last tried there not support boost/shared_ptr in of swig. python had best coverage. interested hear if has changed. as far other experience swig need instantiate template using %template each type want expose.

android - Facebook authentication in Samsung -

i using facebook sdk posting timeline in application. it's working fine on google nexus, motorola. when comes samsung s3 following error: this app has no android key hashes configured, configure app key hashes @ http://developers.facebook.com/apps i don't understand why getting on samsung s3. you need obtain hash key or if have obtain configure first below link obtain , configure hash keys. register package , activity facebook using this link http://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/ check step no 6 configure hash key

c# - How can I mark Mail as read in MS Outlook2010? -

i developing application, in need read content (mail body) of incoming mail. this, using below code trigger event, every time when new mail comes - outlookapp.newmailex += new applicationevents_11_newmailexeventhandler(mailextractor.outlookapp_newmailex); i using ms outlook2010? how can mark mail read going through application? you need set unread property of outlook mailitem http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._mailitem.unread(v=office.14).aspx

ios - NSSortDescriptor - Sort descriptor based on another array -

Image
i hava core data application. , want fetch 1 kind of object, user . user have property userid . i have array userid s, [1, 4, 3, 5] . , create nssortdescriptor sorts user objects based on order of userid s in array. is possible, , how should that? update i have tried following. i added transformable property user object, store user ids array. i have tried following sort descriptor: sortdescriptor = [[nssortdescriptor alloc] initwithkey:@"userid" ascending:yes comparator:^nscomparisonresult(id obj1, id obj2) { nsuinteger idx1 = [self.user.followingids indexofobject:[obj1 valueforkey:@"userid"]]; nsuinteger idx2 = [self.user.followingids indexofobject:[obj2 valueforkey:@"userid"]]; return idx1 - idx2; }]; and i'm getting following error: serious application error. exception caught during core data change processing. bug within observer of nsmanagedobjectcontextobjectsdidchangenotification. [<__nscfnumber

astronomy - How to get positions of stars in the night sky using Google map Sky API -

after viewing documentation of google earth sky api , know using can render night sky. however, can know exact positions , names of stars? furthermore, can enumerate stars in sky? i not know if google sky api has catalog of stars in sky; not make sense maintain kind of resource because there astronomical catalogs very well. many of these astronomical archives have apis. if want work within google sky framework try looking @ kml file primary astronomical database of objects: http://cdsweb.u-strasbg.fr/googlesky-pages/simbad.kml they created while ago, , have not confirmed continues function optimally. stars brought down based on tile , magnitude.

mysql - Getting all the records from Patient entity with primary insurance of the patient can be 'P' that is primary -

i want following sql query in jqpl syntax: select p.*,pin.insurance_company_id patient_insurance pin right join patient p on (pin.patient_id = p.id , pin.insurance_type = 'p' , pin.status = 'a') p.status = 'a' please help. try this: select p.id, p.lastname, p.firstname, p.middlename, p.dob, p.sex, p.ssn, p.phone, p.status, pi.insurancecompanyid , if(pi.insurancetype ='p' , 'is p', 'is not p') patientinsurance pi right join patient p on pi.patientid = p.id or if want records have pi.insurancetype ='p' can append query : where pi.insurancetype ='p'

Appending an DOM/SVG element with the d3 javascript library changes variable reference/scope, why? -

i noticed mixed results when append dom/svg elements existing object inline , in separate step when using d3 javascript library. if @ variable referencing original svg object changes, when object appended during creation of original object. here example: var body = d3.select("body"); var svg = body.append("svg") .attr("width", '100%') .attr("height", '100%') var html1 = svg.append("foreignobject") .attr("x", 50) .attr("y", 25) .attr("width", 200) .attr("height", 100) .attr('id', 'fo1') .append("xhtml:div") .html("lorem ipsum dolor sit amet, consectetur adipiscing elit. donec eu enim quam. lorem ipsum dolor sit amet, consectetur adipiscing elit. donec eu enim quam. lorem ipsum dolor sit amet, consectetur adipiscing elit. donec eu enim quam. lorem ipsum dolor sit amet, consectetur adipiscing elit. donec eu eni

javascript - Developing reporting engine in nodejs -

this may little clean , green, hoping report reporting engine similar jasperjs on js. reporting meaning: defining reports built-in "renderers" entering of chart data in standardised format building simple api, allowing creation of chart exports would appreciate rough gauge of difficulty level. , advice if should propose django opposed nodejs. this first job after graduation @ college , take can get. thanks reading. good reading: node vs python creating restful webservices http://www.brandttechnologies.com/papers/121106f_2012141_using_node_in_reporting_system.pdf if you're looking reporting engine similar jasper reports runs on top of node.js, i'm not aware of any, if you're looking create yourself, advise difficult , time consuming write full reporting engine, if want so, should take @ jasper reports source code, , project partially implements jasper reports on php .

javascript - jqGrid 4.4.5 Grid column width rendering issue in Chrome -

i'm developing jqgrid 4.4.5 fir first time , i've run old bug fix found in past versions, i'm developing jquery 1.9.1 , jqueryui 1.9.2 well. the original issue , fix posted here . i'm getting same trouble new versions of these plugins, familiar jquery 1.9 know $.browser has been deprecated. makes previous solution unusable. similar solution, or @ least jqgrid 4.4.5 equivalent of code in new version of plugin? note: add maybe not mentioned before, issue recreate-able setting browser zoom 90% or smaller. @ 100% zoom renders correctly, less 100% gives trouble. (i need rendering @ 90% zoom). note: have switched 4.3.1 test old fix applied , worked perfectly, seems old trouble chrome me. thanks in advance , effort in helping me trouble. kind regards, pieter. you can make same condition here $.browser in jquery 1.9 using following code , use same solution posted in link you can check browser condition using below code. jquery.uamatch = fu

c# - NewMailEx event is not firing for each mail? -

i developing application, in need read content (mail body) of incoming mail. this, using below code trigger event, every time when new mail comes - outlookapp.newmailex += new applicationevents_11_newmailexeventhandler(mailextractor.outlookapp_newmailex); but newmailex event not firing few mails. seems it’s not firing when 2 or 3 mails come @ same time. theoretically should fire each mail comes in ms outlook inbox. using ms outlook 2010. how can assure triggering of newmailex event each , every mail coming? according documentation "this event (newmailex) passes list of entry ids of items received in inbox since last time event fired". if tested , doesn't that's count. using itemadd not best choice may not fire on each mail can read in documentation . works on per folder basis if user has server rules moves mail different folder need handle multiple folders. my solution to similar requirement using redemption library store class has onme

c++ - std::remove_if using other class method -

i want use std::remove_if predicate member function of differenct calss. that is class b; class { bool invalidb( const b& b ) const; // use members of class verify b invalid void somemethod() ; }; now, implementing a::somemethod , have void a::somemethod() { std::vector< b > vectorb; // filling elements // want remove_if vectorb based on predicate a::invalidb std::remove_if( vectorb.begin(), vectorb.end(), invalidb ) } is there way this? i have looked solution of idiomatic c++ remove_if , deals different case unary predicate of remove_if member of b and not a . moreover, not have access boost or c++11 thanks! once you're in remove_if , you've lost this pointer of a . you'll have declare functional object holds it, like: class isinvalidb { const* myowner; public: isinvalidb( const& owner ) : myowner( owner ) {} bool operator()( b const& obj ) { return myowner->invalidb

android - Accessing local web service in .net on tablet -

i have used simple asp .net web service in project through add new item->web service. want use web service android application installed on tablet. using web service on same pc giving 10.0.2.2:49440/secondtest/webservice.asmx url when need run on device replaced http://192.168.1.4:49440/secondtest/webservice.asmx not working me. not accessible. can me please?

django - Filter over queryset with a loop -

i have inital queryset , loop on this stats = {} queryset = item.objects.all() sub in subject.objects.all(): stats[str(sub.id)] = queryset.filter(subjects=sub.id).count() how can without hit db often? look django aggregation : from django.db.models import count stats = subject.objects.annotate(count=count('item')) now each stats object have count field: stats[0].count

javascript - sort array multidimensional ! three level -

i want 3 level sort each asc or desc. for example: 1st sort age(asc),then nationality(desc),then name(asc) this using of works function sortobjects(objarray, properties) { var primers = arguments[2] || {}; properties = properties.map(function(prop) { if( !(prop instanceof array) ) { prop = [prop, 'asc'] } if( prop[1] == 'desc' ) { prop[1] = -1; } else { prop[1] = 1; } return prop; }); function valuecmp(x, y) { return x > y ? 1 : x < y ? -1 : 0; } function arraycmp(a, b) { var arr1 = [], arr2 = []; properties.foreach(function(prop) { var avalue = a[prop[0]], bvalue = b[prop[0]]; if( typeof primers[prop[0]] != 'undefined' ) { avalue = primers[prop[0]](avalue); bvalue = primers[prop[0]](bvalue); } arr1.push( prop[1] * valuecmp(avalue, bvalue) ); arr2.push( prop[1] * valuecmp(bvalue, avalue) ); }); retu

ios - One instance of navigation bar in every tab -

i've been struggling problem several days. in application have tab bar controller uinavigationviewcontrollers inside. want every navigation bar in every navigation controller same depending on user actions , app state. example: if user logged in app in first view controller, app sets name in navigation bar , sets navigation bar logged in state. when user selects other tab item, want set logged in state of navigation bar first view controller other view controllers. i've tried use singleton no effect. seems have 2 things: set current settings while init uiviewcontroller update initiated controllers after state changes to 1: create class with @interface uiviewcontroller (uinavigationcontroller) - (uinavigationcontroller*)wrapwithnavigationcontroller; @end @implementation uiviewcontroller (uinavigationcontroller) - (uinavigationcontroller*)wrapwithnavigationcontroller { uinavigationcontroller* navigationcontroller = [[uinavigationcontroller alloc] in

multithreading - load and "unload" lots of pictures really often in android -

i working on application on android loaded-images intensive ! according position of user, system loads pictures disk (from 5 25 jpeg-1000x1000) display them immediately. have advices how ! mean, according you, best thread implementation use (asynchtask, thread, runnable ) ? i'm pretty lost , confused best method it, , differences between asynch-runnable… thanks i read training section here: http://developer.android.com/training/displaying-bitmaps/index.html and suggest take at: https://github.com/nostra13/android-universal-image-loader maybe solves problem.

How can we describe T<S> as return type for a method using generics in java -

how can describe t<s> return type method <t,s> t<s> getresult(class<t> tclass, class<s> sclass) you can't, basically. there's no way of describing "a generic type 1 type parameter" , using this.

javascript - Load content of an external page to a div? -

this main page <html> <head> <title></title> <style> #exp{ height: 100%; width:100%; position: absolute; left:0; top:0; background:#00ff00; } </style> <script src="scripts/jquery.js"></script> <script> $(function(){ $("#exp").load('aboutus.html'); }) </script> </head> <body> <div id="exp"> </div> </body> </html> i want load content page aboutus.html content in page is <div style="height:100%;width:100%;position:absolute;left:0px;top:0px">hai</div> i tried load,get,.html etc none of them working. don't want include php methods tried $("#exp").load('aboutus.html'); $("#exp").get('aboutus.html'); $("#exp").html(url(aboutus.html')); one way using ajax call using jquery. just wrap page json call function.

mysql - Mule parameters in SQL queries -

i'm trying query 2 databases f102 mysql , f100 sql server. the query mysql server works sql server connector doesn't "#[header:inbound:company] company" , throws: root exception stack trace: java.sql.sqlexception: many parameters: expected 0, given 1 @ org.apache.commons.dbutils.queryrunner.fillstatement(queryrunner.java:176) @ org.apache.commons.dbutils.queryrunner.query(queryrunner.java:392) @ org.mule.transport.jdbc.sqlstrategy.selectsqlstatementstrategy.executestatement(selectsqlst atementstrategy.java:80) + 3 more (set debug level logging or '-dmule.verbose.exceptions=true' everything) is there differences between calling mysql , sql server when comes invoke variables , parameters in query? <jdbc:connector name="db_conn_f102" datasource-ref="f102" pollingfrequency="5000" doc:name="database" validateconnections="false"> <jdbc:query key="read" va

ios - CMDeviceMotion userAcceleration is upside down? -

i'm seeing unexpected readings useracceleration field in cmdevicemotion. when @ raw accelerometer data cmaccelerometerdata, see if iphone flat on table reading 1g straight down (1g in -z axis) , if drop iphone (on soft surface of course) acceleromtere reading goes 0 expected. that's fine. when instead use cmdevicemotion class, useracceleration reading 0 expected when iphone flat on table. again fine. when drop iphone , read cmdevicemanager useracceleration, useracceleration values 1g straight (+z) not down (-z) expected. appears useracceleration readings exact opposite of acceleration device experiencing. has else observed this? can invert (multiply -1) useracceleration values before try integrate velocity , position, or misunerstanding useracceleration reading? there conceptual differences between cmaccelerometerdata.acceleration , cmdevicemotion.useracceleration raw accelerometer data sum of accelerations measured i.e. combination of gravity , current acceler

python - Type error comparing two datetimes -

my problem common you, didn't find answer on website. want combine 2 dates in python, use : delta = 2012-04-07 18:54:40 - 2012-04-07 18:54:39 but error : typeerror: unsupported operand type(s) -: 'str' , 'str' i understand it, don't know how turn right way. do have idea? thks! you subtracting strings , not datetime.datetime objects. try strptime method in order convert strings datetime.datetime . >>> delta = datetime.datetime.strptime('2012-04-07 18:54:40', '%y-%m-%d %h:%m:%s') \ - datetime.datetime.strptime('2012-04-07 18:54:39', '%y-%m-%d %h:%m:%s') >>> delta datetime.timedelta(0, 1)