Posts

Showing posts from February, 2014

node.js - LoopBack create app error "Empty Server", how to solve this? -

Image
loopback nodejs framework, i'm trying create app , encountered error, can help. thanks looks should choose 1 of following fields using arrow buttons : api-server, empty-server, etc . after press "enter" .

How to make Netbeans show variable names like IntelliJ? -

Image
is there plugin or function enable make netbeans show variable names? you can use alt+shift+1 bring variable viewer.

java 8 - [SonarLint]: make this anonymous inner class a lambda -

the below code works, have notification sonarlint because use anonymous class in stream instead of lambda expression, , don't see how improve below code avoiding notification: properties prop = new properties(); properties temp = new properties(); //... add values , keys in prop , temp prop.putall(temp.entryset().stream() .filter( entry -> !prop.containskey(entry.getkey())) .map( new function<entry<object, object>, entry<string, string>>(){ @override public entry<string, string> apply(entry<object, object> entry) { return new entry<string, string>() { @override public string setvalue(string value) { return value.trim().tolowercase(); } @override public string getvalue() { return ((string) entry.getvalue()).trim().tolowercase(); } @override

vb6 - Run-Time error '91' Object varaible or With Block variable not set -

i have tried code below, got forum, have vb application, if extract first time remove blanks. if try second time, give me run-time error '91', object variable or block variable not set. dim r range dim rows long dim long set r = activesheet.range("a7:w77") rows = r.rows.count = rows 1 step (-1) if worksheetfunction.counta(r.rows(i)) = 0 r.rows(i).delete next

javascript - passing data using post array in java-script -

i try load b.php a.php after execution in function , pass data using post array a.php b.php within same time. code list follows a.php <script type="text/javascript"> alert_for_the_fucntion(); window.location.href = "b.php"; function alert_for_the_fucntion() { $.post("b.php", {action: 'test'}); } </script> b.php <?php if (array_key_exists("action", $_post)) { if ($_post['action'] == 'test') { echo 'ok'; } } ?> for testing purpose tried echo in b.php . not working. have done mistakes? or there possible method this. your code this: tells browser navigate b.php (using request) triggers post request using xmlhttprequest the post request probably gets canceled because browser leaves page (and xhr request asynchronous). if doesn't, response ignored. either way, has no effect. you see result of requ

mongodb - Aggregate data using mongo-spring aggregation framework -

i in need of retrieving grades in between 40-60. folloiwng code snipit tried. @document(collection = "grade") public class grade{ private string courseid; private string assignmentid; private string studentid; private studentsubmissions studentsubmissions; //getters setters omitted } follwoing studentsubmissions class public class studentsubmissions{ private string id; private int grade; private string version; //getters setters omitted } following aggregate method. public list<gradesummary> aggregate(float mingrade, float maxgrade) { criteria pricecriteria = where("grade").gt(mingrade).andoperator(where("grade").lt(maxgrade)); return mongotemplate.aggregate(aggregation.newaggregation( match(pricecriteria), group("studentsubmissions") .sum("grade").as("grades"

Google Drive Api authentication in Android app -

i using google drive in android app application takes photos , uploads drive automatically, problem authentication asks choose google account first time when open app ,can programatically give credentials , make authentication done can avoid step of choosing , authentication ui. you may refer link . can done oauth2 playground @ https://developers.google.com/oauthplayground . steps:- create google account (eg. my.drive.app@gmail.com) use api console register mydriveapp ( https://console.developers.google.com/apis/credentials/oauthclient?project=mydriveapp or https://console.developers.google.com/apis/ ) create new set of credentials (nb oauth client id not service account key , choose "web application" selection) include https://developers.google.com/oauthplayground valid redirect uri note client id (web app) , client secret login my.drive.app@gmail.com go oauth2 playground in settings (gear icon), set * oauth fl

windows - Access Remote machine files in host machine -

i have machine (windows 7) , got remote machine (windows server 2012) , can map host machine drive in remote connection, opposite navigate drive in host machines, how can achieve that? my main goal use ide in host machine alter code on virtual machine , not have install on server i tried \\servermachine\c$ or \\servermachinename\ i authentication requests inserrting right domain user , password dont seem able open connection after right command \\servermachinename\ but autentication domain not same domain machine cointained. after opened empty folder, , had share folder wanted inside remote machine

confused about composite function in haskell -

let f = show.sum.map read.words f "1 2" it work. show.sum.map read.words "1 2" i errors: <interactive>:19:19: couldn't match expected type ‘a -> [string]’ actual type ‘[string]’ relevant bindings include :: -> string (bound @ <interactive>:19:1) possible cause: ‘words’ applied many arguments in second argument of ‘(.)’, namely ‘words "1 2"’ in second argument of ‘(.)’, namely ‘map read . words "1 2"’ prelude> :t show.sum.map show.sum.map :: (num [b], show b, foldable ((->) [a])) => (a -> b) -> string prelude> show.sum.map read.words "1 2" <interactive>:21:19: couldn't match expected type ‘a -> [string]’ actual type ‘[string]’ relevant bindings include :: -> string (bound @ <interactive>:21:1) possible cause: ‘words’ applied many arguments in second argume

c# - .NET Core MVC generic controller views -

when trying create generic .net core mvc controller returns views, views aren't found(error message: "cannot resolve view details"). happening because, generic controller isn't tied specific view. view should picked based on t is. i've seen examples of in asp.net, i'm unable recreate in .net core. is there way solve problem in .net core? generic controller example: public class controllerbase<t> : controller t : class { private imanager<t> _manager; public controllerbase( imanager<t> manager) { _manager = manager; } public async task<iactionresult> details(int? id) { if (id == null) { return notfound(); } var result = await _manager.get(id); return view(result); } } as mentioned in comments can can specify view use via return view("viewname", result); where viewname should adapted requirements (your question sugge

php - Output the array such that -

i making program output array in ascending order if there found matching number skip , consider later. example: array = 2, 1, 3, 1, 5, 2; output should be: array = 1, 2, 3, 5, 1, 2 //first 4 sequence number(1,2,3,5) , repeating number sequenced later. here code <?php if(isset($_post['submit'])) { $var = $_post['in']; $arr = explode(" ",$var); sort($arr); $size = sizeof($arr); $arr2 = array(); $cnt=0; $k=0; for($i=0;$i<$size;$i++) { for($j=0;$j<$size;$j++) { $k = $j + 1; if($arr[$j] < $arr[$k]) { $arr2[$j] = $arr[$j]; array_splice($arr,$j,1); } if($arr[$j] == $arr[$k]) { continue; $cnt++; } if($cnt==0) { break; } } } foreach($arr2 $value) { echo " ".$value; } } ?> <html> <head></head> <body> <form method="post"> <h2>enter data&l

c# - Garbage Collector too slow in foreach loop? -

this question has answer here: .net , bitmap not automatically disposed gc when there no memory left 3 answers i have foreach loop operations images. getting outofmemoryexception when running code 50+ images; because image instances 15+ mb each. var files = directory.getfiles(path).tolist(); foreach (var file in files) { image image = new bitmap(file); //do operations } i removed main logic because problem still exists small piece of code. when add gc.collect(); in foreach loop problem gone , don't exception. my question is: garbage collector slow clean images aren't needed anymore without calling collect method or missing else? never noticed problem before. never thought there problem because //do operations part needs ~1 second each image. should enough time garbage collector thought. perhaps should work using : var files =

ssl - C# Proxy HTTPS CONNECT -

im trying use proxymesh api c#. excerpt site: https://proxymesh.com/faq/ does proxy server support https/ssl sites? yes. proxy server still http, can securely proxy https/ssl connections between , https server (using connect method). communication between client/browser , secure site encrypted; proxy server moving data , forth. caveat since proxy server cannot inspect https requests, all proxy authorization headers or custom proxymesh headers must sent initial connect method . ip based authentication recommended. end-to-end https support added in future. the bolded section important. have no idea how in c# the code have far.. keep on getting bad request results: httpwebrequest request = (httpwebrequest)webrequest.create(url); webproxy myproxy = new webproxy(proxyaddress, false); networkcredential proxycredential1 = new networkcredential(username, password); myproxy.usedefaultcredentials = false; myproxy.credentials = proxyc

xml - xslt convert date, seperated node -

on xml have in level3 <incorporationdate> <ccyy>2016</ccyy> <mm>04</mm> <dd>21</dd> </incorporationdate> now need display 21 april 2016 so try concat , use format-date error try format string. <xsl:variable name="incorpdate"> <xsl:value-of select="concat(//a:identification/b:incorporationdate/c:dd,'/',//a:identification/b:incorporationdate/c:mm,'/',//a:identification/b:incorporationdate/c:ccyy)"/> </xsl:variable> and <xsl:value-of select="format-date($incorpdate, '[d] [mnn] [y0001]')" /> i try format-date on whole node <xsl:value-of select="format-date(//a:identification/b:incorporationdate, '[d] [mnn] [y0001]')" /> i know simple xml/xslt it's not know, learn need change lot's of stylesheets. understanding. create xs:date , format that: <xsl:template match="incorporationdate&

nginx - vuejs blank page after npm run build -

i faced problem in vue.js spa project when upload in server. when run npm run dev works after run npm run build , upload server project has blank page. favicon , title work fine. when run npm run build got message "tip: built files meant served on http server. opening index.html on file:// won't work." if manually refer project resources in index.html, page display it's contents vue-router doesn't work. i appreciate if can suggest solutions rid off problem.

arrays - Complexity of getting all neighbors of all nodes in adjacency list/matrix -

if want neighbors of 1 node in graph, time complexity o(|v|) if graph stored in adjacency matrix , o(|v|) if it's saved in adjacency list. thinking, how change if did not want neighbors of 1 node instead nodes. (note: adjacency list contains array , linked lists. 1 linked list stored @ each array entry, each array entry represents 1 node. each node in linked list represents adjacent node.) my though process following: in adjacency matrix need have @ every single entry. therefore time complexity o(|v|^2). in adjacency list need @ each array entry , go through respective linked list. thinking, should done in o(|e|) because @ edges. is thinking correct? the time complexity o(n + m) n = number of vertex in graph & m = number of edges in graph. need apply bfs or dfs algorithm.

java - Can I prefix a function with "get" in Springboot -

i have mcq class associated mongorepository, , want instance of mcq apply several changes (answers shuffle, questions draw, etc). declared function "mymcq.getinstance()", can't because every time want send mcq in responseentity there error in json output because springboot thinks there "instance" property in class. here java class : @document(collection = "mcqs") public class mcq { @id public string id; @dbref public user creator; public string title; public string categoryid; public list<mcqchapter> chapterlist = new arraylist<>(); public difficulty difficulty; public mcq() {} public mcq(string title) { this(); this.title = title; } public arraylist<string> getquestionsids() { arraylist<string> result = new arraylist<>(); (mcqchapter chapter : chapterlist) result.addall(chapter.getquestionids()); return result; } public

r - There is a error while loading the library gmodels -

> install.packages("gmodels",dependencies = true) installing package ‘c:/users/omprakash/documents/r/win-library/3.4’ (as ‘lib’ unspecified) trying url 'https://cran.rstudio.com/bin/windows/contrib/3.4/gmodels_2.16.2.zip' content type 'application/zip' length 74193 bytes (72 kb) downloaded 72 kb package ‘gmodels’ unpacked , md5 sums checked downloaded binary packages in : c:\users\omprakash\appdata\local\temp\rtmpo6jfcq\downloaded_packages > library(gmodels) error: package or namespace load failed ‘gmodels’ in library.dynam(lib, package, package.lib): dll ‘gtools’ not found: maybe not installed architecture? it seems gtools not installed. you should try manually installing it. colin

android - Drag Listview Item on Top -

how drag array item when code execute? <listview android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentleft="true" android:id="@+id/listview" android:layout_alignparentstart="true" android:layout_alignparenttop="true" /> ­­­­­­­­­­­­­­­­­­­­­ for drag listview item on top means 0th position: getlistview().setselection(0); for smooth scroll: getlistview().smoothscrolltoposition(0); use property. hope help...

ios - Alamofire data is not coming instantly for usage -

when getting data alamofire not yet loaded completely, before below code getting executed, don't know how use completion handler in it, new ios programming, please help. func mobileverification(mobilenumber:string)->bool{ let params:[string:string] = ["mobile_num":mobilenumber] alamofire.request("*************",method:.post,parameters:params,encoding: urlencoding.httpbody).responsejson { response in var loginmessage = "" if let jdata = response.data, let utf8text = string(data: jdata, encoding: .utf8) { let json = json(data:jdata) print(json) let array = json["result"].arrayvalue print(array[0]["message"]) if let loginmessage = array[0]["message"].string{ self.view.maketoast(loginmessage) } }

javascript - How to send cookie in each request header in angularjs? -

Image
hi in developing angularjs web application. using api's data. on login successful data in cookie(response header). in next subsequent http calls need send cookies data apis. below snapshot of response header. below sample $http call. var req = { method: 'post', url: savepersonaldetailsurl, headers: { requestedplatform: "web", requestedlanguage: cookiepreferredlanguage }, data: { loginid: loginid } $http(req).then(function (response) { //do here }, function (error) { toastr.error($filter('translate')('error occured')); }); on each http call want send cookie in header. may know how can done in angularjs? appreciated. thank you. one of features of cookies they're sent server each request. make sure domain request being made same domain set or sub domain. the cookie stored browser, , cooki

pointers - C, pass to function by reference. Pass forward -

i understood meaning of passing reference , value in c, in program "pass forward" reference function, neatness purposes, instance: void f2(int *x2) { *x2 = 7; } void f1(int *x1) { *x1 = 4; f2(x1); } int main() { int x = 1; f1(&x); printf("%d\n",x); return 1; } does main function print out 4 or 7? moreover, if sure pass reference f2 inside f1 , idea do: void f1(int *x1) { *x1 = 4; int x2; &x2 = x1; f2(&x2); } but don't find elegant , fast (in program use instead of int pretty big structs , avoid creating copy inside every function). soultion work anyway? there more elegant , faster way? thanks in advance edit: i tested , first snippet compile , works expected (main prints out 7). first method right way. second code snippet wrong , not compile in c, there's neither reference nor there pass reference concept. arguments always passed value. you can emulate pass reference semanti

ibm mobilefirst - Clickjacking through X-Frame in Worklight 7.0 -

i using mfp 7.0. protect desktop browser app clickjacking through x-frame. there configuration made in server can add x-frame option response header? yes. feature available in mfp 7.0. use of ifixes later september 2015 feature. once have ifix installed, can configure desktop browser environment or mobile web app environment prevent clickjacking through x-frames. the configuration in application-descriptor.xml be: <mobilewebapp cachemanifest="no-use" xframeoptions="deny"/> <desktopbrowser cachemanifest="no-use" xframeoptions="deny"/> the other options available : no-use or sameorigin more details here .

office js - Set custom header (x-header) on Outlook compose mail with JS addin -

i want set custom header in outlook outgoing mail using outlook js web addin. how can achieve this? while mark's (@marklafleur) answer correct , indeed office.js api doesn't provide direct functionality manipulate transport layer headers, able achieve this. there 2 options available ... office.context.mailbox.makeewsrequestasync() gives ability send ews request exchange server , get/set properties of item, including x-headers (which yet property; refer distinguished property "internetheaders", corresponding id {00020386-0000-0000-c000-000000000046} ). please see example on github: make exchange web service request outlook make rest api call resturl appropriate query set/get properties of item. example of such request may find: set custom header outlook/office 365 res t

javascript - Get hovered word from hover() in Jquery? -

i want make auto translate word mouse on over it. use $('p').hover(function () { var hoveredword = $(this).text(); translate(hoveredword, 'en'); // function translate word english language }); it return whole text within paragraph, however, want word hover not whole text. there function in jquery can use archive this? thanks. i in different way. wrap text content using <span> : $(function() { $('p').html(function () { var cont = []; return "<span>" + $(this).text().split(" ").join("</span> <span>") + "</span>"; }).on("mouseover", "span", function() { var hoveredword = $(this).text(); console.log(hoveredword); // translate(hoveredword, 'en'); // function translate word english language }); }); span:hover {background: #ccf;} <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.

php - xDebug Remote-Debugging Session does not start -

i have following problem. want use xdebug debugging in phpstorm. want via remote-debugging. xdebug-session not trigger. i installed browser xdebug-helper-plugin , selected php-storm. activated plugin web-application want debug (the address of application want debug "gm01.powty.com/acc3_dev/" in case). in phpstorm configured server this: picture of server configuration in phpstorm then activated listener in phpstorm (the green phone). i checked ip on work-pc "ipconfig" configuration on server later (the ip 10.50.21.224 in case). i executed "netstat -a" check if state of "0.0.0.0:9000" in "listening"-state. then configured apache-server of course. downloaded correct xdebug.dll using phpinfo() of server. added following lines php.ini on server: php.ini on server then restarted server make configuration active. checked via phpinfo(). by when enter address of webapplication in browser, debug-session not start. not know wh

jmeter - how to handle the error "HTTP Status 500 - Unable to do Single Sign On or Federation" -

Image
i using govt site. after correlation facing issue "http status 500 - unable single sign on or federation" facing while replaying script in jmeter. suggest me how handle this. suggestion valuable me. it appears trying load test application uses federated identity , saml . it means won't able record , replay test scenario without performing advance correlation of dynamic parameters. correlation stands process of extracting dynamic parameter previous response using post-processor , saving jmeter variable , adding parameter next request test plan should like: see how load test saml sso secured websites jmeter article detailed jmeter configuration of extractors , variables.

Python: If (user_input) in dictionary -

having issue checking if user input in dictionary. basics of program there's shop inventory. items stored in dictionary corresponding values e.g. {'kettle': 3,.....} then want user write want. if user has entered 'kettle' want remove item shop inventory , put in user inventory. the main problem right getting if statement together. i'm trying: user_choice = input('what buy? ') if user_choice in shop_inventory: print('complete') else: print('fail') how can program print "complete"? part of question asking if in dictionary, want remove inventory. believe can use 'del' user_choice = input('what buy? ') if user_choice in shop_inventory: del shop_inventory[user_choice] print(shop_inventory) print('complete') else: print('fail')

inheritance - Is there any annotation to warn that subclasses shouldn't hide a static method in Java -

i have class contains public static method in java. there annotation in java warn subclasses not use same method signature(and thereby hide superclass method). other workarounds fine. just make superclass method final : class foo { public static final void go() {} } class bar extends foo { public static void go() {}; // error } ideone example

excel vba - "Run-Time error '13': Type mismatch" in VBA for JSON extraction with JIRA API -

Image
new community here. i've done decent amount of programming i'm new vba. never used before until , tasked extracting json data jira api excel spreadsheet. keep getting error "run-time error '13': type mismatch" , i'm not sure why. know error has passing in incorrect types i've tried changing json variable string no success. have ideas? thanks! by way, trial jira instance testing api functionality. sub test() 'authenticate user dim response string createobject("microsoft.xmlhttp") .open "post", "https://apitestsite.atlassian.net/rest/auth/1/session", false, "admin", "password" .setrequestheader "x-atlassian-token:", "nocheck" .send response = .responsetext end 'query through json set myrequest = createobject("winhttp.winhttprequest.5.1") myrequest.open "get", "https://apitestsite.atlassian.net/rest/api/2/issue/cc-1", false, "

jquery - Refresh only the table content in a Template with new items (Django) -

i implementing table filters. none of existing libraries (such datatables) work me because based on client pagination , cannot bring data db , paginate in client side since has more 5 million items. so, thing want able write in input field , filter items in table accordingly. url starts is: http://127.0.0.1:8000/es/view-containing-the-table/ this url has html cointained in custom_table.html (see file below), includes sub-template called table_rows.html , the 1 want refresh to have done following: structure of project: project |-app |-static | |-javascript | |-myjs.js | |-templates | |-templates1 | |-custom_table.html | |-table_rows.html | |-views | |-__init__.py #gathers views othe files) | |-ajaxcalls.py | |-modelviews.py | |-urls.py urls.py url(r'^table_rows/$', views.tablerows, name='tablerows'), custom_table.html #extend , loads here {% block content %} <table id="mytable""

javascript - vaadin-grid selection not working -

the row selection not working me. selecteditems array changes if select @ once. not sure if got wrong or if bug. selecteditems: array contains selected items. https://www.webcomponents.org/element/vaadin/vaadin-grid/elements/vaadin-grid <link rel="import" href="../bower_components/polymer/polymer-element.html"> <link rel="import" href="../bower_components/vaadin-grid/vaadin-grid.html"> <link rel="import" href="../bower_components/vaadin-grid/vaadin-grid-selection-column.html"> <dom-module id="schedule-vaadin-test"> <template> <vaadin-grid id="material" aria-label="array data example" items="[[items]]" selected-items="{{selecteditems}}"> <vaadin-grid-selection-column auto-select> </vaadin-grid-selection-column> <vaadin-grid-column width="50px" flex-gro

concatenation - How to automatically name and concatenate cells from different operations in Matlab -

i wrote sample code illustrate problem - see below. have several operations, each executed independently (not 4 in example, more). want to... 1) automate naming of results can larger number of years, parts of years , plant types (e.g. name variable "string200811" when year = 2008, partofyear = 1, planttype = 1 etc.) 2) automate concatenation, (see below). let me know if unclear! % operation 1 year = 2008; partofyear = 1; planttype = 1; string200811 = 'blabla'; % random result number200811 = rand(1); % other random result vector200811 = [rand(1); rand(1); rand(1); rand(1)]; % other random result % operation 2 year = 2008; partofyear = 1; planttype = 2; string200812 = 'blablablubb'; number200812 = rand(1); vector200812 = [rand(1); rand(1); rand(1); rand(1)]; % operation 3 year = 2008; partofyear = 2; planttype = 1; string200821 = 'blablabla'; number200821 = rand(1); vector200821 = [rand(1); rand(1); rand(1); rand(1)]; % operation 4 year =

c# - Changing csproj file in open project without reloading -

i'm making addin visualstudio(2015). i want change .csproj file in opened project code have reload project. is there way without reloading, special vs tools change project properties? my code: var collection = new projectcollection(); collection.defaulttoolsversion = "4.0"; var project = collection.loadproject(@"..\..\myproject.csproj"); var group = project.xml.addpropertygroup(); group.label = "mygroup"; group.addproperty(myname, "myvalue"); project.save();

mysql - How to SELECT with all index of SUBSTRING_INDEX -

i have table this table foo1 +----+------------------------------+ | id | content | +----+------------------------------+ | 1 | hello world | +----+------------------------------+ | 2 | hello users | +----+------------------------------+ | 3 | post submitted users | +----+------------------------------+ | 4 | c# programming | +----+------------------------------+ i send parameter stored procedure 'hello,users,post'. want split parameter comma(,) , rows contains indexes (hello or users or post). if send 'hello,users' return table should (contains hello or users) +----+------------------------------+ | 1 | hello world | +----+------------------------------+ | 2 | hello users | +----+------------------------------+ | 3 | post submitted users | +----+------------------------------+ i have tried query select * foo1 foo1.content concat('%'

python - Pandas convert yearly to monthly -

i'm working on pulling financial data, in formatted in yearly , other monthly. model need of monthly, therefore need same yearly value repeated each month. i've been using stack post , trying adapt code data. here dataframe: df.head() date ticker value 0 1999-12-31 ecb/ra6 1.0 1 2000-12-31 ecb/ra6 4.0 2 2001-12-31 ecb/ra6 2.0 3 2002-12-31 ecb/ra6 3.0 4 2003-12-31 ecb/ra6 2.0 here desired output first 5 rows: date ticker value 0 1999-12-31 ecb/ra6 1.0 1 2000-01-31 ecb/ra6 4.0 2 2000-02-28 ecb/ra6 4.0 3 2000-13-31 ecb/ra6 4.0 4 2000-04-30 ecb/ra6 4.0 and code: df['date'] = pd.to_datetime(df['date'], format='%y-%m') df = df.pivot(index='date', columns='ticker') start_date = df.index.min() - pd.dateoffset(day=1) end_date = df.index.max() + pd.dateoffset(day=31) dates = pd.date_range(start_date, end_date, freq='m') dates.name = 'date' df = df.reindex(dates, method='ffill')

servicebus - Windows Service Bus Issue -

we using windows service bus in 1 of our projects , , of late have been getting timeout exception, container size on sql server grows large , processing of messages starts taking lot of time. however noticed number of messages on queue @ stage still in single digit. any thoughts on cause of issue , how can resolve this? any appreciated.

How to use the backslash operator in Julia? -

i trying invert huge matrices of order 1 million 1 million , figured backslash operator helpful in doing this. idea how it's implemented?. did not find concrete examples appreciated. any idea how it's implemented? it's multialgorithm. shows how use it: julia> = rand(10,10) 10×10 array{float64,2}: 0.330453 0.294142 0.682869 0.991427 … 0.533443 0.876566 0.157157 0.666233 0.47974 0.172657 0.427015 0.501511 0.0978822 0.634164 0.829653 0.380123 0.589555 0.480963 0.606704 0.642441 0.159564 0.709197 0.570496 0.484826 0.17325 0.699379 0.0281233 0.66744 0.478663 0.87298 0.488389 0.188844 0.38193 0.641309 0.448757 0.471705 0.804767 0.420039 0.0528729 … 0.658368 0.911007 0.705696 0.679734 0.542958 0.22658 0.977581 0.197043 0.717683 0.21933 0.771544 0.326557 0.863982 0.641557 0.969889 0.382148 0.508773 0.932684 0.531116 0.838293 0.031451 0.242338 0.663352 0.

TestLink API Python - How to look up test cases by assignee -

i'd list of test cases assigned specific user in testlink. i'm using testlink python api, version 0.6.4 . i've been reading jetmore docs testlink . so far have following code: from testlink import testlinkapigeneric, testlinkhelper import testlink testlink_api_python_server_url = '<my testlink ip>' testlink_api_python_devkey = '<my testlink devkey>' my_test_link = testlinkhelper(testlink_api_python_server_url, testlink_api_python_devkey).connect(testlinkapigeneric) test_project_id = my_test_link.gettestprojectbyname('<project name>')['id'] plans = my_test_link.getprojecttestplans(test_project_id) # i've tried ['globalroleid'] userid = int(my_test_link.getuserbylogin('<user name>')[0]['dbid']) plan in plans: print(my_test_link.gettestcasesfortestplan(testplanid=plan['id'], assignedto=userid, details='full')) this produces empty list every test plan in project:

Converting List to pandas DataFrame -

i need build dataframe specific structure. yield curve values data, single date index, , days maturity column names. in[1]: yield_data # list of size 38, yield values out[1]: [0.096651956137087325, 0.0927199778042056, 0.090000225505577847, 0.088300016028163508,... in[2]: maturity_data # list of size 38, days until maturity out[2]: [6, 29, 49, 70,... in[3]: today out[3]: timestamp('2017-07-24 00:00:00') then try create dataframe pd.dataframe(data=yield_data, index=[today], columns=maturity_data) but returns error valueerror: shape of passed values (1, 38), indices imply (38, 1) i tried using transpose of these lists, not allow transpose them. how can create dataframe? iiuc, think want dataframe single row, need reshape data input list list of list. yield_data = [0.09,0.092, 0.091] maturity_data = [6,10,15] today = pd.to_datetime('2017-07-25') pd.dataframe(data=[yield_data],index=[today],columns=maturity_data) output:

javascript - How can I show Privacy dialog popup to ask visitor to allow flash plugin for browser? -

Image
how can show privacy dialog popup ask visitor allow flash plugin browser using java script or whatever? so need popup 1 in image: i read if used swfobject automatically pop-up show if not enabled, tried , did not work me. tried lot of solutions version of flash plugin try trigger pop-up, , none of solutions tried worked me like: if(browsername()=="chrome") { plugindetect.getversion("."); var version = plugindetect.getversion('flash'); } thank you. i found solution pul tag , check if flash exists , not enabled ask enable it, if not exists redirect downlad page <a href="http://www.adobe.com/go/getflashplayer/" class="button">get flash player</a> or: <a href="https://get.adobe.com/flashplayer/" class="button">get flash player</a>

Header file not found when try to build c++ project link to a static library with gradle -

i want build c++ project gradle since think universal build tool multiple language.i try add static library project. here directory structure. . ├── build.gradle ├── gradle │   └── wrapper │   ├── gradle-wrapper.jar │   └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── libs │   └── addlib │   ├── add.hpp │   └── libadd.a └── src ├── greeter │   ├── cpp │   │   └── greeter.cpp │   └── headers │   └── greeter.hpp └── main └── cpp └── greeting.cpp and here build.gradle apply plugin: 'cpp' model { repositories { libs(prebuiltlibraries) { add { headers.srcdir "libs/addlib" binaries.withtype(staticlibrarybinary) { staticlibraryfile = file("libs/addlib/libadd.a") } } } } components { greeter(nativelibraryspec) { }

javascript - Angular 1/ ng-if one-time binding only in a condition -

in template have : <div ng-if="$ctrl.show()"> <input class="form-control" type="text"> </div> in component show() { if (angular.isdefined(this.parking.parkingtype)) { return this.parking.parkingtype.labelkey === 'parking_type.air' } } i want angular process function when clicking on select input (ui-select) attribute on-select="$ctrl.show()" : <ui-select ng-model="$ctrl.parking.parkingtype" on-select="$ctrl.show()"> <ui-select-match allow-clear="true"> <span>{{ $select.selected.label }}</span> </ui-select-match> <ui-select-choices repeat="item in $ctrl.parkingtype | filter: { label: $select.search }"> <span ng-bind-html="item.label"></span> </ui-select-choices> </ui-select> this case may similar sample case of: launching function

django - DRF file.read() contains HTML header info and not just file content -

i'm not sure problem is, file.read() should give me file content. i'm printing out first 200 chars , content headers instead of uploaded file data. uploader local_file = os.path.join(basedir, 'a.jpg') url = baseurl + 'a.jpg' files = {'file': open(local_file, 'rb')} headers = {'authorization': 'token sometoken'} r = requests.put(url, files=files, headers=headers) print(r.status_code) view class fileuploadview(baseapiview): parser_classes = (fileuploadparser,) def put(self, request, filename): file_obj = request.files['file'] data = file_obj.read() print(data[:200]) return response(status=http_204_no_content) and output printed is: b'--139822073d614ac7935850dc6d9d06cd\r\ncontent-disposition: form-data; name="file"; filename="a.jpg"\r\n\r\n\xff\xd8\xff\xe0\x00\x10jfif\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xe1!(exif\x00\x00ii*\x00\x08\x00\x0

java - Not Able to Access Testcases Under Testplan Using OTA -

i tried writing code getting null pointer exception. tried multiple solutions not able figure out problem. appreciated. my flow of execution : subject -> test -> tc1(testcase) itestsettreemanager treemanagerplan = qcconnection.testsettreemanager().queryinterface(itestsettreemanager.class); itestsetfolder basefolderplan = treemanagerplan.root().queryinterface(itestsetfolder.class); string foldernamesplan[] = null; testsetfolderplan=null; if(strtestplanpath.contains("\\")) { foldernamesplan = strtestplanpath.split("\\\\"); for(int i=1;i<foldernamesplan.length;i++) { system.out.println("qc folder parsing.." + foldernamesplan[i]); if(!foldernamesplan[i].equals("")) { boolean createfolder = true; for(int f=0; f< basefolderplan.count(); f++) { try{ if(basefolderplan.findchildnode(foldernamesplan[i]).name().equals

android - Why SphericalUtil.computeDistanceBetween method does not return accurate result? -

Image
hi working on computing distance nearest point of route. testing 2 routes (polylines). nearest point of routes relative origin point in same coordinate or spot sphericalutil.computedistancebetween method of google maps android library returns different results. example according code: for(route route : routes){ boolean islocationonedge = polyutil.islocationonedge(location, route.getlatlngcoordinates(), true, route_search_radius); boolean islocationonpath = polyutil.islocationonpath(location, route.getlatlngcoordinates(), true, route_search_radius); if(islocationonedge || islocationonpath){ //meaning route near @ , compute distance origin latlng nearestpoint = findnearestpoint(location, route.getlatlngcoordinates()); double distance = sphericalutil.computedistancebetween(location, nearestpoint); log.i(tag, "origin: "+location); log.i(tag, "nearest point: "+nearestpoint);

elasticsearch - Multiple Logstash instances vs Filebeats -

i'm trying establish best architecture our elastic stack implementation. we have 2 distinct networks (lets call them internal , external) , several web / db / application servers (approx 10) on each of these networks. i consume iis logs, our rabbitmq messages , other bits , bobs machines in both networks , send them single server on internal network elastic , kibana installation located. for servers on both internal , external networks can see 2 main ways logs sent elastic. setup logstash on each server , send output elastic server on internal network. setup filebeats on each server , send logs single server running logstash (this same box hosts elastic , kibana) i'm unsure of pros , cons of these approaches @ moment. believe correct approach use filebeats, i'm unaware why wouldn't put logstash in multiple places seems better distributing processing of logs. again, perhaps having 1 logstash 20-30 inputs isn't problem? interested in thoughts or gu

asp.net - How to resolve the error "String was not recognized as a valid Date Time in Vb.net " -

my code behind follows want enter date per displayed on textbox4 front end protected sub btnsave_click1(byval sender object, byval e eventargs) handles button2.click dim dt2 oledbparameter dt2 = cmd.createparameter dt2.oledbtype = oledbtype.date dim dt string = textbox4.innertext dt2.value = datetime.parseexact(dt,"m/dd/yyyy", nothing) dt2.parametername = "@startdate" cmd.parameters.add(dt2) end sub my front end code in aspx follows <div class="container" id="textbox4" runat="server" width="181px" bordercolor="black" borderstyle="solid"> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <div class='input-group date' id='datetimepicker1'> <input type='text' class="form-control" />

animation - Swift SpriteKit - Sprite vs Other Graphics -

is there different graphics file format vector / 3d graphics model used in 2d games ease of rotation? in past, use set of sprites have 8 direction animation character walking. there better way animate character walking using 1 character file format? not sure if asking right question. i figured 3d model can rotated direction character walking reduce need additional sprites. what games rpg, evony use sprite animation?

excel - Match Columns then search range -

Image
i have 2 sheets looking array pull single column of data sheet2(column q). the parameters 2 "emplid" columns on each sheet must match, , "trans date" column has on or between "departure date" , "return date" columns on same row. the problem think i'm running there repeat emplid's on each sheet each different date ranges -- example emplid 10113141

database - Transpose or output data to row based table -

i having trouble figuring out how output row based data table in powershell. able standard columnar based data table, not other way around. my current output looks like: books cables pens client1 1 0 0 client2 2 4 6 client3 1 3 10 the books, cables , pens constant, , have new clients add. i need able output table can narrow down filtering both client , item i need have this: client1 client2 client3 books 1 2 1 cables 0 4 3 pens 0 6 10 i use key/value pair fill in data separate object: $ctable = foreach ($client in $clientstuff) { [pscustomobject] @{ client = $client.name books = $client.books.count cables = $client.cables.count pens = $client.pens.count } } $ctable= $ctable | format-table need format table otherwise comes out list have 100s of clients , more 40 dif

Webpack with Babel lazy load module using ES6 recommended Import() approach not working -

i'm trying code splitting , lazy loading webpack using import() method import('./mylazymodule').then(function(module) { // module.mylazymodule } i'm getting 'import' , 'export' may appear @ top level note top level imports working fine, i'm getting issue when try , using dynamic variant of import() var path = require('path'); module.exports = { entry: { main: "./src/app/app.module.js", }, output: { path: path.resolve(__dirname, "dist"), filename: "[name]-application.js" }, module: { rules: [ { test: /\.js$/, use: [{ loader: 'babel-loader', query: { presets: ['es2015'] } }] } ] }, resolve : { modules : [ 'node_modules',

caching - AEM Dispatcher - cache rules -

i looking understanding on part of aem dispatcher configuration. go under /cache /rules section it looks below /rules { # initial blanket deny /0000 { /glob "*" /type "deny" } /0100 { /glob "*.html" /type "deny" } } does rule 100 mean dispatcher not caching html pages? yes, rule /0100 { /glob "*.html" /type "deny" } means no files .html extension cached. see documenatation more details. i'm not sure accomplish on publish instance. situation seem apt if html pages rendered user-specific data inline static parts (as in, user data rendered in jsp/htl scripts responsible displaying whole pages). not caching html pages puts significant strain on publisher farm. if avoidance of caching dynamic data reason config, there better ways deal serving user-specific data aem, eac

twitter bootstrap - Images falling outside css columns on iOS -

i using css columns display images of assorted widths , heights flow without large white spaces. works on desktop browsers, on ipad , iphone (using ios chrome), last images in list fall outside of columns, appearing right of columned container. i've been troubleshooting properties , can't make ios obey. example page: https://gohbavote.ca/round-1/entry-26 here's html: <div class="post-gallery"> <a href="[full img url]" data-lightbox="[lightbox-tag]" class="lightbox-item"> <img src="[thumb img url]" class="lightbox-img" alt=""> </a> <a href="[full img url]" data-lightbox="[lightbox-tag]" class="lightbox-item"> <img src="[thumb img url]" class="lightbox-img" alt=""> </a> <a href="[full img url]" data-lightbox="[lightbox-tag]" class="lightbox-item&qu