Posts

Showing posts from July, 2015

java - bash script issue launching programs -

i have bash script executed when aws ec2 ubuntu instance boots, via aws server launch configuration (which bash script) using following command sudo -u ubuntu /vagrant/test/startall.sh the issue i'm seeing java programs don't run if they're last entry in bash script, run fine if not last entry. i'm bit stumped why it's happening. here's bash script... startall.sh #!/bin/bash # set -x brokersrvdir="/vagrant/test/ppp" meetingsrvdir="/vagrant/test/clone" notifysrvdir="/vagrant/test/notification/production/notificationsrv" workerdir="/vagrant/test/ppp/production/ppworker2" #( cd $workerdir && { make runworker >>log/out.txt 2>&1 & } ) ( cd $brokersrvdir && { ./ppp_broker >>log/out.txt 2>&1 & } ) ( cd $notifysrvdir && { make runnotify >>log/out.txt 2>&1 & } ) ( cd $meetingsrvdir && { ./meetingsrv > /dev/null 2>>log/o...

django - Swapping values in a OneToOneField: IntegrityError -

i have following object: from django.db import models class page(models.model): prev_sibling = models.onetoonefield('self', related_name='next_sibling', null=true, blank=true) i have several instances of these objects. let's say, a, b, c , d . have assigned sibling relationships such a has b prev_sibling , , c has d prev_sibling . now imagine want swap b , d around. re-assign attributes, follows: a.prev_sibling = d a.save() c.prev_sibling = b c.save() however, fails integrityerror , no longer satisfy uniqueness constraint implied onetoonefield after first save() . i tried wrapping code in transaction, hoping that make sure save occur atomically, , prevent temporary constraint breach, so: from django.db import transaction transaction.atomic(): a.prev_sibling = d a.save() c.prev_sibling = b c.save() but did not work. right way resolve this? edit: record: tried sequentially ass...

python - Smart x-axis for bokeh periodic time series -

i have time series data in pandas series object. values floats representing size of event. together, event times , sizes tell me how busy system is. i'm using scatterplot. i want @ traffic patterns on various time periods, answer questions "is there daily spike @ noon?" or "which days of week have traffic?" therefore need overlay data many different periods. converting timestamps timedeltas (first subtracting start of first period, doing mod period length). now index uses time intervals relative "abstract" time period, day or week. produce plots x-axis shows other nanoseconds. ideally show month, day of week, hour, etc. depending on timescale zoom in , out (as bokeh graphs time series). the code below shows example of how plot. resulting graph has x-axis in units of nanoseconds, not want. how smart x-axis behaves more see timestamps? import numpy np import pandas pd bokeh.charts import show, output_file bokeh.plotting import figure...

php - $_SESSION across muliple virtual hosts -

i have learned if share server host (which do, have virtualhost), hosts share same $_session same across hosts. does meant other hosts can access of variables store in $_session? check value of following: echo ini_get('session.save_handler'); echo ini_get('session.save_path'); if save_handler files , save_path common directory /var/lib/php5 you're sharing session storage other users on server. you're still protected nature of session hash id, if have sensitive information might want make change. either change save_handler sqlite , provide own local database file, or change save_path directory that's owned , has minimal permissions. can change save_path in .htaccess file: php_value session.save_path = '/path/to/my/session/directory' or in php source: ini_set('session.save_path', '/path/to/my/session/directory'); edit: realistically though, if have information sensitive enough warrant change, should using vp...

How to ensure a file is closed for writing in Python? -

the issue described here looked solvable having spreadsheet closed in excel before running program. it transpires, however, having excel closed necessary, not sufficient, condition. issue still occurs, not on every windows machine, , not every time (sometimes occurs after single execution, two). i've modified program such reads 1 spreadsheet , writes different one, still issue presents itself. go on programmatically kill lingering python processes before running program. still no joy. the openpyxl save() function instantiates zipfile thus: archive = zipfile(filename, 'w', zip_deflated, allowzip64=true) ... zipfile using attempt open file in mode 'wb' thus: if isinstance(file, basestring): self._filepassed = 0 self.filename = file modedict = {'r' : 'rb', 'w': 'wb', 'a' : 'r+b'} try: self.fp = open(file, modedict[mode]) except ioerror: if mode == 'a': ...

android - Tracking event once in Google Analytics -

i curious how users exploring app. want track event first time happens. example, first time user beats level 1 want send event. is there way send event once google analytics, or need use sharedpreferences , manually track if have sent event before? (this do) i unsure keywords search links , tips appreciated!

python - ImportError: No module named cryptography.hazmat.backends - boxsdk on Mac -

i'm trying automate upload of single file (for now) box python automation. i'm using code box developers website supposed "super easy use" getting error (see title above) when try run simple program found on page: https://www.box.com/blog/introducing-box-python-sdk/ . i've added client id, client secret, , developer token, , added path zip file upload, , keep getting above error. havent changed beyond that. code dont want click link :) from boxsdk import client, oauth2 oauth = oauth2( client_id="your_client_id", client_secret="your_client_secret", access_token="your_developer_token", ) client = client(oauth) shared_folder = client.folder( folder_id='0', ).create_subfolder('shared_folder') uploaded_file = shared_folder.upload('/path/to/file') shared_link = shared_folder.get_shared_link() i've installed cryptography program using pip , easy_install sure, along libffi , openssl ...

checkbox filter in android -

i'm trying learn more checkbox functions in android. want display values of checked checkboxes in textview. in code, shows checkboxes either true(if checked) or false (if not checked) want print checkboxes checked , exclude unchecked. tried using "if, else if" not working. appreciated. mainactivity: public class demo extends activity { private checkbox linux, macos, windows; private button button; private edittext ed1, ed2; private textview text; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.demo); addlisteneronbutton(); } public void addlisteneronbutton() { linux = (checkbox) findviewbyid(r.id.checkbox1); macos = (checkbox) findviewbyid(r.id.checkbox2); windows = (checkbox) findviewbyid(r.id.checkbox3); ed1 = (edittext) findviewbyid(r.id.edittext1); ...

php - American apostrophe clears form input -

’ kind of apostrophe ruins input saved database. i've tried $generalchangedescriptions[$championnumber+1][$indexgeneral+1]=str_replace("’", "'", $generalchangedescriptions[$championnumber+1][$indexgeneral+1]); so changing ’ ' no results still empty field. value apostrophe shown fine after sending with <input type="hidden" name="generalchangedescriptions" value="'.htmlspecialchars(json_encode($generalchangedescriptions)).'"> it no longer visible whole input blank there way fix this? update: after fiddling bit code found out json_encode wipes input after sending there easy solutions?

matplotlib - How to change the line color in seaborn linear regression jointplot -

Image
as described in seaborn api following code produce linear regression plot. import numpy np, pandas pd; np.random.seed(0) import seaborn sns; sns.set(style="white", color_codes=true) tips = sns.load_dataset("tips") g = sns.jointplot(x="total_bill", y="tip", data=tips, kind='reg') sns.plt.show() however, lot of data points regression line not visible anymore. how can change color? not find builtin seaborn command. in case line in background (i.e. behind dots), ask how bring front. there couple approaches, mwaskom tactfully pointed out. can pass arguments joint plot, setting color there affects whole scatterplot: import numpy np, pandas pd; np.random.seed(0) import seaborn sns#; sns.set(style="white", color_codes=true) tips = sns.load_dataset("tips") g = sns.jointplot(x="total_bill", y="tip", data=tips, kind='reg', joint_kws={'color':'green...

ember.js - Extending {{link-to}} with Ember-cli -

this question similar unanswered extending link-to . i'm trying extend {{link-to}} helper output additional attribute bindings. attributes not appear in our html. heres have: //views/link-to.js (normally coffeescript) import ember 'ember' var linktoview = ember.linkview.reopen({ attributebindings: ['data-toggle', 'data-placement', 'title'] }); export default linktoview; the rendered output this: define('app/views/link-to', ['exports', 'ember'], function (exports, ember) { 'use strict'; var linktoview; linktoview = ember['default'].linkview.reopen({ attributebindings: ['data-toggle', 'data-placement', 'title'] }); exports['default'] = linktoview; }); when called , rendered output: // .hbs file {{#link-to 'account' class='header-link' data-toggle='tooltip' data-placement='right' title='a...

angularjs - how to make breadcrumb in ionic framework? -

Image
can ionic provide functionality of breadcrub .actually search on ionic website did not find found documentation of breadcrub .in other words how make breadcrub in ionic .actually don't want use bootstrap in project .actually using bootstrap achievable .but want use ionic .can make breadcrub using ionic i found link i want make type of breadcrub in ionic.can achieve ? http://www.lendmeyourear.net/breadcrumb-navigation-with-css-arrows.html i found 1 solution using jquery . i looking same. however, found breadcrumb possible angularjs , ionic based of angularjs can use sure. please check link more details https://github.com/michaelbromley/angularutils/tree/master/src/directives/uibreadcrumbs

java - How to remove weird border on JTextArea -

Image
i have jtextarea, jlist , couple other things on jpanel, jtextarea seems putting weird border around right , bottom side of textarea. i tried using textarea.setborder(borderfactory.createlineborder(color.black, 2)); rid of it that adds black border expected still weird border. here picture. i can't seem remove white , gray border textarea i have border layout 5 pixel gap vertically, , horizontally. edit don't think stated correctly, white , grey "borders" there when don't add .setborder() you seeing border of both jtextarea , jscrollpane , try remove border of scrollpane, following code: jscrollpane1.setborder(null); will this: to this: note how white line has disappeared jtextarea . looking for?

dsl - Errors when running Language-Solution in MPS -

i'm developing dsl jetbrains mps. it's not obvious use, succeeded far design-part. it's possible right-click on solutions node , "run" it, assuming language executable (extends executing.util). plus use seperately developed jar library (used generator). i build new project test, simple possible, added nodes , loops in generator, error occures , can't undone. as far can see, there several possible sources of errors. dependencies (they tricky in mps) my jar wrong cached files or so executing "run" causes following error: error: not find or load main class mysolution.package.map_concept has of out there experience this? tell me, if there information help. it seems have added jar file model language, makes invisible solution. following instructions @ https://confluence.jetbrains.com/display/mpsd32/getting+the+dependencies+right#gettingthedependenciesright-addingexternaljavaclassesandjarstoaprojectruntimesolutions , creating ...

unit testing - auto-refresh (gulp+livereload+jasmine) -

i'm trying creat gulp task run test , automatically refresh when changes occur in .js test file. this code: gulp.task('watch-test', function() { // start live-reload server plugins.livereload.listen({ start: true}); var filesfortest = [ 'bower_components/angular/angular.js', 'bower_components/angular-mocks/angular-mocks.js', 'src/app/blocks/testcontroller.module.js', 'src/app/blocks/testcontroller.js', 'src/test/spec/sillycontrollerspec.js'] return gulp.src(filesfortest) .pipe(watch(filesfortest)) .pipe(plugins.jasminebrowser.specrunner()) .pipe(plugins.jasminebrowser.server({port: 8888})) .pipe(plugins.livereload()); }); it watches files, have refresh manually page @ browser. any idea can do? i found package incluide jasmine + livereload https://www.npmjs.com/package/gulp-jasmine-livereload-task

pyqt QAction strange behavior of the function call -

i make simple window , added menu , toolbar. , got strange behavior of function connected action. here's code: import os import sys import sip import maya.openmayaui mui pyqt4.qtcore import * pyqt4.qtgui import * pyqt4 import uic #---------------------------------------------------------------------- def getmayawindow(): ptr = mui.mqtutil.mainwindow() return sip.wrapinstance(long(ptr), qobject) #---------------------------------------------------------------------- class mainform(qmainwindow): def __init__(self): super(mainform, self).__init__(getmayawindow()) self.setgeometry(50,50,600,600) mdiarea = qmdiarea() self.setcentralwidget(mdiarea) self.testaction = qaction(qicon('ico.png'), '&test', self) self.testaction.triggered.connect(self.aaaaa) self.menubar = self.menubar() filemenu = self.menubar.addmenu('&file') filemenu.addaction(self.testactio...

linux - Test Android NDK executables on PC without any JNI or upper layers -

i learning binders in android, want test whether sample applications written in c/c++ working properly. on linux based pc. when searched on google, every example implementing jni layer, think don't required can use simple logging facilities. is there way can test (android-based) executables directly on pc? hope clear. since you're compiling against android/log.h , whatever system want run executable on have have proper instruction set , have android/log.h . you switch of android prints print stdout (printf, etc.) , recompile on whatever system you're using using it's compiler (gcc, etc.).

How to generate equivalent query by LINQ c# -

this in-line sql query. same equivalent query generated linq. var lowerpageboundary = 0; var tablename = "orders"; var columntosortby = "orderid"; var sortcolumn = "orderid"; var rowsperpage = 16; var commaseparatedlistofcolumnnames = "orderid,customerid,employeeid "; var sql = "select top " + rowsperpage + " " + commaseparatedlistofcolumnnames + " " + tablename + " " + columntosortby + " not in (select top " + lowerpageboundary + " " + columntosortby + " " + tablename + " order " + sortcolumn + ") order " + sortcolumn; this linq query far. tell me how customize output above in-line sql query. xdocument document = xdocument.load(xmlfilepath); var query = r in document.descendants("orders") select new { orderid = r.element("orderid").value, customerid = r.elemen...

node.js - How can I install an NPM package for a different user? -

i'm writing chef script provision windows 7 build machine our environment. 1 of our dependencies npm package needs installed on 2 separate user accounts. however, npm packages on windows installed locally user. know command can execute install npm package second user while logged in first user? short answer: copy , paste package. simple! long answer: there 1 prerequisite: must able copy , paste necessary files must be. in case, either have administrative privileges (in case carry out method 1) or can log in both user accounts (in case carry out method 2). assume standard windows deployment scenario, make template machine image template profiles , duplicate other machines. method 1 install node.js (run installer, e.g. node-v0.12.7-x64.msi) run "node.js command prompt" start menu order installation of first package following command: npm install -g [package name] ...where [package name] name of package. verify installation successful. (important) re...

javascript - Heatmap not generating as expected -

Image
at present have #759 of lat long value in database. have data @ run time database , create heatmap it. when execute code getting following output my code is <!doctype html> <html> <head> <meta charset="utf-8"> <title>heatmaps</title> <style> html, body, #map-canvas { height: 100%; margin: 0px; padding: 0px } #panel { position: absolute; top: 5px; left: 50%; margin-left: -180px; z-index: 5; background-color: #fff; padding: 5px; border: 1px solid #999; } </style> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=visualization"></script> <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script> <script type="text/javascript"> // adding 500 data points var map, pointarray, heatmap; var latlng = jquery.parsejson('{"22.396428,114.109497": "1...

ios - Core Animation speed -

i'd create animation similar swiping in menus of iphone. means if swipe enough, animation takes new page, if swipe little animation takes on starting page after finishing swipe gesture. so far, have swipe recognizer listens position of finger on screen , follows movement of finger. animation looks @ end of gesture whether finger moved more 1/3 of screen width , decides whether proceed end or go beginning. - (void)pangesturehandler:(uipangesturerecognizer*)recognizer { if (recognizer.state == uigesturerecognizerstateended) { //if our gesture enough let animation roll end if (fabsf(translation.x) > cgrectgetwidth(self.view.frame) * 0.33) { [self finishlayer:categorycontrollermain.view.layer animation:menuopenswipeanimatemoveleft withforward:no]; } //finger movement below .33% of screen width animate initial state else { [self finishlayer:categorycontrollermain.view.layer animation:menuo...

java - jdeveloper - Package does not exist while compiling on Maven and Eclipse -

i'm new jdeveloper , trying import maven project in it. i did that, although, when try build project, external packages (that come maven dependencies) non existant point of view of jdeveloper. i checked maven repo, settings, , project classpath, , doesn't seem problem here. in addition, when mvn compile on projet, compiles normally, , when import project eclipse, no problem displayed. i'd use eclipse (as prefer jdev), i'm obliged use oracle ide. any appreciated. thanks. i solved problem editing project file ( .jpr ) , correcting path maven repository. i used ${maven:maven.local.repo} instead of relative path used before ( ../../../../.m2/repository ).

android - Implement Material-themed widgets -

i have values/styles.xml file quite number of entries within such defining actionbar, it's title , tab text. in application, show new materials design icons when running on android 5.x smartphones. looking @ developer guideline page, have in values/styles.xml: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="theme.foo" parent="android:theme.holo.light.darkactionbar"> <item name="android:actionbarstyle">@style/fooactionbar</item> <item name="android:actionbartabtextstyle">@style/fooactionbartabtext</item> </style> <style name="fooactionbar" parent="android:widget.holo.actionbar"> ... </style> <!-- actionbar title text --> <style name="fooactionbartitletext" parent="android:textappearance.holo.widget.actionbar.title"> .....

sharepoint - ADFS Authentication using PHP -

i'm not friendly microsoft's architecture have implement adfs authenfication on website. i decided use ws-trust solve it. so first, send rst (request security token) http://server.com//adfs/services/trust/13/usernamemixed i receive excepted rsts (request security token response) contains security token. but, i'm stuck, don't know next. the main goal logged sharepoint website require adfs authentication. maybe, can me this. you can post rstr _trust endpoint on sharepoint server , fedauth cookie you'd present on subsequent calls sharepoint. shown in sample php code here: https://github.com/zandbelt/php-ws-trust-client/blob/master/sharepoint/login.php

Unzip a zip archive on a server with php -

i've tryed ways automatically unzip files php of them failed: 1st variant <?php function unzip($file){ $zip=zip_open(realpath(".")."/".$file); if(!$zip) {return("unable proccess file '{$file}'");} $e=''; while($zip_entry=zip_read($zip)) { $zdir=dirname(zip_entry_name($zip_entry)); $zname=zip_entry_name($zip_entry); if(!zip_entry_open($zip,$zip_entry,"r")) {$e.="unable proccess file '{$zname}'"; continue; } if(!is_dir($zdir)) mkdirr($zdir,0777); #print "{$zdir} | {$zname} \n"; $zip_fs=zip_entry_filesize($zip_entry); if(empty($zip_fs)) continue; $zz=zip_entry_read($zip_entry,$zip_fs); $z=fopen($zname,"w"); fwrite($z,$zz); fclose($z); zip_entry_close($zip_entry); } zip_close($zip); return $e; } $file = 'file_name.zip'; echo unzip($file); 2nd variant <?php $zip = zip_open("my_linkedin_groups_scrape_my_run_1...

objective c - Is it possible to programmatically force an ios ap in split view to go full screen in ios9? -

i developing app ipad , ios9 , @ point user click on button watch video. wouldn't want user see in split view size he's on (like 1/3rd or 14th) instead app close other open app , take on entire screen. does know if that's possible? thanks. by-default, video played in full-screen mode. when video playing finished, player gets dismissed , see screen (from played video). in case, in split view controller. do let me know if need further details.

Using interop.MSProject.dll without Office installed or creating Project Add-in in Visual Studio -

Image
i need work on project server using microsoft.office.interop.msproject.dll visual studio. using gacutil.exe have registered microsoft.office.interop.msproject.dll , @ folder "c:\windows\assembly" there entry msproject.dll processor architecture msil. have created console application , when try create application instance gives error: class not registered-hresult: 0x80040154 exception. shown in image. target platform project x86(32-bit). reason error? because office not installed on local machine? there alternative using pia without installing office? have tried creating project add-in visual studio, works successfully, requires project professional open, want avoid. possible avoid opening of project professional application in case? you need have application (i.e. ms project) installed on pc. interop files sre used marshalling property or method calls managed code host application.

android - Textview not showing aftert couple of VISIBLE and INVISIBLE set -

first, used animation hide , show textview. saw using animation costing memory. used way: setvisibility(visible) , setvisibility(invisible) tasktimer it works , performs better considering memory. the main issue after restarting timer many times, textview disappear. i need restart app again! this code snippet: mytimerforanimation = new timer(); mytimerforanimation.scheduleatfixedrate(new timertask() { @override public void run() { runonuithread(new runnable() // run on ui thread { public void run() { counter++; if (counter < 7) { if (counter % 2 == 1) { list_textview[x].setvisibility(view.invisible); } else { list_textview[x].setvisibility(view.visible); } } else { mytimerforanimation.cancel(); mytimerforanimation.purge(); list_textview[x].setvi...

ldap - php ldap_search(): Search: Operations error -

i try connect ldap in php code : $ds = ldap_connect("122.134.124.2", 389); $login = "login@domain.local"; $password = "password"; if ($ds) { $r = ldap_bind($ds, $login, $password); $sr = ldap_search($ds, "dc=domain,dc=local", "cn=m*"); } else echo "impossible connect ldap server."; and error : ldap_search(): search: operations error in test.php on line 8 (the line ldap_search function). yet connection works , put parameters of function ldap_search.

node.js - Performance comparison of websocket implementations -

edit: prevent closing question i'll narrow down essential. can share performance test in mb/s between 2 websocket implementations listed below? application or hardware details irrelevant, 2 crude numbers simple common scenario suffice. original question did test performance of these 2 websocket implemetations node.js ? websocket-node ws i couldn't find recent (just bunch of articles 2012-2013). see is: overhead (if @ all, considering actual network latency more relevant guess both converge 0) throughput (a simple mb/s figure same application/hardware great) can ws broadcast data on network level (despite underlying tcp? @ possible?) or abused method name (which sends same message many clients in for() loop)? even better: comparison of with/without nagle's algorithm comparison of json vs binary messages edit: updated info newer, faster implementation i integrate here nick newman 's jun 17 '16 @ 20:08 comment avoid...

javascript - How to get correct div height on ie8 -

here code.my code works fine on browsers ie8 not working correctly.i have tried things still have problem.sorry bad english hope understand. summary : need correct div height on ie8. $(window).load(function () { /*orta alan kaydırma*/ $("#content-container").height($(".content-left").outerheight()); $(window).scroll(function () { $(".content-left>#content-inline").animate({ top: -($(window).scrolltop()) }, 1); if ($(window).scrolltop() > 1) { $(".make-fixed-white").css("border-bottom-color", "#f2f2f2"); } else { $(".make-fixed-white").css("border-bottom-color", "transparent"); } if ($(".letter").length) { if ($(window).scrolltop() > $(".letter").offset().top - 100) { $(".letter ul").addclass("make-fixed-white"); ...

Combining Regex with Selenium in C# -

i have automation suite, testing against wordpress (a test site practice against). attempting verify when user edit's existing page taken correct screen. following code snippet working fine, id mentioned below no longer present (it image). public static bool isineditmode() { return driver.instance.findelement(by.id("icon-edit-pages")) != null; } assert.areequal(newpostpage.isineditmode(), "you not in edit mode"); the html targeting is... <h2> edit page <a href="http://localhost/wordpress/wp-admin/post-new.php?post_type=page" class="add-new-h2">add new</a> </h2> i extract value of h2 tag 'edit page'. getting value of anchor 'add new', need ignore. using cssselector "h2:first-child" returns both values. i think need use regular expression, if has suggestions great. i attempted doing similar in jsfiddle require c# equivalent var mystring = document.getelementsbytagname(...

android - Unable to fetch contact names -

i trying code retrieve contact numbers , contact names. got numbers names list returns null contentresolver cr = this.getcontentresolver(); //activity/application android.content.context cursor cursor = cr.query(contactscontract.contacts.content_uri, null, null, null, null); if(cursor.movetofirst()) { list<string> contactnames = new arraylist<string>(); { string id = cursor.getstring(cursor.getcolumnindex(contactscontract.contacts._id)); if(integer.parseint(cursor.getstring(cursor.getcolumnindex(contactscontract.contacts.has_phone_number))) > 0) { cursor pcur = cr.query(contactscontract.commondatakinds.phone.content_uri,null,contactscontract.commondatakinds.phone.contact_id +" = ?",new string[]{ id }, null); while (pcur.movetonext()) { string contactnumber = pcur.getstring(pcur.getcolumnindex(contactscontract.com...

ios - waitForExpectationsWithTimeout crashes -

i trying test asynchronous request xctest , using expectationwithdescription:. yet when waitforexpectationswithtimeout called crashes without waiting timeout. tried putting fulfill operation after exclude timeout issue, di no change things; function: func testtrafficrefresh(){ let expectation = expectationwithdescription("refreshed") waitforexpectationswithtimeout(10, handler:nil) traffic.trafficrefresh {[weak self] () -> void in let coming=inarrivohddetailviewcontroller.shareddetailcontroller().activetransit let buses=self!.traffic.arrivingbuses let count=buses.count xctassert(count==0 && coming==0, "no buses , active transit") xctassert(count>0 && coming==1, "arriving buses , inactive transit") expectation.fulfill() } } the same behavior happens in other functions. if take away waitforexpectationswithtimeout operation , keep expectationwithdescription operati...

assembly - MUL operation result -

please explain how mul operation works in situation: mul ecx before operation: eax: 000062f7 (25335) ecx: 3b9aca00 (1000000000) edx: 00000000 (0) after operation: eax: c3ace600 edx: 0000170a (5898) would thankful if can explain me how 5898 calculated. multiplication of 2 32-bit values can yield 64-bit result. the result of mul stored in edx:eax. (the upper 32 bits in edx, lower 32 bits in eax). 0x3b9aca00 * 0x62f7 = 0x170a c3ace600 ecx eax edx eax

winforms - C# win. form - How to maintain date/time for trial -

i creating trial version of application. the trial should run maximum of 3 days. recently came understand isn't simple. tried use system date count 3 days user changes current date past day increases trial period . so, can suggest how maintain 3 days trial? software development platform : visual studio 2008 language : c# (windows form) you may try : save start date. if start date higher current time -> exit or may switch : count minutes program running. on 600 ->exit (or 800 or 900) or may time internet, not local : http://www.timeapi.org/utc/now

android - What view(s) can I use in order to create something like the about screen of the phone? -

Image
i want write activity similar screen of android phones. want display information in style of screen of android phones. this title1 info ----------------- title2 info ----------------- etc. is there special view can use or result of multiple views placed in specific way? or there activity template in android studio can use? see preferenceactivity or preferencefragment . special list views populated either code or xml file. there many different preference types choose (checkbox, switch, list etc) an example preference fragment:

string - Substitute double with single quotes -

i need evaluate length of every filename in directory. here's do: files=$(ls -q) file in $files; echo lenght: ${#file} done but length calculated double-quotes (+2). how can escape that? don't parse output of ls , use wildcard , for : for file in * ; echo "$file: ${#file}" done

sql - Duplicated edges with the same @rid in OrientDB -

i've discovered strange behaviour when querying edge class using orientdb (community-2.1-rc5). database returning exact same edge exact same @rid , exact same data, twice . instinct says bug... this query select e @class='likes' , (out in [#12:0,#12:221]) , in=#36:1913 and orientdb studio returns http://s29.postimg.org/hwruv0zif/captura.png this makes no sense. if go vertex , query likes relationship returns 1 registry... faced problem this? this database i'm using if helps https://www.dropbox.com/sh/pkm28cfer1pwpqb/aaavgel1eftogr4o0todtiaha?dl=0 to bug, should make request join google group. stackoverflow not best place kind of bug. the problem somehow duplicated edge mistake. orientdb let unknown reason. here bug discussion on orientdb google group : https://groups.google.com/forum/#!topic/orient-database/car7yujczci in discussion luca(creator of orientdb) says : "the problem without transaction creation of edge dirty. orientdb ...

c# - How do I remove empty space using Regex? -

i have object value save sql database. when run report on sql database, display &#x20; in report. tried cleaning properties in objects before saving them sql using following regex: regex rgx = new regex("[^a-za-z0-9 - , = % & ( )]"); myobject.description = rgx.replace(myobject.description, ""); the regular expression doing job removing unwanted text. how use regular expression remove &#x20; ? just add string original regex delimited | regex rgx = new regex(@"[^a-za-z0-9-,=%&()#\s]|&#x20;");

JQuery Accordion is not loading dynamically through ajax -

Image
updated: creating jquery accordion dynamically populated ajax data. accordion created on left side bar: when new record has been created has been added in accordion data disturbs accordion can see below image in left side bar: and when refresh page every thing looks fine first image. requirement not refresh page , make accordion work. note: put alerts accordion calling , alerts displaying more 3 times unexpectedly. how can restrict calling ? if may restrict calling problem resolved ! or suggest me bind div on load function/event may run binned function accordingly go through these 2 questions q1 , q2 didn't me out! here code: $.ajax({ url: "/categories", type: 'get', success: function(data) { var content = ""; (i = 0; < data.length; i++) { content += '<label class="categorylables" id="">' + data[i].title + '</label>...

c++ - Why does getchar work like a buffer instead of working as expected in real-time -

this first question on stackoverflow. pardon me if haven't searched not seem find explanation this. attempting example bjourne stroustroup's papers. added bits see array re-sized type text. but doesn't seem work way! getchar() waits till done entering characters , execute loop. per logic, doesn't go loop, character, perform actions , iterate. wondering if implementation specific, or intended this? i on ubuntu 14.04 lts using codeblocks gcc 4.8.2. source in cpp files if matters. while(true) { int c = getchar(); if(c=='\n' || c==eof) { text[i] = 0; break; } text[i] = c; if(i == maxsize-1) { maxsize = maxsize+maxsize; text = (char*)realloc(text,maxsize); if(text == 0) exit(1); cout << "\n increasing array size " << maxsize << endl; } i++; } the output follows: array size now: 10 please enter text: sample text. have liked see memory being r...