Posts

Showing posts from August, 2015

How can I conditionally run code if a Gradle plugin is applied? -

i have script plugin to: check if ivy-publish applied (via apply plugin: ivy-publish ): if applied, declare publishing { repositories { ivy { } } } if it's not applied, run other code however, i'm unsure of how run code if ivy-publish plugin applied, , couldn't find in documentation . there way this? you can use pluginmanager.withplugin(string id, action<? super appliedplugin> action ) method. javadoc: if plugin specified id has been applied, supplied action executed immediately. otherwise, action executed after plugin specified id applied. in build script like: pluginmanager.withplugin('ivy-publish') { // configuration }

java - Why are interface variables static and final by default? -

why interface variables static , final default in java? from java interface design faq philip shaw: interface variables static because java interfaces cannot instantiated in own right; value of variable must assigned in static context in no instance exists. final modifier ensures value assigned interface variable true constant cannot re-assigned program code. source

Does Google Cloud ML Engine use grid search for tuning hyperparameters? -

the grid search technique easy use , embarrassingly parallel approach finding best set of hyperparameters machine learning models. google cloud machine learning (ml) engine use grid search? no. grid search easy use , easy understand suffers curse of dimensionality problem . instead of grid search, google cloud ml engine uses bayesian optimization technique based on algorithm called gaussian process bandits

java - how to communicate with Executor Service Threads -

from controller class, i'm calling helper start process , returning ui process started helper class: public class helper { public string startservice() { //before starting service save status of service started in db executorservice service = executors.newsinglethreadexecutor(); service.submit(new runnable() { public void run() { new worker().startwork(callabletasklist); } }); return "started" } public void stopservice() { // saved status in db stopping (just in case). how pass flag pass startworkmethod stop if flag in false , stop processing. } worker class public class worker { public void startwork(list<callabletask> callabletasklist) throws exception { executorservice service=executors.newfixedthreadpool(50); executorservice anotherservice=executors.newfixedthreadpool(50); (list<callabletask> partition : iterables.partition(callabletasklist, 500)){ // work h...

data warehouse - ETL Testing Datasets / Framework -

i'm trying create reasonable tests our etl processes. i'm thinking reference / testing ingestion dataset needed. don't want use client data (which other alternative here). i run current etl on testing dataset reference transformations. way, when source code changes can test references being produced in etl , make sure no regressions created. i'm not sure right approach. example, if transformation changed in source code, tests compare reference transformation rightly fail. we'd have create new reference transformation dataset transformation. can see getting crazy once team of developers starts making changes separate transformations. ultimately, need way produce test dataset , test transformations. ideas? create test data set, containing @ least 1 row every possible transformation outcome. you'll use test data set source every etl test run. new transformations or bugs come up, add additional rows test data set cover transformations. in et...

AngularJS - Getting the Value from the first column of a row in a table on change event -

please see plunker here demonstrates issue: i want display corresponding english value (first column) given row when of values changed. example 'uploaded' should displayed in pop-up when of values on second row changed. i have gotten far in example, not quite there: <textarea ng-model="res.value" ng-change="vm.changed(vm.resourcegridresources.resources[$index].resources[0].value)" style="min-width: 300px"></textarea> for exemple. not use $index $parent.$index . refers $index of previous ng-repeat . <textarea ng-model="res.value" ng-change="vm.changed(vm.resourcegridresources.resources[$parent.$index].resources[0].value)" style="min-width: 300px"> </textarea> corrected plunkr

Block direct access to .php but allow AngularJS $http requests -

is there way of blocking direct access .php files in ctrl foler, allowing http requests angular app? have .htaccess 'deny all' in ctrl folder @ moment blocks access blocks angular calls. i imagine there isn't way, i'm not whizz @ php wanted ask. angularjs $http({ method: 'post', url: '/ctrl/login/login.php', headers: {'content-type': 'application/x-www-form-urlencoded'}, data: credentials }) i don't believe there is. in fact, http request these .php files angular app nothing more 'a direct access .php files'. if angular app (which lives client-side) request, client request well.

phpstorm - Is possible to open two different git branches of the same project like openning two diferent projects? -

as title says. possible phpstorm? i have 1 project different branches , want open 1 branch in 1 window , other branch in window the question not phpstorm git. phpstorm projects directories might or might not git work trees. before version 2.5, git repository checked out in single working tree. since version 2.5, git can handle multiple working trees attached single git repository. the git command git worktree , documentation says: description manage multiple working trees attached same repository. a git repository can support multiple working trees, allowing check out more 1 branch @ time. git worktree add new working tree associated repository. new working tree called "linked working tree" opposed "main working tree" prepared "git init" or "git clone". repository has 1 main working tree (if it’s not bare repository) , 0 or more linked working trees. you can attach multiple working trees git repository, ch...

python - Multiple excel files -

i want loop through directory , find specific xlsx files , put them each separate pandas dataframe. thing here want sheets in excel files in dataframe. below sample of code implemented, need add logic pick sheets: import pandas pd glob import glob path = 'path_to_file' files = glob(path + '/*file*.xlsx') get_df = lambda f: pd.read_excel(f) dodf = {f: get_df(f) f in files} dodf[files[2]] --- dictionary of dataframes as described in this answer in pandas still have access excelfile class, loads file creating object. this object has .sheet_names property gives list of sheet names in current file. xl = pd.excelfile('foo.xls') xl.sheet_names # list of sheet names to handle import of specific sheet, use .parse(sheet_name) on object of imported excel file: xl.parse(sheet_name) # read specific sheet dataframe for code like: get_df = lambda f: pd.excelfile(f) dodf = {f: get_df(f) f in files} ...gives dodf dictionary of excelfil...

python - Is there a difference between 'await future' and 'await asyncio.wait_for(future, None)'? -

with python 3.5 or later, there difference between directly applying await future or task, , wrapping asyncio.wait_for ? documentation unclear on when appropriate use wait_for , i'm wondering if it's vestige of old generator-based library. test program below appears show no difference doesn't prove anything. import asyncio async def task_one(): await asyncio.sleep(0.1) return 1 async def task_two(): await asyncio.sleep(0.1) return 2 async def test(loop): t1 = loop.create_task(task_one()) t2 = loop.create_task(task_two()) print(repr(await t1)) print(repr(await asyncio.wait_for(t2, none))) def main(): loop = asyncio.get_event_loop() try: loop.run_until_complete(test(loop)) finally: loop.close() main() unfortunately python documentation little bit unclear here, if have sources pretty obvious: in contrary await coroutine asyncio.wait_for() allows wait limited time until future/task comple...

javascript - How to read and write data from csv using fast csv -

i reading data csv , transforming data. want write data new csv file getting created data not getting populated. here have tried const fs = require('fs'); var csv = require("fast-csv"); var stream = fs.createreadstream("/home/rahul/downloads/it.csv"); var ws = fs.createwritestream("/home/rahul/downloads/my.csv"); csv .fromstream(stream) .transform(function(data){ return data.map(function(ip) { return number( ip.split(".") .map(d => ("000"+d).substr(-3) ) .join("") ); }) }) .on("data", function(data){ console.log(data); // logs [ 5009000000, 5009255255 ] }) .on("end", function(data){ csv.write(data).pipe(ws); });

hibernate - Spring Annotation attributes - reference attribute value from class field -

lets want use hibernates @columntransformer annotation, , attribute read of annotation should defined @ application startup. reason that, example, value of attribute should pgp_sym_decrypt(data, secretkey) , , secretkey should not referenced property value, since can generated @ application startup. the question is, how reference value, calculated @ application startup , set field value of lets myconfig class has field string secretkeyvalue , in @columntransformer atrribute?

"error writing history file: open :" error for influxDB on every command -

i installing , trying set influxdb locally. have tried this solution error(there error writing history file: open : system cannot find file specified.) shows on every command. have tried using create database test , error shows when run show database database created. wondering how fix error. also, http://localhost:8086/ shows - 404 page not found. in youtube videos ppl had web interface/gui

html - Divs are not floating left -

Image
i have form , container div. container div looks this: container .container { margin-left: auto; margin-right: auto; width: 500px; and inside container have divs classes of panel: panel .panel { width: 50%; float: left; but reason the panel not floating end of it's container? here full html html <div class="container"> <%= form_with(model: fee_change_submission, local: true) |form| %> <div class="panel"> <%= form.label :account_name, class: "panel__top-label" %> <%= form.text_field :account_name, class: "panel__top-input" %> </div> <div class="panel"> <%= form.label :account_number, class: "panel__top-label" %> <%= form.text_field :account_number, class: "panel__top-input" %> </div> <% end %> </div> css .container { margin-left: auto; margin-right: auto; width: 500px; ...

c - string.h header in the file with the function main -

i have program several .c , .h files. in 1 of .c files using function strcmp(). adding in file header string.h is string.h header in file function main required? thanks! if translation unit containing function main not use function strcmp or other declaration header <string.h> inclusion of header in translation unit redundant , confuses readers.

python 2.7 - liblabjackusb.so: undefined symbol: DigitalIO -

i got installation , library issue labjack product https://labjack.com/products/u12 i followed these installation steps installation on ubuntu 16.04. https://labjack.com/support/software/installers/exodriver/mac-and-linux/in-depth-build-instructions the following code brings me undefined symbol digitalio in liblabjackusb.so $ python >>> import u12 >>> d =u12.u12() >>> d.digitalio(idnum=-1, demo=0, trisd=3, trisio=0, stated=0, stateio=0, updatedigital=1) traceback (most recent call last): file "<stdin>", line 1, in <module> file "build/bdist.linux-x86_64/egg/u12.py", line 2506, in digitalio def getfirmwareversion(self, idnum=none): file "/usr/lib/python2.7/ctypes/__init__.py", line 375, in __getattr__ func = self.__getitem__(name) file "/usr/lib/python2.7/ctypes/__init__.py", line 380, in __getitem__ func = self._funcptr((name_or_ordinal, self)) attributeerror: /usr/local/lib/liblabjackusb.so: undef...

c# - Entity Framework - group multiple foreign keys into a single column -

new ef here , having difficulty. i have 24 tables need create code-first. each 1 of these tables has around 2 - 10 many-to-one relationships simple , can represented 1 table. here few of classes illustrate structure... namespace emrs { public class erecord { [key] public int pcrid { get; set; } public virtual list<efirstclass> efirstclass {get; set;} public virtual list<esecondclass> esecondclass { get; set; } } public class efirstelement { [key] public int elementid { get; set; } public elementcode stuff1 { get; set; } //eairway.06 public string stuff2 { get; set; } public int pcrid { get; set; } public virtual erecord ereportid { get; set; } public virtual list<subelement> stuff4list { get; set; } public virtual list<subelement> stuff5list { get; set; } public virtual list<subelement> stuff6list { get; set; } ...

ASP.NET Core 2.0 and Angular 4.3 File Upload with progress -

using new angular 4.3 httpclient , how can upload , access files in asp.net core 2.0 controller while reporting upload progress client? here working example started: html <input #file type="file" multiple (change)="upload(file.files)" /> <span *ngif="uploadprogress > 0 && uploadprogress < 100"> {{uploadprogress}}% </span> typescript import { component } '@angular/core'; import { httpclient, httprequest, httpeventtype, httpresponse } '@angular/common/http' @component({ selector: 'files', templateurl: './files.component.html', }) export class filescomponent { public uploadprogress: number; constructor(private http: httpclient) { } upload(files) { if (files.length === 0) return; const formdata = new formdata(); (let file of files) formdata.append(file.name, file); const req = new httpreque...

unity3d - Unity - Parent with children fall apart -

Image
i have player character, made of cubes, spheres , capsule. created empty object player , body parts of player child of player . have 2 planes, moving platform in between. can walk , jump on normal planes , walls, when player on moving platform bodyparts of player fall apart. maybe it's stupid, started unity. this goes wrong, player falls apart on moving platform: http://nl.tinypic.com/r/207s3sz/9 and below information overview, player, body parts, , moving platform according character-holder. bodyparts have same properties body part on screenshot. can me goes wrong here? how can transport whole player moving platform? holdcharacter script: using system.collections; using system.collections.generic; using unityengine; public class holdcharacter : monobehaviour { void ontriggerenter(collider other) { other.transform.parent = gameobject.transform; } void ontriggerexit(collider other) { other.transform.parent ...

python 3.x - how to get data from whoscored -

i need data whoscored.com when type code import requests bs4 import beautifulsoup soup url = "https://www.whoscored.com/statistics" page_html = requests.get(url) page_soup = soup(page_html.content, 'html.parser') i gettin page_soup variable follows <html style="height:100%"> <head> <meta content="noindex, nofollow" name="robots"/> <meta content="telephone=no" name="format-detection"/> <meta content="initial-scale=1.0" name="viewport"/> <meta content="ie=edge,chrome=1" http-equiv="x-ua-compatible"/> <script src="/_incapsula_resource? swjiylwa=2977d8d74f63d7f8fedbea018b7a1d05" type="text/javascript"></script> </head> <body style="margin:0px;height:100%"><iframe frameborder="0" height="100%" marginheight="0px" marginwidth="0px...

javascript - Closure and let -

this question has answer here: what's difference between using “let” , “var” declare variable? 21 answers javascript closure inside loops – simple practical example 31 answers iam struggling understand why results different in bellow example . var arr = []; function build(){ (var = 0; < 3; i++) { let j = i; console.log('j = ' + j + ' ' + i); arr.push(function(){ console.log(j); }); } return arr; } var newarr = build(); newarr[0](); newarr[1](); newarr[2](); what dont understand , if remove line let j = i; , replace j var , console.log(i); output 3 , 3, 3 because time run newarr0; value 3 . whats difference let j ? isnt same ? time run newarr0; final value of j wouldnt 3 again ? i know differen...

c# - What is typing discipline? -

wikipedia talks c# typing discipline: static, dynamic, strong, safe, nominative, partially inferred what typing discipline? terms mean , how related language? the typing discipline on wikipedia refers type system used c# (just try clicking link, lead type system article). as mean: static - types determined @ compile-time (the compiler wants know type before runs) dynamic - types determined @ runtime (in c#, facilitated dynamic keyword introduced in c# 4.0) safe - language doesn't allow violate type rules has. can't put strings list of complex types instance without cast defined. strong - rather poorly explain it, have @ eric lippert's article on topic here nominative - name of type used determine type equivalence (what means 2 types same fields different names treated different types) partially inferred - compiler can guess type referring during compile-time (this var keyword in c#, allows not specify type in code, although it...

swift - Does setting `constraint.isActive = false` deallocate the constraint? -

say want remove constraint, traditionally do: view.removeconstraint(constraint) however, there new isactive methods installing/uninstalling constraints. if following: constraint.isactive = false will remove memory correctly? yes, constraint.isactive = false is doing same thing as: viewthatownsconstraint.removeconstraint(constraint) so if thing holding on constraint view, correctly remove memory. here's proof: let view = uiview() weak var weakview: uiview? = nil autoreleasepool { weakview = uiview() } assert(weakview == nil) // traditional way of removing constraints ensures constraint deallocated weak var weakconstraint: nslayoutconstraint? = nil autoreleasepool { weakconstraint = view.widthanchor.constraint(equaltoconstant: 10) } assert(weakconstraint == nil) // nothing holding on constraint autoreleasepool { weakconstraint = view.widthanchor.constraint(equaltoconstant: 10) view.addconstraint(weakconstraint!) } assert(weakconstraint...

aggregation framework - MongoDb get first exists in group stage -

i have data; [{date :"01-01-2016" , usd: 3 , month : 1, year :2016 }, {date : "02-01-2016" , usd : 2 ,month : 1, year :2016}, {date : "03-01-2016" , usd : 1 ,month : 1, year :2016}, {date : 04-01-2016" , bek : 1 ,month : 1 , year :2016 } ] i need first "bek" value average of usd group year-month. when compute aggregation ; db.serie_data.aggregate([ { $match : { bek : { $exists : true}} }, { $group: { _id : { year : "$year", month : "$month" }, year : { $first: "$year" }, month : { $first: "$month" } , usd : { $avg: "$usd } ,bek : { $first: "$bek" } } }, { $project : { year : "$year" , month : "$month" , usd : "$usd" , bek : "$bek" }}, ]) all usd values becoming null, since when bek exists, usd not. i need this; [{month:1,year:2016,usd : 2, bek : 1 } ] , but : [{month:1,year:2016,usd : null , bek : 1 } ] i need use $exis...

sql server - T-SQL: Trying to combine two queries into one -

i want list of customers , purchases among items a, b, c, d, e but ... only customers have purchased c or e. right i'm thinking of pseudo-code: select customer, item purchases items in (a, b, c, d, e) , customer in ( select customer purchases items in (c, e) ) my actual query more complex, takes long run , includes customer information multiple tables , purchases spread on multiple tables ... wondering if inefficient run select statement twice - , whether can more efficiently? the answer depends on complexity, format , amount of data can replace in exists other way using temp tables - populate list of customers use items c,e temp tables , use temp table in query select customer, item purchases p1 p1.items in (a, b, c, d, e) , exists ( select top 1 1 purchases p2 p1.customer = p2.customer , p2.items in (c,e))

linux - Permission denied for ANY task at root's crontab -

i have (and this) @ root crontab * * * * * /bin/true tail /var/log/cron.log lists sep 13 19:53:01 host cron[9881]: permission denied sep 13 19:54:01 host cron[9882]: permission denied sep 13 19:55:01 host cron[9890]: permission denied sep 13 19:56:02 host cron[9891]: permission denied before asks: # ls -l /bin/true -rwxr-xr-x 1 root root 27280 mar 2 2017 /bin/true no matter task command, "permission denied" , nothing executed, obviously. any comments?

ruby on rails - How can I use a bingInt (as string) as a parameter? -

so i'm creating system visitor can ask client music composition. user starts fill form details , such, , when submits it, it's not yet sent client. however, can estimation of price, , modify demand if wants to. after that, still can submit 1 last time, , time, estimation sent. i don't want use default id parameter because way simple 'parse' other estimations if url looks ends /3 or /4 . you'd have try few urls , if it's lucky day, you'd "hack" estimation isn't yours. i'm planning use cron job delete these estimations after while, don't want take risk. to avoid that, decided use visitor's session_id parameter, on removed every alphabetic characters, still saved string in mysql 5.7 database activerecord ok that. changed routes accordingly, , result supposed localhost:3000/devis/4724565224204064191099 # devis means 'quotation' in french however, when try route, following error: activerecord::recordnotfound (c...

ios - Swift 3 game button pressed loop -

i have array of images if pressed button image randomly appear. , there image down called array appears randomly once opened game. want conditions statement button pressed. have 5 conditions once button clicked: 1- if pressed , image appeared not same uiimage view down score added 2- if button did not press 2 seconds appear down. 3- if button pressed , same uiimage game over. 4- if calculated 4 images down because didn't hit image in 2 seconds lose. var array:[uiimage] = [uiimage(named: "1.png")!, uiimage(named: "2.png")!, uiimage(named: "3.png")!, uiimage(named: "4.png")!, uiimage(named: "5.png")!, uiimage(named: "6.png")!, uiimage(named: "7.png")!, uiimage(named: "8.png")!, ...

Powershell object property changed to "Text" on pass to Start-Job -

i'm passing object background job via start-job. object has array property use inside background job. however, array property converted other field. instead of being property "array", "arraytext" , appears string. i'm assuming has serialization, i'm not sure why happening. know object methods lost, thought data members should survive serialization? data seems there in text.

liquid - jekyll: check if there are no posts -

how can check if there no posts in _posts folder? so far, i've tried {% if site.posts == null %} <p>no posts...yet.</p> {% endif %} and {% if site.posts == nil %} <p>no posts...yet.</p> {% endif %} is possible in liquid? grab size of posts array , compare 0: {% assign psize = site.posts | size %} {% if psize == 0 %} <p>no posts...yet.</p> {% endif %}

ios - Xcode 9: Swift dependency analysis error -

Image
i have ios-app written in obj-c , ui-tests app in swift. installed xcode 9 beta 2 , wanted compile app. following error: "dependency analysis error > “swift language version” (swift_version) build setting must set supported value targets use swift. setting can set in build settings editor." when go build settings there isn't possibility set version swift language. represent bug? furthermore app doesn't use swift, automated ui_tests. it tells need specify swift version in build settings. click project , go build settings (not target) , set "swift language version" swift 3.2 or swift 4 . here have screenshot :)

android - getting string from resource strings.xml -

this question has answer here: android application crashes @ getstring() line 2 answers nullpointerexception trying access string resource 3 answers unfortunately myapp has stopped. how can solve this? 14 answers when string strings.xml , don't error right away, can't run program : string mybuttontext = getstring(r.string.buttontext); (when remove line , variable program works perfectly) i'll put program, in case you'd need it: public class mainactivity extends appcompatactivity { private button button; string mybuttontext = getstring(r.string.buttontext); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(saved...

ios - Any workaround to have different constraints for same size class? -

say need have view has leading , trailing spacings, on iphone se spacings should 16, on larger phones can have 32 spacing, in portrait mode horizontal size class compact, means can't apply different spacings different size classes. then thought having high priority constraints instead of required , , make intrinsic content size of view be, say, 288, on iphone se, spacings have 16 , 16 (ie. 16 + 288 + 16 = 32), on larger phones can 32. haven't tried can point me correct direction of solving problem? thanks! edit: view uilabel, , don't want give hardcoded width constraint. i solve these issues more using constraint multiplier. may not 16/32 can similar effect. you can set hard limits required min 16, required max 32 , set lower priority constraint of parent width * somemultiplier

angular - ng2 aot compilation error on rollup -

afaik i've followed of steps described set aot ng2 app, rollup process: https://angular.io/guide/aot-compiler my dir structure uses following pattern: mysite/ng2/components mysite/ng2/templates ... i opened git bash in context of ng2 dir above. i'm executing specified cmd compile app aot: "../node_modules/.bin/rollup" -c rollup-config.js my main-aot.ts file has following import statement: import { appmodulengfactory } './aot/app.module.ngfactory'; however, returns following error: main-aot.ts → build.ts... [!] error: not resolve './aot/app.module.ngfactory' main-aot.ts error: not resolve './aot/app.module.ngfactory' main-aot.ts @ error (c:\code\myapp\node_modules\rollup\dist\rollup.js:185:14) @ then.resolvedid (c:\code\myapp\node_modules\rollup\dist\rollup.js:9804:8) i verified app.module.ngfactory exists under mysite/ng2/aot/. tried update import statement different path pattern: import { appmodulengfactory } ...

asp.net - best way to protect the machinekey other than dapi/encrypting web.config -

so need sso solution means both consuming website need same machine key. is there way can encrypt machine key since it's stored plain text? aware can encrypt web.config , dapi stuff. is there other way since both seem compromised if attacker gains access server itself?

Can SSL handshake issue arise when I use SOCKS5 proxy over ssh tunnel? -

i in private network can not use known internet port 80,443. but luckily there open port trying open proxy using ssh tunnel. i connected different server able connect internet ssh ssh port forwarding setting. used proxy application (i used proxifier) socks5 protocol access forwarded port above. as far http concerned, there have been no problem set up. can connect them without problem expected. can not connect of (not all) https site. does 1 have experience or wild guess case? first guess ssl, in case of socks proxy using ssh tunneling, thought there supposed no issue regarding ssl handshake. (please let me know if wrong.) any advice appreciated.

c# - multiplication table using two nested loops but i am getting an error -

Image
i trying create table like... desired: but code coming out like.. actual: my code: static void main(string[] args) { (int = 0; <= 9; i++) { console.write(i + "\t"); (int j = 1; j <= 9; j++) { if (i > 0) console.write(i * j + "\t"); else console.write(j + "\t"); } console.write("\n"); } console.readkey(); } how add * , -, | ? (int = 0; <= 9; i++) { if (i == 0) { console.write("*\t | \t"); } else { console.write(i + "\t | \t"); } (int j = 1; j <= 9; j++) { if (i > 0) { console.write(i * j + "\t"); } else ...

javascript - PHP. How to correctly check the empty form field or not? -

there form sending application. default fields required. how organize check filled in field or not , output of alerts in case of empty value, no reset of filled fields. it's this: if @ least 1 field not filled, form updated , fields have been filled reset. please modify else's code(( <script> $(document).ready(function(){ .... var soparray_<?=$_request['code']?> = [ //массив сопоставлений {orig: ".bids_form_<?=$_request['code']?> #namework_<?=$_request['code']?>", now: "property[name][0]"}, {orig: ".bids_form_<?=$_request['code']?> #datestart_<?=$_request['code']?>", now: "property[date_active_from][0]"}, {orig: ".bids_form_<?=$_request['code']?> #dateend_<?=$_request['code']?>", now: "property[date_active_to][0]"}, {orig: ".bids_form_<?=$_request['code']?...

Concerns WebRTC.The remote video didn't playing when peers are not in the same network -

i'm building webrtc chatting web site using java websocket. works fine when users in same network(like using same wifi).but fails work when users aren't in same network environment. what's confusing remote video has src="blob.....".but video refuses play. stun server use stun:stun.l.google.com:19302. can problem related being in china? thank lot reading. project uploaded in site. https://csckaigi.chinanorth.cloudapp.chinacloudapi.cn/kaigi edit 1: realized site chinese site,so may need vpn access. website presented japanese,so explain how use this. first click つくる button create room , next enter name in chatting room . second user should enter room number(which copied first user,or click room list below.if there's no list,then click link refresh),then enter user's name.finally users suppose linked , see each other. stun servers not sufficient. need turn server (and no, there no 'free' ones) things work every...

python - download remote gz files that reside in a tree like directories does snot work -

i have been scratching head more 2 days, still cannot figure out how following! want download geo data sets in ftp://ftp.ncbi.nlm.nih.gov , in each data set, need see if contain keywords interested in. able manually download 1 of data sets , checked file desired keywords. however, since number of data sets huge, cannot manually. want write program me. first step, tried see if can download them. structure follows: hots-> /geo/ -> datasets/ -> gds1nnn/ .... way through gds6nnn , each of them contain more 600 directories; ordered number i.e. gds1001. now, in each of these directories: ---> soft inside folder there 2 files named this: folder name (gds1001)+_full.soft.gz this file think need download , see if keywords looking inside file. here code: ftp = ftp('ftp.ncbi.nlm.nih.gov') # remember need provide host name not complete address! ftp.login() #ftp.retrlines('list') ftp.cwd(...

python - Django 1.11 Pagination Markdown -

i tried paginate long string in django splitting using array did django-markdown-deux stopped working. here how implemented it: models.py: class post(models.model): content = models.textfield() def get_markdown(self): content = self.content markdown_text = markdown(content) return mark_safe(markdown_text) views.py: def post_detail(request, slug=none): #retrieve instance = get_object_or_404(post, slug=slug) #detect breaklines db , split paragraphs using tempinstance = instance.content paginatedinstance = tempinstance.split("\r\n\r\n") paginator = paginator(paginatedinstance, 5) #set how many paragraph show per page page = request.get.get('page', 1) try: paginated = paginator.page(page) except pagenotaninteger: paginated = paginator.page(1) except emptypage: paginated = paginator.page(paginator.num_pages) context = { "instance": instance, "paginated": paginated, #will use display story instead of ...

android - Second spinner not working -

i have problem second spinner not being able select item , save value. if add s2.setonitemselectedlistener(this); spinner wont select or scroll . if remove listener selection of items enable doesn't catch selection , can tell me missing ? thanks public class menutiendas extends activity implements onitemselectedlistener{ spinner s1,s2,s3; string sp1, sp2, sp3 = ""; string id, id_pasajero = ""; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.menutiendas); s1 = (spinner)findviewbyid(r.id.spinner1); s2 = (spinner)findviewbyid(r.id.spinner2); //s3 = (spinner)findviewbyid(r.id.spinner3); s1.setonitemselectedlistener(this); s2.setonitemselectedlistener(this); //s3.setonitemselectedlistener(this); sharedpreferences prefs = getsharedprefe...

python - Interpolating values with scipy -

i'm working on short code snippet understand how scipy interpolates values on curve. in particular, i'm interested in finding values along interpolated curve. here's code i'm using: import numpy np import matplotlib.pyplot plt scipy.interpolate import interp1d x2 = [0, 1, 10, 25, 30, 50, 51, 89] y2 = [5, 12, 50, 73, 23, 34, 41, 50] #x2 = [10, 16, 22, 29, 38, 47, 59, 66, 75, 86, 100, 113, 119, 136, 142, # 148, 154, 161, 171, 184, 192, 202, 223, 236, 246, 251, 262, 269, # 283, 297, 306, 316, 322, 331, 346, 358, 367, 373, 388, 397, 410, # 418, 423, 429, 439, 446, 467, 483, 497, 507, 520, 531, 538, 545, # 554, 575, 582, 588, 600, 608, 613, 627, 635, 655, 662, 676, 682, # 687, 695, 705, 712, 717, 724, 732, 740, 747, 755, 761, 771, 778, # 791, 802, 809, 816, 824, 834, 856, 863, 872] # #y2 = [23085.967, 14267.121, 20750.584, 9210.3926, 18401.682, 16611.393, # 24010.594, 17857.979, 218...

powershell - How to show warning when robocopy is overwriting a file? -

currently need use powershell , robocopy copy source directory target directory. library files consists lots of .dll. i need overwrite .dll exist in target directory. however, of .dll in target directory newer version. therefore, before overwriting, need prompt warning tell users that. aware of that. how can check , compare version/properties of .dlls before doing robocopy? i have checked there no such switch robocopy. any solution ? thank you

excel - Missing value when export listview to xls file in c# -

the problem can export listview excel file successfully, when try open it. said can read only. , value in file change '0' example: 10379743021704072015 -> 10379743021704000000 10379743021704072015 -> 1.0379743021704e+019 note: use microsoft excel 2016 open it. using (savefiledialog sfd = new savefiledialog() { filter = "excel workbook|*.xlsx", validatenames = true }) { if (sfd.showdialog() == dialogresult.ok) { microsoft.office.interop.excel.application app = new microsoft.office.interop.excel.application(); workbook wb = app.workbooks.add(xlsheettype.xlworksheet); worksheet ws = (worksheet)app.activesheet; app.visible = false; ws.cells[1, 1] = "date"; ws.cells[1, 2] = "time"; ws.cells[1, 3] = "harness"; ...

content missing when a file is written into another file Python -

im entry level python developer working on requirement need merge many text files in forder 1 file in folder b. wrote below code working not writing entire content files in folder a. import os = open(r"c:\temp\datsoutput\new folder\output.txt", "w") path = r'c:\temp\dats' filename in os.listdir(path): fullpath = path+"\\"+filename open(fullpath,'r',encoding="utf_8_sig", errors="ignore") ins: line in ins: a.write(line) the around 6000 lines below line missing. rout:= 996.6mm angl:= 95degree orrf:= =0/0 tmrref:= =0/0 repcou:= 0 end new cylinder 26 of subequipment /fa-3101/main_m1_davit name:= =805324448/24319 type:= cyli lock:= false owner:= /fa-3101/main_m1_davit purp:= unset pos:= w 537.345mm s 46.083mm u 0mm ori:= y s , z u leve...

iOS 11 PhotoKit. Get maximum-size image from iCloud Photo Sharing albums -

i try receive image icloud shared albums, not exist on device. when call: phimagerequestoptions *options = [phimagerequestoptions new]; options.deliverymode = phimagerequestoptionsdeliverymodehighqualityformat; options.networkaccessallowed = yes; options.synchronous = no; [[phimagemanager defaultmanager] requestimageforasset:asset targetsize:phimagemanagermaximumsize contentmode:phimagecontentmodedefault options:options resulthandler:^(uiimage * _nullable resultimage, nsdictionary * _nullable info) { }]; i receive thumb small size. if press on image in photos app, image download fine, if try download in application nothing happens (i receive small image). maybe know how resolve problem? for previous ios version work fine.

convert a javascript code snippet to php -

i have javascript code this.i want convert code in php.as beginer in php struggling convert code snippet in php.how can perform this? java script var view = [{data: [["1:24:22", 969],["1:24:42", 970],["1:25:03", 972]]}, {data: [["2:35:22", 969],["2:44:42", 970],["2:55:03", 972]]}]; view.foreach(function (r) { k = 0; r.data.foreach(function (d) { d[0] = ++k; }); }); tried php $view = [{data: [["1:24:22", 969],["1:24:42", 970],["1:25:03", 972]]}, {data: [["2:35:22", 969],["2:44:42", 970],["2:55:03", 972]]}]; below code php version of javascript. $view taken json string , can manipulated below. appreciate @marty's comment, think you. $view = '[{"data": [["1:24:22", "969"],["1:24:42", "970"],["1:25:03", "972"]]}, {"data...

mysql - Using LIKE when searching for "%" -

this question has answer here: match '%' sign when searching in mysql database 5 answers i want check whether column starts "%". if search character code below doesn't work when searching "%". select * `table` `column` 'anothercharacter%' thanks. you can try this select * `table` column 'anothercharacter%[%]%' or where column '%\%%' escape '\'

c - How to silence -Wunreachable-code-return (GCC/Clang) -

when using function has noreturn attribute? the following code gives warning @ last line. extern void main_loop(void) __attribute__ ((noreturn)); int my_event_loop(void) { main_loop(); return my_success_enum; /* <- '-wunreachable-code-return' */ } note return value needed function fits interface , can assigned callback. removing may give problems compilers don't support noreturn attribute. using #pragma gcc diagnostic push/pop work quite verbose. is there better way quiet warning @ last return?

How to save the python script output as a variable in python -

how store python script output variable my script output has following data on screen. python3 office1.py success!! success: {"ok":true,"id":"3afe26a36a329b1a8b98fcc805fd77c9","rev":"1-e2e221dbda9918f8e1adfef00c680383"} the id & rev showing id , revison values of cloudant db output. i store variable , use hem in next json file. any appreciated thank you,

python - Visual Studio Django app fails to build with StaticRootPath error -

i'm writing first django app, , have encountered problem. when go build project in visual studio, build fails without giving errors. way can show me error @ changing output diagnostic mode, @ point shows me this: target "detectstaticrootpath" in file "c:\program files (x86)\microsoft visual studio\2017\community\msbuild\microsoft\visualstudio\v15.0\python tools\microsoft.pythontools.django.targets" project "c:\users\oem\documents\tsm_shared\student-marketplace-v2\ecommerce test\ecommerce test.pyproj" (target "djangocollectstaticfiles" depends on it): initializing task factory "runpythoncommandfactory" assembly "c:\program files (x86)\microsoft visual studio\2017\community\common7\ide\extensions\microsoft\python\core\microsoft.pythontools.buildtasks.dll". using "runpythoncommand" task task factory "runpythoncommandfactory". task "runpythoncommand" task parameter:target=import tes...