Posts

Showing posts from March, 2012

Eclipse is extremely slow on Fedora 24 -

i running fedora 24 os (with gnome 3) , installed eclipse cdt package fedora repositories (eclipse cdt neon.1), , turned out extremely slow, only when writing code or scrolling, rest of ui works , quickly. i have done research topic , seemingly problem related gtk backend, , commonly solved running eclipse under gtk2 instead of gtk3. however, has not helped me @ all. options have tried are: export swt_gtk3=0 and eclipse --launcher.gtk_version 2 (also tried in eclipse.ini) these 2 options switch gtk2, noticeable because graphical appearance changes. i tried older versions of eclipse (juno, kepler , luna) , problem still exists, worse. have increased memory size jvm 3gb , problem remains intact. the underlying hardware 6 core intel xeon (12 virtual cores hyperthreading) , 32 gb of ram, assume should not represent problem. i noticed while scrolling or writing, 1 of cores goes 70%-100% utilization, explains lag, don't know how solve. is there other option...

c# - How to make TwoWay Binding work -

i have problem when put binding mode twoway datagrid won't show. when leave binding mode on default, datagrid apear strings , , cannot find problem. in xaml have 3 more button s: load (that loads table), update , cancel (that cancel changes , reloads datagrid directly observablecollection . here xaml datagrid line <datagrid x:name="datagrid" autogeneratecolumns="true" canvas.left="10" canvas.top="10" alternatingrowbackground="lightgreen" height="245" width="500" itemssource="{binding userss.getvalues, mode=twoway, updatesourcetrigger=propertychanged}" datacontext="{binding relativesource={relativesource self}}"/> i have userss class creat observablecollection store data sqlite database . public class userss : inotifypropertychanged { public static sqliteconnection m_dd = new sqliteconnection("data source=mydatabase.sqlite;version=3;"); public ...

javascript - How to mock a module function inside a callback with Sinon.JS? -

i have following javascript code: import notifications 'notification-system'; export class documentparameters { handleupload() { return promise.resolve().then(() => { notifications.success(); }); } } notification-system module installed npm. i mock notifications.success in unit test: import notifications 'notification-system'; import { expect } 'chai'; import sinon 'sinon'; import { documentparameters } './document'; describe('handleupload()', () => { it('should upload , create success notification', (done) => { const success = sinon.stub(notifications, 'success'); const documentparameters = new documentparameters(); documentparameters.handleupload().then(() => { expect(success.callcount).to.equal(1); done(); }); success.restore(); }); }); this unit test fails because stub never called: success.callcount 0. my solution : import notif...

node.js - Mongodb Query does not work with string -

i trying documents in database match string not work when pass in variable. i have string servicestring , servicestring = "test1", "test2", "test3" query = db.collection('services').find({ 'service': { $in: [servicestring] } }); this returns nothing db if this: query = db.collection('services').find({ 'service': { $in: ["test1", "test2", "test3"] } }); it works , returns need. do know why not working, thinking string putting commas in string. whats way can because string input user can change cant hard code variables in query? $in looking array. so, it's better create array of string want find. let servicestring = ["test1", "test2", "test3"]; note : can use var instead of let here then query likes : let services...

openstreetmap - OSM - Mapnik - areas rendered as background color -

i generating maps using mapnik , osm data (postgres , shapefiles). problem quite few areas, of believe considered "landcover", rendering background color. areas render background color regardless of zoom level. for example, in between streets, blue. there forests render expected, of residential areas blue. i using mapnik 3 stylesheet. running on ubuntu 16.04. the images below show generating, , see (based on over openstreetmaps). any suggestions should solve problem appreciated. thanks. what i'm getting osm the problem caused invalid zoom levels and/or minscaledenominator, maxscaledenominator values. have not narrowed down completely, removing attributes, i'm seeing land again. thank help.

windows - CMD Batch - Search for last occurence of character while looping through file -

i have .txt file loop through every line , spool file. ok no problem far. want not spool lines, have following criteria: they contain more slashes. find last slash. after 1 search rest of string .*** (* = wildcard). if not found don´t spool, else spool. input file content example: c:/abc/abc/ c:/abc/abc/test.txt c:/eee/ c:/eee/test.cfg c:/test/abc/test/xxx/bbb/ccc/aaa/test.txt c:/test/abc/test/xxx/bbb/ccc/aaa/ output should like: c:/abc/abc/test.txt c:/eee/test.cfg c:/test/abc/test/xxx/bbb/ccc/aaa/test.txt it not static, lines appear, should removed. thought finding last slash , take after , if there last thing ".***" if keep else don´t echo i don´t want use other tools this. must done via native command-line functionality. maybe can me out. code: >output.txt ( /f "usebackq delims=" %%i in ("file.txt") ( set "line=%%i" setlocal enabledelayedexpansion rem somehting here don`t know how echo(!line!) ) ) just in 1...

python - Why the expected instance 'user' is a class? -

recently i'm learning flask, , there bug confused me 2 days: when try login in login_user ,it raises typeerror: __init__() takes 1 2 positional arguments 3 given user in models.py : class user(usermixin, db.model): __tablename__ = 'users' id = db.column(db.integer, primary_key=true) email = db.column(db.string(140), unique=true, index=true) username = db.column(db.string(80), unique=true, index=true) password_hash = db.column(db.string(128)) confirmed = db.column(db.boolean, default=false) role_id = db.column(db.integer, db.foreignkey('roles.id')) loginform in forms.py : class loginform(flaskform): email = stringfield('邮箱', validators=[datarequired(), length(1, 64), email]) password = passwordfield('密码', validators=[datarequired()]) remember_me = booleanfield('记住我') submit = submitfield('登陆') /login in views.py : @auth.route('/login', methods=['get', '...

SQL Server execute procedure as user -

i have stored procedure loads data target table , works fine when run in session ad credentials. when try run in job (again ad details in run option) login not have access 1 of db's. i used exec sp1 which worked fine. i used (to emulate running stored procedure in job) execute user = 'domain\jdoe' execute sp1 revert which failed. why stored procedure fail when running same credentials used in different session window? thanks in advance you need set source database trustworthy . note has other security implications (see below). by default in sql server cannot use assumed security context out of 1 database , unless source trusted. setting database trustworthy how indicate database trusted source. security measure designed prevent hacks 1 database application (via injection, usually) using springboard of other databases in same sql server. setting trustworthy saying " this database is secure and no 1 can out isn't supposed to. ...

hdl - Declaring an array of constant with Verilog -

first want apologize ignorance,this question may stupid many of you..but newbie in domain of hw dev trying turn software function hardware accelerator... in c code use array of integer calculate value shown here uint k[64] = { 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5, 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174, 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da, 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967, 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85, 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070, 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3, 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 }; as see here gonna use calculate t1 $ t1 = h ...

Distance between uset input numbers in a 2d array java -

i'm beginner programmer , need 2dimensional arrays. program has read how many rows , columns there in array(it's square so, numbers same , set "d" in program below), , has read number "n" tells program how many inputs there in array. then, user adds "n" numbers array , output needs distance between input numbers (the distance between first , second, second , third,...). have move manhattan distance. int d=sc.nextint(); int n=sc.nextint(); int[][] array=new int[d][d]; //length , heigth of array int distance=0; int c=0; for(int i=0;i>d;i++){ for(int j=0;j>d;j++){ array[i][j]=c; c++; distance=math.abs(i)+math.abs(j); } } system.out.println(distance); this have far. need filling code part sums distances , prints it. ty

javascript - Internal Error: Invalid UTF-8 - Sass & Gulp -

i following error when trying run gulp sass in linux ubuntu hutber@hutber-ubuntu:/var/www/beta.norsemanfc.co.uk$ gulp sass [14:43:26] using gulpfile /var/www/beta.norsemanfc.co.uk/gulpfile.js [14:43:26] starting 'sass'... [14:43:27] gulp-notify: [compile error] frontend/sass/style.scss internal error: invalid utf-8 [14:43:27] finished 'sass' after 547 ms searching through files/folders special characters returns nothing. hutber@hutber-ubuntu:/var/www/beta.norsemanfc.co.uk$ find ./* -iregex '.*/.*[èö].*' -print otherwise if remove @import @ start of file fail on @include border-box-sizing; variable susy so of course how can sass running locally? updated hutber@hutber-ubuntu:/var/www/beta.norsemanfc.co.uk/frontend/sass$ find ./* | xargs grep -i '.*/.*[èö].*' grep: ./fonts: directory grep: ./fonts/helvetica-neue: directory grep: ./modules: directory grep: ./modules/form: directory grep: ./pages: directory grep: ./plugins: directory grep:...

c# - DotNetCore.1.0.1-VS2015Tools.Preview2.0.3 Not Compiling after NUGET Updates -

the .net core project compiled fine new. once update nuget packages fails messages listed below. this happening before , after install of new tools. updated today: dotnetcore.1.0.1-vs2015tools.preview2.0.3 errors: severity code description project file line suppression state error 3. may trying publish library, not supported. use dotnet pack distribute libraries. error 2. project not list 1 of 'win10-x64, win81-x64, win8-x64, win7-x64' in 'runtimes' section. error 1. project has not been restored or restore failed - run dotnet restore error can not find runtime target framework '.netcoreapp,version=v1.0' compatible 1 of target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'. removed global.json version specification told uses latest saves me time, should not doing that? i can not understand how not tested. created brand new clean web application using .net core template in vs2015. updated nuget,...

javascript - Cycle2 Next/Prev issues with AutoHeight -

i using cycle2 in site im working on. cms , using jquery 1.6.4 go posed problem - got taken care of .on/.bind hack cycle2 core. unfortunately cannot update jquery @ moment. the slideshow working fine after hack - next , prev buttons work should , thumbnail navigation works fine well. the issue: of our images taller rest , slideshow taller images cut off @ bottom. integrated data-cycle-auto-height="container" built in cycle2. beautiful works. click on taller image thumbnail , image slideshow auto adjusts current image's height. but, data-cycle-auto-height="container" height running, can no longer use next/prev buttons. clickable , hover effect still works, once clicked nothing happens. if go ahead , remove data-cycle-auto-height="container" slideshow div, began function again. looked in console , not throwing additional errors - error in console uncaught typeerror: $(...).on not function(…) getting get-go, jquery 1.6 , cycle2 compatibility i...

Matlab SVM example -

i trying implement svm classification. goal output correct grid of origin of power signal (.wav file). grids titled a-i , there 93 total signals training set , 49 practice signals. have 93x10x36 matrix of feature vectors. know why errors shown? traincorrectgrid , training_cepstrum1 both have 93 rows don't understand problem is. appreciated. my code shown here: clc; clear; close all; load('avg_fft_feature (4).mat'); %training feature vectors load('practice_fft_mag_all (2).mat'); %practice feauture vectors load('practice_gridorigin.mat'); %correct grids of origin practice data load practicecorrectgrid.mat; load training_cepstrum1; load practice_cepstrum1a; load fset1.mat %load in correct practice grids traincorrectgrid=['a';'a';'a';'a';'a';'a';'a';'a';'a';'b';'b';'b';'b';'b';'b';'b';'b';'b';'b';'c...

continuous integration - GitLab Runner unable to restore nuget packages when started from gitlab but can when started locally -

i trying .net project build , test using gitlab ci. i have downloaded , installed recent version of gitlab runner , registered our gitlab instance. have created following .gitlab-ci.yaml file: variables: solution: performance-validation-tool.sln stages: - build - test # - deploy build: stage: build script: - echo "restoring nuget packages..." - 'c:/nuget/nuget.exe restore' - echo building... - 'msbuild.exe "%solution%"' except: - tags test: stage: test script: - echo testing... - 'msbuild.exe "%solution%"' - dir /s /b *.tests.dll | findstr /r tests\\*\\bin\\ > testcontainers.txt - 'for /f %%f in (testcontainers.txt) mstest.exe /testcontainer:"%%f"' except: - tags the important part build action. if run build gitlab following error of nugget packages: warning: unable find version '3.5.0' of package 'nunit.console'. c:\windows\system32\con...

sublimetext - Whats the name of these sublime text theme -

Image
can tell me name of shown sublime text theme? searched on google, no luck. or is not sublime? thank in advance. as mentioned @gavin, seems webstorm ide . based on phpstorm color scheme sublime answer, sublime text there theme darkula color scheme , seems webstorm ide 's sublime text theme version.

How to set namespace correct in PHP? -

i have load file index.php in server in directory public_html . in file set namespace , use as: namespace public_html; error_reporting(e_all); ini_set('memory_limit', '-1'); set_time_limit(0); use public_html\helper\curl\curlheaders; use public_html\helper\curl\curl curl; use public_html\helper\pdo\facadequery db; so, files see located in root directory public_html when run script error: fatal error: class 'public_html\helper\pdo\facadequery' not found in /home/bulud/public_html/parse.php on line 34

Add param to all objects in an Array - Javascript -

i have array of objects like: [ { title: 'title 1', value: 'value 1' }, { title: 'title 2', value: 'value 2' } ] i need add new param objects. i know can on array , modify each object, i'm trying find way solve native method. exists? var arrayobj=[ { title: 'title 1', value: 'value 1' }, { title: 'title 2', value: 'value 2' } ]; arrayobj.foreach(function(obj){ obj.newprop='new'; }); console.log(arrayobj);

ios - Is it possible to exclude dependency in Cocoapods? -

firebase/messaging have dependencies on: using firebase using firebaseanalytics using firebasecore using firebaseinstanceid using firebasemessaging using googleinterchangeutilities using googlesymbolutilities using googletoolboxformac i know possible exclude googletoolboxformac ? problem have 1 static library included use googletoolboxformac without cocoapods. so want know possible or not? assuming version of googletoolboxformac date enough satisfy firebase/messaging's requirements, following: find xcconfig files each of build schemes: find . | grep xcconfig edit them , remove following 3 strings: "$pods_configuration_build_dir/googletoolboxformac" -iquote "$pods_configuration_build_dir/googletoolboxformac/googletoolboxformac.framework/headers" -framework "googletoolboxformac" you'll have redo whenever pod update however, @valentin says, not recommended. better remove googletoolboxformac building existing static libr...

Retrieving json query from postgres and display in java -

string selecttablesql = "select user_id, username dbuser"; statement statement = dbconnection.createstatement(); resultset rs = statement.executequery(selecttablesql); while (rs.next()) { string userid = rs.getstring("user_id"); string username = rs.getstring("username"); } with above code..i able establish connection postgres , display values database table. how parse json select query - select array_to_json(array_agg(row_to_json(t))) ( select user_id, username dbuser ) t the resultant json structure above select query in postgres - [{user_id:"123",username:"abc"},{user_id:"234",username:"pqr"}] not understanding how read above json "select" query postgres , display values "user_id" , "username" separately in java. i beginner.any appreciated.thankyou in advance. you should use jackson - objectmapper class this objectmapper mapper = new objectmapper(); list...

polymer - Vaadin-Datepicker Min/Max limit not working -

i got 2 vaadin-datepickers in polymer project. 1 start-date , 1 end-date. want make sure end-date after start-date. read api-documentation can use min max properties. <vaadin-date-picker label="start date" value="{{item.startdate}}"></vaadin-date-picker> <vaadin-date-picker label="end date" min="{{item.startdate}}" value="{{item.enddate}}"></vaadin-date-picker> with above example nothing seems happen? i did test check if vars defined , if maybe format incorrect <vaadin-date-picker label="end date" min="2000-01-01" max="2000-12-31" value="{{item.enddate}}"></vaadin-date-picker> i checked version i'm using that's up-to-date 1.1.4 does know i'm doing wrong? min/max limits not supported in 1.1.4 release. from github documentation : https://github.com/vaadin/vaadin-date-picker/releases/tag/v1.2.0-alpha1

flash - Firefox ubuntu - unable to access video player -

i installed firefox on ubuntu. selenium test click on play button in video player. unfortunately, test fails everytime tries so. don't want play video on linux box. want test click on play button inside video. how install flash player on ubuntu box firefox can load flash players correctly? go here: https://get.adobe.com/flashplayer/ select apt in download dropdown , run it by default firefox prompt activate flash on site site basis. if trying automated tests may want disable can going about:addons in url bar , under entry flash, change ask activate setting active

html - Why doesn't my iron-list items reset when I have a div (still inside the list) on top of main elements? -

i have iron-list bunch of objects i'd them reposition upon occurring event changes input data iron-list. need each object reference top of list , have not found solution yet. way can them act absolute objects put div before main item see below. when change data number of items stay same , (as many new elements in array) reposition. if there more items left previous data, stay though binding heights read data. <iron-list id="myid" items="[[myinput]]" as="myitem" selection-enabled multi-selection> <template> <!-- have have main items position referenced top of iron-list --> <div id="referencediv" style="left:0px; float:left; width: 100%; min-height:1px; background-color:blue; top: 0px; display: none;"></div> <div id="mainitemid" style$="background-color:#fff; height:[[myitem.height]]px; top:[[myitem.top]]px; border-radius: 3px;...

c++ - How to use OpenCV VideoCapture class on Raspberry Pi? -

i have been trying access videocapture class perform image processing on each frame , keep obtaining series of errors, described in order: :-1: error: main.o: undefined reference symbol '_zn2cv12gaussianblurerkns_11_inputarrayerkns_12_outputarrayens_5size_iieeddi' /usr/local/lib/libopencv_imgproc.so.2.4:-1: error: error adding symbols: dso missing command line :-1: error: collect2: error: ld returned 1 exit status i using qtcreator , rasberry pi 3 . able load image disk why piece of code have literally pulled opencv docs not compile? i have ensured appropriate video linux drivers loaded entering terminal command: sudo modprobe bcm2835-v4l2 here link docmentation http://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html #include "opencv2/opencv.hpp" using namespace cv; int main(int, char**) { videocapture cap(0); // open default camera if(!cap.isopened()) // check if succeeded return -1; mat ed...

javascript - How to add header with colspan row in excel export - DataTable -

i'm using datatable excel export button. i've added header in excel export using javascript. but, how add row merge cells in header of excel data? , how can add header in every page of excel file? javascript var otable = $('#dataaksesad').datatable({ dom: 'bfrtip', buttons: [ { extend: 'excelhtml5', text: 'cetak', title: "monitoring ad_"+date, customize: function (xlsx) { var sheet = xlsx.xl.worksheets['sheet1.xml']; var numrows = 5; var clr = $('row', sheet); //update row clr.each(function () { var attr = $(this).attr('r'); var ind = parseint(attr); ind = ind + numrows; $(this).attr("r",ind); }); // create row before data $('row c ', sheet).each(function () { var attr = $(this...

neo4j - what does mean Open Transaction and Commit Transaction -

Image
i'm working on neo4j . faced 2 window : open transaction , commit transaction . what mean open transaction , commit transaction ? picture of neo4j: the neo4j browser used transactional cypher http endpoint execute cypher query. the browser first opened transaction (in "open transaction" phase) making request endpoint without passing cypher statement . it committed transaction (in "commit transaction" phase) making second request endpoint (with appropriate numeric transaction id), passing cypher statement.

swing - JPanel and Java layout managers -

having read on internet jpanel while feel still need clarification after reading it. questions: what jpanel used for? which layout manager flexible use? how position components @ areas using layout managers? i find difficult position components @ areas within container using layout manager. what layout manager recommend use or have use mixture of different ones? my first question jpanel used for. you know that. add components panel. my second question layout manager flexible use the more flexible layout manager, more complicated layout manager use. trick design gui logically , use multiple panels different layout manager achieve desire effect. each layout manager has own strengths , weaknesses. i find difficult position components @ areas within container using layout manager. that old thinking. should not trying position components specifically. position components , let layout manager adjust size of frame changed user. maybe want com...

javascript - Mongodb insert callback never called -

this question followup of this one , figured better ask new question post comment , necropost. (tl;dr give solution _id when collection inserted) i've tried .js bash script or in console doesn't seem work : var latest; db.collec.insert({test:"yes"},function(err,newdoc){ latest = newdoc[0]._id; }); the variable doesn't change. in console command returns writeresult({ "ninserted" : 1 }) lastest still void, , in js has same value before. is there way id without node.js ? should switch node.js ? my bash script mongo --eval '<my whole javascript>' you missing 1 piece in expression. var latest; db.collec.insert({test:"yes"},function(err,newdoc){ latest = newdoc.ops[0]._id; }); newdoc contains entire response mongo. newdoc.ops contains array of inserted row(s). newdoc.insertedids contains array of id's of inserted row(s). an alternative solution be: var latest; db.collec.insert({te...

r - RStudio Not Rendering Sankey -

looking identifying why code not render sankey in rstudio viewer or otherwise. think problem r version (3.3.1)...the packages i'm using built under 3.3.1. unfortunately organization takes awhile update enterpirse... library(devtools) library(rjson) library(igraph) library(rcharts) x = read.csv('./r/dataforr.csv', header=true) colnames(x) <- c("uid","from", "to", "avg.hours") sankeyplot <- rcharts$new() sankeyplot$set( data = x, nodewidth = 115, nodepadding = 110, layout = 132, width = 1500, height = 1300, units = "hrs", title = "new sankey" ) sankeyplot$setlib('http://timelyportfolio.github.io/rcharts_d3_sankey') sankeyplot the address in sankeyplot$setlib('http://timelyportfolio.github.io/rcharts_d3_sankey') incorrect. as per this question , should be: sankeyplot$setlib('http://timelyportfolio.github.io/rcharts_d3_sankey/libraries/widgets/d3_sankey')

asp.net mvc - MVC C# Controller Conflict (site front with area admin) -

Image
i can not figure out. how solve problem? adminareareistration cs public override void registerarea(arearegistrationcontext context) { context.maproute( "cmsadmin_default", "cmsadmin/{controller}/{action}/{id}", new { action = "index", id = urlparameter.optional } ); } routeconfig public static void registerroutes(routecollection routes) { routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.maproute( name: "default", url: "{controller}/{action}/{id}", defaults: new { controller = "default", action = "index", id = urlparameter.optional } ); } according error image, may use different namespaces when declaring area registerarea avoid naming conflict between default route , area route: adminarearegistration.cs public override void reg...

javascript - calling angularjs scope function from href link from cshtml file -

this cshtml contents: @model mbos.dto.viewmodel.others.reporttemplateviewmodel<mbos.dto.viewmodel.branchbocaanalysis> @if (model.includetableheader) {<thead> <tr class="no-borders"> <th>no.</th> <th>branch</th> <th>assessor</th> <th>rating</th> </tr> </thead> } @foreach (var row in model.models) { <tr> <td>@row.id</td> <td>@row.branch</td> <td>@row.assessor</td> <td><a href="javascript:angular.element(document.getelementbyid('branchanalysisctrl')).scope().ratingdetail();">@row.rating.formatdouble() </a></td> </tr> } this angularjs controller: (function () { 'use strict'; angular.module("app.branchanalysis", ["app.base.report"]) .controller('branchanalysisctrl', ['$scope',...

jquery - Parsing Filter Needed For Newline Delimited JSON format -

i'm running problem attempt automate api process bigquery. the issue need data in newline delimited json format go bigquery database data i'm pulling not that, need parse out. here link pastebin can idea of data looks like , also, here because: {"type":"user.list","users":[{"type":"user","id":"581c13632f25960e6e3dc89a","user_id":"ieo2e6dtsqhiyhtr","anonymous":false,"email":"test@gmail.com","name":"joe martinez","pseudonym":null,"avatar":{"type":"avatar","image_url":null},"app_id":"b5vkxvop","companies":{"type":"company.list","companies":[]},"location_data":{"type":"location_data","city_name":"houston","continent_code":"na","country_name":"...

javascript - Smartest way to gather and upload data from a Cordova app to server? -

i'm creating sixth cordova app, far complicated 1 – have upload user-submitted data server. data 9 different html text fields , user's coordinates (with cordova-plugin-geolocation). i've been googling hours, , i'm still quite lost. have little experience servers, absolutely none uploading data them cordova/js. figured guys , gals know lot more me, question is: what smartest way upload these ten strings of text single file on remote server? please note not single event, user must able upload several different sets of data on time without files overwriting previous files. there many users app, each user should have own subfolder on server, right? thank in advance!

php - Get post meta returns "" when meta is set in code and not by using post edit page -

in admin screen, have input box. user selects date in input input box. when user clicks button date put meta field called "_yl_lease_security_refund_date" through ajax call method uses update_post_meta. can verify update_post_meta works because get_post_meta , send value in ajax response. however, if leave screen , come it, get_post_meta call returns "" value of input box unless meta value changed through edit post page. how can meta value updates persist? here method ajax calls: function yeager_srr_post_date_refunded() { $result = 'not updated'; if ( defined( 'doing_ajax' ) && doing_ajax ) { $is_meta_updated = update_post_meta( $_post['lease_id'], '_yl_lease_security_refund_date', $_post['refund_date'] ); $meta_value = get_post_meta( $_post['lease_id'], '_yl_lease_security_refund_date', true); if( $is_meta_updated !== false) { $result = 'saved'; } e...

Nginx port available for all url -

i'm working docker , nginx , default.conf file : server{ listen 80 default_server; server_name localhost; location / { root /usr/share/nginx/html; } } server{ listen 80; server_name blog.domain.com; location / { proxy_pass http://my-ip:8080; } } so quick explanation : the defaut host serve html folder, no problem that. the url blog.domain.com serve wordpress application running on port 8080, no problem that. i have application running on port 8081 (phpmyadmin) , problem is, if try http://my-ip:8081 or blog.domain.com:8081 it's ok, can access phpmyadmin... why ? i don't want port 8081 available url on server. phpmyadmin work proxy_pass directive. can deny location whole earth. guess nginx not server listening on port 8080 80 else listening on 8080 , wish have nginx proxy server. in such case, work. minimum config : # first server block ...

html - Anchor breaks tilde -

i'm trying use tilde changing opacity of element, need element have anchor tag breaks transition. clearify have 2 elements. #china , , #map . when hover #china want #map change opacity. works when not having anchor tag infront. css: #china:hover ~ #map { opacity: 0.1; } html: <section id="map-container"> <a href="#article-info-china"><article id="china"></article></a> <article id="map"></article> </section> any appreciated. thank you this normal behavior. ~ selector won't trick because tries find #map element right after #china not case. in order work have oto set :hover selector anchor tag, this: a:hover ~ #map . this select #map element because right after ancor tag. but may not want have opacity when outside #china element.

avr - How to disable input pullup on Arduino (Atmega1284p). Regular methods don't seem to work -

using "mighty mini" board uses atmega1284p processor, arduino ide 2:1.0.5 on raspbian, mighty mini "board" files installed. i having erratic behavior on inputs, checked 'scope , seems although have not enabled internal pullup, have +3.3v appearing on input pin. need pin float. i ran simple test make sure wasn't coding issue: void setup() { pinmode(8, input); } void loop() { } according docs, should put pin in high impedance state. scope shows ~3.2 volts on pin when connect 1k resistor ground. pin being driven. i decided try accessing registers directly, eg: void setup() { ddra = 0; ddrb = 0; ddrc = 0; ddrd = 0; porta = 0; portb = 0; portc = 0; portd = 0; } void loop() { } this didn't work either.. still +3.3v on pin. i've tried different pins. i thought possibly board definition mighty mini have gotten register defines wrong.. it's worked in every other way.. actual application uses sp...

javascript - How can access variable from python file into js or node js -

i have 1 python file , has many variables. want access particular variable node js. i have tried python shell (which use python-nodejs integration) i.e pyshell.on('message', function(message) { console.log('from python script: ' + message); }) it prints messages sent python script (a simple "print" statement) output shows like from python script : today :11/17/2016 from python script: hello from python script: 123 but want particular message or value today:11/17/2016. how can that?

I want to get text from an excel file with its font style and weight using C# .net? -

while getting text excel resetting font style , structure. want exact text shows in excel sheet. if have sentence in words bold, want text bold also. you should try epplus ( http://epplus.codeplex.com/ ) creating excel workbooks, i'm sure has features processing excel files well.

Migrating Vaadin Portlet from Liferay 6.1 to Liferay 6.2 ga6 -

i trying migrate portlet liferay 6.1 liferay 6.2 ga6. portlet has vaadin integration version 7.6.5. getting error , need figuring out how proceed: .... @ com.vaadin.ui.ui.doinit(ui.java:682) @ com.vaadin.server.communication.uiinithandler.getbrowserdetailsui(uiinithandler.java:214) @ com.vaadin.server.communication.uiinithandler.synchronizedhandlerequest(uiinithandler.java:74) @ com.vaadin.server.synchronizedrequesthandler.handlerequest(synchronizedrequesthandler.java:41) @ com.vaadin.server.vaadinservice.handlerequest(vaadinservice.java:1409) @ com.vaadin.server.vaadinportlet.handlerequest(vaadinportlet.java:544) @ com.vaadin.server.vaadinportlet.serveresource(vaadinportlet.java:626) @ com.liferay.portlet.filterchainimpl.dofilter(filterchainimpl.java:122) @ com.liferay.portlet.scriptdataportletfilter.dofilter(scriptdataportletfilter.java:82) @ com.liferay.portlet.filterchainimpl.dofilter(filterchainimpl.java:116) @ com.liferay.portal.kernel.portlet.portletfilterutil.dofilter(po...

MODX - Template variable that hides post author when checked -

so using add-on articles create press release section on site. need create template variable check box , if checked not show post author: [[*publishedby:userinfo=`username`]] what best way me this. if checkbox tv input option value " hide==1 " use output filter this: [[*your_tv:ne=`1`:then=`[[*publishedby:userinfo=`username`]]`]]

PHP/Laravel, foraeach: ($array as $value) works, ($array as $key => $value) does not?! -

i have no idea how explain question in way giving example. hope ok. i defined 2 arrays: $range = ['1000' => '1100', '1100' => '1200', '1200' => '1300']; and $years = ['2010', '2011']; then try data given database like: foreach ($years $year) { foreach ($range $from => $to) { $result[$year][$from] = flight::leftjoin('aircrafts', 'flights.lfz_lfdnr', '=', 'aircrafts.lfz_lfdnr') ->selectraw('aircrafts.gewicht, sum(flights.anzldg) landungen') ->whereyear('datum', '==', $year) ->where('gewicht', '>=', $from) ->where('gewicht', '<', $to) ->count(); }; }; which works output like: { "2010": { "1000": 821, "1100": 979, "1200...

android - Run react native project into samsung device -

Image
last week start learn react native , used android emulate run , debug application when finished first project need run app android deivce , go react native page , done steps here got same error every time how can solve problem ? important me , :) edit after add ip address dev menu project in device , reload js got error your android device needs connect build server running on laptop. assuming both phone , laptop on same network, fetch laptop's ip address , key in settings menu, invoked launching developer menu. more details here: https://facebook.github.io/react-native/docs/running-on-device-android.html

Ms Access 2013 Database -

i have create database in table name approved_schedule has column name fileno, stdname, amount1, amount2, , want add amount column in query process have written query. for example: fileno = 7100, amount1 = 19430 , aoumnt2 = 0; select sum(amount1 + amount2) 'total payment' approved_schedule fileno = 7100; but query result total payment = 0; what should do? you need group if you're doing sum. group fileno

android - Update activity's TextView from EditText value within ListView's item -

Image
so, have activity textview , listview custom baseadapter. activity looks this: as can see, every item of list custom layout , basic idea is: every time numeric edittext within changes, "total" textview activity (which sum of prices of every product) must updated well. i suppose must somehow done adapter class, don't know how it. my activity file looks (it gets products data server via "getcollectionproducts" asynctask, set adapter): public class productaisleactivity extends appcompatactivity implements view.onclicklistener{ listview productlist; button participate; imagebutton search; edittext searchet; textview productstotal; product[] colproducts; relativelayout collectionheader; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_product_aisle); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); getsupportact...

admin - Generating CREATE TABLE statements for Cassandra keyspace -

in cassandra, there way generate create table statements existing tables inside particular keyspace? desc keyspace keyspace_name output cql commands given keyspace. these cql commands can used recreate keyspace , tables.

Conditionally adding a property in TypeScript -

i'd conditionally add property object (or maybe mean class - unsure of actual semantics in typescript). import imetadata './metadata-interface'; export default class metadata { [idx: string]: imetadata; public 'foo' = { name: 'foo', } imetadata; public 'bar' = { name: 'bar', } imetadata; }; but how conditionally add bar object? can like: export default class metadata { [idx: string]: imetadata; public 'foo' = { name: 'foo', } imetadata; if(condition) { public 'bar' = { name: 'bar', } imetadata; } }; use if statement: export default class metadata { [idx: string]: imetadata; public 'foo' = { name: 'foo', } imetadata; public 'bar'?: imetadata; constructor(condition: boolean) { if (condition) { this.bar = { nam...

excel - Add Total Row For Columns D - M -

i have been using syntax add total row column d - need add total row d - m. instead of writing code multiple times , changing column name there quick re-usable function add total row bottom of columns d - m? with activesheet if application.worksheetfunction.counta(.cells) <> 0 lastrow = .cells.find(what:="*", _ after:=.range("d1"), _ lookat:=xlpart, _ lookin:=xlformulas, _ searchorder:=xlbyrows, _ searchdirection:=xlprevious, _ matchcase:=false).row else lastrow = 1 end if end range("d" & lastrow +1).formular1c1 = "=sum(r[-" & lastrow & "]c:r[-1]c)" this has same effect highlighting range , hitting ctrl+right arrow range("d" & lastrow + 1 & ":m" & lastrow + 1).fillright

Excel VBA Follow Hyperlink to Separate Workbook and AutoFilter by Value in Source Workbook -

i'm totally new vba please bare me. have code allows me follow hyperlink separate sheet within same workbook , filter such sheet value associated hyperlink. note create hyperlink first , outside of vba process. how did it: a) open visual basic under developer tab b) right-click workbook want add macro , click insert >module c) copy , paste following code module: sub filter(scriteria string) lfield = cells(1, 1).entirerow.find("isometric number", lookin:=xlvalues, lookat:=xlpart, searchorder:=xlbycolumns, searchdirection:=xlnext, matchcase:=false).column range("a1").autofilter field:=lfield, _ criteria1:=scriteria end sub my understanding module tells workbook autofilter column named isometric number on hyperlinked tab particular value called out below. can change column name whatever want, needs changed in module , on tab want autofilter occur. d) copy , paste following code main tab (expand microsoft excel objects , double click main ta...

reactjs - React - Element type is invalid - how to debug this error? -

Image
how can error message given react debugged ? figure out causing ? googled error seems caused different things. invariant.js:38 uncaught invariant violation: element type invalid: expected string (for built-in components) or class/function (for composite components) got: object. given code: // @flow import react 'react'; import reactdom 'react-dom'; import { createstore , combinereducers} 'redux' import deepfreeze 'deepfreeze' import expect 'expect' var _ = require('lodash') type state$todo = { text:string; completed:boolean; id:number; }; class todo { static make(t:string,id:number):state$todo{ return {text:t,id:id,completed:false} } static toggle(t:state$todo):state$todo { return {...t, completed:!t.completed}; } }; type action$setvisibilityfilter = { type:'set_visibility_filter', filter:state$visibilityfilter }; type action$add_todo = { type:'add_todo', text:string, id:...