Posts

Showing posts from June, 2013

node.js - request follow redirection without post data -

i'm using request.js http request in node.js. request({ method: 'post', uri: 'http://www.example.com/getdata', followallredirects: true, followoriginalhttpmethod: true, json: true, form: { id: 1, msg: 'test data', }, }, (err, res, body) => {}) let's when post { id: 1, msg: 'test data' } http://www.example.com/getdata , proxy redirect http://us.example.com/getdata . the codes above redirect http://us.example.com/getdata , how can set redirection post data? this hard if not impossible. if redirects done sending "301 moved permanently" or "302 found" http status code in practice works if "303 see other" sent, i.e. get request made with no data sent in body . see list of http status codes on wikipedia: this example of industry practice contradicting standard. http/1.0 specification (rfc 1945) required client perform temporary redirect (the original describing p

javascript - firebase-ui for email verification -

i've set firebase email/password authentication using firebase-ui. var uiconfig = { signinsuccessurl: '<?php echo $url; ?>', signinoptions: [ // leave lines providers want offer users. firebase.auth.googleauthprovider.provider_id, firebase.auth.facebookauthprovider.provider_id, firebase.auth.emailauthprovider.provider_id ], // terms of service url. tosurl: '<your-tos-url>' }; // initialize firebaseui widget using firebase. var ui = new firebaseui.auth.authui(firebase.auth()); // start method wait until dom loaded. ui.start('#firebaseui-auth-container', uiconfig); but security reasons want user confirm her/his email.but fromthe above code doesn't send verfication mail user. i've used following method send verification mail user if he/she not verified his/her account mail. firebase.auth().onauthstatechanged(function(user)

android - Is it possible to transfer an app from one device to another? -

apps xender, allow user share app user, directly transferring (and installing app) on users device. done device device, , done without target device downloading app google play. i know how transfer file 1 device using wifi direct. my question - file need transfer, transfer app? apk ? located ? you can find apk of installed app in /data/app in internal storage . not in every case of time when sending apk sending complete app . also check post maybe thats want. https://stackoverflow.com/a/11908293/7704356

c3.js - Pattern fills in c3 pie charts -

Image
i'm using c3 pie charts. need have patterns on chart apart having different colors. can me how have pattern fills(like given image) in pie-charts using c3 js?

android - Access to the internet at a certain time even if the phone is asleep -

i have @ time, when phone sleeping. task requires internet access. i used that: alarmmanager wakefulbroadcastreceiver, startwakefulservice class extends intentservice. everything works while phone (with andoid marshmallow) active. after falling asleep, don't have access internet. additional note: don't need wi-fi, 3g or something.

matlab - Overlaying a semi-transparent rectangle on an plot created with imagesc? -

i have used imagesc in matlab plot acoustic field. want overlay semi-transparent filled in rectangle @ location on image. ideally i'd able following: imagesc(g,g,field); hold on plotrectangle([100,100,200,200], 'b', 0.5) hold off where b color of rectangle 0.5 transparency. can done? you can use rectangle create rectangle object , use color specified rgba include transparency rectangle('position', [100 100 200 200], 'facecolor', [0 0 1 0.5]) alternately, can use patch object p = patch('vertices', [100, 100; 100, 200; 200, 200; 200 100], ... 'faces', [1, 2, 3, 4], ... 'facecolor', 'b', ... 'facealpha', 0.5)

javascript - How to read a remote JSON file with jQuery.getJSON()? -

i'm new javascript , read remote json file getjson() . reason function returns syntax error unexpected token ) can't figure out wrong. this do, am'i missing ? var url = "http://mysafeinfo.com/api/data?list=englishmonarchs&format=json"; $.getjson(url, function (json) { console.log(json); alert(json); )}; link jsfiddle you have javascript error var url = "http://mysafeinfo.com/api/data?list=englishmonarchs&format=json"; $.getjson(url, function (json) { console.log(json); alert(json); }); // here swapped bracets

PHP: What's the most efficient way to summarize a large array into just 10 arrays? -

my web app returns user images in specific folder (pictures taken each day in month) via array of filenames. issue number of images many (30-500 images). what wanted provide summary of array, reducing array 10 images. first 10 limiting loop. represents first part (for few images of day) . wanted 10 images array in way 10 images equally spread out throughout day. i think of several ways involving quite lot of code. was wondering if knows of cool array function or method solves problem? there no built-in function in php that. best thing think using of sizeof() function: $size = sizeof($array); $chunksize = ceil($size/10); for($i = 0;$i<$size;$i+=$chunksize){ echo $array[$i]; }

angularjs - Angular/Ionic : change input focus after completion -

Image
in order users lon application, send them code (6 numbers) sms. when coming application, display popup in order them input said code. have 6 inputs (maxlength=1) better design. here visual have : there (so-far) html template of popup : <ion-content class="content-activation-code"> <div class="activation-code-list"> <input type="text" class="activation-input-code" maxlength="1" ng-model="code.c1" ng-focus="code.c1===''"> <input type="text" class="activation-input-code" maxlength="1" ng-model="code.c2"> <input type="text" class="activation-input-code" maxlength="1" ng-model="code.c3" > <input type="text" class="activation-input-code" maxlength="1" ng-model="code.c4" > <input type="text" class="activation-input-c

javascript - Node.js/Gulp: child process spawn 'Error: spawn EACCES' -

i trying build , run executable in gulp using node. executable builds fine, attempting run gives error: error: spawn eacces @ exports._errnoexception (util.js:1023:11) @ childprocess.spawn (internal/child_process.js:313:11) @ object.exports.spawn (child_process.js:387:9) @ gulp. (/path/to/my/app/gulpfile.js:167:24) @ module.exports (/path/to/my/app/node_modules/orchestrator/lib/runtask.js:34:7) @ gulp.orchestrator._runtask (/path/to/my/app/node_modules/orchestrator/index.js:273:3) @ gulp.orchestrator._runstep (/path/to/my/app/node_modules/orchestrator/index.js:214:10) @ gulp.orchestrator.start (/path/to/my/app/node_modules/orchestrator/index.js:134:8) @ gulp. (/path/to/my/app/node_modules/gulp-sync/lib/index.js:51:27) @ module.exports (/path/to/my/app/node_modules/orchestrator/lib/runtask.js:34:7) bear in mind script works fine when gulpfile.js in same directory executable attempting run. but have moved gulpfile.

javascript - How to retrive value from objects by checking test condition in array -

i have 1 array filterval = [ab, bc, de]; , millions of record. need check if record.property value matching of filterval return true else false. now problem in code when iterate 2nd index first value washed. can 1 tell me how achive this. my code. for(var i=0; i<filterval.length; i++){ grid.store.filterby(function(record){ debugger; if(filterval[i]==record.data[filterproperty]) return true; else return false; }); } **note** : when going i=2; data washed away 1st one. it looks me you're using extjs, case? if might want tag question. here's do: grid.store.filterby(function(record){ return filterval.indexof(record.data[filterproperty]) !== -1 });

reactjs - React Native Error when run react-native run-android -

when run react-native run-android i got error a problem occurred configuring root project 'albums'. not resolve dependencies configuration ':classpath'. not find com.android.tools.build:gradle:23.0.3. searched in following locations: https://jcenter.bintray.com/com/android/tools/build/gradle/23.0.3/gradle-23.0.3.pom https://jcenter.bintray.com/com/android/tools/build/gradle/23.0.3/gradle-23.0.3.jar

c# - Generic types cannot Cast, although IsAssignableFrom -

i have generic queryprovider can provide (sequences of) data of type upon request. before providing data check if requested type isassignablefrom type can provide. the compiler satisfied cast ienumerable<tdata> ienumerable<tresult> , yet complains casting tdata tresult class myclass<tdata> { private ienumerable<tdata> getsequence() {return enumerable.empty<tdata>(); } private tdata getsinglevalue() { return default(tdata); } public tresult getresult<tresult>() { tresult result; if (typeof(tresult).isassignablefrom(typeof(ienumerable<tdata>))) { // can assign ienumerable<tdata> tresult ienumerable<tdata> data = getsequence(); result = (tresult)data; } else if (typeof(tresult).isassignablefrom(typeof(tdata))) { // can assing tdata tresult: tdata data = getsinglevalue(); result = (tresult)data; compiler e

Two variables in echo PHP -

i have loop , want show values question$vari2 in loop $vari1=$_session['quantity']; $vari2=0; while($vari2<$vari1){ $vari2++; extract( $_post, extr_overwrite, "question$vari2" ); echo "<br>data1= ".$_session['data1'.$vari2]; echo "<br>data2= ".$_session['data2'.$vari2]; echo "<br>data3= "."$question1"."<br>"; //problem line } how write last line show question1, question2 ... in loop try echo '$'.'question'.$vari2; show $question2 in file not values of variable you looking variables variable : $var = "question{$vari2}"; echo "<br>data3={$$var}<br>";

office365 - Trying to set user licenses in Office 365 via Powershell -

i have office 365 tenant multiple license plans , i'm trying disable features of e3 plan in bulk via powershell. here's i've got: $enterprisepack=new-msollicenseoptions -accountskuid companyname:enterprisepack -disabledplans "flow_0365_p2", "powerapps_0365_p2" import-csv c:\scripts\inputfiles\e3users.csv | foreach-object -process { set-msoluserlicense -userprincipalname $_.upn -licenseoptions $enterprisepack -verbose} the issue i'm running into, can verify users exist, , import csv valid, error every user in csv: set-msoluserlicense : user not found. user: . this pretty frustrating, want disable features e3 users (which in csv) , command works when run as: $enterprisepack=new-msollicenseoptions -accountskuid companyname:enterprisepack -disabledplans "flow_0365_p2", "powerapps_0365_p2" set-msoluserlicense -userprincipalname testuser.here@domain.com -licenseoptions $enterprisepack -verbose as can see, difference

c# - csproj copy files depending on operating system -

i using .net core build cross platform class library. depending on operating system c# .net core project built using .csproj file, need copy native library project's output directory. e.g., os x want copy .dylib file, windows want copy .dll file, linux want copy .so file. how can condition clause in .csproj itemgroup? <itemgroup> <content include="libnative.dylib" condition=" '$(configuration)|$(platform)' == 'debug|osx' "> <copytooutputdirectory>preservenewest</copytooutputdirectory> </content> </itemgroup> $(platform) not seem work. there different variable can use?

is it possible to assign constant values to attributes in xtext rule? -

i have metamodel in have class range min max integer values , want define xtext dsl, in can define range 1..10 , standard defaults ? , ! stand 0..1 or 1..1 . looked around documentation, couldn't find way define in xtext grammar. far, have rule general case range: min=int '..' max=int; however, didn't find way define like range: '?' min=0 max=1; range: '!' min=1 max=1; how achieve similar behavior dsl? please note not interested in generating metamodel grammar, dsl models should adhere existing metamodel. i dont know easy solution might able customize xtexts object creation e.g. like model: ranges+=abstractrange*; abstractrange returns range: explicitrange | zorange | oorange; explicitrange returns range: min=int ".." max=int; zorange returns range: {range} max=zeroone; zeroone returns ecore::eint: "?"; oorange returns range: {range} max=oneone; oneone returns ecore::eint: "!"; and followin

Create lookalike audience Facebook API with several countries -

i trying create lookalike audiences via facebook api, finding users in several countries. 1 country works fine, whenever try several countries error message: { message: '(#2654) invalid lookalike spec: please ensure lookalike spec has valid parameters'} here json parameters sent request: { "name":"snorkeling vacation guide: lookalike visitors", "subtype":"lookalike", "origin_audience_id":"6063046728433", "lookalike_spec":{ "allow_international_seeds":true, "type":"similarity", "location_spec":{ "geo_locations":{ "countries":[ "us", "ca", "uk", "de", "se", "ie" ] } } }, "description&

cq5 - AEM 6.1 logging out on creating new page -

Image
i trying use brand new instance of aem 6.1 in separate folder whenever creating new simple webpage in siteadmin showing me error i(admin) have been logged out. login screen flashes millisecond after , siteadmin account not see csrf thing in felix console , dispatcher not started yet. 15.04.2017 07:26:42.172 *info* [0:0:0:0:0:0:0:1 [1492221402062] /content.pages.json http/1.1] com.adobe.granite.workflow.core.payloadmapcache getting running workflows (0) cache population took: 21ms 15.04.2017 07:26:42.172 *info* [0:0:0:0:0:0:0:1 [1492221402062] /content.pages.json http/1.1] com.adobe.granite.workflow.core.payloadmapcache initial workflow payload cache population took 21ms 15.04.2017 07:26:42.195 *warn* [0:0:0:0:0:0:0:1 [1492221402062] /content.pages.json http/1.1] org.apache.jackrabbit.oak.jcr.session.refreshstrategy session has been idle 1 minutes , might out of date. consider using fresh session or explicitly refresh session. java.lang.exception: session created here: @ org.a

ios - Tap UITabBarItem To Scroll To Top Like Instagram and Twitter -

i'm having issues making feature work , help. my hierarchy tabbarcontroller -> navigation controller -> tableviewcontroller what want if on current tab , scrolled down able tap current view's uitabbaritem , scrolled top,like instagram , twitter example. i have tried many things right here : older question but sadly non of answers did job me. i appreciate manner , thank in advance! here tableview`controller's code : import uikit class barsviewcontroller: uitableviewcontroller,uisearchresultsupdating,uisearchbardelegate,uisearchdisplaydelegate,uitabbarcontrollerdelegate{ //tableview data & non related stuff.... override func scrollviewwillbegindragging(_ scrollview: uiscrollview) { self.searchcontroller.searchbar.resignfirstresponder() self.searchcontroller.searchbar.endediting(true) } func tabbarcontroller(_ tabbarcontroller: uitabbarcontroller, didselect viewcontroller: uiviewcontroller) { let tabbarindex = t

python 3.x - python3 relative import not working: ImportError: cannot import name 'gmail' -

i understand relative import has explicit in python 3, can't figure 1 out. i have 1 directory called work , files main.py , gmail.py in main.py, used have "import gmail" in python 2 i used 2to3, , line changed "from . import gmail" user@ubuntu:~/work$ python main.py traceback (most recent call last): file "main.py", line 7, in <module> . import gmail importerror: cannot import name 'gmail' what doing wrong? by way, when "python gmail.py", works fine. $ cat main.py . import gmail $ cat gmail.py print('test') ====================================== ok found works $ cat main.py import gmail so why did 2to3 change not work? , why people use "from . import gmail" when "import gmail" works? the complete answer i've been able find here: relative imports in python 3 better have written up.

c# - Dapper with sql query dynamic parameters -

in asp.net web-api, getting error "ora-00936: missing expression" below code snippet. had tried many solutions did not overcome error. , want know how bind more 1 parameter dynamically. using oracle back-end , dapper orm. string empid = json.empid; //'15rd005' var sql = @"select id_no,sno,reason,applieddate,case when leave_type = 0 'cl' when leave_type = 1 'el' when leave_type = 2 'sl' when leave_type = 3 'off' when leave_type = 4 'od-off' when leave_type = 5 'lop' when leave_type = 6 'optional' end leave_type, to_char(fromdate,'dd-mon-yyyy') f_date, to_char(todate,'dd-mon-yyyy') t_date, case when fromslot=0 'first-half' when fromslot=1 'second-half' when fromslot=2 'full-day&#

postgresql - Importing JSON data to Postgres -

i have imported 3 rows postgres table called cards. when showing contents of table, null values , raw text coming in front of data. don't know why?? does has idea?? here, image attached. someone put them there. data gets there because put there. can't audit system 3 sentences.

Q: Android Remove Multi-User Button (No Root) -

Image
total newb here. how go removing multi-user icon/button quick settings bar? screenshot: rooting not option, can't alter system settings (like adding fw.max_users=1). the purpose not allow owner user create additional users. settings blocked applock app can't done there, can via quick settings bar. can remove button writing script (android studio)?

nltk - python ntlk donwload gives parser eror -

i trying run following command import nltk nltk.download('all') but getting error traceback (most recent call last): file "./update.py", line 3, in <module> nltk.download('all') file "/usr/lib/python3.6/site-packages/nltk/downloader.py", line 664, in download msg in self.incr_download(info_or_id, download_dir, force): file "/usr/lib/python3.6/site-packages/nltk/downloader.py", line 534, in incr_download try: info = self._info_or_id(info_or_id) file "/usr/lib/python3.6/site-packages/nltk/downloader.py", line 508, in _info_or_id return self.info(info_or_id) file "/usr/lib/python3.6/site-packages/nltk/downloader.py", line 875, in info self._update_index() file "/usr/lib/python3.6/site-packages/nltk/downloader.py", line 825, in _update_index elementtree.parse(compat.urlopen(self._url)).getroot()) file "/usr/lib/python3.6/xml/etree/elementtree.py", line

ggplot2 - I have this piece of code, and I would like to put the plots in the same plot in R (like the hold on; function in matlab) -

Image
library(ggplot2) qplot(womanbed, womanage) ggplot(data.frame(womanbed, womanage), aes(womanbed,womanage)) + geom_point(color='#56b4e9') qplot(manbed, manage) ggplot(data.frame(manbed, manage), aes(manbed,manage)) + geom_point(color='darkblue')` as can see womanbed,womanage first plot , manbed , manage second plot. these vectors character type (e.g : "24","23"). want both plots @ same figure (so have dots men , women different colors in same x,y axis) the data have: womanbed: "01:00" "23:00" "23:30" "00.30" "23:00" "01:00" "23:00" "02:00" "01.50" "02:00" "01:00" "04:00" "01.30" "23:30" "00:00" "00:00" "01:00" "00:00" "00:30" "01:56" "05:30" "23:45" "00:45" "22.40" "02:00" "00:15" "

c# - Binding generic ObservableCollection to ItemsSource of Listview, kills XAML Designer and Visual Studio -

when app launches, i'm setting datacontext of window such: <window.datacontext> <vm:defaultviewmodel /> </window.datacontext> then bind observablecollection listview later on with: <listview margin="10" minheight="0" borderthickness="0" itemssource="{binding clients}"> <listview.view> <gridview> <gridviewcolumn header="client id" width="85" displaymemberbinding="{binding clientid}"/> <gridviewcolumn header="client name" width="220" displaymemberbinding="{binding clientname}"/> <gridviewcolumn header="branch" width="60" displaymemberbinding="{binding branch}" /> <gridviewcolumn header="client number" width=&q

html - Angular - Automatically select option based on condition -

i working on table consists of several fields, 1 of dropdown values ranging 0% 100%. dropdown menu connected ng-model called: task.custom_fields task variable ng-repeat. field in task object called: task.finished finished has value of 0 or 1, 1, want dropdown menu automatically select value connected 100%. if knows if can done angular syntax appreciate if let me know. my html code looks follows: <td md-cell> <md-select ng-model="task.custom_fields['96203']" placeholder="100%"> <md-option value="0">0%</md-option> <md-option value="0.1">10%</md-option> <md-option value="0.2">20%</md-option> <md-option value="0.3">30%</md-option> <md-option value="0.4">40%</md-option> <md-option value="0.5">50%</md-option> <md-option value="0.6">

php - How can I disable the default composer install in CircleCI? -

i have product in circleci has composer.json . default, when file present, circleci run composer install . however, don't want this, since i'm spawning docker container in run composer stuff. so question basically: how can disable circleci's default behaviour , make 'ignore' composer.json file?

php - 2 namespace with same class name - is it need to use "use" alias to call first namespace? -

from below code, try call sayhi method, in class cat namespace foo; not work, have use "use" change name call it; <?php namespace foo; class cat { public static function sayhi() { echo "meow"; } } namespace bar; class cat { public static function sayhi() { echo "hello"; } } foo\cat::sayhi(); //try use backslash path fatal error: class 'bar\foo\cat' not found ?> if use cat::sayhi(); call method namespace bar don't want. question: there method solve problem without use ' use ' alias? when declare namespace, code operates within namespace until declare another, or until end of file. you're doing this: namespace foo; class cat {} namespace bar; class cat {} // here in namespace bar foo\cat::sayhi(); since you're in bar namespace, , namespace reference doesn't anchor root namesp

c++ - finding all IPv6 hosts in interface -

i'm trying analyze network defined interface name see how many ipv4 devices , how many ipv6 devices in. ipv4 hosts find network , broadcast address , iterate trough them find hosts , i'm wondering how find ipv6 hosts since there ipv6 host without ipv4 address assigned itself. so thoughts are.. want iplement ping6 command ping broadcast , listen answer ipv6 hosts. don't have advices or experiences approach? or there better solution?

javascript - Async/Await inside Array function reduce -

i have 2 code snippets (parallel,sequential) execution of simple async function on array reduce. not understand, why execution not start until call promise.all. best way this? // function returning promise root value async function proot(x) { return new promise((res,rej)=>{ settimeout( () => { console.log(x*x); res(x*x) },1000) }) } // parallel execution var arr1 = [2,3,4].reduce((prev,next)=>{ return prev.concat(proot(next)) },[]) arr1 = await promise.all(arr1) // sequential execution var arr2 = [2,3,4].reduce( async (prev,next)=>{ return (await prev).concat(await proot(next)) },promise.resolve([])) arr2 = await promise.all([arr2]) the code inside promise gets executed when call function returns promise: // parallel execution var arr1 = [2,3,4].reduce((prev,next)=>{ return prev.concat(proot(next)) },[]) but returns promise instead of value. need handle promise value resolves. you d

Android ndk build: Specifying warning level for both C and C++ -

i'm compiling ndk-build (r10e) library mixing c , c++ files. mk file has lines: local_cppflags += -wall local_cppflags += -wno-unused-parameter local_cflags += -wall local_cflags += -wno-unused-parameter however, when compile code: void func2() { unsigned int size = 3; int pos; ( pos = 0; pos != size; ++pos ) { } } in cpp file, expected warning: file.cpp:4:28: warning: comparison between signed , unsigned integer expressions [-wsign-compare] ( int pos = 0; pos != size; ++pos ) in c file, don't warning... isn't local_cflags right way specify warning level c files? bonus question: there way specify warning level both c , c++ using simple variables (to avoid duplicating lines local_cppflags / local_cflags )? according section 3.8 options request or suppress warnings of gcc documentation, -wall enables -wsign-compare c++ code. fo c code either need use -wextra , or enable -wsign-compare explicitly. bonus question

git - Gradle: Can I place one root project within another? -

question: can following or lead problems? myandroidgradleproject |-- settings.gradle |-- build.gradle |-- app | +-- build.gradle +-- somelibraryandroidgradleproject |-- settings.gradle // root project within root project! |-- build.gradle |-- app | +-- build.gradle +-- library +-- build.gradle where myandroidgradleproject/settings.gradle looks this: include ':app' include ':library' project(':library').projectdir = new file('./somelibraryandroidgradleproject/library') as far can tell, seems fine, don't want run problems later on... can confirm fits gradle's design? why that? the reason directory structure want have somelibraryandroidgradleproject git submodule within git repository of myandroidgradleproject . have both projects sitting side side in same parent directory this androidstudioprojects |-- myandroidgradleproject +-- somelibraryandroidgradleproject but way of course cannot have 1 su

Upload CSV to Google Spreadsheet in a new sheet using C# -

i able add new sheet exisiting google spreadsheet via sheets api using code below. how import csv new sheet ? //auth code sheets api above line sheetsservice sheetsservice = new sheetsservice(bc_init); string spreadsheetid = "xxxxxx"; string sheetname = datetime.now.tostring(); var addsheetrequest = new addsheetrequest(); addsheetrequest.properties = new sheetproperties(); addsheetrequest.properties.title = sheetname; batchupdatespreadsheetrequest batchupdatespreadsheetrequest = new batchupdatespreadsheetrequest(); batchupdatespreadsheetrequest.requests = new list<request>(); batchupdatespreadsheetrequest.requests.add(new request { addsheet = addsheetrequest }); var batchupdaterequest = sheetsservice.spreadsheets.batchupdate(batchupdatespreadsheetrequest, spreadsheetid

javascript - How to add class to div if background image equals a particular image -

i'm trying add class div (vc_gitem-animated-block) if background image. basically, if div has image (vc_gitem_image.png) background, want hide parent div. if other divs have different background example (blog-fpo.png), need parent div not have class added, don't hide it's parent. i have code in page: <style> .hide{ display:none; } .show{ display:block; } </style> <div class="vc_gitem-animated-block"> <div class="vc_gitem-zone vc_gitem-zone-a vc_gitem-is-link" style="background-image: url('http://savagebrands17.wpengine.com/wp-content/uploads/2016/12/blog-fpo.jpg') !important;"> <a href="http://savagebrands17.wpengine.com/join-savage-at-conscious-capitalism-2017-%c2%89uo-pitfalls-on-the-path-to-purpose-presentation/" title="join savage @ conscious capitalism 2017 – “pitfalls on path purpose” presentation" class="vc_gitem-link vc-zone-link&q

javascript - Node.js, Socket.io emit not working -

i making website in socket.io . emit method not working in code. can't see errors in code. here server code. var io = require("socket.io").listen(server); //some external codes running server in node.js io.on("connection", function(socket) { //this line working. console.log("socket connected."); io.on("requestnewmap", function(data) { //create new map object in here. io.emit("responsenewmap", { mapdata: map }); }); }); and client side javascript code. var socket = io(); socket.on("responsenewmap", function(data) { var map = data.mapdata; //draw map in canvas's context. }); //setinterval runs method every 2 seconds. function requestnewmap() { socket.emit("requestnewmap"); } this part wrong: io.on("requestnewmap", function(data) { //create new map object in here. io.emit("responsenewmap", { mapdata: map }); });

ssrs 2008 - Making matrix fit in Report Builder -

how make matrix fit page in report builder. have tried make interactive height 0 in report designer didn't work. have column that's not showing entirely when run report. have tried decrease length of matrix column still not showing entirely.

java - How to retrieve a list from DynamoDB? -

im having specific error when running scan expression on table within dynamodb database. there 1 item in projects table of now. item contains project description , list of strings of team mates. when retrieving information project description code prints out correct name of project. when trying retrieve list of team mates same item says list null object reference. can not seem understand why list being returned null. assume permissions have been set within iam console, , database. below code thread scans table. public void run() { dynamodbscanexpression scanexpression = new dynamodbscanexpression(); //returns list of items table. each item of project type list<project> scanresult=mapper.scan(project.class,scanexpression); //for each project within scanresult following (project project: scanresult){ //retrieve name of team (this portion of code logs project name properly) string team=project.getproj

Multiply matrix with vector(element wise) Tensorflow -

i not sure on way put question title. show example on thing need in using tensorflow. for example: matrix_1 shape = [4,2] matrix_2 shape = [4,1] matrix_1 * matrix 2 [[1,2], [3,4], [5,6], [7,8]] * [[0.1], [0.2], [0.3], [0.4]] = [[0.1,0.2], [0.6,0.8], [1.5,1.8], [2.8,3.2]] is there algorithm achieve this? thank you this error getting simplified problem example above: valueerror: dimensions must equal, 784 , 100 'mul_13' (op: 'mul') input shapes: [100,784], [100] the standard tf.multiply(matrix_1, matrix_2) operation (or shorthand syntax matrix_1 * matrix_2 ) perform computation want on matrix_1 , matrix_2 . however, looks error message seeing because matrix_2 has shape [100] , whereas must [100, 1] elementwise broadcasting behavior. use tf.reshape(matrix_2, [100, 1]) or tf.expand_dims(matrix_2, 1) convert correct shape.

php - Registration information for user not being saved into database in phpmyadmin -

i'm using below tutorial , have read thru , searched multiple questions without luck solving this. https://www.youtube.com/watchv=e8tp2ferkls&index=39&list=pl0eyrzgxdwhwbtoawjm9faf1ixepexft- i've checked small syntax errors missing quotes, semicolons, etc , haven't found errors. i've confirmed variables echo properly. it's last step of saving information in database on phpmyadmin. i'm using xampp. tried solve hours. i'd appreciate feedback. index.php (i copied , pasted form not post entire front-end code). <form action="signup.php" method="post"> <input type="text" name="name" placeholder="first , last name"> <input type="text" name="email" placeholder="email address"> <input type="text" name="mobilephone" placeholder="mobile phone number"> <input type="password" name="pwd"

JavaScript closure inside loops – simple practical example -

var funcs = []; (var = 0; < 3; i++) { // let's create 3 functions funcs[i] = function() { // , store them in funcs console.log("my value: " + i); // each should log value. }; } (var j = 0; j < 3; j++) { funcs[j](); // , let's run each 1 see } it outputs this: my value: 3 value: 3 value: 3 whereas i'd output: my value: 0 value: 1 value: 2 what's solution basic problem? well, problem variable i , within each of anonymous functions, bound same variable outside of function. what want bind variable within each function separate, unchanging value outside of function: var funcs = []; function createfunc(i) { return function() { console.log("my value: " + i); }; } (var = 0; < 3; i++) { funcs[i] = createfunc(i); } (var j = 0; j < 3; j++) { funcs[j](); // , let's run each 1 see }

Ansible setup mysql root password -

Image
anyone of have idea build yml mysql updating of root password , granting privileges? have created playbook , on fresh install working expected , no issue @ all. when vagrant provision again fails set root password , i'm getting error. below codes mysql.yml --- - name: install mysql packages apt: name={{ item }} state=installed update_cache=yes with_items: - mysql-server - mysql-client - python-mysqldb - libmysqlclient-dev - name: drop database {{ dbname }} mysql_db: name: "{{ dbname }}" login_user: "{{ dbuser }}" login_password: "{{ dbpass }}" state: absent delegate_to: "{{ dbhost }}" run_once: true - name: create database {{ dbname }} mysql_db: name: "{{ dbname }}" login_user: "{{ dbuser }}" login_password: "{{ dbpass }}" state: present delegate_to: "{{ dbhost }}" run_once: true - name: ensure mysql running , starts on boot se

Mysterious Out Of Memory Error In 6502 BASIC -

i trying create simple word search game put characters on board on xpet in vice emulator using 6502 basic. find used work fine before added status indicator, fails, running out of memory @ 45, more 3 words. strange, because status indicator uses same variables rest of program uses, meaning should not take more space. have idea causing error? there hidden bug? 1 uu = 0 : goto 600 : rem can type run. uu=0: (toggle indicator on) 2 rem simple wordsearch game generator 3 rem takes words , creates board , key it. 4 rem words can read/written top bottom or left right. 5 rem board square between 3x3 , 21x21. more information @ 12000. 8 print "zero words, terminating game..." : rem small piece 9 end : rem of code here happens if put 0 number of words. 10 rem below default data (it's random). enough. 11 data "rat","clam","ten","sip","lie","ugly","not","yet","thou","if" 1