Posts

Showing posts from June, 2012

arduino - Teensy 3.1 keyboard script execution -

i'm trying program teensy 3.1 keyboard, , i'm using example https://www.pjrc.com/teensy/td_keyboard.html . int count = 0; void setup() { } // no setup needed void loop() { keyboard.print("hello world "); keyboard.println(count); count = count + 1; delay(5000); } i uploaded script teensy , script execution starts immediately. problem after if unplug teensy , plug second time, nothing happening. know doing wrong? you're not doing wrong; expected behavior. the documentation states: you may notice "hello world 0" not appear. pc takes brief time detect presence of new usb device, program begins running immediately. if use keyboard.print() before pc finishes detection process (called "enumeration" in usb lingo), keyboard.print() nothing. the remedy stated is: a delay() can added in setup(), if necessary. suggest put nice long delay in setup() give pc time recognize keyboard.

Call someone with Twilio then disconnect me and play a message to other person -

i'm trying create button on webpage (on presonal php webserver) should connect me (either call cellphone or via webclient), call number, want have options either hangup call, or disconnect me play mp3 other person , hangup. i'm not sure how go it. created twiml, how connect existing call? or there different way it? <?xml version="1.0" encoding="utf-8"?> <response> <play>https://something-something.twil.io/assets/recording1.mp3</play> <hangup/> </response> thanks in advance. i think you're trying do. have list of people you're trying call. app call them , connect you. if hear answering machine, want press key hangup , move on next call. after hang up, first outbound call stays online , leaves .mp3 message recipient? i believe 1 solution creating conference bot. your app makes outbound call you, bot , recipient , puts conference room called "room-timestamp" timestamp current time.

vsto - Cannot enable a Ribbon button programmatically -

i developed vsto 4 add-in excel. works perfect, however, have button placed in custom tab of ribbon control disabled. after clicked other ribbon button in custom tab, need enable disabled button. i tried with: btncancelar.visible = true; in click event of button, button not shown. strange thing when debugging, still not appear, if messagebox shown, button visible @ last. i don't understand behaviour. how can enable or disable ribbon button dynamically code? i'm not sure language used in project, guess can tranform own language used. i'll show example here in c#: first need implement called callback function in ribbonxml definition: <button id="buttonsomething" label="content" size="large" getvisible="enablecontrol"/> then next step implement callback function: public bool enablecontrol(iribboncontrol control) { return true; // visible ... false = invisible } vsto trigger getvisible callback

typescript - error TS2304: Build:Cannot find name 'Iterable' after upgrading to Angular 4 -

i using typescript 2.4.1 , have upgraded many packages in project. among them upgraded angular 2 4.3.1. after many corrections in @types packages, errors left are: \node_modules\@types\jquery\index.d.ts(2955,63): error ts2304: build:cannot find name 'iterable'. \node_modules\@types\three\three-core.d.ts(767,24): error ts2304: build:cannot find name 'iterable'. \node_modules\@types\three\three-core.d.ts(771,24): error ts2304: build:cannot find name 'iterable'. \node_modules\@types\three\three-core.d.ts(775,24): error ts2304: build:cannot find name 'iterable'. \node_modules\@types\three\three-core.d.ts(779,24): error ts2304: build:cannot find name 'iterable'. \node_modules\@types\three\three-core.d.ts(783,24): error ts2304: build:cannot find name 'iterable'. \node_modules\@types\three\three-core.d.ts(787,24): error ts2304: build:cannot find name 'iterable'. \node_modules\@types\three\three-core.d.ts(791,24): error ts2304: buil

iis - IIS6 server not allowing ncftpget to download files recursivelly -

Image
i'm working on old windows 2003 server iis 6.0. there's ftp site in production on server , had need add 1 did using virtual directory. can manually login, navigate several directories deep , download files 1 @ time without errors thrown. however, when try download recursively it's grabbing files , folders in root of remote directory specify. have same directory structure running on windows 2003 server , have no problems downloading recursively using same batch script i'm sure issue not that. i'm @ complete loss next. have verified user i'm logging in has windows rights entire directory structure, enabled anonymous access , set iusr account have full control on entire directory tree well, no luck. i should mention there no error messages returned either. have looked @ log file on server , no errors shown there either, record of each file , folder downloads, no reference ones skipping. client i'm using download ncftpget if curious. i'm using in appli

cordova - Meteor app does not update Meteor.settings after a hot-code-push on Android app -

i have app deployed on galaxy , have mobile versions (android , ios) well. i noticed today if change meteor.settings file , redeploy galaxy, trigger hot-code-push on mobile devices expected. problem when app reloads after hot-code-push process finished, don't see new values meteor.settings on android. app reloads meteor.settings files still old one. see new values have close mobile app , open again. means reload process not reload meteor.settings file well. does 1 else can confirm problem? bad because change meteor.settings file , don't want forced launch update on google playstore everytime. need rely on hot-code-push. i'm using latest meteor version 1.5.1.

javascript - Changing redux state but also retain some old values of state -

in react-redux app, changing redux state , looks this state { key1: oldval1 key2: oldarray1 //the value here array . . . } now when update state next time... state { key1: newval1 //but key2 want keep value same oldarray1 //now since oldarray1 not anywhere except in old state, can this...? key2: state.key2 . . . } so if key2: state.key2 , state.key2 array, reference lost since state changed , state.key2 won't point anything? i want rough explanation of how object/array references affect state in redux. note redux state immutable, first state , second state 2 different objects, can assign old value new key, if use object.assign or immutable tool, of course. switch (action.type) { case set_visibility_filter: return object.assign({}, state, { key1: action.newval1, key2: state.key1, })

Installing Visual Studio 2005 on Windows 10 -

is possible install visual studio 2005 on windows 10? i need maintain legacy application targets .net framework 2.0, need use version of visual studio. it not supported, works far have tried. coincidentally, came here after searched same thing while installing visual studio 2005 professional. have old vs 2005 c++ source has given me modify. after installation of vs 2005 complete, installed following 2 updates: vs80sp1-kb926601-x86-enu.exe vs80sp1-kb932232-x86-enu.exe look these on google find download links msdn. after installing these updates, launched vs 2005, , far, has worked fine. app running, there no errors, builds fine, , can use vs 2005 always.

kotlin - Spring Boot .mustache file extension -

i'm working on spring boot application , adding small configuration web page using mustache templates using this article example . have working fine when of mustache template files have extension .html, problem don't ide support. intellij idea has plugin mustache, extension has .mustache. when change file extensions, though, end 404 error. i've seen in official example using .mustache, know it's possible. couldn't find in project indicate setting changed enable this. major difference using kotlin instead of java, don't see why have effect on mustache file extensions. what missing? thanks! nevermind. realized 2.0.0 branch of spring boot , 1.5.x branch still has .html.

CSCore: is it possible to create parallel source chains? -

i'm developing application in i'd play sound , visualize sound in various ways. in visualizer portion want apply filters extract different features of sound, not affect sound played. source-->wasapiout -->highpassfilter-->highpassvisualizationoutput -->lowpassfilter-->lowpassvisualizationoutput is possible construct several synchronized chains in manner, or thinking problem wrong?

javascript - Angular 2: Iterating over an array of objects and printing "Yes" to the view ONCE if any of the iterated objects return "true" for the check -

i have situation in angular 2 app iterating on array of objects, , if "completed" property set false of objects, want print view 'yes', because there (at least) 1 object "completed" equal false -- meaning it's still active flag. however, right now, template code have printing 'yes' view each time 1 of these objects "completed" property set false returns true . how can adjust code i'm getting "yes" printed once if 1 (or more) of objects in array being iterated on has "completed" property set true? here's code: <td *ngfor="let flag of service.flags"> <ng-template *ngif="flag?.completed === false"> <span class="standard-flag">yes</span> </ng-template> </td> i tried using ternary operator, gives me same result: <td *ngfor="let flag of service.flags"> <ng-template *ngif="flag?.comple

selenium - python requests sometimes returns empty list -

so i've been trying scrape "2005 - 2013" "drink between 2005 2013" , @ first code worked me empty lists returned, yet requests still have 200 status code import requests, lxml.html, csv headers = {'user-agent':'mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, gecko) chrome/59.0.3071.115 safari/537.36'} page = requests.get('http://www.cellartracker.com/wine.asp? iwine=91411',headers=headers) print(page.status_code) html = lxml.html.fromstring(page.content) content_divs = html.xpath('//a[@title="source: community"]/text()') print(content_divs) not sure if should start using selenium scraping because it's js site, , if not sure how either basic useful! thanks!!

python - How can I filter a pandas dataset based on multiple columns? -

i trying ifthen logic working in dataframe , couldn't find examples. what trying filter dataset include values col1=col3 , col2=col4 col1 col2 col3 col4 wagner john wagner john jane mary klein peter schneider megan wicker sam schneider megan schneider megan result col1 col2 col3 col4 wagner john wagner john schneider megan schneider megan my code here doesn't work df1.apply(lambda x : x['col1'] if x['col1'] == x['col1'] , x['col2'] == x['col2'] else "", axis=1 i'd use dataframe.query() method: in [205]: df.query("col1==col3 , col2==col4") out[205]: col1 col2 col3 col4 0 wagner john wagner john 3 schneider megan schneider megan or "classical" approach: in [206]: df.loc[(df.col1==df.col3) & (df.col2==df.col4)] out[206]: col1 col2

python - MultiValueField does not work with ModelChoiceField -

the code: (where addressinput multiwidget) class addressinput(widgets.multiwidget): def __init__(self, attrs=none): self.widgets = widgets.hiddeninput(attrs), widgets.textinput(attrs) # note second widget customized, i'm providing simplified example, produce same error super().__init__(self.widgets, attrs) def decompress(self, value): try: address = addresspoint.objects.get(pk=value) except (addresspoint.doesnotexist, valueerror): address = none return [value, str(address)] def value_from_datadict(self, data, files, name): return tuple(widget.value_from_datadict(data, files, f'{name}_{i}') i, widget in enumerate(self.widgets)) class addressformfield(multivaluefield): widget = addressinput def __init__(self, queryset, empty_label="---------", to_field_name=none, limit_choices_to=none, *args, **kwargs): fields = ( modelchoicefield(queryset, emp

Positioning a Kivy Animation On Screen. -

Image
i've been playing code how make repetitive rotating animation in kivy? . in code below i'm using rotate image of 45rpm record. i'd change position of record center of screen spin in upper right corner of screen. i've searched can't find information on how re-position image towards upper right corner and/or information on how ensure keeps rotating once moved. i'd appreciate help. thanks in advance. ....brad.... image code at: https://drive.google.com/open?id=0b-t2cvsaoz2vq2hmahm0snlqvlu # modified https://stackoverflow.com/questions/41321832/how-to-make-a-repetitive-rotating-animation-in-kivy kivy.app import app kivy.lang import builder kivy.uix.floatlayout import floatlayout kivy.animation import animation kivy.properties import numericproperty builder.load_string(''' <loading>: canvas.before: pushmatrix rotate: angle: root.angle axis: 0, 0, 1

spring - Configure JHipster to use local linux sendmail -

This summary is not available. Please click here to view the post.

c++ - Receiving a runtime error, see photo, during run. Want to expand a spiral matrix -

Image
i @ lost , posting code can situation resolved. relatively new programming , teaching myself c++ dr. bronson's textbook. here error get: here code. when put "cout" statement @ head of int main(), still same error. // 28.pe.numberspiralmatrix.cpp : defines entry point console application. // #include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; const int row = 1001; const int col = 1001; int right(int spiral[row][col], int, int, int, int); int down(int spiral[row][col], int, int, int); int left(int spiral[row][col], int, int, int, int); int up(int spiral[row][col], int, int, int); int main() { cout << "we here!" << endl; int spiral[row][col]; int crow = 4; int ccol = 4; int i, j; int growth = 1, count = 0, count1 = 0, count2 = 0, count3 = 0, count4 = 0, count5 = 0; int inc; (inc = 0; inc < 501; inc++)//increased 1 { growth = right(spira

ruby - Why freezing hash literal is not the same as freezing string literal? -

i have been reading ways reduce memory usage in ruby/rails app, , 1 thing mentioned freezing objects. have tried code below (mri, ruby 2.3.3) , save memory, according activity monitor, compared not freezing string. pipeline = [] 100_000.times { pipeline << 'hello world'.freeze } however, if try same hash literal, uses lots of memory, unless assign hash variable , freeze before. pipeline = [] 100_000.times { pipeline << {hello: 'world'}.freeze } # uses 25mb my_hash = {hello: 'world'} my_hash.freeze 100_000.times { pipeline << my_hash} # uses 1mb can explain why? thought string case bit strange, because looks you're creating lots of different string objects, freezing each 1 separately, , adding lots of frozen objects array. don't know why works, hey, did. now, hash case more in line expected, don't know why won't behave string. it's case ruby optimizer can identify string being same 1 loop next, it'

git - Github Push Not Appearing As Contribution -

could please guide me on whether due incorrect settings or else. whenever push changes github desktop gui app, not appear contribution on profile. if take same code , paste github via web browser appears contribution. how make desktop pushes appear contribution well? thank you quickly, see plausible causes. 1- commits pushed on branch other master may not appear in contributions. 2- forgot commit before pushing. 3- author's email set spelling mistake. there how fix previous commits if it's third option: change git email previous commits

IOS CallKit calling Identify Got Rejected -

Image
in app, use callkit identify call app user. , there logic pop alert window checks whether user has turned on identify , blocking in app settings. (which see in screen shot). , reason got app rejected apple. told me add privacy key in info.plist. there no private key related callkit calling identify. so, not know how deal this, there 1 have same experience ?please show me problem, thx lot. there's conflicting information this. one (accepted) answer here says it's not needed, comments in blog post , this stackoverflow answer says key looking add nsvoipusagedescription (for callkit , voip). so that's key add info.plist file, along description string in value section. this apple forum thread has different possible key try, too.

html - Eclipse static web project HTTP Preview/Server module conflicts with relative paths -

Image
so start static web project on eclipse. let's mysite. , start jetty web server on eclipse , open localhost:8080 on browser. this i'll see: so go localhost:8080/mysite/index.html , see homepage. as can see the link not leading should be. should going localhost:8080/mysite/index.html , or more preferable, mysite's index page should hosted on localhost:8080/index.html , not on module. index.html <!doctype html> <html lang="en"> <body> <a href="/index.html">home</a> </body> </html> if change mysite/index.html defeats purpose of being http preview server, because mysite it's own site , not kind of module. how fix without using workaround? as can see the link not leading should be. should going localhost:8080/mysite/index.html, instead goes localhost:8080/index.html that because using url form relative server's root / . simply use ./ (page-relative path)

xpath - PHP - Parsing XML Challenge -

i'm trying parse feed similar following: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <feed xml:base="https://api4.mysite.com/api/" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/atom"> <title type="text">customers</title> <id>https://api4.mysite.com/api/customers/</id> <updated>2017-07-27t08:00:15z</updated> <link rel="self" title="customers" href="customers" /> <entry> <id>https://api4.mysite.com/api/contacts('00000001-a000-0000-1000-030102101201')</id> <title type="text"></title> <updated>2017-07-27t08:00:15z</updated> <author> <name /> </author> <link rel="edit" title="contact" href="contacts('00000001-a000-

java - Export and import data from parse server -

i trying export , import database parse server / xls , csv files. using bitnami parse server dashboard 1.0.25. ever search either states parse has been closed or functionality not there on parse server. question is there way without of hassle thank , should keep on using parse server open source or switch mentioned on many website many developers moving other databases such mongodb or firebase etc. thank replies. just call data server in model , export locally. why want export files on server.

lambda - how to operate two adjacent objects in java8 function style,change below codes -

the latter staffoperinfo object need compare former one,how change below code java8 style?my english poor,i hope not mind, thanks! staffoperinfo before = null; (staffoperinfo : staffmap.get(staffid)) { if (before == null) { before = so; } else { if (so.gettermip()!=null&&!so.gettermip().equals(before.gettermip()) && so.getacceptdate().gettime()- before.getacceptdate().gettime()<step*1000) { if (filtermap.containskey(staffid)) { filtermap.get(staffid).add(before); filtermap.get(staffid).add(so); } else { list<staffoperinfo> ll = new arraylist<>(); ll.add(before); ll.add(so); filtermap.put(staffid, ll); } }

eclipse - AttributeError: module 'odbc' has no attribute 'connect' - python with pydev -

i new python , can't seem find answer error. when run code below error attributeerror: module 'odbc' has no attribute 'connect' however, error shows in eclipse. there's no problem if run via command line. running python 3.5. doing wrong? try: import pyodbc except importerror: import odbc pyodbc # specifying odbc driver, server name, database, etc. directly cnxn = pyodbc.connect('driver={sql server};server=pxlstr,17;database=dept_mr;uid=guest;pwd=password') the suggestion remove try...except block did not work me. actual import throwing error below: traceback (most recent call last): file "c:\users\a\workspace\testpyproject\src\helloworld.py", line 2, in <module> import pyodbc file "c:\users\a\appdata\local\continuum\anaconda3\lib\site-packages\sqlalchemy\dialects\mssql\pyodbc.py", line 105, in <module> .base import msexecutioncontext, msdialect, varbinary i have pyodbc installed , impor

Laravel - can Omnipay use with other payment Gateway like revPay? -

currently our company choosing revpay payment gateway. need know laravel omnipay able used revpay? the current list of omnipay gateways here: https://github.com/thephpleague/omnipay i not see revpay on list.

typescript - Observable on AngularJS does not interpolate: " cant find property of undefined" -

everyone. have application shows cats. gets data json using service , http. can do, , works. however, have feature "cat detail" page, involves routing. uses same service not render whole json file, particular object, in case, particular cat. search said particular cat using find() method on first getcat() function, using route.params value search parameter. however, routing isn't problem itself. can see below. console can print return of function , shows sole object should . problem seems concern moment of interpolation. when bind variable, component template, should carry data of observable, angular shows me "cannot read property 'nombre' of undefined". i don't know why isn't working. people recommend using safe navigation operator on binding, doesn't me. same error keeps appearing. i have rechecked syntax various days, , belief got right. makes me think problem relies on has scope of component, maybe related lifecycle hooks.

Google Firebase Android app receiving wrong db information from DataSnapshot -

i making android app require google firebase, , in app have iterate through datasnapshots couple of times. in 1 specific instance, datasnapshop passing data different directory in database specified to. make reference database, add event listener calls ondatachange method passes datasnapshot through. here: nref = mfirebasedatabase.getreference(); nref.addvalueeventlistener(new valueeventlistener() { @override public void ondatachange(datasnapshot datasnapshot) { if (datasnapshot.exists()){ showdatalobreq(datasnapshot); showdata(datasnapshot); } else { } } @override public void oncancelled(databaseerror databaseerror) { } }); and here methods calls: public void showdatalobreq(datasnapshot datasnapshot){ for(datasnapshot ds : datasnapshot.child("lobby_requests").getchildren()){ system.out.println("here"+ds.getvalue()

React native JSON and State -

i new react native , programming in general. need here. i have simple login screen user enters email , password. when user clicks on login button, call web service check number of matching records in db email/password combination. web service returns count in json format. getting blank count. doubting has setting state. json web service: {"subscriber":[{"count":"0"}]} here code: constructor(props) { super(props) this.state = { email: '', password: '', ucount: '', data: [] }; } _onpressbutton() { this.getdata(); console.log("email:", this.state.email); console.log("passwd:", this.state.password); console.log("data", this.state.data); console.log("ucount", this.state.ucount); if (this.state.ucount < 1) { alert.alert('fail') } else { this.props.navigation.navigate('loginsuc

javascript - Flask.SocketIO Fails to send data asynchronously to registered participants when async mode is "threading" -

edit: updated title nature of problem became more clear i'm trying implement simple socket.io connection send broadcast events flask server javscript client. first server message reaches client, no more. on server side, keeps calling emit periodic data updates, client never receives messages after first one. here javascript client (relevant lines extracted react app): var io=require('socket.io-client') var socket = io.connect(); socket.on('connect', function() { console.log('connection established'); }); socket.on('message', function(data){ console.log('message received'); console.log(data); //only gets called first message sent server } and flask server code: from flask_socketio import socketio, emit app = flask(...) socketio = socketio(app, async_mode="eventlet") socketio.emit('message', "test data", broadcast=true) #update function called periodically json data #of form {"data&q

r - take randomly sample based on groups of another dataset with no match cases -

i have 2 datasets these ones: df <- data.frame(id = 1:20, sex = rep(x = c(0,1), each=10), age = c(25,56,29,42,33,33,33,25,25,25,26,57,30,43,34,34,34,26,26,26), ov = letters[1:20]) df1 <- data.frame(sex = c(0,0,0,1,1), age = c(25,33,39,41,43)) i want take 1 random row every group of sex , age of df according every group of df1, not cases of age in df1 match in df, want impute every group in df1 no match in df value of var ov related same sex , closest age, this: df3 <- rbind(df[c(8,7),2:4],c(0,39,"d"),c(1,41,"n"),df[14,2:4]) note donor case in sex = 0 , age = 39 df[4,] , note donor case in sex = 1 , age = 41 df[14,] how can this: using data.table can try this: 1) convert data data.table , add keys: df1 dt1 <- as.data.table(df1) # convert data.table dt1[, newsex := sex] # serve grouping column dt1[, newage := age] # setkey(dt1, sex, age) # set data.tables keys dt1 sex age

java - How can we validate json based on key value pair in Jmeter -

Image
i haved worked around jmeter load testing. focusing on api automation. reading file csv endpoints , response expected, challenge facing whether how validate json based on key value pair, can validate data in interested , not whole json body. in java using eclipse can using below method: jsonobject obj1=null,obj2=null; obj1=new jsonobject(actual); obj2=new jsonobject(required); iterator<?> keys = obj2.keys(); while( keys.hasnext() ) { string key = (string)keys.next(); if(obj2.get(key) instanceof jsonarray) { if(!comparejsonarray(obj2.getstring(key),obj1.getstring(key))) {return false;} status=true; }else if(obj2.get(key) instanceof jsonobject) { if(!comparejson(obj2.getstring(key),obj1.getstring(key))) {return false;} status=true; }else{ if(obj2.getstring(key).equalsignorecase(obj1.getstring(key)))

git - Unwanted stuff written in file when cherry-picked -

recently got know cherry-pick command in git , , turns out useful command. learnt resources on how use cherry-pick contents other's repo. after used command, contents got cherry-picked other's repo branch, alongwith them had few lines in different parts of file, <<<<<<< head <<<<<<< head <<<<<<< head >>>>>>> 53de559... >>>>>>> 0fa87af (such types of unwanted stuff present wherever changes made). want know whether these lines affect file or required git . if not required how remove them. i followed steps described here