Posts

Showing posts from May, 2015

php - HTTP Error 500 (Internal Server Error) in Drupal -

iam providing datas using json ios app using php. while running code in browser, showing server error. if there no values in database, shows {"posts":null} provided in code. problem occurs if there value in database. shows error server error website encountered error while retrieving http://path server file/php/categoryitemlisting.php?category=11. may down maintenance or configured incorrectly. here suggestions: reload webpage later. http error 500 (internal server error): unexpected condition encountered while server attempting fulfill request. error occuring php file. using other files, able transfer data. my connection.php file : <?php $link = mysql_connect("127.0.0.1","root","") or die('cannot connect db'); mysql_set_charset("utf8"); mysql_select_db('cotton',$link) or die('cannot select db'); ?> categoryitemlisting.php <?php require('connection.php'); $item = array()

apk - How to Access sysfs entry from android application -

can please explain me on how access value exposed sysfs android application. a reference suggests can not access here but there 1 android application same. please explain. i found answer after research this how works. //cmd path of script executed string cmd = "/home_dir/./my_shell_script.sh" ; runtime run = runtime.getruntime() ; //this run script java process pr = run.exec(cmd) ; the values returned can read this bufferedreader buf = new bufferedreader(new inputstreamreader(pr.getinputstream())); try { string string = buf.readline(); char[] text = string.tochararray(); int start = 0; int len = string.length(); textview.settext(text, start, len); toast.maketext(this, string, toast.length_short).show(); } catch (ioexception e) { toast.maketext(this, e.getmessage(), toast.length_short).show(); } it show variable/output in toast message. references: 1 executing shell c

ios - Warning: Signed shift result (0x1F0000000) requires 34 bits to represent, but 'int' only has 32 bits -

after compiling remail project no error, 1 of warnings is: remail-iphone/sqlite3/sqlite3.c:18703:15: signed shift result (0x1f0000000) requires 34 bits represent, 'int' has 32 bits i.e. (0x1f<<28) in following code: if (!(a&0x80)) { &= (0x1f<<28)|(0x7f<<14)|(0x7f); b &= (0x7f<<14)|(0x7f); b = b<<7; |= b; s = s>>11; *v = ((u64)s)<<32 | a; return 7; } what's proper way kill warning ios (32-bit)? remail iphone seems using old version of sqlite (3.6.15). if i'm not mistaken, following commit should fix problem: http://www.sqlite.org/src/info/587109c81a9cf479?sbs=0 if (!(a&0x80)) { /* assert( ((0xff<<28)|(0x7f<<14)|(0x7f))==0xf01fc07f ); */ &= 0xf01fc07f; b &= (0x7f<<14)|(0x7f); b = b<<7; |= b; s = s>>11; *v = ((u64)s)<<32 | a; return 7; } however, there might other code sect

javascript - Highlight an item in jQuery UI Multiselect Next -

i have jquery ui multiselect next http://quasipartikel.at/multiselect_next want highlight item using colour. for example, have: <select id="countries" class="multiselect" multiple="multiple" name="countries[]"> <option value="afghanistan" selected="selected">afganistan</option> <option value="albania" selected="selected">albania</option> <option value="austria" selected="selected">austria</option> <option value="germany" selected="selected">germany</option> </select> is possible highlight germany in red? i using highlight 4th row: .ui-multiselect ul.selected > li:nth-child(3) { background:none; background-color:green; } if want multiple replace li li:nth-child(2n+1) odd etc… hope helps.

javascript - jQuery - this.option becomes undefined in load function -

i'm trying alter plugin little bit, here's prototype function, i've marked lines i've added. ok, problem happens inside img-load function i've added. i've surrounded old code 1 assure script waits until image has loaded. problem is, "this" inside load-function not connected 1 outside. i've tried giving load function parameter apparently it's not working or i'm doing wrong. do know easy way sort-of inherit "this"? don't know else do. plugin.prototype._fade = function(number) { var $element, currentslide, next, slidescontrol, value, _this = this; $element = $(this.element); this.data = $.data(this); if (!this.data.animating && number !== this.data.current + 1) { $.data(this, "animating", true); currentslide = this.data.current; if (number) { number = number - 1; value = number > currentslide ? 1 : -1; next = number; } else { value = this.data.dire

c# - Cannot re-assign a value to XSLT variable, or can I exit from for-each loop conditionally -

cannot re-assign value xslt variable, or can exit from <xsl:for-each conditionally xml <r> <a id="a"> <s id="a111">1</s> <s id="a222">2</s> <s id="a333">3 <s id="a3331">3.1</s> <s id="a3332">3.2</s> <s id="a3333">3.3</s> </s> <s id="a444">4</s> <s id="a555">5</s> <s id="a666">6</s> </a> <a id="x"> <s id="x111">1</s> <s id="x222">2</s> <s id="x333">3 <s id="x3331">3.1</s> <s id="x3332">3.2</s> <s id="x3333">3.3</s> </s> <s id="x444">4</s> <s id="x555">5</s> <

objective c - Generate unique name everytime like "Windows folder structure" behaviour -

i want create folder structure logic windows.i using sqlite database that. want generate unique name everytime. e.g. if user enters text name "new". , if again enter same name "new" should new(1). if again enter same name "new" should "new(2)". if user delete "new(1)" entry , enter "new" "new(1)" should placed in between "new" , "new(2)". could suggest logic that? appreciated? in advance tejas i consider have database id , foldername fields. need retrieve records database. in of query use like operator. once list go in loop , add add new entry comparing number. try this.

c# - DropDownList.DataTextField can't be bound to a dataset? -

Image
i'm trying bind dataset dropdownlist , throws httpexception here's i'm trying do if (dsgroupsnotonfestival.tables[0].rows.count > 0) { //bind dataset new group selection ddlnewgroup.datasource = dsgroupsnotonfestival.tables[0].defaultview; ddlnewgroup.datavaluefield = "band_id"; ddlnewgroup.datatextfield = "band_naam"; ddlnewgroup.databind(); } else { ddlnewgroup.items.add(new listitem("no groups add")); } the exception message: databinding: 'system.data.datarowview' not contain property name 'band_naam'. i'm absolutely positive dataset contains column title band_naam. can see, exception thrown when binding datatextfield , meaning datavaluefield bound correctly, right? edit: this stored procedure: use [groep2_festivals] go /****** object: storedprocedure [dbo].[getgroupsoffestival] script date: 14-05-13 12:31:18 pm ******/ set ansi_nulls on go set quoted_identifier on go

gcc4.8 - "make check" cannot find installed shared libraries -

installing gcc 4.8, using recommended infrastructure libs reduce possible issues. built , installed gmp using default settings--> shared libs went /usr/local/lib built isl, make check cannot find installed gmp shared lib. installed isl anyway, shared libs went /usr/local/lib. built cloog, make check cannot find either installed isl or gmp shared libs so went cloog-0.18.0/.libs/ , made soft links /usr/local/lib/libisl.so.10.1.1 , libgmp.so.3 , re-ran make check without failures. these recommended infastructure tarballs downloaded gcc ftp server, , built , installed using default configuration. why might "make check" unable find shared libraries installed? should add: new ubuntu installation you need make sure /usr/local/lib in global shared library config -- check /etc/ld.so.conf -- /usr/local/lib should there or in 1 of files includes. if not, add , run ldconfig root rebuild cache.

asp.net - IE 10 with no add on mode, ruins my all css settings of web app -

Image
i have web app, works fine in normal mode , on version of ie, ff , chrome well, when run on ie 10 no add on mode, ruins settings of css ! what can done? reinstalling ie doesn't helps! please guide me! it may you remove older doctype declaration of: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> replace newer html5 declaration: <!doctype html> <meta http-equiv="x-ua-compatible" content="ie=emulateie9">

iOS reordering a UITableView -

Image
i have uitableview reads data sql db. when reorder data changes top , bottom ones dragging 1 top bottom when let go @ 5 switches top , bottom ones. using following - (void)tableview:(uitableview *)tableview moverowatindexpath:(nsindexpath *)fromindexpath toindexpath:(nsindexpath *)toindexpath { [mystringsarray exchangeobjectatindex:fromindexpath.row withobjectatindex:toindexpath.row]; } how can reorder list? it'll 2,3,4,5,1 , not 5,2,3,4,1 exchange not proper way should use this. - (void)tableview:(uitableview *)tableview moverowatindexpath:(nsindexpath *)fromindexpath toindexpath:(nsindexpath *)toindexpath { id buffer = [mystringsarray objectatindex:fromindexpath.row]; [mystringsarray removeobjectatindex:fromindexpath.row]; [mystringsarray insertobject:buffer atindex:toindexpath.row]; } edited match comment below.

xml - XMLParser in java -

while using getnodename, return actual value "#text" prefix. not want prefix. if remove space , newlines, getnodename working fine. using documentbuilderfactory,documentbuilder , document parse xml. my xml file <test> <a> file1 </a> <b> file2 </b> <c> <files> <file> myfile1 </file> </files> </c> </test> my java method nodelist childnodes = null; nodelist parentnodes = xml.getnodelist("test"); int node_len = parentnodes.getlength(); (int = 0; < node_len; i++) { childnodes = parentnodes.item(i).getchildnodes(); int child_len = childnodes.getlength(); (int j = 0; j < child_len; j++) { node datanode = childnodes.item(j); system.out.println(datanode.getnodename()); } } please me clear issue. advance. in xml node, , nodes implement getnodename()

javascript - Linkyfing european phone number -

Image
i searching regex replaces random phone number <a href> . phone numbers should swedish, non-swedish should supported. i support following formats: (0 + 9 numbers) +46xxxxxxxxx 0046xxxxxxxxx 0xxxxxxxxx (0 + 8 numbers) +46xxxxxxxx 0046xxxxxxxx 0xxxxxxxx (0 + 7 numbers) +46xxxxxxx 0046xxxxxxx 0xxxxxxx usually formatted according format this page, have no requirement support (although great). what have tried far, tried lot of regex. using this answer tried make own version of it, can't seem work. closest have come regex, yet removes much: /( |^|>)((((\+|00)[0-9]{2} ?(\(0\))?)|0)([0-9]{2}-? ?[0-9]{7})|([0-9]{3}-? ?[0-9]{6})|([0-9]{1}-? ?[0-9]{8}))( |$|<)/gi this fiddle: http://jsfiddle.net/xaxy4/1/ the goal of script identify phone numbers , make them <a href="tel:xxx">xxx</a> link. current code is: $(document).ready(function () { var patt=/( |^|>)((((\+|00)[0-9]{2} ?(\(0\))?)|0)([0-9]{2}-? ?[0-9]{7})

user interface - How to shorten the namespace of custom view in xml in android? -

i have custom view defined deep in package structure. <com.android.notepad.example.customview.myedittext id="@+id/note" ... /> it not visually use entire package name everywhere want use view. can shortened? we specify namespace in androidmanifest.xml! (e.g com.android.notepad.example specified in androidmanifest.xml file)

multithreading - Threads in Java getting NullPointerException -

i'm trying call thread in java. want check if thread interrupted or not. thread defined in class "scheduler". here's code: if (flag == true) { thread = new scheduler(); thread.start(); } else { thread.interrupt(); } public void run() { while (thread.isinterrupted() != true) // here npe... { //.... } } is run() code snippet scheduler ? in run why have thread.isinterrupted() ? instead use thread.currentthread().isinterrupted() also see constructor , thread variable declared

jquery - Dialog doesn't "pop up" but redirects the entire page -

i working on calendar using fullcalendar jquery plugin. need dialog opened when click event. when click event on calender split second gray background when open dialog, dialog supposed pop-up clears page , opens (so calendar dissapears). i've been looking everwhere , can't figure out i'm doing wrong. this code clickevent : eventclick: function (event) { if (event.url) { var page = event.url var title = "test" var $dialog = $('<div></div>') .html('<iframe style="border: 0px; " src="' + page + '" width="100%" height="100%"></iframe>') .dialog({ autoopen: false, modal: true, height: 300, width: 600, title: title, position: "top" }); $dialog.dialog('open'); } return false } edit :

javascript - I want to access the values of the keys of an object? -

i'm using api , i'm getting response of on success function data. i'm trying use gives me "keys" of objects not there values, question is: can values using below approach? i have got "keys" of objects using javascript's object.key() method want values too. here response. have taken snippet of response here got in console. division: object active: 1 country: "united states" lat: 42.3584647 lon: -71.05962 name: "boston" url: "http://yipit.com/boston/" below function written key of object: function getvalues(data){ for(var = 0;i <= data.response.deals.length-1; i++){ var obj = []; var num = + 1; var keyarray = object.keys(data.response.deals[i].division); $('#empid h6').html(keyarray); //here keys of objects country,lat,lon etc. console.log("value of keyarray "+num+" "+keyarray); } } the underscore library ha

osx - How to set up a NSLayoutConstraint in a NSScrollView? -

Image
i new nslayoutconstraint . i want manage content of nsscrollview programmatically. @ end, want create subclass of nsscrollview method - add:(nsview *)aview add aview after others , enlarge documentview of nsscrollview if necessary. (all osx) guess exists can't find it, if knows find this, in ;) here picture can understand : my plan use nslayoutconstraint s. constraints : equal vertical space between view 1 , view 2 , etc. the documentview height should adapt sum of heights of view 1 , view 2 , etc. some fixed vertical margins between documentview and view 1 , last view . view 1 , view 2 , etc. right-aligned so, let come question : have started adding view 1 (i see after rest). did following : thescrollview nsscrollview ; newsubview view want add ; respect picture, view 1 . thecontainer = [[nsview alloc] initwithframe:nsmakerect(0, 0, 0, 0)] ; [thescrollview setdocumentview:thecontainer] ; [newsubview settranslatesautoresizingmaskintoconstraints

javascript - Setting values of selected checkbox -

i have checkboxe dynamically appear number of times based on database. each checkbox id generated dynamically. initial value of $i 1. <input type="checkbox" name="ch[]" id="<?php echo $i - 1;?>" /> now want set value of each selected checkbox 1 , 0 unselected checkbox in real time . plz me. if understood correctly, set values in real time need following: $("[name='ch[]']").on("change", function() { this.value = +this.checked; }); demo: http://jsfiddle.net/mmsfb/

unable to get cmake + jom + parallel execution + multiple custom targets -

how make parallel execution custom targets on $windows$, without using msvc? i have moderately results parallel job execution using cmake + jom , when compiling c++ targets. have targets, generate code. problem run on single core :( the cmake files quite complex now, in pseudo-code looks this add_custom_target(generate_all) foreach(domain ${domains}) add_custom_target(generate_${domain} command command-that-generates-domain-code ) add_dependencies(generate_all generate_${domain}) endforeach() when invoke jom generate_all , want dependant targets executed on cores. ok, solve problem, used ninja build system instead. because of visual studio strange compilation problems, compiled ninja under gentoo box (using mingw32-gcc toolchain). compiles without issues on win box, mingw . afterwards, can used on win box compile (c/cpp code, gnu/msvc compilers, + parallel job execution targets).

jquery - Open/Close multiple div with external content loaded -

i'm trying create portfolio loads external content when clicking on "read more". loading external content works fine , div animates should. got same div close , open when click on "read more" link. my problem when click on same "read more" link div don't close, animates , load external content again. i hope makes sense... my html follows: <div id="portfolio-content"></div> <div id="isotope-container"> <div class="element webdesign"> <header> <h3>test title: webdesign</h3> </header> <img src="images/test_img_01.jpg" alt="" title=""/> <ul class="meta clearfix"> <li>filter:</li> <li><a href="" title="

c# - Which method in EF5 is in charge of creating database -

i have couple of questions: in ef5 code first api method in charge of checks if database exits, , if it's not case method creates database? if use ef code first dal project , want ef generate other database testing purpose can using ef? i've changed initial catalog in connection string check if creates other database not , threw exception by using ef code-first or database-first, have dbcontext class, ef5 how knows used method it's internal actions? thanks. api check if exists context.database.exists(); , context.database.createifnotexits(); as access ef context starts doing things. there default behavior can manipulate things. a context can open again different db instances yes. can use create different dbs on same server. careful use of constructor , corresponsing api.config setting required. <connectionstrings> <add name="youcanhavemanyoftheese" connectionstring="data source=localhost;initial catalog=different dbna

python - How to get single related object after filter -

i got parent-children (1-n) model relation: class parent(models.model): some_fields = models.integerfield() class child(models.model): parent = models.foreignkey(parent, relatend_name='children') first = models.booleanfield() second = models.booleanfield() now filter parents based on children fields: parent.objects.filter(children__first=true) this generates following sql: select app_parent.* app_parent inner join app_child on app_parent.id = app_child.parent_id app_child.first = true after got parent fields but want related child fields sql that: select app_parent.*, app_child.* app_parent inner join app_child on app_parent.id = app_child.parent_id app_child.first = true and via django orm. ideas? update i think have nice workaround parents = parent.objects.filter(children__first=true).prefetch_related('children') \ .extra(select={'child_id': '"app_child"."id"'}) parent in parents: pa

python - Whitespace in pyplot legend entry? -

Image
i want add spacing between end of legend entry , legend border. i've tried using arguments pyplot.legend haven't found combination works. here's minimal working example: import matplotlib.pyplot plt import numpy np x = np.linspace(0.0,1.0,10) y = x fig = plt.figure() p, = plt.plot(x,y,'-o') plt.legend([p],['$y = x$'], loc='best') plt.show() i've tried plt.legend([p],['$y = x\/$'], loc='best') plt.legend([p],['$y = x{ }$'], loc='best') plt.legend([p],['$y = x\:$'], loc='best') plt.legend([p],['$y = x$ '], loc='best') but none of them work. seems pyplot smart , removes trailing whitespace. there way accomplish this? to give example of why want this, it's balance out space on both sides using 1 marker instead of 2 in legend, see example below. space beside w-y , exp. smaller space on left. i think can want combination of kwargs borderpad , handletext

android - Call AsyncTask from another class -

in existing app have activity inner class extends asynctask, looks following: public class activity_1 extends baseactivity { .... new async().execute(); ... public class asyncextends asynctask<void, void, string> { protected string doinbackground(void... progress) { ... } protected void onpreexecute() { ... } protected void onpostexecute(string result) { ... } } } now, need call same doinbackground-method activity, onpostexecute() of inner class operates on local ui variables , hence it's not possible use outside clas. there way can call asynctask, , override onpostexecute and onpreexecute -method, or shall create yet inner-class in other activity, same background thing (of course move common utility-class or something), etc...? you can make separate abstract package private class, extending asynctask , implementing doinbackground() method: abstract class myasynctask extends asynctask<void, void, string>

c# - Why does Math.Pow(-78.0921, -64.6294) return NaN? -

i have 2 values: x = -78.0921 , y = -64.6294 . now, when want compute math.pow(x, y) returns nan. should do? how can solve problem? how should calculate power? there other function can calculate this?...or maybe not defined mathematically ? you've tried compute number not real. by not real mean, if tried every single number between largest number , smallest number can think of, none of numbers solution -78.0921 power of -64.6294. in fact, no real number solution -1 power of 0.5, or square root of -1, , in general a^b if negative , b non-integer, the result not real. the inability express such useful result in real numbers lead invention of complex numbers. sqrt(-1) = i , imaginary unit, in complex number system - complex numbers have real component , imaginary component, expressed a + b*i . in general, no negative number fractional power produces real result, have component of in - closer .5 power is, more i, closer .0, more real, , path follows circle bet

I want to run a FOR inside an IF statment to concatenate using & in vba excel -

Image
this first time using vba. generating data in grid of cells number of rows , fixed 4 columns. please note rows not fixed, example data may in grid b17 e20 (4x4 grid) or change b17 e25 (4x9 grid). now, not entries in grid contain data, remain blank. so problem want list of entries in grid in 1 cell on excel separated ";" i think need use logic statements omit blank cells, not how use them strings , because number of rows change, need put of inside loop. yet , try generate content 1 excel using & operator, content gets overwritten. please see code below full macro , attached screenshot of data need enter in grey cells make work. my post referring "images in website gallery" section... sub combo() ' ' combo colours sizes ' maxcolours = range("f3") maxsizes = range("h3") rowoffset = 3 col1 = 1 col2 = 7 col3 = 9 col4 = 10 col5 = 12 col6 = 13 currow = 4 ' generate simple

ASP.NET - Trying to output variable into jQuery -

i trying grab value of callid , if defined within url , set checked box (this id of <input type="checkbox" /> ). if defined, should check box default. here's i'm using, getting error on page: <% dim callid callid = request.querystring("callid") if callid <> "" %> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script> $(document).ready(function(){ $("#<% callid %>").prop('checked', true); }); </script> <% end if %> the error points bit: $("#<% callid %>") saying callid not expression. how set callid value inside of jquery tag? try - $("#<%= callid %>").prop('checked', true);

selenium - How to assert the current URL? -

i'm unittesting yii application phpunit , selenium-server . code: class startsurveyredirecttest extends webtestcase { public $fixtures=array( 'sessions'=>'surveysession', 'surveys' => 'survey', ); public function testactive() { $survey = $this->surveys('survey_active'); $user_id = 1; $imid = 'nl1234-9876'; $this->open('veldwerk/survey/redirect?survey_id=' . $survey->survey_id . '&user_id=' . $user_id . '&imid=' . $imid . '&' . $survey->security_parameter_name . '=' . $survey->getsecurityparametervalue() ); //assert if redirected $this->assertnotequals($this->url(),test_base_url . 'veldwerk/survey/redirect?survey_id=' . $survey->survey_id . '&user_id=' . $user_id . '&imid=' . $imid . '&' . $survey-

c# - should I just set SuppressUnmanagedCodeSecurity for maximum performance? -

am correct if need maximum performance, , have trusted library should set suppressunmanagedcodesecurity attribute dll imports have? i.e. convert such import: [dllimport("srl.dll", charset = charset.ansi)] private static extern string errormsg(int errcode); to such import: [dllimport("srl.dll", charset = charset.ansi), suppressunmanagedcodesecurity] private static extern string errormsg(int errcode); everywhere. are there reasons not set suppressunmanagedcodesecurity?

acl - Changing NTFS security on user with fullcontrol to modify -

i have thousands of folders need change users fullcontrol access modify access. following list of have: a script changes ntfs perms: $acl = get-acl "g:\folder" $acl | format-list $acl.getaccessrules($true, $true, [system.security.principal.ntaccount]) #second $true on following line turns on inheritance, $false turns off $acl.setaccessruleprotection($true, $true) $rule = new-object system.security.accesscontrol.filesystemaccessrule("administrators","fullcontrol", "containerinherit, objectinherit", "none", "allow") $acl.addaccessrule($rule) $rule = new-object system.security.accesscontrol.filesystemaccessrule("my-serverteam","fullcontrol", "containerinherit, objectinherit", "none", "allow") $acl.addaccessrule($rule) $rule = new-object system.security.accesscontrol.filesystemaccessrule("users","read", "containerinherit, objectinherit&quo

java - jdbc - how to select query in one string -

i trying fetch select queries in 1 string. want. tried different ways, not solve. code: resultset rs = st.executequery("select city_id user name = '" + name + "'"); string sql = ""; while (rs.next()) { sql += "select * city id = " +rs.getint(1) + ","; } sql = sql.substring(0, sql.length()-1); preparedstatement stmt = con.preparestatement(sql); rs = stmt.executequery(); i did this, there errors. how can solve it? basically, want add many queries in 1 string, , execute string. need them in resultset. i'm little confused trying achieve guess need this: select * city c inner join user u on (c.id = u.city_id) u.name = ?; then need execute 1 query , have desired results. but @dystroy mentioned if want use approach need @ first fetch ids user list<integer> , create list<string> hold queries or use in clause in query. pseudo

jquery confirm action doesn't work -

i'm using class set yes/no alert. http://myclabs.github.io/jquery.confirm/ this code: var currentid; $(".confirm").click(function() { currentid = $(this).attr('id'); }); $(".confirm").confirm({ text: "are sure?", confirm: function(button) { //if alert here currentid, alerts right $.post("receive.php", { currentid: "id"} ) .done(function(data) { alert(data); //nothing!!! }); }, cancel: function(button) { $('.modal hide fade').css("display", "none"); }, confirmbutton: "yes", cancelbutton: "no!", post: true }); }); receive.php <? echo $_post['id']; ?> $.post("receive.php", { currentid: "id"} ) should be $.post("receive.php", { id: currentid } )

ios - Clear UIWebView Content without a webViewDidFinishLoad delegate callback -

i looking way clear uiwebview content. not want webviewdidfinishload called. not implementing uiwebviewdelegate not option me in case. loadhtmlstring , loadrequest empty data won't work me since trigger webviewdidfinishload callback. using stringbyevaluatingjavascriptfromstring: (as suggested in so ) not trigger callback. if content pdf format, not clear uiwebview' s content need to. any idea? two options: 1) handle case in delegate. can url loaded , triggered webviewdidfinishload, if url empty data - ignore it. 2) remove current instance of uiwebview , add new 1 nothing, @jeepston supposed. check options possible visual glitches on replacement. not sure empty webview, anyway. luck.

javascript - Infovis JIT: add click listener to edge -

i'm trying capture click event on edge of sunburst graph. i've captured click events on nodes. i'm trying: //..sunburst example code events: { enable: true, enableforedges: true, type: 'native', onclick: function(node, eventinfo, e){ if (!node) return; if(node.nodefrom){ console.log("target edge"); }else{ console.log("target node"); } } but captures node clicks. what's wrong? thank in advance. the problem 'contains' method, edge type 'hyperline'(which sunburst uses) not yet implemented in infovis library. contains method used library know if position specified in parameters within edge or not. can not events without contains method. so, can either implement own contains method type hyperline in jit.js or can change edge type 'line' 'hyperline' in init method. edge: { overridable: true, type: 'line', //'hyperline

ubuntu - Ruby On Rails Mysql Access Denied -

im trying excute following command on new rails project on ubuntu server. rails g scaffold user email:string username:string but im receiving following error: "/usr/local/rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': access denied user 'root'@'localhost' (using password: yes) (mysql2::error) /usr/local/rvm/gems/ruby-1.9.3-p392/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/con

Difficulty querying two tables in mysql with php -

i have database in mysql , contains 2 tables: table: political_party +----------+--------------------+-------+ | party_id | party_abbreviation | party | +----------+--------------------+-------+ table: polling_party_result +----+------+-----------------+ | id | p_id | number_of_votes | +----+------+-----------------+ i writing php program outputs form, updates political_party_result table id runs 1 x.. problem i'm facing on form, id relates party_abbreviation column in above political_party table. that 1(in political_party_result table) should bring out ap(from political_party table) 2 = adc 3 = pdp etc.. here html code: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>html inec</title

javascript - AngularJS - ng-repeat - conditionally append html -

dear programmers while trying learn angular.js i've stumbled on problem cant solve myself. therefore kindly ask :) start apologise less optimal code... i've started 'adventure' javascript , angular.js :/ i trying write 'simple' webapp present following functionality: i have list of nodes <div ng-repeat="node in nodes | filter:search" id="node{{node.id}}"> <a ng-click="appendchassis()">{{node.nazwa}}</a> <button class="btn"><i class="icon-plus-sign"></i> add</button> <div some-stuff="mytoggle($index)" class="somestuff" id="dupa{{node.id}}"></div> </div> those nodes come db query. each node has number of devices in it. after clicking on name of device <a ng-click="appendchassis()">{{node.nazwa}}</a> through $scope.appendchassis = function() { var index = this.$index;

sybase - SQL: Next Month of Integer Date and return an Integer -

this question has answer here: t-sql datetime conversion 7 answers i have column startmonth integer, example 199812 i need have next month of , return integer 199901 . how handle in sql in 1 line? similar to select nextmonth(199812) will display 199901 select case when startmonth % 100 = 12 startmonth - 11 + 100 else startmonth + 1 end

java - Override parts of Activity class from TestProject -

i have 2 projects, sourceproject , testproject. in source-project have following class: public class myactivity extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); log.i("", "normal mode"); } } in test project i'd change/override log message example. of course can following , put new class under same package path , change class following: public class myactivity extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); log.i("", "test mode"); } } but let's have more functionality in class , use functionality (in test class well). can't extend sourceproject-class "myactivity" because it's named equally. if change name "myactivityx extends myactivity"

python - Recovering from a duplicate migration in Django South -

due merging several feature branches project, have following migrations: 0001_initial.py 0002_auto__add_field_userprofile_telephone__add_field_userprofile_timezone.py 0003_auto.py 0004_auto__del_field_organisation_admin.py 0005_auto__add_field_organisation_permitted_domains.py 0005_auto__add_field_userprofile_currency.py note have 2 duplicate 0005 migrations. these ran fine, , deployed fine on production system. $ python manage.py migrate accounts --list [17:11:42] accounts (*) 0001_initial (*) 0002_auto__add_field_userprofile_telephone__add_field_userprofile_timezone (*) 0003_auto (*) 0004_auto__del_field_organisation_admin (*) 0005_auto__add_field_organisation_permitted_domains (*) 0005_auto__add_field_userprofile_currency my table has correct columns: $ psql db_my_project=# \d+ accounts_organisation d

c - What is the effect of x=x++;? -

this question has answer here: why these constructs (using ++) undefined behavior? 12 answers #include <stdio.h> int main() { int x=100; x=x++; printf("x : %d\n",x); //prints 101 return 0; } what reason output 101? think output should 100. this undefined behaviour , due sequence points . between consecutive "sequence points" object's value can modified once expression the end of previous epxression x=100; 1 sequence point, , end of x=x++; another. basically, expression has no intermediate 'sequence points', yet you're modifying value of x twice. result of undefined behaviour: basically, anything happen: 100, 101 or 42...

asp.net - MVC 3 Menu navigating to /Gap not /Home/Gap -

please accept apologies possible simplicity of question new mvc 3 , attempting learn through doing. have created new view named gap within application cannot figure out how reference page top menu. keeps navigating /home/gap not work. <ul id="menu"> <li>@html.actionlink("home", "index", "home")</li> <li>@html.actionlink("gap", "gap")</li> <li>@html.actionlink("about", "about", "home")</li> </ul> assuming receive http 404 error saying not work, need create action return view user. <ul id="menu"> <li>@html.actionlink("home", "index", "home")</li> <li>@html.actionlink("gap", "gap", "home")</li> <li>@html.actionlink("about&

ruby - How do I write logic into a HTML file? -

i trying populate html file few parameters: <!doctype html> <html> <head> <title>'breakdown'</title> </head> <body> <h1 'breakdown'> </h1> #{a.each |k,v| k.each |b| "<h2 #{a} />" "<ol id='resultsfor#{a}'>" v.each |result,number| "<li #{number} #{result} />" end "</ol>" end end} </body> </html>" and output: <html><head> <title>tests breakdown</title> </head> <body> <h1 'breakdown' > </h1> abcr11r20r33 </body></html> where abc corresponds r1 , r2 , , r3 result key , numbers 1,2,3 . i seem loose additional text in each loops. thing seem getting out o

nvd3.js - Custom order of x axis in D3.js -

i have these labels axis x: 1..2..3..4..5..6..etc but need custom order: 3..2..5..1..6..4..etc even if give array in such custom order d3, automatically orders in first example. i'm using nv.models.linechart() . the exact dump of values: [{"values":[{"label":18,"value":12},{"label":19,"value":412},{"label":20,"value":441},{"label":21,"value":920},{"label":22,"value":944},{"label":23,"value":144},{"label":0,"value":0},{"label":1,"value":18},{"label":2,"value":0},{"label":3,"value":7},{"label":4,"value":4},{"label":5,"value":12},{"label":6,"value":0},{"label":7,"value":0},{"label":8,"value":0},{"label":9,"value":9},{"label":10,&quo

security - Delegated Authentication using websockets -

i have googled " websocket delegated authentication " , interesting hit (unsurprisingly) on stackoverflow: websockets authentication what i'd know is: how allowing client-side applications - connected via websockets - delegate authority back-end services , data stores? i'm interested in figuring out how delegate x509-based authentication, @ point, i'd happy hear anyone's account of how they're delegating authority client-side on websockets. don't know tech using php, net, java? anyway plain formsauth use cookie passed browser websocket connection. can tell if client has access or not. have used certificates (x509) wss/tls if .net guy here's docs http://xsockets.net/api/net-c# find both wss/tls , formsauth @ bottom of page.

html - List items with alternating heights messing rows -

i having trouble list has items alternating heights based on content. causes rows break seen here: http://jsfiddle.net/pyrgb/ try re-sizing display view see effect. what ideally list item continue next row space enough make row without hitting edge of above row. possible? i know have mentioned 'rows' , table solution using lists keep display fluid , adaptable range of devices. only solution have found set min-height content not overflow so: http://jsfiddle.net/pyrgb/1/ cannot predict amount of content in list items , list item adapt height if possible. edit: note, if see resize display have 3 columns, can see effect need doesn't work in other situations. (not sure if same in browsers, using chrome 26) thanks remove float , make li display inline-block vertical align top. http://jsfiddle.net/stevendwood/pyrgb/2/ ul li{ width: 100px; padding: 10px; margin: 0 0 20px 20px; border: 1px solid red; background: #eaeaea; display