Posts

Showing posts from July, 2013

java - Performance cost of refactoring similar methods into Strategy pattern? -

i find myself facing lot of similar methods repeating code in projects. general pattern seems (apologies vague code, licensing won't let me provide concrete example): public void modifytype1person() { map<string, ?> parameters = new hashmap<>(); parameters.put("type", "type1"); parameters.put("stringargument", "some name"); editpersonbasedontype(parameters); } public void modifytype2person() { map<string, ?> parameters = new hashmap<>(); parameters.put("type", "type2"); editpersonbasedontype(parameters); } public void modifydefaulttypeperson() { map<string, ?> parameters = new hashmap<>(); parameters.put("type", "othertype"); parameters.put("booleanargument", true); editpersonbasedontype(parameters); } public void editpersonbasedontype(ma

Pass variables from JavaScript to Node.js -

i have simple html this: <html> <head><title></title></head> <body> <script>var testvariable = "hello"</script> <form method="post" action="/"> <input type="submit" name="submit" value="submit"> </form> </body> </html> and node.js looks this: app.post('/', function(req, res) { console.log(req.body.testvariable); }); what need when form submitted testvariable needs passed node.js function, i'm trying hidden fields i'm still having problems that, i.e: <input type="hidden" name="chat" value="<script>testvariable</script>"> but can imagine pass script string, , not value of variable. does knows how that? sorry if silly question, i'm new javascript , node.js in general , can't find answers in google. thanks. -

c# - Returning Data to Previous a ViewModel using Prism Navigation -

imagine have 2 views, viewmodel infoviewmodel displays information person , viewmodel searchviewmodel handles searching person , selecting result. i want infoviewmodel able initiate search process result in searchviewmodel telling view infoviewmodel has been selected. potential requirement infoviewmodel can communicate searchviewmodel result unacceptable , user should pick else (this should happen without search result screen disappearing , reappearing) normally easy solve infoviewmodel giving searchviewmodel callback called whenever result selected. callback having return parameter specifying whether result or not searchviewmodel can clean or not. seems prism discourages since, @ least in prism 4.0, there no way navigate object parameter (you pass strings parameters). 1 of workarounds i'm using use service store object parameters can uniquely identified in next view way of string guid. has it's own problems, worse feels prism intentionally designed against doing this.

c++ - How to wait for GTK+ object to be destroyed before continuing? -

i have program open file dialog , take file name , resource intensive operations. my problem while opertion running, though gtk_widget_destroy() has been called on file dialog stays open. this problem because need implement loading bar in near future , don't want dialog hanging around. code looks this: if(gtk_dialog_run(gtk_dialog(fileselect)) == gtk_response_ok){ filename = string(gtk_file_chooser_get_filename(gtk_file_chooser(fileselect))); gtk_widget_destroy(fileselect); }else{ gtk_widget_destroy(fileselect); return; } resourceintensivefunction(); so how can wait file dialog exit before continuing? btw i'm using gtk 2. so, found out how it, relatively simple. while(gtk_events_pending()){ gtk_main_iteration_do(true); } hope helped someone.

reactjs - In Flux what's the appropriate way for an action in one React component to affect another component? -

i'm trying wrap head around facebook's flux... say have app side menu can hidden , shown via button in header. my header 1 component, side menu component. currently header component sets class on html div side menu element gets animated hidden css. what's general idea here? reactjs doesn't care how gets data (how it's data getting passed in or how data should handled across web application). that's flux comes in, creates functional approach on how data handled. data-flow essentially: action -> data store -> component mutation of data happen through calling actions. data stores have listen on actions , mutate data within store. keeps data structure , logic flat. in case, dataflow this: header --> user click --> fires action --> updates store --> side menu listening , responding store change. your case simple example don't need flux. think it's easier if have parent component maintains view state logic, , u

c - Struct with union: structure has no member named -

this question has answer here: anonymous union within struct not in c99? 6 answers i have following structures: struct sched_param { union { int sched_priority; struct lshort_sched_param lshort_params; }; }; struct lshort_sched_param { int requested_time; int level; }; whenever make sched_param param1 structure , try update param1.sched_priority field message written in topic. struct sched_param param1; param1.sched_priority = 1; but, whenever make sched_param param2 , try update param2.lshort_params.level works good. struct sched_param param2; param2.lshort_params.level= 1; what reason? it because version of gcc compiler using not support unnamed union . see stackoverflow link

javascript - Bootstrap tour infinite loop -

i trying tour redirect page, when redirects enters loop. tried can. right using path, have tried using onnext , tour doesn't work. here code: <script> // instance tour var tour = new tour({ steps: [ <?php if(!$master_id) { ?> { placement:"bottom", backdrop:true, duration:5000, element: "#user_signin", title: "sign in account", content: "click here see sign in form" }, { placement:"bottom", backdrop:true, duration:5000, element: "#user_signup", title: "create new account", content: "click here see sign form" }, <?php } ?> { placement:"bottom", backdrop:true, duration:5000, element: "#user_location", title: "choose location", content: "select location can show tailored results , service providers close you." },

python - re.sub not working for a particular regex pattern -

i using following code : re.sub(inputpattern,outputpattern, currentline) in above code , reading value of outputpattern csv , value : \\1-\\2-\\3-\\4 i reading below : outputpattern = row['prefix_1_wrt_fmt'] i have tried : outputpattern = "'"+ row['prefix_1_wrt_fmt'] +"'" the problem is not treating proper format , if hard code below works fine : re.sub(inputpattern,'\\1-\\2-\\3-\\4', currentline) you need escape backslashes if have literal string. "\\1-\\2-\\3-\\4" if read input don't have that. need change pattern inside csv \1-\2-\3-\4 you use raw string if dislike escaping every char when using literal string, prefixing string letter r. r"\1-\2-\3-\4"

excel - Paste cells in specific row based on column header -

i not programmer appreciate help! i trying take range of cells, , paste them in part of spread sheet in correct column want (the column change later that's why want identify column paste cells right row) example, take cells (a2:a10) , paste them "ttm" column d4:d12... have put text ttm d1... later, ttm may become e1, in case a2:a10 cells need moved e4:e12... thanks lot! the following function can used want. need explain trigger code , if want search other 'active sheet' function move_cells() dim icols integer dim integer dim strkey string dim inewcol integer strkey = "ttm" ' set whatever label want search row 1 for. icols = activesheet.usedrange.columns.count ' count of used columns = 1 icols ' find column containing 'ttm' if lcase(cells(1, i).text) = lcase(strkey) ' ignore case incase somebody.... inewcol = ' save col # c

mongodb - Database with no authentication -

i have mongodb install on server of 1 of clients. an application have no control on using 1 single mongo database without authentication. basically every new database requires authentication, previous 1 needs accessed without using credentials. i managed enable authentication successfully, previous database requires authentication. how can achieve this? sorry, not possible. mongodb authentication on/off per instance. try splitting 1 database out own instance?

mongodb - mongo db count differs from aggregate sum -

i have query , when validate see count command returns different results aggregate result. i have array of sub-documents so: { ... wished: [{'game':'dayz','appid':'1234'}, {'game':'half-life','appid':'1234'}] ... } i trying query count of games in collection , return name along count of how many times found game name. if go db.user_info.count({'wished.game':'dayz'}) it returns 106 value and db.user_info.aggregate([{'$unwind':'$wished'},{'$group':{'_id':'$wished.game','total':{'$sum':1}}},{'$sort':{'total':-1}}]) returns 110 i don't understand why counts different. thing can think of has data being in array of sub-documents opposed being in array or in document. the $unwind statement cause 1 user multiple wished games appear several users. imagine data: { _id: 1, wished: [{game:'a

ios - How to set setAnimationInterval in cocos2d-x for android? -

i porting cocos2d ios game android game using cocos2d-x . now, have problem. in original game, used [pdirector setanimationinterval:1.0 / 240]; so, have implemented following such pdirector->setanimationinterval(1.0 / 240); doesn't work correctly. please solve issue. thanks. this due fact fps on android systems cannot controlled. take @ issue on github here .

javascript - Triggering a click through Jquery on ruby code -

so i'm trying f.submit triggered when click f.check_box . don't know if can use jquery work on ruby... view of to-do list items on page. when click checkbox mark off, want automatically submitted. i thought assign div tag on f.check_box , f.submit trigger them... first bit of jquery i've working with. <h1><%= @list.title %></h1> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <div> <h2><% @list.items.each |item| %></h2> <%= item.content %> <%= form_for([@list, item]) |f| %> <div id="target"> <%= f.check_box :complete %> </div> <div id="handler"> <%= f.submit %> <% end %> </div> <% end %> </div> <script> jquery(document).ready(function() { jquery("#target").click(function() {

opengl - Why does java app crash in gdb but runs normally in real life? -

attempting run java app gdb results in segfault, yet running app alone not. app .jar uses jogl , bit of memory-mapping talk gpu. stacktrace below hints @ sort of memory access problem don't understand why manifests in gdb not in real life. there environment factor gdb needs know allow proper execution? this issue persists between jvms openjdk 6 , 7, oracle jre 7. oracle jre runs little farther startup before segfault. segfaults otherwise consistent in occurrence , location between trials. segfault persists between gpus , drivers(!!): nvidia, radeon, fglrx current , fglrx beta (14.xx). gdb attach already-running instance of program, doesn't seem possible gdebugger this, needs work. there no intent debug gdb. rather trying use gdebugger perform opengl debugging. gdebugger apparently relies on gdb part of backend, if gdb fails, gdebugger. resulted in attempts run gdb alone isolate issue. gdebugger output: gdb string: [thread debugging using libthread_db enabled]

javascript - Suitable chart library for dynamic data? -

i looking suitable javascript charting library work being generated data pulled api using ajax/json. i'll using line, bar , pie charts. any library straightforward use, has documentation , allow me have animated graphs plus. what best option in scenario? your question little vague - though personal experience, have found chart.js , canvas.js (preferring former) easy use - have detailed documentation, easy-to-use code formats , available animations when graphs changed dynamically.

html - Having issues with PHP File Upload -

i trying upload file site odd reason not working. exists=true triggering means should working right? giving me $error=true;. below code: html: <input size="30" enctype="multipart/form-data" name="profile_icon" id="register-profile_icon" class="elgg-input-file" type="file"> php: $profile_icon = $_files["profile_icon"]; if($profile_icon){ $exists=true; } $error = false; if(empty($profile_icon["name"])){ register_error(elgg_echo("profile_manager:register_pre_check:missing", array("profile_icon"))); $error = true; } use $_files["profile_icon"]["tmp_path"] file path. $_files["profile_icon"] contains arrays of values name, tmp_path, type, size etc. on note need add enctype attribute <form> . and there function available moving upload function move_uploaded_file();

javascript - I have multiple <td> with the checkbox and its values.I want to change colour of <td> -

below html code contains multiple checkboxes respective values in <td> . got values of clicked checkboxes through php array format $res[] . want make checkbox disappear of got values , make <td> background color red value of checkbox visible. got values of checkboxes in php $res[0][seat]=>4; , $res[1][seat]=>1 4 , 1 values. how using jquery? <table> <tr> <td> <input name="chk" class='chk' type="checkbox" value="1"/> <label>1</label> </td> </tr> <tr> <td > <input name="chk" class='chk' type="checkbox" value="2"/> <label>2</label> </td> </tr> <tr> <td > <input name="chk" class='chk' type="checkbox" value="3"/> &l

objective c - Cocoa predefined resize mouse cursor? -

Image
is resize mouse cursor used preview (e.g. when resizing shapes) system cursor? it's not available directly method in nscursor doesn't there's private resource cursor in preview app's bundle either.. are there more system cursors other methods defined nscursor class..? i think particularly interested in these class methods (preview.app dissasembly). +[nscursor resizeangle45cursor]; calls +[nscursor _windowresizenortheastsouthwestcursor]; +[nscursor resizeangle135cursor]; calls +[nscursor _windowresizenorthwestsoutheastcursor]; according disassembly of appkit these private methods of nscursor. you can try in code e.g. (void)mousedown:(nsevent *)theevent { [[self window] disablecursorrects]; id cursor = [[nscursor class] performselector:@selector(_windowresizenortheastsouthwestcursor)]; [cursor push]; } there more undocumented cursors such as +[nscursor _helpcursor]; +[nscursor _zoomincursor]; +[nscursor _zoomoutcursor]; and many

password encryption - Can someone clarify how the PHP function crypt() works? -

from understanding crypt(string, salt), takes salt, tacks onto front of encrypted version of string parameter. $pw = "secret"; $format_and_salt = $2y$10$mwrmztkwmtc5zgjjzdi1nt; $hash = crypt($pw, $format_and_salt); $hash gets stored database column hashed_password $2y$10$mwrmztkwmtc5zgjjzdi1nofgsqugiu7ezetpe.uhjgqbmdrw2.vqm or broken down: first part $format_and_salt: $2y$10$mwrmztkwmtc5zgjjzdi1n (sans 't') + second part encrypted $pw: ofgsqugiu7ezetpe.uhjgqbmdrw2.vqm if use crypt again validate password user submits $_post against stored hashed_password in database, output both cases doesn't seem reflect logic described above. i'm missing something. so then: $existing_hash = $admin['hashed_password'] ($admin being array derived query). and crypt($pw, $existing_hash) returns $2y$10$mwrmztkwmtc5zgjjzdi1nofgsqugiu7ezetpe.uhjgqbmdrw2.vqm which identical $hash above. works validate or invalidate users submission $_post, me

java - Early image binding issue for treeviewer -

i have treeviewer in project explorer @ perspective level. want have children item icons under treeviewer changes per condition. may change item icon per created, resolved image path @ imageregistry level , got condition when tree item created. may have listener or property change handler change icon whenever needed. like this: public void addpropertychangelistener(propertychangelistener listener) { // changing } in property change listener should identify element(s) need have icons updated , call treeviewer.update() method elements. don't make decision @ point image display. inside labelprovider.getimage() method should check element , conditions retrieve correct image imageregistry .

c++ - Protecting executable from reverse engineering? -

i've been contemplating how protect c/c++ code disassembly , reverse engineering. never condone behavior myself in code; current protocol i've been working on must not ever inspected or understandable, security of various people. now new subject me, , internet not resourceful prevention against reverse engineering rather depicts tons of information on how reverse engineer some of things i've thought of far are: code injection (calling dummy functions before , after actual function calls) code obfustication (mangles disassembly of binary) write own startup routines (harder debuggers bind to) void startup(); int _start() { startup( ); exit (0) } void startup() { /* code here */ } runtime check debuggers (and force exit if detected) function trampolines void trampoline(void (*fnptr)(), bool ping = false) { if(ping) fnptr(); else trampoline(fnptr, true); } pointless allocations , dealloc

Writing Zend Framework 1.12 mysql "replace" -

i want write replace query update or insert multiple rows data. how can write in zend framework 1.12. is there options giving array values can insert/ update multiple rows @ same time?. please me this. use update method of table class . for example, if wanted give users primary keys (field id ) of 1, 2, 3 name (field name ) of bob: $users = new users(); $data = array( 'name' => 'bob' ); $where = array( sprintf('id in (%s)', implode(',', array(1,2,3))) ); $users->update($data, $where); if necessary, quote conditional(s) prevent sql injections. can update rows directly database adapter instance, see zend_db_adapter . note: implode allows 1 use data type has appropriate string representation.

sql - Reduce the use of AND operator in Oracle while comparing multiple NULL values in different columns -

i want compare multiple column's null values. eg. assume have 3 columns in table have find out not null values. using following code : select * table1 column1 not null , column2 not null , column3 not null i don't want use code uses "and" multiple times if columns goes on increasing. have option in oracle 11g ? i agree comment query fine is. if columns checking of numeric variety can use oracle's behavior null values advantage shorten query this: select * table 1 ( column1 + column2 + column3 ) not null; if of listed columns null sum null also. unfortunately, if have strings instead--null strings concatenate fine, same approach doesn't work them.

sip - Huawei - how to ASR statistics -

need information how asr (answer-seizure ratio) huawei. i heard, huawei recording cdr full call , not record cdr per routing tries. example scenario: - incoming call - static routes: first try -> "trunk 1", second try -> "trunk 5" if call success (connected trunk 1) - have 1 record in cdr - ok if call fail on trunk 1, success on trunk 5 - have 1 record in cdr - not normal. as expected, must have 2 records, 1 failed call (trunk 1) , 1 success (trunk 5) else, how can count asr statistics?

scala - ClosedChannel Exception -

i have following scala code: var cf:channelfuture = try { tlog().info(" before channel write ...........{} {}", _channel.isopen, _channel.getconfig.getconnecttimeoutmillis) _channel.write(rsp) } catch { case e:closedchannelexception => tlog.error("closedchannelexception thrown: nettytrigger @line 97") null case e:throwable => tlog.error("", e) null } if (inp != null) try { tlog().info(" before channel if *** write ...........{} {}", _channel.isopen, _channel.getconfig.getconnecttimeoutmillis) cf= _channel.write(new chunkedstream(inp)) } catch { case e:closedchannelexception => tlog.error("closedchannelexception thrown: nettytrigger @line 107") case e:throwable => tlog.error("", e) } when put load on our server throw below error : 2014-11-30 23:22:38 [new i/o worker #12] error c.z.blason.io.eventemitter - java.nio.channels.closedchannelexception: null @ o

c++ - shared_ptr or unique_ptr to CustomDialogEx -

hell all, i creating tab-controls on fly. purpose, doing customdialogex *tabpages[total_modules]; and in constructor doing cmoduletabctrl::cmoduletabctrl() { tabpages[0] = new cpodule; tabpages[1] = new csbmodule; tabpages[2] = new cptmodule; tabpages[3] = new cqsmodule; } and in init() method, doing void cmoduletabctrl::init() { // add dialog pages tabpages array. tabpages[0]->create(idd_dlg_p, this); tabpages[1]->create(idd_dlg_sb, this); tabpages[2]->create(idd_dlg_pt, this); tabpages[3]->create(idd_dlg_qs, this); } when tried use smart pointers this std::unique_ptr<customdialogex[total_modules]>tabpages; it giving error @ place calling base class member functions. example: tabpages[0]->create(idd_dlg_p, this); it gives following error... left of '->create' must point class/struct/union/generic type how implement using smart pointers? thanks. you're creating pointer a

Android set html content to textView with HtmlTextView class -

today i'm find class define html tag android widgets. after download , create new instance can not set textview. i'm search in class document can not find document how set class result textview: htmltextview text = new htmltextview(this); text.sethtmlfromstring("<h2>hello wold</h2><ul><li>cats</li><li>dogs</li></ul>", true); /* set text content */ content.settext ( text ); use this content.settext(html.fromhtml("your html string"));

javascript - Change color of child element if specific condition is satisfies -

i change color of child element if has "out of stock message". message generated @ run time, can changed other items , want change color if text "out of stock". can not modify code can apply css or javascript / jquery. here html code: <span id="stockstatus" class="status"> <span id="itemavail">out of stock</span> </span> i have tried jquery code not working: $(document).ready(function () { $(".status").each(function(){ if ($(this).children('span').text().trim() == "out of stock") { $(this).children('span').css("color", "red"); } }); }); after changing content(you have not mentioned how getting added on page), can use: $(".status span:contains(out of stock)").css("color", "red"); working demo

javascript - Get value from directive in html table -

Image
i using angular js. want value input inside row in table. below there input element. when click button (add) need value particular row. view <tr ng-click="" ng-repeat='customer in customers | filter:query | orderby: sort.field : sort.order'> <td ng-repeat='field in fields'> {{customer[field]}} </td> <td mult-ecs> <p class="input-group"> <span class="input-group-addon">rs</span> <input class="form-control" name="debit" type="text" ng-model="customer['id'].value"> </p> <button ng-click="addmulecs(customer['id'])" class="btn btn-primary btn-sm" >add</button> <button ng-click="removemulecs(customer[id])" class="btn btn-danger btn-sm" >remove</button>

visual studio 2010 - Can't collapse pieces of code after doing Ctrl + M, P -

Image
ctrl + m, p expands whole document. after doing can't collapse specific methods or pieces of code. it's not possible via shortcut keys (for example: ctrl + m, m ) neither via menu: as can see, ctrl + m, o possible collapses whole document also + en - signs disappear when ctrl + m, p in vs2012 toggling outline expansion [ctrl] + m, m. presume hasn't changed previous version. don't have vs2010 check...

java - How to design a checkbox treeviewer using jface -

i have designed checkbox treeviewer using jface when run program doesnot display thing on ui.i not able find issue is.please me whrer problem new jface. private void createtreemenu(composite parentcomposite){ /*treeitem = new treeitem(tree, swt.multi | swt.check | swt.virtual |swt.border ); treeitem.settext("(1)test session"); treeitem.setimage(new image(null, treeviewer.class.getclassloader().getresourceasstream("icons/folder-main.jpg")));*/ composite treemenu = new composite(parentcomposite, swt.border); treemenu.setlayout(new gridlayout(1, false)); treemenu.setlayoutdata(new griddata(griddata.fill, griddata.fill, true, true)); /*tree = new tree (treemenu, swt.multi | swt.check |swt.virtual ); griddata treegd = new griddata(swt.fill, griddata.fill, true, true); tree.setlayoutdata(treegd);*/ checkboxtreeviewer treeviewer=new checkboxtre

regression - R - Force certain parameter to have positive coefficient in lm() -

i know how constrain parameters in lm() have positive coefficient. there few packages or functions (e.g. display ) can make coefficient , intercept positive. for instance, in example, force x1 , x2 has positive coefficients. x1=c(na,rnorm(99)*10) x2=c(na,na,rnorm(98)*10) x3=rnorm(100)*10 y=sin(x1)+cos(x2)-x3+rnorm(100) lm(y~x1+x2+x3) call: lm(formula = y ~ x1 + x2 + x3) coefficients: (intercept) x1 x2 x3 -0.06278 0.02261 -0.02233 -0.99626 i have tried function nnnpls() in package 'nnls' , can control coefficient sign easily. unfortunately can't use due issues nas in data function doesn't allow na. i saw function glmc() can used apply constrains couldn't working. could let me know should do? you can use package penalized : set.seed(1) x1=c(na,rnorm(99)*10) x2=c(na,na,rnorm(98)*10) x3=rnorm(100)*10 y=sin(x1)+cos(x2)-x3+rnorm(100) df <- da

html - Why won't these anchor links work? -

i have anchor links working fine in navigation (services -> headhunting/executive search etc) anchor links on icons below nav not work. when put url (including tag) new browser window works ok) don't understand why can't work icons (or text below icons main nav). ideas? http://www.mapthemarket.co.uk i don't see anchors in page's source code. links menu use sort of javascript scrolling. this how make anchor in html: <a href="#headhunting">link headhunting anchor</a> <h3 id="headhunting">this headhunting section above link jumps to</h3>

objective c - iOS App Landscape Mode Launch Image Not Showing -

i'm developing ios app in landscape mode. i'm loading launchscreen images : default@2x.png, default-568h@2x.png, default-667h@2x.png, default-736h@3x.png. the problem whenever launch app in iphone6 or 6+ gets screen dimensions iphone5. p.s. i've tried using images.xcassets did not worked iphones<6. thanks. read ios human interface guidelines provided apple , confirm images in required sizes or not. go through image naming conventions approprite or not. because launch images should picked automatically per device , orientation. here link: https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/iconmatrix.html#//apple_ref/doc/uid/tp40006556-ch27-sw2

check type in regardingobjectid field in crm 2013 c# -

how can know type in regardingobjectid field in crm c#? (in our task entity can contact, account or incident). thank foe answer. davlumbaz's code correct it's bound style. in case of late bound, code be: entityreference regardingref = (entityreference)record["regardingobjectid"]; bool iscontact = regardingref.logicalname == "contact";

jquery - why to use jqgrid(client side) rather using asp.net grid view(server side) -

i know how use jqgrid , asp.net grid(server side) also.but have basic question. why should 1 use jqgrid(client side) if have gridview control (server side).please add why use client side development if every thing ready on server side development. please answer, in advance. you can refer below site better knowledge https://softwareengineering.stackexchange.com/questions/171203/what-are-the-difference-between-server-side-and-client-side-programming it u !!!!

How to add specific row from datagridview to listbox in VB.net -

when pressing button, want values specific row datagridview placed in listbox. example, when pressing budgie button, want details budgie, in row 1, placed in listbox (it's can calculate costs) however, when press button shows in listbox 'datagridviewrow { index=1 }' need change show values rather that? private sub btnbudgie_click(sender object, e eventargs) handles btnbudgie.click me.lstsales.items.add(datagridview1.rows(1)) end sub this works if select whole row: dim item string = "" try dim c integer = datagridview1.selectedrows(0).cells.count - 1 if c <= 0 c = 0 end if x = 0 c dim cell datagridviewcell = datagridview1.currentrow.cells(x) if x = datagridview1.selectedrows(0).cells.count - 1 item = item & cell.value else item = item & cell.value & " - " end if next

json - org.mozilla.javascript.EcmaError: TypeError: Cannot read property "length" from undefined -

when post (a json string) using curl i'm getting following error[1]; knows, how fix this? post json -d @endpointconfigimpl.json , file content like; endpoint_config='{ "production_endpoints": { "url": "http://gdata.youtube.com/feeds/api/standardfeeds", "config": null }, "endpoint_type": "http" }' [1] caused by: org.mozilla.javascript.ecmaerror: typeerror: cannot read property "length" undefined (/publisher/site/blocks/item-design/ajax/add.jag#11) @ org.mozilla.javascript.scriptruntime.constructerror(scriptruntime.java:3687) @ org.mozilla.javascript.scriptruntime.constructerror(scriptruntime.java:3665) @ org.mozilla.javascript.scriptruntime.typeerror(scriptruntime.java:3693)

antlr3 - Performance of compiler decreases drastically when using backtrack option -

i've implemented transpiler c-like language using c# version of antlr3 on windows7. to parse if/else statements use following rule: ifstatement : 'if' '(' expression ')' b1=block ( 'else' b2=block -> ^('if' expression $b1 $b2 'else') | 'else' ifstatement -> ^('if' expression $b1 ^(elsif ifstatement)) | -> ^('if' expression $b1) ) ; to translate tree generated rule own language c# use following grammar snippet: ifstatement options { backtrack = true; } : ^(n='if' expression b1=block) -> if( node={$n}, cond={$expression.st}, block1={$b1.st}, block2={null}, iselsif={($n.parent.text == "elsif") ? "true" : null}, node2={null} ) | ^(n='if' expression b1=block b2=block n2='else') -> if( node={$n},

ios - Push notification sound is not working -

i using push notifications in app.when notifications comes,i not getting notification sound of notification , in ipad settings switched-on notification buttons in ipad though notification sound not coming. { alert = "testing commands@2014-12-01t12:16:26", sound = "default" } i getting sound file this.but notification sound not coming. i new pushnotification concept.can please solve this... you should use json format send notifications encapsulated in aps dictionary like: { "aps" : { "alert" : "your message.", "badge" : 0, "sound" : "default" } } for complete reference: https://developer.apple.com/library/ios/documentation/networkinginternet/conceptual/remotenotificationspg/chapters/applepushservice.html

cordova - VS-MDA: Custom iOS-Framework in Plugin -

we want create mobfox-plugin our hybrid apps. running in cli-cordova apps, not work in our hybrid apps, because seems directory structure of framework (the symbolic links between headers , version directory) destroyed windows, framework inside plugin in mda project. if start build, header directory of not recognized symbolic link, ordinary executable textfile on mac. this how include framework in plugin xml: <framework src="libs/ios/mobfox.framework" custom="true"/> i tried copy mobfox.framework sdk frameworks folder , reference standard system libraries (which work well): <framework src="mobfox.framework" /> but fails, though framework included correctly in xcode. compiler says cannot find mobfox.h-class, how it's included: #import <mobfox/mobfox.h> so think problem windows cannot handle symbolic links inside .framework file. has workaround or solution problem? or idea why workaround placing file in standard-framewo

Unable to run my code in Ipython notebook. -

i unable run code inside ipython notebook. whenever run code, notebook gets struck , displays processing symbol(*). when close notebook , open again , execute command, able run commands inside notebook. can please me this in [*]: print "data" after closing , reopening notebook in [2]:print "data" data

android - horizontal listview for images -

i need show images in horizontally.i try use horizontal scroll viewer.but when number of images high gives me outofmemory error doesn't hadle loading images automatically trys load images memory.so there horizontal list view in android ? add entry in manifest.xml , application tag -> android:largeheap="true" eg: <application android:name="app_name" .. android:largeheap="true" ..> </application>

How to read large data from Excel files (14MB+) in PHP? -

how read large data excel files (14mb+) in phpexcel? have done excelreader says fatal error: allowed memory size of 134217728 bytes exhausted (tried allocate 36 bytes) in e:\xampp\htdocs\projects\pin\library\excel_reader2.php on line 1508 can 1 give me link read excel large data? increase memory php can use. edit php.ini , change memory_limit option, example: memory_limit = 128m ; /* change 128m needs */ also, read related post: ini_set("memory_limit") in php 5.3.3 not working @ all

ios - CBPeripheral interaction with Windows -

i have app in iphone device. app advertising cbperipheral service. created 1 app on mac allows interact mac desktop using cbcentral. exchanges data mac initiated handshake. wanted make interact windows 7 pc interact iphone app in similar manner. unable find proper way it. i have found this , minimum supported in windows 8. there way it? there no support microsoft bluetooth 4.0 aka btle prior windows 8.

solrj - Optimize single core of a solr server having multiple cores -

my solr server having multiple cores. possible optimize single core of using solrj? i believe you're looking for: public updateresponse optimize(string collection){} being collection: collection: complete logical index in solrcloud cluster. associated config set , made of 1 or more shards. if number of shards more one, distributed index, solrcloud lets refer collection name , not worry shards parameter required distributedsearch. and core: solr core: referred "core". running instance of lucene index along solr configuration (solrconfigxml, schemaxml, etc...) required use it. single solr application can contain 0 or more cores run largely in isolation can communicate each other if necessary via corecontainer. historical perspective: solr supported 1 index, , solrcore class singleton coordinating low-level functionality @ "core" of solr. when support added creating , managing multiple cores on fly, class r

sql - What exactly is SSRS for? -

i have heard lot ssrs tool , , planning use in project retrieving reports. however, not clear why ssrs should used. ssrs has, should use it? crystal reports? comparable? thanks! agree @pred bit of generic question, nevertheless: ssrs microsoft tool has integration platform, such sql server, .net, , on. crystal reports owned business objects, specialize in business intelligence software. for basic reports, either fine. find crystal reports / business objects works better more advanced reporting. i'd lean towards ssrs if you're on microsoft stack.

sql - Transpose Query Result in Oracle 11g -

i have query returns out result in following form: element reading1 reading2 reading3 --------------------------------------- 1 0.25 1.5 3.5 2 1.3 2.3 5.5 3 4.5 5.5 4.3 .. .. .. .. n 1.5 2.3 5.5 --------------------------------------- i want output in following form: 1 2 3 .. n --------------------------------------- reading1 0.25 1.3 4.5 .. 1.5 reading2 1.5 2.3 5.5 .. 2.3 reading3 3.5 5.5 4.3 .. 5.5 i.e have transpose table. have tried using oracle pivot following way: with t ( select element,reading1 zzz; ----(1) ) select * t pivot( max(reading1) element in (1,2,3,..n)) ----(2) this gives me result reading1,however unable produce result readings correctly. highly appreciated. thanks in advance, best regards, kunal you're close - want combination of unpiv

sendmail - Get notified when Email content invalid or mail is not delievered in php using sendgrid API -

we sending 1 lac email daily using sendgrid api. but happen thousand of mail undelievered recipient. we want list of these undelievered mail. how possible ? please suggest idea or links. becouse lost , appreciate assistance. thank you. wow..! made it... curl code- curl -x https://sendgrid.com/api/bounces.get.json?api_user=undefined&api_key=xxxxxxxx and here php code $ch =curl_init('https://sendgrid.com/api/bounces.get.jsonapi_user=10timeslocal&api_key=10timeslocal'); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_customrequest, "get"); curl_setopt($ch, curlopt_postfields, $data); $response = curl_exec($ch); thanks lot tried solve this.

play 2.3.6, java 1.8 how to pass session to scala templates -

i know there lot of links in discussion either related old framework version or don't work me, what want pass session scala templates without having pass them explicitly form controllers, didn't find examples(working) of implicit parameters in play 2.3.x version, view rendered ok(welcome.render(msg)) , in template i'm doing @(notice: string)(implicit session: play.api.mvc.session) gives me method render in class welcome cannot applied given types; error, tried with @(notice: string)(implicit request: play.api.mvc.request[any]) @(notice: string)(implicit request: requestheader) but none seem work, know can pass required session values controller i'm trying send user data that'd required in navbar required in each view don't want send controllers. any appreciated play session might retrieved scala templates session helper, statement below. altough i'm using play 2.2.1, may work well. btw, have never needed implicit parameter in order r

java - org.apache.jasper.JasperException: Unable to compile class for JSP pls helpz -

i'm making web application project using maven. i've jsp file index.jsp . here index.jsp : <%@ page language="java" contenttype="text/html; charset=iso-8859-1"%> <%@ page import="rajendra.arora.bitcoin.coinbaseexample" %> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> </head> <body> <p>my name fooo.</p> <% coinbaseexample ce=new coinbaseexample(); out.println(ce.gethttp("https://api.coinbase.com/v1/account/balance", null)); %> </body> </html> now, i've coinbaseexample.java file looks like: package rajendra.arora.bitcoin; import java.io.ioexception; import java.security.invalidkeyexception; import java.security