Posts

Showing posts from January, 2010

android - App using Splunk Mint crashes on HTC One but works fine on other devices -

i have android app works fine on popular devices (galaxy s3, s4, s5, note 2, note 3, htc desire, sony experia z2), crashes when running on htc one. strangely, runs when fine when run on virtual htc 1 in genymotion emulator. i have bugsense-splunk mint baked inside of app, , see bugsense stuff inside of error log cat. here crash report: java.lang.runtimeexception: error occured while executing doinbackground() @ android.os.asynctask$3.done(asynctask.java:300) @ java.util.concurrent.futuretask.finishcompletion(futuretask.java:355) @ java.util.concurrent.futuretask.setexception(futuretask.java:222) @ java.util.concurrent.futuretask.run(futuretask.java:242) @ android.os.asynctask$serialexecutor$1.run(asynctask.java:231) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1112) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:587) @ java.lang.thread.run(thread.java:864) caused by: com.splunk.mint.network.util.delegationexception:

c - two blocking operations in one process -

i have 2 simple jobs. 1st reading pipe. , 2nd operations timeout. problem make work in 1 process (i khow way in 2 process unsuitable me..). and there reasons dont use cron. 2 jobs should runned run asyncronically (non blocking each other). any ideas? #include<stdio.h> #include<stdlib.h> void someanotherjob(); main(){ printf ("hello!\n"); int c; file *file, *file2; file = fopen("/dev/ttyusb0", "r"); file2 = fopen("out.txt", "a"); if (file) { while ((c = getc(file)) != eof){ fputc(c, file2); fflush(file2); } fclose(file); } while (1) { someanotherjob(); sleep(10); } } void someanotherjob() { printf("yii\n"); } you can use select nonblocking i/o many descriptors:

javascript - Knockout.js: Sort on multiple keys -

in knockout.js, possible sort multiple keys? for example: var anotherobservablearray = ko.observablearray([ { name: "bungle", type: "bear" }, { name: "boogle", type: "bear" }, { name: "george", type: "hippo" }, { name: "zippy", type: "unknown" } ]); for example, might want sort asc type first, , desc name . possible ko observable arrays? thanks i extend observable arrays sortby method lets me define field sort sorting direction: ko.observablearray.fn.sortby = function(fld, direction) { var isdesc = direction && direction.tolowercase() == 'desc'; return ko.observablearray(this.sort(function (a, b) { = ko.unwrap(a[fld]); b = ko.unwrap(b[fld]); return (a == b ? 0 : < b ? -1 : 1) * (isdesc ? -1 : 1); })); }; then when binding: <div data-bind="foreach: yourarray.sortby('type', 'asc')"> see

angularjs - Notification when transition completes -

i use angular 1.3.1, nganimate css transitions. , want know when css transition starts , completes. i expecting able use module.animation not work expect (and docs suggest). i'm not able notification when transition completes. i have created plunker: http://plnkr.co/edit/ugcmbboilt1xvhx7jgst . this html code: <body ng-controller="controller ctrl"> <h1>angular animation issue!</h1> <div class="animation" id="resizeme" ng-class="ctrl.classname"></div> <label> <input type="checkbox" ng-model="ctrl.classname" ng-true-value="'big'" ng-false-value="''"> bigger! </label> this css code: #resizeme { width: 100px; height: 100px; background-color: red; -webkit-transition: width linear 1s; transition: width linear 1s; } #resizeme.big { width: 200px; } and javascript code: var module = angular.module('

Java flow-control -

can explain why code giving output null? when try call new a() instead of new b() , printing current date. class { date d = new date(); public a() { printdate(); } void printdate() { system.out.println("parent"); system.out.println(d); } } class b extends { date d = new date(); public b() { super(); } @override void printdate() { system.out.println("child"); system.out.println(d); } } public class test { public static void main(string[] args) { new b(); } } new b() invokes constructor of b, invokes constructor of a. a's constructor calls printdate() , which, due overriding, executes b's printdate() , prints value of d variable of b . however, d variable of b not initialized yet (it initialized after constructor of executed). therefore still null (which default value reference variables). on other hand,

Using COUNT in SQL Server doesn't show null values -

select songs number of playlists member of. select title, count(*) 'number of playlists member of' song inner join playlistsong on playlistsong.songid = song.id inner join playlist on playlist.id = playlistsong.playlistid group song.title this solution works, doesn't show songs not assigned playlist. there way include songs? please let me know if need more information. use left join instead select song.title, count(distinct playlist.id) 'number of playlists member of' song left join playlistsong on playlistsong.songid = song.id left join playlist on playlist.id = playlistsong.playlistid group song.title

excel - Transform a column into a table -

Image
i'm looking way transform single column table. here's example: my plan transform into i'm using formula indirect(address((row($a1)-1)*2+column(a1);1)) output result. and copy paste using transpose function. so know if there way make work better , easier? thank for specific case, assuming data in sheet1!a1:a8 use in cell a1 on sheet: =index(sheet1!$a$1:$a$8,(column()*2-1)+(row()-1),1) and drag b1:d1 , a2:d2

sql - mysql incorrect key file for table -

i have following table named posts column type null default comments postid bigint(20) no 0 source varchar(10) no profanity tinyint(1) no 0 postcreated bigint(15) yes null postmessage varchar(255) yes null possibleduplicate varchar(255) yes null used checking duplicate messages posturl varchar(255) yes null posttype varchar(10) no posttag tinyint(11) no 0 media varchar(255) yes null first result of coalesce media1-4 media1 varchar(255) yes null media2 varchar(255) yes null media3 varchar(255) yes null media4 varchar(255) yes null latitude varchar(255) yes null longitude varchar(255) yes null

How to do one time registration in android? -

in android application, want show registration page @ time of registration after directly go main activity, doesn't go registration page again if open. i did this,it works but. if open app , close before registration process, registration page didn't appear next time, without registration. how can avoid that. how write condition disappear activity after registration process. sharedpreferences pref = getsharedpreferences("activitypref", context.mode_private); if(pref.getboolean("activity_executed", false)){ intent intent = new intent(this, track.class); startactivity(intent); finish(); } else { editor ed = pref.edit(); ed.putboolean("activity_executed", true); ed.commit(); } guys please help! sharedpreferences _regpref; boolean _usertype = ""; you have check shref pref before setcon

c++ - Where is the "per file" Custom Build Step in Visual Studio 2013? -

i have converted c++ project visual studio 2010 2013 community edition. with previous versions right click on source file , edit custom build step in properties. can't find equivalent in vs2013. the converted project has custom build step , runs it, edit ? when open raw 2013 .vcxproj file, can see custom build step as <custombuild include="foo.h.in"> ... </custombuild> but don't want keep editing project text editor... just harper described. 1 more thing add - in vs 2013 , higher renamed file specific custom build step custom build tool , not shown default. show change configuration properties -> general -> item type custom build tool . apply changes , 'custom build tool' sub menu appear.

Even after specifying `create-session="stateless"` spring is creating JSESSIONID cookies -

even after specifying create-session="stateless" spring creating jsessionid cookies , writing browser cache. understanding ; if mention stateless spring doesn't add session. missing here or understanding wrong ? the problem facing because of i using both basic authentication (for rest services) , form based authentication in application. if user logged in firefox , , uses basic authentication invoke rest service using restclient logs out first user after rest service returned. intention keep first user session active . please find configuration below <http auto-config="false" pattern="/rest/internal/**" entry-point-ref="headerbasedauthenticationentrypoint" create-session="stateless" disable-url-rewriting="true"> <custom-filter position="basic_auth_filter" ref="headerbasedauthenticationfilter" /> </http> i following response header in restclient stat

How to handle special characters in LDAP query -

i use ldapsearch on ubuntu access ldap server create cache-file returned results lookup addresses, phone-numbers, etc. to create cache file use command ldapsearch -h ldap.example.domain -lll -d cn=***,cn=***,dc=***,dc=*** -w -s 1 -b cn=***,dc=***,dc=*** "cn=*" sn givenname works out, of cases, if search cache-file names, containing umlaut characters (e.g. üöäß ), no results returned. reason: max müller for example encoded max tco8bgxlcg== by ldap server , therefore unusable within cache file. there possibility resolve this? note: cannot change results of ldap server itself, since have no root access it. what seeing normal ldapsearch results. generally, should not need create cache file ldap fast. values see in result base64 encoded. you use unboundid ldap sdk java has memory based ldap server run locally.

web services - java.awt.HeadlessException on a Java WebService -

i try to open browser url if webserver called. webserver works fine on tomcat7 , created eclipse. tested code on eclipse server , every thing ok , new browser url open. public java.lang.string register(java.lang.string username, java.lang.string password) throws java.rmi.remoteexception { try{ desktop.getdesktop().browse(new uri("http://google.de")); }catch(exception e){ stringwriter sw = new stringwriter(); e.printstacktrace(new printwriter(sw)); string exceptionasstring = sw.tostring(); username = exceptionasstring; } return "new token:"+password + username; } but if deploy code war-file "real" tomcatserver error: (the webservice ok , become return value, new browser not open) error thrown, because desktop not supported desktop.isdesktopsupported() == false on "real" server java.awt.headlessexception @ java.awt.desktop.getdesktop(desktop.java:124) .... my questi

ios - App crashes with output : "terminating with uncaught exception of type NSException (lldb) " -

the issue appears arise when connect outlets storyboard. if don't have them connected, can run app , runs - without showing in table. however, when connecting outlets brings error. 2014-11-19 15:35:45.477 2[2786:34838] -[to_do_2.firstviewcontroller tableview:numberofrowsinsection:]: unrecognized selector sent instance 0x7b660fd0 2014-11-19 15:35:45.488 2[2786:34838] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[to_do_2.firstviewcontroller tableview:numberofrowsinsection:]: unrecognized selector sent instance 0x7b660fd0' *** first throw call stack: ( 0 corefoundation 0x00212946 __exceptionpreprocess + 182 1 libobjc.a.dylib 0x01beea97 objc_exception_throw + 44 2 corefoundation 0x0021a5c5 -[nsobject(nsobject) doesnotrecognizeselector:] + 277 3 corefoundation 0x001633e7 ___forwarding___ + 1047 4 corefoundation 0x00

jquery - remove labels in flot -

Image
i have 2 same graph.i want remove label second 1 not required. below code input: var d = [ { "label": "absolute return", "data": [[18, 40], [19, 20], [20, 100], [21, 100], [22, 100], [23, 100], [24, 100], [25, 100], [26, 100], [27, 100], [28, 100], [29, 100], [30, 100], [31, 50], [32, 40], [33, 60], [34, 70], [35, 40], [36, 100], [37, 100], [38, 100], [39, 100], [40, 100], [41, 100], [42, 100], [43, 100], [44, 100], [45, 100], [46, 100], [47, 100]], "color": "#395a85" }, { "label": "emerging markets equity (mgi)", "data": [[18, 30], [19, 20], [20, 0], [21, 0], [22, 0], [23, 0], [24, 0], [25, 0], [26, 0], [27, 0], [28, 0], [29, 0], [30, 0], [31, 50], [32, 20]

ffmpeg - How do I rotate yuv/rgb image using libav -

i want rotate image decoded using libav h.264 decoder. i see ffmpeg has option -vf transpose it. want programatically. see there vf_transpose.c in libavfilter looks same thing. i want know how can exercise in code? edit: here sample code use decoding:: avcodec *dechd; avcodeccontext *ctxdecode = null; avframe *picturedecoded; avpacket avpkt; /* -------- setup -------- */ avcodec_init(); /* register codecs */ avcodec_register_all(); dechd = avcodec_find_decoder(codec_id_h264); ctxdecode= avcodec_alloc_context(); avcodec_get_context_defaults(ctxdecode); ctxdecode->flags2 |= codec_flag2_fast; ctxdecode->pix_fmt = pix_fmt_yuv420p; ctxdecode->width = cap_width; ctxdecode->height = cap_height; if (avcodec_open(ctxdecode, dechd) < 0) { printf("avcodec: not open h.264 decoder\n"); exit(1); } picturedecoded= avcodec_alloc_frame(); avcodec_get_frame_defaults(pict

javascript - How I can print the image when click the image link? -

<div class="grid col-220 cert"> <a href="images/1.jpg" class="certtop" rel="prettyphoto[certificates]"><img src="images/thumb/" /></a> <a href="images/1.jpg" class="certbottom" ><i class="fa fa-print"></i>certificate name </a> </div> i want print 1.jpg when click class ".certbottom". how can with? use jquery code: $(document).ready(function() { $(".certtop").click(function () { $(this).append('<img src="images/1.jpg">'); }); });

c - Stop or Start setitimer -

i have set timer have 1 small issue, whenever alarm expires , catch_alarm function called, the timer stops , restarts when in returns main function . need perform benchmarks (packets received , send different interfaces) not include time takes processing not reflect true rx , tx rates accurately the code sample shown: #include <signal.h> #include <stdio.h> #include <string.h> #include <sys/time.h> void catch_alarm (int sig) { //stop timer here printf("calling interrupt now\n"); sleep(1); signal (sig, catch_alarm); //start here again } /*void waste (void) { printf("hello 1\n"); while(1) { printf("hello 2\n"); } printf("hello 3\n"); }*/ struct itimerval old; struct itimerval new; int main(void) { signal (sigalrm, catch_alarm); new.it_interval.tv_sec = 1; new.it_interval.tv_usec = 500000; new.it_value.tv_sec = 1; new.it_value.tv_usec = 500000; old.it_interval.tv_sec

c# - Rectangle around selected ListView item -

i draw rectangle around selected item in listview, due reading somewhere microsoft recommends against changing 'highlighted colour' of said item. however, i'm using selectedindexchanged event , when actual listviewitem drawn rectangle disappears. educated guess suggest rectangle either behind or has being cleared when has being redrawn? question is, when best time draw rectangle visible? code far can seen below: void lvmain_selectedindexchanged(object sender, eventargs e) { if (lvmain.selecteditems.count > 0) { if (lastselecteditem == null) // first time called { lastselecteditem = (sender system.windows.forms.listview).selecteditems[0]; drawhighlightrectanlge(lastselecteditem); } else { // todo: remove previous highlight lastselecteditem = (sender system.windows.forms.listview).selecteditems[0]; drawhighli

vb.net - Creating a Google Calendar event in VB -

i'm trying create google calendar event in visual basic using google api v3. i've managed authenticate , events calendar i'm not sure how save events , documentation isn't helpful. here's current code: imports system.collections.generic imports system.io imports system.threading imports google.apis.calendar.v3 imports google.apis.calendar.v3.data imports google.apis.calendar.v3.eventsresource imports google.apis.services imports google.apis.auth.oauth2 imports google.apis.util.store imports google.apis.requests public class clsgoogle '' calendar scopes initialized on main method. dim scopes ilist(of string) = new list(of string)() '' calendar service. dim service calendarservice public calevents list(of [event]) = new list(of [event]) 'list of events in calendar sub new() 'classes constructor, authenticate google servers everytime object created authenticate() end sub priv

ios - unexpectedly found nil while unwrapping an Optional value in webservice code -

Image
i have binded login action , tried call restfull webservice . below code: @ibaction func loginaction(sender: anyobject) { println(emailtextfield.text) println(pwdtextfield.text) let plaindata = emailtextfield.text.datausingencoding(nsutf8stringencoding) let base64string = plaindata?.base64encodedstringwithoptions(.allzeros) println(base64string) let plaindatapwd = pwdtextfield.text.datausingencoding(nsutf8stringencoding) let base64stringpwd = plaindatapwd?.base64encodedstringwithoptions(.allzeros) println(base64stringpwd) var urlpath = "http://inspect.dev.cbre.eu/syncservices/api/jobmanagement/pluscontactauthentication?email=\(base64string)&userpwd=\(base64stringpwd)" var url: nsurl! = nsurl(string: urlpath) var request: nsurlrequest = nsurlrequest(url: url) var connection: nsurlconnection! = nsurlconnection(request: request, delegate: self,startimmediately: false) connection.start() } i found ni

loops - ansible: how to iterate over all registered results? -

given following playbook: --- - name: check if log directory exists - step 1 stat: path="{{ wl_base }}/{{ item.0.name }}/{{ wl_dom }}/servers/{{ item.1 }}/logs" get_md5=no register: log_dir with_subelements: - wl_instances - servers - name: check if log directory exists - step 2 fail: msg="log directory not exists or not symlink." failed_when: > log_dir.results[0].stat.islnk not defined or log_dir.results[0].stat.islnk != true or log_dir.results[0].stat.lnk_source != "{{ wl_base }}/logs/{{ wl_dom }}/{{ item.1 }}" with_subelements: - wl_instances - servers that using following vars: --- wl_instances: - name: aservers servers: - adminserver - name: mservers servers: - "{{ ansible_hostname }}" the second task uses 1 of 2 possible results ( results[0] ). my question is: how iterate on available items stored in log_dir.results ? a sample output debug:hostvars[inventor

angularjs - karma error 'Uncaught ReferenceError: PR is not defined' -

i'm new karma testing angular. followed instructions here ( http://www.ng-newsletter.com/advent2013/#!/day/19 ), , got these errors: chrome 38.0.2125 (mac os x 10.10.0) error uncaught referenceerror: pr not defined @ /public/shared/vendor/angular-1.2.21/docs/components/google-code-prettify-1.0.1/src/lang-apollo.js:28 chrome 38.0.2125 (mac os x 10.10.0) error uncaught referenceerror: pr not defined @ /public/shared/vendor/angular-1.2.21/docs/components/google-code-prettify-1.0.1/src/lang-clj.js:46 chrome 38.0.2125 (mac os x 10.10.0) error uncaught referenceerror: pr not defined @ /public/shared/vendor/angular-1.2.21/docs/components/google-code-prettify-1.0.1/src/lang-css.js:107 i'm not sure how begin figuring out. advice? don't know other info should provide able me :( thanks!

javascript - prevent validaton onfocusout depending of the radio button -

i'm having problem validate form below. main issue have use "onfocusout" function validate inputs. name input has required depending of radio selection. when "value3" selected, focus set input. while on input, if user tries change radio button, onfocusout triggered before radio value changed, , in case error shown while should not suggestion? <form id="myform"> <input type="radio" name="radio" value="value1" /> value1 <input type="radio" name="radio" value="value2" /> value2 <input type="radio" name="radio" value="value3" /> value3 <input type="text" name="name" /> <input type="submit" /> </form> the js code is: $("#myform").validate({ rules: { name: { required: { depends: function () { ret

javascript - Angular calculation not updating in view -

i creating small application calculates distance between 2 points. console.log outputs calculation correctly, not angular portion in view. after click or second selection. i've setup 2 select fields (with separate ng-models) filled information out of json file. i've searched internet extensively, can't find answer. can me this... :) code: var app = angular.module('calculateapp', []); app.controller('calculatecontroller', function($scope, $http) { $http.get('json/stops.json') .then(function(item){ $scope.stations = item.data; $scope.station1 = false; $scope.station2 = false; // watch , calculate $scope.$watch( function( $scope ) { function distance(lat1, lon1, lat2, lon2) { var r = 6371; var = 0.5 - math.cos((lat2 - lat1) * math.pi / 180)/2 + math.cos(lat1 * math.pi / 180) * math.cos(lat

TFS Team Explorer Everywhere gives "An input validation error occurred: The character ':' is not permitted in server paths." -

currently cannot use tf get, tf status, tf checkin on unix box (using team explorer everywhere command line client version 12.0.2.201409181807) following error: an input validation error occurred: character ':' not permitted in server paths. when @ remote workspaces on visual studio advanced edit shows server server_name\collection_name (pretty sure there no ':' in there). cannot find way show server path command line client trying use, nor can find way change through command line. visual studio unable change settings on remote workspace. extensive searching of both google , website have produced no match error , @ loss do. removing workspace , starting again seems work short time not long term option. also having issues public workspaces. every single time have set permissions public. every single time have benn ignored client.

java - Pull to refresh returns the first position of the list -

i have 1 problem pull refresh, use com.handmark.pulltorefresh. , need add new elements list when see last element of list. make this: view = inflater.inflate(r.layout.fragment_generalnews, container, false); mpullrefreshlistview = (pulltorefreshlistview) view .findviewbyid(r.id.pull_refresh_list2); .... // add end-of-list listener mpullrefreshlistview .setonlastitemvisiblelistener(new onlastitemvisiblelistener() { @override public void onlastitemvisible() { if (generalactivity.razr <= 7.0) { pagenumber += 1; log.d("menu", "page2 = " + pagenumber); newpage = "page/" + pagenumber + "/"; final int position = mpullrefreshlistview.getrefreshableview().getfir

nginx appears to use rewrite regardless of server_name -

i have following config file. server { listen 80; server_name web.example.com; access_log /var/www/example/shared/log/web.access.log; error_log /var/www/example/shared/log/web.error.log debug; rewrite ^/(.*)$ http://www.example.net$request_uri; permanent; } when make request curl -ii -h "host: example.com" http://example.com above rewrite rule works. (argh).. the server_name explicitly says "web.example.com" 2014/11/18 22:49:20 [notice] 30694#0: 1868 "^/(. )$" matches "/", client: 1.2.3.4, server: web.example.com, request: "head / http/1.1", host: "example.com" 2014/11/18 22:49:20 [notice] 30694#0: *1868 rewritten redirect: " http://www.example.net/ ", client: 1.2.3.4, server: web.example.com, request: "head / http/1.1", host: "example.com" not present here other server { } configs. xavier (below) pointed out had set default_server listen: 443; not listen: 80. (argh)

algorithm - Network Flow Update Values -

i practicing algorithms problems book , came across one: you given directed network g n nodes , m edges, source s, sink t , maximum flow f s t. assuming capacity of every edge positive integer, describe o(m + n) time algorithm updating flow f in each of following 2 cases. (i) capacity of edge e increases 1. (ii) capacity of edge e decreases 1. it seems simple walking through network flow edges , adjusting flows, not think simple. wikipedia give algorithms o(n^2 m) or o(n m^2). or thoughts appreciated. there solution here . suppose e edge between u , v. increased capacity the idea increasing capacity dfs in residual flow graph path s t. decreased capacity if edge unsed in maximum flow done. otherwise, idea see if there alternative path u v in residual flow graph. takes o(n+m). if found, can increase maximum flow 1. otherwise, need decrease flow. finding path u s along flow can increase 1, , path t v along flow can increase 1. (the inc

Liferay maven dependency could not be resolved -

i using liferay 6.2.10.4 enterprise edition maven.while deploying maven clean package commad got below error. the following artifacts not resolved: com.liferay.portal:portal-service:jar:6.2.10.4, com.liferay.portal:util-bridges:jar:6.2.10.4, com.liferay.portal:util-taglib:jar:6.2.10.4, com.liferay.portal:util-java:jar:6.2.10.4: not find artifact com.liferay.portal:portal-service:jar:6.2.10.4 in central ( http://repo.maven.apache.org/maven2 ) -> [help 1] i have used below well. repositories> <repository> <id>liferay-ce</id> <name>liferay ce</name> <url>https://repository.liferay.com/nexus/content/groups/liferay-ce</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositori

Write text from text file to list c# windows phone -

i beginer , don't know how write text file list strings. mean have file : a b c d e f g h ... and want write list dont know how, maybe simple tried , doesnt work. have list<list<string>> listakolumn = new list<list<string>>(); var str = application.getresourcestream(new uri("wzor.txt", urikind.relative)); streamreader sreader = new streamreader(str.stream); int x = 0; while (!sreader.endofstream) { foreach (string k in sreader.readtoend().split(new char[] { ' ' })) { int j = 0; foreach (string l in k.split(new char[] {' '})) { if (listakolumn.count < k.split(new char[] { ' '}).length) { listakolumn.add(new list<string>()); } //double temp2; listakolumn[j].add(l); j++; } } } b

how function pg_ls_dir () work in postgresql 8.0.6? -

behold, send such request database select pg_ls_dir('. . . /data/pg_log/') files_dir; and answer here: error: function pg_ls_dir("unknown") not exist hint: no function matches given name , argument types. may need add explicit type casts. it says here there no function version of postgresql c work (8.0.6), there way connect desired function, or other way files directory? that's because you're using old version of postgres. pg_ls_dir() appeared in version 8.1. i suggest upgrade latest version (9.3 of writing) if @ possible, version 8.0 9 years old , no longer supported.

c# - Changing an unhandled exception to a handled one in a finally block -

consider program: using system; static class program { static void main(string[] args) { try { try { throw new a(); } { throw new b(); } } catch (b) { } console.writeline("all done!"); } } class : exception { } class b : exception { } here, exception of type a thrown there no handler. in finally block, exception of type b thrown there handler. normally, exceptions thrown in finally blocks win, it's different unhandled exceptions. when debugging, debugger stops execution when a thrown, , not allow finally block executed. when not debugging (running stand-alone command prompt), message shown (printed, , crash dialog) unhandled exception, after that, "all done!" printed. when adding top-level exception handler nothing more rethrow caught exception, well: there no unexpected messages, , "all done!" printed. i understand how happening: determination of whether exception has handler happens before final

javascript - Coffee script access to input value -

i new javascript, coffee script, jquery , ui tech in general. trying accomplish simple thing - read value input field far no luck. code pretty simple: <div class="ui-widget"> <label for="tags">tags: </label> <input id="tags" value="hello"> </div> from coffee script trying read value follows: jquery ($) -> $field = $('.ui-widget input') text=$field.val alert #{ text } but far no luck, contrary via $field.val("bye") works fine. could please put shed on that? thx parameter less function calls require parentheses. text=$field.val is translated var text; text = $field.val; notice getting function reference val adding parans: text=$field.val() becomes var text; text = $field.val(); returning result of function rather function itself.

jquery - automaically change div height with other -

i have div in site named offers has auto height . have div called promotions. want make way if increase height of first div second div automatically change height according first div. how can that? thanks <div class="offers"> </div> <div class="promotions"> </div> demo - http://jsfiddle.net/victor_007/ma51tap3/ var = $('.offers').height() _increase height of first div second div automatically change height _ to check sibling $('.offers').siblings('.promotions').height(a) or check next $('.offers').next('.promotions').height(a)

mysql - Wrong datetime is stored in database -

my table looks (..., date1, date2, date3, date4, date5, ...) and code this: date_default_timezone_set('europe/london'); $date = date("y-m-d h:i:s"); $query = mysqli_query($db, "insert table (date1, date2, date3, date4, date5) values ('$date','$date','$date','$date','$date'); problem date2 have server new york datetime, while date1, date3, date4 , date5 have london datetime. how possible? used same variable $date attributes. in table defined datetime not null . i'm not familiar mysqli (i use pdo) maybe should verify if database has default values date fields. also, if i'm not wrong, shoud use double quotes in query. finally, you should take care sql injection ( wikipedia.org/wiki/sql_injection ). you're query may vulnerable. regards, jonathan f.

How to search for videos using GettyImages Connect API -

i'm trying use api search videos. have client key, secret, , need. have scoured api doc page , down several times, , can't find reference video search. on-site search allows video search, , api works fine when search videos. i use: 'https://connect.gettyimages.com/v3/search/images/editorial?phrase=' + query + '&fields=id%2ctitle%2ccaption%2cpreview search images, , i've tried every combination of word 'video' in search videos, no avail. the images search works great, way. the "swagger" interactive page (most annoying way display api doc, way) has section images, search/images, etc, no video search or video (using video id). the v3 api release notes states have support video search , download. where? thanks can lend hand here, confusing api i've ever encountered. thank you! sorry it's taken long answer question! @ time posted, don't think had our video-specific search , download endpoints up. there now,

garbage collection - Python __del__ method for classes? -

i'm interested in adding hooks code when class (as opposed instance) garbage collected or otherwise falls out of memory. here example code: def make_objects(): class a(type): def __del__(cls): print 'class deleted' class b(object): __metaclass__ = def __del__(self): print 'instance deleted' b = b() print 'making objects' make_objects() print 'finished' i hoping see: making objects instance deleted class deleted finished but instead saw was: making objects instance deleted finished if modify code explicitly call del b , makes no difference: def make_objects(): class a(type): def __del__(cls): print 'class deleted' class b(object): __metaclass__ = def __del__(self): print 'instance deleted' del b output: making objects finished my question is: possible hook object being deleted? the

android - Sony Xperia Z1 Compact Sony Enterprise API -

does know enterprise api version z1 compact support? i have installed airwatch sony service states: currently, devices sony enterprise api version 3-5 have been certified airwatch. but can't find info on api phone has, , if why mail account not work trough airwatch. thanks in advance help. at moment (november 2014) z1 on latest software update (4.4) supports enterprise api level 4. can change future updates.

gnu - Isolate parent makefile environment from included makefile in gnumake -

lets have makefile a.mk has variable named files used. a.mk includes b.mk using files variable name. when execution comes a.mk, files variable modified don't want. how can achieve this? don't have option of modifying b.mk. want environment a.mk , b.mk isolated each other. i believe choices not include b.mk , use sub-make instead (if works) or save , reset variable around b.mk inclusion.

How can I organize files under the qml.qrc folder in Qt Creator? -

if have bunch of resources (images, fonts, etc.) in different folders under qml.qrc file, there way organize within qt creator? for example, if have following in qml.qrc file: <rcc> <qresource prefix="/"> <file>main.qml</file> <file>pages/mainpage.qml</file> <file>pages/newcontactpage.qml</file> <file>images/plus.png</file> <file>images/minus.png</file> <file>images/exit.png</file> </qresource> </rcc> it show long list in qt creator, this: resources qml.qrc / main.qml pages/mainpage.qml pages/newcontactpage.qml images/plus.png images/minus.png images/exit.png since list can long on duration of project, nice if these organized better , split folders in directory. ideas? from qt documentation: the qt resource system by default, re

Copy multiple excel cells into one -

i have lots of excel data, whereby there many records need consolidate 1 cell. i know if copy text carriage return character automatically go new cells, , if paste same text formula bar, paste's records same cell, keeping carriage return character, wanting copy multiple excel cells somehow paste them single cell. i know can paste text editor paste using method above, intention quick , effective. any suggestions?

c++ - Elegant way to disconnect slot after first call -

inside constructor, there connection: connect(&amskspace::on_board_computer_model::self(), signal(camera_status_changed(const amskspace::camera_status_t&)), this, slot(set_camera_status(const amskspace::camera_status_t&))); and method: void camera_model:: set_camera_status(const amskspace::camera_status_t& status) { disconnect(&amskspace::on_board_computer_model::self(), signal(camera_status_changed(const amskspace::camera_status_t&)), this, slot(set_camera_status(const amskspace::camera_status_t&))); // job } and i'd disconnect slot after first call. the question is: there way call slot once? without explicit disconnection? single shot method? possible? the core idea create wrapper, special "connect" automatically disconnect signal. usefull if use lot of "call me once" connections; otherwise i'd advice qobject::disconnect @ beginning of slot. t

c# - Detect context in Self-hosted Web Api -

in current project have windows service periodically runs tasks (topshelf/quartz.net). instead of creating separate project web service want add windows service using self-hosting features available in owin. has added benifit of not needing deploy in iis. when i'm going implement data access layer (dal) i'll getting problems however. all database actions done within unitofwork stored in request state , in end there commit/rollback. context determines lifecycle of unitofwork (request state). in console app use perthreadrequest state. in web environment have perhttprequeststate. mean scope of unitofwork per thread or per httprequest. in current project have mix of both console (quartz jobs) , web (web api calls). these both need use dal aren't able use same request state it's context. i solve manually. when using dal quartz jobs, have use perthreadrequeststate , when using dal web api calls use perhttprequeststate messy solution. when using dal should detect

wso2 - How can i catch error in wso2esb, when i send message to web service? -

i have rest service, return error http 500 (specially). fault sequence not catch error. how catch error? thanks! my config: <?xml version="1.0" encoding="utf-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="d" transports="https,http" statistics="disable" trace="disable" startonload="true"> <target> <insequence> <property name="force_error_on_soap_fault" value="true"/> <send> <endpoint> <address uri="http://localhost:8080/rest/ris/b"/> </endpoint> </send> <log level="full"/> </insequence> <outsequence> <send/> <property name="force_error_on_soap_fault" value="true"/> <log level="fu

javascript - D3 Adding data to 3D Pie Chart -

below js code d3 example found here . var msasubgroup = svg.append("g").attr("id","msasubgroupdata").attr("class","piechart"); donut3d.draw("msasubgroupdata", getdata(msa), 450, 150, 130, 100, 30, 0.4); var wedges = msasubgroup.selectall("g.slices").data(datum).enter(); wedges.on("mousemove", function(d){ //this browser complaining about. mousex = d3.mouse(this); mousex = mousex[0]; //console.log(d); d3.select(this) .classed("hover", true); tooltip.html(d.label+": " + d.value).style("visibility", "visible").style("left", mousex + "px" ); }); i have made few modification try , add data along tool tip. seemed pretty straight forward in fact needed bind data svg. however, getting curious error in console: uncaught typeerror: undefined not functi

html - PHP not displaying anything in MAMP -

im new php , trying record information display on php page using mamp server environment. the attributes productid, productname, productdescription , productprice. i've been able basic php run fine every time open php file, nothing displays, wandering if might location placed php file. in htdocs. appreciate help. thanks <?php //connection db mysql_connect('localhost', 'root', 'root'); //choosing db mysql_select_db(primrose); $sql= "select * products"; $records mysql_query(sql); ?> <html> <head> <title>product data</title> </head> <body> <table width="600" border="1" cellpadding="1" cellspacing="1"> <tr> <th>name</th> <th>description</th> </tr> <?php //loops on each record , each new record set variable products while(produ

sqlite - Loading a ListView Adapter in Android -

i trying load adapter sqlite database , cannot seem wrap head around how works. extremely new android , java programming forgive if stumble around of obvious. i understand have "proper" database setup must have 3 java files, main, databasehandler , class whatever table is, getting there. have of working in form cannot seem listview load rows in table. i have 1 table 2 columns, id , item. code in databasehandler items shown below: public list<item> getallitems() { list<item> itemlist = new arraylist<item>(); string selectquery = "select * " + table_items; sqlitedatabase db = this.getwritabledatabase(); cursor cursor = db.rawquery(selectquery, null); if (cursor.movetofirst()) { { item item = new item(); item.setid(integer.parseint(cursor.getstring(0))); item.setitem(cursor.getstring(1)); itemlist.add(item); } while (cursor.movetonext()); } retu