Posts

Showing posts from September, 2012

jbpm - XmlBPMNProcessDumper generated XML is not same as WorkBench designer generated XML -

i'm using xmlbpmnprocessdumper generate bpmn xml. result defferent when compare generated workbench designer. there other class generate properly? they not meant identical, though should (mostly) semantically equivalent (from runtime perspective @ least). trying achieve? note models generated designer / eclipse using eclipse bpmn2 emf model generate xml.

Hadoop - Merge reducer outputs to a single file using Java -

i have pig script generates output hdfs directory. pig script generates success file in same hdfs directory. output of pig script split multiple parts number of reducers use in script defined via 'set default_parallel n;' i use java concatenate/merge file parts single file. want ignore success file while concatenating. how can in java? thanks in advance. you can use getmerge through shell command merge multiple file single file. usage: hdfs dfs -getmerge <srcdir> <destinationdir/file.txt> example: hdfs dfs -getmerge /output/dir/on/hdfs/ /desired/local/output/file.txt in case don't want use shell command it. can write java program , can use fileutil.copymerge method merge output file single file. implementation details available in link if want single output on hdfs through pig need pass through single reducer. need set number of reducer 1 so. need put below line @ start of script. --assigning 1 reducer in order generate 1 output file.

html - Bootstrap - input in navbar spanning several columns -

in bootstrap 3.3.4, try have input group in navbar spans 8 central columns, next brand name. unfortunately input group either seems remain fixed size, or stretches input-group-addon. code closest want achieve (modulo stretching) this: <nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="row"> <div class="col-xs-2"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapsible"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">brand</a> </div> <div cla

ruby on rails - PgSearch 1.0.0 throws ModelNotMultisearchable error when trying to rebuild from console -

i've got app 4 different models multisearchable, set pg_search_scope; ie: class episode < activerecord::base include pgsearch # multisearchable :against => [:title, :description] pg_search_scope :search_text, :against => [:title, :description], :using => { :tsearch => {:prefix => true} } as can see @ 1 point tried setting multiserachable way. of late there items know should returning not in search results, , thought i'd have rebuild pg_search_documents; that's throwing error: irb(main):004:0> pgsearch::multisearch.rebuild(show) pgsearch::multisearch::modelnotmultisearchable: pgsearch::multisearch::modelnotmultisearchable /app/vendor/bundle/ruby/2.0.0/gems/pg_search-0.7.3/lib/pg_search/multisearch/rebuilder.rb:6:in `initialize' /app/vendor/bundle/ruby/2.0.0/gems/pg_search-0.7.3/lib/pg_search/multisearch.rb:10:in `new' /app/vendor/bundle/ruby/2.0.0/gems/pg_search-0.7.3/lib/pg_sea

php - Get substr from string -

i have code <?php echo $fileinfo[2] ?> so $fileinfo[2] outputs: /1/video/hey-smith_.mp4 i want part of string video/hey-smith_.mp4v , how remove /1/ ? this return 3rd character end of string: echo substr($fileinfo[2],3);

git - Moving merged commits back to old branch, reverting master and keeping changes -

Image
i merged commits master , need changes on new branch , master reverted what pre-merge. here's commit history looks now: and here's like: i'm not seeing differences, believe understand problem, it's i've done before. 1) create new branch: assuming master current branch, create new branch c:\git\project> git branch my_new_branch 2) reset master branch. let's assume last 4 commits need out. c:\git\project> git reset --hard head~4 3) work on new branch c:\git\project> git checkout my_new_branch the --hard causes indexes reset of first commit want keep, , modifications lost. a few caveats: -if you've pushed master changes remote, doesn't affect remote. @ least @ site, can't push reset, have work remote's owner (or git admin) similar this. -the --hard should clean untracked files, @ least docs read so, i'm not convinced occurs.

ios - Making different parts of an NSString clickable -

in app reading in text file on server. when nsstring want make different parts of clickable if click on sentence, open dialog box. how go this? i have read using uitapgesturerecognizer not sure how use recognize string of text rather single word @ time. i have looked nsmutableattributedstrings not finding need make sense of how this. any appreciated. you can use nsattributedstring insert link custom url scheme. then, when detect link has been pressed, check url scheme , if it's yours, whatever want in method. have use uitextview , or can use tttattributedlabel (you can find tttattributedlabel here ). following sample code (inspired older ray wenderlich article) uses uitextview . nsmutableattributedstring *attributedstring = [[nsmutableattributedstring alloc] initwithstring:@"something should happen when press _here_"]; [attributedstring addattribute:nslinkattributename value:@"yoururlscheme://_here_"

Using audioread on a MP3 File in Matlab -

i have trouble read mp3 file in matlab. there function audioread supposed job, doesn't work. >> [x fs] = audioread('corner.mp3'); *** audioread: problem reading corner.mp3:too many input arguments. *** audioread: returning empty waveform the function work wav files without problem. don't know problem comes from, searched here , using google, without success. have you, guys, idea ? edit : here mp3 file : http://www8.zippyshare.com/v/zzqpecrf/file.html edit 2 : using matlab 7.12.0 (r2011a) on windows 8 laptop. edit 3 : seems matlab version old. i'm using r2014a version , works perfecly ! your answer not reproducible in matlab 2015a. hiandbaii matlab version old. use mp3 file , update newer version of matlab , work. >> [x fs] = audioread('corner.mp3'); >> fs fs = 44100 >> size(x) ans = 12899250 2

scope - Python: Imported functions access to global variables -

i have 2 files shown below. #foobar.py foo = false def bar(): if foo: print "worked" else: print "did not work" and #main.py foobar import * foo = true bar() print foo the output when run $ python main.py is did not work true is possible bar() access global foo defined in main.py ? update should have clarified earlier thought question should remain bare-bone possible. foobar.py supporting file (with other functions having different parameters use global foo ) want use bunch of related ipython notebooks. the notebooks should ideally have own definitions of foo , it's absence should caught , handled. i chose not include argument try , make code cleaner. i aware that: wildcard imports ( import * ) should avoided, make unclear names present in namespace, confusing both readers , many automated tools.- pep8 accepting comment l3viathan answer. no, it's not. why don't want use arg

xcode - Parse/Swift getObjectInBackgroundWithId query not working -

i trying run query object in background id when run method query.getobjectinbackgroundwithid , getting error message: "cannot invoke 'getobjectinbackgroundwithid' argument list of type (string, block: (pfobject!,nserror?) -> void" the same thing happens when use user.signupinbackgroundwithblock i'm thinking maybe xcode updated of features while using 'block's , maybe syntax different? ideas? here's snippet of code: http://imgur.com/1cvfhbu yes!!! thank you! the new sample code getobject is: query.getobjectinbackgroundwithid("oaq79bhv53") { (gamescore: pfobject?, error: nserror?) -> void in if error == nil && gamescore != nil { println(gamescore) } else { println("error") } }

Tag system for Django -

i building quiz app user (content creator or author) can create quizzes (choice based questions , solutions) specific domain. these quiz can attempted other users (consumers - not yet implemented). to allow quiz consumers able search questions based on specific domains of interest (and add granularity quiz content), implementing tagging system attached questions. here models: class question(models.model): ques_id = models.autofield(primary_key=true) ques_text = models.textfield(max_length=1024, blank=false) ques_author = models.foreignkey('author') ques_created = models.datefield(auto_now_add=true) ques_dscore = models.integerfield() ques_bloom = models.charfield(max_length=3) ques_subject = models.charfield(max_length=3) ques_type = models.charfield(max_length=1) ques_flags = models.charfield(max_length=16) ques_quiz = models.manytomanyfield('quiz') def __unicode__(self): return self.ques_text class c

python 2.7 - Will using memcache reduce my instance memory? -

i'm running soft memory errors on google app engine app because of high memory usage. number of large objects driving memory usage sky high. i thought perhaps if set , recalled them memcache maybe might reduce overall memory usage. reading through docs doesn't seem case, , benefit of memcache reduce hrd queries. does memcache impact overall memory positively or negatively? edit: know can upgrade instance class f2 i'm trying see if can remain on least expensive while reducing memory. moving objects , memcache have no impact on memory unless destroy these objects in java code or empty collections. a bigger problem memcache entities limited 1mb, , memcache not guaranteed. first of these limitations means cannot push large objects memcache. the second limitations means cannot replace, example, hashmap memcache - it's impossible tell if getvalue() returns null because object not present or because bumped out of memcache. have make call each time dat

shell - Bash string length check- [: : integer expression expected -

i trying follow in systemd unit file. facing 2 problems here publicipaddress empty string , hence thought iplength should 0 , should not cause [: : integer expression expected error getting error. iplength seems empty every time, valid value of publicipaddress. missing ?   /bin/bash -c '\ env="/etc/environment"; \ touch $env; \ if [ $? -ne 0 ]; \ echo "****** not modify $env .. exiting .."; \ exit 1; \ fi; \ while true; \ publicipaddress=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4); \ iplength=${#publicipaddress}; \ echo "************************************$iplength..."; \ if [ "$iplength" -gt 0 ]; \ echo "************************************ hurahhhhhh .."; \ break; \ fi; \

android - WARN in logcat ResourceType: For resource ..., entry index(...) is beyond type entryCount(1) -

i getting these warnings on logcat every time app renders layout. tried search not find clue. i think related resources (drawables, strings or values) don't know causing this. it's not error, little annoying. somebody have idea? 04-22 15:28:33.204 21943-21943/xx.xxx.xxxxxxx.xxxxx.xxxxx w/resourcetype﹕ resource 0x01030128, entry index(296) beyond type entrycount(1) 04-22 15:28:33.204 21943-21943/xx.xxx.xxxxxxx.xxxxx.xxxxx w/resourcetype﹕ resource 0x01030224, entry index(548) beyond type entrycount(1) 04-22 15:28:33.204 21943-21943/xx.xxx.xxxxxxx.xxxxx.xxxxx w/resourcetype﹕ resource 0x01030005, entry index(5) beyond type entrycount(1) 04-22 15:28:33.204 21943-21943/xx.xxx.xxxxxxx.xxxxx.xxxxx w/resourcetype﹕ resource 0x01030237, entry index(567) beyond type entrycount(1) 04-22 15:28:33.204 21943-21943/xx.xxx.xxxxxxx.xxxxx.xxxxx w/resourcetype﹕ resource 0x0103000c, entry index(12) beyond type entrycount(1) 04-22 15:28:33.205 21943-21943/xx.xxx.xxxxxxx.xxxxx.xxxxx

sql - Insert into 2 tables from a single select query using TSQL -

i trying insert 3 tables 1 single select statement. here trying do: insert dbo.temp1 (name, location, city) select name, location, city mytable. i want able insert 3 tables once run select statement inserting temp1, temp2 , temp3. how can this? thanks. you can't in 1 step* what can insert initial query #temp table (or @table variable) staging area, , insert tables there. wrap steps in transaction retain acid: begin tran select name, location, city #temp mytable; insert temp1(name, location, city) select name, location, city #temp; -- same temp2 , temp3. commit tran * excluding hacks such view instead-of trigger. the staging table important concurrency point of view, repeating original query 3 times may result in different results if there interim concurrent changes source table.

xcode - Launching a specific simulator in irb using Calabash iOS -

i using calabash ios testing , when go calabash-ios console , open irb , enter start_test_server_in_background launches simulator. problem having building simulator don't want work anymore. started using 5s simulator, want build 6s when enter start_test_server_in_background . is there environmental variable needs set or 1 can pass in variable in console while entering start_test_server_in_background ? when start console can specify device_target in same way when run tests. place in front of call start console: device_target='iphone 5s (7.1 simulator)' calabash-ios console

scala - reduceByKey type mismatch -

i got list res22: array[(string, list[(string, int)])] = array((door_182,list((in,1), (in,1))), (door_89,list((in,1), (in,1), (in,1))), (door_180,list((in,1), (in,1), (in,1), (in,1))), (door_83,list((in,1), (in,1), (in,1))), (door_177,list((in,1), (in,1))), (door_23,list((in,1), (in,1))), (door_128,list((in,1), (in,1))), (door_34,list((in,1), (in,1))), (door_18,list((in,1), (in,1))), (door_32,list((in,1))), (door_76,list((in,1), (in,1), (in,1))), (door_87,list((in,1), (in,1), (in,1))), (door_197,list((in,1), (in,1))), (door_133,list((in,1), (in,1))), (door_119,list((in,1), (in,1))), (door_113,list((in,1), (in,1), (in,1), (in,1), (in,1))), (door_155,list((in,1), (in,1), (in,1), (in,1), (in,1))), (door_168,list((in,1), (in,1), (in,1))), (door_115,list((in,1), (in,1))), (door_9,list((in,1), (in,1))),... i tried sum number of in each door this: scala> reduced.map(n => (n._1, n._2)).reducebykey((v1,v2) => v1 + v2.tostring).collect i error: <console>:32: error: t

Render from/to areas in Highcharts line chart -

Image
i'm trying achieve in highcharts line chart has from/to areas. example, in chart below can see 2 from/to areas in gray (jan 2001/dec 2001 , dec 2007/march 2009 respectively). can done in highcharts? yes can added plotbands . xaxis: { plotbands: [{ color: '#fcffc5', from: 4.5, to: 7.5 }] },

iis 7.5 - N ot getting CA Siteminder SMSESSION Cookie in response -

we implementing ca site minder on external server single sign on. did necessary configuration on our server on policy server. when hit url request interrupted isapi filter , site minder replace log in page put credentials , click log in. this request goes policy server , after authenticating site minder redirect me original url hit on somehow not getting smsession cookie. i check frt log , found cookie there in request header mean site minder able generate , pass cookie request not set in response header getting removed response. i tried find why getting removed or response not setting smsession cookie not able find reason. i using integrated pipeline mode , same setup working fine classic mode since application mvc can't use , have use integrated mode. the smsession cookie not provided application siteminder. initialized in client browser after login , should included when authenticated request arrives @ application. i suggest monitoring client side ensure

java - Number Of Days in a month of particular year Not Working -

note : donot mark duplicate, know duplicate question didn't it . i want calculate number of days in month of particular year. read this , not working fine. tried following public class numofdays { public static void main(string[] args) { scanner input = new scanner(system.in); system.out.print("enter month: "); int month = input.nextint(); system.out.print("enter year: "); int year = input.nextint(); calendar mycal = new gregoriancalendar(year, month, 1); system.out.println("number of days are: " + mycal.getactualmaximum(calendar.day_of_month)); } } my console is enter month: 2 enter year: 2000 number of days are: 31 /// wrong and enter month: 10 enter year: 1999 number of days are: 30 // correct i know there 1 other method i.e. calculate manually, want above. please let me know if doing wrong. p.s: using java-8. wasn't there 31 days in march 2000? mo

Meteor on Openshift gives errors for facebook and google+ login integrations -

we have used diy cartridge install meteor on openshift using http://www.tutas-labs.com/meteor-on-openshift/ , build app, facebook , google+ login not work , following errors during loading of app in firefox browser 1) firefox can't establish connection server @ wss on facebook/google+, xhr calls happens continuously not log-in using facebook/google+ any here appreciated

nearest neighbor - How to add and remove points from a KDTreeSearcher in matlab -

in matlab, there way update data points in kdtreesearcher? i'm starting tree n data points (a.k.a observations), , iteratively search point tree, after point chosen need invalidate point until later stage. the ability build tree data (something createns) , flag points valid/invalid or enabled/disabled enough. there lot of removals (invalidations) , fewer additions (re-validations), when points invalidated process ends. i've seen similar question scikit-learn kd-tree , has no answers.

linux - Where would the CPU context interrupted by ptrace be, userspace stack or kernel stack? -

on linux x86_64, when use ptrace stop process, threads' cpu contexts saved, or process's cpu context saved? is context on process's userspace stack or kernel stack? or somewhere else? or multiple copies? for other situations (not ptrace), interrupted (including exception , syscall) cpu context saved, kernel stack, userspace stack or somewhere else? is ptrace interrupt? update it seems that, ptrace's context pt_regs_x86_t, save determined programmers. kernel stores copy interrupted context? yes, kernel store context thread not executing. context largely same whether thread being ptrace'd or not. difference in how/whether thread can scheduled anew -- if it's being ptraced, tracing process decide when can resumed. the thread's user-space context stored on kernel stack (but it's important note there separate kernel stack area each thread). , same whether thread entered kernel executing system call, or suspended due interrupt -- ,

ios - Missing return in a function - swift error in Model -

so have self generated pie chart on storyboard various labels, sliders, buttons of age, currentasset, income, etc. i'm building model struct , keep getting errors several methods have "missing return in function expected return 'double'" though can see have returns currentassetfactor, savingsfactor, bondfactor, tolerancefactor, outlookfactor. doing wrong? public struct allocationmodel { let maxage = 95.0 let currentage: double let mincurrentasset = 100000.0 let maxcurrentasset = 500000.0 let currentasset: double let minsavings = 5000.0 let maxsavings = 20000.0 let currentsavings: double let maxincomerequired = 0.04 let minincomerequired = 0.01 let currentincomerequired: double let tolerance: string let outlook: string // mark: - methods public var currentassetfactor: double { if currentasset > maxcurrentasset { return 5.0 } else if currentasset >= mincurrentasset { return double(currentasset / mi

java - Why do you have to declare "Integer int1" before I can use it in an onCreate and in a onClick method? -

there answer related this, didn't understand it.. i'm new related coding, go easy on me please. have: package com.example.robert.rekenmachine; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.view.menu; import android.view.menuitem; import android.widget.edittext; import android.view.view; import android.widget.textview; public class mainactivity extends actionbaractivity { edittext num1text, num2text; textview ans; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); num1text = (edittext)findviewbyid(r.id.num1text); num2text = (edittext)findviewbyid(r.id.num2text); ans = (textview)findviewbyid(r.id.ans); integer int1 = integer.parseint(num1text.gettext().tostring()), int2 = integer.parseint(num2text.gettext().tostring()); float ft1 = float.parsefloat(num1text.gettext

C function variable argument length -

i want pass variable argument function don't want set number in argument. check end of argument 0 below: #include <stdarg.h> #include <stdio.h> void foo(char* str, ... ) { printf("str: %s\n",str); va_list arguments; va_start(arguments,str); while(1) { double data = va_arg(arguments,double); if (data == 0) { break; } printf("data: %.2f\n",data); } va_end (arguments); return; } int main() { foo("hello", 5.5, 4.5, 3.5); } but seems out put not correct: str: hello data: 5.50 data: 4.50 data: 3.50 data: 34498135662005122837381407988349324615424289861359674446209831441373336786008345008385190019649501215393603210517859097842586295826918562939434091794406737728862534747430060032.00 the last data output random value, should not there! you solve adding sentinel value values passed. int main() { foo("hello", 5.5, 4.

css - Font not loading in Monaca onsen ui -

hi have started developing in monaca ide , can't seem implement fonts in phonegap app. @font-face { font-family: "customfont"; src: url("components/monaca-onsenui/css/font_awesome/fonts/roboto-light.ttf") format("opentype"); /* make sure defined correct path, related location of file `my_css.css` */ } body { font-family: "customfont"; font-size:30px; } this css font want use, , not implemented... can shed light on this? are sure url correct? font file loaded correctly? the following code should work: @font-face { font-family: 'roboto'; src: url('https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/font/roboto/roboto-regular.ttf'); } body { font-family: 'roboto'; font-size: '30px'; } http://codepen.io/argelius/pen/xbwzmv

using fax4j in maven java project on windows 7 -

i'm using fax4j in maven java project on windows 7. i have little code send fax. when run code program responds follow error: error code: 258 message: unable send fax. my pom.xml project have 1 dependency: <dependencies> <dependency> <groupid>net.sf.fax4j</groupid> <artifactid>fax4j</artifactid> <version>0.42.9</version> </dependency> </dependencies> and project have 1 class main this: import java.io.file; import org.fax4j.faxclient; import org.fax4j.faxclientfactory; import org.fax4j.faxjob; import org.fax4j.faxjob.faxjobpriority; import org.fax4j.faxjobstatus; public class faxtest { public static void main(string[] args) { faxclient faxclient = faxclientfactory.createfaxclient(); faxjob faxjob = faxclient.createfaxjob(); file file = getfile("fax/fax.txt"); if (file == null) { system.err.println("erro fax.txt."); return; } else { system

api - Java get metadata of public file on Google Drive -

hello i've downloaded , installed latest version of drive rest api java , want metadata of public file google drive fileid - have following code: private static final string application_name = "test"; private static final string file_id = "thefileid"; public static void main(string[] args) { httptransport httptransport = new nethttptransport(); jacksonfactory jsonfactory = new jacksonfactory(); drive service = new drive.builder(httptransport, jsonfactory, null).setapplicationname(application_name).build(); printfile(service, file_id); } private static void printfile(drive service, string fileid) { try { file file = service.files().get(fileid).execute(); system.out.println("title: " + file.gettitle()); } catch (ioexception e) { system.out.println("an error occured: " + e); } } but error message: "daily limit unauthenticated use exceeded. continued use requires signup." i'v

elasticsearch - Elastic search GET method not working -

i have created index of name gizmoindex type employee contain different documents , each 1 has automatic generated id. when executing query. example : - localhost:9200/gizmoindex/employee/_search { "query": { "filtered": { "filter": { "term": { "firstname": "gaurav" } } } } } it not giving output. if created user defined index : - "localhost:9200/gizmoindex/employee/1" using put, above mentioned query retreiving result working fine. check uri search , modified search query below curl -h localhost:9200/gizmoindex/employee/_search?pretty=1 -d ' { "query": { "filtered": { "filter": { "term": { "firstname": "gaurav" } } } } }

php - Ajax fetches data from database only once -

i working in wordpress , have drop down box , search button. , have used ajax fetch data after selecting choice drop down box. problem search button fetches data once , second time if select drop down other value , press search refreshed data not pasted. html [showmyimage] <form id="mydispimage" action="" method="post"> <select name="category" id="category" style="width:250px; background-color:lightgrey;">'; <option value="" disabled="disabled" selected="selected" ">select category</option>'; <option value="cutie pie">cutie pie</option>'; <option value="chubby">chubby</option>'; <option value="dimples">dimples</option>'; </select>; <input type="submit" id="displayimage" name="displayimage" value="search" style="margin-lef

.net - C# Variable with different amount of generic args based on some condition -

i'm not sure if title describing in best way i'll problem- have variable pabs list of 4-tuples, 5-tuples, or 6-tuples based on condition...the problem don't know 1 i'm having trouble declaring type variable. basically want this: if (condition1) pabs = loaddata() // returns list of 4-tuples else if (condition2) pabs = loaddata() // overloaded version returning list of 5-tuples else pabs = loaddata() // overloaded version returning list of 6-tuples is possible @ all? what mean 'list of n-tuples'? should list of tuple of n elements' because .net define list list<t> , many tuples tuple<t>, tuple<t1, t2>, tuple<t1, t2, t3>, ... if want variable pabs list<tuple<t1,..., t4>> or list<tuple<t1,..., t5>> or list<tuple<t1,..., t6>> . want pabs can take 3 different types. therefore can't give common type 3 different types unless object . later use bads must ask type ,

xml - How to merge elements of same name found consecutively -

please suggest how merge elements same name [element mi only] appearing consecutively. element mi [without having attributes] required merge. element mi may have parent. xml: <article> <math> <mtext>one</mtext> <mi>i</mi> <mi>n</mi> <mi>s</mi> <mi>t</mi> <mtext>the</mtext> <mi>s</mi> <mi>m</mi> <mrow> <mi>a</mi> <mi>l</mi> <mi>l</mi> </mrow> <mi>y</mi> <mn>8</mn> <mi>z</mi> </math> </article> xslt: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:template match="@*|node()"> <xsl:copy><xsl:apply-templates select="@* | node()&

Erlang ports and thread safety -

i'm looking call c function erlang process via erlang port, described here: http://www.erlang.org/doc/tutorial/c_port.html in production need multiple erlang processes calling c function in parallel, each different set of arguments. my question is, thread safe @ c function level ? the docs talk controlling erlang process creating 'connected process', sounds if responsible creating isolated instance of 'external program' (c function). so sounds it's thread safe @ c level i'd 100% sure. tia it may depend on implementation, ports, answer "yes" reason mention. if using nif , using shared memory inside of nif, have concern thread safety. with ports, however, "controlling process" acts serialization (as in arranged in series) layer, meaning requests handled 1 after other , not @ once. moreover, believe (but not know certain) communication protocol ports use requires serial execution.

Type Error Exception in Autoform (Meteor) -

i getting client side exception (below) while using update autoform. have absolutely no idea how debug issue. please note, file in collection gets created fine. exception in thrown in client side console. apologies if noob-question. client form: {{#autoform class="editf" id="editf" collection="serviceproviders" type="update" doc=selectedprovider}} {{> afquickfield name="businessname"}} {{> afquickfield name="businessdesc"}} <button type="submit" class="btn btn-primary">update profile</button> {{/autoform}} helper: template.createprovider.events = { 'submit .editf' : function(e) { event.preventdefault(); router.go('/createdprovider'); autoform.resetform('editf'); } }; collection hooks: serviceproviders.after.update(function (userid, doc) { meteor.call('updateaddressandlocation', userid, doc); }); exception: exception in

angularjs - ng-keypress inside popup.html (chrome extension) not working -

i trying use angular.js build chrome extension. in popup.html (for default popup), have input element want angular handle keypress event for, ng-keypress isn't working , not sure if missing or need workaround. i have following code in popup.html: <html ng-app="chrome-ext" ng-csp> <body ng-controller="popupcontroller"> <input type="text" class="form-control" placeholder="enter name" ng-model="vm.name" ng-keypress="vm.findname($event)" />

git - gitignore file but not folder -

i have folder named format *.*.*.*.log i want ignore *.log files entry *.log in gitignore ignoring whole folder. how ignore *.log files not *.log directories? after digging found /*.log will trick.

powershell - Remove duplicates from beginning of array -

similar removing duplicate values powershell array want remove elements array. issue is, actively work end of array want keep last instance of duplicate. | select -uniq removes duplicates come after in array. example (taken above link modified little bit): $a = @(1,2,5,3,0,4,5,6,2,7,8,9,0) $a = $a | select -uniq output $a: 1,2,5,3,0,4,6,7,8,9 but desired output i'm looking for: 1,3,4,5,6,2,7,8,9,0 essentially want leave last instance of duplicate. thank you! one option reverse array select -unique working in reverse, reverse result normalize it. $a = @(1,2,5,3,0,4,5,6,2,7,8,9,0) [array]::reverse($a) $a = $a | select -unique [array]::reverse($a) $a -join ',' 1,3,4,5,6,2,7,8,9,0

java - Will this if statement throw an exception or ignore it? -

this question has answer here: java logical operator short-circuiting 8 answers will code not evaluate divide 0 portion of if statement since first part evaluates false? if so, true cases in java ides? or compilers throw exception? int n = 0; int x = 5; if (n != 0 && x / n > 100) { system.out.println(" s1"); } else { system.out.println("s2"); } from jls §15.23 : the conditional-and operator && & (§15.22.2), evaluates right-hand operand if value of left-hand operand true. so no, not exception. obviously assumes have single-threaded or thread safe environment - if introduce visibility problems mix it's anyone's guess.

html - Bootstrap & CSS - Text incorrectly aligns with radio button when there is a word wrap -

Image
so, can't seem figure out why happening. text inside <span> correctly aligns right of radio button when there isn't word wrap. if there word wrap, entire <span> situated underneath radio button, including first line. see picture below: the first radio button text aligned correctly. text without word wrap aligns correctly. html: <div class='checkbox'> <input type='radio' id='statementbody' class='statementselector pull-left' "/> <label for='statementbody'> <span>text here</span> </label> </div> css 'pull-left' part of bootstrap: .pull-left { float: left !important; } i should add cannot eliminate <label for> , <span> tags.

javascript - D3 getting JSON data within a JSON -

using this reference. trying implement page. however, json data using has json within it. json looks similar this: { "nodes": [ {"fixed":true,"classes": null,"data": {"id": "imombr","idtype":"username","visible":true },"grabbable": true,"grabbed":false,"group":null,"locked": false,"position":null}, {"fixed":true,"classes": null,"data": {"id": "stephieru_","idtype":"username","visible":true },"grabbable": true,"grabbed":false,"group":null,"locked": false,"position":null} ], "links": [ {"source":0,"target":1,"value":1}, {"source":1,"target":0,"value":1} ] } so trying id within data text display. have tried several things seems can'

jquery - Click on LI, show/hide UL -

i trying toggle nav, can't seem figure out whats wrong code. it's pretty messy using cms has created id , class used in list menu. ideally have better name list. i have posted code on https://jsfiddle.net/chachacallis/amfmsors/1/ $(document).ready(function () { $('ul ul').hide(); $('ul li span.section_title a').removeattr("href"); $('ul li span.section_title > a').click(function (event) { $('ul ul').hide('slow'); $(this).parent().find('ul').toggle('slow'); }); }); updated if didn't want default action disable home , other items not have sub menu? how add existing code? firstly, jsfiddle did not include jquery did nothing @ all. secondly, removing href attribute a elements renders them un-clickable. if want stop link action being followed on click need use preventdefault() on raised event. finally, dom traversal incorrect. need use closest('li').

sql server - SQL SELECT DISTINCT for dynamic data -

need little if possible: got data follows , filtered , inquiryid column trying work inquiry number of booking: the last column has number of nights in trying calculate using excel 2007. the column inq_date booked nights hotel stay , in case , enquiry 2 nights. each booking has amount of lines on equals amount of nights staying for. a second booking follows: 7 lines - inquiryid = 9501 this booking 7 nights , differs first 1 above of 2 nights. in column @ end , need calculate nights , on filtered data . there 2 tables involved : booking_inquiry booking_inquiry_rooms linked on : inquiryid so far have: in sql(which works has specified specific inquiryid) select distinct count(inquiryid)from dbo.booking_inquiry_rooms inquiryid = '9501' this returns 7 i know there , need adapt clause , maybe dynamic parameter , cant life of me how... can me please? thanks, matt select inquiryid, count(*) nights dbo.booking_inquiry_rooms group i

r - keep numbers of a vector that recurr more than 3 times -

i have vectors one: c(1, 1, 1, 1, 5, 7, 7, 7, 7, 7) . do, keep elements appear more 3 times in vector. in case, obtain following vector c(1, 1, 1, 1, 7, 7, 7, 7, 7) there smart way achieve this? in advance there number of ways can this, 1 following: a <- c(1, 1, 1, 1, 5, 7, 7, 7, 7, 7) a[a %in% unique(a)[table(a)>3]] with unique(a)[table(a)>3] select elements of vector have more 3 occurrences. the rest should straightforward

java - Make JavaFX application thread wait for another Thread to finish -

i calling method inside ui thread. inside method new thread created. need ui thread wait until new thread finished because need results of thread continue method in ui thread. don´t want have ui frozen while waiting. there way make ui thread wait without busy waiting?. you should never make fx application thread wait; freeze ui , make unresponsive, both in terms of processing user action , in terms of rendering physical screen. if looking update ui when long running process has completed, use javafx.concurrent.task api . e.g. somebutton.setonaction( event -> { task<somekindofresult> task = new task<somekindofresult>() { @override public somekindofresult call() { // process long-running computation, data retrieval, etc... somekindofresult result = ... ; // result of computation return result ; } } task.setonsucceeded(e -> { somekindofresult result = task.getvalue();