Posts

Showing posts from February, 2015

priority to index.html for index.php in .htaccess -

i trying set priority of index.php index.html (but landing page) in .htaccess file works fine but ?page_id=16 display same index.html page don't want rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d directoryindex index.html index.php rewriterule . /index.php [l] note: using wordpress. try code : rewriteengine on rewriterule ^$ /index.html [l,r=301]

javascript - Using jQuery to modify the name of a CSS class - Not working on load -

i have following code (using xslt/html) <div class="{@classname} modify""><img src="{substring-before(@image, ', ')}"/></div> the "classname" being through dynamically through cms, when there 2 options selected, segregated bunch of other characters. result end similar this: ;#class1;#class2;# what i'm trying modify class names based on set to. written following code, when entered browsers console window, works absolute charm. however, when added actual page, doesn't take effect. i'm wondering if it's priority thing or else: $('.modify').each(function(){ var newprimeitem= "primary item"; var newitem = "item"; if ( $(this).attr('class') == ";#primary;#item;# modify") { $(this).attr('class', newprimeitem);} if ( $(this).attr('class') == ";#item;# modify") { $(this).attr('class', newitem );} }); any on appreciated. ...

Release memory at Run-time in cocos2d iphone with ARC enabled -

i have enabled arc in cocos2d iphone project. facing 1 problem of elements not visible on-screen or off-screen. want release memory occupied elements @ run time.as have implemented arc in project release memory @ compile time. think should release memory @ run time memory optimization. demonstration have implemented infinite tiled map using 4 tile map object. files shown below. helloworldlayer.h #import "cocos2d.h" #import "box2d.h" #import "gles-render.h" #define ptm_ratio 32 @interface helloworldlayer : cclayer { cctmxtiledmap *map1; cctmxtiledmap *map2; cctmxtiledmap *map3; cctmxtiledmap *map4; cctmxtiledmap *defaultmap; float maptobeadded; int whichmap; cgsize screensize; int speed; bool complexmap; ccmenu *menu; } +(ccscene *) scene; @end helloworldlayer.mm #import "helloworldlayer.h" #import "appdelegate.h" #import "physicssprite.h" @implementation helloworldlayer ...

asp.net - Send parameter with accentuation c# -

i have page , in send event, need pass parameter value "name". name have accentuation and, in example name "raúl lozada" sends " ra&#250;l lozada " procedure parameter. how can correct it? in html page, loads correctly! <asp:boundfield datafield="user" headertext="user" /> sqlparameter myparam4 = ocommand.parameters.add("@user", sqldbtype.nchar); myparam4.value = row.cells[0].text; you need html unescape string, before sending db: use httputility.htmldecode : myparam4.value = httputility.htmldecode(row.cells[0].text);

javascript - ASP.NET Razor: add to Model moved List box items from another list box -

i have 2 list boxes below: @html.listbox("selectedlist",(ienumerable<selectlistitem>)viewbag.selectedlist, new { @class="listbox" , id="list2" }) <input id="btnadd" type="button" class="submit" value="add"/> <input id="btnremove" type="button" class="submit" value="remove"/> @html.listbox("nonselectedlist",(ienumerable<selectlistitem>)viewbag.nonselectedlist,new { @class="listbox" , id="list2" }) i move items between lists using add , remove buttons. working fine want add selected items model object. there way can that?

objective c - ObjCMongoDB framework and SyncServices in OSX -

i'm looking pointers on how keep coredata model in sync mongodb. i'm leveraging objcmongodb framework , can create objects in core data follows: coredataobj = [bsondecoder decodemanagedobjectwithclass:[hostname class] context:[self managedobjectcontext] data:[bson_host datavalue]]; unfortunately when re-import mongodb copy of same objects made , stored. i'm not sure if using objcmongodb framework incorrectly or if need using syncservices import data coredata model? can guide me or provide example? objcmongodb (of i'm author) performs deserialization core data, but, @ present, not deduplication or syncing. treats bson documents simple ordered dictionaries, without sense of identification attribute. in particular, treats _id other key. you can behavior want you'll need implement yourself. the easiest way implement -awakeafterusingcoder: or -aw...

c - LD_PRELOAD and clone() -

i'm using script run program ld_preload library created me intercept calls, works @ point process calls clone() , lose ability intercept what's next (the program run again without library), there way overcome this? call clone(child_stack, clone_vm | clone_fs | clone_files | clone_sighand | clone_thread | clone_sysvsem | clone_settls | clone_parent_settid | clone_child_cleartid, parent_tidptr, tls, child_tidptr) looking on parameters of clone saw there ability trace child process well, nothing pertaining preloading. i should mention i'm trying intercept calls on specific file descriptor , process clones file descriptors i'm not sure if possible want without flag clone (problem don't understand of them). update: i'm using trying log activity done qemu-dm (which run xen) #define _largefile64_source #define _gnu_source #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <dlfcn...

ios - How do I animate my subviews on adding them? -

i have developed font selection utilizes uipickerview , uitoolbar, both added on touching uibutton. but kind of pop in looks sloppy. is there way animate them? here method adds them (it's called on clicking button) : -(void)showpicker { [self.view addsubview:_fontpicker]; [self.view addsubview:pickertb]; } you can animate them in couple of ways, easiest fade them in. fade in [someview setalpha:0] [self.view addsubview:someview]; [uiview beginanimations:@"fadein" context:nil]; [uiview setanimationduration:0.5]; [uiview setanimationbeginsfromcurrentstate:yes]; [someview setalpha:1]; [uiview commitanimations]; fade out float fadeduration = 0.5; [uiview beginanimations:@"fadeout" context:nil]; [uiview setanimationduration:fadeduration ]; [uiview setanimationbeginsfromcurrentstate:yes]; [someview setalpha:0]; [uiview setanimationdidstopselector:@selector(removeview)]; [uiview commitanimations]; -(void) removeview { [some...

java - alert message from server to client -

i have big doubt, in j2ee application validations in class consult in ddbb, problem in case need send alert message client, think impossible, problem can not validation in part or in servlet because validation between diferent consults in diferent databse, think must hard code little work extrange validations, problem is... how can send alert message client? i past code: public string [] modificartablaadmin (connection conexion, string [] datosmodificar){ string [] resultado=new string[0]; string modificacion = ""; statement stmt=null; string [] condicion = null; string[] condicionb=null; string dia=""; string mes=""; string condiciongeneral = null; string horas=""; string minutos=""; string annio = ""; string segundos=""; string ojo =""; string ojo2 =""; string bas...

android - Its returning a error, but its in try-catch. Whats the error? -

my code want surrounded bt try-catch. did it, continue error caused by: java.lang.nullpointerexception @ java.text.simpledateformat.parse(simpledateformat.java:1001) @ java.text.dateformat.parse(dateformat.java:624) this code: simpledateformat sdf = new simpledateformat("dd/mm/yyyy hh:mm"); try{ date date = sdf.parse(dataultima); dataultima = new simpledateformat("dd/mm/yyyy hh:mm").format(date); } catch (parseexception e) { // todo auto-generated catch block e.printstacktrace(); } your code catching parseexception , nullpointerexception won't handled catch clause. guess either sdf null when code executes, or dataultima null when passed parse method (i don't remember how parse() responds null arguments). you can solve in number of ways. check see if variable causing exception null before executing try block, add catch nullpointerexception try/catch, or make parseexception block catch more generic exception (like e...

Set anchorpoint for rotation in Titanium -

how can set anchor-point rotation of image. over here, need place other images in rotated/tilted manner w.r.t first image. need set anchor-point of rotation first image on android have set anchor point on transform matrix. on ios have set anchor point view trying rotate. important undocumented behaviour: i've been struggling week , found out following: if try set anchorpoint view without first setting it's width or height, or setting them ti.ui.size anchorpoint @ 0,0. you can try code snippet should work. haven tested it, can idea. code should work both platforms. var anchor_x = 0.5; var anchor_y = 0.5; var view = ti.ui.createview({ // set height , width!!!! // if not anchor calculated width = 0 , height = 0 width: ti.ui.fill height: ti.ui.fill }); // it's ios (ipad or iphone) if (ti.platform.platform == 'iphone os') view.anchorpoint = {x: anchor_x, y: anchor_y}; var transform; // if it's android, create 2dmatri...

javascript - Passing JS-array to PHP, then updating MySQL -

i have problem. story far: php1 reads array database, contains integers - has following form: [0, 70, 44, ...] because number of entities contains varies, want able read , store whole array 1 cell of database - the solution must not disregard this, then. php1 contains js, allows user on website, alters 1 of entities in array, makes it, e.g.; [0, 75 , 44, ...] so far, good. now want new array replace 1 in database , central goal fail achieve. i'm working - isn't working: php1 executes ajax magic, , sends array php2 , works fine: var arrayx = [0, 75, 44, ...]; var arrayy = json.stringify(arrayx); $.ajax({ url: 'php2.php', type: 'post', data: {arrayy: arrayy } }); php2 connects db, , attempts update 1 cell new array, means of following, doesn't work (!): $arrayz = json_decode($_post['arrayy'], true); mysql_query("update userbase set db_column = $arrayz id=0", $con); mysql_close($con); i've trie...

html - How to make a php variable $_POST upon clicking it? -

i'm trying make $suggestion[$ss_count] become clickable link $_post once clicked. i'm trying achieve query expansion sort of effect. word of course needs information posted , needs recognized if ($_post['query']) the code use is: <?php if ($_post['query']) { $query = urlencode($_post['query']); $s_count = 0; $ss_count = 0; $query = 'http://www.dictionaryapi.com/api/v1/references/collegiate/xml/'.$query.'? key=135a6187-af83-4e85-85c1-1a28db11d5da'; $xml = new simplexmliterator(file_get_contents($query)); foreach ($xml -> suggestion $suggestion[$s_count]) { $s_count++; } if ($s_count > 1) { echo ('<h4>did mean?</h4>'); while ($ss_count <=$s_count) { echo ($suggestion[$ss_count].'<br>'); $ss_count++; } } } ?>

Linux C++ ARM-Cross-Compiler floor function bug? -

the following sample application supposed floor integer value: #include <iostream> #include <math.h> int round(double val) { return val + 0.5; } double round2(double val) { return floor(val + 0.5); } int main() { double val1 = 16.75; cout << "round 16.75: " << round(val1) << endl; cout << "round 21.60: " << round2(21.60) << endl; cout << "round 5.50: " << round(5.50) << endl; cout << "round 5.40: " << round2(5.40) << endl; } on desktop pc both function working correct. if cross-compile raspberry arm-gnueabi-toolchain (v4.7.2) , copy compiled file on raspberry execute it, function uses floor function returns zero. if compile application on raspberry works fine. is bug or doing wrong? update: arm-linux-gnueabi-readelf -h -a stamp elf header: magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 c...

Pass variables from java to javascript -

i'm new javascript programming, , have question not find answer anywhere. i have code in java stuff 2 double arrays double[] arrx = new double[sizea]; double[] arry = new double[sizeb]; then, need pass these 2 variables html/javascript code need use them. is possible? would recommend following: install apached tomcat http://tomcat.apache.org/tomcat-6.0-doc/appdev/ try hello world example included in apached tomcat http://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/ you find values in variables shown in gui. next step assigning java variables javascript variables, use following syntax <script type="text/javascript"> var jsvariable =<%javavariable%>; </script> hoping helps. cheers !!

asp.net - avoid duplicate entries, not key field -

i have table, has 2 columns key -> primary key, auto incremented reqnumber -> custom generated value the reqnumber structured year/month/day/number, number number of times request made day. example, if 3 requests made today , 2 yesterday, table have key reqnumber 1 2013/07/16/001 2 2013/07/16/002 3 2013/07/17/001 4 2013/07/17/002 5 2013/07/17/003 the problem i'm having sometime multiple users save @ same time. proc save, first checks how many created today , adds 1 that, above see 3 created today next 1 4. after insert. but if 2 users hit save @ same time, both 4, means when insert happens 2013/07/17/004 twice. is there way avoid this, either in sql or .net? locks way, slow performance correct? if want application able scale, you're going want create new table: create table daycounter ( lastreset datetime not null, nextvalue int not null ) then, you'll need function can next available value @ will: ...

android - Calculate difference between start angle and current measured angle/ Circle Calculation -

in application want calculate angle difference between start of application , current measured angle. therefore use sensor.type_accelerometer , sensor.type_magnetic_field current orientation. works quite well. here code: @override public void onsensorchanged(sensorevent event) { if (event.accuracy == sensormanager.sensor_status_unreliable) return; switch (event.sensor.gettype()) { case sensor.type_accelerometer: valuesaccelerometer = lowpass(event.values.clone(), valuesaccelerometer); break; case sensor.type_magnetic_field: valuesmagneticfield = lowpass(event.values.clone(), valuesmagneticfield); } boolean success = sensormanager.getrotationmatrix(matrixr, matrixi, valuesaccelerometer, valuesmagneticfield); if (success) { sensormanager.getorientation(matrixr, matrixvalues); azimuth = (float) math.todegrees(matrixvalues[0]); if (azimuth < 0.0f) { ...

Validation of empty fields in JavaScript and displaying text inside <p> tag -

this guestbook validation trying make. text in <p> tag not getting changed , don't know why. me validate form: function frmvalidate() { var nmchk = document.forms["guestform1"]["name"].value; var cmntchk = document.forms["guestform1"]["comment"].value; if (nmchk == null || nmchk == "") { var namep = document.getelementbyid("namep"); x.innerhtml = "name must filled out"; return false; } else { return true; } if (cmntchk == null || cmntchk == "") { var cmntp = document.getelementbyid("cmntp"); x.innerhtml = "comment must filled out"; return false; } else { return true; } } instead of var namep = document.getelementbyid("namep"); x.innerhtml="name must filled out"; you want var namep = document.getelementbyid("namep"); ...

excel - Format if table value does not match first row -

Image
i have test results data in excel this: correct d b c b c d student1 d b c b c d student2 d b c b c student3 d b c b d d student4 d d c b c student5 d d c b c d student6 d b c b b d i want highlight cells contain incorrect answers. how go it? the existing answer makes little sense me hence alternative:

About deleting, removing widgets and layouts in Qt 4 -

(i use qt 4.7, windows 7, 64bit). i created custom table. each row horizontal layout widgets. rows kept in qlist easy access, , children too. rows added inside parent widget. if resize parent widget, calculate new sizes, delete everything, , recreate again. my problem don't want delete widget. when clear table, it. since have widgets inside qlist , inside parent layouts, how can remove widgets in each row, delete layouts, , add new layouts? if do: takeat(0) every element inside each layout have qlayoutitem widget inside... how can delete layoutitem without deleting widget?.... how remove widget without killing it, no matter if it's in parent or child? because there many methods deleting: removeitem, removewidget... in layout, not takewidget... takeat() , gives qlayoutitem. i tried several ways, still see widgets no matter happened them. questions this: when widget deleted? if takewidget(index) layout, deleted time itself? happen if have pointer in list? re...

javascript - Changing the global variable from inside a function, or best practice to achieve the same -

i trying change variable called projectcounter in jquery project don't have repeat buttons inside each div each project. how can make change in 1 function accessible functions? have far: var projectcounter = 1; $('a').click(function() { function setvalue() { var projectcounter = projectcounter + 1; alert(window.projectcounter); } }); i have made jsfiddle also: http://jsfiddle.net/cpfrd/ var projectcounter = 1; $('a').click(function() { setvalue();//this calls function , makes happen }); //defining/declaring function, doesn't until called function setvalue() { projectcounter = projectcounter + 1;//no var keyword because want reference existing variable, not declare new 1 alert(window.projectcounter); } this should address problems why code not working. don't make claims best practice though.

c# - Items Common to Most Lists -

given list of lists (let's 5 lists, have real number work), can find items common 5 lists relative ease (see intersection of multiple lists ienumerable.intersect() ) using variation of following code: var list1 = new list<int>() { 1, 2, 3 }; var list2 = new list<int>() { 2, 3, 4 }; var list3 = new list<int>() { 3, 4, 5 }; var listoflists = new list<list<int>>() { list1, list2, list3 }; var intersection = listoflists.aggregate((previouslist, nextlist) => previouslist.intersect(nextlist).tolist()); now let's intersection ends containing 0 items. it's quite possible there objects common 4/5 lists. how go finding them in efficient way? i know run through combinations of 4 lists , save results, method doesn't scale (this have done on approx. 40 lists). if no item common 4 lists, search repeated looking items common 3/5 lists, etc. visually, represented lists of grid points , we're searching points have overlap. any ideas? ...

javascript - Not able to geo code japanese address using google API -

i implementing http://jsfiddle.net/zf6lg/ reverse geocoding. $(function () { var lat = 44.88623409320778, lng = -87.86480712897173, latlng = new google.maps.latlng(lat, lng), image = 'http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png'; //zoomcontrol: true, //zoomcontroloptions: google.maps.zoomcontrolstyle.large, var mapoptions = { center: new google.maps.latlng(lat, lng), zoom: 13, maptypeid: google.maps.maptypeid.roadmap, pancontrol: true, pancontroloptions: { position: google.maps.controlposition.top_right }, zoomcontrol: true, zoomcontroloptions: { style: google.maps.zoomcontrolstyle.large, position: google.maps.controlposition.top_left } }, map = new google.maps.map(document.getelementbyid('map_canvas'), mapoptions), marker = new google.maps.marker({ ...

javascript - JS POST request via form.submit() differs from click one -

i need submit post method form using javascript, form: <form action="" method="post"> <p> <input class="button white bigwidth" type="submit" name="imgcontinue" value="continue image ... "> </p> </form> and how try send via js: var form = document.getelementsbytagname("form"); if(form.length != 0) { form[0].submit(); } but doesn't work same way clicking on button (i checked there jquery click handlers attached) test page: http://imgmoney.com/img-515f13c1bb27c.html any suggestions how automaticly send form same way user mouse click it? request via form.submit() post http://imgmoney.com/img-515f13c1bb27c.html http/1.1 host: imgmoney.com connection: keep-alive content-length: 0 cache-control: max-age=0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 origin: http://imgmoney.com user-agent: mozilla/5.0 (windows nt 6.1) applewebkit/537.3...

html - How can I use jQuery to create a csv of all checked checkboxes associated text? -

i got of way need answer question here: how can value of labels associated checkboxes (and did break jsfiddle)? ...but have related question, namely, " how can use jquery create csv of checked checkboxes associated text? " what i've got far, missing piece commented, here: js fiddler link the html is: <button id="btndept">select depts</button> <div id="dialog" title="select depts want include in report" style="display:none;"> <div> <section class="breakafter"> <label for="ckbxselectall">select all</label> <input type="checkbox" id="ckbxselectall" /> <label for="ckbxdeselectall">deselect all</label> <input type="checkbox" id="ckbxdeselectall" /> </section> <label for="ckbx2">2</label> ...

Getting Unique Values in Multidimensional Array PHP -

i have array similar this: array(5) { [0]=> string(2) "32" [1]=> string(2) "67" [2]=> string(19) "2013-07-15 15:56:28" [3]=> string(1) "1" [4]=> string(4) "fail"} array(5) { [0]=> string(2) "32" [1]=> string(2) "89" [2]=> string(19) "2013-09-15 13:50:34" [3]=> string(1) "2" [4]=> string(4) "pass"} array(5) { [0]=> string(2) "37" [1]=> string(2) "55" [2]=> string(19) "2013-07-15 16:36:12" [3]=> string(1) "1" [4]=> string(4) "fail"} array(5) { [0]=> string(2) "39" [1]=> string(2) "92" [2]=> string(19) "2013-08-15 15:46:20" [3]=> string(1) "1" [4]=> string(4) "pass"} the first value displays content id, second score, third date, fourth attempt number (no limit), , fifth result. want print these values in browser, if there mor...

java - SOAP Body elements -

after generating client code wsdl proper. after envelope did sysout , body elements has <http: / www.siebel.com /xml / contactinfo>xyz</http://www.siebel.com/xml/contactinfo> <http: /www.siebel.com /xml / contactinfo>john</http://www.siebel.com/xml/contactinfo> <http:/www.siebel.com /xml / contactinfo>smith</http://www.siebel.com/xml/contactinfo> instead of thing this <sov:contact> <sov:personuid>xyz</sov:personuid> <sov:firstname>john</sov:firstname> <sov:lastname>smith</sov:lastname> </sov:contact> should add code <sov:contact> instead of <http: / www.siebel.com /xm.... this caused axiom-421 . issue occurs axiom versions in combination stax implementations. the solution either upgrade newer axiom version or add woodstox application used instead of weblogic's stax implementation.

c# - delete row based on a condition -

i coding in c# , using microsoft.office.interop.excel. have columns a-f , rows don't have value in column b. want loop through column b , find cells no text/value , delete entire row. manged loop through column b , find null cell, when try delete row- nothing happens. here code: excel.range b = objsheet.get_range("b1:b" + lastusedrow, system.type.missing); foreach (excel.range r in b) { string column = r.text.tostring(); if (string.isnullorempty(column)) { excel.range bentirerow = objsheet.get_range(r + "1:" + r + "b" + lastusedcolumn, system.type.missing); // excel.range bentirerow2 = r.entirerow; bentirerow.delete(microsoft.office.interop.excel.xldirection.xlup); } } rather looping through column can following; vba code: range("b1:b" + lastusedrow).specialcells(xlcelltypeblanks).entirerow.delete in c# use: .specialcells(excel.xlcelltype.xlcelltypeblanks) btw wouldn't name...

arrays - Python string "b" prefix (byte literals) -

i looking through unit testing code , found this: self.assertin(b'hello', res.body) i know means bytes in python 3 returns byte array , found here . believe code written python 3.3 , trying figure out how works in other versions (in case 2.7) related question found had poorly-written accepted answer contradictory comments confused me. questions: in versions of python b'mystring' "work"? how behave in python 2.x? how behave in python 3.x? does have byte literal change ? this described in document linked. in versions of python b'mystring' "work"?: 2.6+. how behave in python 2.x? it creates bytes literal—which exact same thing str literal in 2.x. how behave in python 3.x? it creates bytes literal—which not same thing str literal in 3.x. does have byte literal change? yes. that's whole point; lets write "future compatible" code—or code works in both 2.6+ , 3.0+ without 2to3 . quoting fir...

ios - cellForRowAtIndexPath is getting called only once -

i don't know doing wrong cellforrowatindexpath method of table view getting called once. here code: - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { nslog(@"--->%d",[collaboratoresdata count]); return [collaboratoresdata count]; } when collaboratoresdata array filled, calling [_collaboratortblview reloaddata] reload table view. i getting 3 in nslog(@"--->%d",[collaboratoresdata count]); cellforrowatindexpath getting called 1 time. -(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; // add placeholder cell while waiting on table data uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:nil] autorelease]; } ce...

asp.net mvc - How do I resolve ConfigurationErrorsException when running MVC3 project on a server with MVC3 & 4 installed? -

i have project developed on machine mvc3 installed. copied project machine has both3 mvc , mvc4 installed. reason getting error below. mvc3 , mvc4 supposed able run side side. think error has mvc4 being installed, since membership provider changed between 3 , 4. not sure how isolate problem. how resolve configurationerrorsexception when running mvc3 project on dev machine has both mvc3 , mvc4 installed? system.configuration.configurationerrorsexception unhandled user code message=exception has been thrown target of invocation. (c:\projects\acme\bom&mrp\acmewidget\acme.widget.web\web.config line 42) source=system.web baremessage=exception has been thrown target of invocation. filename=c:\projects\acme\bom&mrp\acmewidget\acme.widget.web\web.config line=42 stacktrace: @ system.web.security.membership.initialize() @ system.web.security.membership.get_provider() innerexception: system.reflection.targetinvocationexception message=exception ha...

cygwin - How to convert generated Private Key in Openssh format to integrate subversion in IDEA IDE -

Image
i needed generate private/public key in openssh format have me integrate subversion repository intellij. have used puttykeygen.exe generate initial key. while integrating in intellij, failing me authenticate same private key. how can convert putty generated private/public initial key openssh format. read, subversion integration in intellij uses cygwin/openssh format of private key. p.s: have tried puttykeygen same no luck! idea ide still fails authenticate. anyone can shed light on helpful. thanks! edit after going through following steps create openssh private key : puttygen has menu: conversion -> export openssh key save private key openssh format . i have again tried integrating idea using same key got generated using above mentioned direction. , got myself failed same message saying authentication failed! i assuming, key obtained either not openssh format or there proceeding wrong integration. please let me know possibly reason of me not able integrate subver...

Get php to output Json with out quotes so that javascript will see it as a object -

here problem having able output javascript object { id : "title", name : "title", field : "title", width : 200, cssclass : "cell-title", editor : slick.editors.text } notice editor : slick.editors.text not in quotes of kind. i can output this... can't seem php not put quotes around slick.editor.text {"id":"title","name":"title","field":"title","width":200,"cssclass":"cell-title","editor":"slick.editors.text"} here php code using output string. public function creatcolumn($id, $name, $field, $width, $cssclass, $editor = null) { $obj = (object) array('id'=>$id, 'name'=>$name, 'field'=>$field, 'width'=>$width, 'cssclass'=> $cssclass, 'editor' => $editor); return json_encode($obj); } is there way output php json object php ...

java - IntelliJ does not find native libraries for OpenCV when adding jar as a dependency for Play project -

i working on play 2.1 project, in requests web-service handle downloading user-supplied images, re-sizing , re-cropping them, , filtering out known bad photos (for example, don't want users upload company logos). trying use opencv handle back-end work, can't seem intellij add opencv jar in way works java project. i've been able build opencv source, without issue. left me following folder: /home/charles/opencv/release inside folder, have 3 files of interest: bin/opencv-246.jar lib/cv2.so lib/libopencv_java246.so if try add jar file intellij new java library, seemingly finds classes/methods, , can write code using auto-complete. can click on respective classes or methods, , brings me right files. however, when try run play project, error: [info] loading project definition /home/charles/github/imageproject [info] set current project imageproject (in build file:/home/charles/github/imageproject/) --- (running application sbt, auto-reloading enabled) --- ...

android - Facebook connectivity using Jabber ID -

in app, instead of using saslauthentication such x-facebook-platform, i'm using facebook jabber id method login. from this reference, got following piece of code public void connecttofb() throws xmppexception { connectionconfiguration config = new connectionconfiguration("chat.facebook.com", 5222); config.setsaslauthenticationenabled(true); config.setsecuritymode(securitymode.required); config.setrosterloadedatlogin(true); config.settruststorepath("/system/etc/security/cacerts.bks"); config.settruststorepassword("changeit"); config.settruststoretype("bks"); config.setsendpresence(false); try { sslcontext sc = sslcontext.getinstance("tls"); sc.init(null, memorizingtrustmanager.getinstancelist(this), new java.security.securerandom()); config.setcustomsslcontext(sc); } catch (generalsecurityexception e) { log.w("tag", "unable use memorizingtrustmanager", e); } xmppconnection xmpp = new xmpp...

502 Bad Gateway error Nginx and uWSGI in deploying Flask app -

i'm trying deploy flask app on linode vps running ubuntu 10.10. i've been following tutorial ( https://library.linode.com/web-servers/nginx/python-uwsgi/ubuntu-10.10-maverick#sph_configure-nginx ) keep getting 502 bad gateway error. here /etc/default/uwsgi: pythonpath=/var/www/reframeit-im module=wsgi here /var/www/reframeit-im/wsgi.py: # add application directory python path import sys sys.path.append("/var/www/reframeit-im") # run flask app reframeit import app application here app's nginx config file, symlinked /sites-enabled directory (/opt/nginx/conf/sites-enabled/reframeit-im): server { listen 80; server_name www.reframeit-im.coshx.com reframeit-im.coshx.com; access_log /var/www/reframeit-im/logs/access.log; error_log /var/www/reframeit-im/logs/error.log; location / { include uwsgi_params; uwsgi_pass 127.0.0.1:9001; } } i checked nginx error logs app , found this: 2013/07/17 19:30:19 [error] 20037...

JavaScript count in line with PHP loop -

i have page 2 drop-down menus. option selected in first drop-down menu controls displayed in second. the code nice , easy when drop-down menus used once - i'm looking repeat each set of drop-down menus four times. drop-down menu 1 assigned id experience[<?php echo $i; ?>][manufacturer] . drop-down menu 2 assigned id experience[<?php echo $i; ?>][type] . essentially, i've got is: <select id="experience[1][manufacturer]">...</select> <select id="experience[2][manufacturer]">...</select> <select id="experience[3][manufacturer]">...</select> <select id="experience[4][manufacturer]">...</select> ... followed by: <select id="experience[1][type]">...</select> <select id="experience[2][type]">...</select> <select id="experience[3][type]">...</select> <select id="experience[4][type]">...<...

php - mysqli_real_escape_string and stripslashes returning blank variables -

i using following code clean variables returned forms. swapped on mysql mysqli result function below stripping variables being blank. //start session session_start(); //include database connection details require_once('config.php'); //array store validation errors $errmsg_arr = array(); //validation error flag $errflag = false; //connect mysql server $link = mysqli_connect(db_host, db_user, db_password); if(!$link) { die('failed connect server: ' . mysqli_error()); } //select database $db = mysqli_select_db($link,db_database); if(!$db) { die("unable select database"); } //function sanitize values received form. prevents sql injection function clean($str) { $str = @trim($str); if(get_magic_quotes_gpc()) { $str = stripslashes($str); } return mysqli_real_escape_string($link,$str); } //sanitize post values $login = clean($_post['login']); $password = clean($_post['password']); //input validations if($lo...

javascript - How to tell JSLint / JSHint what global variables are already defined -

in project have global variables work containers: myproject.myfreature.somefunction = function() { ... } so use script across site , jslint / jshint complains that: 'myproject' not defined i know can go every javascript file , add comment /*global myproject*/ on top of it. i'm looking way define comment in sort of config file don't have go file file adding comment. some kind on option in config/jshint.yml nice. for jshint can create .jshintrc project directory with { "globals": { "myproject": true } }

html - Make objects fill remaining div vertically -

i have 2 buttons located within div, want them take entire space remaining vertically. just now, looks this: header --------------------------- button 1 button 2 --------------------------- footer how can make 2 submit buttons take entire space? html: <body> <header> <h1>{title}</h1> </header> <div id="wrapper"> <div id="main-content"> <!--<div class="innerinstructions">choose direction.</div>--> <form action="app-web.php" method="get" class="main-form clocking"> <input type="hidden" name="do" value="performclock" /> <input type="hidden" name="uid" id="uid" value="'.$uid.'" /> <input type="submit" name="clockaction" value="in &rarr;" accesskey...

c - I can't build HELLO, WORLD program? -

i new learning c , i'm on windows (i want learn on windows). i have installed gcc on cygwin, , i'm using netbeans ide . source: #include <stdio.h> main() { printf("hello, world!\n"); return 0; } i error when building above code: "/usr/bin/make" -f nbproject/makefile-debug.mk qmake= subprojects= .build-conf make[1]: entering directory `/cygdrive/g/vs projects/hello world' "/usr/bin/make" -f nbproject/makefile-debug.mk dist/debug/cygwin_4.x-windows/hello_world.exe make[2]: entering directory `/cygdrive/g/vs projects/hello world' mkdir -p build/debug/cygwin_4.x-windows rm -f build/debug/cygwin_4.x-windows/helloworld.o.d gcc -c -g -mmd -mp -mf build/debug/cygwin_4.x-windows/helloworld.o.d -o build/debug/cygwin_4.x-windows/helloworld.o helloworld.c mkdir -p dist/debug/cygwin_4.x-windows gcc -o dist/debug/cygwin_4.x-windows/hello_world build/debug/cygwin_4.x-windows/helloworld.o build/debug/cygwin_4.x-window...