Posts

Showing posts from January, 2015

draw lines on overlaid scatter plots in R -

Image
i want visualize embedding r^2 r^2. have overlaid scatter plots of original data , transformed data. want join dots stars corresponding same color line can see how each point gets transformed. idea how in r. reproducible example of overlaid scatter plot given below. set.seed(18) m<-cbind(a=runif(10),b=runif(10)) n<-cbind(d=rnorm(10),e=rnorm(10)) plot(n[,1],n[,2],col=rainbow(10),pch=20,xlab="x",ylab="y") points(m[,1],m[,2],col=rainbow(10), pch=8) one way segments segments(n[,1], n[,2], m[,1], m[,2], col = rainbow(10))

Prolog program about lists -

i new programmer in prolog , tried program says: make predicate penta(x) , x list , returns true when in x there 5 consecutive elements : first element sum between first , second. third element difference between 5th , 4th example: x = [ ... 5, 7, 12, 18, 30, ... ] . so did this: penta(x) :- \+length(x,0), //here verify if lists contains less 5 elements gives false. \+length(x,1), \+length(x,2), \+length(x,3), \+length(x,4), (a, b, c, d, e | x), c + b, c d - e, penta(x). this not compile doesn't work yet. tell me what's wrong if like. thank much. in prolog, write predicates not functions . predicate defines rule succeed or fail on sets of instantiated variables. want predicate, penta(x) succeeds if x list contains 5 consecutive elements meeting criteria. start top. either 5 consecutive elements meet criteria @ head of list, or later in list. % succeed if first 5 elements meets criteria penta([a, b, c, d, e |_]) :- ... % goes here succeed? %

object - Case Else Statement from different tables -

i trying retrieve name based on type of claim. seem easy enough, it's not working me. working 2 main tables, claim , exposure , , contactname table. each claim can have multiple exposures , each exposure can have 1 claim . both tables contain nameid field - claim.nameid , exposure.nameid . nameid correlates contactname table. contact name id name 111 jim 222 bob 333 john 444 sam 555 walt normally, each claim can have multiple exposures , exposures on claim can have same name or different names. name ids found on exposure . the exposure.nameid joins contactname.id claim claim.nameid exposureno exposure.nameid name a null 1 111 jim a null 2 222 bob a null 3 333 john b null 1 444 sam b null 2 444 sam workers comp claims different. each workers

java - Get Bit values from Byte Array -

i have byte array need read specific bits , convert int (see byte array structure below). though bits information want read in 3 bytes, tried reading 4 bytes (6-9) integer , read bits integer value bits or bitsvalue method somehow not able see right values bit manipulation. , expertise in bits pretty sure doing wrong. can please suggest doing correctly , why not working. in advance!! byte array in little endian format. 0th byte - value 1st byte - value 2nd - 5th byte - value 6th - 9th byte - first 18 bits represent value - next 5 bits represent value - next 1 bit represent value - last 8 bits represent value public class test { public static void main(string... dataprovider) { string s = "46 00 ef 30 e9 08 cc a5 03 43"; byte[] bytes = new byte[s.length()]; bytes = hexstringtobytearray(s); int bytepointer = 0; int msgtype = getintfromsinglebyte(bytes[bytepointer]); // 0th byte int version = ge

Need to compare 2 dates -

i need compare 2 dates/time stamps , see if within 10 minutes of each other in sql. if within 10 minutes of each other, not want data output in. if outside of 10 minutes, output data. example: if event 1 occurs on saturday 9/10/2017 10:00:00, , event 2 occurs on saturday 9/10/2017 10:00:09, not want data queried. if event 1 occurs on saturday 9/10/2017 10:00:00, , event 2 occurs on saturday 9/10/2017 10:00:11, want data queried.

android - UUID's have to be distinct for service , characteristic and descriptor? -

i trying make client-server connection server containing 1 service 1 characteristic contains 1 descriptor. i've made service, characteristic , descriptor have same uuid , when try write on descriptor/characteristic (in android app) pop-up appears tells me , bluetooth has shut down becouse of problem (not known). there condition uuid's have distinct ? the "uu" of uuid means "universally unique". uuid describing type of data, though, can have 2 characteristics same uuid if both providing same sort of data. (ex 2 thermometers) think descriptors supposed have uuid's dictated standard (so know they're descriptors). so, service, characteristic, , descriptor should have different uuid's.

javascript - Cannot subscribe Page to Facebook App -

when use facebook graph api explorer , send post request page_id/subscribed_apps?access_token=access_token all ok, page appears in subscribed pages webhook. but when use fb node.js api , send request like: fb.api( /${fbselectedpage}/subscribed_apps, 'post', {"access_token": ${selectedpagetoken}}, function(response) { console.log(response); } ); page not appear in subscribed pages webhook section. same postman. works graph api explorer. does know solution? p.s. real subscribe many pages 1 app , webhook events them?

firefox webextensions - How to know whether a chrome extension is downloaded from store? -

i develop chrome extension compatible firefox/edge/opera. the extension rely on rest api accessible on web. during web development, prefer pointing development endpoint not affect production tenant , affect development instance , database. my question quite simple, make similar pseudo-code: if (extension.downloaded_from_store == true) endpoint = "https://api-dev.example.com" else // extension has been installed local directory endpoint = "https://api-prod.example.com" do have idea how such thing (preferably background.js page) ? if solution can compatible browsers, perfect ! most google chrome extensions on store have permanent extension id. if packaged extension uses same extension id each update can hardcode id , check inside first if. i recommend reading more packaging chrome extensions here. specifically this part.

Setting up celery with django -

new celery , django, , have working demo project i'm using starting point. here's how creates celery app # set default django settings module 'celery' program. os.environ.setdefault('django_settings_module', 'ch.settings') app = celery('ch') # using string here means worker doesn't have serialize # configuration object child processes. # - namespace='celery' means celery-related configuration keys # should have `celery_` prefix. app.config_from_object('django.conf:settings', namespace='celery') # load task modules registered django app configs. app.autodiscover_tasks() the function binded using @app.task(bind=true) in py file process_image , debug_task this command works in project celery worker --app ch.celery_app the test project name ch my project name revamp , here's how implemented it # set default django settings module 'celery' program. os.environ.setdefault('django_setti

Swift: new xcode project via GUI OR swift package manager CLI? -

im new swift development. i want use libraries in swift package manager format. mean project must in spm format? so instead of creating new project via xcode's gui wizard, should using: swift package init swift package generate-xcodeproj also possible use spm libraries written in swift 3, have application code in swift 4? im using xcode9-beta.

cordova - Requesting php using Ajax -

i came across following error (failed load http: // ...: no 'access-control-allow-origin' header present on requested resource. access.) when trying pull echo php index.html of cordova using ajax. here codes: php: <?php echo ". . ."; ?> ajax: $(document).ready(function() { $.ajax({ type: "get", url:"http://.../index.php", datatype: "text", success: function(){ alert('funcionou ?'); } }); });

java - Multiple API calls with retrofit and RXJava 2 -

i have question in order understand better rx java solution retrofit in android, problem following: have application has offline mode local database, while i'm working app, process in there recorded database , send backend saved. in case have process change status in order, example have action change arriving status of job, change job started status, , 4 more actions change statuses in process. statuses saved different local database tables , have make multiple api call change statuses 1 each status. explaning this, have screen in app group process statuses every job pending send backend, in case grouped id of job, press button in app screen , send of statuses calling every api , result when finish calls in order put loading progress , remove when finish, clear local database statuses send well, , finish activity. know rx java has zip option call api's , wait result, in case don't know if it's possible because have call every api every same status of jobs, example

MongoDB - random signal 15? -

relatively new this, forgive me if wrong. mongodb / ubuntu seems randomly receive sig15 , power down. im unsure of anyway (with wiredtiger) trace signal 15, , there no pattern in time happens. 2017-09-11t12:07:43.594-0400 control [main] ***** server restarted ***** 2017-09-11t12:07:43.598-0400 storage [main] [rocksdb] block cache size gb: 0 2017-09-11t12:07:43.598-0400 storage [main] [rocksdb] compression: snappy 2017-09-11t12:07:43.599-0400 storage [main] [rocksdb] maxwritembpersec: 1024 2017-09-11t12:07:43.599-0400 storage [main] [rocksdb] engine custom option: 2017-09-11t12:07:43.599-0400 storage [main] [rocksdb] crash safe counters: 0 2017-09-11t12:07:43.599-0400 storage [main] [rocksdb] counters: 1 2017-09-11t12:07:43.599-0400 storage [main] [rocksdb] use singledelete in index: 0 2017-09-11t12:07:43.602-0400 access [main] initialized external auth session 2017-09-11t12:07:43.606-0400 control [initandlisten] mongodb starting : pid=3259 port=27017 dbpath=/var/lib/

r - How to sort source and/or target nodes in a sankey diagram within a shiny app? -

Image
i have simple sankey diagram, generated using networkd3 package inside shiny app. how can source and/or target nodes sorted? as can see in mwe, default, neither source nodes (a, b, c, d, e) nor target nodes (v, w, x, y, z) sorted. @ least, sorting not comprehensible me. code: library("shiny") library("networkd3") ui <- fluidpage( column(3), column(6, sankeynetworkoutput("mysankeyd")), column(3) ) server <- function(input, output) { output$mysankeyd <- rendersankeynetwork({ mydf <- list( nodes=data.frame(name=c( "a", "b", "c", "d", "e", "v", "w", "x", "y", "z")), links=data.frame(source=as.integer(c(0, 1, 2, 3, 3, 4, 4)), target=as.integer(c(7, 6, 7, 8, 7, 5, 9)), value = c(1, 4, 1, 5, 1, 5, 3) ) ) sankeyne

deep learning - Are shared layers handled efficiently? -

are shared layers handled efficiently in cntk? (i.e., activation computation not duplicated) fro example suppose have following expression: def create_func(shared_layers, out1_layers, out2_layers): # ... there block specifying activations...omitted brevity shared_hl_func = for(shared_layers, lambda n: dense(n), name="shared hidden layers") out1_hl_func = for(out1_layers, lambda n: dense(n), name="out1 hidden layers") out2_hl_func = for(out2_layers, lambda n: dense(n), name="sigma hidden layers") output1_func = sequential([shared_hl_func, out1_hl_func, dense(1, activation=none, init=init, name="out1_regression_layer")], name="out1") output2_func = sequential([shared_hl_func, out2_hl_func, dense(1, activation=none, init=init, name="out2_regression_layer")], name="out2") return output1_func, output2_func output1, out

java - Session in ProxyPassReverse -

so have java dynamic web application running on tomcat7 web server used run directly eclipse till opens in browser on url : http://localhost:8080/myproject/ now, avoid relative urls being different on live server , local machine because of directory (myproject) host, want run project on url : http://local.myproject.com/ with of apache , proxypassreverse. after setting local.myproject.com point 127.0.0.1 in hosts file, did following configuration in apache conf file : <virtualhost *:80> servername local.myproject.com proxypreservehost on proxypass / http://localhost:8080/myproject/ proxypassreverse / http://localhost:8080/myproject/ proxytimeout 1200 </virtualhost> this allowing me open homepage of myproject on local.myproject.com. problem is, it's not maintaining session data whenever refresh page, session data lost, not able log in myproject.

c++ - Is it possible to use placement-new to change the type of a polymorphic object? -

is possible use placement-new change type of polymorphic object? if not, in standard prohibits it? consider code: #include <new> struct animal { animal(); virtual ~animal(); virtual void breathe(); void kill(); void *data; }; struct dead: animal { void breathe() override; }; void animal::kill() { this->~animal(); new(this) dead; } is calling "kill" ever legal? update: comments not address (il)legality according standard of programming technique shown here of changing type of object explicit call destructor , applying placement-new new object compatible. because there interest in why this, can mention use case led me question, although not relevant question asking. imagine have polymorphic type hierarchy several virtual methods. during lifetime of object, things happen can modeled in code object changing type. there many legal ways program this, example, keeping object pointer, smart or not, , swapping in copy of o

bitcoin - Where in Ethereum blockchain do transaction details of a smart contract get written? -

i have been reading blockchain , ethereum, cannot seem head around couple of concepts. first, in blockchain newly created transaction stored ? if blockchain has been on going time, , lets on block x right now. if deploy contract today, , gets executed, transaction details reside on every block after block x or on block x + 1 ? , transaction details details on block, or block contain every transaction happened within time period ? again, of prior blocks transactions written subsequent blocks ? happens if more 1 transaction gets executed same contract, written 2 different blocks or within same block ? second, when designing contract have seen restricted 2 parties enter it, , other people use contract new instance of contract has created, understanding correct ? or should 1 contract designed in way uses , 1 instance of ever created ? where in blockchain newly created transaction stored ? in blocks each node stores. will transaction details reside on every block

scala - methods missing from scaladoc search -

none of value members of tuple2 class appear when search them. examples: _2 , invert , swap are classes intentionally left out when doing scaladoc search? browser playing tricks on me? i guess intentional; tuple2 inherits _2 product2 (which show in search results), perhaps designers of search interface thought overly redundant search output include separate result every subtype. you can click on product2 , "known subclasses" find out tuple2 inherits method.

java.util.scanner - Read a character followed by n number of integers like A 1 2 3 using Java's Scanner(System.in) object from the same line -

i unable read 1 2 3 same line, 1 2 3 can read 1 line because of in start, scanner reads a. string command = ""; int numbers; list<integer> ints = new arraylist<integer>(); scanner scan = new scanner(system.in); command = scan.next(); while (scan.hasnextint()) { numbers = scan.nextint(); ints.add(numbers); } scan.close(); i use nextline() (and hasnextline() ), split on 1 or more consecutive white-space characters (to create array of tokens), set command first token , stream tokens - skip first 1 (it's command ) , collect list . like, scanner scan = new scanner(system.in); while (scan.hasnextline()) { string line = scan.nextline(); string[] tokens = line.split("\\s+"); string command = tokens[0]; list<integer> ints = stream.of(tokens).skip(1) .maptoint(integer::parseint).boxed().collect(collectors.tolist()); system.out.printf("command = %s, ints = %s%n", command, ints.tostrin

css - ionic 3 setting image as background for ionic tabs -

i need set tab bar image rather solid color. tabs.html like <ion-tabs color="ferrari-bg" class="ferrari-tabs"> <ion-tab [root]="tab1root" tabicon="people-outline"></ion-tab> <ion-tab [root]="tab1root" tabicon="speedometer"></ion-tab> <ion-tab [root]="tab2root" tabtitle="about" tabicon="information-circle"></ion-tab> <ion-tab [root]="tab3root" tabicon="calendar"></ion-tab> <ion-tab [root]="tab3root" tabicon="film"></ion-tab> </ion-tabs> and app.scss .ferrari-tabs{ background-color: transparent !important; box-shadow: 0 2px 5px 0 rgba(0,0,0,.16),0 2px 10px 0 rgba(0,0,0,.12); background-image: url("../assets/images/footer.png") !important; background-size: cover; } how doesnt render image. in chrome dev console can see class applied no idea

binaryfiles - Can I use a git smudge/clean filter to convert binary file to multiple files and back? -

i have binary file can deserialized text representation along supporting image files. can use smudge , clean conversion 1 file many, , again? eg: the binary file: demo.bin would deserialize to: demo.txt (important able diffs on file) demo.picture1.bmp demo.picture2.gif the short answer "no". longer answer more complicated: sure, can write such files work-tree want. cannot make them wind in index , though, definition untracked files. try overwrite existing index files fraught peril. (both old style filter-driver , new-style filter-as-process expected / assumed (by git) work on 1 specified path @ time. using process method, perhaps delay touching index until filter terminated, before git assumes done whatever doing—whether requires smudging or cleaning.)

ios - Custom textfield with custom subviews not adjusting tableviewcell height -

i have custom textfield appropriate constraints inside tableview cell. during runtime, adding subview textfield , noticed frame of textfield not adjusting height of subview. maybe cause why tableview cell not adjusting height despite adding estimatedrowheight , rowheight = uitableviewautomaticdimension.

c# - Items Count of listbox on another form -

while i'm debugging, value of ex comes 0. i can't modify or read listbox values on different form. have 2 forms here. how can resolve this? form1 eski = new form1(); form2 yeni = new form2(); listbox array = new listbox(); int ex = eski.listbox5.items.count; (int ix = 0; ix <= ex; ix++) { array.items.add(eski.listbox5.items[ix]); } the problem on code one: form1 eski = new form1(); you initializing new form , code not call opened form1 running on application. you need replace , instead: var eski = application.openforms.oftype<form1>().singleordefault(); with that, can access controls want.

mod rewrite - Getting Apache redirect errors (infinite loop) -

so i'm trying view page: http://stage.myhost.com/content/myhost/wtcp365/policies/search-results (sadly not publicly available hosts names has been obfuscated) but there seems infinite loop happening. firefox saying "firefox has detected server redirecting request address in way never complete." i'm not apache expert i'm hoping can me find offending rewrite rule. i've searched net can't find useful guide tells me for. i've seen how enable logging. works if know for. i've included rewrite rules , log below. lot! apache rewrite rules: rewriteengine on loglevel alert rewrite:trace6 #this change disabling debug parameters due debug=layout not been disable osgi configs rewritecond %{query_string} \bdebug=\b rewriterule ^ %{request_uri}? [l,r=301] #redirecting adobe domain myhost domains rewritecond %{server_name} stage rewritecond %{server_name} adobems.com rewriterule "^(.*)$" "https://stage.myhost.com${redirectmap:$1|$1}

dockerfile - Does Docker expose timing of builds? -

is possible configure docker output timing build of dockerfile? run medium sized dev team , collect statistics on average build times our developers' development containers. bonus points if can expose timing individual steps. you use tool time measure build times. e.g. time docker build . for individual build steps it's getting more difficult. @ run date command after each step, add layer image. it's getting bit messy.

windows - ModuleError on bat file running python script -

i having trouble running python script windows scheduler, looking schedule bat file runs script outputs log file. however, bat file gives me modulenotfounderror: no module named ibapi . ibapi module folder contained in c:\tws api\source\pythonclient . tried below bat code, doesn't work. how rid of modulenotfounderror ? setlocal set pythonpath="c:\tws api\source\pythonclient" set pythonpath="c:\tws api\samples\python\pead" c:\users\myusername\appdata\local\programs\python\python36-32\python.exe "c:\tws api\samples\python\pead\livescraper.py" %* endlocal

html - How to keep a sentence lined up perfectly after making the browser smaller? -

to honest, can't find right words adress problem, i'll try. first picture in picture, of first words of each sentence lined perfectly. second picture in picture, first word of each sentence doesn't line eachother. happens when place in center text-align. know why that, sadly i'm not able fix easy thing fix. this code tested with: <!doctype html> <html> <head> <meta charset="utf-8"> <style> #text { text-align: left; word-wrap: break-word; width: 100%; max-width: 470px; } @media , (max-width: 1300px) { #text { text-align: center; } } </style> </head> <body> <div id="text"> random textjust random textjust random textjust random textjust random textjust random textjust random textju

python - finding all Strong tags with beautifulsoup returns an empty array -

i want extract strings included in strong tags , save them in file. cannot extract strong tags; returns empty array. missing anything. here code have used: input: >>>import requests >>>from bs4 import beautifulsoup >>>r=requests.get(' http://www.webmd.com/heart-disease/heart-disease-glossary#1') >>>r.content >>> soup=beautifulsoup(r.content,"lxml") >>>print(soup) >>>soup.find_all('strong') output last statement: [] thanks, actually, there isn't strong tag in soup. when open url in browser, can 2 strong tags. don't think need them. <li xmlns="http://www.w3.org/1999/xhtml">check address typing errors such <strong>ww</strong>.example.com instead of <strong>www</strong>.example.com</li> if mean terms in bold, should use .find_all('b'). [tag.text.strip().replace(':',"") tag in soup.find_all(

python - Django: User Reporting Some URL on Website -

so i'm trying build something, users able report on site. here's model, class report(models.model): reporting_url = models.urlfield() message = models.textfield() i created form model including 'message' field because 'reporting_url' needs populate depending upon specific page user has clicked "report" button. def report(request): url_report = ??? if request.method == 'post': form = reportform(request.post or none) if form.is_valid(): new_form = form.save(commit=false) new_form.reporting_url = url_report new_form.save() i wondering how can pass specific url 'reporting_url' field in form depending on page user has clicked "report" button? (much s see on social networks). am doing correctly, or there better way doing this? please me code. in advance! if there report button on specific page believe write custom context processor. more info: django: url of current pa

handlebars.js - Handlebar templating not working -

i using marionette js , handlebar. tried using triple brackets {{{ still htmlfromserver rendered plain tags , not rendered html. i populate data server side marionette model. htmlfromserver= "<img src="smiley.gif" alt="smiley face" height="42" width="42">" <body> <a href={{link}} target="_blank">{{title}}</a>{{publisheddate}} <a href={{link}} target="_blank" class="result_url">{{link}}</a> <p class="snippet">{{{htmlfromserver}}}</p> </body> similar issue: marionettehandlebarsissue

html - Problems with create internal links( Anchor links) on a blog post in Blogger? -

6:23 (1 hour ago) hi, can understand how create internal links (anchor links) in post? can't able find helpful answer. feeling frustrated. i did person said me on blogger product forum - for anchor link: can create hyperlink in html mode. insert following code want place anchor. (you can change archorlinkname whatever like) <a name="anchorlinkname"></a> for link within same post want jump anchor, please use code. (you can change word in yellow) <a href="#anchorlinkname">click here go anchorlinkname</a> but weird happening once updating post or going html mode compose mode. error - <a href="https://www.blogger.com/blogger.g?blogid=48019486#overview"> <a href="https://www.blogger.com/null" name="overview"></a> i don't know why these https://blogger.com/blogger.g?blogid=48 , https://blogger.com/null gets added automatically. redirecting me admin post section or

java generics super keyword -

i went through these topics generics..? super t bounding generics 'super' keyword however, still seem kind of lost super keyword: when declare collection that: list<? super number> list = null; list.add(new integer(0));//this compiles list.add(new object());//this doesn't compile shouldn't opposite - have list contains objects (of unknown type) parents of number . object should fit (since parent of number ), , integer shouldn't. opposite case reason. provided have following code static void test(list<? super number> param) { param.add(new integer(2)); } public static void main(string[] args) { arraylist<string> slist = new arraylist<string>(); test(slist); //will never compile, however... } it impossible compile above code (and sanity suggests right behaviour), basic logic prove opposite: string object, object superclass of number. string should work. i know crazy isn't reason why didn&

node.js - Screenshot element - Update node scope's variable within browser's scope [Nightmarejs] -

i'm trying take screenshot of particular element of webpage. in order so, i've been trying use nightmarejs' 'screenshot' method . requires rectangle object gives coordonates , dimensions method. the issue don't have coordonates , dimensions before evaluation of page. i've tried use global variable pass 'evaluate' function. unfortunately, it's not updating 'rect' variable. according documentation (and understanding of it), code below should able pass variable 'evaluate'. var rect; nightmare.goto(url) (...) .evaluate(function(rect){ rect = { x : element.x, y : element.x, width : element.width, height: element.height } },rect) .screenshot('snapshot.png',rect) .then(function(){ console.log('done'); }); but not. i'm aware can't pass functions/object 'evaluate', here, i'm not doing that. can confirm ? i've tried use 'nightmare-scre

customization - paypal express checkout: how to change 'cancel and return to Alfredo barco store' to mine? -

am integrating paypal express checkout ( https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/client-side-rest-integration/ ) our website. how change 'cancel , return alfredo store' our store name? am trying javascript based integration shown in full interactive demo. also, in payment page, how make paypal show line showing payment store: something "you agreeing pay $abc.de store" thank you. for production environment see business name in paypal login. issue can closed.

WSO2 APIM 2.1: Filter downstream api responses -

our downstream (back-end) end-point return lots of data of sensitive , needs filtered out. using datamapper within out-sequence becoming increasingly laborious design datamapper each of api resources. possible develop generic script based on https://www.npmjs.com/package/json-schema-filter . thinking swagger definition create in apim should give ability pragmatically load schema within out-sequence , filter response. our apim swagger definition similar downstream apis expect have lot less properties schema filter should in principle work. any appreciated. thanks, venkata

svg - ../ For Parent Directory Not Working HTML -

all, i did bit of research haven't found exact thread or resolution issue. i using express in webapp, chrome version 60.0.3112.113, , win 10 version 1703. i developing site want use hamburger svg mobile navigation. how html sits "topbar" <div id="topbar"> <img src="../images/hamburger.svg" alt="ham"> </div> and here file structure: https://puu.sh/xxdih/c842297b54.png according structure, should need ../images/hamburger.svg , when that, comes 404 error in waterfall. have run issue multiple times doing sort of html sourcing parent directories, in js files works fine. i'm not sure issue is. for express server,every uri processed express contains resource url , request url. request url(api) refered express api config resource(image, js, css, html...) relative static server's root directory defined using express.static(root_path) . that's want say.

javascript - google apps script combine duplicate rows by concatenating -

i'm trying combine duplicate rows using column h comparison. if duplicates found, want keep values of bottom row except in columns e-g,m,o want combine values. e.g. row 4 , 5 have matching values in h. new column e should have value e4 & e5 while new column has value a5. this i'm working with: function tryme() { var ss=spreadsheetapp.getactive(); var sh=ss.getactivesheet(); var rg=sh.getdatarange(); var row=rg.getrow(); var col=rg.getcolumn(); var va=rg.getvalues(); // values of data range == data comparing var na=[]; // create array var duplicate=true; // duplicate returns true compare wih !duplicate for(var i=0;i<va.length;i++) // each data item { duplicate=false; // start assuming no duplicates for(var j=0;j<na.length;j++) // each item in new array ?? na.length? thought started empty na[] ?? { if(va[i][1]==na[j][1]) // check if value of first item in data matches value of first item in new array { ss.

sql - Oracle Trigger - Condition before insert -

i don't know problem when created new trigger. syntax correct? thanks! console logging pane p/s: console display when try insert values create or replace trigger ex03_3 before insert on hr.chitietdathang each row declare tonghang number; -- total items hanghienco number; -- items present hangdaban number; -- items sales. begin -- total items select sum(mh.soluong) tonghang hr.mathang mh; -- total items sales select sum(ctdh.soluong) hangdaban hr.chitietdathang ctdh; -- items present hanghienco := tonghang - hangdaban; if(hanghienco >= hangdaban) hanghienco := hanghienco-1; insert hr.chitietdathang values(:new.sohoadon,:new.mahang, :new.giaban,:new.soluong,:new.mucgiamgia); rollback; end if; null; end; seem 2 critical mistakes 1) trigger tries insert hr.chitietdathang in body of insert trigger of hr.chitietdathang . 2)

Validating Azure AD JWT in C# -

validate azure ad jwt c# code extracting appid/clientid token. below mentioned code take token string , validate client id clientid/appid extracted token public bool validate(string token) { string clientid = "your appid/clientid"; string stsdiscoveryendpoint = "https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration"; configurationmanager<openidconnectconfiguration> configmanager = new configurationmanager<openidconnectconfiguration>(stsdiscoveryendpoint, new openidconnectconfigurationretriever()); openidconnectconfiguration config = configmanager.getconfigurationasync().result; tokenvalidationparameters validationparameters = new tokenvalidationparameters { validateaudience = false, validateissuer = false, issuersigningkey = config.signingkeys.firstordefault(), validatelifetime = false };

python - Django: Class Based View accessing URL variables -

my urls.py has entry: urlpatterns = [ url(r'^results/(?p<query>).+', views.resultsview.as_view(), name="results"), ] which matches corresponding class based view: class resultsview(templateview): template_name = os.path.join(appname, "results.html") def dispatch(self, request, *args, **kwargs): query = kwargs['query'] print("here: " + str(json.dumps(kwargs, indent=1))) print(self.kwargs['query']) print(self.kwargs.get('query')) print(kwargs['query']) print(kwargs.get('query')) if query none: return redirect('/') return super(resultsview, self).dispatch(request, *args, **kwargs) def get_context_data(self, **kwargs): context = super(resultsview, self).get_context_data(**kwargs) print("here: " + str(json.dumps(kwargs, indent=1))) print(self.kwargs['query&

How do you perform wireless debugging in Xcode 9 with iOS 11? -

Image
wireless debugging added feature in xcode 9. how perform wireless debugging in xcode ios 11? set device network debugging debug app running on ios or tvos device on wifi or other network connection. note: network debugging requires xcode 9.0 or later running on macos 10.12.4 or later , , on device, requires ios 11.0 or later , or tvos 11.0 or later . steps set iphone, ipad, or ipod touch 1. choose window > devices , simulators, in window appears, click devices. 2. connect device mac lightning cable. 3. in left column, select device, , in detail area, select connect via network. xcode pairs device. if xcode can connect device using network, network icon appears next device in left column. 4. disconnect device. now ready debugging on network. note: mac system , iphone/ipad should share same network use wireless debugging. ------------------------------------------------------------------------- steps set apple tv: 1. make sure

android - Failed to initialize display event receiver -

Image
i have made app periodically starts service retrieves information server. i use alarmmanager schedule service. works fine , app receives alarm every 30 min. app works fine, after full night of inactivity -and start app, crashes error: 'failed initialize display event receiver'. else works perfectly. i searched problem long time , found others same problem, no solution, yet. process: it.unipi.iet.portolan.traceroute, pid: 13092 java.lang.runtimeexception: failed initialize display event receiver. status=-2147483648 @ android.view.displayeventreceiver.nativeinit(native method) @ android.view.displayeventreceiver.<init>(displayeventreceiver.java:61) @ android.view.choreographer$framedisplayeventreceiver.<init>(choreographer.java:695) @ android.view.choreographer.<init>(choreographer.java:169) @ android.view.choreographer.<init>(choreographer.java:72) @ android.view.choreographer$1.initialvalue(choreographer.java:98) @ android.view.choreogr