Posts

Showing posts from February, 2011

java - Eclipse javax.websocket import not resolved -

Image
i'm new java development (using speeding real-time game server, coming python). i'm trying add basic java server-side websockets, , added simplest example code found (from websockets production ready server in java? ). i'm importing following: my problem is, eclipse telling me import "javax.websocket" cannot resolved . can add "javax" module? don't understand complicated interface yet, lot help! (i've got latest eclipse, java 8 installed on mac os x 10.11 latest) do use jdk or java ee? javax.websocket in java ee .

c# - Browser back button fails - ONLY IF postback has been performed on previous page -

i'll keep simple. have 2 pages: list page detail page quick info on list page: a grid show list of items "view" hyperlink each pointing detail page (e.g. detail.aspx?id=1) a number of filters , search button by default list shows items without filtering scenario 1 (ok): without filtering, click on of view links this take me detail page of selected item click on browser button, list page shown (ok) scenario 2 (not ok): do search filter on list page, triggers postback filtered items click on 1 of view links this take me detail page of selected item click on browser button, error page ! error info: ie: webpage has expired chrome: err_cache_miss firefox: document expired any idea why scenario 2 fails bring list page? don't need filters retained when going back, need list page displayed straight away without error. thanks in advance try clear cache. here similar discussion. but did disable button line of javascript

c++ - How to troubleshoot vulkan blank screen? -

i went through lunarg 'drawcube' samples , incorporated code engine. when run, black screen, since black clear color. can change clear color different color , see it. but, geometry not render @ all. no errors or warnings generated. my question is, can troubleshoot issue this? renderdoc installs vulkan sdk (at least on windows), , frame debugger, similar pix/diagnostics, codexl , nsight. can give view of how graphics pipelines processing data. you should enable validation layers (particularly vk_layer_lunarg_standard_validation ), , install debug callback. if triggering 'warn' or 'error' messages, these indication of why not executing you'd expect.

ERROR org.quartz.core.JobRunShell - Job group1.JobReport threw an unhandled Exception -

there strange problem when generating report using quartz scheduler i can generate report fine! no problem. the method (reportsbean) works normally, there problem when passing through quartz any idea please?? don't know anymore :/ 13449 [myscheduler_worker-1] error org.quartz.core.jobrunshell - job group1.jobreport threw unhandled exception: java.lang.nullpointerexception @ com.changes.bean.reportsbean.createpdfcriticalchanges(reportsbean.java:104) @ com.changes.quartz.jobreport.execute(jobreport.java:36) @ org.quartz.core.jobrunshell.run(jobrunshell.java:202) @ org.quartz.simpl.simplethreadpool$workerthread.run(simplethreadpool.java:573) 13452 [myscheduler_worker-1] error org.quartz.core.errorlogger - job (group1.jobreport threw exception. org.quartz.schedulerexception: job threw unhandled exception. [see nested exception: java.lang.nullpointerexception] @ org.quartz.core.jobrunshell.run(jobrunshell.java:213) @ org.quartz.s

Using ant task in mobilefirst error in wladm cmd -

i followed tutorial: http://www.ibm.com/support/knowledgecenter/sshs8r_7.1.0/com.ibm.worklight.appadmin.doc/admin/r_invoking_the_wladm_program.html i'm trying enter command in cmd , tried this: wladm --url= http://ip:9080 --user=demo --passwordfile=path\wladm.config --secure=false show info i'm getting error: error accessing http://ip:9080/userandconfiginfo?locale=en_us : http/1.1 404 not found now when enter command: wladm --url= http://ip:9080 --user=demo --passwordfile=path\wladm.config --secure=false list adapters runtimename i'm getting error: error accessing http://sv591527.ph.sunlife:9080/management-apis/1.0/runtimes/sun lifetestapp/adapters?pagesize=1000000000&locale=en_us: http/1.1 404 not found anyone have idea i'm missing? the url should contain context root of mobilefirst web application administration services, is, should http://ip:9080/wladmin or http://ip:9080/worklightadmin . more details, please

vb.net - html.dropdownlistfor selected value not selected -

been stuck on 2 days...hoping guys can help. using vb.net mvc4 framework. i have html.dropdownlistfor in view looks this: @html.dropdownlistfor(function(model) model.title, new selectlist(model.titles, "key", "value"), "-select-", new {.id = "titles", .class = "form-control"}) model.titles dictionary(of string, string) such short list i'd rather pull directly function instead of database. got idea use dictionary list here: http://nimblegecko.com/dropdownlistfor-with-dictionaries-in-asp-net-mvc-and-why-selectlist-wants-to-kill-you/ my function looks this, gets pulled model model.titles public function getagcreptitles() dictionary(of string, string) dim list new dictionary(of string, string) list.add("a/d/sgt", "a/d/sgt") list.add("a/sgt", "a/sgt") list.add("cpl", "cpl") list.add("det", "det") return list end function

django - How to use the attribute 'url' of ol.source.OSM -

i've deployed local openstreetmap tile server , tried many times show map using openlayers3, failed unfortunately. here's experiment scene. deploy tile server on port 80, , image correctly via http://127.0.0.1:80/osm_tiles/ {z}/{x}/{y}.png. besides, place django web on port 8099, , can access web page via http://127.0.0.1:8099/my/page . in template page, wrote this var layer = new ol.layer.tile({ source: new ol.source.osm({ attributions: [ ol.source.osm.attribution ], url:'//127.0.0.1:80/osm_tiles2/{z}/{x}/{y}.png' }) }); var map= new ol.map({ target : 'map_canvas', loadtileswhileanimating: true, view: new ol.view({ center:ol.proj.transform([116.391625,39.906813], 'epsg:4326', 'epsg:3857'), zoom : 12 }), layers:[layer] }); the map_canvas shows nothing, can image

java - Creating objects with different properties -

i confused on how object oriented perspective maintainability in mind. taught when designing application think change. trying spend time on personal project design, heck may want change later. application inspired newest game called division. calculator damage per second. the technologies have chosen spring, rest, hibernate, angular.js 1.0 , maven. possibly bootstrap unsure @ moment because focusing on end. these technologies understand aren't needed level application doing learning purposes. now since have of understanding of project is, issue having. having hard time making server object oriented regards pojo. in division have weapons , gear. weapons can have different mods , attributes. not weapons can have same mods such assault rifle can have scope why shotgun have scope? attributes relative same weapons mods vary depending on type of weapon used. gear, gear can have different attributes based on type of gear is. gloves can have attributes increase critical hit chanc

Sharepoint:ClientPeoplePicker can't search user by Japanese kanji name when type only 1 character -

i'm having problem search function of user control in sharepoint (sharepoint:clientpeoplepicker). user needs type kanji name in field search users. if user inputs more 2 japanese characters, search function work well. however, if user types 1 character (’大’, example), control doesn't return result, expected result must 17 users. solution? p/s ignore case of copy-paste, care typing

c - gcc -g0 and without the -g option -

what difference between compiling without -g option , compiling -g0 option in gcc? there specific reason behind giving -g0 option in gcc? tried compiling , found " no debugging symbols " message both cases in gdb. if go gcc manual , find says: -g level … request debugging information , use level specify how information. default level 2. level 0 produces no debug information @ all. thus, -g0 negates -g . so, don't use -g0 if want debug information. if want debug information, remember use -g option both when creating object files ( -c ) , when linking program. and compiling without -g @ , compiling -g0 equivalent , there no debugging information in resulting binaries — found experimentation.

python - Cannot sort a set correctly -

uci = {'a+': 4.0, 'a': 4.0,'a-': 3.7, 'b+': 3.3, 'b': 3.0,'b-': 2.7, 'c+': 2.3, 'c': 2.0,'c-': 1.7, 'd+': 1.3, 'd': 1.0,'d-': 0.7, 'f': 0.0} def top(student_info : {(str,str)}) -> {str}: name_set = set() x in sorted(student_info, key = lambda x: x[0][-1], reverse = true): print(x) top({('alice','c'),('bobby','b-'),('carol','b-'),('david','d'),('evelyn','c+')}) i want sort set key of grade highest lowest. however, not give me right order. got is: ('bobby', 'b-') ('evelyn', 'c+') ('carol', 'b-') ('alice', 'c') ('david', 'd') any appreciated! thank it's sorting correctly. have sorting last character in first item in tuple. key function going fe

c# - How can you minimize the number of new lines of code (not using a string class methods)? -

private static void main() { var stringsone = new[] {"aaa", "bbb", "ccc"}; var sb = new stringbuilder(); foreach (var s in stringsone) { sb.append(s + " "); } var concat = sb.tostring(); console.writeline(concat.substring(0,concat.length-1)); console.readkey(); } you can try this, minimized lines: var stringsone = new[] { "aaa", "bbb", "ccc" }; var sb = new stringbuilder(); stringsone.select(p => p).tolist().foreach(q => sb.append(q+" ")); console.writeline(sb); no tostring or substring method used

C# Dynamic List Class -

i have bit of weird issue. working in c# script ssis have developed need build list based off dynamic data. background to explain it, script task fired has variable api url, goes off , pulls json string , throws typed list using following code. var listobject = get_apidata<applicationonedataset>(url) the class long winded , not needed in context of issue. applicationonedataset typed match 1 of possible json results returned get_apidata . now have need change applicationonedataset applicationtwodataset dynamically based on api url pass script. so have done send through second variable script called class name contains string "applicationdatasetone" or "applicationdatasettwo" based on context call under. the question my question how can dynamically vary line: var listobject = get_apidata<applicationonedataset>(url) with string variable passed script. my original thinking along lines of this: var classtype = (strin

jquery - An Example for using AJAX calls to the controller method using JSON data -

i trying learn ajax,json,jquery using in asp.net mvc.i want simple example ajax call made controller.the controller has json data.an example first name : age : submit it takes name,age , submit button can implement ajax.how do using json data.it great if can explain me example have provided above. this how ajax call should : $.ajax({ url: data: datatype: }); php exemple : <?php if(isset($_post)){ $f_panne=$_post['f_panne']; $p=$_post['produit']; $bdd = new pdo('mysql:host=localhost;dbname=reparation', 'root', ''); $req2 = $bdd->prepare('select count(*) nbre modele_produit join panne_produit on modele_produit.id_modele=panne_produit.id_produit join type_panne on panne_produit.id_panne=type_panne.code_type_panne join famille_panne on type_panne.code_panne=famille_panne.code_panne famille_panne.nom_panne=? , modele_produit.nom_modele= ?');

Reference C# library in C++ Program, But can't other PC -

i made classlib use c#. , made c++ win32 project. c++ program import c#'s tlb , can call lib's method successfuly. work in development pc.. i have 2 file exe(made c++) , dll(made c#). if lay 2 file same folder on development pc. work successfuly. if same thing on pc. make happen. cocreateinstance() return null. i don't know reason problem.. please teach me if know. c++ sources.---- stdafx.h #pragma once #include "targetver.h" #include <stdio.h> #include <tchar.h> #import "pc3dx.dll" no_namespace, rename("postmessage","cdmpostmessage") #import "mailctrl.tlb" no_namespace named_guids mail.h #include <iostream> #include <stdio.h> #include <stdlib.h> #pragma once struct mailinterface; class mail { public: mail(void); ~mail(void); bool sendmail(); _bstr_t m_smtpserver; int m_port; _bstr_t m_from; _bstr_t m_to; _bstr_t m_title; _bstr_t m_body; private: mailinterface *mailinter;

entity framework - Dynamic select columns with list in c# -

i having , movie class id, moviename, disc, reldate list<movie> moviedata = db.movies.tolist(); return json(moviedata , jsonrequestbehavior.allowget); this return below data [ { id: 1, moviename: "junglebook", desc: "good movie", reledate: "/date(1460917800000)/" }, { id: 2, moviename: "fan", desc: "lets see movie-1", reledate: "/date(1460831400000)/" }, { id: 3, moviename: "jadu", desc: "must see", reledate: "/date(1460658600000)/" } ] but want return data based on selected columns , eg when pass id, moviename give me below result(id , moviename dynamic condition) [ { id: 1, moviename: "junglebook" } ] based on column condition return me array list data specified columns. you can start linq select columns in table , filter results : var selecteddata = db.movies.where(x => x.id == 1).select(x => new {

In Ansible, is there a way to make deployment in a specific order? -

i’m using ansible since few months now, , have little issue deployment order on different hosts. i have 8 servers: 4 reverse proxy apache 4 tomcat servers when make deployments on these servers, have stop first apache perform deployment on first tomcat. when tomcat1 done, have start apache1. after continue same deployments on servers. if hosts file is: [apache-servers] apache1 apache2 apache3 apache4 [tomcat-servers] tomcat1 tomcat2 tomcat3 tomcat4 then, ansible stops apaches, tomcats, makes deployment, , restarts all. so, have found trick want. have run shell script rewrite host file before running ansible-playbooks. is there better way same? use serial: 1 in play , run play on 1 host @ time.

python - Dictionary is not accessed in template page in django -

Image
i new django. trying pass 1 dictionary template view page when try print dictionary value using loop not print. folder structure is: mytest -mytest -personal -templates -personal -includes -basic.html -header.html -home.html -urls.py -views.py -webapp view.py from django.shortcuts import render # create views here. def index(request): return render(request,'personal/home.html') def contact(request): return render(request,'personal/basic.html',{'contents':['if contact me, please email me','ansarijuned@gmail.com']}) basic.html {% extends "personal/header.html" %} {% block content %} <p>this home page header</p> <div class="container"> <div class="row"> <div class="col-lg-12"> <h2>contact us</h2> <hr />

How to control the default music player from android wear App -

hi need play music android wear app. i use code open default music player if(android.os.build.version.sdk_int>=15){ intent intent=intent.makemainselectoractivity(intent.action_main, intent.category_app_music); intent.addflags(intent.flag_activity_new_task);//min sdk 15 intent.setaction(intent.action_run); startactivity(intent); } but need implement onplay,next, previ, stop.. searched services not working.. is other way play songs android wear can me finish this.

python - Scrapy: How to output to csv without column headings? -

i'm outputting scrape .csv, doing multiple instances of same spider same .csv. causes header repeated, causes problems on database insert. i found here how rid of headers altogether, solution eliminating them if there's content in file doesn't seem work. i'd comment there, reputation isn't high enough. does know how can print out column headers file once? i've tried testing solution, , seems args[0].tell() equal 0, never enters if statement. seems close, have no idea how tell if there content in file. i change code mentioned answer following: from scrapy.exporters import csvitemexporter class headlesscsvitemexporter(csvitemexporter): def __init__(self, *args, **kwargs): # args[0] (opened) file handler # if file not empty skip headers if os.fstat(args[0].fileno()).st_size > 0: kwargs['include_headers_line'] = false super(headlesscsvitemexporter, self).__init__(*args, **kwargs)

ibatis - Exception with rownum in mybatis -

following sql query used in mybatis mapper xml. <select id="getdata" fetchsize="30" resulttype="java.util.hashmap" > select * table module='ab' , rownum < 15 </select> i getting below exception while using rownum : error parsing sql mapper configuration. cause: org.apache.ibatis.builder.builderexception: error creating document instance. cause: org.xml.sax.saxparseexception; linenumber: 130; columnnumber: 16; content of elements must consist of well-formed character data or markup. below things have tried: rownum&lt;=15 , <![cdata[ rownum <= 15 ]]> but still not working. try this: <select id="getdata" fetchsize="30" resulttype="java.util.hashmap" > select * table module='ab' <![cdata[ , rownum <= 15 ]]> </select> or rownum &lt;= 15 (with whitespaces aft

java - hibernate 4 Mssql 2008 limit string -

i need run following hql query: select top 1000 ent myentity ent .... but complains on token 1000. how can set limit manually mssql 2008 in hql? limit operator not supported in hql queries. have 2 solutions : using hql: query q = session.createquery("from myentity ..."); q.setfirstresult(1); q.setmaxresults(1000); using nativequery: query q = session.createnativequery("select * myentity ... limit 0, 1000");

php - Create a variable parameter list -

Image
im looking bit of advice, have visited this page in manual, might wrong page or misinterpreted instructions still confused. i have following question assignment above. know: 1st , foremost variable-length parameter? creating function not problem however, how set number of argumnets, since according question (if understand correctly) function should able take number of arguments. guess comes 1st question regarding variable-length paramenters again...? thank reading to use variable length parameters on php need function func_get_args() instead define parameters on function declaration. function this: function foo() { $params_count = func_num_args(); $params_values = func_get_args(); } on $params_values there parameters given foo() function. on params_count there number of parameters given foo() . can number of parameters given foo function func_num_args() an example of using functions ( https://3v4l.org/twd3v ): function foo() { $params_co

iife - What is the (function() { } )() construct in JavaScript? -

i used know meant, i'm struggling now... is saying document.onload ? (function () { })(); it’s immediately-invoked function expression , or iife short. executes after it’s created. it has nothing event-handler events (such document.onload ). first pair of parentheses ( function(){...} ) turns code within (in case, function) expression, , second pair of parentheses (function(){...}) () calls function results evaluated expression. this pattern used when trying avoid polluting global namespace, because variables used inside iife (like in other normal function) not visible outside scope. why, maybe, confused construction event-handler window.onload , because it’s used this: (function(){ // code here var foo = function() {}; window.onload = foo; // ... })(); // foo unreachable here (it’s undefined) correction suggested guffa : the function executed right after it's created, not after parsed. entire script block parsed before cod

filter - how to get trapezoidal pwm signal -

i generate pwm signal microcontroller kinetis, don't want digital signal i'm trying convert signal trapezoidal 1 t rise , t fall longer. i've found have set rc filter nmos wave others suggest no use of nmos required ? can 1 ? what need achievable digital-to-analog conversion or pulse-width-modulation + rc filter. not every mcu has dac, pwm can realized sure.

control structure - Accessing index when iterating over java array for loop -

this perhaps random , nitpicky question, i've been doing lot of work array manipulation in java recently, , wondering whether, when using following loop: for (object obj : somearrayorcollection) { //do } if there's way access kind of ordinal without doing (declaring variable , adding 1 every time loop runs) or 1 of coworkers (using list.indexof(int i) method)? feel both of these add rather lot of overhead. know use standard for (declaration;condition;change) { } loop, it's more convenient in context of project use modified loop. so, question is, there way access index of object you're working without resorting more memory-intensive operation have above? thanks! no, for -each loops not keep track of index on because not every iterable indexable. set s, example, have no concept of order, makes no sense "the loop on element n th index". if want keep track of iteration loop on, need use counter suggested.

c# - Why is this F# code so slow? -

a levenshtein implementation in c# , f#. c# version 10 times faster 2 strings of 1500 chars. c#: 69 ms, f# 867 ms. why? far can tell, exact same thing? doesn't matter if release or debug build. edit: if comes here looking edit distance implementation, broken. working code here . c# : private static int min3(int a, int b, int c) { return math.min(math.min(a, b), c); } public static int editdistance(string m, string n) { var d1 = new int[n.length]; (int x = 0; x < d1.length; x++) d1[x] = x; var d0 = new int[n.length]; for(int = 1; < m.length; i++) { d0[0] = i; var ui = m[i]; (int j = 1; j < n.length; j++ ) { d0[j] = 1 + min3(d1[j], d0[j - 1], d1[j - 1] + (ui == n[j] ? -1 : 0)); } array.copy(d0, d1, d1.length); } return d0[n.length - 1]; } f# : let min3(a, b, c) = min (min b c) let levenshtein (m:string) (n:string) = let d1 = array.init n.length id let d0 = array.create n.length 0 i=

javascript - How to apply $watchCollection to grid in template(html page) that is included using ng-include in another page? -

i new angularjs. i have page contains grid filled data. <table items="personlist" tr-ng-grid page-items="9" selection-mode="singlerow" selected-items="persongrid" style="font-size: smaller;"> <thead> <tr> <th field-name="name" display-name="{{ 'settings_grid_name' | translate }}"></th> <th field-name="address" display-name="{{ 'settings_grid_address' | translate }}"></th> <th field-name="age" display-name="{{ 'settings_grid_age' | translate }}"></th> </tr> </thead> <tbody> <tr> <td field-name="age"> <div class="text-center"> <i style="font-size: 21px" class="base-icon {{getdevicestate(griditem.age)}}"></i> </div> </td>

angular - Getting error when subscribing to promise -

i getting error when page getting loaded saying people.ts?9320:22 syntaxerror: unexpected token <(…)peoplecomponent.apiservice.people.subscribe.error @ people.ts? 9320:22safesubscriber.__tryorunsub @ vm38600:166safesubscriber.error @ vm38600:127subscriber._error @ vm38600:77subscriber.error @ vm38600:57mapsubscriber._next @ vm38955:51subscriber.next @ vm38600:51onload @ vm38808:57zonedelegate.invoketask @ vm38526:423ngzoneimpl.inner.inner.fork.oninvoketask @ vm38628:36zonedelegate.invoketask @ vm38526:422zone.runtask @ vm38526:320zonetask.invoke @ vm38526:490 here code: export class peoplecomponent { people: any; constructor(apiservice: api) { apiservice.people .subscribe({ next: x => (this.people = x), error: e => console.error(e), //error line 22 here! complete: () => console.log('completed!') }); } } my api sevice: import {injectable} 'angular2/cor

?android:attr/selectableItemBackground not working on white windowBackground -

i use ?android:attr/selectableitembackground for items of recyclerview. unfortunately not working. have line in styles.xml file: <item name="android:windowbackground">@color/white</item> without line can see ripple means background os not working because of whilte windowbackground. how can force ripppe effect appear on white background? here layout recyclerview items: <?xml version="1.0" encoding="utf-8"?> <linearlayout android:id="@+id/brand_row" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="?android:attr/listpreferreditemheight" android:background="?android:attr/selectableitembackground" android:orientation="vertical"> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:

algorithm - Sum of maximum flow between every pair of vertices of a tree -

given undirected tree n vertices numbered 1 n. each edge tree has capacity. find sum of maximum flow between possible pair of vertices. there exist 1 way go between 2 vertices. find sum of maximum flow between possible pair of vertices. for eg: in given tree 3 edges 1 2 5 2 3 6 edges between node 1 , node 2 capacity 5, node 2 , node 3 capacity 6. output - 32 (1,2) = (2,1) = 5 (1,3) = (3,1) = 5 (2,3) = (3,2) = 6 therefore output (5+5+6)*2 = 32 my approach- sort edges based on edge_capacity while edge_list not empty : remove edge minimum capacity count number of nodes on left , right of edge. dfs node count add ( left_count * right_count * edge_capacity ) answer. return answer*2 . time complexity o(n 2 ). solution gives tle. how can further reduce time complexity? code- def dfs(node): count = 1 visited = set() stack = [node] while stack: vertex = stack.pop() if vertex not in visited: visited.add(

csv - How to read a text file with mixed data_types automatically in Python? -

i have several text files of mixed data types in different columns, want read them program recognizes each column type automatically not know column contains type. when read numeric data used following, fails mixed datatypes. import numpy np import csv train = np.array(list(csv.reader(open(self.source_data_file, "rb"), delimiter=','))).astype('float') have @ numpy.genfromtxt here : http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.genfromtxt.html you can read files directly specifying delimiter , dtype. suppose have line in csv goes this: 10,120.3,xfghfh you can following : data = np.genfromtxt('input_file', dtype=none , delimiter=",") print (data) which give : data = array((10, 120.3, 'xfghfh'), dtype=[('column_name1', '<i4'), ('column_name2', '<f8'), ('column_name3', 's6')])

actionscript 3 - how to get instance name of a movieClip dynamically? -

i have movieclips (suppose= a) on stage. need modify them when drop moviclip (suppose= b) in movieclip (suppose= c). my code is var stx:number; var sty:number; ant.addeventlistener(mouseevent.mouse_down, objdrag); ant.addeventlistener(mouseevent.mouse_up, objdropinpenta); function objdrag(e:mouseevent):void { stx = e.currenttarget.x; sty = e.currenttarget.y; e.currenttarget.startdrag(); } function objdropinpenta(e:mouseevent):void { e.currenttarget.stopdrag(); if (e.currenttarget.hittestobject(penta)) { trace(e.currenttarget.name); var mcname: mcname = "s1" + e.currenttarget.name trace(mcname.name); mcname.visible = false; e.currenttarget.visible = false; } else { e.currenttarget.x = stx; e.currenttarget.y = sty; } } i know how make separately want make dynamically mcname.visible = false; this not working missing? please guide thanks in advance

python - Image processing issues with blood vessels -

Image
i'm trying extract blood vessels image, , so, i'm first equalizing image, applying clahe histogram obtain following result: clahe = cv2.createclahe(cliplimit=100.0, tilegridsize=(100,100)) self.cl1 = clahe.apply(self.result_array) self.cl1 = 255 - self.cl1 and i'm using otsu threshold extract blood vessels, failing well: self.ret, self.thresh = cv2.threshold(self.cl1, 0,255,cv2.thresh_binary + cv2.thresh_otsu) kernel = np.ones((1,1),np.float32)/1 self.thresh = cv2.erode(self.thresh, kernel, iterations=3) self.thresh = cv2.dilate(self.thresh, kernel, iterations=3) here's result: obviously there's lot of noise. i've tried using median blur, clusters noise , makes blob, in places. how go removing noise blood vessels? this original image i'm trying extract blood vessels: getting results difficult problem (you'll have somehow model structure of blood vessels , noise) can still bett

how can i use Parametrization in selenium IDE -

i have given login page test,i wish test using selenium ide. manually tested scenario different login values. best way test scenario in selenium try creating xml file (say testlogin.xml) stores logins want use <testdata> <vars uname=”user1” pword=”password1”/> <vars uname=”user2” pword=”password2”/> <vars uname=”user3” pword=”password3”/> </testdata> in test after have opened login page put in following steps <tr> <td>formxml</td> <td>location of testlogin.xml</td> <td></td> </tr> <tr> <td>type</td> <td>location of username field</td> <td>${uname}</td> </tr> <tr> <td>type</td> <td>location of password field</td> <td>${pword}</td> </tr> at end of test <tr> <td>endforxml</td> <td></td> <td></td

vb.net - Add WordPress Blogs in Another web site -

i have blog page (developed in wordpress) , have website (developed in vbcommerce). requirement have add latest 3 blogs our website. please tell me how can this? you can using wp rest api plugin. , use per_page latest 3 posts. on vbcommerce website, can show latest blog posts wordpress through curl .

javascript - Reloading a pop up window in asp.net -

i have pop window in asp.net in pop window have 2 div. in div 1 child page being loaded. in div 2 grid-view being loaded same page. in div 1 have save button on click of need update gridview in div 2 parent page code reference: for div one: <div> <input type="button" id="btnsave" value="save" onclick="someevent" class="btn btn-primary btn-sm" /> </div> for div two: <div class="modal fade" id="transactionfieldmapping" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true" style="width: 100%; height: 100%;"> <div class="modal-dialog" style="width: 68%; height: 75%;"> <div class="modal-content" style="width: 60%; height: 95%;"> <div class="modal-h

How to call dynamic crm 2016 rest api from javascript? -

i want create lead in dynamic crm website. website build using html static site. need call dynamic crm (setup on premises) api contact page submit data in dynamic crm. please suggest me right direction. thanks the sdk has lots of helpful information, have looked @ it? here's start: authenticating crm js using adal.js perform operations using web api

perl - How to run multiple scripts in sequence using command prompt -

i need kind of modification in post-synthesis hardware description language (hdl) files of field-progammable gate array (fpga) design. using microsemi's libero system on chip (soc) tool design process. totally, has 3 different design processes such as pre-modification process modification process post-modification process on hdl codes all 3 steps need performed in sequence using windows command line. wrote tcl script first , third processes , perl script second process. in first , third processes, fpga design tools synthesis, simulation, place , route called through command line. this overall idea of work. question how can run 3 different scripts (tcl, perl , tcl) in sequence using single script (or other file format) in command line? note : in few steps, required user data through stdin. working in windows platform.. create batch file (extension .bat) like: start /b tcl script1 start /b perl script1 start /b tcl script2

ERROR! conflicting action statements (expect, command) in Ansible -

i'm trying install java on several hosts ansible. looked examples of expect module provide answers prompts. think syntax quite fine: - hosts: datanode sudo: yes sudo_user: root tasks: - expect: name: install java jdk 7 command: apt-get install openjdk-7-jdk responses: question: 'do want continue? [y/n]': 'y' but when try execute ansible-playbook file.yml receive error: error! conflicting action statements (expect, command) error appears have been in '/root/scp.yml': line 5, column 5, may elsewhere in file depending on exact syntax problem. offending line appears be: tasks: - expect: ^ here where problem? (i have installed ansible 2.0.1.0, pexpect, python) thanks! note ansible works yaml files, , kind of files indented . means spaces put before each statement important let ansible understand how nested. more info yaml . corrected task: - hosts: datanode sudo: yes sudo_user: root task

r - Create TRUE/FALSE dataframe based on the presence/absence of specific variables -

i have data frame samples taken different seasons. summarize sites have samples spring (march-may) , autumn (september-november) across different years. example, if site had sample spring 2007, cell reads 'true'. here example dataset: dates <- data.frame(c(as.date("2007-9-1"), rep(as.date("2008-3-1"), times = 3) , rep(as.date("2008-9-1"), times = 3))) sites <- as.data.frame(as.factor(c("sitea",rep(c("sitea","siteb","sitec"), 2)))) values <- data.frame(matrix(sample(0:50, 3.5*2, replace=true), ncol=1)) dataframe <- cbind(dates,sites,values) colnames(dataframe) <- c("date","site","value") i have managed create factor 'season' within dataframe based on these functions. dataframe$months <- as.numeric(format(dataframe$date, '%m')) dataframe$season <- cut(dataframe$months, breaks =

plot - Multiple y axes in MATLAB (axis alignment issue when printing) -

here sample of strange problem. i'd plot curves multiple y axes , use common method in matlab. function plot_test() clear; savefile = 1; scrsz = get(0,'screensize'); figure('position',[1 1 0.9 * scrsz(3) 0.9 * scrsz(4)]); hold on; box on; x = 0:1:10; h1 = plot(x, x.^2 , 'r', 'linewidth', 2.5); %axis label xlabel('xlabel', 'fontsize', 20, 'interpreter', 'latex'); ylabel('ylabel', 'fontsize', 20, 'interpreter', 'latex'); set(gca, 'fontsize', 20, 'linewidth', 3); ax1 = gca; ax2 = axes('position',get(ax1,'position'),'xaxislocation','top','yaxislocation','right','color','none','xcolor','none','ycolor','k'); linkaxes([ax1 ax2],'x'); hold on box on; h2 = plot(x, x, 'b', 'parent', ax2, 'linewidth', 2.5); ylabel('second ylabel', '

android - How to set Save/Cancel pinned at the bottom of activity? -

i wonder if there simple way of making save/cancel buttons in bottom of activity one: calendar (add new event) lg v10 thanks in advance! do this....(tested) <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <scrollview android:id="@+id/scrollablecontents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_above="@id/footer"> //put views here </scrollview> <relativelayout android:id="@+id/footer" android:layout_width="match_parent" android:layout_height="wrap

gdal incorrectly quoted string literal Oracle OCI -

i updated gdal version 2. error if want data oracle database. ogrinfo -ro oci:database/passwd -sql "select count(*) tablename" the error is: incorrectly quoted string literal. old gdal version 1.xx works correctly think problem oci.dll @ gdalplugins. has idea after waiting little bit error ora-12154: tns:could not resolve connect identifier it doesn't know why, because old gdal version had worked sql quoting strict in 2.x 1.x, see: https://trac.osgeo.org/gdal/browser/trunk/gdal/migration_guide.txt#l123

php - IF with string read by FGETCSV -

i have problemi in using if statement string read file through fgetcsv command. file start country ( without quotes ) in first position put if statement @ beginning of code in order verify file correct. if statement is: if ($data[0]=="country") { … } else { print $data[0] } the if statement fails but... on screen see word country . means fgetcsv works well, there problems on string comparison. can tell me why if statement fails? thanks in advance help giorgio try comparing this: if (strtolower(trim($data[0])) == 'country') { echo 'found'; } else { print $data[0] }

typescript - Aurelia - value converter using promise -

i need format date using format returned promise. tried returning promise toview(value). doesn't work. @autoinject export class datetimevalueconverter { constructor(private formatservice:formatservice) { } toview(value) { return this.formatservice.getformat().then(format=> moment(value).format(format) ); } } here's formatservice's code, works properly export class formatservice { private format; constructor(private http:apphttp) { this.format= null; } public getformat() : promise<string>{ if (this.format){ var promise = new promise<string>((resolve, reject)=>{ resolve(this.format); }); return promise; } return this.http.get('format') .then((format) => { if (format){ this.format= format; } return format;

c - linked list print function is not working -

this program runs without error doesn't print anything. couldn't figure out error. i'm learning data structure in c, practice learn data structure? thanks in advance!!!!!! #include<stdio.h> #include<stdlib.h> typedef struct node { int data; struct node *next; }list_node; list_node* push(list_node* head_r, int new_data) { list_node* new_node = (list_node*)malloc(sizeof(list_node)); new_node->data = new_data; new_node->next = head_r; head_r = new_node; return head_r; } void print(list_node* head_r) { while(head_r) { printf("%d\n", head_r->data); head_r = head_r->next; } } int main() { list_node* l_list = null; push(l_list, 1); push(l_list, 2); push(l_list, 6); push(l_list, 8); push(l_list, 7); push(l_list, 3); push(l_list, 4); printf("given linked list \n"); print(l_list); return 0; } your list empty because push ret

ASP.NET - App_Code - Mix VB and C# in the same folder -

Image
i use webforms type. , in website project, there pages using vb , c#... works!... but problem is, can see on picture above, put 'cs' file , 'vb' file in 'app_code' folder, , there error appear..... the files '/app_code/bsn3.class.cs' , '/app_code/assemblyinfo.vb' use different language, not allowed since need compiled together. ok... solved problem.. in web.config file, add code <compilation debug="false"> <codesubdirectories> <add directoryname="vbcode" /> <add directoryname="cscode" /> </codesubdirectories> </compilation> and seperate vb , cs code 2 folder 'vbcode' , 'cscode' .. so, this

Return value of command fire using socket in Java -

my application connects hardware plotter machine prints data based on command. doing socket connection , firing commands. in hardware can see command has been reached not able return value of executed command. below sample code. there no error @ execution on line string cmd = in.readline(); got stuck. main.java public class test { public static void main(string[] args) { try { printtest printtest = new printtest(); printtest.print(); } catch (throwable e) { e.printstacktrace(); } } } method public void print() throws ioexception { socket socket = null; try { socket = new socket(); socket.connect(new inetsocketaddress(host, port), 10); system.out.println("isconnected :- " + socket.isconnected()); bufferedreader in = new bufferedreader(new inputstreamreader(socket.getinputstream())); bufferedwriter out = new bufferedwr

.net - Why is this Public Function in a Module not accessible -

i have assembly comprised of several useful little utilities. within have module containing simple public function. module fishtrackerconfigurations public function getvalueofuseproductid boolean return vtlgetuseproductid 'a simple private routine in same module end function end module when call function project (in assembly referenced following error. error bc30390 'fishtrackerconfigurations.public function getvalueofuseproductid() boolean' not accessible in context because 'public'. the function being called within projects application.xaml.vb file, in protected overrides sub onstartup(e startupeventargs) routine. i'd know why happens. although method public , module (by default) not. you need specify explicitly: public module fishtrackerconfigurations

c# - Deploying site to IIS server -

i developing mvc site in vs 2013 using 4.6.1 framework. need deploy site remote desktop iis server. but after deploying, site responds 503 error steps followed: created application pool version 4.0 verify if iis has 4.6.1 installed. location: hkey_local_machine\software\microsoft\net framework setup\ndp\v4\full , checked release data (has value 394271) created new site , converted application. created new virtual directory , pasted code project (publish setup done). problem: when try access site, responds 503 , app pool stops. have disabled app pool-> advanced setting ->rapid-fail protection -> enabled false app pool seems stop still. my error log reason appoffline. have gone through code, (which when run on local dev machine works great) not sure how identify cause of problem. what possible causes above problem on iis. see this . your web pages served application pool. if disable/stop application pool, , tries browse application, service unavailabl

checkbox - dynamically adding check box and getting its checked unchecked value in android -

i creating android app there 20 checkboxes shown user multiple selection. have programmed display checkbox dynamically problem how checked box value ? have tried code far. my global variables are arraylist<mycheckbox> listofcheckeditem; private int checkbox_position; and adding checkboxes did this listofcheckeditem = new arraylist<>(); listofcheckeditem.add(new mycheckbox(true, "one")); //(ischecked,text) listofcheckeditem.add(new mycheckbox(false, "two")); listofcheckeditem.add(new mycheckbox(true, "three")); listofcheckeditem.add(new mycheckbox(false, "four")); listofcheckeditem.add(new mycheckbox(false, "five")); viewgroup.layoutparams params = new viewgroup.layoutparams(viewgroup.layoutparams.wrap_content, viewgroup.layoutparams.wrap_content); (int = 0; < listofcheckeditem.size(); i++) { checkbox_position = i; mycheckbox myche

mod rewrite - Apache > How to redirect the home page and others urls separately? -

i'm dealing website overhaul in special configuration : 2 websites hosted on 2 different servers new domain name new one. new domain online, have redirect old domain old server running on apache 2.2.16. thus, have redirect old domain home page new domain home page : http://www.oldwebsite.com > http://www.newwebsite.com and @ same time have redirect old urls separately 1 one (for seo purpose because new domain urls optimized) : http://www.oldwebsite.com/page1/ > http://www.newwebsite.com/newpage1/ http://www.oldwebsite.com/page2/ > http://www.newwebsite.com/newpage2/ http://www.oldwebsite.com/page3/ > http://www.newwebsite.com/newpage3/ http://www.oldwebsite.com/directory1/ > http://www.newwebsite.com/newdirectory1/ http://www.oldwebsite.com/directory2/ > http://www.newwebsite.com/newdirectory2/ http://www.oldwebsite.com/directory3/ > http://www.newwebsite.com/newdirectory3/ etc. therefore, put in htaccess file on old server these rules : rewrite

Sony Ip camera opencv Java -

i trying take images ip cam (sony snc p1) motion detection using opencv java. stream in mjpeg format , using opencv's videocapture try retrieve image. can grab image video file using videocapture when try open camera doesn't work. can view stream on vlc ip address doesn't work on opencv. code use: while (true){ videocapture camera1=newvideocapture("http://192.168.0.101/mjpeg"); if (!camera1.isopened()) system.out.println("cannot open file"); } what version using? in opencv 2.4 known bug. (fixed in later versions) you can olso try adding dummy param, @ end, camera1.open("http://192.168.0.101/?dummy=video.mjpg"); because opencv videocapture expects extension @ end of file name.