Posts

Showing posts from February, 2010

.net - adding new value to List overwrite previous value -

i'm trying add list. if move declaration loop works fine slow, if don't, add method overwrite previous values. what should do? dim _obj new classdal.site.salespoint dim _r = _obj.getcities dim temp new classdal.site.salespoint dim mylist new list(of classdal.site.salespoint) each row in _r temp.fullcode = convert.tostring(row.item(0)) temp.citycode = convert.tostring(row.item(1)) temp.karm = convert.toint32(row.item(2)) temp.name = convert.tostring(row.item(3)) mylist.add(temp) temp = new classdal.site.salespoint next return mylist you have declare varible inside loop reference type, otherwise in next loop modifying reference last item created. you try doing this, don't think quicker: for each row in _r mylist.add(new classdal.site.salespoint { .fullcode = convert.tostring(row.item(0)) .citycode = convert.tostring(row.item(1)) .karm = convert.toint3

NGINX 2 domains on the same IP, want to redirect both to HTTPS -

i have 2 domains running on server, nginx proxies them node apps. have certificate one, other i'm using cloudflare provide https. want ensure when users visit either domain, redirected https version of domain, without www. current configuration, uncommenting block domain2 configuration file seems break both sites :( domain1 config file: upstream domain1.com { server 127.0.0.1:8000; keepalive 8; } server { listen 0.0.0.0:80; server_name domain1.com www.domain1.com; return 301 https://domain1.com$request_uri; } server { #listen 80; listen 443 ssl http2; server_name domain1.com; access_log /var/log/nginx/domain1.com.log; root /var/www/domain1.com/client/public; include /etc/nginx/global/cloudflare-allow.conf; ssl_certificate /etc/nginx/ssl/domain1.crt; ssl_certificate_key /etc/nginx/ssl/domain1.key; if ($bad_referer) { return 444; } location / { proxy_http_version 1.1; proxy_set_he

Javascript, get the name of a bound function -

i've created function , bound arguments below. function myfunc(){} let boundfunc = myfunc.bind(argument); but pass bound function argument function, need name. following: function dothething(callable){ console.log(callable.name + " did thing"); } dothething(boundfunc); prints out bound did thing rather myfunc did thing . there way name of bound function? callable.caller results in uncaught typeerror: 'caller' , 'arguments' restricted function properties , cannot accessed in context. , not browser standard. google chrome v 51.0.2704.103 gives different result: function myfunc(){} let boundfunc = myfunc.bind(null); function dothething(callable){ console.log(callable.name + " did thing"); } dothething(boundfunc); it prints bound myfunc did thing , original name callable.name.substring(6)

c# - WCF connection with HTTPS security using SSON cookie -

i have little experience cookies need here. i have scenario have establish wcf connection remote endpoint using https security. situation complicated thing endpoint address in client config pointing web proxy redirects request actual endpoint if sson auth has been detected or redirects auth page. example : service address client config ' https://a.com/my.svc '. if auth ok connect address, if not, redirected ' https://a.com/auth ' , after successful auth proceed again ' https://a.com/my.svc ' if open address in web browser i'm redirected auth page , after successful auth (login/pwd) redirected address. after authenication sson cookie generated , consequent address queries lead me straight address no additional auth. as of i've done following: do auth using wpf webbrowser control. i've got cookie after that. made client endpoint connection. yeah session used default in prod environment, i'm not sure if can remove it. <custom

oracle12c - Oracle 12C Identity Column with EntityManager -

i have created sample table identity column in oracle. create table "core_prod"."book" ( "id" number generated default identity minvalue 1 maxvalue 9999999999999999999999999999 increment 1 start 1 cache 20 noorder nocycle not null enable, "author" varchar2(255 byte), "genre" varchar2(255 byte), "isbn" varchar2(255 byte), "published" number not null enable, "title" varchar2(255 byte), primary key ("id") using index pctfree 10 initrans 2 maxtrans 255 compute statistics tablespace "mca_data" enable ) segment creation deferred pctfree 10 pctused 40 initrans 1 maxtrans 255 nocompress logging tablespace "prod_data" ; i have created entitymanagerconfiguration using below configuration @bean public datasource datasource() { drivermanagerdatasource datasource = new drivermanagerdatasource(); datasourc

python - Why is numdifftools so inaccurate? How does it work? -

i'm using python's numdifftools library perform derivatives. however, few tests prove library highly inaccurate: import numpy np numdifftools import derivative # result should 1/2 or 0.5 derivative(np.log, 1)(2.0) >>> array(0.5493061443340549) is there way fix inaccuracy? using numdifftools 0.9.16 , numpy 1.9.3 following code gives exact result: import numpy np numdifftools import derivative # result should 1/2 or 0.5 derivative(np.log)(2.0) output: array(0.5000000000000238)

Uploading file on the wrong folder with PHP -

i'm uploading pictures using angularjs , php. on server side, code looks this: <?php $filename = $_files['file']['name']; $destination = '/home1/cccctang/public_html/miquelimarc/uploads' . $filename; move_uploaded_file( $_files['file']['tmp_name'] , $destination ); ?> even folder seems defined, keeps uploading files root folder (where .php file is). what missing? you forget write / $destination = '/home1/cccctang/public_html/miquelimarc/uploads/' . $filename;

php - Display Vertical bar chart with grouped bars. -

i trying create barchart using google charts. want display both sales orders , sales quotations total value each month. have done this, displays orders value each month in horizontal format. not getting how show both values using single barchart (vertically) here code $query = "select monthname(last_modified) month, orders.sales_order_id, orders.authorise, orders.company_id, before_order_line_items.sales_order_id, before_order_line_items.item, before_order_line_items.uom, sum(before_order_line_items.total) 'total', before_order_line_items.tax orders inner join before_order_line_items on orders.sales_order_id on before_order_line_items.sales_order_id orders.order_quote = 'order' , orders.authorise='yes' group month(orders.last_modified)

.Net framework 4.5.1 Nuget issue with MassTransit -

when try install masstransit via nuget in .net framework 4.5.1 asp.net web application, following error gets displayed: install failed. rolling back... install-package : not install package 'masstransit 3.3.5'. trying install package project targets '.netframework,version=v4.5.1', package not contain assembly references or content files compatible framework. more information, contact package author. @ line:1 char:1 has had same problem , know how solve this? .net 4.5.1 unsupported , masstransit not support longer. upgrade v4.5.2+.

string - Java Weekday input Validation -

is there "tidier" way of writing code? i'm stickler simplicity , seems bit repetitive me. (i'm changing days numbers can use them in own if statements, if wondering) suggestions? scanner scantext = new scanner(system.in); system.out.print("enter day: "); string weekday = scantext.nextline(); int day = 0; if (weekday.equalsignorcase("monday")) day = 1; else if (weekday.equalsignorcase("tuesday")) day = 2; else if (weekday.equalsignorcase("wednesday")) day = 3; else if (weekday.equalsignorcase("thursday")) day = 4; else if (weekday.equalsignorcase("friday")) day = 5; else if (weekday.equalsignorcase("saturday")) day = 6; else if (weekday.equalsignorcase("sunday")) day = 7; else { system.out.print("error! invalid day: "); weekday = scantext.nextline(); } if not using jdk 1.8, code may you: list<string> strdays = arrays.aslist("mo

javascript assigning variable inside a callback function return undefined -

this question has answer here: why variable unaltered after modify inside of function? - asynchronous code reference 6 answers i have simple script play audio like: var audio = new audio(music) var music_duration audio.addeventlistener('loadedmetadata', function() { var duration = audio.duration console.log(duration) music_duration = duration }) console.log("checking duration") console.log(music_duration) here music_duration returns undefined.. while duration inside addeventlistener gives duration of music. i new javascript ... wrong in here ?? console.log("checking duration") console.log(music_duration) will executed before loadedmetadata event emitted. you can check editing script in way: var audio = new audio(music) v

css3 - Cannot remove shaded background of carousel - CSS -

Image
link website test page: webpage link i'm trying have carousel no background. images , indicators displayed is. have tried this: .carousel{ background:none; background-color: none; } which didn't make difference, tried adding placeholder background see did: .carousel{ background: url(http://placehold.it/620x420/); } this added placeholder background behind shading of carousel. i've uploaded image here: hopefully knows i've done wrong, in advance. edit: added html code carousel: <!-- image gallery start--> <br/><br/> <div id="carousel" class="carousel slide" data-ride="carousel" style="max-width: 400px; margin: 0 auto"> <!-- indicators --> <ol cla

c# - dotnet new project can't restore it's dependencies -

Image
i wanted create web app using mvc6 , searched asp.net 5 preview templates in asp.net web application(.net framework) couldn't find , searched further more in google. of solutions said install asp.net core preview templates , somehow got installing asp.net core . creating new project below. after step creating new project me, these things happening new project. to dependencies have in project getting similar error this: nu1002 dependency system.runtime.handles 4.0.1 not support framework .netcoreapp,version=v1.0. here project.json project.json { "dependencies": { "microsoft.netcore.app": { "version": "1.0.0", "type": "platform" }, "microsoft.aspnetcore.diagnostics": "1.0.0", "microsoft.aspnetcore.server.iisintegration": "1.0.0", "microsoft.aspnetcore.server.kestrel": "1.0.0", "microsoft.

excel - How to use the functions CELL and INDEX together in vba -

i want use cell , index address of value in excel vba. i write following doesn't work doesn't know how read cell function. placef = application.worksheetfunction.cell("address", application.worksheetfunction.index([g9:l44], [i3], [i4])) is there alternative or way function work? if trying address of value in range, use find function. in case, since seem know location of value, can return address calling range(location).address location "columnrow" call of location

c# - Vertical Multi-level Navigation Menu in UWP App -

i m working on uwp app app contain products categories , inside category create product list , 3-level navigation. for example i working on uwp app right involves use of such navigation. let me hook basic code , can modify based on needs. so, xaml looks this: <grid background="{themeresource applicationpagebackgroundthemebrush}"> <grid.rowdefinitions> <rowdefinition height="50"/> <rowdefinition height="*"/> </grid.rowdefinitions> <relativepanel grid.row="0" background="blue"> <button x:name="button" content="&#xe700;" horizontalalignment="stretch" verticalalignment="stretch" width="50" height="50" foreground="white" borderbrush="{x:null}" background="{x:null}" fontfamily="segoe mdl2 assets" relativepanel.alignleftwithpanel="true" cl

c++ - Fast way to convert type between char* to custom union -

i have 2 types , 1 function. 1 type char one[32] the other type typedef union _data{ uint8 byte[32]; int8 ibyte[32]; }data the function gets data input parameter, void compute(data data){} now, have char* (char[32]) type , wish convert data type , pass parameter compute . both types 32byte size, , want fast way convert type. thought of memcpy ,but slow since copies data. can use pointer somehow pass char* data type? the way of doing without breaking strict aliasing , being well-defined copy character array correct array of union. perhaps like data data; if (std::is_signed<char>::value) { std::copy_n(one, 32, data.ibyte); } else { std::copy_n(one, 32, data.byte); } and no it's not going "slow", unless thousands of time per second. measure , profile first, don't fall trap of premature optimization.

html - Align element with multiline text to the center of parent block preserving left text-alignment -

there menu multiple items. each item had one-line contents, aligned center of it. 1 item two-line contents has been added. according design plans two-line item-contents-element still should aligned center of parent item, text in item-contents-element should left-aligned: how-it-should-look also, items responsive, , items contents may change , other items - using fixed width item contents inappropriate. starting this code : <!doctype html> <html> <head> <meta charset="utf-8"> <title>align element wit multiline text center of parent block preserving left text-alignment</title> <style> .list-item { border: 1px solid #999; padding: 10px; text-align: center; width: 350px; } .item-contents { border: 1px dashed #999; display: inline-block; text-align: left;

Order all mysql data by rand then order it by column -

i have 1000 records querying , ordering random. each record has business type want order random businesstype. query : $sqlquery = "select * businesses postcode regexp '^" . $pcode . "[0-9]' , businessid not in (select businessid telesales.notinterested now() between dateofcall , (dateofcall + interval 42 day)) order rand() limit 500"; if rand(), businesstype random still, , if try group businesstype after rand doesnt give results. ideas?

python - Sort & Unique vs Set -

in python 2.7, in order retrieve set of unique strings redundant list of strings, preferred (~10 million strings of length ~20): a) sort list , delete repeating strings sort(l) unique(l) #some linear time function b) put them in set set(l) note not care order of strings. i made simple test check running time of both solutions. first test creates set , second test sorts list (it doesn't remove duplicates sake of simplicity). as expected creating set faster sorting, since complexity o(n) while sorting o(nlogn) . import random import string import time def random_str(): size = random.randint(10, 20) chars = string.ascii_letters + string.digits return ''.join(random.choice(chars) _ in range(size)) l = [random_str() _ in xrange(1000000)] t1 = time.clock() in range(10): set(l) t2 = time.clock() print(round(t2-t1, 3)) t1 = time.clock() in range(10): sorted(l) t2 = time.clock() print(round(t2-t1, 3)) the output got: 2.77 11

tensorflow: how to do numpy-like range with a tensor -

def inference(arg1, arg2): #something x in np.range(arg2): #to in above code, define model, , want range in arg2, numpy: for in numpy.range(arg2) , problem arg2 tensor, maybe tf.placeholder() , how?? edit: in fact, code this: def inference(arg1, arg2): #to return loss loss = inference(arg1, arg2) #do tf.optimizer sess = tf.session() sess.run() so first question in function inference() can define session, , call session.run() again? second, this, turns out that: tensorflow.python.framework.errors.invalidargumenterror: cannot assign device node 'tower_3/train/shuffle_batch/random_shuffle_queue': not satisfy explicit device specification '/device:gpu:3' because no supported kernel gpu devices available. colocation debug info: colocation group had following types , devices: queueenqueue: cpu queuesize: cpu queueclose: cpu queuedequeuemany: cpu randomshufflequeue: cpu [[node: tower_3/train/shuffle_batch/random_shuffl

javascript - Is there is any work around to get result according to first letter in angucomplete angularjs directive -

i using angularjs directive angucomplete-alt in there possibility results according text first select. here fiddle clear view. angular.module('myapp', []).filter('myfilter', function(){ return function(input, text){ return input.filter(function(item){ return item.startswith(text); }); }; }); function myctrl($scope){ $scope.filter_text = 'a'; $scope.items = [ 'abc', 'bca' ]; } if person type 'de' dropdown suggesting 'andhra pradesh' instead of 'delhi' because 'andhra pradesh' starts letter 'a'. want search according first letter. thanks

javascript - Java and chrome extension, natives messages -

i try chrome extension call java code in pc. call works fine, code executes, try return variables chrome extension don't work. see in console listener ondisconect write console message, listener onmessage don't. don't know problem. here code in chrome extension: manifest json { "name": "prueba native message", "version": "1.0", "manifest_version": 2, "description": "chrome extension interacting native messaging , localhost.", "app": { "background": { "scripts": ["background.js"] } }, "icons": { }, "permissions": [ "nativemessaging" ] } background.js var port = chrome.runtime.connectnative('com.app.native'); function message(msg) { console.warn("received" + msg); } function disconect() { console.warn("disconnected"); } c

Two Identical Divs with jQuery slideToggle, but only one of them is working. -

would appreciate if possible? thanks in advance takes time respond! here problem. i have 2 identical divs sit in row. contain h3 , p. on click of h3 want slidetoggle display of p. the slidetoggle works fine on first div on second div has no affect @ all. any ideas might going wrong?? my code below... html <section class="twocol"> <div id="accordionpanel"> <h3 class="accordioncontrol">this title of content area</h3> <p class="accordiontext">lorem ipsum dolor sit amet, no per erant dicant tritani. et reque aperiam fabulas nec. vim ne pericula tincidunt. id perpetua constituam quo, feugiat pertinax referrentur @ per.</p> </div> </section> <section class="twocol"> <div id="accordionpanel"> <h3 class="accordioncontrol">this title of content area</h3> <p class="accordiontext">lorem ipsum dolor sit amet, no per eran

android how to get the name of connected bluetooth device -

this question has answer here: android: how find out name of bluetooth device connected? 1 answer i want know how name of connected bluetooth device in android here code networkinfo bluetooth = connectivitymanager .getnetworkinfo(connectivitymanager.type_bluetooth); if(bluetooth.isconnected()) { toast.maketext(myprofile3context,"bluetooth connected", toast.length_short).show(); } here check if bluetooth device connected or not. if bluetooth connected want know how name of connected device. try public string getlocalbluetoothname(){ if(mbluetoothadapter == null){ mbluetoothadapter = bluetoothadapter.getdefaultadapter(); } string name = mbluetoothadapter.getname(); if(name == null){ system.out.println("name null!");

osx - Remove brackets from phone number in run shell script -

i create custom workflow contacts app in mac in way can dial phone number through hyperlink. these settings: service receives selected 'phone numbers' in 'contacts.app' pass input: arguments script: open "http://example.com/dial.htm?number=${@}" my problem phone numbers automatically formatted brackets , link not work: +44(0)123 456 789 how can modify script telephone number comes clean without brackets? thanks in advance you can use sed command replace () or ([0-9]) nothing: #!/bin/sh #replace brackets keep number inside brackets #url=`echo http://example.com/dial.htm?number=${@}|sed 's/[()]//g'` #replace brackets number inside - i.e., (0) url=`echo http://example.com/dial.htm?number=${@}|sed 's/([0-9])//g'` echo "${url}" ##open ${url} test: ./test.sh '+123(0)223465' http://example.com/dial.htm?number=+123223465

cron - Does Docker support restarting containers every X seconds -

i have logstash container keeps 2 data sources sync. when runs, queries non-synced entries in 1 database , posts them other. run container every 10 seconds. what have been doing specify --restart=always when container exits, restarts itself, around takes around 5 seconds, bit use case. does docker support want achieve (waiting x seconds between restarts, or kind of scheduling) or should remove restart policy , schedule cron run every 10 seconds? if container exits succesfully, restarted --restart=always an ever increasing delay (double previous delay, starting @ 100 milliseconds) added before each restart prevent flooding server. means daemon wait 100 ms, 200 ms, 400, 800, 1600, , on until either on-failure limit hit, or when docker stop or docker rm -f container. here part guess: if container restarted (the container started , runs @ least 10 seconds), delay reset default value of 100 ms. what can is: restart container cron every 10 seconds config

javascript - Ways to circumvent the same-origin policy -

the same origin policy i wanted make community wiki regarding html/js same-origin policies searching topic. 1 of searched-for topics on , there no consolidated wiki here go :) the same origin policy prevents document or script loaded 1 origin getting or setting properties of document origin. policy dates way netscape navigator 2.0. what of favorite ways go around same-origin policies? please keep examples verbose , preferably link sources. the document.domain method method type: iframe . note iframe method sets value of document.domain suffix of current domain. if so, shorter domain used subsequent origin checks. example, assume script in document @ http://store.company.com/dir/other.html executes following statement: document.domain = "company.com"; after statement executes, page pass origin check http://company.com/dir/page.html . however, same reasoning, company.com not set document.domain othercompany.com . with method,

python - Blender, convert .stl to .obj with prompt commande -

i want convert .stl file .obj, without using blender interface. to that, want in 2 step : 1 stl blend 2 blend obj actually blend obj work ok python code : import bpy import sys argv = sys.argv argv = argv[argv.index("--") + 1:] # args after "--" obj_out = argv[0] bpy.ops.export_scene.obj(filepath=obj_out, axis_forward='-z', axis_up='y') and batch : @echo off rem put path of blender folder set path=c:\program files\blender foundation\blender set filename=guitar.blend set target=guitar.obj rem launch blender %filename% --background --python convert_blend_to_obj.py -- %target% pause this work perfectly. the problem stl blend, not working python code : import bpy import sys argv = sys.argv argv = argv[argv.index("--") + 1:] # args after "--" blend_out = argv[0] bpy.ops.import_mesh.stl(filepath=blend_out, axis_forward='-z', axis_up='y') and batch associated : @echo off rem put pat

javascript - Switch .js file in multiple html pages -

i have multiple html pages dashboard.html, page1.html, page2.html, page3.html etc... , 2 .js files, namely example1.js , example2.js file ** from below example ( dashboard.html ) file, if click on load file 1 link, page , other html pages(page1.html, page2.html etc...) should replace default.js file example1.js file in remaining html pages until come dashboard page , change other. ** i fine using external libraries please check example code below same... ps : newbie script, please me out dashboard.html <html> <head> <title>switch js file</title> <script src="jquery.min.js"></script> <script src="default.js"></script> </head> <body> <a href="javascript:;" id="loadexample1">load file 1</a> | <a href="javascript:;" id="loadexample2">load file 2</a> <h1>default js file loaded successf

hadoop - Output of ffmpeg into HDFS directly -

i have requirement in have convert rtsp stream mp4 video or frames (as case may be) & want save them in hdfs (hadoop filesystem). for have tried using ffmpeg convert rtsp stream mp4 video/frames & saving video/frames in local filesystem. below - ffmpeg -i rtsp://10.0.37.150:8554/big_bunny.mkv -r 1 -f image2 frames/big_frame-%3d.bmp ffmpeg -i rtsp://10.0.37.150:8554/big_bunny.mkv big_bunny.mp4 and saving video/frames (stored in local filesystem) hdfs using put command - hadoop fs -put frames/ /user/maddy/ hadoop fs -put big_bunny.mp4 /user/maddy/ this working. want directly (that in 1 step without saving required files in local filesystem) i tried (like below command) not working ffmpeg -i rtsp://10.0.37.150:8554/big_bunny.mkv hdfs://localhost:9000/user/maddy/big_bunny.mp4 i error - hdfs://localhost:9000/user/maddy/big_bunny.mp4: protocol not found so there way in using ffmpeg can directly save these files hdfs without first saving in loc

How to plot a graph in SAGE using non-english symbols? -

simple command try run: sage: graph({'Б':[1,2]}).plot().save('/tmp.plot.png') fails: /usr/lib/sagemath/local/lib/python2.7/site-packages/matplotlib-1.5.1-py2.7-linux-x86_64.egg/matplotlib/text.py in set_text(self, s) 1204 accepts: string or printable '%s' conversion. 1205 """ -> 1206 self._text = '%s' % (s,) 1207 self.stale = true 1208 unicodedecodeerror: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128) can this? sagemath version 7.2, release date: 2016-05-15 apparently way use matplotlib doesn't allow non-ascii strings. see trac 21008 . update: ticket has fix , positive review, in sage 7.3, or possibly 7.4 depending on how fast 7.3 gets out.

r - How to assign colors to groups in survival graphs -

i have full control on colors used display group graphs using ggsurv . you'll find below toy example reproduce i've seen (mostly taken there ): require(data.table) # function create synthetic survival data simulweib <- function(n, lambda, rho, beta, ratec) { # covariate --> n bernoulli trials x <- sample(x=c(0, 1), size=n, replace=true, prob=c(0.5, 0.5)) # weibull latent event times v <- runif(n=n) tlat <- (- log(v) / (lambda * exp(x * beta)))^(1 / rho) # censoring times c <- rexp(n=n, rate=ratec) # follow-up times , event indicators time <- pmin(tlat, c) status <- as.numeric(tlat <= c) # data set data.frame(id=1:n, time=time, status=status, x=x) } set.seed(1234) nbgroups <- 7 dat <- list() for(k in 1:nbgroups) { dat.onegp <- simulweib(n=10, lambda=0.01, rho=1, beta=-0.6, ratec=0.001) # fit <- coxph(surv(time, status) ~ x, data=dat.onegp) dat.onegp <- muta

javascript - array for full calendar -

how should array if want serialize , use in full calendar? (int) 1 => [ 'start_date' => '2016-06-01', 'end_date' => '2016-06-01' ], (int) 2 => [ 'start_date' => '2016-06-02', 'end_date' => '2016-06-02' ], (int) 3 => [ 'start_date' => '2016-06-03', 'end_date' => '2016-06-03' ], (int) 4 => [ 'start_date' => '2016-06-04', 'end_date' => '2016-06-04' ], (int) 5 => [ 'start_date' => '2016-06-05', 'end_date' => '2016-06-05', 'events' => [ (int) 0 => [ 'date' => 'e', 'name' => 'holliday' ], (int) 4 => [ 'date' => 'e', 'name' => 'holliday' ] ] ] this array , use json_encod

Is it possible to integrate rest-assured in my cucumber-jvm (selenium) project? -

help me how integrate rest-assured in cucumber-jvm project.. said using ui testing.. any help?? appreciated!! yes, see allure cucumber-jvm adaptor

How to get lastest redirect url in php using curl -

i using php , curl redirect url, have got output, shows me error 302 not found @ last redirect(i have redirect url twice), here php code, <?php $url = 'http://www.example.com/kdjf/ksdjfk/file'; function getred($url){ $ch = curl_init($url); curl_exec($ch); if (!curl_errno($ch)) { $info = curl_getinfo($ch); return $info['redirect_url']; } curl_close($ch); } $dds=getred($url); echo getred($dds); ?> $dds gives me next redirection after example.com passed , have use redirect function again, , have got error, <html> <head> <title>302 found</title> </head> <body bgcolor="white"> <center><h1>302 found</h1></center> <hr><center>nginx</center> </body> </html> http://www.example.org/skdfjk/new_file.html how http://www.example.org/s

haskell - WReq add abritrary cookie to the request -

i'm trying use proxmox ve json api, wreq can login , json response containing token sent cookie every request. question how set cookie wreq ? looks session handling automatically handle set-cookie sent server, in case never happens. is there wreq equivalent simple curl -b "something=value" in shell ? looks possible call cookie constructor hand takes lot of argument, , don't know should put in there besides name , value. thanks, one option use getwith allows specify cookiejar custom cookie values. {-# language overloadedstrings #-} import network.wreq.lens import network.wreq import control.lens import network.http.client import data.time.clock secs n = n*10^12 mins n = n*60 days n = n*1440 foo = <- getcurrenttime let expires = addutctime (days 30) cookie = cookie "name" "value" expires "example.com" "/" true true false false jar = createcookiejar [cookie] opts = de

javascript - MeteorJS and IoT Space -

i want deploy meteor application on wago industrial plc 750-8202. wago supports boards support package ptxdist tooling support ( communicate codesys program on linux-based wago pfc200 plc ). have no idea how can utilize meteor on such platform. have ideas how steps can realized add meteor support wago plcs ? it has linux on it, ssh plc. make sure connected local network. now can install node , else. have own vps. configure everything. can install ftp server , upload files on ftp. or create small script triggered github hooks , update plc push changes master branch.

c# - How to validate a swagger rest API using visual studio -

i new api testing using swagger rest api. looking examples on how validate post request rest api call swagger. trying figure out how write unit test validating swagger rest api in visual studio 2015 edition in c#. please let me know how can proceed , if have examples worked real great me. thanks, anusha

data warehouse - Dim_geography csv? -

edit * there somewhere csv file geographical infomation on dim_geography. mean go create it, im thinking there must csv file or similar out there provide me hierarchies need create table in our dwh my basic need..... list of these in world level name 1 continent 2 country 3 state/provence 4 city

php - SQL Query If Statement? -

i have 2 fields in legacy database. want query 1 of them, null , in case there if statement like if field_a !== null { field_a='value' } else { field_b='value' } my question is, there way in sql or have 2 queries, 1 check if null, if statement in logic? i think can capture logic this: where field_a = 'value' or (field_a null , field_b = 'value') or more as: where field_a = 'value' or field_b = 'value'

java - How to use DirectedSparseVertex() in the jung library? -

i new jung library, , trying create new vertex , following jung tutorial (here: http://jung.sourceforge.net/doc/manual.html#start ). but, eclipse ide cannot recognize directedsparsevertex class or directededge class when try use it. wondering if missing import or something? here code. hope guys can help. import java.net.url; import java.util.arraydeque; import java.util.arraylist; import java.util.linkedlist; import java.util.priorityqueue; import java.util.queue; import org.jgrapht.directedgraph; import org.jgrapht.graph.defaultedge; import edu.uci.ics.jung.graph.directedsparsegraph; import edu.uci.ics.jung.graph.graph; import edu.uci.ics.jung.graph.sparsegraph; import edu.uci.ics.jung.visualization.renderers.renderer.vertex; public class locknodes { public locknodes() { graph original = new directedsparsegraph(); vertex v1_orig = original.addvertex(new directedsparsevertex());

ios - How to build frameworks for arm* architecture only, with Carthage? -

i'm trying build project sent appstore, , dependencies going arm * + i386 + x86_64 . take carthage. how make assembly dependencies arm * ? i had read instructions carefully) specifically, carthage copy-frameworks

php - Marketplace using Paypal -

hi creating mobile app marketplace hoping ebay model implemented. buyer pay seller , take our cut seller. don't want payment ourself sale , handle disputes order shipping or chargebacks. when sale done on our app, buyer should send payment sellers paypal , paypal handle other stuff regarding disputes or chargebacks. i want seller link paypal account our app , take permissions future payments , maintain record can calculate fee regarding sales made on our platform. paypal mobile sdk support feature. but question here how can automate original purchase process? 1 option when sale done, send invoice seller side buyer (possible using paypal rest api) , open invoice pay link on buyer side. once buyer pay invoice , transfer funds seller know sale approved because paypal facilitator have access invoice (we sent invoice buyer have permissions of invoicing of seller account). but if don't want invoicing system? can implement buyer send funds seller without generating invoice

machine learning - Increasing training data doesn't reduce overfitting in CNN -

i working on cnn classification problem: using cnn classify audio emotions 6 classes (anger, disgust, fear, happy, sad, neutral). using emodb dataset, , input features fourier transforms [256*36]. , cnn network has 3-4 convolutional layers max-pooling each conv, plus 1 connected layer. learning curve shows large gap between training , validating loss, indicating severe overfitting. , best validating accuracy can between 75% 80%. learning curve here 1 of learning curve got. black , blue ones training accuracy , loss, respectively. other 2 validation accuracy , loss. validation result don't improve anymore when training loss goes 0. i have tried augment data set, add 50% dropout fc layer, add l2 regularization fc layers, , use learning rate decay policy (as 'inv' in caffe). gap still remains. is because dataset small? have around 500 audios in total, , extend around 6,000 samples. when increased data 15,000, gap still large. 15,000 still small dataset cnn? woul

javascript - How to know which element is not visible in console output using protractor? -

when executing jasmine script using protractor, getting below message test step having lot of elements , i'm not sure element not visible, there way capture non visisble element in console output. × should able change first , last name of existing 'admin user' failed: element not visible do need changes in config file? my current config below. /** * created kumarso on 5/25/2016. */ exports.config = { directconnect: true, seleniumaddress: 'http://localhost:4444/wd/hub', specs: ['../conf/costome_conf.js','../test_spec/editusertest_spec.js'], chromedriver: c:/users/kumarso/appdata/roaming/npm/node_modules/chromedriver/lib/chromedriver/chromedriver.exe', framework: 'jasmine2', multicapabilities: [{ browsername: 'chrome' }], allscriptstimeout: 100000, jasminenodeopts: { oncomplete: null, isverbose: false, showcolors: true, in

iphone - ProgressDialog equivalent for iOS -

Image
i'm starting development ios using xamarin.ios , want know if there progressdialog of android equivalent in ios? in other words, want create modal in ios: i think, https://components.xamarin.com/view/mbprogresshud/ is best option. can find information here https://components.xamarin.com/gettingstarted/mbprogresshud edit 1 here static class written me. hope you using coregraphics; using mbprogresshud; using system; using system.collections.generic; using system.text; using uikit; namespace candycaneclub.ios.helper { /* generic helper class show , hide overlay running processes on application */ public class overlayhelper { public static mtmbprogresshud overlay; //initialize overlay string message show , view on suppose show public static mtmbprogresshud initoverlay(string message, uiview view) { overlay = new mtmbprogresshud(view) { labeltext = message, remov