Posts

Showing posts from January, 2015

php - Magicsuggest setValue() changes when move to other field -

on selectionchange setting new value when focus out setvalue change. here code : var ms=$('#mydiv').magicsuggest({ usecommakey: true, hidetrigger: true, placeholder: 'search here', allowduplicates: false, data: '/getdata.php', ajaxconfig: { xhrfields: { withcredentials: true, } }, valuefield: 'name', renderer: function(data){ return data.full_name; }, resultasstring: true }); $(ms).on('selectionchange', function(e, cb){ var response = cb.getvalue(); var respone_ary = response.tostring().split(','); if(respone_ary.length > 1){ this.removefromselection(cb.getselection()); this.setvalue(respone_ary); } }); for example : in response getting ...

android - Response with non-Latin letters using Volley (UTF-8) -

i'm using volley download text files website. this content of sample text file: neon wönn 30€ kostüm größter spaß testtesttesttest★★★★testtest:::test i put in notepad , selected 'encoding utf-8' in savefiledialog. in filezilla in server manager selected 'force utf-8' before uploaded file. when download volley response this: neon wönn 30⬠kostüm gröÃter spaà testtesttesttestââââtesttest:::test here method: public static void getrequest(string url) { requestqueue queue = volley.newrequestqueue(activity); stringrequest stringrequest = new stringrequest(request.method.get, url, new response.listener<string>() { @override public void onresponse(string response) { //response gibberish :/ } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { log.e("volley...

chai - Writing sad path test for Yeoman generator -

i have yeoman generator requires argument. want write test confirm throws error if generator called without arguments. i have tried many variations similar following code. 'use strict'; var path = require('path'); var assert = require('yeoman-assert'); var helpers = require('yeoman-test'); var chai_assert = require('chai').assert; describe('my yeoman generator', function(){ it('will barf without arguments', function(done) { this.timeout(0); var fn = function() { helpers.run(path.join(__dirname, '../generators/app')) .on('end', done); }; chai_assert.throws(fn); }); }); chai's assert.throws doesn't catch exception 1 thrown. i'm not sure why error thrown chai doesn't catch it. appreciated. the error message given is 1) yeoman generator barf without arguments: assertionerror: expected [function: fn] throw error @ function.assert.throws (node_modules/c...

Parsing JSON in Android using AsyncHttpClient -

i need parse json android application, i’m getting error: org.json.array cannot converted jsonobject what want take json server , parse textviews had made i’m using asynchttpclient, here code. asynchttpclient client1 = new asynchttpclient(); client1.get("http://mahmoudfa-001-site1.atempurl.com/appetizers.json",new texthttpresponsehandler() { @override public void onfailure ( int statuscode, header[] headers, string responsestring, throwable throwable){ } @override public void onsuccess ( int statuscode, header[] headers, string responsestring){ log.i("a1", responsestring); //testing if server responding. toast.maketext(getapplicationcontext(), responsestring, toast.length_long).show(); try { jsonobject job = new jsonobject(responsestring); jsonarray arr = new jsonarray(build); //string arrlen = integer.tostring(arr.length()); jsonobject na = a...

java - How to transform a string such that it only contains vowels which have occurences equal or greater than their given values? -

i asked question in interview. have string s (all lowercase characters) need make new string p such : the total number of a 's in string should equal or greater given value of int variable a . the total number of e 's in string should equal or greater given value of int variable e . the total number of i 's in string should equal or greater given value of int variable i . the total number of o 's in string should equal or greater given value of int variable o . the total number of u 's in string should equal or greater given value of int variable u . constraint in order resultant string, can replace character other lower case character. can number of times each replacement has cost associated it. cost of replacing c1 c2 absolute difference of ascii value of c1 , c2 . eg. replacing b e has cost 3 , c a has cost 2. we need find minimum cost of converting s p. given is: string s five ints - a, e, i, o, u my approach first sort string, d...

Visual Studio: Unit Testing Universal Windows Class Libraries -

i using visual studio 2015 community edition: have created blank app (universal windows): template found in c# -> windows -> universal. i have created class library (universal windows) in same solution: template found in c# -> windows -> universal now intend create unit test project test class library created earlier. now not see unit test project templates in universal windows section (they kind of test apps or ui tests, not suitable testing class libraries directly, think). so tried creating normal unit test project :(template in c# -> test -> unit test project) and when try add reference class library (universal windows) complains cannot add project reference. can suggest how go solving problem?

windows - Batch File delete newest file -

how delete newest file in folder using batch script? all results have found show how delete oldest files or delete them after n days. links : batch file delete files older n days , batch script delete oldest folder in given folder thank you for /f %%a in ('dir /b /o-d /a-d %the_directory%') echo("%the_directory%\%%a"&goto deldone :deldone would approach. rudely escapes for loop having deleted first filename encountered in sorted-in-reverse-date-order ( /o-d ) list. this saves having read entire list. not such problem few files, can pain thousands. the required del command merely echo ed testing purposes. after you've verified command correct , change echo(del del delete files.

Android: How to create tutorial at app start like in Google Analytics app? -

Image
in app want have tutorial when user installs app first time. used google analytics app , way looks perfect me. i have seen such views in other apps well. standard view or library exist it? or have write scratch using view pager? in advance !! i think this 3rd party library best these types of tutorials.here 1 screen shot: this library. another 1 here. you can try this. and last 1 favourite. you can use this viewpageindicator also. to make sure tutorial shown 1st time, can use shared preference. sample code is: public class mainactivity extends activity { public static final string myprefs = "myprefs"; ... @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); sharedpreferences sp = getsharedpreferences(myprefs, context.mode_private); if (!sp.getboolean("first", false)) { sharedpreferences.editor editor = sp.edit(); ...

materialize - Materializecss chips in Rails 4 doesn't save data to db -

i have problem material chips in rails (4.2.6) app. when add class chips-initial input field, can't write data field. field nil. don't understand why. field string, when field array, got same problem. this form: = simple_form_for @exemple |f| .input-field = f.input :title .input-field = f.label 'content' = f.text_area :content, class: "materialize-textarea" .input-field.chips.chips.chips-initial.chipschips-placeholder = f.input :tags = f.button :submit, class: 'btn btn-primary' this .js initial chips $( document ).ready(function(){ $('.chips-initial').material_chip({ data: [{ tag: 'apple', }, { tag: 'microsoft', }, { tag: 'google', }], placeholder: 'enter tag', secondaryplaceholder: '+tag', } ) }); in html: <div class="input-field chips chips chips-initial chipschips-placeholder" data-index="0" data-i...

How can I read what is in a database and checking if a certain string is in there? i am using python with sqlite3 -

instead of reading , fetching data database, how go reading database , checking piece of data in there? i have created database login system holding emails, passwords etc , user whether or not have login. at moment users can create login, if have one, read through database , check email have typed in in there , if password matches 1 stored email. sqlite databases files, simplest method of retrieval going to query database. you query email , password combination , verify against user has entered. imagine have simple schema name, email, password , run sql command select email, password table name == (name of user) . if you're using python client, cursor object, , call cursor.fetchall() method return tuples of results. in case there should 1 or 0 results, should easy handle.

javascript - how to install or user Angular 2 in Codeigniter 3 -

i running codeigniter 3x have use , learn month , wanna start learn js framework not know how install/use angular in codeigniter ? use angular in codeigniter ? if use directory. codeignter_project/ ------------------|application ------------------|assets ------------------------|bootstrap_3.3.7 ------------------------|jquery_3.1.0 ------------------------|my_lib ------------------------|nicescrol_3.6.8 ------------------|system ------------------|application ------------------|index.php is there any1 have use angular in codeigniter 3x please share experience thank in advance. at first, try complete angular js basics. otherwise, difficult understand execution flow. yes, it's idea. can use angular js codeigniter. how install it include angular js inside head using cdn or keep inside assets folder & include other scripts. then define ng-app, ng-model, ng-bind etc inside views & desired output.

html - className:hover #myID {style} -

im trying have description text on mye card(box) move 10px when hover on over pictures. reason city name text , button follows it. no hover in card (img) here hover (img) as u can see on second img. button jumps too. html code card text , city name , button <div class="cards_container"> <div class="card" id="card_oslo"> <p class="cardcityinfo"> oslo er et kult sted <br> hvor det er mange <br> turister året rundt. <br> så dra og besøk. </p> <h4 class="card_text">oslo</h4> <a href="#"><h5 id="btn_card">se mer</h5></a> </div> css code style, , how tried code :hover effect on desc. text on cards. ".card:hover .cardcityinfo" 1 i'm trying hover on text .cardcityinfo{ font-size: 1.1rem; font-family: 'nunito', sans-serif; color: #f...

Implementing Semigroup for dependent pair in Idris -

i'm trying implement semigroup interface simple dependent pair in idris, doesn't compile : semigroup (n ** vect n f) (<+>) (_ ** xs) (_ ** ys) = (_ ** xs ++ ys) with error type mismatch between ty , nat but compile : mypair:type -> type mypair f = (n ** vect n f) semigroup (mypair f) (<+>) (_ ** xs) (_ ** ys) = (_ ** xs ++ ys) why ? best way accomplish ? idris faq : if use name in type begins lower case letter, , not applied arguments, idris treat implicitly bound argument. one approach solving problem rid of syntactic sugar , explicitly bind n this: semigroup (dpair nat (\n => vect n f)) (<+>) = (_ ** xs) (_ ** ys) = (_ ** xs ++ ys) another approach use upper-case letter vector length: semigroup (n ** vect n f) (<+>) = (_ ** xs) (_ ** ys) = (_ ** xs ++ ys) here, n not bound in semigroup implementation, , allows dpair syntactic sugar kick in , bind n did in first variant. as mypair ...

json - JavaScript: Stringify a shallow copy of a circular referenced object? -

is there way shallow copy of below 1 layer deep? have means fix using different design wondering if else had ran trying convert string before. var someobjclass = function() { var self = this; this.group = { members: [self] }; }; var p = new someobjclass(); var str = json.stringify(p); it's little unclear you're asking, if goal stringify circular object, you'll have override tojson specify how you'd object represented function someobjclass () { var self = this; this.group = { members: [self] }; } someobjclass.prototype.addmember = function(m) { this.group.members.push(m); }; // when stringifying object, don't include `self` in group.members someobjclass.prototype.tojson = function() { var self = this; return { group: { members: self.group.members.filter(function (x) { return x !== self }) } }; } var = new someobjclass(); var b = new someobjclass(); a.a...

Excel - Array formula with gap -

currently have formula working fine array formula, determine maximum differences between values of 2 arrays: {=max(abs(d3:n3-aw3:bg3))} i trying exclude 1 pair of values middle of both arrays (cells l3 , be3 respectively). not work: {=max(abs(d3:k3;m3:n3-aw3:bd3;bf3:bg3))} i getting "too many arguments"error; error make sense abs function's perspective - semicolon argument separator. how can 1 work gaps in arrays (i.e. - non-adjacent cells) ? instead of using ';' can use ':'. below formula work you. {=max(abs(d3:k3-aw3:bd3), abs(m3:n3-bf3:bg3))}

Django ImportError for valid import -

i think best explained little code. aware weird relationships between data hack inlines working many-to-many relationships. the app "data" has following models.py: from crawler.models import crawljoin class website(models.model): hack = models.foreignkey(crawljoin, null=true, blank=true, editable=false) the app "crawler" has following models.py: from data.models import website class crawljoin(models.model): pass class crawl(models.model): websites = models.manytomanyfield(crawljoin, through='website') if try migrate either crawler or data, following error: importerror: cannot import name 'crawljoin' do know how can resolve issue? far can tell, should not getting error... thank you. you have circular import because both models modules trying import each other. can break circular import removing import , using string in foreign key: hack = models.foreignkey('crawler.crawljoin', null=true, blank=true...

UML Diagram When Class has both Is-a and Has-a relationship -

Image
i wondering how present class has both "has-a" , "is-a" relationship class in uml diagram. i wondering if correct: a realize relation used either <<interface>> or abstract class. design this: n.b.: triangle realization must not overlap class touch it. there's typo: seal instead of sell .

methods - Javascript, Object prototype - avoid writing full path -

i know title may not clear, i'll try best explain i'm trying achieve. i know modifying prototypes frowned upon, , reason, i'm trying figure out way without adding more 1 item prototype. i know along lines of object.prototype.collection = {}; object.prototype.collection.method1 = function(){ . . . }; object.prototype.collection.method2 = function(){ . . . }; object.prototype.collection.method3 = function(){ . . . }; etc. and whenever wanted use 1 of methods call objectinstance.collection.method1(); the problem can pretty wordy , tedious, not mention if you're calling hundred methods collection, word 'collection' hundred times redundant , waste of bytes. so hoping technique of creating methods in manner, without having write full path every time. i.e. write objectinstance.method1(); and know right look. my thought process @ point calling latter throw method not exist error. i'm curious if there manner of intercepting error? for insta...

sql - MySQL data type for a field with only two possible options -

i'm trying work out data type use field in database can 1 of 2 options: 'dual' or 'solo'. i realise boolean can't use tinyint(1) because inputs not numbers. if give me idea of use in situation appreciated :) you can use enum colname enum('dual', 'solo') internally stored tinyint , when storing , retrieving use strings. or use tinyint . terms "dual" , "solo" refer 2 , 1 participants, have participants tinyint(1) and store 1 solo , 2 dual .

Angular 2: Chaining RxJS Observables in Route Resolver -

i trying data chain of observables in resolver. first need make http call types , array returned, need loop through array of types , data each type. @ end, want return array or of data each type @ once (before navigating route). getalltypesdataresolverfunction() { this.getalltypes() .flatmap(data => { let alltypesdata = []; data.foreach(i => { if(i.type === 4) { alltypesdata.push({'typeobj': i}); return observable.forkjoin([this.getdatafortype(), this.getmoredatafortype()]) .subscribe(data => { let arraylength = alltypesdata.length-1; alltypesdata[arraylength].typeobjdata = data; }) } }) return alltypesdata; }).subscribe(data => { return data; ...

MongoDB - how to search fields with different data types? -

i search multiple fields in document. each of these fields of type date , string or number . have tried using $or query using regex search search term, search within field of type string : somecollection.find({ $or: [ {sometext: /searchterm/}, {somedate: /searchterm/}, {somenumber: /searchterm/} ] }); is posisble search across fields different data types?

javascript - Firebase remove node based on child value -

i want delete entire node query delete * user_id = "-ktrupwryo9wfj-tf8ft" how can achieve on firebase? -kvpqfxnzqkzzrowhxgk answer: "1" question_number: 2 user_id: "-ktrupwryo9wfj-tf8ft" -kvpqfxodhsamjyfnjy7 answer: "4" question_number: 25 user_id: "-ktrupwryo9wfj-tf8ft" to delete references child having particular value first need retrieve keys ('-kvpqfxnzqkzzrowhxgk', '-kvpqfxnzqkzzrowhxgk' in case) equalto query , delete references remove function. a sample code here. var ref = firebase.database(); //root reference data ref.orderbychild('user_id').equalto('-ktrupwryo9wfj-tf8ft') .once('value').then(function(snapshot) { snapshot.foreach(function(childsnapshot) { //remove each child ref.child(childsnapshot.key).remove(); }); });

Using ng-bootstrap with angular-cli 1.0.0-beta.18 -

i'm using angular-cli 1.0.0-beta. 18 , trying load ng-bootstrap using guidline @ https://ng-bootstrap.github.io/#/getting-started steps: install ng-bootstrap using npm install --save @ng-bootstrap/ng-bootstrap added following app.module.ts import {ngbmodule} '@ng-bootstrap/ng-bootstrap'; @ngmodule({ declarations: [appcomponent, ...], imports: [ngbmodule.forroot(), ...], bootstrap: [appcomponent] }) export class appmodule { } for ibox-tools.module.ts have import {ngmodule} "@angular/core"; import {browsermodule} "@angular/platform-browser"; import {iboxtoolscomponent} "./ibox-tools.component.ts"; import {ngbmodule} '@ng-bootstrap/ng-bootstrap'; @ngmodule({ declarations: [iboxtoolscomponent], imports : [ngbmodule, browsermodule], exports : [iboxtoolscomponent], }) export class iboxtoolsmodule {} and try use ngbdropdown module in ibox-tools.template.html <div class="col-xs-6"...

swift - Video Asset in Xcode 8 -

i'm working on first ios app in xcode 8 using swift i'm having trouble getting video work on button press. need asset it's downloaded part of app , need call asset folder cannot figure out how it. documentation i've looked @ talks pictures , sound clips have not been able find regarding videos. appreciated.

uwp - Prism-Mvvm app deployment error on Mobile Emulator -

i got exception when deploying simple prism.mvvm app on mobile emulator 10586,while works on simulator on local machine. referencing prism.storeapps package.here code app.xaml.cs namespace mvvmsample { sealed partial class app : mvvmappbase { public app() { initializecomponent(); } public enum expirences { main } protected override task onlaunchapplicationasync(launchactivatedeventargs args) { this.navigationservice.navigate(expirences.main.tostring(), null); return task.fromresult<object>(null); } } } mainpage.xaml <controls:pagebase x:class="mvvmsample.views.mainpage" xmlns:controls="using:mvvmsample.controls" xmlns:prism="using:microsoft.practices.prism.mvvm" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/...

java - how to associate users to a location android -

i parsequery on parseclass called useractivity try pull of user's location , go through each of locations. however, keep failing on constructing proper user list: i understand if there's nothing in list, should create , add new item. point, should check if each user within 50 feet of item's location. else if list has @ least 1 item, should check if user there already, if not add user. i keep doing until reach end of user list. my code below taking approach: can't seem right results. ideas? parsequery<parseobject> cp = new parsequery<>("useractivity"); cp.whereequalto("currenthotspot","none"); cp.whereequalto("venueid","empty"); cp.wherewithinmiles("userlocation",mypoint,10.0); details hpitem; try{ list<parseobject> qreply = cp.find(); if(qreply.size()>0){ for(int = 0; i<qreply.size();i++){ string user = qreply.get(i).getstring("userid"); pars...

HTML - How do css/javascript files get loaded? -

good day! i have stumbled on problem, , can't seem wrap mind around it. let's loading page url http://example.com/home . load html index.php , displays css , js attached. works charm , how want work. the problem comes in here, if request url http://example.com/home/test . still load same html, how made work. now, doesn't load css , js files anymore used design. don't have old content anymore in them, content of page itself. clearify: my css @ first , how it's loaded @ first url example. body{ margin: 0; background:rgb(0,0,1);} 2nd url css result <html> html loaded, not css anymore </html> edit : the html file load same on , on again, doesn't listen url load file, require_once same html file. path's js , css static . my question : how css , js files loaded? how can remove effect of /test in loading files. i hope explained enough, if not, please , try make more clear. what need load css or json file spec...

java - Wait for two conditions simultaneously Helium -

i'm using these 3 lines: waituntil(text("wait").exists, 900); switchto("testing"); click(point(995, 440)); i'm waiting text show up, clicks button in different tab, if want have listen "go" simultaneously , have click different button? waituntil(text("go").exists, 900); switchto("testing"); click(point(1100, 440)); i have no way of knowing show first. i've tried working around if conditions, can't seem work quite how want to. ideas on how make happen? i ended putting 2 if statements in refresh loop, "works", it's not ideal. it's slow (too slow) , quits. other ideas? public static void repeatscript() { refresh(); if (text("wait").exists()) wait(); if (text("go").exists()) go(); repeatscript(); }

apache - How do I start plack application on boot -

does know how start plack application on boot. the os raspbian(raspberry pi). think have run normal user(pi). that's how start manually. i have tried adding rc.local without success su pi -c 'cd /path/to/app && plackup -d -p 5000 -r -r ./lib,./t -a ./bin/app.psgi &' this in-turn used apache , app written in dancer2 if makes difference. the issue perl 5 environment variables not initialised (which in .bashrc). so solution run plackup command inside bash -i reads .bashrc or set perl5lib before invoking plackup

Accessing Data in a ARRAY using PHP -

this question has answer here: how extract data json php? 2 answers i not sure how access data in array 1 have showen below. as im trying summonerid, wont it. my current code is: $gettierlist = data showen $summonerid = $gettierlist['summonerid']; i have tried $summonerid = $gettierlist->summonerid; and $summonerid = $gettierlist['29161162']->summonerid; and nothing work. how can data want out of this? { "29161162": { "summonerid": 29161162, "pages": [ { "id": 24193964, "name": "nida", "current": false, "slots": [ { "runeslotid": 1, "runeid": 5273 }, { "runeslotid": 2, "runeid": 5273 }, { "runeslotid": 3, ...

arrays - Find standard deviation from text file with integers -

i have file containing list of numbers needs stored in array. how can compute population standard deviation of array? main class doesn't need altered. main import java.io.bufferedreader; import java.io.filereader; public class main { private static int numbers=20; public static void main(string[] args) { double[] mynumbers = new double[numbers]; calculations calculations = new calculations(); try { calculations.readfile("numbers.txt", mynumbers); double stddev = calculations.computestandarddeviation(mynumbers); system.out.println("population std dev = " + stddev); } catch (exception e) { e.printstacktrace(); } } } calculations import java.io.bufferedreader; import java.io.filereader; public class calculations { // read integers text file, use myarray.length number read // read numbers text , convert doubles. public void readfile(string filename, double[] myarray) throws exception { filerea...

database - The best way to store many uneven vectors in R? -

the real data (for each year , each id there list): year1_id1 <- list() (k in 1:1000) {year1_id1[[k]] <- rnorm(floor(runif(1,1,1000)),0,5)} and have 16 years , each year there 100-1000 ids. know list way store data 1 year , 1 id, not sure best way store many years , ids together.

Implicit ExecutionContext priority in Scala 2.12 -

in scala 2.12 importing global execution context , having implicit execution context defined in scope results in ambiguous implicit, while in 2.11 works fine. import scala.concurrent._ import scala.concurrent.executioncontext.implicits.global class a(implicit ec: executioncontext) { x = implicitly[executioncontext] } compiler gives error: error: ambiguous implicit values: both lazy value global in object implicits of type => scala.concurrent.executioncontext , value ec in class of type scala.concurrent.executioncontext match expected type scala.concurrent.executioncontext val x = implicitly[executioncontext] ^ what cause of , how work around in code? the spec treats overload resolution disambiguation of selection of members of class. implicit resolution uses static overload resolution choose between references not members. arguably, following misinterpretation of spec, since zzz defined in class derived x yyy is: $ s...

java - Convert certificate string to byte array -

i got string represents pem certificate: -----begin certificate----- miicutccafugawibagibadanbgkqhkig9w0baqqfadbxmqswcqydvqqgewjdtjel makga1uecbmcue4xczajbgnvbactaknomqswcqydvqqkewjptjelmakga1uecxmc vu4xfdasbgnvbamtc0hlcm9uzybzyw5nmb4xdta1mdcxntixmtk0n1oxdta1mdgx ndixmtk0n1owvzelmakga1uebhmcq04xczajbgnvbagtalbomqswcqydvqqhewjd tjelmakga1uechmct04xczajbgnvbastalvomrqwegydvqqdewtizxjvbmcgwwfu zzbcma0gcsqgsib3dqebaquaa0samegcqqcp5hng7ogbhtlynpos21cbewke/b7j v14qeyslnr26xzussvko36znhiao/zbmoorckk9vecgmtclfuqtwdl3ragmbaagj gbewga4whqydvr0obbyeffxi70krxeqdxzgbacqor4judncemh8ga1udiwr4mhaa ffxi70krxeqdxzgbacqor4judnceovukwtbxmqswcqydvqqgewjdtjelmakga1ue cbmcue4xczajbgnvbactaknomqswcqydvqqkewjptjelmakga1uecxmcvu4xfdas bgnvbamtc0hlcm9uzybzyw5nggeamawga1udewqfmambaf8wdqyjkozihvcnaqee bqadqqa/ugzbrjjk9jcwndvfghlk3icnrq0ov7ri32z/+hqx67arfgzu7kwdi+ju wm7dcfrpngvwfwuqomspue9rzbgo -----end certificate----- i assigned above string string variable string mycertstr . what proper way convert myc...

java - A Graph data structure with simultaneous node coordinates update -

i exploring efficient way (static) graph data structure allow me easy access node coordinates; given operations involving coordinate data needed, stored in matrix class (for instance, privided n nodes in 2d space, have nx2 matrix). the initial idea have class node attributes (including x , y coordinates in tuple, example), class graph contain array of node objects, , matrix of coordinates of these nodes. how achieve simultaneous two-direction update of matrix entries , node coordinate entries (whenever touch node 4, 4th row of matrix changes simultaneously :: whenever touch 4th row of matrix, tuple (x, y) of node 4 changes simultaneously)? please feel free propose alternative ways of data representation. understand above may work update method, avoided?

asp.net webhooks - Debugging with Source and Symbols is not working -

this documented tells how setup repository , work locally, debugging source , sumbol . after following steps, tried run bitbucket receiver sample . unfortunately, after several tries getting exception: not load file or assembly 'microsoft.aspnet.webhooks.common' or 1 of dependencies. strong name signature not verified. assembly may have been tampered with, or delay signed not signed correct private key. (exception hresult: 0x80131045) any on highly appreciated.

html - Allow image overflow in "overflow: hidden"-based navigation -

i trying rebuild batman nav left-aligned centered logo image. added additional li class: <li><a href="#">link 1</a></li> <li><a href="#">link 2</a></li> <li class="logo_nav"><a href="/"><img src="image-url" /></a></li> <li><a href="#">link 3</a></li> <li><a href="#">link 4</a></li> and second logo class align logo on left if screen size decreases: <div class="logo_left"><a href="/"><img src="image-url" /></a></div> my problem: overflow: hidden; in main class not allow overflow on centered image. when delete overflow: hidden; main class , add exceptions nav classes, whole design explodes on smaller screens. does have idea on approach or knows bette...

javascript - Using ReadableStream as HTML <img> source -

i'm using fetch dynamically load images server. how use returned readablestream image source in html? in code example below data.body readablestream, how set images source in web page? there way use pipe image source? imageservice.js getimage(key) { if(key != null) { return this._downloadimagemap().then((imagemap) => { let uri = imagemap[key]; if(uri != null) { return this.client.fetch(uri).then((data) => { return data.body; }); } else { throw new error('image not found'); } }); } else { return promise.reject(new error('no key specified')); } } example desired usage (does not work): this.imageservice.getimage(this.skill).then((imgstream) => { $('#theimage').attr('src', 'data:image/png;base64,' + imgstream); }); slightly different in way don't return im...

javascript - Canvas - make element do a smooth turn given radius and angle -

i'm trying figure out how make element move js in canvas, here's have prepared: https://jsfiddle.net/ge1o2bt1/ . so example, want constructor function on "particle" have function called turn can pass angle, , radius , turn example if it's going x++; y+=0 after turning 90º should go x+=0; y++ . here's code moves object (inside constructor): this.move = function(){ this.x+=1; }; then it's drawn on canvas based on x , y position. in advance, tried lot of things using math.cos , math.sin or using context.rotate save() , restore() . i'm not in math couldn't figure out how it. edit: using tutorial refactor code , made this: https://jsfiddle.net/g2c9hf1p/ . when click, object turns x degrees(i set 90) can't give radius because it's dependant on speed. you use variable direction , array objects, whicht keeps increments coordinates. var direction = 0; var directions = [{ x: 1, y: 0 }, { x: 0, y: 1 }, { x: -1, y: 0 }...

Communication between C# and Java -

i want use grpc in c# , java. c# should act server , java client. i windows user , not know, how generate proto file c# , java. on website, found tutorials specific language not different languages. using grpc in both c# , java should easy using them individually. need use same .proto file generate code each. .proto defines methods , messages both c# , java compatible with. if @ each set of examples, each use same .proto (i.e., helloworld.proto or route_guide.proto ). examples compatible between languages (i.e., c# helloworld server can communicate java helloworld client). specifying grpc services in proto files pretty straight-forward; i'd assume looking @ examples make clear enough. more information defining proto messages, may take @ protobuf documentation .

Why does Jetty's cross-origin filter cause the server to crash? -

as instructed in http://www.eclipse.org/jetty/documentation/current/cross-origin-filter.html , enable cross-origin requests on jetty-8.1.18.v20150929 (bundled basex 8.5), downloaded jetty-servlets-8.1.18.v20150929.jar , , placed in web-inf/lib. also, in web.xml, added: <filter> <filter-name>cross-origin</filter-name> <filter-class>org.eclipse.jetty.servlets.crossoriginfilter</filter-class> <init-param> <param-name>allowedorigins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>allowedmethods</param-name> <param-value>get,post,options</param-value> </init-param> <init-param> <param-name>allowedheaders</param-name> <param-value>*</param-value> </init-param> </filter> <filter-mapping> <filter-name>cross-origin</filte...

ms word - Converting Docx Files To Text In Swift -

i have .docx file in temporary storage: let location: nsurl = nsurl.fileurlwithpath(nstemporarydirectory()) let file_name = location.urlbyappendingpathcomponent("5 november 2016.docx") what want extract text inside document. cannot seem find converters or methods of doing this. i have tried this: let file_content = try? nsstring(contentsoffile: string(file_name), encoding: nsutf8stringencoding) print(file_content) however prints nil. so how read text in docx file? your initial issue how string url. string(file_name) not correct way convert file url file path. proper way use path function. let location = nsurl.fileurlwithpath(nstemporarydirectory()) let fileurl = location.urlbyappendingpathcomponent("my file.docx") let filecontent = try? nsstring(contentsoffile: fileurl.path, encoding: nsutf8stringencoding) note many changes. use proper naming conventions. name variables more clearly. now here's thing. still won...

htmlunit - Get a non-id form with HTML-UNIT C# -

so i've got htmlpage 2 forms in it, not 1 of have id get. i've tried them getting last child on body (which form need get), i've been trying receive on htmlform element, no luck. ideas? edit: i'm adding part of code can see :( <table width="650" bordercolor="#cccccc" bgcolor="white" border="1"> <tbody> <tr> <th> <font size="1">accion </font> </th> <th> <font size="1">estado </font> </th> <th> <font size="1">descripcion </font> </th> <th> ...