Posts

Showing posts from June, 2011

php - Multi select dropdown - how to add default value -

i'm trying add default value in multiselect dropdown, far tried <select name="addons[]" multiple="multiple" id="addons"> <option value="not selected" <?php echo set_select('addons[]', 'not selected', true); ?> >not selected</option> <?php foreach ($addons $options) { ?> <option value="<?php echo $options->addon_name; ?>"><h5><?php echo $options->addon_name; ?></h5></option> <?php } ?> </select> i should suppose default value "not selected" i'm getting empty. 1 knows i'm going wrong ? <select name="addons[]" multiple="multiple" id="addons"> <option value="not selected" <?php echo in_array("not selected",$addons)?"selected":"" ?> >not selected</option> <?php foreac

SIP support for Cordova/Phonegap -

is there possibility use sip in cordova/phonegap? i've not found plugin, yet. support webrtc not available (but planned in 2.x, according roadmap). supporting sip or webrtc on android has nothing phonegap / cordova , though added extension naturally come browser provided phonegap os. right need external libraries you. you may add extension phonegap (written in java) communicated sip server. or if can use javascript library implement sip protocol (like sipml5 ) if choose use late solution, browser needs support websocket or webrtc (both applicable). far know browser plugin provided phonegap android not support neither of mentioned technologies, knowledge 6 month ago. tried implement my own websocket phonegap extension provide phonegap websocket . i've never tested sipml5 , have no idea problems might encounter.

asp.net mvc 3 - To form Html Href in mvc -

<a href="basicinfo.aspx" class="desc3 pull-right"><i class="icon-edit"> i have simple html href in mvc. require manipulate path use in asp.net suppose have url this http://localhost:52086/visacase/?summary=317 now require take value of summary, in asp.net using request.querystring , want form full href url like note: want in view of mvc. assistance request.params["summary"] this should give value of summary parameter.

jquery - Opacity becoming transparent in browser -

Image
i stuck opacity issue again. tried this: var hiddensection = $('div.hidden'); hiddensection.show() .css({ 'display': 'block' }) .css({ width: $(window).width() + 'px', height: $(window).height() + 'px' }) .css({ top: ($(window).height() - hiddensection.height()) / 2 + 'px',left: ($(window).width() - hiddensection.width()) / 2 + 'px'}) .css({ 'background-color': '#333333', 'filter': 'alpha(opacity=70)', 'opacity': '0.7' }) //.css({ 'background-color': 'rgba(105,105,105,0.8)' }) .appendto('body'); this thing working fine ie8 how in chrome, firefox getting result: screenshot: it become transparent don't want make popup transparent.how can crack this? any appreciated. when apply opacity element opacity reflected on child elements. that's why popup content transparent too. css3 col

javascript - how to post to page wall as admin user not as page -

i know how post page wall/comment/like graph api.as post sample use in way - fb.login(function(response) { if (response.status=='connected') { if (response.authresponse.accesstoken) { var token = response.authresponse.accesstoken; fb.api('/'+page_id+'/feed?access_token='+token+'&message='+message, 'post', function(response) { ......rest of codes..... but because admin user of page, posting page not admin user me.also same way when comment,like page post same behaviour. searched posts have not answered answer yet.i found fb bug reported here - https://developers.facebook.com/bugs/334877786593553/ but fb response bug not solution!.so alternative other facebook dialog(fb.ui) , research on appreciated.

wordpress - Background Slider -

i want background slider behind menu , logo, don't it. i see no pictures of slider hope can me problem so hope someone's can me <link href='http://fonts.googleapis.com/css?family=lato:400,900italic,700|prata|qwigley' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/fancybox/jquery.fancybox.css"> <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/skeleton.css"> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/style.css" /> <script type="text/javascript" href="<?php echo get_template_directory_uri(); ?>/js/modernizr.custom.86080.js"><

wcf binding - WCF call times out when the returned message is large -

we have system client flash application calling asmx based search web service in turn calls wcf service hosted in windows service using nettcpbinding. working fine when no. of search results small. when search results going large, in range of 2000 records, getting exception in asmx service calls wcf: `the communication object, system.servicemodel.channels.servicechannel, cannot used communication because in faulted state.` in order troubleshoot error, enabled service tracing , found error reported is: `the socket connection aborted. caused error processing message or receive timeout being exceeded remote host, or underlying network resource issue. local socket timeout '00:01:00'.` we have increased timeout values in both server , client configs , increased maxitemsinobjectgraph value. there no errors happening @ wcf call can debug , observed behavior is, when wcf call returns, code in asmx service hitting exception block , reporting above error. server side confi

Neo4j embedded with high availability -

i used spring data neo4j embedded 1 of poc. works blazing fast on single machine. before going production, wanted separate database application server. configured 3 neo4j server instances , ha proxy , used spring data neo4j rest connect. speed worst. each query takes more 30 seconds execute. i thinking use neo4j embedded ha? can provide me links/tutorials configure spring data neo4j in embedded mode ha proxy. i wish have 3 neo4j servers , multiple application servers. thanks. additional log 17:43:10.695 [main] debug o.s.b.f.annotation.injectionmetadata - processing injected method of bean 'org.springframework.data.neo4j.config.neo4jconfiguration#0': autowiredmethodelement public void org.springframework.data.neo4j.config.neo4jconfiguration.setconversionservice(org.springframework.core.convert.conversionservice) 17:43:10.703 [main] debug o.s.b.f.annotation.injectionmetadata - processing injected method of bean 'org.springframework.data.neo4j.config.neo4jconfigura

arm - How to solve error " Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException:"? -

i made myapp arm processor(armv7, 512 ram, debian wheezy os, openjdk-7 installed). when run myapp on os gives error. code , error below. search according error can't solve error. myapp works fine on pc have installed windows 7 , ubuntu 12.04. 1 have idea or solution suggest me? import javax.swing.jframe; import javax.swing.jpanel; /** * * @author jay_2 */ public class myapp extends jpanel { /** * @param args command line arguments */ public static javax.swing.jtextfield inputext; private javax.swing.jlabel inputlbl; private javax.swing.jscrollpane jscrollpane1; private javax.swing.jscrollpane jscrollpane2; private javax.swing.jlabel outputlbl; public static javax.swing.jtextarea outputtextarea; private javax.swing.jlabel templbl; public static javax.swing.jlabel tempshowlbl; public static javax.swing.jtextarea temptextarea; public myapp() { // todo code application logic here setcomponents(); }

forms - Best way to create a floating object in c# -

Image
i want make system tray app used "mask off" areas of screen (this use hide portions of dj software such bpm counters, user can hide bpm when practising, press key reveal.) it's equivalent of sticking piece of gaffer tape monitor, without nasty residue! the requirements are: the user should able draw number of rectangles on screen want mask off. (maybe using setup / edit mode) the rectangles need on top (kind of modal, but...) the user must able interact application below - i.e. mouse clicks , key presses should work on dj software the user should able toggle between displaying , hiding rectangles (without having redraw each time not sure of best way approach - thought making rectangles number of forms no content or controls on. there better (graphical way) acheive this? panels or rectangles or something? ideally have liked use layered form using standard form easier write , present here @ stackoverflow. the ux far great doesn't matter, it

How to post a message on linkedin in android? -

i new android.in application , there requirement when click on share button need share on linked in wall.how can ? please can 1 me. thanking in advance. well using socialauth android posting messages on linkedin , twitter. and more basic approach can go through this here example socialauth : first have download socialauth-android-sdk-2.0.zip here then copy jar dist folder , paste in libs folder of project. now, register application on linkedin , api key , secret key copy file "oauth_consumer.properties" assets folder of zip assets folder of project , edit file , write api key , secret key in linkedin section #linkedin api.linkedin.com.consumer_key = ************* api.linkedin.com.consumer_secret = ************** also drawable of linkedin example provided in example folder of zip. finally, change activity accordingly (activity given below), public class shareactivity extends activity implements onclicklistener { edittext sharetext;

c - Looping construct in a C99 macro -

i want generate array initializer arbitrary logic unfortunately requires looping. #define random_array(n) \ ... double array[] = random_array(10); suppose code above generates initializer 10-element array. possible define such macro (with loop) in c99 ? nb: doesn't have macro if function call suffice (but has possible call among global initializers, not in second function); the c preprocessor doesn't support loops, want not (easily) possible. i added '(easily)' because there ways loop-like behavior using boost's iterate . uses recursive file inclusion emulate loop. i'm not sure if want go far.

windows - What is the correct way to detect that an IShellItem refers to a Library? -

i'm using common file dialog fos_pickfolders let user pick location save files. if user selects library, e.g. library\documents current code fails @ point call ishellitem::getdisplayname extract file system name. if item file succeed , library's default save location used. what detect shell item library, obtain ishelllibrary interface, , query find default save location. save files there. what correct way detect ishellitem refers library? the way found use ishelllibrary::loadlibraryfromitem ( msdn here ), pass ishellitem interface. if fails (i.e. hresult != s_ok ), ishellitem not library. so this: bool islibrary(ishellitem *pitem) { bool bislibrary = false; ishelllibrary *plib = null; hresult hr = cocreateinstance(clsid_shelllibrary, null, clsctx_inproc_server, iid_ppv_args(&plib)); if (succeeded(hr)) { hr = plib->loadlibraryfromitem(pitem, stgm_read); if (succeeded(hr)) bislibrary = true;

Python rauth connection to linkedin -

i have taken on support app uses rauth connect linkedin. code failing is: self.linkedin= oauth1service( name='linkedin', consumer_key=self._consumer_key, consumer_secret=self._consumer_secret, request_token_url=self.request_token_url, access_token_url=self.access_token_url, authorize_url=self.authorize_url) self.request_token, self.request_token_secret = \ self.linkedin.get_request_token(method='get', oauth_callback=self.callback_url) the owner of app says used work we're getting: typeerror: request() got unexpected keyword argument 'oauth_callback' can point me doc/examples me re-architect this? -jim it sounds you&

vb.net - Need to bind/populate combobox in WPF forms, ideally with value and display -

my application other reasons isn't set mvvm architecture , i'm not able @ time. thing need modify combobox populated database (it stored in oracledatareader). programmatically add items combobox looping through oracledatareader, or bind in way. public sub loadlocationcombo() dim rs oracledatareader dim dt new datatable() dim dr datarow dim lstitems new arraylist rs = objclsdb.locationcombo dt.load(rs) dt.columns("description").allowdbnull = true dt.columns("value_id").allowdbnull = true dt.columns("description").defaultvalue = "" dt.columns("value_id").defaultvalue = 0 dr = dt.newrow dr("description") = "" dr("value_id") = 0 dt.rows.insertat(dr, 0) cbolocation.itemssource = dt.defaultview cbolocation.displaymemberpath = "description" cbolocation.selectedvaluepath = "value_id" end sub that current

ActionScript 2.0 Random Boolean Function not working -

i have below code show randomly true , randomly false. in case being false. appreciated. thanks. in below code tail , heads tow buttons. on(release) { var guess:boolean = boolean(math.round(math.random())); var input:boolean; if (event.target.name == "tail"){ input = true; } else if (event.target.name == "heads"){ input = false; } if (guess == input){ var newresult = number(income.text) + number(amount.text); income.text = number(newresult); } else{ var newresult = number(income.text) - number(amount.text); income.text = number(newresult); } } this work: on(release) { var guess:boolean = boolean(math.floor(math.random()*2)); if (guess){ result.text = "your guess corrent"; var newresult = number(income.text) + number(amount.text); income.text = number(newresult); } else{ result.text = "your guess wrong"; var ne

Drupal Module - Post as user -

i'm looking module allows admin create content user. remember drupal 6 used few years ago cannot find on now! is there such module? thanks in advance help! dean could use masquerade ? there impersonate module, apparently exists drupal 5.

plugins - Gruntjs: How to make copy task to copy only changed files on watch -

so on grunt-contrib-watch plugin info page, there example on how make jshint run changed file. grunt.initconfig({ watch: { scripts: { files: ['lib/*.js'], tasks: ['jshint'], options: { nospawn: true, }, }, }, jshint: { all: ['lib/*.js'], }, }); grunt.event.on('watch', function(action, filepath) { grunt.config(['jshint', 'all'], filepath); }); i have not tested example self. took , applied copy task, unsuccessfully. grunt-contrib-copy task set copy images , templates angular project. , happy know if can make work copy task , if can, doing wrong. thank much. here stripped out gruntfile.js. // build configurations. module.exports = function(grunt){ // project configuration. grunt.initconfig({ pkg: grunt.file.readjson('package.json'), // copies directories , files 1 location another. copy: { // development devtmpl: {

c++ - Difference in passing const &object vs. const object -

suppose have function one bool verifyobject(const myobj& obj); or one bool verifyobject(const myobj obj); as far understand, when pass in second case, copy made. however, compiler might exploit constness pass in first case. such, see no difference in passing const object in either way. am wrong? as far understand, when pass in second case, copy made. yes; although in cases (such when passing temporary) copy elided. however, compiler might exploit constness pass in first case. no; unless argument temporary, not 1 of situations in copy can elided. when calling function, compiler may not know parameter const within function, since top-level const can omitted when declaring function. if can determine passing reference equivalent passing copy (which won't case if copy-constructor or destructor have observable side effects, or if class has mutable members), can't change calling convention since callers have no way of knowing change. having

ruby on rails - Jquery window height messed up -

i'm using jquery-rails 2.2.1 jquery 1.9.1 if open firebug , run $(window).height() height 921. if close , open firebug (same size) $(window).height() changes 1130 if try resize firebug window values >>> $(window).height() 921 >>> $(window).height() 4276 >>> $(window).height() 6106 >>> $(window).height() 7326 my firefox 21.0 , firebug 1.11.3. i don't know happening imagine problem firebug, correct way window size (no document)? i'm using center div in middle of screen $(document).ready(function(){ wsh = $(window).height(); wsw = $(window).width(); addsh = (wsh/2) - ($('#addsituation').height()/2); addsw = (wsw/2) - ($('#addsituation').width()/2); $('#addsituation').animate({'margin-top': addsh}, 1000); } the first time open div fine, if open , close firebug messes, if resize firebug goes way down. updated rails-jquery last version. there workaround? there way that? note: di

How to get array value from looping in php? -

i think simple problem. can't finish it. please me simple problem. want values array use looping. , code <?for ($i = 1 ; $i <=5 ; $i++){ $foo = array(1,2,3,4,5); echo $foo[i]; } ?> it doesn't work :( use this $foo = array(1,2,3,4,5); echo $foo[$i]; you missed $ before should $i mark variable.

nested - Wicket listview within a listview -

i pretty new wicket i'm making horrible mistake here. i trying add listview listview receive error, know error has hierarchy of components , because hierarchy of java file , html file not same. don't know how solve it. give me pointers? relevant code (setting listviews): final listview<menuitem> sublistview = new listview<menuitem>("menusubview", new arraylist<menuitem>()) { private static final long serialversionuid = 1l; @override protected void populateitem(listitem<menuitem> item) { //do } }; sublistview.setrenderbodyonly(true); sublistview.setreuseitems(true); listview<menuitem> listview = new listview<menuitem>("menuview", menuitems) { private static final long serialversionuid = 1l; @override protected void populateitem(listitem<menuitem> item) { final menuitem menuitem = item.getmodelobject(); ajaxlink<menuitem> alink = new ajaxlink<menuitem&

javascript - Date picker Kalendae not working on IE9 -

i'm using kalendae date picker chrome , firefox dosen't work ie9 (while author says it's compatible ie8). problem can display calendar nothing happens when click on date :/ does use date picker , if so, have had problem? thank's! --------------- edit ----------------- @deepu: don't have error. @amitapollo: mean date div/class? have give div id if want attach kalendae object it... code looks this: var divcal = document.createelement('div'); divcal.setattribute('id', 'divcal'); divcal.style.position = 'absolute'; divcal.style.left = xmouseposition + "px"; divcal.style.top = ymouseposition - 150 + "px"; document.getelementbyid('section').appendchild(divcal); var cal = new kalendae('divcal', { months:1, mode:'select', weekstart:1, direction:'today-past' }); i have call change function this: cal.subscribe('change', function (dat

ruby on rails - SASS in Sinatra: couldn't set custom directory -

i've read sinatra sass custom directory , sinatra custom sass directory . but doesn't work me. write app: require 'sinatra' require 'sass' require 'slim' configure set :views, :scss => 'assets/css' end '/css/*.css' scss params[:splat].first.to_sym end '/' slim :index end when i'm running error: http://localhost:3000/css/style.css typeerror @ /css/style.css no implicit conversion of hash string it's vice versa, first :scss symbol , :views : configure set :scss, :views => 'assets/css' end

c# - Allow user to copy image from picturebox and save it everywhere -

in application have picturebox shows image. when user right clicks on picturebox , selects copy context menu, want copy image clipboard user can paste in folders , anywhere else. how can that? edit: use code user can paste image word. var img = image.fromfile(pnlcontent_picture_picturebox.imagelocation); clipboard.setimage(img); clipboard.setimage copies image content (binary data) clipboard not file path. paste file in windows explorer need have file paths collection in clipboard not content. you can add path of image file stringcollection , call setfiledroplist method of clipboard achieve want. system.collections.specialized.stringcollection filecollection = new system.collections.specialized.stringcollection(); filecollection.add(pnlcontent_picture_picturebox.imagelocation); clipboard.setfiledroplist(filecollection); now user can past file anywhere e.g. windows explorer. more info on clipboard.setfiledroplist method http://msdn.microsoft.com/en-us/li

python - List elements to variables -

inspired accepted answer reading utf8 csv file python , i've tried following get valueerror: need more 5 values unpack seems empty strings tripping me here. there function should apply row make work? i'll need work these variables individually further down line. thanks. def encodevar(x): return x row = ['85123', '', '123 address', '', '', 'tucson', 'az ', 'the company name', '', ''] zip5,zip4,strname,strnumber,strsuite,city,state,busname,lname,fname in row: hhid = encodevar( zip5 ) +\ encodevar( zip4 ) +\ encodevar( stname ) +\ encodevar( stnumber ) +\ encodevar( stsuite ) +\ encodevar( busname ) you looping over row , means each element iterated on separately. just assign directly variables: zip5, zip4, strname, strnumber, strsuite, city, state, bu

jquery - Implementing fixed position in javascript causes jitter in Safari when scrolling -

fixed position not work use case because fixed browser window , can in state text off screen right , can not it. anyways, have attempted use absolute positioning , adjusting "top" in javascript. works pretty in firefox , chrome, in safari content jitters when scroll. http://jsfiddle.net/z8ufe/4/ <div class="fixed sticky" data-offset-top="50"><p>fixed</p></div> $(document).ready(function() { var documentheight = $(document).height(); $(document).scroll(function() { var scrolltop = $(window).scrolltop(); $(".sticky").offset(function() { $this = $(this); var offsettop = $this.data("offset-top"); if (scrolltop < 0) { scrolltop = 0; } var newtop = offsettop + scrolltop; if (newtop < offsettop) { newtop = offsettop; } // prevents document infinitely expanding. var maxtop = documentheight -

Blogger: Labeling Sections on the Layout Page -

Image
i've created responsive theme blogger. thus, since layout page shows reflection of actual layout, doesn't make use of media queries. lined vertically @ 100% width in admin area(which expected). my question: there way can label sections somehow labels show on layout page, not when viewing site? when viewing layout page, there 8 sections "add gadget", , user has no way of knowing section what. yes!!! can change , style (including title) of layout page (admin page) without effecting , style of actual site. to answer question titles of layout page. example, have text widget , want change title of "text" actual title in layout not in actual site: find id of widget (in template) want address: "template" > "jump widget" > "text1". all widgets listed in "jump widget" id's wish use based on 1 wish address. above "/b:skin" use css style titles see fit (id's start "#" ma

cocoa - How to build commands for use with writeAsync over RFCOMMChannel? -

i have communicate on bluetooth device, device expects commands separated carriage return + linefeed. connection established using rfcommchannel. atm seems code not working since expecting reply device, when send commands using simpel terminal program. this code run after connection established (this definately working since can log data coming in external device) nsstring *clockrequest = @"c\r\n"; void *clockrequestdata = (__bridge void *)([clockrequest datausingencoding:nsasciistringencoding]); nslog(@"data buffer write: %@", clockrequestdata); [rfcommchannel writeasync: clockrequestdata length:100 refcon:null]; //writing data rfcomm - (void)rfcommchannelwritecomplete:(iobluetoothrfcommchannel*)rfcommchannel refcon:(void*)refcon status:(ioreturn)error { nslog(@"macbook wrote timecube, status: %d", error); } the code establishing connection taken , adjusted https://gist.github.com/crazycoder1999/3139668 thx in advance add c

video.js - videojs 4.0 meet strange on IE9 -

i embed js through cdn. img source , video source load romote disk,the img can't scale player size. when click play button,but can't play video. website link: http://www.zeguoren.com/thread-6463-1-1.html according w3c html5 specifications : the image given poster attribute, poster frame, intended representative frame of video (typically 1 of first non-blank frames) gives user idea of video like. so should use image poster attribute fit size of video. if want see poster img, have set preload attribute 'none' or 'metadata' (see here ). about video, internet explorer 9 support .mp4 format. should add source: <video data-setup="{}" poster="http://img142.poco.cn/[...]2043.jpg" preload="none" class="vjs-tech" id="my_video_1" tabindex="0"> <source type="video/mp4" src="http://storage.live.com/items/f[...]2b!290?a.mp4"></source> <sour

php - Wordpress Ajax setcookie WAMP/LAMP disparities -

in wordpress themed-plugin e-commerce have 2 ajax/php scripts setting cookies ( both in same directory ) ajax calls set same "cart.js" first script sets/updates anonymous cart cookie when cart either created or updated. second checks if customer/user exists, or creates 1 anew , --in either case -- logs them in if not already, before cart gets passed paypal. such, upon returning paypal customer/user ( now logged in ) presented overview / review of status of orders ( new , old ). on wamp develpment stack, works flawlessly, while on hosted (linux) installation cart_cookie script works expected, while checkout/customer_cookie throws... [14-may-2013 02:08:50] php warning: session_start() [<a href='function.session-start'>function.session-start</a>]: cannot send session cache limiter - headers sent (output started @ /home2/alternam/public_html/demo/wp-content/themes/am_wallaby_kids/checkout.php:2) in /home2/al

sql server - SQL how to format time containing an aggregate or a subquery -

please help. having little bit of problem here , need figuring out. have query returns multiple rows , when try format time display following message... msg 130, level 15, state 1, line 3 cannot perform aggregate function on expression containing aggregate or subquery. here format used when error... cast(sum(datediff(second, 0, entrytime)) / 3600 varchar(12)) + ':' + right('0' + cast(sum(datediff(second, 0, entrytime)) / 60 % 60 varchar(2)), 2) + ':' + right('0' + cast(sum(datediff(second, 0, entrytime)) % 60 varchar(2)), 2) which when run in in query correct format like... project name total time aaa 0:00:19 bbb 0:00:04 ccc 6:00:06 ddd 16:05:52 but, can't seem figure out how format following query display time in manner... select projname 'project name', convert(varchar(10), sum(case when phone = 0 , research = 0 (d

backbone.js - Does Backbone need Underscore? -

due backbone.js: `extend` undefined? , own errors after comment underscore.js : does backbone need underscore? need partly? (which parts?) yes. backbone has explicit dependency on underscore, says right @ top of backbone page: http://backbonejs.org/ backbone's hard dependency underscore.js ( >= 1.4.3).

asp.net - MVC app doesn't send email when deployed on a remote server -

when exception occurs in mvc app, code sends email. the thing works charm when deploy locally. on remote server, though, doesn't send email. below details deployment environment. web server: iis 7.5 .net framework: v4 mvc version: 4 windows server: windows server 2008 r2 standard help appreicated. sorry, realized had grant permissions user asp.net v4.0 , name of application pool / identity under application registered / running. that solved problem.

attributes - How to find XElement specific Children (in c# with LINQ)? -

i've got xml file : <root> <environment env="prod"> <key name="big key" propagate="true" value="21" /> </environment> <environment env="pre-prod"> <key name="first key" propagate="true" value="4" /> <key name="second key" propagate="true" value="3" /> </environment> </root> i want check if key exist in file, , if propagate item true. manage 2 system.xml.linq.xelement : key name="first key" , key name="second key". get 1 pkeyname (like "second key" eg.) can't find how... public static bool ispropagate(string pxmlfilename, string penvironment, string pkeyname) { var doc = xelement.load(pxmlfilename); ienumerable<xelement> childlist = doc.elements("environment") .where(elt => elt.attribute("env").value == penvironment) .elements(); if (chil

Cygwin causing errors in Aptana when Ant builds project with HTML parsed as PHP -

i have aptana studio 3, build: 3.4.0.201304151603 installed on windows 7 (service pack 1). have configured associate *.html files php source editor default add code completion (and apache parses *.html as) php. i have custom builder on project launch ant 1.7.0 build it. nothing special except prompt ant target build. finally, have cygwin installed , use tail'ing logs, etc. whew ! enough intro, down problem. recently, when first fire custom builder, console displays following: [2013-05-09 12:24:36] #<nomethoderror: undefined method `end_node' #<java::comaptanaeditorphpinternalparsernodes::phphtmlnode:0xc37a88>> ps: illegal option -- x usage ps [-aefl] [-u uid] -f = show process uids, ppids -l = show process uids, ppids, pgids, winpids -u uid = list processes owned uid -a, -e = show processes of users -s = show process summary -w = show windows cygwin processes i have yet find references online java::comaptanaeditorphpinternalparsernodes::phphtmlnode

correlated subquery - How to reference and reuse a corelated sub query? -

imagine trade table , cds_coupon table joined on trade id; coupon table having settlement date , settlement amount well. required query amount , date of next coupon settle. select t.tradeid tradeid, ( select settlement_date cds_coupon e t.tradeid=e.tradeid , e.settlement_date = (select min(settlement_date) cds_coupon ei ei.tradeid = t.tradeid , ei.settlement_date > sysdate ) ) settlement_date, ( select settlement_amount cds_coupon e t.tradeid=e.tradeid , e.settlement_date = (select min(settlement_date) cds_coupon ei ei.tradeid = t.tradeid , ei.settlement_date > sysdate ) ) settlement_amount, trade t as can seen 2 levels of identical corelation done twice grab different field - once grab settlement date , once grab settlement amount. hence question - how reference , reuse corelated sub query ? if using sql server use common table expression (cte) . ;with settlementdates () ( select tradeid, min(settlement_date) settlement_date

ubuntu - cmake working for root not for other user -

i have dummy compilation running in buildbot slave. when running buildbot user get: -- c compiler identification unknown -- cxx compiler identification unknown -- check working c compiler: /usr/bin/gcc -- check working c compiler: /usr/bin/gcc -- broken cmake error @ /usr/share/cmake-2.8/modules/cmaketestccompiler.cmake:52 (message): c compiler "/usr/bin/gcc" not able compile simple test program. ... cc1: error: /usr/local/include/x86_64-linux-gnu: permission denied /usr/local/include/x86_64-linux-gnu not exist if manually run su get: -- c compiler identification gnu -- cxx compiler identification gnu -- check working c compiler: /usr/bin/gcc -- check working c compiler: /usr/bin/gcc -- works -- detecting c compiler abi info -- detecting c compiler abi info - done -- check working cxx compiler: /usr/bin/c++ -- check working cxx compiler: /usr/bin/c++ -- works -- detecting cxx compiler abi info -- detecting cxx compiler abi info - done and on, can later make , ru

How to add a string to os.system() command? (Python) -

i add tweet = "@idoodler cpu temperature " + str(cpu_temp) os.system("sudo twidge update \"tweet\"") (tweet tweet string above). can please tell me how can add tweet string os.system() command? cmd = "sudo twidge update \"{0}\"".format(tweet) print cmd os.system(cmd) although honest better off using subprocess.call import subprocess subprocess.call(["sudo","twidge","update",tweet])

Javascript: multiple events, one ajax request -

i'm new js , i'm trying think of best way design asynchronous interaction in application i'm working on. i've got list of records related live api-backed data. show user list of these records, , user can select specific records want see more information about. load additional data api via ajax call. to make more real world example, let's have list of stocks. i've got name , yesterday's closing price each stock. there's check box next each stock name, , if user checks box plots historic price of stock past year on graph. when user selects 1 stock in way, behavior simple. send 1 api request historical data 1 stock, , plot on graph. however, user might select bunch of stocks @ once, or in rapid succesion. don't want fire 10 or 20 or 50 requests back-to-back, want make 1 request 10 or 20 or 50 stock histories. let's application has event listener looks stock history when check box toggled, this: $('input.stock_toggle').change(

local - HTML5 offline needs to work on mobile devices canvas kineticjs -

sorry if has been posted before have looked around , havn't been able find appropriate answer. i recreating extremely old introduction music theory textbook school in website form, uses flash , updating can ran on mobile devices. using html5 jquery , kineticjs, have lots of code working typical computers can't code run on ios or android tablet, appropriate thing do, should have been using tool phonegap along? please insight how should go amazing! thanks

r - How to know if a regression model generated by random forests is good? ( MSE and %Var(y)) -

i tried use random forests regression. original data data frame of 218 rows , 9 columns. first 8 columns categorical values ( can either a, b, c, or d), , last column v9 has numerical values can go 10.2 999.87. when used random forests on training set, represents 2/3 of original data , randomly selected, got following results. >r=randomforest(v9~.,data=trainingdata,mytree=4,ntree=1000,importance=true,do.trace=100) | out-of-bag | tree | mse %var(y) | 100 | 6.927e+04 98.98 | 200 | 6.874e+04 98.22 | 300 | 6.822e+04 97.48 | 400 | 6.812e+04 97.34 | 500 | 6.839e+04 97.73 | 600 | 6.852e+04 97.92 | 700 | 6.826e+04 97.54 | 800 | 6.815e+04 97.39 | 900 | 6.803e+04 97.21 | 1000 | 6.796e+04 97.11 | i not know if high variance percentage means model or not. also, since mse high, suspect regression model not good. idea how read results above? mean model not good? like @joran told, %var amount of tot

optimization - Python: alternate to brentq and fsolve in python that finds all the zeros of the given function -

is there module find zeros of function instead of first 0 encounters beyond specified starting point? with brentq , specify function changes sign , pick location unless did n times. similarly, fsolve , pick starting point , finds first 0 beyond point , again have n times. how find n locations in 1 calling n < infinity of course. the function have in mind 3 zeros , below: import numpy np import pylab scipy.optimize import brentq mm = 7.3477e22 # mass moon me = 5.9736e24 # mass earth r12 = 384400.0 # distance between earth , moon pi2 = mm / (me + mm) def f(xi): return ((1.0 - pi2) / np.absolute(xi - pi2) ** 3.0 * (xi + pi2) + pi2 / np.absolute(xi + pi2 - 1.0) ** 3.0 * (xi + pi2 - 1.0) - xi)

javascript - Cons of MouseOver for webpages -

so creating "button" multiple images within slideshow , whenever mouseover it, image changes image. however whenever slideshow image changes, mouseover effect gets removed mouseout state since technically mouse no longer on image. i tried having fade effect button of searches lead using hover functions instead of mouseover , mouseout. so wondering if hover better mouseover in terms of it's potential capabilities? is possible pause slideshow event on hover, etc? , how can go doing it? here current code: function.js $(function () { $('#01 img:gt(0)').hide(); setinterval(function () { $('#01 :first-child').fadeout(1500) .next('img').fadein(1500) .end().appendto('#01'); }, 3000); }); $(document).ready(function () { $("#image1").mouseover(function () { $(this).attr("src", "images/board_01_over.jpg"); }); $("#image1").

php - Magento custom layout local.xml not applying to custom module output pages -

i'm developing both, magento custom module , magento custom theme, i'm facing problems driving me insane!!!(p.s.: magento 1.7.0.2) my module , theme structure following: app -local -mynamespace -mypackagename -block -controllers -etc -helper -model -sql design -frontend -default -mycustomtheme -etc -layout -template my config.xml(placed on mypackagename/etc): <?xml version="1.0" encoding="utf-8"?> <config> <modules> <namespace_packagename> <version>0.1.0</version> </namespace_packagename> </modules> <frontend> <routers> <namespace_packagename> <use>standard</use> <args> <module>namespace_packagename</module> &