Posts

Showing posts from July, 2014

c# - Windows Push Notification Service Failed due to Time Out -

the windows push notification fails while trying establish connection @ following code. var channel = await pushnotificationchannelmanager.createpushnotificationchannelforapplicationasync(); it times out 0x80070102 exception. have disabled firewall , uninstalled antivirus still fails. any suggestions?

android - Not able to setup AndroidViewClient on Windows 7 -

i referred wiki , tried on internet not make working. have set android_view_client_home androidviewclient folder, pythonpath androidviewclient/src folder. i still not able import viewclient , getting following exception on running monkeyrunner script. com.dtmilano.android.viewclient import viewclient importerror: no module named dtmilano 140910 18:18:23.594:s [main] [com.android.monkeyrunner.monkeyrunneroptions] @ org.python.core.py.importerror(py.java:304) 140910 18:18:23.594:s [main] [com.android.monkeyrunner.monkeyrunneroptions] @ org.python.core.imp.import_logic(imp.java:790) 140910 18:18:23.594:s [main] [com.android.monkeyrunner.monkeyrunneroptions] @ org.python.core.imp.import_module_level(imp.java:842) 140910 18:18:23.594:s [main] [com.android.monkeyrunner.monkeyrunneroptions] @ org.python.core.imp.importname(imp.java:917) 140910 18:18:23.594:s [main] [com.android.monkeyrunner.monkeyrunneroptions] @ org.python.core.importfunction.__call__(__builtin__.java:1220) 14...

javascript - Open Folder Explorer from link -

a similar question been asked example here . anyawy need not open in browser contents on folder, this: <a href="file:///d:/tools/">open folder</a> (bwt above works on chrome, opens d:\tools in machine) what achieve opening folder explorer @ given address (in case of windows opening windows explorer @ d:\tools. the scenario is: web application (php) knows folder open, user clicks button , folder opened in folder eplorer. somehow manual workaround is: display path in browser the user copies it user opens folder explorer user pastes path i realized using internet explorer behavior desired one: 1) user clicks on <a href="file:///\\server\files\folder1">\\server\files\folder1</a> 2) windows explorer opens @ \\server\files\folder1 so want achieve possible in internet explorer (without exploring plugins , tricks). on other browsers clicking on link let browser render read visualization of folder, while using oth...

javascript - If parent element has only 2 child elements do something, else something else -

so have html markup: <div class="buttons-holder> <label class="my-btn"> <input name="example" value="1" type="radio"> yes </label> <label class="my-btn"> <input name="example" value="0" checked="checked" type="radio"> no </label> </div> but have more 1 label inside .buttons-holder element. how can specify in jquery apply jquery code if there exists 2 label elements? i tried still applies elements: if ($('form label:has(input[type="radio"])').eq(2)) { //do } else { //do else } jsfiddle: http://jsfiddle.net/jw51hggc/ based on comments , fiddle $('form .buttons-holder').filter(function(){ return $(this).children('label:has(input[type="radio"])').length == 2 }).wrapinner('<div class="wrap"><...

Confusion while using regex to edit a key-value ini file (Python) -

i'm trying regex ante using edit .ini file based on vague descriptions of parts want changed. specifically, i'm trying update line in file describes list of directories program use search vst libraries. i'm using following expression: r"^(?=.*?vst.*?=)(?=.*?[(path)|(directories)].*?=)(?p<key>.*?)\s?=\s?(?p<value>.*)$" i.e. i'm using lookaheads find out if there's mention of 'vst's alongside mention of 'path' or 'directories' before equals sign (indicating they're in key), , if match there i'm splitting result key-value groups. however, i'm finding isn't working, , it's matching 'vst' in it. is there i'm missing that's failing assert both lookaheads? (also not sure whether i've gone overboard question marks) any appreciated matt figured out: r"^(?=.*?vst.*?=)(?=.*?(?:path|directories).*?=)(?p<key>.*?)\s?=\s?(?p<value>.*)$" what wr...

android - Most efficient way to share data between a Service and an Activity -

i'm working on app composed of background intentservice running time (even when activity lost focus) , activity (a section pager fragments). the background service checking time , storing large array of objects (up 300) parsed xml file. each object represent event associated starttime , when starttime matches current time service has notify activity (if available) display event happening. on activity side have fragments (tabs of section pager) custom arrayadapter list events listview. right i'm doing sending object service localbroadcastmanager. fragments listening , when receive object update local arraylist replacing , notifying arrayadapter data set changed. since each fragment has keep arraylist update arrayadapter , listview, end same object stored both inside service's array , in 1 of fragment' array. i'm wondering if there better way. the question : efficient (on memory/cpu usage , speed) way share large array of objects between service , a...

c# - How to Show the SMTP Status -

i wrote program 1 year ago . designed form "connect " . , winform email textbox , ...etc. i use smtp send email email understand want me know. many of customers me , "i sended email product " don't receive ! after , understand anti viruses blocking smtp , install anti virus , block smtp , send email on debug mode nothing happened (the program doesnt give me error) . so , is there programmatically way understand , smtp blocked or not ?! i use ftp send suggest of customers know , not secure way me , customers . cause many person use our iis server administrator(and im not admin of server) . can u suggest me send customer suggest in secure way ?! thank u read . most of anti-virus products catch , prevent smtp service sending it, not making requests, don't think going have luck programatically determining if intercepted. the easiest option (but not fool proof) shell out windows mailto:email@emailaddress.com i switch web servic...

python - Django getting objects from a mixin -

i have small model method i'm using previous , next object relative current object. looks this: class article ... def get_prev_next(self): articles = list(article.objects.all()) = articles.index(self) try: p = articles[i - 1] except indexerror: p = none try: n = articles[i + 1] except indexerror: n = none return {'prev': p, 'next': n} it works, , may inefficient, want use in different model. i'd make mixin, can't figure out how original model class name can run model.objects.all() , list. i have far: class prevnextmixin(object): objects = list(???.objects.all()) = objects.index(self) ... a mixin still class. code still needs go method. method self argument now. class prevnextmixin(object): def get_prev_next(self): objects = list(self.__class__.objects.all())

sql - Cast date to int4 -

i using netezza , have 2 separate tables join date. in first table, date stored type "date" (e.g., 2014-09-10) while in second table, date stored type "int4" (20140910). i've tried joining tables date: select * table1 inner join table2 b on date(a.start_date) = to_date(b.start_date, 'yyyymmdd') this runs slow. it's been recommended me comparison might faster if cast date in table1 int4 , compare int4's. however, couldn't find way or if best way. here query: select * table1 inner join table2 b on date(a.start_date) = to_date(b.start_date, 'yyyymmdd'); in general, databases have hard time joins on different types of columns or on joins functions. reason twofold: function make hard (or impossible) use indexes. statistics on columns of different types incompatible. however, if move functions 1 side, engine might able something. instance: select * table1 inner join table2 b on b.s...

python - Trying to find all possible combinations and groupings -

i have been trying work through following problem using excel , realized may better suited python however, not sure start, have basic understanding of python. how guys approach solving this? there 6 kinds of coffee , there 10 kinds of flavor shots , can put one, 2 or 3 shots in each kind of coffee. based on this, know (and list) unique flavor combinations , how long go without having same cup of coffee. using itertools.combinations can different possibly combinations of flavour shot: from itertools import combinations shots = range(1,11) n = 3 coms = [c n in range(1, n+1) c in combinations(shots, n)] the length of coms give number of combinations, in case of 6 flavours , one, two, or 3 shots 175. the number of flavour shot combinations when added coffee 6 * 175 = 1050 . edit additionally (as aside) don't need through programming. assuming have n elements , want work out how many different ways can pick k of them number given binomial coefficient can ca...

assets - Multi Device Hybrid Apps - support for xxhdpi and xxxhdpi densities on Android -

Image
i'm using visual studio 2013 multi-device hybrid apps ctp 2.0. in project template, there several placeholder splashscreens , icons android: ldpi, mdpi, hdpi , xhdpi densities. how can support xxhdpi , xxxhdpi densities? tried following: added files res/icons/android (icon-144-xxhdpi.png) , res/screens/android (screen-xxhdpi.png) added icon specification config.xml according cordova docs the xxhdpi images not present in apk file after build. currently visual studio not support xxhdpi or xxxhdpi , therefore xxhdpi.png images make package ( .apk). vs cpt2.0 supports below listed resolution , can see complete list across different platforms here http://msdn.microsoft.com/en-us/library/dn757053.aspx#visualassets workaround include xxhdpi or xxxhdpi resources package: create multi-device hybrid apps project or open existing project. build project go bld\debug\platforms\android\res add folder xxhdpi or xxxhdpi res like build project. not re-build. ...

postgresql - How do you uninstall Postgis? -

i had postgis installed on machine, , somehow, files got corrupted. want uninstall , reinstall postgis things working again, not sure how go this. i running windows 8.1. i've tried searching in control panel under programs , features postgis doesn't show there. i've tried in stackbuilder there no uninstall options. a google search turned nothing useful. has done before? possible uninstall , reinstall postgis doing same whole postgres? this work me and remove postgis database run bellow query drop extension postgis to create postgisis run above query in query panel select postgis_full_version();

java - Unable to connect to Amazon RDS DBInstance via Hibernate or sqlplus -

i have created dbinstance in rds. have added vpc security group subnet including machines ip sending requests. however, not able connect dbinstance yet. connection times out. specifying following details in hibernate.cfg.xml: <session-factory> <property name="hibernate.dialect"> org.hibernate.dialect.mysql5innodbdialect </property> <property name="hibernate.connection.driver_class"> com.mysql.jdbc.driver </property> <property name="hibernate.connection.url"> jdbc:mysql://{dbinstancename}.us-west-2.rds.amazonaws.com:3306/{dbname} </property> <property name="hibernate.connection.username"> {username} </property> <property name="hibernate.connection.password"> {password} </property> </session-factory> i out of ideas on wrong. appreciated. p.s: tried connecting using sqlplus in vain. thanks. log aws account, go rds, click on secu...

variables - Conditional checks in makefile -

consider following makefile. intend call "make var=xxx" normal building, , "make help" or "make clean" or "make showvars" @ other times. when i'm doing actual build, need ensure 'var' variable passed @ commandline, not require present other targets such clean. currently, check bails out time var not specified, safe, annoying , unnecessary when cleaning or mucking around. how can run check build targets , not @ other times? var= $(if $(var),,$(error var not specified @ commandline!)) var_release=`echo $(var) | sed -e 's/-/_/g'` .phony showvars clean prep rpm all: prep rpm prep: # prep work. requires valid var , var_release rpm: # build rpm. requires valid var_release help: # not require var , var_release showvars: # display vars. requires valid var , var_release clean: # not require var , var_release update: per maxim's suggestion below, using $(makecmdgoals) check target specified , ignoring not req...

awk - Bash: nested for loop to iterativly change a paritular element in a matrix -

i try change in file.txt formatted follow: 0.0 0.0 1.0 2.0 3.0 0.0 0.0 3.0 3.0 35.0 ... only second zeros in each lines: 0.0 numbers. i know sed command change elements if write that: input=0 f in {0..2} sed -i "1s/$input/$f/" file.txt input=$f done the sed command change first 0 in file, changing to: 1.0 0.0 1.0 2.0 3.0 1.0 0.0 3.0 3.0 35.0 ... but, instead, like: 0.0 0.1 1.0 2.0 3.0 0.0 0.1 3.0 3.0 35.0 ... so how can specify sed must change number? upgrade: i try use sed command guessed sadasidha: number=0.2 sed -r "s/^([0-9].[0-9]) ([0-9].[0-9])/\1 ${number}/" input.txt but request bit different, idea make loop in can increment second element on fourth line, instance, 10 times, second element of third line, second line , first one...as in 4 loop as: input=0 f in {0..10} m in {0..10} s in {0..10} g in {0..10} change second element on fourth line 10 times, input=$f ...

c# - XslCompiledTransform cannot load stylesheet, expects token '}' -

i have xml contains following line: <field text="%%=$summ,{0:0.000}%%%" /> xslcompiledtransform.load expecting '}' instead of ':'. expected token '}', found ':' in %%=$summ,{0 -->:<-- 0.000}%%% is there way avoid this? the curly braces used attribute value templates in xslt. the xslt processor evaluates content xpath expression, , 0:0.000 not valid xpath. if mean literal curly braces, must escaped (in attribute values only, of course): <field text="%%=$summ,{{0:0.000}}%%%" />

responsive design - Compass: Exporting Sprites Positions as Percentages -

when using compass' sprite generator, generator creates css rules based on pixels. example code: @import 'compass/utilities/sprites'; $sprite-2-layout: horizontal; @import "sections/anatomy-sprite-test/sprite-2/*.png"; @include all-sprite-2-sprites; $sprite-3-layout: horizontal; @import "sections/anatomy-sprite-test/sprite-3/*.png"; @include all-sprite-3-sprites; $sprite-4-layout: horizontal; @import "sections/anatomy-sprite-test/sprite-4/*.png"; @include all-sprite-4-sprites; example output: /* line 84, ../../../../../../../../../../../library/ruby/gems/2.0.0/gems/compass-core-1.0.1/stylesheets/compass/utilities/sprites/_base.scss */ .sprite-2-00 { background-position: 0 0; } /* line 84, ../../../../../../../../../../../library/ruby/gems/2.0.0/gems/compass-core-1.0.1/stylesheets/compass/utilities/sprites/_base.scss */ .sprite-2-00 { background-position: -244px 0; } is there way in these can generated in percentages in ord...

R integration with Tableau -

i facing difficulty in integrating r tableau. when created calculated field asking rserve package in r , not alowing drag field worksheet. have installed package still shows error saying "error occurred while communicating resrve service.tableau unable connect service.verify server running , have access privileges" any inputs. thank you need start rserve. if install rserve package, run (on rgui, rstudio or wherever run r scripts) > library(rserve) > rserve() you can test connection rserve on tableau, on help, settings , performance, manage r connection.

c# - Is paths interpretation on mono on mac different from the .net windows version? -

i'm translating app .net on windows mono on mac. found error happening, think related how backslash interpreted on mono - mac. path.getdirectoryname("assembly\\file.dll") on mono mac return empty string, on .net windows return "assembly". normal behaviour? can change way path interpreted kind of configuration, or need replace every backslash forwardslash? on mono can use mono_iomap environment variable ignore differences path ( windows case insensitive, unix case sensitive) , path separator ( '\' vs '/' ) see http://www.mono-project.com/docs/advanced/iomap/ the best long term solution anyway use methods path.combine or path.directoryseparator fix these problems

javascript - Apps script write to Big Query unknown error -

this supposed read in csv , write bigquery. when runs, however, nothing written, , there no errors logged. read need write csv , turn octet stream. not sure whether or not compatible google bigquery. function test(){ try{ var tablereference = bigquery.newtablereference(); tablereference.setprojectid(project_id); tablereference.setdatasetid(datasetid); tablereference.settableid(tableid); var schema = "customer:string, classnum:integer, classdesc:string, csr:string, csr2:string, insurance:string, referralgeneral:string, referralspecific:string, notes:string, inmin:integer, inhr:integer, outmin:integer, outhr:integer, waitmin:integer, waithr:integer, datetimestamp:float, dateyr:integer,datemonth:integer, dateday:integer"; var load = bigquery.newjobconfigurationload(); load.setdestinationtable(tablereference); load.setsourceuris(uris); load.setsourceformat('newline_delimited_json'); load.setschema(schema); load.setmaxbadrecords(0); load.setwr...

jQuery move the caret/cursor after the new appended element? -

so, have code appending tab when tab pressed, cursor stays behind tab after tab appended. how make when append new element cursor moves after/in right of tab. have code: jquery $('.example').each(function(){ this.contenteditable = true; }); if(event.keycode==9){ event.preventdefault(); $('.example').append('\t'); } html <div class="example"></div> this code not working har0lds proposal(which read in topic given not asked): $('.example').each(function(){ this.contenteditable = true; }); function placecaret(field){ var editable = field, selection, range; // populates selection , range variables var captureselection = function(e) { // don't capture selection outside editable region var isorcontainsanchor = false, isorcontainsfocus = false, sel = window.getselection(...

html - my <ul> dissapears when generating <li> in PHP? -

i'm having weird error ul tag dissapears when generate li tags in it, have no idea if here me great. the html gets generated in: <div class="col-md-12 col-xs-12"> <div id="tickets"> <ul>'.$ticket->generatetickets().'</ul> </div> </div> my php function public function generatetickets(){ $cols = array ('id','description','ticket_id'); $items = $this->db->orderby('id')->get("tickets", null, $cols); if ($this->db->count > 0){ foreach ($items $item) { echo '<li><a href="?p=support&action=readticket&tid='.$item['id'].'">ticket #'.$item['ticket_id'].'<br/></a> <p>'.substr($item['description'],0,20).'..</p> </li>'; } } } console showing ul dissapeared: h...

performance testing - Dynamically obtain wresult parameter in JMeter -

i working in performance testing project , need obtain parameter called wresult (that passed encoded post) dynamically. the problem can not find parameter in page. this parameter seems authentication porposes think. thanks help. it looks you're load testing ms-mwbf protected application microsoft's saml protocol version. here few resources might helpful: setting load-test jmeter performing sp initiated sso's saml 2.0 sso saml login scenario in jmeter using xpath extractor in jmeter xpath language reference

c++ - Is gcc 4.8 or earlier buggy about regular expressions? -

i trying use std::regex in c++11 piece of code, appears support bit buggy. example: #include <regex> #include <iostream> int main (int argc, const char * argv[]) { std::regex r("st|mt|tr"); std::cerr << "st|mt|tr" << " matches st? " << std::regex_match("st", r) << std::endl; std::cerr << "st|mt|tr" << " matches mt? " << std::regex_match("mt", r) << std::endl; std::cerr << "st|mt|tr" << " matches tr? " << std::regex_match("tr", r) << std::endl; } outputs: st|mt|tr matches st? 1 st|mt|tr matches mt? 1 st|mt|tr matches tr? 0 when compiled gcc (macports gcc47 4.7.1_2) 4.7.1, either g++ *.cc -o test -std=c++11 g++ *.cc -o test -std=c++0x or g++ *.cc -o test -std=gnu++0x besides, regex works if have 2 alternative patterns, e.g. st|mt , looks last 1 not matched reasons. code ...

node.js - Error with Simple Express Server and Gulp -

i'm trying run simple express web server using gulp task. want static server displays index file. can perform running node module, again, want in gulp. plan on expanding allow livereload server set up. i have followed many tutorials on setting livereload failing. i'm assuming has versions being used respect when articles written. hoping maybe had idea on how handle this. i have created small github repo allows play around i'm trying accomplish: fixit gulpfile.js: var gulp = require('gulp'); var express_port = 4000; var express_root = __dirname; gulp.task('express', function () { var express = require('express'); var app = express(); app.use(express.static(express_root)); app.listen(express_port); }); *there index.html in same directory gulpfile and here error: /var/www/clients/client1/web14/sendus-admin/node_modules/express/node_modules/etag/index.js:55 throw new typeerror('argument entity must string or buffer...

Hierarchical display of DB data in ASP.NET MVC c# -

i trying obtain information multiple tables , display data in hierarchical view. have following tables: track_info gen_ed_head gen_ed_sub_head gen_ed_sub_sub_head gen_ed_course core_head core_sub_head core_sub_sub_head core_course i need first display 1 record track info, display each record of gen_ed_head each gen_ed_sub_head listed under respective head , gen_ed_sub_sub_head listed under , gen_ed_course listed. i know how not in mvc. here example of looping (hierarchy) looking for: foreach(track in track_info) { display track info foreach(genedhead in gen_ed_head) { display gen_ed_head info foreach(henedsubhead in gen_ed_sub_head) { display gen ed sub head info foreach (genedsubsubhead in gen_ed_sub_sub_head) { display gen ed sub sub head info foreach(course in gen_ed_course) { display gen ed course info } ...

c# - Setting custom font on all UIButtons -

i want apply custom font buttons in ios app i've created in xamarin. i've achieved custom font on labels previous code: //labels uilabel.appearance.font = uifont.fromname("lato-light",16f); ...which affects not buttons reason. tried targeting label on button so: var buttonappearance = uilabel.appearancewhencontainedin(typeof (uibutton)); buttonappearance.font = uifont.fromname("lato-light", 16f); ...which nothing. should targeting button title instead? know there lots of questions on here concerning how set in xcode i'm working c# in xamarin.ios. thanks! so since there no uibutton.appearance.font , can use c# workaround use. make extension method (inside static class): public static void applytheme(this uibutton button) { //set font on button or whatever } then call code on every uibutton in app: //in viewdidload, awakefromnib, etc. mybutton.applytheme(); this give styling buttons can modify app changes.

laravel - Permission denied: .composer/vendor/bin -

recently, way of installing laravel's command has changed. can see here: http://laravel.com/docs/installation#install-laravel after execute composer global require "laravel/installer=~1.1" i'm receiving error permission denied: .composer/vendor/bin any idea how fix it?

c# - MVC 4 partial view causes page to become unresponsive on submit -

situation: in c#/mvc 4 solution employing view partial view within. view form submit button. partial view div hidden, can displayed if checkbox selected. issue: if partial view hidden, submit works normally. if partial view not hidden submit causes page become unresponsive, if 1 waits 3 plus minutes or submit works expected. the code below. thank in advance consideration. novice developer, therefore comments, suggestions , critiques welcome. code: model namespace mymodels { public class mainmodel { public selectlistitem things { get; set;} public ienumerable<othermodel> morethings { get; set;} } } view //named myview @model mymodels.mainmodel @using mymodels @if (model != null){ using (html.beginform("myviewname", "mycontrollername", formmethod.post, new { id = "view-form" })) { @html.labelfor(model => model.things) @html.dropdownlist("", (selectist)viewbag.things) ...

assembly - Why are characters being offset by 0x40 on my Commodore 64 emulator? -

Image
i have 6502 code print string screen memory after clearing screen. unfortunately if print string, example "hello world", come out in garbled characters. i've found because upper case characters start @ 0x01, not 0x41 thought petscii codes here . i can fix subtracting 0x40 string, other letters incorrect, example, spaces. i'm not sure why character generator turning 0x01 character 'a' , not 0x41. turns 0x41 inverted spade sign (like on deck of cards) , above seems border characters , weird symbols. after looking around while found quote on wikipedia page petscii seemed state problem i'm trying solve, i'm not sure how fix , can't find information anywhere... the actual character generator rom used different set of assignments. example, display characters "@abc" on screen directly pokeing screen memory, 1 poke decimal values 0, 1, 2, , 3 rather 64, 65, 66, , 67. i running on vice x64 emulator on mac os x, , i'm asse...

How can I drag virtual files from java swing to windows desktop? -

is possible drag "virtual" file java swing application , drop onto windows desktop? "virtual" mean "not local" file needs downloaded/prepared potentially take long time. have client-server application shows view of remote files. when user drops file on desktop, receive notification of destination folder use start download process java application. please offer or guidance i've been looking solution while now. i'm working on similar myself, , have unfortunate news you: windows cannot handle promised files, nor inform java application files dropped. put, there no way handle remote drag-and-drop via dnd api only. you need create empty files in temp directory somewhere, , hand windows files when mouse leaves swing window. need set watchservice on local filesystem receive notification of file creation. after dropend, check empty files of correct name not in temp directory, , effect transfer @ point (move remote files empty files droppe...

Can't Loop through javascript quiz -

this javascript quiz done for loops. problem when 2 of same answers selected (such "dec" , "dec"), program scoring them 2 correct answers. please review code. seems if program looping selected options, , checking them against answers. <html> <head> <title>javascript multiple choice test</title> </head> <body> <form name="form1"> when xmas?<br/> <input type="radio" name="answer" value="jan" >jan<br/> <input type="radio" name="answer" value="dec" >dec<br/> <input type="radio" name="answer" value="feb" >feb<br/> <input type="radio" name="answer" value="june" >june<br/> </form> <form name="form2"> when ...

objective c - Embedded .xib appearing in wrong position -

Image
i hoping ios 8 bug (it still might be; works fine in ios 7) i'm still seeing in ios 8 gm seed. i have categoriesview.xib embedded in detailview.xib. when detailview.xib displayed, placeholder uiview displays in right location, contents of categoriesview.xib appear 72px above they're supposed to. i'm using autolayout. 72px seems 20px status bar + 44px navigation bar + 8px auto layout constraint top of image. inside categoriesview.xib, there 5 little icons representing each possible category. each icon has width/height constraint , leading space constraint add padding neighbor. typically screen show 1-2 categories, , accomplish this code: // width constraints part of categoryviewswidthconstraints outlet collection // padding constraints part of categoryviewsspacingconstraints outlet collection // loop through outlet collection, , set width , padding constraints 0 (int = 0; < self.categoryviewswidthconstraints.count; i++) { [self.categoryviewswidthconstrain...

linux - bash scripting: search Java STDOUT for a variable -

when run mytest.jar, outputs alot of information in stdout (not in file) , trying read/search file specific string put variable in bash script. java stdout: line 1 info............ line 2 info........... .... ... successful (either 'successful' or 'failed') how search for, in bash, last line in stdout or ('successful' or 'failed') without redirecting stdout file? thanks in advance this not way of checking success or failure. you should instead rewrite mytest.jar use system.exit(0) on success , system.exit(1) (or higher) on error. if program written, this. you can check success or failure in bash using e.g. if java -jar mytest.jar echo "the command succeeded :d" else echo "the command failed :(" fi all unix programs work way, , should make sure mytest.jar no exception.

dart - When my future completes, how do I notify the observed variable? -

my template (item_view.html) references variable (map item) that's getter it's defined in viewmodel. in item_view.html, things like: <h1>{{item['subject']}}</h1> in item_view.dart, item is: @observable map item => toobservable(viewmodel.itemviewmodel.item); note it's referencing observed map item in itemviewmodel below. the mainviewmodel has getter itemviewmodel: @observable itemviewmodel itemviewmodel { // code determine item model return. // ... return itemviewmodels[id]; } and finally, itemviewmodel gets item, , should populating item results. class itemviewmodel extends observable { final app app; @observable map item = toobservable({}); itemviewmodel(this.app) { getitem(); } void getitem() { ... // todo: completes later, , item changes aren't being observed! f.child('/items/' + decodeditem).onvalue.first.then((e) { item['subject'] = // ...and on. .....

java - Build project with maven without Neo4j running -

i have project set using spring-data-neo4j. we're trying have our build process lean possible i'm not able build project unless neo4j running. if it's not running application context fails load because cannot connect graph. don't have neo4j unit tests set skip loading neo4j information entirely don't see way of lazy loading neo4j:repositories , neo4j:config beans. there way of doing this? there workaround? here's spring-data-neo4j setup: <neo4j:repositories base-package="com.xxx.graph.repository" /> <neo4j:config graphdatabaseservice="graphdatabaseservice" base-package="com.xxx.domain" /> <bean id="graphdatabaseservice" class="org.springframework.data.neo4j.rest.springrestgraphdatabase" scope="singleton"> <constructor-arg value="${graph.db.url}" /> </bean> in end decided have our unit tests import entirely separate context files...

javascript - Fire function when returning to a tab -

i'm looking javascript / jquery method fire function when returning tab. i'm tracking amount of time spent on ad using getdate on load, , subtracting difference when leaving ad. however, links ad lead new tab, , user may return keep interacting ad. can used restart timer when user navigates tab? onload won't seem work since tab loaded, , onfocus fires many times (the user interacts ad perform live search of inventory). suggestions? something should trick: $(window).on('blur focus', function(e) { // window has been focussed, when blurred. if(e.type == 'focus' && $(this).data('type') == 'blur') { alert('you have returned!') } // store event type. $(this).data('type', e.type) })

javascript - Data from Table to json -

Image
good day, i have table data trying convert json format can print jspdf plugin problem cant seem insert proper json format existing json data. here script convert table data json $('.report-table tr').each(function(){ var obj = {}; obj['column'] = [{}]; obj['column']['value']=[]; $('th', this).each(function(){ //obj.column.value.push($(this).text()); obj['column']['value'] = $(this).text(); // obj.column.value.push($(this).text()); // obj['column'] = $(this).text(); }); $('td', this).each(function(){ // obj.column.value.push($(this).text()); obj['column']['value'] = $(this).text(); }); dynamic.contents.data.push(obj); }); this existing json data want appended var dynamic = { "documenttitle": "dynamic print", ...

sql - How to add check constraint CHECK constraint to the APP_DATE column to make sure that all appointments are before 02/01/2012 -

alter table office add constraint check_app_date check (app_date < ’02-01-2012’); i have tried use above commands getting error. error @ line 2: ora-00911: invalid character is correct way check constraint in sqlplus? you're missing to_date function: add constraint check_app_date check (app_date < to_date(’02-01-2012’,'dd-mm-yyyy'));

java - HandlerInterceptorAdaptarer Spring - Invalid content was found starting with element 'bean' -

i'm trying make handlerinterceptoradaptarer work. my class extends handlerinterceptoradapter package br.com.caelum.tarefas.interceptor; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; import org.springframework.web.servlet.handler.handlerinterceptoradapter; public class autorizadorinterceptor extends handlerinterceptoradapter{ public boolean prehandle(httpservletrequest request,httpservletresponse response,object controller){ string uri = request.getrequesturi(); if(uri.endswith("loginform") || uri.endswith("efetualogin") || uri.contains("resources")){ return true; } if(request.getsession().getattribute("usuariologado") != null){ return true; } return false; } } after went servlet-context.xml , added <interceptors> <bean class="br.com.caelum.tarefas.interceptor.autorizadorint...