Posts

Showing posts from June, 2013

backbone.js - Marionette router not triggering controller method on route -

i'm trying upgrade application marionette 1.* > 2.4.2. biggest part of change shifting away marionette modules using browserify/watchify commonjs style modules. i've hit roadblock while trying router/controller , running. no error thrown, reason routes arent triggering controller methods. doc_router.js: var $ = require('jquery') , _ = require("underscore") , backbone = require("backbone") , marionette = require("backbone.marionette") , app = require("../../app.js") var router = marionette.approuter.extend({ approutes: { "docs": "listdocs" } }); // map controllers var api = { listdocs: function () { console.log("listdocs") // doesnt log console app.docapp.list.controller.listdocs(); } }; // update url when controller event // requires triggered, call // appropriate controller via api. app.on("docs:list", function () {

android - Transfer data between smartwatch using nfc -

is possible transfer data between smart watch 3 using nfc api. have checked development , sdk api . can have api or sdk smartwatch3 can transfer data between 2 smartwatch3 using nfc?

php - Variables in javascript while keeps resetting -

this question has answer here: what difference between client-side , server-side programming? 4 answers i have while loop in code: while (i < 5) { var pos = new google.maps.latlng(<?php echo json_encode($lat[$b]); ?>,<?php echo json_encode($lon[$b]);?>); var marker = new markerwithlabel({ position: pos, draggable: true, raiseondrag: true, map: map, icon: 'icon.png', labelcontent: <?php echo json_encode($unidad[$b]); $b=$b+1;?>, labelanchor: new google.maps.point(22, 0), labelclass: "labels", // css class label labelstyle: {opacity: 0.75}, }); google.maps.event.addlistener(marker, "click", function (e) { iw1.open(map, this); }); i++; } now, let me explain code , happening. first of using javascript , php because need info db, , add map (google maps) need use javascript

c# - Connection string with ASP.Net -

i have solution 3 projects: a web application (wa) a data model layer (dml) using code first, , a data access layer (dal) the wa’s web.config , dml's app.config each have connection string section specifying connection string database. i've noticed dml connection string doesn't matter. safe remove section app.config file? also, why string unused? finally, i'm guessing when application run, connection database established using connection string in web.config file , database definition managed dml/dal? is because other projects aren’t being run per se, methods , properties being referenced? thanks yes, can remove connection string dml's app.config. unused because starting web application , it's config matter @ runtime.

sails.js - How to use bigserial for primary key id with Sails js -

i have following model definition: module.exports = { attributes: { id: { type: 'bigserial', primarykey: true }, email: { type: 'email', required: true, unique: true } } when lifed sails, didn't give me warning "bigserial" data type, though not officially documented. however, on table created on postgresql, column "id" has type "text". how have bigserial primary key? you can use command in db `alter table your_table add column key_column bigserial primary key; in sails model can use somethin this: module.exports = { connection: yourconnection, tablename: yourtablename, attributes: { id: { type: 'integer', autoincrement: true, primarykey: true }, email: { type: 'email', required: true, unique: true } } note: need set db connection config on config/connections.js somepostgresqlserver: { adapter: 'sails-postgresql&#

java - Get a NoSuchMethodError:Spring Framework when I am not using Spring -

Image
i running normal automation case error : java.lang.nosuchmethoderror: org.springframework.util.classutils.iscglibproxyclass(ljava/lang/class;)z @ org.apache.cxf.common.util.springaopclasshelper.getrealclassinternal(springaopclasshelper.java:86) @ org.apache.cxf.common.util.classhelper.getrealclass(classhelper.java:55) @ org.apache.cxf.jaxrs.provider.providerfactory.setcommonproviders(providerfactory.java:513) @ org.apache.cxf.jaxrs.client.clientproviderfactory.setproviders(clientproviderfactory.java:91) @ org.apache.cxf.jaxrs.provider.providerfactory.initbasefactory(providerfactory.java:138) @ org.apache.cxf.jaxrs.client.clientproviderfactory.initbasefactory(clientproviderfactory.java:81) @ org.apache.cxf.jaxrs.client.clientproviderfactory.createinstance(clientproviderfactory.java:56) @ org.apache.cxf.jaxrs.client.jaxrsclientfactorybean.initclient(jaxrsclientfactorybean.java:364) @ org.apache.cxf.jaxrs.client.jaxrsclientfactorybean.createwebclient(jaxrsclientfactorybean.java:212)

Qt Visual Studio Community Add-in -

does qt visual studio addin support visual studio 2015 community edition? i try instal in vs say: https://wiki.qt.io/visual_studio_add-in these instructions refer visual studio 2012. replace references vs2012 appropriate file vs version (2008, 2010 , 2012 supported). qt 5.6 has not shipped , first support vs 2015. @ least officially built it. don't know if add-on available @ time. edit september, 2016: there visual studio add-in qt vs tools (beta) . in meantime, there this add-on emulates official add-on in vs 2015.

javafx prevent Enter key propogating from default button action -

i have treeview onkeyrelease(...) handler watches enter key. it launches modal dialog window has 'ok' button set default onaction(...) handler. when press enter in dialog onaction() handler invoked, it's work, , and explicitly close() dialog. the enter key propagated calling treeview , picked again onkeyrelease() handler. question: how can prevent enter key propagating after button's onaction called? button's default onaction not key event there seems consume it. ideas? below skeletal representation of doing... /** * here treeview impl framework... */ public class taxonomyeditor extends ... { private final keyreleaseeventhandler keyreleaseeventhandler = new keyreleaseeventhandler(); private boolean edited; public final void init(taxonomy taxonomy) { ... addeventhandler(appevent.tree_item_added_event, new eventhandler<appevent>() { @override public void handle(appevent event) {

asp.net mvc - Is checking ViewBag.Val != null correct in Razor? -

what's proper way check in razor if viewbag has value set? know i can do if(viewbag.foo != null) { ... } but looking in events stream in vs 2015 notice generates (handled) runtimebinderexception . the fact throws error leads me suspect not correct way check presence of value, , harming performance (though have not done testing). in addition doesn't distinguish between value being absent , value being set null . is there more correct approach? there no way defined razor developers, can see this using extension method.

html - PHP Contact Form, not sending email -

this question has answer here: php mail function doesn't complete sending of e-mail 24 answers i have been trying make first contact form , after hours of googling can't seem find error in code why it's not working. my php code: <?php $to = 'llavert@gmail.com'; $from = strip_tags($_post['email']); $name = strip_tags($_post['name']); $adress = strip_tags($_post['address']); $city = strip_tags($_post['city']); $subject = strip_tags($_post["subject"]); $message = strip_tags($_post['message']); $header = "from: noreply@example.com\r\n"; $header.= "mime-version: 1.0\r\n"; $header.= "content-type: text/html; charset=iso-8859-1\r\n"; $header.= "x-priority: 1\r\n"; mail($to, $subject, $message, $header); print_r(error_get_last()); ?> my html form:

ios - How to distribute weights according to the width of UIView with Objective-C -

Image
i'm trying linearlayout in ios, distribute weights depending layout. in case, i've got 4 views (3 uiview , 1 uilabel . scope giving same width of them depending superview's width, , set frame depending of it. so in viewdidload execute command: [self.view1 setframe:cgrectmake(0 * self.view1.superview.frame.size.width/4, self.view1.frame.origin.y, self.view.frame.size.width/4, self.view1.superview.frame.size.height)]; [self.view2 setframe:cgrectmake(1 * self.view2.superview.frame.size.width/4, self.view2.frame.origin.y, self.view.frame.size.width/4, self.view2.superview.frame.size.height)]; [self.view3 setframe:cgrectmake(2 * self.view3.superview.frame.size.width/4, self.view3.frame.origin.y, self.view.frame.siz

Python - parsing user input using a verbose regex -

i try design regex parse user input, in form of full sentences. stuggling expression work. know not coded trying hard learn. trying parse precent 1 string see under code. my test "sentence" = how i'm 15.5% wholesome-looking u.s.a. radar () [] {} -- are, ... you? text = input("please type coherently: ") pattern = r'''(?x) # set flag allow verbose regexps (?:[a-z]\.)+ # abbreviations, e.g. u.s.a. |\w+(?:[-']\w+)* # permit word-internal hyphens , apostrophes |[-.(]+ # double hyphen, ellipsis, , open parenthesis |\s\w* # sequence of word characters # |[\d+(\.\d+)?%] # percentages, 82% |[][\{\}.,;"'?():-_`] # these separate tokens ''' parsed = re.findall(pattern, text) print(parsed) my output = ['how', "i'm", '15', '.', '5', '%', 'wholeso

javascript - How to only change toggle image of child element? -

i have plus/minus image toggle using jquery, when click on ul , every plus/minus image changes @ same time. need change image ul clicked on. jquery: $("#xmldiv").on("click", "ul", function(e) { $(this).find(".mainlist").slidetoggle('slow', function () { if($('span.minus img').attr('src') == 'images/plus.png') $('span.minus img').attr('src', "images/minus.png"); else $('span.minus img').attr('src', "images/plus.png"); }); }); html: <div id="xmldiv"> <ul class="section"> <li class="root"><span class="minus"><img src="images/minus.png"></span> antivirus compliance <ul class="mainlist" style="margin-left: -25px; display: block;"> <li class="desc"

html - How to target label element based on input element's dynamic class? -

html <label for="email">email</label> <input type="text" name="email"></input> the class attribute of email input element may change, if user enters invalid email format. want label change red when input it's gets class "invalid". in fact, want labels for attribute "invalid aware" of assigned input elements. css attempt: label[for=*.invalid]{ color: red; } the above incorrect because might have specify specific form element name. option 1 if you're adding dynamic class input element ( .invalid ), why not add class label element, well? simplify styling of label when input fails validation. option 2 i understand changing label color red highlights error user. in option still highlight error user, in different way. css :valid , :invalid pseudo-classes represent form , input elements validate or fail validate. these pseudo-classes style input not label . opti

string formatting - Java getFloat troubles - decimals being truncated -

Image
i'm querying postgres database storing floats. see in postgres inputs being stored decimal values, when query postgres java , put them textboxes via settext decimals being trimmed. here's code: statement stmnt = conn.createstatement(); resultset rs; rs = stmnt.executequery("select * \"tblsamples\" " + " \"fnname\" = '" + cmbfnname.getselecteditem().tostring() + "' limit 1;"); while ( rs.next() ) { txtid.settext(rs.getstring("id")); //attempt 1: txtxoffset.settext(string.format("%f", rs.getfloat("fnxoffset"))); //attempt 2: txtxoffset.settext(string.format("%0.000000000f", rs.getfloat("fnxoffset"))); //attempt 3: txtxoffset.settext(string.format("%d",(long)rs.getdouble("fnxoffset"))); } none of these things working. can't tell if it's because of "

visual c++ - strlen not counting newlines? -

i embedded lua project , came across strange (for me) behavior of strlen , lua interpreting. trying load string, containing lua code, lual_loadbuffer , consistently threw error of " unexpected symbol " on whatever last line of lua code, except if whole chunk written in 1 line. example: function start() print("start") end would results error: unexpected symbol on 3rd line, but function start() print("start") end loads successfully. i figured out loading same chunk lual_loadstring , gives no errors, , saw uses strlen determine length of specified string (i used std::string::size ) , using strlen provide length of string lual_loadbuffer results in successful loading. now question was: may difference between strlen , std::string::size, , @ surprise answer strlen not counting new lines (' \n '). is: const char* str = "this string\nthis newline"; std::string str2(str); str2.size(); // gives 34 strlen(str)

javascript - jQuery click to scroll to cloest div.class and show not working -

hi have ideas im doing wrong here? when click show content want find closest div class ask , scroll not work... im new jquery maybe im doing wrong think logic correct haha getting error in console: cannot read property 'top' of undefined example: $(document).ready(function() { // show examples $(document).on("click", ".show-syntax", function(e) { var ele = $(this).parent().closest(".render-syntax"); // search within section ele.show(); $("html, body").animate({ scrolltop: $(ele).offset().top }, 100); e.preventdefault(); }); }); .render-syntax { display: none; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <div class="container"> <a href="#" class="show-syntax">show content</a> </div> <div class="render-syntax"> <

excel - Find distinct values based upon multiple columns -

i have spreadsheet of sales (to keep example simple) 3 columns name -- state -- country it's easy find how many sales. (sum lines) can find out how many customers have how finding out how many customers particular state (and country) name -- state -- country p1----- ca------ usa p2----- ca------ usa p1----- ca------ usa p1----- ca------ usa p3----- ny------ usa p3----- ny------ usa the above example give 2 unique customers ca , 1 unique customer ny , 3 usa edit: the desired result above table state - unique customers ca ---- 2 ny ---- 1 country - unique customers usa ---- 3 assuming data have headers in row 1 of columns a, b, , c, follow these directions. in cell f1 enter state. in cell g1 enter count. in cell f2 enter array-formula (must confirmed ctrl + shift + enter↵ ): =iferror(index(b$2:index(b:b,counta(b:b)),match(0,countif(f$1:f1,b$2:index(b:b,counta(b:b))),)),"") in cell g2 enter regular formula (confirmed enter): =if(l

Python one liner conditional -

can please explain code for? shift, range = order < self.order , (1, (to, orig-1)) or (-1, (orig+1, to)) i know set shift , range depending on result of order < self.order what don't know why there and , or statement there from documentation of boolean expressions in python - the expression x , y first evaluates x ; if x false, value returned; otherwise, y evaluated , resulting value returned. the expression x or y first evaluates x; if x true, value returned; otherwise, y evaluated , resulting value returned. so and / or expressions in python don't return true or false , instead - for and return last evaluated false value, or if values true , return last evaluated value. for or returns last evaluated true value, or if values false , returns last evaluated value. so , in case if condition true , returns value of (1, (to, orig-1)) , otherwise returns value of (-1, (orig+1, to)) . very simple examples show - &g

How to install and start the 0.4-pre Julia kernel with IPython notebook? -

i installed 0.4-pre julia kernel on mac, goes into /applications/julia-0.4.0-pre-349a4e1977.app/contents/resources/julia/bin/julia and set symbolic link kernel ln -s /applications/julia-0.4.0-pre-349a4e1977.app/contents/resources/julia/bin/julia /usr/local/bin/julia but in ipython notebook, aka jupiter, 0.3.10 starts when ipython notebook --profile=julia how include 0.4-pre kernel option in ipython notebook? if have ipython/jupyter version 3 or above, should start with ipython notebook without --profile julia

Android : How to draw layout with slanting and curved edges like this? -

Image
i unable figure out how design layout in android images shown below. please suggest solutions in order achieve same. this can achieved in 2 ways: 1- use images in background , position them accordingly. 2- write own view class , override ondraw(canvas canvas) method. can android documentation. creating custom views creating view class or check solution help: android custom shape

How to create fake PHP directory that mapped to another PHP directory? -

for example, have folder web.com/app/resource/css/ , browser perspective want user able access folder via url web.com/css/ instead of web.com/app/resource/css/ . how accomplish php? put in .htaccess file: rewriteengine on rewriterule ^css app/resources/css/ [qsa,nc,l]

haskell - How should I specify the type in a instance statement when there is a type class restriction? -

i trying define simple data structure suppose add infinity element type under num . put under defined class numcontainer , has method fromnum construct numwithinf using regular num . code straight forward. data numwithinf = infinity | finite deriving show class numcontainer k fromnum :: num => -> k instance num => numcontainer (numwithinf a) fromnum x = finite x however when ran it, ghci gave me following error: hw.hs:7:24: not deduce (a ~ a1) context (num a) bound instance declaration @ hw.hs:6:10-45 or (num a1) bound type signature fromnum :: num a1 => a1 -> numwithinf @ hw.hs:7:5-24 `a' rigid type variable bound instance declaration @ hw.hs:6:10 `a1' rigid type variable bound type signature fromnum :: num a1 => a1 -> numwithinf @ hw.hs:7:5 in first argument of `finite', namely `x' in expression: finite x in equation `fromn

Printing a Google Chart: print css ignored -

i have google horizontal bar chart grows downwards dynamically depending on number of items, 2500 px. <div class="page"> <div class="pagecontent"> <div id="chart" style="width:80%; height: ${chartheight}px;"></div> </div> </div> i'm trying fit 1 full page when printing. none of browsers seems care width/height set, no matter combination of min-height, max-height , height tried. tried setting both 100% , pixel value, 2500px chart ends 1 , half page tall. div.page { page-break-after: always; } .pagecontent { margin: 40px 5px 5px 5px; } @media print { body {font-size: xx-small;} #chart {width: 100% !important; min-height:100px !important ;max-height:100px !important; height:100px !important;} div.pagecontent {margin: 5px;} } fitting height lesser issue, problem half of chart missing because of being wide.

javascript - Handle Non-Angular pages in Protractor -

i have application navigates away non-angular app login. basic login this. first, loads angular app, click on button on page. navigates away non angular app (sts implemented identityserver) , logs in, navigates angular app. here code wrote handle this. this.login = function (userid) { browser.driver.get(browser.params.host.hostname); browser.driver.findelement(by.id('continuebutton')).click(); browser.driver.wait(function () { browser.driver.findelement(by.xpath("//*[@id=\"body\"]/section/div[2]/div[3]/a")).click(); browser.driver.findelement(by.id("username")).sendkeys(userid); browser.driver.findelement(by.id("password")).sendkeys("flisdev"); browser.driver.findelement(by.tagname("button")).click(); }, 10000); }; but throws 'angular not found on page" error , randomly element not found error link referenced xpath. basic flow of logi

How to Disable Mobile View in Magento and Display the Desktop screen -

i using venus theme on magento, when trying load site on mobile , content been displayed in irregular format. want disable responsive layout same desktop style should displayed on mobile. can 1 in finding out this. it difficult task developer, check css of remove css using mobile view. think should try make correct responsive view. can find media screen size.

exception handling - Why doesn't scanner ask for an other input in a try-catch while loop java -

suppose need keep on asking user till enters double . what did used while loop , checking if there exception or not. if there exception, go , ask next input. double bal = 0; scanner sc = new scanner(system.in); while (true) { try { system.out.println("enter balance"); bal = sc.nextdouble(); break; } catch (exception e) { system.out.println("that isn't number"); } } system.out.println("bal " + bal); sc.close(); but if enter non-double doesn't ask next input, keeps on printing 2 lines ending in infinite loop. enter balance xyz isn't number enter balance isn't number enter balance isn't number enter balance isn't number .... what i'm missing? you need discard previous input stream calling sc.next() in catch block. sadly, scanner not automatically when input fails.

php - laravel - add conditions to relationships -

i have 2 models "channels" , "schedules" relationship 1 channel has many schedules (one-to-many). want channels containing schedules today , schedules need sort asc date limit 10 schedules per channel. i wrote following code returns wrong results sometimes. checked , found laravel generating sql query limiting schedule results channels. i'm using eloquent. know how this?... thanks. $channels = $this->channels->wherehas('tvschedules', function($q) { $q->where('day', date('y-m-d', strtotime(carbon::now()->todatestring()))) ->where('end_time', '>=', carbon::now()->totimestring()); })->with(['tvschedules' => function($q){ $q->where('day', date('y-m-d', strtotime(carbon::now()->todatestring()))) ->where('end_time', '>=', ca

python - How to do string with dot operator extension using a variable -

basically trying following code snippet a = "abc" = dir(a) print print a.__add__ the fourth line using variable (in loop) rather operating each time, following (but did not go smooth): print a.all[0] tmp = a+'.'+all[0] print tmp eval tmp please suggest me how can through loop using variable like: in : print a.i normally, don't use eval considered unsafe , bad practice overall. according python docs dir outputs list of strings, representing valid attributes on object without arguments, return list of names in current local scope. with argument, attempt return list of valid attributes object. there's built-in method member of class/instance name: getattr (and it's sister methods setattr , hasattr ) a = "qwe" member in dir(a): print getattr(a, member) prints <method-wrapper '__add__' of str object @ 0x0000000002ff1688> <class 'str'> <method-wrapper '__contains

Median-Filter vs. morphological operators on binary images to reduce noise -

typically use median-filter on grayscale images reduce salt- , peppernoise , morphologicial operators same in binary pictures. colleague asked me why don't use median on binary images instead of erosion , dilation. wasn't able answer , i'm little bit puzzled this. me , tell me if bad or idea use median-filter reduce noise in binary images? i guess mean opening , closing, because erosion/dilation produce bigger deformation of original signal. use "small" median filter instead of "small" opening/closing should relatively comparable on binary images. on gray level image, median filter should less "aggressive", because uses median value (instead of minimum/maximum), , should provide better preservation of original signal.

When using node.js cluster, how to access a worker's environment when it dies? -

i'm using node.js cluster module create worker processes. , set custom variable in each worker's environment fork it. i need read custom variable when worker dies, when worker dies, can't access environment object anymore. this tried far: var cluster = require('cluster'), os = require('os'); if (cluster.ismaster) { cluster.on('exit', function (worker, code, signal) { console.log('worker ' + worker.process.pid + ' died'); var x = { workerid: worker.process.env.workerid // undefined. }; cluster.fork(x); }); (var = 0; < os.cpus().length; i++) { var x = { workerid: }; cluster.fork(x); } } else { console.log("workerid: ", process.env.workerid); // simulate exeption: throw "fakeerror"; } i know that's not gonna work, question is: how access latest state of worker's envoronment ri

css - How avoid cell wrapping in Bootstrap3 -

first, sorry quality of question, explain want achieve quite hard, that's way i've prepared sample code . there can see 2 main columns: #main-left-column , #main-right-column . on #main-right-column i've placed 6 green cells , works bootstrap authors wants, want somehow add 'overlay-x:auto' css property on right column avoid cell wrapping. any idea how ? simple, put right <div> (columns inside #main-right-column ) <table> container , set minimal width. css: .width-300-450 { min-width:300px; width: 100%; max-width:450px } example: <table> <tr> <td> <div class="width-300-450"> <div class="col-xs-12 bg-success"> <h2>test</h2> </div> <div class="col-xs-12 bg-warning"> <p>...</p> </div>

Fetch value from a set object in java -

i'm iterating set object find particular value. there short way fetch instead of iterating it? here code for(tree t : assignedtrees) { println t.treename; } the above code return expected value. assignedtrees set object set<tree> assignedtrees = new hashset<tree>() println assignedtrees return [tree{id=null, treename=mango}] can fetch treename instead of iterating? you can fetch object set calling myset.get(object) . however, in case wish fetch object based on 1 of attributes. best way map - e.g. map<string, tree> trees = new hashmap<>(); trees.put(treeobject.treename, treeobject); tree mytree = trees.get("mytreename"); note if you're putting own objects sets or maps, must override equals , hashcode methods, or strange things happen.

Unix scripting in bash to search logs and return a specific part of a specific log file -

dare it, windows person (please don't shoot me down soon), although have played around in linux in past (mostly command line). have process have go through once in while in essence searching log files in directory (and sub directories) filename , getting out of said log file. my first step is grep -ril <filename or partial filename looking for> log/*.log from have log filename , vi find occurs. clarify: grep looking through log files seeing if filename after -ril occurs within them. vi log/<log filename> /<filename or partial filename looking for> i j couple of times find cdata, , have url need extract, in putty select, copy , paste browser. quit vi without saving. fred1 triggered @ mon aug 31 14:09:31 nzst 2015 incoming file /u03/incoming/fred/fred.2 fred.2 start grep end grep renamed fred.2.20150831140931 <?xml version="1.0" encoding="utf-8"?> <runresponse><runreturn><item><name>

php - Display value for dropdown populated from database (SQL Server) -

i trying display saved value dynamic dropdown populated database. code below : <?php $server = "xxx"; $options = array( "uid" => "xxx", "pwd" => "xxx", "database" => "xxx"); $conn = sqlsrv_connect($server, $options); if ($conn === false) die("<pre>".print_r(sqlsrv_errors(), true)); echo " "; $myquery="select department change_details id='2137'"; $fetched=sqlsrv_query($conn,$myquery) ; if( $fetched === false ) { die( print_r( sqlsrv_errors(), true ));} while($res=sqlsrv_fetch_array($fetched,sqlsrv_fetch_assoc)) { $department=$res['department']; } ?> <div class="container"> <!-- department --> <div class="form-inline clearfix"> <label class="col-md-5">department initiating request</label> <label name="department"></l

android - Need Value of "sendUserActionEvent() mView == null" -

im working on part of android app should switch between activities. happens on actionbar dropdown-menu. my problem is: don't value know activity should call (on if-statements in onclick). heres code: onoptionsitemselected: @override public boolean onoptionsitemselected (menuitem item){ // handle action bar item clicks here. action bar // automatically handle clicks on home/up button, long // specify parent activity in androidmanifest.xml. int id = item.getitemid(); //noinspection simplifiableifstatement if (id == r.id.home) { toast.maketext(getapplicationcontext(), "home wurde angeklickt!!", toast.length_short); replacefragment(hf); } if (id == r.id.archiv) { toast.maketext(getapplicationcontext(), "archiv wurde angeklickt!!", toast.length_short); replacefragment(af); } return super.onoptionsitemselected(item); } menu_homescreen(.xml): <menu xmlns:android="http://schemas.android.com/

mysql - mysqli_multi_query() statements executed parallel or one after another? -

i executing mysqli_multi_query() 2 queries in it: update customers set balance = balance + 15 ck in (select ck purchases deal_id = 1 , status = 0); update purchases set status = 3 deal_id = 1; before executing queries - there several records in purchases table status=0, customers table not receive updates reason. tested running both queries hand 1 after - works. have feeling second update runs before first one. shouldn't go 1 after without processing @ same time? thanks the queries executed 1 after another, , it's case long queries queued via single mysql connection. i have feeling not handling results correctly. need call mysqli_store_result() once after multi query , while mysqli_more_results() mysqli_next_result().

operating system - How to turn off all CPU on ubuntu? -

i want confirm infiniband protocol not relies on cpu work. so, have infiniband program works , want turn off cpu see whether still work or not. turn off single core in ubuntu (12.04) quite simple. echo 0 | sudo tee /sys/devices/system/cpu/cpu1/online however given 4 cpu can turn off 3 of them. how can turn off of them without doing tings suspend computer ? if want confirm channel adapter interface doesn't use main processor, don't think need shut down cores (which question if possible). disconnect system everything, including ib switch , else might require processing. use obtain base operating state in terms of system time use, user time, etc. reconnect system ib switch , start processing remote requests should not require intervention main processor. characterize operating state. then compare them see if there beyond natural statistical variability. if find something, go , analyze system see if there other explanation. rinse , repeat. ps suspect usag

c - Associativity interpretation? -

in c operators left-associative , right associative, left-associative operator example starts left side , ends on right of user. if example in case of assignment operator x=y; x=5 , y=20 , saying put value of y in x , seems legitimate. but in cases if(x>y) , '>` operator has left associativity. means computes is x greater y? false . but, why go can reading right associativity is y smaller x? false why use left associativity when output comes same in both cases? for ternary operation mat says. the answer x>y>z depends on direction, answer vary right left , left right. because of different comparisons done @ different stage. both answers evaluate value, why chose 1 left associativity the associativity concept come in play when expression has more 1 operator. property of operator in expression, not operands. define how brackets inserted, not operator means. operator : r expression : x r y r z left right : (x r y) r z right left

lambda - Strange Logical Error in Java Code -

interface new<t> { boolean func(t n, t v); } class myfunc<t>{ t val; myfunc(t val){ this.val = val; } void set(t val){ this.val = val; } t get(){ return val; } boolean isequal(myfunc<t> o){ if(val == o.val) return true; return false; } public class main { static <t> boolean check(new<t> n , t a, t b){ return n.func(a,b); } public static void main(string args[]){ int = 321; myfunc<integer> f1 = new myfunc<integer>(a); myfunc<integer> f2 = new myfunc<integer>(a); boolean result; //f2.set(f1.get()); //if uncomment line result become true system.out.println(f1.val + " " + f2.val); system.out.println(); result = check(myfunc::isequal, f1, f2); system.out.println("f1 isequal f2: " + result); } } why result false when 'a' used in both f1 , f2 ? why result true when f2.set(f1.get()); uncommented? please explain me making mistake.

security - How does outlook encrypt the password for windows credentials -

i using imsgserviceadmin::configuremsgservice configure outlook profile exchange server. when calling function, windows popup dialog enter credentials. after enter credentials , save, found create generic credentials : ms.outlook:@.:put , password encrypted. such "@@...yba" i how outlook encrypt password want manually create credentials before call configuremsgservice credentials windows won't show. thanks in advance. i'm senior escalation engineer outlook here @ microsoft , received exact question customer in past. asked product team if able document format used publish credentials in credential manager. answer is, no, can't, because routinely change format new scenarios crop up. may not obvious, target name of credential different different scenarios. that's critical part. without knowing of details constructing target name, knowing how protect password won't you.

javascript - Anyone else getting an undefined object when promising firebase.auth().signOut() in react native? -

my logout function listed below. how i'm implementing it. not sure what's causing promise come undefined. it's not binding issue. i've tested that. logout() { firebase.auth().signout() .then((respnose) => { console.log(respnose) }) .catch((error) => { console.log('error on logging out: ' + error) }) } <header statusbarprops={{ barstyle: 'light-content' }} leftcomponent={{ icon: 'menu', color: '#fff' }} centercomponent={{ text: 'chat room', style: { color: '#fff' } }} rightcomponent={<icon name='logout' color='white' type='material-community' onpress={this.logout}/>} /> i'm using react-native-elements. try because on success has no response on error has error object in fact signed out case error since response undefined const thisclass = this; // here how assign variable firebase.auth().signout().then(() => { // sig

quickblox video call not going -

package com.esolz.sweet_date.sweetdate.fragments; import android.app.fragment; import android.content.broadcastreceiver; import android.content.context; import android.content.intent; import android.content.intentfilter; import android.media.audiomanager; import android.media.mediaplayer; import android.os.bundle; import android.os.handler; import android.util.displaymetrics; import android.util.log; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.horizontalscrollview; import android.widget.imagebutton; import android.widget.imageview; import android.widget.linearlayout; import android.widget.textview; import android.widget.togglebutton; import com.esolz.sweet_date.sweetdate.r; import com.esolz.sweet_date.sweetdate.helper.applicationsingleton; import com.esolz.sweet_date.sweetdate.holder.dataholder; import com.esolz.sweet_date.sweetdate.activity.mainactivity; import com.esolz.sweet_date.sweetdate.sweetdate.listus