Posts

Showing posts from August, 2014

javascript - Is there an event "on Refresh" for jqgrid navgrid -

i try find how trigger event before grid refresh itself. need "onsearch" reset button. here code navgrid : $("#jqgrid").jqgrid('navgrid','#jqgridpager' ,{edit: false, add: false, del: false, search: true, refresh: true},// button of footer : search , refresh {}, // settings edit {}, // settings add {}, // settings delete { onsearch:function(){/*... first action ... */}, /* here : afterrefresh: function(){console.log("refresh?");}, */ multiplesearch:true, overlay:false, sopt: ['eq'] } // search options ); does has idea and/or documentation navgrid events? thanks you can use beforerefresh , afterrefresh : $("#jqgrid").jqgrid('navgrid','#jqgridpager', {edit: false, add: false, del: false, search: true, refresh: true, beforerefresh: function(){console...

docker - How to enable AUFS on Debian? -

when try install docker via: curl -ssl https://get.docker.com/ | sh i message: warning: current kernel not supported linux-image-extra-virtual package. have no aufs support. consider installing packages linux-image-virtual kernel , linux-image-extra-virtual aufs support. however, neither package seems exist on debian jessie: # apt-get install linux-image-virtual linux-image-extra-virtual reading package lists... done building dependency tree reading state information... done e: unable locate package linux-image-virtual e: unable locate package linux-image-extra-virtual what missing here? aufs not supported modern kernels, should skip overlayfs aufs. restart docker daemon option: --storage-driver=overlay2 (or add option /etc/default/docker) in systems should add processing of file /etc/default/docker start procedure creating /etc/systemd/system/docker.service content: [service] environmentfile=-/etc/default/docker execstart= execstart=/usr/bin/dock...

Java jcombobox different text in its dropdown and different text in its textfield -

i want create jcombobox have following appearance behaivour: 1) in dropdown list each line should code number , item name. 2) when user selects 1 of lines, in textfield component of combobox code number should appear , not item name. (something this) how can that? thanks in advance. it not hard using 2 steps: your jcombobox items must object example: public class item { private string number; private string name; // constructor + setters , getters } a listcellrenderer customize how render values in popup list or in text-field of jcombobox : jcombobox<item> jc = new jcombobox<item>(); jc.setrenderer(new listcellrenderer<item>() { @override public component getlistcellrenderercomponent( jlist<? extends item> list, item value, int index, boolean isselected, boolean cellhasfocus) { if(isselected && list.getselectedindex () != index) return new j...

php - Storing data from client desktop application to server DB -

what best way send bulk data periodically sqlite db present in desktop application db in mysql server through php script. want send maximum possible amount of data server @ one-shot , want reduce number of pings server. desktop application implemented in c++ mfc. i tried implementing basic module , got problem: the cstring variable used store string content not storing more 10,000 characters there bigger data structure store more amount of content. it helpful, if can suggest me on below areas : is there maximum amount of data sent using http. is there other protocols data sent php script in server. best format data transfer. please let me know, if there other things consider build software system task. i have system in place send few amount of information (about 5 kb) every 30 secs. problem results in huge number of server pings multiple clients. hence send data in bulk after storing them locally in sqllite3 db.

python - Return tuple with smallest y value from list of tuples -

i trying return tuple smallest second index value (y value) list of tuples. if there 2 tuples lowest y value, select tuple largest x value (i.e first index). for example, suppose have tuple: x = [(2, 3), (4, 3), (6, 9)] the value returned should (4, 3) . (2, 3) candidate, x[0][1] 3 (same x[1][1] ), however, x[0][0] smaller x[1][0] . so far have tried: start_point = min(x, key = lambda t: t[1]) however, checks second index, , not compare 2 tuples first index if second index's equivalent. include x value in tuple returned key; second element in key used when there tie y value. inverse comparison (from smallest largest), negate value: min(x, key=lambda t: (t[1], -t[0])) after all, -4 smaller -2 . demo: >>> x = [(2, 3), (4, 3), (6, 9)] >>> min(x, key=lambda t: (t[1], -t[0])) (4, 3)

sql - How to sha1 hash a c# login application -

i want make password hash password sha1 tried make passlogin = sha1(@passlogin) not working here code using (sqlcommand cmd = new sqlcommand("select * loginreport userlogin = @userlogin , passlogin = @passlogin", conn)) { conn.open(); cmd.parameters.addwithvalue("@userlogin", txtuser.text); cmd.parameters.addwithvalue("@passlogin", txtpass.text); sqldatareader dr = cmd.executereader(); if (dr.hasrows == true) { messagebox.show("successfully login"); form1 formreports = new form1(); formreports.showdialog(); application.exit(); } else { messagebox.show("check username , password again!!"); } } it seems you're not hashing value before assigning parameter. you may first want try hashing input string, see included code ( not tested! ) example how this: public static string generatesaltedsha1(string plaintextst...

How to display animated GIF picture in Android Widget which shows on Screen? -

i'm trying display animated gif picture in widget, , have url picture. know can use webview in activity webview.loadurl("http://my_url_here.gif") , webview not supported in android widget. i've had url picture, , i'm finding ways not using third party libraries. does know how display in widget? where no way show gif animation on remoteviews. can use widgets describes in official documentation

security - ClaimedIdentifier vs FriendlyIdentifier for storing in DB? Which is safer? -

i'm using openid 2.0 in application. need save openid identifier value in db verify user. can save email saving claimedidentifier seems approach. why safe use claimedidentifier , not friendlyidentifier storing in db? difference make? i both values in application, many posts avoid using friendlyidentifier due security issues. security issues can claimedidentifier overcome friendlyidentifier cannot? figured 1 out too- truncating openid friendly identifier , saving random string in db might cause scripting issues if has replicated intuit openid url format , passed scripting values. better save full unique claimed identifier value(https) , fetch , truncate match user.

python - Changing default color of text -

Image
in order change default color of text in app black, tried setting color property inside <label> 0,0,0,1 . color: text color, in format (r, g, b, a). color listproperty , defaults [1, 1, 1, 1]. this makes text black regardless of markup color used. example code @ bottom of post creates 3 buttons black text when color: 0,0,0,1 : and expected white, red, green text color when color: 1,1,1,1 : i assuming color applied after markup coloring, causing problem described above. question: correct way change default color of text? kivy version: 1.9.0 from kivy.app import app kivy.uix.boxlayout import boxlayout kivy.lang import builder kv = """ <label>: markup: true color: 0,0,0,1 # defaults 1,1,1,1 when not used <mywidget>: orientation: 'vertical' button: text: 'no markup text' button: text: '[color=ff0000]red markup[/color]' button: text: ...

joomla 2.5, user authentication -

i trying work out solution, how make authentication joomla 2.5 website. did log in form, , created test users, although don't know how access joomla db. can me find solution question. answers found on google, didn't quite understand. nice if share tutorials. thank in advance. try , think useful you, http://docs.joomla.org/j2.5:accessing_the_database_using_jdatabase

Translate animation with android -

Image
i new in android. want use translate animation in android. want red rounded image comes center of layout. comes . want red rounded image comes center image color green. in advance. final alertdialog.builder dialog = new alertdialog.builder(this) .settitle("auto-closing dialog") .setmessage("after 10 second, dialog closed"); dialog.setpositivebutton("confirm", new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int whichbutton) { // tasks when confirm clicked } }); final alertdialog alert = dialog.create(); alert.show(); // hide after 10 seconds final handler handler = new handler(); final runnable runnable = new runnable() { @override public void run() { if (alert.isshowing()) { alert.dismiss(); } } }; alert.setondismisslistener(new dialoginterface.ondismisslistener() { @override public void ondismiss(dialoginterface dialog)...

java - Setup custom auth and role in spring security -

i have extended websecurityconfigureradapter configure custom authentication , authorization. have introduced new api say, "/v1/api". requirement follows, this api supposed called entity role "api_role" , no 1 else also person "api_role" should not able call other api in system. how configuration like? @override protected void configure(httpsecurity http) throws exception { http.authorizerequests().antmatchers("/v1/api**").hasauthority("role_api"); the above code achieves 1 purpose, how block person role hit other api? you can use following java configuration. @override protected void configure(httpsecurity http) throws exception { http.authorizerequests().antmatchers("/v1/api**").hasauthority("role_api") .and().authorizerequests() .antmatchers("/**").not().hasauthority("role_api");

use case - Usage of const data member in C++ -

well, know functionality of const data member in c++ class. what want know is, purpose of introducing const data member in class. why use while writing real software? real-life usage of const data members? please give me few real life examples reasons. edit : not asking static const data member. asking real life use cases each object having different const value same data. you'd use const data member same reason you'd use any const object: value may arbitrarily initialised never changed. a rule of thumb denote const "by default", can picture plenty of reasons use in class. class user { user(const std::string& name) : name(name) {} private: /** * user's name invariant lifetime of object. */ const std::string name; }; can leave out const here? yeah, sure. may accidentally change name when didn't mean to. entire purpose of const protect against such accidents. however, sadly, class not assig...

android - Rising memory usage after start new activities -

similar case this question , app uses multiple activities display different sections. sliding menu's button, can switch 1 activity another. codes follow: intent intent = new intent(getapplicationcontext(), activitya.class); startactivity(intent); finish(); similar other menu buttons, switch activity b, c , d. when switch b, memory usage 30mb; switch b c, memory usage 35mb; switch c d, memory usage 40mb; switch d a, memory usage 45mb. when click "force gc" in android studio, memory usage drops 5 10mb only. how can stop memory usage increasing non-stop ? last, here androidmanifest.xml : <activity android:name=".activitya" android:screenorientation="portrait"> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <activity android:name=".ac...

java - How to create a flash light as well as strobe effect. Need help to fix strobe effect -

i trying create flash light application contains strobe function. have achieved flash light on/off effect running trouble strobe effect. whenever try create strobe effect application crashes. if remove that, works fine. i have 1 activity seekbar @ top , on/off switch @ center. want achieve if user clicks on/off button flash light should toggle on/off if seekbar @ top @ 0. if user increase value in seekbar flash light should start strobe accordingly , if user move value 0 flashlight should remain constant. please me fix error. log cat 07-23 16:54:12.610: w/dalvikvm(21210): threadid=11: thread exiting uncaught exception (group=0x40c15a68) 07-23 16:54:12.610: e/androidruntime(21210): fatal exception: thread-2373 07-23 16:54:12.610: e/androidruntime(21210): java.lang.runtimeexception: fail connect camera service 07-23 16:54:12.610: e/androidruntime(21210): @ android.hardware.camera.native_setup(native method) 07-23 16:54:12.610: e/androidruntime(21210): @ android.hardwar...

MySQL - Group By using different values -

i have table of messages , below shows 3 rows - second , third being between 2 users. when query table , use group both lines show want one. this query: select a.receiver order a.datetime desc limit 25; is there way limit 1 row return when both users have been senders/receivers. thanks first can group larger number , group smaller one. select a.sender, a.receiver, a.message, a. read, a.datetime messages ( a.sender = '1000000000' or a.receiver = '1000000000' ) group if(a.sender > a.receiver, a.sender, a.receiver), if(a.sender > a.receiver, a.receiver,a.sender) order a.datetime desc limit 25; note: the first if picks larger number , second 1 picks smaller number.

excel - Apply easyxf style for specific cell or row range only: xlwt Python -

i written few lines code.. book = xlwt.workbook() sheet = book.add_sheet('section details', cell_overwrite_ok=true) style_detail = xlwt.easyxf('font: name calibri, height 180,colour_index black;align: wrap on, vert center, horiz center; border : bottom thin,right thin,top thin,left thin;') sheet.write_merge(0, 0, 0, 0, 'product family') sheet.write_merge(1, 1, 0, 0, 'product category') sheet.write_merge(0, 0, 1, 1, 'product') . . sheet.write_merge(n, n, n, n, 'product') //n dynamic number.. now, after completing writing work. want apply style specific cells only(depending on requirement). rw = sheet.row(1) rw.set_style(style_detail) if apply style specific row apply entire row of sheet(for column endless columns). how can apply style specific cell of row only? please let know if more code or info require idea. thanks in-advance. you can add style object 6th argument of write_merge() function as sheet.write_m...

How to read XML file in Stored Procedure in Oracle SQL? -

i need consume xml file folder , perform transformations on specific tag values (say eventname value "loadstopapp"), assign temp variable, , insert temp variable dummy table. how can that, sample xml? <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <cisdocument> <eventname>loadstopappointment</eventname> <reasoncode>aph_</reasoncode> <reasoncodedescription>appointment changed</reasoncodedescription> <systemtimezoneoffset>0.000000</systemtimezoneoffset> <eventdatetime>2016-03-30t16:48:30</eventdatetime> <eventreporteddatetime>2016-03-30t16:48:30</eventreporteddatetime> <eventoccurreddatetime>2016-03-30t16:48:30</eventoccurreddatetime> </cisdocument> insert dummy_table ( eventname, reasoncode, reasoncodedescription, systemtimezoneoffset, eventdatetime -- ,... ) select extractvalue( ...

JQuery drag drop items and get its value to use it for search -

first of i'm not familiar jquery or javascript, know php i followed youtube tutorial , didn't expected result. what need create box drop images , , when image dropped in box title of image , can use title value in search (using box search area) i started mentioned tutorial, is: html: <html> <head> <title>drag drop using jquery</title> <meta charset="utf-8"/> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script> <link rel="stylesheet" type="text/css" href="style.css" /> <script src="jquery.js"/></script> </head> <body> <ul> <li class="item"><img src="banana.png" title="banana" alt="banana" /></li...

python - Displaying a temporary message while loading a page - Django admin -

i'm using django admin , i'm looking showing message user while page loading (something like: please wait...). there way show temporary message if user clicked 'admin:appname_modelname_changelist' link (load object change). i'm not using ajax transfer request. i'm looking ajaxstart , ajaxcomplete functions in order control start/end loading page. you override admin template , add javascript onclick handler on link show loader (with jquery example). overriding admin templates: https://docs.djangoproject.com/en/1.9/ref/contrib/admin/#overriding-admin-templates jquery onclick handler: https://api.jquery.com/click/

c# - populate many-to-many relationship table using navigation properties in Entity Framework -

i learning entity framework in asp.net mvc application. have 3 models - appmodel, categorymodel , app_categorymodel (to specify many many relationship between appmodel , categorymodel). snippet of is: public class categorymodel { [key] public int id { get; set; } public string name {get; set; } public virtual icollection<app_categorymodel> mapping { get; set; } } public class appmodel { [key] public int id { get; set; } public string name { get; set; } public virtual icollection<app_categorymodel> mapping { get; set; } } public class app_categorymodel { [key] public int id {get; set;} public int appid {get; set; } public int categoryid {get; set; } public virtual appmodel app {get; set;} public virtual categorymodel category {get; set;} } i following 'code-first' approach , tables got created successfully. but,...

Execute RFT script on a button click from VB.NET -

i have automation scripts in rft. have designed ui in vs2012(coding in aspx.vb) takes input fields here. need execute rft script on click of button taking fields ui arguments. help?? thanks in advance. you can use rft command line interface .

c# - How to bind complex objects to Telerik's RadGrid -

Image
i have create table monitor list of streams. table, can see attached, must have following features: the stream description (or name) monitored the type (input, output or both) the results of particular day ( and here problem ) this desidered result: the data streams provided web service, via json. i planned on doing radgrid, have difficulties in implementation. this model pass: [datacontractformat] public class streamoutputdto : basedto { public string name { get; set; } public string type { get; set; } public list<detailstream> details { get; set; } } where " detailstream " is: public class detailstream { public string id { get; set; } public datetime date { get; set; } public int countinfo { get; set; } public statestream stateinput { get; set; } public statestream stateoutput { get; set; } //... } public enum statestream { inprogress, received, declined, inexistent } so detailstream resu...

MongoDB SSIS with $unwind -

i started using mongodb source in ssis (using c# driver). new mongodb , c#. when did not have nested documents, statements below worked me: var query = query.and(query.or(query.gt("createdon",maxupdatedonbson), query.gt("updatedon", maxupdatedonbson)), query.or(query.lt("createdon", cutoffdate), query.lt("updatedon", cutoffdate)),query.in("testtype", testtypes) ); mongocursor<bsondocument> toreturn = collection.find(query); now, got nested documents. able create java script, , works mongodb itself db.test.aggregate( [ { $unwind : { path: "$items",includearrayindex: "arrayindex"} } , { $match: { $and: [ {$or: [ { createdon: { $gt: isodate("2015-11-22t00:00:00z")} }, {updatedon: { $gt: isodate("2015-11-22t00:00:00z") } } ] }, {$or: [ { createdon: { $lt: isodate("2016-05-09t00:00:00z")} }, {updatedon: { $lt: isodate("2016-05-09t00:0...

gruntjs - Grunt Usemin: How to define targets? -

i wondering how can use "targets" grunt usemin. e.g. run sth. like: grunt usemin:app this tried (error: warning: object # has no method 'indexof' use --force continue.) – same useminprepare usemin: { app : { html: ['<%= config.app.dist %>/app/{,*/}*.html'], css: ['<%= config.app.dist %>/app/css/{,*/}*.css'], options: { dirs: ['<%= config.app.dist %>/app'] } }, site: { html: ['<%= config.site.dist %>/{,*/}*.html'], css: ['<%= config.site.dist %>/css/{,*/}*.css'], options: { dirs: ['<%= config.site.dist %>'] } } }, in grunt usemin targets defined in html page not in gruntfile. <!-- build:js scripts/vendor.js --> <script src="bower_components/jquery/jquery.js"></script> <scr...

javafx - How to make a TableView Column as LocalDate and set it's value only via FXML? -

how can fill localdate values column in fxml only? somewhere in controller class: protected void addperson(actionevent event) { observablelist<person> data = tableview.getitems(); data.add(new person(firstnamefield.gettext(),lastnamefield.gettext(),emailfield.gettext(),checkbox.isselected(),integer.parseint(numberfield.gettext()),localdate.now())); firstnamefield.settext(""); lastnamefield.settext(""); emailfield.settext(""); checkbox.setselected(false); numberfield.settext("0"); datefield.settext(""+localdate.now()); } person class: public class person { private final simplestringproperty firstname = new simplestringproperty(""); private final simplestringproperty lastname = new simplestringproperty(""); private final simplestringproperty email = new simplestringproperty(""); private final simplebooleanproperty checked = new simplebooleanprope...

java - Why does Spark Streaming stop working when I send two input streams? -

i develping spark streaming application in need use input streams 2 servers in python, each sending json message per second spark context. my problem is, if perform operations on 1 stream, works well. if have 2 streams different servers, spark freezes before can print anything, , starts working again when both servers have sent json messages had send (when detects ' sockettextstream not receiving data. here code: javareceiverinputdstream<string> streamdata1 = ssc.sockettextstream("localhost",996, storagelevels.memory_and_disk_ser); javareceiverinputdstream<string> streamdata2 = ssc.sockettextstream("localhost", 9995,storagelevels.memory_and_disk_ser); javapairdstream<integer, string> datastream1= streamdata1.maptopair(new pairfunction<string, integer, string>() { public tuple2<integer, string> call(string stream) throws exception { tuple2<integer,string> streampair= ...

amazon web services - Getting error: Missing Authentication Token after AWS API request -

Image
i trying call lambda function through aws api gateway. i've been getting error when tried iam authentication, api key authentication , no authentication. {"message":"missing authentication token"} some people had same problem due non existing endpoint. however, i've taken endpoint directly lambda function aws console. i've been trying open url in browser , on postman (with , without header authentication: x-api-key: *****************). both responded above stated error. one more step: in postman, need set authorization aws signature , , enter accesskey , secretkey iam user: postman screenshot

php - Retrofit 2 response body contents only "<html>" string -

i'm trying understand how use retrofit library, created android project , simple php script. index.php file location xampp's htdocs directory. here php script, here want return string when script executed <html> <head> <title>php test</title> </head> <body> <?php echo "success"; ?> </body> </html> on android part want send request @get("/") call<string> test(); here send response , necessary preparations gson gson = new gsonbuilder() .setdateformat("yyyy-mm-dd't'hh:mm:ssz") .setlenient() .create(); retrofit retrofit = new retrofit.builder() .baseurl("http://192.168.43.169:80/") .addconverterfactory(gsonconverterfactory.create(gson)) .build(); idatasyncapi datasyncapi = retrofit.create(idatasyncapi.class); cal...

ffmpeg - how to set effect on video in android programmatically? -

i have video save in sdcard, want apply effect black , white , etc. it's functionality editing in video in photo editor or video editor applications. now want functionality in android programmatically? when user choose black , white color in option should response , change effect of our video , save sdcard. i have find solution like, https://github.com/krazykira/videffects but has not save functionality of video , if go through in "ffmpeg" library not responding quickly? how can change effect of video , save video in sdcard? thank you this link have lot of information regarding ffmpeg , have used in alot of projects use source , ask question on forum regarding ffmpeg surely answers asap and command greyscale effect on video black & white filter (gray scale): commandstr = "ffmpeg -y -i /sdcard/videokit/in.mp4 -strict experimental -vf hue=s=0 -vcodec mpeg4 -b 2097152 -s 320x240 -r 30 /sdcard/videokit/out.mp4";

c# - Change value in List<T> using Linq -

i have list whant change value of double property in list if property has decimals. if x.value has decimals, want change value take first decimal woithout rounding it. i'm trying can't right: ( only assignment, call, increment, decrement, await, , new object expressions can used statement ) var newlist = correctionqoutas.tolist() .foreach(x => x.value%1 != 0 ? x.value = convert.todouble(string.format("{0:0.0}", x)) : x.value = x.value); edit: correctionqoutas custom object has 4 properties. double starttime, double endtime, double value , string id. you can't modify collection while you're iterating it. here's simple approach var list=correctionqoutas.tolist(); for(int i=0; i<list.count(); i++) { if(list[i].value % 1 != 0) { list[i].value = convert.todouble(string.format("{0:0.0}", list[i].value)) ; } }

How to store a single column of a single row out of a MySQLi prepared statement in a PHP variable? -

i'm new php , mysql , i'm looking solution store single value of database row in variable using prepared statement. right prepared statement , execution: $emailsql = $conn->prepare("select email user email = ? limit 1;"); $emailsql->bind_param('s', $email); $emailsql->execute(); i tried get_result() , fetch() , fetch_object() , i'm out of ideas , google search results. you need add code binding of result specific variable $emailsql->bind_result($emailresult); and fetch : while($emailsql->fetch()){ printf ($emailresult); } so should it: $emailsql = $conn->prepare("select email user email = ? limit 1;"); $emailsql->bind_param('s', $email); $emailsql->execute(); $emailsql->bind_result($emailresult); while($emailsql->fetch()){ printf ($emailresult); } in case need variable outside loop take approach: $theemail; $emailsql = $conn->prepare("select email use...

debugging - Windows Phone 8 Source not available -

while debugging receive exception: a first chance exception of type 'system.reflection.targetexception' occurred in mscorlib.ni.dll visual studio says: source information missing debug information of module. how can fix ? a first chance exception of type first chance exceptions ok. second 1 have worry (it means first chance not handled). visual studio says: source information missing debug information of module. you might able acquire symbols microsoft. see use microsoft symbol server obtain debug symbol files . usually, set project use microsoft's symbol server. debug project, , visual studio fetch symbols libraries microsoft. fetching microsoft takes time. after first fetch, turn off feature. way, symbols available without latency missing symbols subsequent debug sessions. i don't know microsoft makes available windows phone because have not done enough development it. date, i've tried porting native libraries through comman...

C# ChromiumWebBrowser: Prevent control from stealing focus -

there have been many similar questions, not solved problem. i'm doing program has form chromiumwebbrowser in it. navigation done automatically. when webbrowser complete it's task, i'll dispose it, create new webbrowser, add form, , load new address. but, when new webbrowser created , added form, program jumps in front of ever other program in top focus. example: start program, press button start task, open notepad type text , program jumps in front of when navigating new site. even when program minimized, don't jump in font of, still steals focus, , no program has focus. please me! alot! your form need set: this.topmost = false; , set: this.bringtofront(); add new browser form function follow: private chromiumwebbrowser addnewbrowser(fatabstripitem tabstrip, string url) { if (url == "") { url = openurl; txturl.select(); txturl.focus(); } else { tabs...

C# split string of first character occurrence -

i thought simple kicking butt. i have string 21. a.person want a.person out of this. i try following 21 string[] pname = values[i, j].tostring().split(new char[] { '.' }, 2); pname[1] ??? values[i, j].tostring() = 21. a.person , yes i've verified this. everyone giving alternate solutions when yours should work. problem values[i, j] must not equal 21. a.person i plugged simple test.. [test] public void junk() { string[] pname = "21. a.person".split(new char[] { '.' }, 2); console.writeline(pname[1]); } what print? a.person (with space in front, because didn't trim space)

cakephp helper call function of other helper -

what trying achieve automate helpers loading scripts , css. idea have function on every helper, loading scripts / styles used dedicated helper. guess can achieved having controlling helper querying active helpers , execute script/style loading function. what cannot find in documentation is: how can helper query list of active helper objects you can query helperregistry of view using (see view::helpers ): $this->_view->helpers(); once have registry, can names of loaded helper using helperregistry::loaded() , retrieve them using helperregistry::get() : // inside helper: $registry = $this->_view->helpers(); foreach ($registry->loaded() $name) { $helper = $registry->get($name); } disclaimer: code above not tested.

Completing the where clause in sql server -

i have table kyc3 there walletno , status , rank columns present. rank columns filled 0. while status column has following data: accepted, rejected, registered , scanned. want put value each status in rank column accepted = 1, rejected = 2, registered = 3 , scanned = 4 i wrote following query not understand how complete it: insert kyc3([rank]) select status_ kyc3 i understand need put clause indicate logic data population. should write? you can use update fill cell of existing row. update kyc3 set rank = case when status = 'accepted' 1 when status = 'rejected' 2 when status = 'registered' 3 when status = 'scanned' 4 end use insert creating new rows.

eclipse - No resource identifier found for attribute 'fullBackupContent' in package 'android' -

part of androidmanifest.xml <application android:allowbackup="true" android:fullbackupcontent="false" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/appthemecompat" android:largeheap="true" > i'm newbie in android developer, use eclipse mars sdk 25.1.3 , error. no '/xml' folder under 'res/' in project. should fix issue? sorry english. does manifest tag this? <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.my.appexample"> i never used "fullbackupcontent" every attribute needs declared xmlns use it. also, if new android development. why need "fullbackupcontent" , "largeheap"? did copy somewhere or on purpose?

c# - Turn on Windows Virtual Keyboard (Tabtip.exe) in email and numeric mode -

i have developed wpf application using webbrowser (system.windows.browser) , have loaded local html file input controls of type email, number, tel etc. <input type="email" /> <input type="number" /> the virtual keyboard changes email, number while page loaded on internet explorer not on developed wpf webbrowser application.

asp.net mvc 4 - Unable to connect web exception mvc4 -

we doing facebook posting application using httpwebrequest. httpwebrequest request = webrequest.create(url) httpwebrequest; using (httpwebresponse response = request.getresponse() httpwebresponse) { //doing stuff here. } this code failing @ line uisng unable connect server exception. not failing always, failing in 90% cases. can advise how best can addressed? try (this may not answer; trying debug issue), see if fails other 1 does; try replacing google.com own url: webrequest g = httpwebrequest.create("http://www.google.com"); var response = g.getresponse();

php - Only Wordpress logo loads -

Image
good day, so in process of setting wordpress website , have put on theme. since beginning customize it, i've realized page stopped loading contents, , began loading logo against blank page. the blue rectangle logo going. theme jobcareer. suggestions?

javascript - How to convert canvas to SVG with embedded image base64 in fabricjs -

i have fabricjs canvas image, loaded fabric.image.fromurl() method. i need export svg, want export image embedded source in base64, not link. how can it? way load image source not link? example code: loading image: fabric.image.fromurl('./assets/people.jpg', function (image) { image.set({ left: 10, top: 30 }); canvas.add(image); }; exporting svg: canvas.tosvg(); in exported svg have: <image xlink:href="http://localhost:8383/app/assets/people.png" /> but want in base64 like: <image xlink:href="data:image/png;base64,ivborw0kggoaaaansuheugaaae8aaakucayaaacizzszaaaaaxnsr0iars4c6qaaaarnqu1baacx(...)" /> there no option can achieve this: image has method called 'getsvgsrc'; override this: fabric.image.prototype.getsvgsrc = function() { return this.todataurlforsvg(); }; fabric.image.prototype.todataurlforsvg = function(options) { var el = fabric.util.createcanvaselement(); ...

pdf generation - MS Access report to PDF cuts of some characters inconsistently -

my print preview ms access shows fine. here's actual pdf file snapshot shows letters cut in half. happens inconsistently report , not same data. in report 5 out of 40 questions had first letter cut in half. please advise. i've tried adjusting data field must start, i.e. i've moved start of question bit more right, no difference. here's design view i've highlighted in yellow question starts. i've moved more right, makes no difference. here's user captures questions ] your problem text lines have stray tab character (ascii 9) @ or near beginning of line, being interpreted lateral positioning move string. correct lines not have stray tab. if use acrobat's text editor delete tab, rest of line jumps view. below, i've extracted text of each line in sample, , replaced unexpected tab character " x ." if use acrobat text editing navigate spot in line tab located (you won't see directly, it's there), shift-cursor side...

java - Actual use of lockInterruptibly for a ReentrantLock -

what use method lockinterruptibly ? have read api it's not clear me. express in other words? the logic same interruptible blocking methods: allows thread react interrupt signal sent thread. how particular feature used application design. example, can used kill contingent of threads in pool waiting aquire lock.

saml - How do I fetch users from IdP-ADFS in Java program? -

we have web-based application talks idp , idp uses adfs saml. using spring security framework in between idp , our server, now, able authenticate user @ idp , sending user name our application server(without re-authenticating). to assign different roles, need users @ our application server(we assign privileges @ application level). so question how fetch users adfs application server? adfs sits on top of ad. adfs has nothing whatsoever user management. so need migrate users out of ad. you can ldap commands e.g. howto: (almost) in active directory via c# , everything in active directory via c#.net 3.5 (using system.directoryservices.accountmanagement) .

google app engine - cron job fails in gae python -

i have script in google appengine started every 20 minutes cron.yaml. works locally, on own machine. when go (manually) url starts script online, works. however, script fails complete online, on google's instances, when cron.yaml in charge of starting it. the log shows no errors, 2 debug messages: d 2013-07-23 06:00:08.449 type(soup): <class 'bs4.beautifulsoup'> end type(soup) d 2013-07-23 06:00:11.246 type(soup): <class 'bs4.beautifulsoup'> end type(soup) here's script: # coding: utf-8 import jinja2, webapp2, urllib2, re bs4 import beautifulsoup bs google.appengine.api import memcache google.appengine.ext import db class article(db.model): content = db.textproperty() datetime = db.datetimeproperty(auto_now_add=true) companies = db.listproperty(db.key) url = db.stringproperty() class company(db.model): name = db.stringproperty() ticker = db.stringproperty() @property def articles(self): return...

python 3.x - python3 os.mkdir() does not enforce correct mode -

is bug or feature ? when create directory os.mkdir (idem pathlib.path.mkdir ) , explicit mode, permissions of created directory not fit. if enforce os.chmod again, works... >>> import sys, os >>> sys.version '3.4.3 (default, feb 27 2015, 18:13:37) \n[gcc 4.4.5]' >>> os.mkdir('truite', mode=0o2770) >>> oct(os.stat('truite').st_mode) '0o40750' >>> os.chmod('truite', 0o2770) >>> oct(os.stat('truite').st_mode) '0o42770' since wanted able make directory parents , mode o2770, here code ( pth pathlib.path object) : def make_shared_dir(pth) : if not pth.parent.is_dir() : make_shared_dir(pth.parent) if not pth.is_dir() : pth.mkdir() pth.chmod(0o2770) it's feature. the documentation mentions it, albeit briefly: os.mkdir(path[, mode]) create directory named path numeric mode mode. default mode 0777 (octal). on sys...

Is there a good rule for using 'const' in classes and operator overloads in C++? -

i have piece of code this: class educationalcentre { string _centrename; vector<course> _courses; // courses offered centre collection<course*, student*, 150> _applicants; public: educationalcentre(string name="<name>") { _centrename = name; } educationalcentre(const educationalcentre& obj) :_courses(obj._courses), _applicants(obj._applicants) { _centrename = obj._centrename; } }; now, in part _applicants(obj._applicants) copy construction header, there's squiggly red line around (obj , hovering error says type incompatibility ( const being mentioned). since don't want change @ stage (this part of exam test) - know why happening. i tried removing const educationalcentre(const educationalcentre& obj) , indeed solves problem but.. said, rather learn causes instead of removing it. rule using const use whenever can :) of course, best practices there exc...

Use the floating action button in Nativescript/Angular project -

in mobile app, have message page , i'd add floating action button write new message. of course heard plugin allowing me use fab seems work nativescript project. i've tried using registerelement function able use element in html file (like did cardview ) didn't give anything. maybe i'm doing wrong. missing ? try registerelement("fab", () => require("nativescript-floatingactionbutton").fab);

python - Show text annotations on selection in Bokeh -

i have little bokeh plot data points , associated text labels. want text labels appear when user selects points box select tool. gets me close: from bokeh.plotting import columndatasource,figure,show source = columndatasource( data=dict( x=test[:,0], y=test[:,1], label=[unquote_plus(vocab_idx[i]) in range(len(test))])) tools="box_zoom,pan,reset,box_select" p = figure(plot_width=400, plot_height=400,tools=tools) p.circle(x='x',y='y', size=10, color="red", alpha=0.25,source=source) renderer = p.text(x='x',y='y',text='label',source=source) renderer.nonselection_glyph.text_alpha=0. show(p) this close, in if draw box around points, text labels shown , rest hidden, problem renders text labels start (which not want). initial plot should have labels hidden, , should appear upon box_select. i thought start rendering alpha=0.0, , setting selection_glyph parameter, this: ... renderer = p.text(...

react native - How can I center items and selected item in RN Picker android? -

Image
is possible center android picker items , selected item? i've searched everywhere, , tried alignitems:'center' & justifycontent:'center', items still aligned left (visible on photos), when put alignself:'center' picker no longer visible. have clues? var reports = [ {name: 'report 1', id: 'r1'}, {name: 'report 2', id: 'r2'}, {name: 'report 3', id: 'r3'}, {name: 'report 4', id: 'r4'}, {name: 'report5', id: 'r5'}, {name: 'report6', id: 'r6'} ]; ... <picker style={styles.androidpicker} mode={'dropdown'} selectedvalue={this.state.report} itemstyle={styles.reports.iospicker} onvaluechange={(reportid) => this.onreportchanged(reportid)}> {reports.map(function (reports) { return <picker.item style={{alignself:'cen...