Posts

Showing posts from March, 2015

Connecting Ms Access Db to Mysql through Vba -

i have been trying connect mysql database ms access no result.i don't think using dao.connection , workspace properly. keep on getting 3001 connection error when set mysqlcon . guess arguments not set following example here . function connectingmysql() dim mysqlcon dao.connection dim wrkodbc workspace set wrkodbc = createworkspace("newodbcworkspace", "admin", "", dbuseodbc) set mysqlcon = wrkodbc.openconnection("connection1", , , "driver={mysql odbc 5.1 driver};" _ & "server=testserver.com;port=3306;" _ & "database=test;" _ & "user=root;" _ & "password=pass;" _ & "option=3;") end function more infos: running ms access 2003 this msdn page says using dbuseodbc cause runtime error. odbcdirect workspaces not supported in microsoft access 2010. setting type argument dbuseodbc result in run-time error. use ado

How can I add keys to a hash variable in Ansible YAML -

i've got variable in ansible use pass environment variables task. however, i've got playbook uses role, , i'd tack more values onto variable. how can accomplish this? example, want have different oracle_home depending on type of server i'm running playbook against. --- group_vars/application.yml environment_vars: pip_extra_index_url=https://my.local.repo/pypi --- group_vars/ubuntu.yml environment_vars: oracle_home: '/usr/lib/oracle/instantclient_11_2' --- group_vars/centos.yml environment_vars: oracle_home: '/opt/oracle/instantclient_11_2' --- roles/test_role/tasks/main.yml - name: install python requirements pip: name: my_app==1.0 environment: environment_vars --- main.yml - hosts: application roles: - role: test_role --- inventory [application:children] ubuntu centos i'd way: environment_vars: oracle_home: > {% if ansible_distribution=='centos' %} /opt/oracle/instantclient_11_2

Display image on root page of the notebook in python tkinter -

Image
i designing gui window project. in want display image on notebook root page (so although tab active, image seen) have programmed in python using tkinter. didnt find way adding image on root page. code below: title = 'trial tool window' # import pmw directory tree. import sys sys.path[:0] = ['../../..'] import tkinter import pmw class mybutton(tkinter.button): def __init__(self, master=none, cnf={}, **kw): self.__toggle = 0 apply(tkinter.button.__init__, (self, master, cnf), kw) class demo: def __init__(self, parent): # create , pack notebook. notebook = pmw.notebook(parent) notebook.pack(fill = 'both', expand = 1, padx = 10, pady = 10) page = notebook.add('aaaa') notebook.tab('aaaa').focus_set() # create "toolbar" contents of page. group = pmw.group(page, tag_text = 'xyz') group.pack(fill = 'both', expand = 1, padx = 10, pady

android - Default accept "Improve Location Accuracy" popup when Google play services is updated [ROOT] -

Image
i have application installed in phones cab drivers use track location , distance traveled cab. (the phone rooted , have privileges on phone). in first implementation of our application used locationmanager.requestlocationupdates location updates gps , network providers. since need capture every kilometer traveled cab enabled "high accuracy" mode in location settings. for 2 reasons willing move fused-location-provider for reason (a known bug in android: https://code.google.com/p/android/issues/detail?id=57707 ) network_provider not providing location updates. for reason devices loses gps fix , not gaining again until device reboots. we observed fusedlocationprovider giving better results , planning change our application use fusedlocationprovider. problem - our devices have older version of googleplayservices not have locationservices. 2 options have are use older version of fusedlocationprovider using locationrequest , locationclient. though giving results out

android activity - LIBGDX screen capture gives me black or wrong result -

i'm using this method capture screen in libgdx. of time black screen. when though not capture contents of screen. have few scene2d tables not captured , of elements on screen (like fonts) flipped horizontally. i've tried solutions on internet on screen capturing black screen, or, above method, scarcely result. there chance can capture libgdx screens (loaded shaders) properly?

Animated/timed text with JavaScript return -

i have following code: function list() { return "blob1<br>blob2<br>blob3"; } when code run, directly displays whole text in return on call of function. is there way make display blob1 , wait 0.5 seconds, display blob2 , after 0.5 more seconds display blob3 ? this how might it: var stack = ["blob1", "blob2", "blob3"]; function nextitem() { document.body.innerhtml += stack.shift() + "<br>"; } nextitem(); settimeout(nextitem, 500); settimeout(nextitem, 1000);

php - restler explorer prompt viewer with REQUEST_BODY json -

i trying comment methods restler's explorer show request_body put , push values object's values. right see { "property" : "" } . what want json-formated string of object i've created insert/update: class wash_object extends \stdclass { public $completed_date=''; public $certificate_id=0; public $trailer_id=0; ... } i have been digging through documentation both restler , explorer far have not seen how tell explorer fill in text field under value request_body . comment handles little trick? you have decorate function parameters want populated in field. don't necessary need use parameters if you're reading them $request_data. /** * updates item * * @url put / * * @param array $request_data * @param string $completed_date * @param int $certificate_id * @param int $trailer_id * * @return mixed */ public function put($request_data, $completed_date,

Continuing script after failure on os.system call python -

i have script have written scan directory of text files , if finds them, creates system call run script on txt file. still working on couple little bugs causes of system calls fail. like, however, not kill script. informed of error move on life. seems successful call returns 0 while call resulted in error returns n. tried compare result 0 never gets far. suggestions on how can accomplish this?? import sys, getopt, os def main(argv): def scan_dir(path): temp_path = path print temp_path file in os.listdir(path): temp_path += file if file.endswith(".txt"): result = os.system("python callscript.py -i %s" % path) if result != 0 print "error!" temp_path = path def usage(): print "usage: dostuff.py [hi:]\n \ \t -h\t print us

angularjs - In Angular, is there a way to communicate imperatively to a directive? -

what know i have custom directive isolate scope. "outside", can communicate to directive using declarative bindings (via @ , = bindings). directive can communicate to outside using either declarative bindings ( = ) or imperative callbacks ( & ). what i'd know is there imperative way communicate to directive ? example say have <edit-profile> directive. i'd expose method reset() , owner of directive can reset directive (imperatively). here's i'd it: <edit-profile on-save="..."></edit-profile> <button ng-click="editprofile.reset()"> reset </button> and here's directive: app.directive("editprofile", function() { return { restrict: "e", scope: { onsave: "&" }, template: ` <input type="text"> <button ng-click="onsave()"> submit </button&g

java - When using Mokito, what is the difference between the actual object and the mocked object? -

in program below, trying use mockito junit in test case. don't see how mokito helping create objects test? don't see special here seems if mokito instantiating object. public class testcase1{ @mock myclass myclass; public void setup(){ mokitoannotations.initmoks(this); } @test public void testaddition(){ when(myclass.add(2,2)).thenreturn(20); assertequals(4,myclass.add(2,2)); } } my actual class ( myclass.java ) public class myclass{ public int add(int x, int y){ return x+y; } } is mocking object, same injecting(di) object? appreciate help! your test doesn't test of code. tests mockito works fine. when introduce concept of mocking, take example: suppose build detonator, , want test it. of course use detonator real bomb, , see if whole block explodes when use detonator. isn't practical. btw, maybe don't have bomb @ disposal. maybe c

spring - "Error: HttpStatus cannot be resolved to a variable" How to resolve This? -

i getting error in below code @ line 2: @responsestatus(httpstatus.ok) . error is: " httpstatus cannot resolved variable ". imports required this? missing necessary jar file? help? @requestmapping( value = "/{id}", method = requestmethod.get ) @responsestatus(httpstatus.ok) @responsebody public string validateuser( @pathvariable( "id" ) string id){ return "user validated" } add: import org.springframework.http.httpstatus;

java - JPA EclipseLink Custom Entity/Object as IN Parameter -

i have stored procedures working when pass in basic java objects (string, long, etc.) cant seem pass in own entity/object without getting following error: exception [eclipselink-4002] (eclipse persistence services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.databaseexception internal exception: java.sql.sqlexception: invalid column type error code: 17004 call: begin sar_ops.input_rule_no_response(operation_id_in=>?, executing_usr_id_in=>?, rule_obj_in=>?, success_ind_out=>?, error_cur_out=>?); end; bind => [mo1234abcd, test, rule [id=99999, last_updated_by=mike], => success_ind_out, => error_cur_out] query: resultsetmappingquery(name="input_rule_no_response" ) from reading thought code work (see below). added @struct annotation , gave name of matching oracle object database. under impression eclispelink documentation need @embeddable , @struct annotations on class, have added @entity annotation whilst testing theory still

javascript - jQuery toggle state changes upon refresh -

i looked through older questions , learnt solve issue need implement cookies , somehow remember states. being new jquery, turning out little tricky me implement this. here javascript code: $(document).ready(function(){ $('.trthjobstatus caption').click(function() { $('.trthjobstatus th,.trthjobstatus td').slidetoggle('1000'); }); }); anyone knows how can use cookies remember state , avoid toggle state change when page refreshed? thanks in advance! i'm big fan of using localstorage on cookies, particularly if have application needs device agnostic. note code below not reset localstorage var when it's no longer needed. $(document).ready(function(){ if(localstorage['trthjobstatus']){ $('.trthjobstatus th,.trthjobstatus td').slidetoggle('1000'); } $('.trthjobstatus caption').click(function() { localstorage['trthjobstatus'] = true; $('.trth

java - returns null while returning from nested loop -

i returning array string[] data, returns null. tried store array in data[] not worked, have values in strings(name,phone,temp,password) cant return.. public string[] searchuserdata(string email) { string[] data= null; string temp,name,phone,password; if (cr.movetofirst()) { { temp = cr.getstring(2); if (temp.equals(email)) { //data[0]= cr.getstring(1); //data[1]= cr.getstring(2); //data[2]= cr.getstring31); //data[3]= cr.getstring41); name = cr.getstring(1); phone = cr.getstring(3); password = cr.getstring(4); log.i("values", name+" "+phone+" "+email+" "+password); } } while (cr.movetonext()); cr.close(); } db.close(); return data; } writing string[] data = new string[4]; start off. this gives 4 elements in data arr

c# - StringFormat, ConverterCulture, and a textbox's decimal mark -

i'd resolve small quirk i've been having. it's not quirk rather behavior i'd change if possible. if use {n:2} stringformat/converterculture, textbox forced having decimal mark always (even during process of inputting text). mean, can't delete dot or comma @ all, must able figure out have move next "field" of number in order edit decimal points either clicking mouse there or pressing "right". since that's uninituitive users, there way avoid without resorting rewriting formatters? hope simple in framework of existing properties. example, xaml textbox bound datagrid's cell, <textbox name="textbox1" height="18" margin="0,0,10,0" text="{binding selecteditem[1], converterculture=en-us, elementname=grid1, stringformat={}{0:n2}, updatesourcetrigger=propertychanged}" width="59" textalignment="right" verticalalignment="center" /> added remarks after answe

how to list modified files by a certain user in a branch while excluiding all xml files using GIT? -

i have issue, working in project git. when feature takes time update develop branch(its kind of gitflow) , later merge changes develop feature branch. it works fine , all. but once done this, history of commits merged , commited feature branch appear there. example: did 2 commits, after updated , merged branches, @ branch history appear first 2 commits , other n commits made other users since merged , commited branch... appear there. how can list commits made me? there way in stash well? and dont know if there way without showing type of file? you can use squash concept merge commits single signature. instance if have 5 commits in dev branch merging them squash show 1 commit in feature branch. git merge --squash

guava - Create Multimap from Map<K,Collection<V>> with key as V[0] and value as K using Java 8 -

i have map<string,list<string>> (say inputmap) , want convert map<string,list<string>> each (k,v) in new map (v.get(0),k) of inputmap. ex. x -> b,c,d y -> b,d,e z -> b,g,h p -> a,b,d q -> a,d,f r -> a,c,b to b->x,y,z a->p,q,r i thought using like inputmap.entryset().stream().collect(collectors.tomap(map.entry::getvalue.get(0),map.entry::getkey)); and converting map multimap, cannot write map.entry::getvalue.get(0) it great if create multimap in .collect() itself. you can collect directly multimap : multimap<string, string> result = inputmap.entryset().stream() .collect( arraylistmultimap::create, (mm,e) -> mm.put(e.getvalue().get(0), e.getkey()), multimap::putall );

javascript - I am facing conflict in jquery ui tooltip and bootstrap.js, so I put the below solution as suggested for new alias and getting the error :- -

alias change- : $.widget.bridge('uitooltip', $.ui.tooltip); now getting error while calling jquery tooltip new alias: uncaught error: cannot call methods on uitooltip prior initialization; attempted call method 'option'... here code snippet using :- $(this).uitooltip( "option", "content", ""+ $(this).attr("data-content") ); where data-content works , commenting above part well. the order of things essential... <script src="js/jquery-1.11.1.js"></script> <script src="js/jquery-ui.js"></script> <script> // handle jquery plugin naming conflict between jquery ui , bootstrap $.widget.bridge('uibutton', $.ui.button); $.widget.bridge('uitooltip', $.ui.tooltip); </script> <script src="js/bootstrap.js"></script> first must come jquery ui, call $.widget.bridge , , include of bootstrap.js then init

c++ - How to define an implicit conversion from double? -

i have defined class complex overloads + operator: complex operator+(complex const& x, complex const& y); i want define implicit conversion double complex , such that, example, if write c + d , c complex , d double , call overloaded + defined above , return complex . how can this? you need define constructor it. referred "converting constructor" complex::complex(double x) { // conversion } this allow implicit conversion, long don't use explicit keyword, force have use cast convert. you can define other versions of operator+ complex operator+(complex const& x, double y); complex operator+(double x, complex const& y);

Sharing an object in simperium, write_access doesnt do anything -

i have created 2 users, , if create bucket 1 user , object inside bucket can share using http api @ moment.. see here https://simperium.com/docs/reference/http/#objectshare however, when sent through "write_access" = true , 200 result, doesnt seem let me write it. if enable sharing other way allows data sync both ways, doing wrong? has collaboration got further yet? can see there long no docs yet? know? after more trial & error, found solution: to edit shared object, target user (ie user object shared with) needs use objectid equal to: <original_user_simperiumid>/<original_objectid> edit object. if use <original_objectid> won't work. so full command editing shared object, using curl: curl -h 'x-simperium-token: {auth_token_of_target_user}' https://api.simperium.com/1/{appid}/{entity}/i/{original_user_simperiumid>/{original_objectid} -d '{"data_key" : "new_data_value"}'

ios - Generated subview is always behind image view -

viewcontroller.m -(void) viewdidload { [super viewdidload]; [self addscorerowviewwithindexleft:(++i) andname:[scoredict objectforkey:@"name"] andscore:[[scoredict objectforkey:@"points"] integervalue]]; } -(void) addscorerowviewwithindexleft:(nsinteger)index andname: (nsstring *)name andscore: (nsinteger)score { uiview *scorerowview = [[uiview alloc] initwithframe:cgrectmake(128, 112 + index * 80, 280, 20)]; uilabel *indexlabel = [[uilabel alloc] initwithframe:cgrectmake(20, 20, 20, 20)]; uilabel *namelabel = [[uilabel alloc] initwithframe:cgrectmake(150, 20, 180, 20)]; uilabel *scorelabel = [[uilabel alloc] initwithframe:cgrectmake(330, 20, 50, 20)]; uicolor *color = [uicolor darkgraycolor]; [indexlabel settext:[@((int)index) stringvalue]]; [indexlabel setfont:[uifont fontwithname:@"dinalternate-bold" size:18]]; [indexlabel settextcolor:color]; [namelabel settext:name]; [namelabel

How do I find any string Perl? -

i new @ perl , i've got problem. find string in part of code: my $change = $item->look_down( _tag=> 'td', class => 'colzmiana change ' #????? ); in html code, there colzmiana change up , colzmiana change down or colzmiana change . class => find every colzmiana change . could me ?

security - Django user login through api -

this question has answer here: django rest framework - understanding authentication , logging in 1 answer i want create login form users sign django site. site set using django rest framework , considering having login form make request through site's api. in past have used standard django form user logins. concerned if new login form sends request through site's api instead, there might security vulnerability of sort. don't know if true, or issue security might be. should stick django forms authenticating users? or safe sign users in through api? keep in mind using django form allow use sessionauthentication under drf - more notes here. short of use django loginviews when creating login pages, , notes on using csrf tokens if use session auth drf. http://www.django-rest-framework.org/api-guide/authentication/#sessionauthentication how res

c# - AutoCompleteStringCollection with TextChanged Event -

i'm using text box filter entries. have display updating on text box textchanged event, user isn't hitting enter or pressing button begin filtering. want use autocompletestringcollection remember entries typed text box; however, if save every string text box when textchanged event fired store substrings of each filter term. so instance, if typed string "test" display: "t" "te" "tes" "test" recommended strings. want last string added autocompletestringcollection. i've thought 2 separate methods implement. 1) create task waits "x" amount of time after last textchanged event before adds string autocompletestringcollection. if did have use cancellationtoken cancel task every time textchanged event fired. more complicated because i'm using .net 4.0. 2) search through autocompletestringcollection every time string added , remove substrings (that start @ beginning of word). may backfire if user ty

html - Php Static Page -

i try create user profile page. visitor can see page www.sample.com/details.php?id=1 <?php foreach($db->query('select * uyeler') $row) { echo "<tr><td>" .$row['id'] . "</td>"; echo "<td>" .$row['username'] . "</td>"; echo "<td>" .$row['sex'] . "</td>"; echo "<td>" .$row['country'] . "</td>"; echo "<td>" .$row['age'] . "</td>"; echo "<td>" .$row['twitter'] . "</td>"; echo "<td>" .$row['instagram'] . "</td>"; echo "<td>" .$row['snapchat'] . "</td>"; echo (&

solr - Still seeing old shard after calling SPLITSHARD -

Image
i called splitshard, , see after posting commit: i thought splitshard supposed rid of original shard, shard1, in case. missing something? expecting 2 remaining shards shard1_0 , shard1_1. the rest call used /admin/collections?collection=default-collection&shard=shard1&action=splitshard if helps. response solr mailing list: once splitshard call completes, marks original shard inactive i.e. no longer accepts requests. yes, have use deleteshard ( https://cwiki.apache.org/confluence/display/solr/collections+api#collectionsapi-api7 ) clean up. as far see on admin ui, information wrong i.e. ui not respect state of shard while displaying them. so, though parent shard might inactive, still end seeing active shard. there's open issue one. one way confirm shard state looking @ shard state in clusterstate.json (or state.json, depending upon version of solr you're using).

javascript - Programmatically both start and kill a web browser using Node.js -

how can programmatically both start , kill web browser using node.js? pseudo-ish code so: var spawn = require('child_process').spawn; // opens browser , returns control terminal, optimally // process should run in foreground , exit on ctrl-c. spawn('open', ['http://www.stackoverflow.com']); process.on('sigint', function() { // kill opened browser here }); you can use "spawn" https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options also, reference: https://stackoverflow.com/a/16099450/4130451 to kill: https://nodejs.org/api/child_process.html#child_process_child_kill_signal

visual studio 2013 - Azure worker role gets published with the wrong service configuration -

Image
i'm trying "publish azure" functionality in vs2013 going worker-role cloud-service project. the problem i'm having no matter change service configuration settings application deployed local service configuration my .azurepubxml: <?xml version="1.0" encoding="utf-8"?> <project toolsversion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <propertygroup> <azurecredentials>{"servicemanagementendpoint":"https:\/\/management.core.windows.net\/","subscriptionid":"redacted"}</azurecredentials> <azuredeletedeploymentonfailure>false</azuredeletedeploymentonfailure> <azuredeploymentlabel>myworkerrole</azuredeploymentlabel> <azuredeploymentreplacementmethod>automaticupgrade</azuredeploymentreplacementmethod> <azureslot>staging</azureslot> <azureenableremotedesktop>

r - Loading 83mb RData Object from twitteR Package -

i have 83.356mb rdata file contains 1 list object. list object has 10 elements, each of "status" object, created when querying twitter api using twitter package. when tried load object yesterday, waited half hour , still did not load. when left on night, crashed r. so sum up, unable load rdata file r. didn't think 83mb large, , believe way under memory limitation of r, don't understand why not loading.

jsp - Using <s:set /> to dynamically build element's name -

i want reuse set of html field elements , have struts build 'name' attributes variable. saw how generate unique html id attributes within struts 2 iterator tag , figured use similar can't work. seems can build name attribute struts variable in iterator loop. how can simple variable instead? here code, first trying use variable, second using iterator : <s:set var="type" value="main" /> <s:textfield name="prefix%{#type}.name"/> <s:set var="alist" value="{'main'}" /> <s:iterator value="alist" var="ltype"> <s:textfield name="prefix%{#ltype}.name"/> </s:iterator> this generates 2 elements : <input type="text" name="prefix.name" value=""> <input type="text" name="prefixmain.name" value=""> with first not substituting variable, , iterator loop working. why doesn&

excel - How to match data between sheets using loops -

okay breakdown. i have 2 sheets. 1 sheet (order_lvl) has original data order numbers going down rows , "line numbers" locations integers of line in corresponding cells. i'm trying populate other sheet (sheet1) same order numbers going down rows, location numbers (1-246) column headers (essentailly values within cells of order_lvl becoming column headers of sheet1). within corresponding cells want put "1" if order_lvl indicates order features line location , "0" if not. this have populating data , keep getting error saying "object not support propety or method" @ line if statement" sub populatedata() dim s1 excel.worksheet dim s2 excel.worksheet set s1 = sheets("order_lvl") set s2 = sheets("sheet1") dim orderrows range dim lastrow integer lastrow = s1.cells(rows.count, 1).end(xlup).row set orderrows = range("b2" & lastrow) dim irow variant each irow in orderrows dim j variant each j in s1.ra

How to use Tika via PHP when both installed on one server? -

i need make internal website allows users upload .doc, .pdf, .xls files , see text in textarea box. i have created site in php point user can upload files. i have installed tika on server , @ command line can type java -jar tika-app-1.10-snapshot.jar -m manu.pdf > output.txt creates text need in output file. what best way call tika php in order plain text of uploaded file php? searching around find: php code makes calls "tika server" e.g. curl php wrapper classes tika seem use tika on same server php installed on, have not gotten of them work. alternatively, call tika via exec command. but i'm not sure easiest way proceed. if on own managed servers, , both php , tika locations known you, use exec . or if prefer better control (which suspect not need) use shell_exec if have performance issues, and/or need scale thing, there room more elaborate solution.

inheritance - Inheriting defaultProps from superclass in React -

i think props , (for example, theme ), universal among components makes sense extract handling (to superclass). follows default value belongs there. however, idionatic way achieve in react? class base extends react.component { bgcolor() { switch (this.props.theme) { case 'summer': return 'yellow'; break; case 'autumn': return 'grey'; break; case 'winter': return 'white'; break; } } } base.defaultprops = { theme: 'autumn' }; class sky extends base { render() { return <div style={{backgroundcolor: this.bgcolor()}}>{this.props.clouds}</div>; } } sky.defaultprops = { clouds: [] }; ... defaultprops class property (as opposed instance ), , there no inheritance. by assigning sky.defaultprops hide base ones. if want combine them, you'd need explicitly that, e.g. sky.defaultprops = object.assign({}, base.defaultprops, { clouds: [] });

How to remove the Java icon at JavaFX application start? -

i'm having trouble start of javafx application. when loading application icon in windows taskbar java icon instead of own icon split second. @override public final void start(final stage stage) { maincontroller controller = new maincontroller(); scene scene = new scene(controller.getroot()); stage.settitle("geex"); stage.geticons().addall( new image(app.class.getresourceasstream("/application/images/icon_16.png")), new image(app.class.getresourceasstream("/application/images/icon_32.png")), new image(app.class.getresourceasstream("/application/images/icon_48.png")), new image(app.class.getresourceasstream("/application/images/icon_64.png")), new image(app.class.getresourceasstream("/application/images/icon_128.png")), new image(app.class.getresourceasstream("/application/images/icon_256.png")) ); stage.setscen

Program solving equation in Assembly -

i have problem simple program in assembly. i'm using dosbox , tasm . have problem program. operand types not match @ line 76 78 80 . after multiplication. tried make changes using difftrent variable size ; -------------------------------------------- ; equation=(a+c*b)/d-2*c, ; -------------------------------------------- .model small .stack 100h .data db 0 b db 0 c db 0 d db 0 result1 db ? result2 db ? message1 db "equation: (a+c*b)/d-2*c a=$" message2 db "b=$" message3 db "c=$" message4 db "d=$" message5 db "result=$" .code start: mov ax,@data mov ds,ax mov ax, seg message1 ;get , save variable mov ds,ax mov dx,offset message1 mov ah, 9h int 21h

maven - Whats the difference between spring-framework-bom and platform-bom? -

ive been experimenting spring bom , note there 2 build managers - spring-framework-bom , platform-bom <dependencymanagement> <dependencies> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-framework-bom</artifactid> <version>${spring.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencymanagement> or <dependencymanagement> <dependencies> <dependency> <groupid>io.spring.platform</groupid> <artifactid>platform-bom</artifactid> <version>1.1.2.release</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies

how can I reliably stream data out of a matlab program? -

i have create matlab program gets , transforms streaming data receives sensor. needs, in turn, push out output data stream, application. there matlab command/api can used piping out continuous output stream matlab? http? process piping? other? you can stream using udp, it's really crappy. have had many issues this. not not able stream 1 megabyte / second of float data without dropping packets left , right. switched open source program octave http://www.gnu.org/software/octave/ matlab compatible (your .m code runs is) , can handle fast udp streams way better. if doing sensor control should stick tcp.

php - The class 'Doctrine\ORM\EntityManager' was not found in the chain configured namespaces XXX -

i have read the other questions concerning issue have not come across solution of yet. i following error message: the class 'doctrine\orm\entitymanager' not found in chain configured >namespaces zfcuser\entity, common\entity, employment\entity, intern\entity, >team\entity, purchaserequest\entity. i have holidayentity, holidaycontroller, holidayservice. adding holiday works, when try remove holiday error pops up. pass holiday id controller service, fetches associated object , runs doctrine 2 removeentity command. i unsure how tackle problem @ moment. controller code: public function deleteaction() { $holidayid = $this->params()->fromroute('id', 0); try { $this->getservicelocator()->get('holidayservice')->removeholiday($holidayid); } catch (exception $e) { $this->flashmessenger()->adderrormessage($e->getmessage() . '<br>' . $e->gettraceasstring()); } return $

objective c - Lazy-loading and thread-safe dictionary -

i use pattern: @property (nonatomic, readwrite, strong) nsmutabledictionary * mutabledictionary; [...] - (id)objectforkey:(nsstring *)key { id result = self.mutabledictionary[key]; if (!result) { result = [...] ; // go , fetch result; self.mutabledictionary[key] = result; } return result ; } but realized not thread-safe. have similar lazy-loading pattern thread-safe. what best way achieve that? i use nslock objects. easy use. wrap setter of mutabledictionary in it. @property (nonatomic, readwrite, strong) nsmutabledictionary * mutabledictionary; nslock *mutexlock = [nslock new]; [...] - (id)objectforkey:(nsstring *)key { id result = self.mutabledictionary[key]; if (!result) { [mutexlock lock]; result = [...] ; // go , fetch result; self.mutabledictionary[key] = result; [mutexlock unlock]; } return result ; } update: assumes in //go fetch results not thread safe.

ios - MKMapSnapshotter completionHandler never called in parent app when called from WatchKit -

i have weird issue: call parent app openparentapplication:reply: normal. it nicely doing job getting data internet using async nsurlrequests when want map image using mkmapsnapshotter (still in parent app) completion block never called. mkmapsnapshotter *snapshotter = [[mkmapsnapshotter alloc] initwithoptions:options]; [snapshotter startwithcompletionhandler:^(mkmapsnapshot *snapshot, nserror *error) { nslog(@"completion handler called"); //this never called }; i tried call with: snapshotter startwithqueue: on dispatch_get_global_queue(dispatch_queue_priority_background, 0) or dispatch_get_main_queue() etc. nothing seems work. if call same code directly wkinterfacecontroller or parent app works fine. i don't think can call/use mkmapsnapshooter way wanting to. when use openparentapplication make request, opening parent app in background mode , mkmapsnapshooter requires foreground mode deliver final image. as per apple docs: the sn

Is it possible to run gulp-notify in a watch task? -

i'm putting gulpfile , wondering if can combine gulp-notify (or other solution) watch task message pops when watch task has started running. can't find searches on how go doing this. possible? here's watch task: // watch our files changes gulp.task('watch', function() { // -- wanna run notify message here saying 'watching changes...' -- // gulp.watch('assets/styles/**/*.scss', ['styles']); gulp.watch('assets/scripts/**/*.js', ['scripts']); gulp.watch('assets/images/**/*', ['images']); }); i managed gulp-notify , node-notifier. after gulp tasks pipe notifier , in callback use node-notifier show popup. var notify = require('gulp-notify'); var nodenotifier = require('node-notifier'); gulp().src(options.src) .pipe(gulp.dest(options.dest)) .pipe(notify(function () { nodenotifier.notify({ 'title': 'app', 'message': 'build&#

asp.net web api - How to read header in controller constructor -

is possible read header authorization in controller constructor? , how? , best solution (reading header value in controller constructor) achieve goal ? the following code of classes inherit interface: public interface iprovider { string senddata(string data); //other methods } public class firstprovider : iprovider { private string _url; public firstprovider(string url) { _url = url; } public string senddata(string data) { //send data first provider website (_url) //return result } } public class secondprovider : iprovider { //some code } and following api controller: public class providercontroller : apicontroller { private iprovider _provider; public providercontroller() { //read authorization key headers (how??) string authtoken; //fetch database/cache provider use based on authorization key var provider = providers.getprovider(authtoken); //initializ

c# - One file of the project does not seem to be under source control -

Image
vs2012 pro , tfs: file used under source control , icons next think showing when make change , right click option " undo pending changes" disabled. other files in same project working fine. here screen shot: file issue service.asmx.cs the red check mark next file indicates under source control , checked out. file generated service.asmx file , perform source control changes "undo pending changes" have make operation on service.asmx file. whatever change make cascade generated file. if in doubt source control status of file can locate in source control explorer can perform operations on individual files though files linked in visual studio. however, unless know doing highly recommend stay in visual studio when working files linked this.

scroll - tableViewUi cell subtitle shows sometime -

i having issue uitableviewcell. when table view loads, of cell not have subtitle. aldy set style of cell subtitle. weird part when scroll , down, missing parts appear again other cells missing table subtitle. here code cellforrowatindexpath let cell = tableview.dequeuereusablecellwithidentifier(cellidentifier, forindexpath: indexpath) as! uitableviewcell cell.layoutmargins = uiedgeinsetszero cell.preservessuperviewlayoutmargins = false let polist = self.polist[indexpath.row] if(polist.poshort == "header"){ cell.backgroundcolor = sharedclass().coopgroupheadercolor let selectedcolor = uiview() selectedcolor.backgroundcolor = sharedclass().coopgroupheadercolor cell.selectedbackgroundview = selectedcolor cell.textlabel?.textcolor = uicolor.blackcolor() cell.textlabel?.font = uifont.boldsystemfontofsize(18.0) cell.textlabel?.textalignment = .left cell.accessorytype = .none let t_header =

javafx - CheckComboBox choices are empty -

hi learning javafx , want create dropdown multiple select. think need use checkcombobox. implement did no show elements. here`s code: in fxml : <checkcombobox fx:id="keywordbox" layoutx="233.0" layouty="240.0" prefheight="25.0" prefwidth="131.0" /> in controller: @override public void initialize(url location, resourcebundle resources) { final observablelist<string> strings = fxcollections.observablearraylist(); (int = 0; <= 4; i++) { strings.add("item " + i); } keywordbox = new checkcombobox<string>(strings); keywordbox.getcheckmodel().getcheckeditems().addlistener(new listchangelistener<string>() { public void onchanged(listchangelistener.change<? extends string> c) { system.out.println(keywordbox.getcheckmodel().getcheckeditems()); } }); } and dropdown empty. idea? you creating new checkcombobox instead of using 1 fxml. re

php - How to get value by value of an array -

i got problem, got array sql query , want associate each value of array index value. array(16) { ["nocommande"]=> string(5) "49083" ["datecommande"]=> string(19) "2007-02-21 18:24:04" ... so here want each value 1 per one. array[i] doesn't work bit in trouble. thanks support. you can iterate below:- foreach($your_array $key=>$value){ echo $key.'-'.$value; echo "<br/>";//for new line show in manner } it output :- nocommande - 49083 , etc.

cordova - Access SharePoint on-premise with a token obtained from Azure AD and ADAL -

the goal access on-premise sharepoint data rest requests mobile application based on apache cordova using oauth. what have tried far 1. azure mobile services / hybrid connection / aad / adal similar blog post access sharepoint on behalf of user , on-premise server instead of o365: client side log-in using adal apache cordova . mobile service connected on-premise server through hybrid connections. using adal.net acquire token sharepoint server using token obtained in step 1. this works fine except step three, since there no sort of connection between on-premise server , aad, hence no token can acquired. 2. same above plus azure application proxy we've setup azure application proxy described kirk evans in post . azure ad application mobile service given access permission application application proxy (in same azure ad tenant). now steps 1 3 working fine. we've been able obtain token using application proxy url resource. we've tried execute rest reque

java - How to create war file in eclipse with all the necessary dependencies without maven or ant -

Image
i saw lots of questions including 1 : how create war file in eclipse without ant or maven? i have standard web project created eclipse. in web project many others there isn't jsp , web files, java files also. using eclipse luna , trying export project war when use export option , package war packages web content. after deploy tomcat fails on login in site because there no java files on war. new web projects , not want use maven or ant. want make working war eclipse , not find normal way that. right click on web project --> export --> war file --> choose destination path , select on export source files. see below screen shot: after creating excel2db22.war. have imported again ide. can see files including java in project. see below ss: i hope you.

ajax - Why FullAjaxExceptionHandler does not simply perform an ExternalContext#redirect()? -

in omnifaces, fullajaxexceptionhandler , after having found right error page use, calls jsf runtime build view , render instead of page includes ajax call. why this? imho simpler perform externalcontext#redirect() ? there specific reasons this? we writing our own exceptionhandler based on fullajaxexceptionhandler , wanted understand reason behind design. the primary goal of fullajaxexceptionhandler let exceptions during ajax requests behave exactly same exceptions during non-ajax requests. developer must able reuse error pages across both conditions without worrying condition while implementing error pages. a redirect isn't part of normal flow during non-ajax requests. default <error-page> mechanism in web.xml performs forward display error page, not redirect. if redirect performed, error page request attributes such javax.servlet.error.exception lost , render null . moreover, normal practice place error pages in /web-inf prevent endusers being able d

javascript - Masonry layout bug on Safari, using a Wordpress site -

i'm stumped. use masonry on wordpress site, , looks fine on major browsers except safari. here article link, example: masonry article apple watch on wordpress site on safari div items squashed up, , have no idea why. i've deactivated plugins, made no difference i've tried using position:absolute; inside div item, blocks overlapped i've tried vertical-align:top; inside div item, made no difference any appreciate. stumped on one...thanks! as @dcardoso mentioned, item class backface-visibility style causing issue. seems adding transform forces safari correctly render item. -webkit-transform: translate3d(0,0,0);

asp.net mvc - pass a DateTime value using Jquery to Action method -

i trying pass datetime value using jquery controller showing me error the parameters dictionary contains null entry parameter 'fromdate' of non-nullable type 'system.datetime' method 'system.web.mvc.actionresult report(system.string, system.string, system.datetime, system.datetime, int32, int32, int32)' while debugging getting value. generating report can not able sort out . please problem. view <a href="@url.action("report", new { id = "pdf" })" class="btn-primary" id="exportbutton"> export pdf&nbsp;<i class="glyphicon glyphicon-print"></i></a>&nbsp; @html.textboxfor(m => m.fromdate, new { @readonly = true, @class = "date-picker form-control" }) @html.textboxfor(m => m.todate, new { @readonly = true, @class = "date-picker form-control" }) $('#exportbutton').click(function () { var accounttype =