Posts

Showing posts from January, 2012

vb.net - how can i make a loop of data having in listbox in vb? -

i have listbox having value of integer . want make 2 loop while objreader.peek() <> -1 textline = objreader.readline() words = textline.split(new char() {","c}) listbox1.items.add(words(3) & "," & words(4)) loop integer = 0 listbox1.items.count - 1 dim tempstr = listbox1.items.item(i) tempstr = listbox1.items(i) value = tempstr.split(","c) data= value(0) next i want make 2 datalist remove first item of value1 remove last item of value1 you can take loop . in first got value first last -1 in sec got second(with out first) last 1 j integer = 0 listbox1.items.count - 2 dim first = listbox1.items(j).tostring dim sec = listbox1.items(j+1).tostring next i think sloves problem

How to get value from a listview Asp.Net -

i have listview in asp.net this: <asp:listview id="lvloads" datakeynames="bookingid" onitemcommand="lvloads_onitemcommand" runat="server"> <emptydatatemplate> <table> <tr> <td>no data returned.</td> </tr> </table> </emptydatatemplate> <grouptemplate> <asp:placeholder id="itemplaceholder" runat="server"></asp:placeholder> </grouptemplate> <itemtemplate> <fieldset> <table class="table table-striped table-responsive"> <thead> <tr class="hidden-lg"> <th width="15%">type</th>

how change type map mapbox-leaflet -

i want type of map in map create. use leaflet , mapbob, dont know how change type of map. var mapboxtiles = l.tilelayer('https://{s}.tiles.mapbox.com/v3/examples.map-zr0njcqy/{z}/{x}/{y}.png', { attribution: '<a href="http://www.mapbox.com/about/maps/" target="_blank">terms &amp; feedback</a>' }); how change content tilelayer 1 create me? thank you! like this: // provide access token l.mapbox.accesstoken = 'pk.yyyyyyyyyyyyyyyy'; // create map in div #map l.mapbox.map('map', 'jonataswalker.kieo57jb'); //put yours here

linux - Bosh init gives error, on openstack, while creating bosh VM through script -

i have created openstack environemt , want deploy bosh, after deploying cloudfoundry on vm our office's test environment. following these links guides: guide configuring openstack icehouse on ubuntu lts 14.04 guides bosh after have confiugured script according environment, ran script , got following errors: error: started deploying creating vm instance 'bosh/0' stemcell '20e80643-76a0-4b28-8993-ceafd1ecfdaf'... failed (00:00:04) failed deploying (00:00:04) stopping registry... finished (00:00:00) command 'deploy' failed: deploying: creating instance 'bosh/0': creating vm: creating vm stemcell cid '20e80643-76a0-4b28-8993-ceafd1ecfdaf': cpi 'create_vm' method responded error: cmderror{"type":"unknown","message":"expected([200, 202]) \u003c=\u003e actual(404 not found)\nexcon.error.response\n :body

Make phone call from Apple watch app -

can use button make phone call apple watch app? for iphone app can use once button pressed: [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"tel://1111111111"]]); openurl silently ignored if device locked or app in background. additionally watchkit doesn't contain api initiating phone call. your best bet may prompt user open iphone app, possibly using handoff, , tap button initiate call there. not great solution, watchkit pretty limited right now.

sql - Ignore other results if a resultset has been found -

to start, take snippet example: select * statsvehicle ((referencemakeid = @referencemakeid) or @referencemakeid null) this fetch , filter records if variable @referencemakeid not null, , if null, fetch records. in other words, taking first 1 consideration if @referencemakeid not null. i add further restriction this, how can achieve this? for instance (referencemodelid = @referencemodeleid) or ( (referencemakeid = @referencemakeid) or (@referencemakeid null) ) if @referencemodelid not null, need filter referencemodelid, , ignore other statements inside it. if such, returns records. there can done achieve such thing? maybe this? select * statsvehicle ( -- removed following, it's not clear if beneficial -- (@referencemodeleid not null) , (referencemodelid = @referencemodeleid) ) or (@referencemodeleid null , ( (referencemakeid = @referencemakeid) or (@referencemakeid null) ) )

c# - Is the processorid per core? -

can processor whether dual core or i3 or i5 or i7 have processor id equals number of core processor or number of logical processor? i using win32_processor processorid. it returs processorid in stuck whether returns multiple processorid each core processor or logical processor. or, return processor id regardless of number of core processor , logical processor. you need test on system depends on type of cpu have. it's 1 entry per logical (hyper-threaded) processor. here msdn says on multiprocessor computer, 1 instance of win32_processor class exists each processor. to determine total number of processor instances associated computer system object, use win32_computersystemprocessor association class. to determine if hyperthreading enabled processor, compare numberoflogicalprocessors , numberofcores. if hyperthreading enabled in bios processor, numberofcores less numberoflogicalprocessors. example, dual-processor system contains 2

Nuget downloading packages to incorrect folders - Bamboo build server -

i'm trying create build plan in bamboo asp.net mvc project. i've setup build plan call nuget.exe packages required build. however, nuget restore operation putting nuget files different directories specified, causing build issues. below extract of 2 of nuget packages in packages.config file causing problems: <package id="owin" version="1.0.0" targetframework="net46" userinstalled="true" /> <package id="unity" version="3.5.1404" targetframework="net46" userinstalled="true" /> the restore operation works correctly, packages downloaded incorrect directory names. example, owin package downloaded packages\owin.1.0 when should packages\owin.1.0.0 . unity package downloaded packages\unity.3.5.1404.0 it should noted position of 2 lines in packages.config file (i.e. unity directly follows owin package), don't think it's coincidence directory looses .0 directly before package

How to use mysql function to insert data -

i've created mysql function: delimiter $$ use `local_sysdb`$$ create function `addpost` ( postsource char(20), hashtagid int, coordinateslat float, coordinateslon float, created int(20) unsigned, filterlevel varchar(45), postid char(20), postlanguage char(11), profanity tinyint(1), retweeted tinyint(1), posttext text, truncated tinyint(1), userid int(10), username char(15), userfullname char(20), media varchar(255), mediatype1 char(5), media1 varchar(255), mediatype2 char(5), media2 varchar(255), mediatype3 char(5), media3 varchar(255), mediatype4 char(5), media4 varchar(255), filter varchar(45), urltopost varchar(225), channeltitle varchar(225), channelid char(30), category int(11) ) returns text language sql deterministic begin if(inhashtagcampaign(hashtagid,created,postsource)) case postsource when 'twitter' i

mysql - saving parentheses or quotations into sql in vb.net -

i have save command on vb project. problem won't save texts " ' " or parentheses. think has sql command.. here code saving update saving dim myadapter new mysqldataadapter dim mydatatable new datatable dim command new mysqlcommand dim add string add = "insert tracker.recordtracker (action_taken,marginal_note,remarks,type_of_document,referred_date,items,received_from,received_date,referred_to,recdate,refdate)values('" + acttaken.text + "','" + margnote.text + "','" + remarks.text + "','" + doctype.text + "','" + rfrldatelbl.text + "','" + itemtbx.text + "','" + rfromtbx.text + "','" + rcvdate.text + "','" + reftotbx.text + "' ,'" + rdate.text + "',@refdate)" command = new mysqlcommand(add, connection)

Python Pandas two conditional dataframe groupby running sort -

i'm looking way run 2 conditional pandas dataframe groupby method. have many logs parse , have following single condition groupby method, there way have 2 conditional groupby method? df[df['feature enabled'] == 1].groupby([’feature active'])[['value1','value2']].mean() is there way print running groupby current log go through each file, like... df[df['iteration'] == currentlog_id , df['feature enabled'] == 1].groupby([’feature active'])[['value1','value2']].mean() this me plot excel after each log go along , process directory of logs. thanks to use multiple conditions need use bit-wise & , not and , need enclose conditions in parentheses due operator precedence: df[(df['iteration'] == currentlog_id) & (df['feature enabled'] == 1)].groupby([’feature active'])[['value1','value2']].mean() should work

javascript - How to add client side validation in joomla frontend module with alert? -

Image
this simple module need phone no. (format=+x-xxx-xxx-xxxx) , url validation. validation show on top position , red color. right side module , validation true field color green.

python - Smoothing of graph gives a huge difference in the range -

Image
i trying plot smooth curve using x,y cordinates above. howsoever graph out of range of data. snippet of code here. import numpy np import matplotlib.pyplot plt scipy.interpolate import spline ylist = [0.36758563074352546, 0.27634194831013914, 0.22261484098939929, 0.10891089108910891, 0.31578947368421051, 0.086956521739130432, 0.27272727272727271, 0.18181818181818182, 0.0, 0.0, 0.92000000000000004, 0.0, 0.10526315789473684, 0.23333333333333334] xlist = [0.025000000000000001, 0.075000000000000011, 0.125, 0.17500000000000002, 0.22500000000000001, 0.27500000000000002, 0.32500000000000001, 0.375, 0.42500000000000004, 0.47500000000000003, 0.52500000000000002, 0.57500000000000007, 0.625, 0.97500000000000009] xlist_smooth = np.linspace(xlist.min(), xlist.max(), 100) ylist_smooth = spline(xlist, ylist, xlist_smooth) plt.plot(xlist_smooth,ylist_smooth) i following curve output i think problem here spline interpolation of higher order not suitable smoothing data. below plotte

d3.js - Mirror d3 graph horizontally in JavaScript/html -

i'm trying flip graph in js without changing axis. javascript isn't specialty , after googling 4 hours i'm starting think isn't possible. can point me in right direction please? var width = 960, height = 500; d3.json("data2.json", function(error, heatmap) { var dx = heatmap[0].length, dy = heatmap.length; // fix aspect ratio. // var ka = dy / dx, kb = height / width; // if (ka < kb) height = width * ka; // else width = height / ka; var x = d3.scale.linear() .domain([0, dx]) .range([0, width]); var y = d3.scale.linear() .domain([0, dy]) .range([height, 0]); var color = d3.scale.linear() .domain([null, 0, 30, 60, 90, 120]) .range(["#ffffff", "#ff0000", "#ff9933", "#ffff00", "#99ff33", "#00ff00"]); var xaxis = d3.svg.axis() .scale(x) .orient("top") .ticks(20); var yaxis = d3.svg.axis() .s

How can I get keyboard events in Google Spreadsheets? -

how can keyboard events in google spreadsheets? want use events in script format non-adjacent cells. keyboard events cells cannot handled apps script. can detect cell change once has beeb commited (user typed , pressed enter example), not keyboard event (its range edit event)

django alphanumeric validator not work -

i try force user use alphanumeric characters in field wrote following code in user model: alphanumeric = regexvalidator(r'^[0-9a-za-z]*$', message='only alphanumeric characters allowed.') username = models.charfield(unique=true, max_length=20, validators=[alphanumeric]) but still can create: user.objects.create(username="@@") i don't want create it... am doing wrong? did wrote wrong regex validator? i think code should this: username = models.charfield(unique=true, max_length=20, validators=[ regexvalidator( r'^[0-9a-za-z]*$', message='only alphanumericcharacters allowed.', code='invalid_username' ) ] )

rest - How can I use a String in an URL? -

i'm trying create web service can send stardog request using http method. problem stardog request using few symbol aren't allowed in url, ? or ; , i'm trying not force user manually convert %3f or %3b . so want url : localhost:8080/webservicetest/query?select="select * {?s ?p ?o}" my jersey annotations following: @get @path("/query") @produces(mediatype.application_json + ";charset=utf-8") public string execquery(@queryparam("select") string selectquery, @queryparam("update") string updatequery) { does know if possible? , if is, how can that? if use javascript/ecmascript 5.1++ on client side can convert string uri string format. use method encodeuricomponent(str); which explained here . it possible replace ? ; chars %-represetation. (in case of using curl) (space) ! " # $ % & ' ( ) * + , / : ; %20 %21 %22 %23 %24 %25 %26 %27 %28 %29 %2a %2b %2c %

MDX: generate hierarchy level within RDL report -

let's say, have cube dimention 'grocery store', has 2-level hierarchy: fruits & vegetables dep. fruits vegetables tomatoes cucumbers bakery dep. milk dep. the question - how can add hierarchy level within mdx query of rdl-report, 'tomatoes' , 'cucumbers' members move new 3rd level under native 2nd level 'vegetables'. need without changes cube, means of pure mdx only. when tried build calculated set desired 3rd level , use along rest part of initial hierarchy this: set [level 3] case when [grocery store].[hierarchy].[level 2].currentmember = [grocery store].[hierarchy].&[tomatoes] or [grocery store].[hierarchy].[level 2].currentmember = [grocery store].[hierarchy].&[cucumbers] [grocery store].[hierarchy].[level 2].currentmember else null end select {[measures].[sales]} on columns, crossjoin(hierarchize( {[grocery store].[hierarchy].[level 2]} -{[grocery store].[hie

php - How to disable locales redirect in yii2-localeurls for specific controller/module -

i'm using yii2-localeurls along locales in yii2. working pretty fine. reading documentation, see, redirecting configured language or default language happens automatically (even if enablelanguagedetection false ). created ticket@github ensure functionality coming soon. so here fine main.php configuration: 'urlmanager' => [ 'class' => 'codemix\localeurls\urlmanager', 'languages' => [ 'en' => 'en-gb', 'de' => 'de-de' ], 'enablelanguagedetection' => false, 'enableprettyurl' => true, 'showscriptname' => false, 'rules' => [ ], ], default language configuration in main.php according $language : 'language' => 'en-gb', now, created module api case route following. api route-param mapping api module: api module route application.com/api/<controller>/<action> modul

c++ - does a function know how much memory its parameters occupy? -

when call function passing value, making copy in memory of actual parameters' value. the question is: function know how space parameters occupy in memory? if answers yes, how can retrieve in function scope? if answers in no, have potentially hidden memory error? consider example: #include <stdio.h> void func(char * x) { x +=98; *x='c'; //is ok? or have hidden memory error? *++x='\0'; --x; puts(x); } int main() { char a[100]; char *b =a; func(b); return 0; } you have potentially hidden error. don't manually crap use std::string .

android - BroadcastReceiver trying to return result during a non-ordered broadcast Weird Error -

this error started occurring when app launched first time though not sending push notification: broadcastreceiver trying return result during non-ordered broadcast java.lang.runtimeexception: broadcastreceiver trying return result during non-ordered broadcast @ android.content.broadcastreceiver.checksynchronoushint(broadcastreceiver.java:799) @ android.content.broadcastreceiver.setresultcode(broadcastreceiver.java:565) @ com.pushnotification.gcmbroadcastreceiver.onreceive(gcmbroadcastreceiver.java:17) @ android.app.activitythread.handlereceiver(activitythread.java:2712) @ android.app.activitythread.access$1700(activitythread.java:144) @ android.app.activitythread$h.handlemessage(activitythread.java:1449) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:155) @ android.app.activitythread.m

ios - Xcode not recognizing declared variable? -

Image
this question has answer here: inappropriate expected declaration error 1 answer i have created new class within controller file such : import uikit class firsttableviewcontroller: uitableviewcontroller { class sport { var name: string = "sport name" var branches: nsarray = [" branches of sport"] } now when try create new object class, works expected: var americanfootball = sport() however when try access 1 of properties class change, doesn't recognize new object: whats issue ? you should access property inside function. import uikit class firsttableviewcontroller:uitableviewcontroller { class sport { var name: string = "sport name" var branches: nsarray = [" branches of sport"] } var americanfootball = sport()//this property of firsttableviewcontroller override func vie

pandas - PYTHON: Creating a dataframe of permutations from a list of tuples -

i presently trying create massive table of permuted values. loca = [1, 2, 3] locb = [4, 5, 6] locc = [7, 8, 9] within 'loc' values permuted. each value in 'loc' different population ('pop1', 'pop2', 'pop3'). far have have been able form massive list of tuples combines every within 'loc' rearrangement every between 'loc' rearrangement. perma = list(itr.permutations(loca, 3)) permb = list(itr.permutations(locb, 3)) permc = list(itr.permutations(locc, 3)) permabc = list(itr.product(perma,permb,permc)) permabc [((1, 2, 3), (4, 5, 6), (7, 8, 9)), ((1, 2, 3), (4, 5, 6), (7, 9, 8)), ((1, 2, 3), (4, 5, 6), (8, 7, 9)), ... etc etc... ((3, 2, 1), (6, 5, 4), (8, 9, 7)), ((3, 2, 1), (6, 5, 4), (9, 7, 8)), ((3, 2, 1), (6, 5, 4), (9, 8, 7))] i have been trying pandas dataframe, having trouble iterating through list of tuples dataframe. :( ideal format: loc pop1 pop2 pop3 1 2 3 | b 4 5 6 |

delphi - TCheckBox.Data invalid typecast when using as TValue -

steps reproduce: -new firemonkey-application -add tcheckbox form now create method following code: procedure tform1.foo; var a,b:integer; lval:tvalue; begin lval:=tvalue.from<integer>(42); a:=lval.asinteger; checkbox1.data:=tvalue.from<integer>(42); b:=checkbox1.data.asinteger; end; the cast lval runs without problems, checkbox1.data however, if it's tvalue too, throws "einvalidcast"-error, when calling asinteger . same error appears when using checkbox1.data.astype<integer> instead. am misusing tcheckbox.data here or kind of bug? tcheckbox.data contains boolean value, check box checked state. why einvalidcast error when try read integer it. the reason why seemingly can put integer data in, because tcheckbox.setdata ignore invalid data types , sets data false .

Android Studio Gradle fails to build -

i facing problem few days. when try build project gradle thorws message. cleaned project re downloaded dependencies still problem has not solved. help me find out fix. error message :app:dexdebug error:org.gradle.api.internal.changedetection.state.defaultfilecollectionsnapshotter$filecollectionsnapshotimpl cannot cast org.gradle.api.internal.changedetection.state.outputfilescollectionsnapshotter$outputfilessnapshot possible causes unexpected error include:<ul><li>gradle's dependency cache may corrupt (this occurs after network connection timeout.) <a href="syncproject">re-download dependencies , sync project (requires network)</a></li><li>the state of gradle build process (daemon) may corrupt. stopping gradle daemons may solve problem. <a href="stopgradledaemons">stop gradle build processes (requires restart)</a></li></ul>in case of corrupt gradle processes, can try closing ide , killing java

f# - Accord.net Cobyla solver returns success when there are no feasiable solutions -

i'm using accord.net's cobyla solver solve rather simple non-linear problem. in cases there no feasible points problem. when run simple problem non-feasibility obvious, solver return "success" though solution not feasible. consider following example, written in f#: open system.collection.generics let obj12 = quadraticobjectivefunction("a - a*a"); let c12 = quadraticconstraint(obj12, array2d.zerocreate 1 1, [| 10.0 |], constrainttype.lesserthanorequalto, 4.0) let c13 = quadraticconstraint(obj12, array2d.zerocreate 1 1, [| 10.0 |], constrainttype.greaterthanorequalto, 45.0) let p1 = list<nonlinearconstraint>() p1.add(c12) p1.add(c13) let solver1 = cobyla(obj12, p1) let success = solver1.maximize() let value = solver1.value let solution = solver1.solution let r = solver1.status the solution solver found 4.5 violate first , second constraints solver status "successful". is bug/feature? workaround? i author of c# cobyla

javascript - Dynamically values parse to Popup Model Box from PHP Page -

i trying parse php data values inside while loop popup model . sample code <?php include("connect.php"); $sql = 'select id products tag="mixed" order id desc limit 5'; mysql_select_db('levels'); $retval = mysql_query( $sql, $db_server ); if(! $retval ) { die('could not data: ' . mysql_error()); } while($row = mysql_fetch_array($retval, mysql_assoc)) { $id = $row['id']; ?> <div onclick="showdialog('#dialog6');show_data();"> <div id="getid"> <?php echo $id; ?> </div> </div> <?php } mysql_close($db_server); ?> <script> function showdialog(id){ var dialog = $(id).data('dialog'); dialog.open(); } function show_data(){ var x = document.getelementbyid("getid").innerhtml; document.getelementbyid("demo").innerhtml = x; } </script> <!-- popup model --> <di

ios - Add localization -

hi have app on ios appstore https://itunes.apple.com/us/app/baby-tweets-english/id681812385?ls=1&mt=8 i delivered current version additional localization support swedish (i saved , can see on itunes connect portal) howerver when enter swedish app store, signed in swedish credit card still see description in english. app store @ ip of enter store from? can reason swedish isn't displayed ? thanks the displayed description based on language preference in settings. you won't see swedish description if preferred language set english.

java - How can I implement FocusListener of JDatePicker? -

i want perform function in focusevent of jdatepicker . using below code implementing focuslistener . properties p = new properties(); p.put("text.today", "today"); p.put("text.month", "month"); p.put("text.year", "year"); utildatemodel model = new utildatemodel(); calendar today=calendar.getinstance(); date todaydate=new date(); today.settime(todaydate); model.setdate(today.get(calendar.year), today.get(calendar.month), today.get(calendar.date)); model.setselected(true); jdatepanelimpl datepanel =new jdatepanelimpl(model, p); jdatepickerimpl datepicker = new jdatepickerimpl(datepanel,new datelabelformatter()); datepicker.addfocuslistener(new focuslistener() { @override public void focuslost(focusevent e) { // todo auto-generated method stub system.out.println("fcus lost"); } @override public void focusgained(focusevent e) { // todo auto-generated method stub

html - Unable to center align the label field of form -

Image
i want center align form w.r.t. page, if use following, text input field getting aligned label remains @ left. how resolve it? <div id="passcode"></div> <form class="form-horizontal"> <fieldset> <legend style="color:#145fac">please fill in online form</legend> <div class="form-group"> <label for="inputemail" class="col-lg-2 control-label">name</label> <div class="col-lg-10"> <input type="text" class="form-control formwidth" id="inputname" placeholder="nam" /> </div>...</div> </fieldset> </form> text-align: left applied control-label therefore overrides "center" applied parent element. try using css below .control-label, .form-control { text-align: center; }

share - How to get Know the user shared my website post in FaceBook or not -

how confirmation dynamically when user shares product ecommerce website facebook can redirect him new page if share product in facebook. ecommerce website dont have user login has guest checkout . please tell me solution how work on please me guys. thanks in advance. the way check if shared authorize him publish_actions . way, share callback include post id. ...but never permission approved facebook that, because incentivizing share (= rewarding user or gating content behind it) not allowed according platform policy .

java - Migrating from Junit to TestNG in IntelliJ -

i found information migrating junit testng in general ( here example) , working in intellij junit , testng separately, nothing migrating junit testng in intellij itself. can describe steps required this?

Looping check in Java -

can guide me on how looping compare data using java? example : have lot of section 1 30 each time need take 2 section compare data (a, a) or not? i need compare sec1, sec2 if data (a,a) add 1 output continue compare next section sec2, sec3 , on ... sec1 sec2 b sec3 c sec4 sec5 e sec6 sec7 . . . . . . i assume sec1,sec2 string in array. char [] sections = {'a','a','b','a','a','b','b','a','a','b'}; int count = 0; for(int = 0; < sections.length - 1; i++) { if(sections[i] == 'a' && sections[i+1] == 'a')//compare want { count++; } } system.out.println(count); edit try { string query = "select * emp;*; resultset rs = stmt.executequery(query); while(rs.next()) { string []sections = new string[30]; for(int = 0; < 30; i++) { sections[i] = rs.getstring(i+1); } //now add check

How to find percentile in r with many cateogories in a dataset? -

Image
my dataset looks similar this: category value1 value2 19 143 12 124 21 130 b 23 323 b 24 323 b 23 342 b 24 233 b 27 234 c 28 212 c 29 233 d 11 365 d 12 323 d 13 344 this dataset has many categories viz. a,b,c,d etc , 2 columns how can find out 90th percentile of these values in category-wise? output should in pattern: try library(dplyr) df1 %>% group_by(category) %>% summarise_each(funs(quantile(., 0.90))) # category value1 value2 #1 20.6 140.4 #2 b 25.8 334.4 #3 c 28.9 230.9 #4 d 12.8 360.8 or library(data.table) setdt(df1)[, lapply(.sd, fun=quantile, prob=0.90), category] or using aggregate base r aggregate(.~category, df1, fun=quantile, prob=0.90) dat

android - How to override back button only on single page in cordova 4.0? -

i have requirement, on particular page, mean when user comes in index.html , when click button, need prompt alert saying want exit app. if says 'yes', exit else 'no'. i'm able achieve this, overriding button , checking whether user in index.html page or not shown in below code. code sample: function onload() { alert("onload"); document.addeventlistener("deviceready", ondevicereay, false); } function ondevicereay() { var x = document.url; alert(x); if( x.indexof('index') >= 0) { document.addeventlistener('backbutton', function(e){ if (confirm("press button!")) { alert("you pressed ok!"); navigator.app.exitapp(); } else { alert("you pressed cancel!");

android - terminalide install issue -- "this tool is deprecated" -

i've tried several times install terminalide app on lenovo a7600-f tablet running android 4.2.2. follow instructions exactly, same results. when tutorial 5, ./builder.sh produces "this tool deprecated". when enter ./install.sh, returns line saying "this requires android.permission.interact_across_users_full". goes downhill there, , end unable compile java. i had same results trying install phone, suspect @ fault here. haven't been able find issue. i think can ignore "deprecated" message. security exception can fixed adding --user 0 am command in install.sh , run.sh .

c# - sync data grid view -

i have data grid view data source data table in form in c#, how can make read table database continuously mean if program running in many computers in same network , connected same database , if computer 1 add row database appears automatically in computer 2 without clicking button refresh. void load() { c.connect("sel_dep"); c.com.commandtype = commandtype.storedprocedure; sqldataadapter da=new sqldataadapter (c.com); datatable dt = new datatable(); c.open(); int last = 0; while (true) { if (dt.rows.count > 0) dt.rows.clear(); da.fill(dt); dd = dt; if (dt.rows.count != last) { last = dt.rows.count; this.invoke((methodinvoker)delegate { datagridview1.datasource = dt; datagridview1.selectedrows[0].selected = true; label1.text = datagridview1.rowcount.tostring(); }); } }

c - Cannot open include file: 'libgen.h' -

i want use basename function. include this: #include <libgen.h> char *dirname(char *path); char *basename(char *path); but visual studio show me error : error c1083: cannot open include file: 'libgen.h': no such file or directory intellisense: cannot open source file "libgen.h" is libgen.h not reference header file? why can't include? in advance.

apache pig - FLATTEN On bag NOT working as expected -

input : a.csv file having map data [banks#{(bofa),(chase)}] pig script : a = load 'a.csv' (bank_details:map[]); b = foreach generate flatten(bank_details#'banks') bank_name; output : b : ({(bofa),(chase)}) applying flatten on bag c = foreach generate bank_details#'banks' banks: bag{t:(bank:chararray)}; d = foreach c generate flatten(banks); output : d : org.apache.pig.backend.executionengine.execexception: error 0: exception while executing [poproject (name: project[bag][0] - scope-114 operator key: scope-114) children: null @ []]: java.lang.classcastexception: org.apache.pig.data.databytearray cannot cast org.apache.pig.data.databag @ org.apache.pig.backend.hadoop.executionengine.physicallayer.physicaloperator.getnext(physicaloperator.java:366) expected output : (bofa) (chase) if input file has got bag below : input : a.csv {(bofa),(chase)} pig script : a = load 'a.csv' (bank_details:bag{t:(bank_name:chararray)}); b

android - OnClickListener not getting fired for an image button inside a ListView using Custome Adapter -

i have spent time searching solutions , tried different ways couldn't find goes wrong. i developing app have imagebutton child element of listview (i have done using custom adapters). upon executing onclick of imagebutton , nothing happens. my fragment_tweets.xml looks follows: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v4.widget.swiperefreshlayout android:id="@+id/swipecontainer" android:layout_width="match_parent" android:layout_height="match_parent"> <listview android:layout_width="wrap_content" android:layout_height="wrap_content"

Run 'openssl req' command in Java? -

it seems x509 cert request can generated openssl java has no control on that. decided invoke openssl command in java ; system windows7-64bit, jdk 1.7, openssl 1.02 binary distribution. generating csr request via direct openssl command, invoking same command in java reports error. openssl command: openssl req -new -key bob.pem -out bob.csr -subj /c=cn java code: process p; string command="openssl req -new -key bob.pem -out bob.csr -subj /c=cn"; runtime r=runtime.getruntime(); p=r.exec(command); error message: unable load private key 8016:error:0906d06c:pem routines:pem_read_bio:no start line:.\crypto\pem\pem_lib.c:701:expecting: private key the .pem indeed private key generated openssl. please give me hand. thanks. bob.pem generated via command: openssl genrsa -out bob.pem -----begin rsa private key----- miiepgibaakcaqea25i5waagjibvqtlxghdcjwduntbiqx9isx4zrdl5cql8wu7u vxengxjhijbpe1ajoxsl12lggzgsnw7g5mimsjogi929h8vaim+iu96+ea6te6xu 5dheapliuwq62fybhg1b

python - Tornado - Send message to client on demand -

i'm using tornado serve html file and, @ same time, want python program dynamically change value in same page through websockets. purpose value can seen changing, without need refresh on client side. in case, want send message variable changes "1234" "4321" every 4 seconds. have thread doing value toggling , want same thread send value websocket, can handle script using onmessage function in client side. the following code give me following error: 'application' object has no attribute 'write_message' import tornado.ioloop import tornado.web import tornado.websocket import threading import time flag = true class mainhandler(tornado.web.requesthandler): def get(self): self.render("mypage.html") class wshandler(tornado.websocket.websockethandler): def open(self): self.write_message('connected') print "websocket opened" def on_message(self, message): self.wr

java - can't properly dynamically load and set up game state -

all right, complicated question, let's try start so, i'm sure many of have played game, show buttons identification of save file, , when press it, retrieve save state file , start playing want implement similar simple rpg(think simplified fire emblem, if you're played it). set jpanel buttons actioncommand "load , play save file", , code try use in actionlistener execute functionality rpggame jpanel relevant characters, cursor, etc, , setgame method helps set (using button text try retrieve particular file) using +".dat" try serialized state else if (e.getactioncommand().equals("load , play saved file")) { jbutton source = (jbutton)(e.getsource()); try { newgame = loadchapterstate(source.gettext() + ".dat"); newgame.setupgame(); //newgame.setcursor(newgame.cursor); cardlayout layout = (cardlayout)(overallgame.getlayout()); layout.show(overallgame, game); //requestfocusinwind

asp.net - Two different expirations dates for twilio audio files -

i have uses twilio , app has 2 different sets of audio files: menus (files never change) information (files change constantly) at moment had set cache files of couldn't figure out how set different expiration date before send file twilio, problem been twilio download files directly website, far understand cannot set cache using asp.net i using xml below in web.config in directory files @ moment cannot find way specify different values different files, example: menu1.wav - max cache meny2.wav - max cache info1.wav - no cache info2.wav - no cache is possible? <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webserver> <staticcontent> <clientcache cachecontrolmode="disablecache" /> </staticcontent> </system.webserver> </configuration> twilio evangelist here. looks can use <location> element define different

javascript - node.js parse a page and catch external frontend js errors -

is possible parse external page http://example.com has js errors (for example '$ not defined'), catch these errors , print them via console.log()? yes, possible. need download page , render in headless browser such phantomjs . someone has done already: http://npmjs.com/package/phantom-check $ phantom-check http://example.com phantom checking http://example.com [info] [phantom] starting... [info] [phantom] running suite: 2 steps [debug] [phantom] opening url: http://example.com/, http [debug] [phantom] navigation requested: url=http://example.com/, type=other, willnavigate=true, ismainframe=true [debug] [phantom] url changed "http://example.com/" [debug] [phantom] injected casper client-side utilities page http://example.com has no errors