Posts

Showing posts from July, 2014

Optimizing dictionaries in Python -

my question different 1 asked here . asking improvements made code containing dictionaries. however, link explains memory profilers, next step. i have following 2 sets of code achieve same thing. first one, a={1: 'a', 2: 'b', 3: 'c', 4: 'd'} b=[x x in if x in (1,2,3)] b=['a', 'b', 'c'] second one, a={1: 'a', 2: 'b', 3: 'c', 4: 'd'} c=[a[x] x in set(a.keys()) & set([1,2,3])] b=['a', 'b', 'c'] i know 1 works better in terms of memory optimized methods, , large sets of data. thanks in advance! if you're optimizing memory use generators tool. example: def get_keys(mapping, keys): key in keys: try: yield mapping[key] except keyerror: continue on example: list(get_keys(a, (1, 2, 3))) ['a', 'b', 'c']

Open file name that is inside the register in Ex mode in Vim -

if have full path inside register(e.g. @a="/dir/file.txt" ) , want open file in ex mode. i try :e @a that, doesn't work. and try :e echo @a doesn't work either. obviously can type :e ctrl-r a in ex mode, works. but i'm wondering there way content of register in ex mode without use ctrl-r. the :edit command takes file specification. there special characters (like % current file name; cp. :h cmdline-special ), @reg notation not work here. vim's evaluation rules different programming languages. need use :execute in order evaluate variable (or expression); otherwise, it's taken literally; i.e. vim uses variable name argument. so, solution problem is :execute 'edit' @a if don't want special characters apply register contents, more robust (but longer) way is :execute 'edit' fnameescape(@a)

javascript - jQuery/CSS: Changing the height and width attributes of an image when clicked -

i'm working on simple gallery built html, css, , jquery. when user clicks on image, larger version of image should pop in frame overlay behind it. have no problems horizontally-oriented images, vertically-oriented images, larger image comes out distorted. you can view working sample on codepen: http://codepen.io/anfperez/pen/axzgrv i try change the attributes of image saving height of image in variable , changing attribute using jquery, doesn't seem working. how can access height , width of larger image url , put frame? trying following code, did not work. var height_large = $(this).attr('height') var width_large = $(this).attr('width') $('#frame img').attr('height', height_large) $('#frame img').attr('width', width_large) for reference, here actual url of photo i'm trying pull down: https://farm8.staticflickr.com/7072/7274940170_c166072ddf_c.jpg changing height auto #frame img worked me. displays la...

Jenkins upload artifact to nexus plugin not working with Nexus 3 -

i have jenkins project gradle build , uploads build artifacts nexus maven hosted repository using jenkins upload artifact nexus plugin. working fine when using nexus 2.13 - after upgrading nexus 3, upload nexus no longer working. have made sure have configured nexus 3 repository nexus 2.13 repository. when build jenkins project response groupid: com.company artifactid: hello-world-util version: 1.0.0 file: hello-world-util-1.0.0.jar repository:companydevops uploading artifact hello-world-util-1.0.0.jar started.... reason phrase: method not allowed <!doctype html> <html> <head> <title>405 - nexus repository manager</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <!--[if lt ie 9]> <script>(new image).src="http://192.168.99.100:18081/favicon.ico?3.0.1-01"</script> <![endif]--> <link rel="icon" type="image/png" href="http:...

deep learning - How to use mxnet RNN symbol to generate lstm -

i've found rnn symbol added in mxnet v0.7 python lib. now, i'm trying use impl lstm in example/rnn python. have no idea because there's no document or information of input , output. can give me advice? thanks i think have given simple example on how use rnn symbol build lstm (they have mode option this, i.e., mode='lstm'). here example, check out: https://github.com/dmlc/mxnet/blob/master/example/rnn/rnn_cell_demo.py

apache - RewriteEngine is not working [.htaccess] -

rewrite engine not working, i'm using 000webhost web hosting service provider , i'm on free plan. problems: 1.) when go domain (without subdomains) prospekt.ml , i'm gonna redirected 000webhost 404 error. 2.) when tried test .htaccess if it's working. it's supposed rewrite url , add vanity url. ( user/astroxoom) instead of that, i'm getting redirected 000webhost 404 error. the .htaccess file placed on public_html folder. should redirect "member/user/username.php?username=$1" screenshot of public_html thank , have day! edit: .htaccess file # not remove line, otherwise mod_rewrite rules stop working rewritebase / # fancy indexing options indexes indexoptions fancyindexing namewidth=80 scanhtmltitles indexorderdefault ascending date indexignore *.jpg *.png # rewrite users rewriteengine on rewriterule ^member/user/([^/]+)$ member/user/username.php?username=$1 [l,qsa] on 000webhost server have use absolute rewrite path (st...

php - Symfony [2.8.9] EntityType within embedded form not selecting value -

i have organisation entity referencing embedded form containing country entity. form saves without issue, country entitytype field not correctly pick value upon editing, , such first option in dropdown selected rather correct option. the organisationtype form: <?php namespace appbundle\form\type\meta; use symfony\component\form\abstracttype; use symfony\component\form\formbuilderinterface; use symfony\component\form\formevent; use symfony\component\form\formevents; use symfony\component\optionsresolver\optionsresolver; class organisationtype extends abstracttype { public function __construct() { } public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('title', new titletype(), array('required' => true, 'label' => false)) ->add('country', new countrytype(), array('label' => false)) ->add('locatio...

python - theano CPU running out of memory: what is wrong? -

i run simple network theano on server , got out-of-memory error, not sure reason. asking because unlikely because using memory. here reasons: first, according post , when running gpu result in problems caused no support of virtual memory, running cpu, should fine. second, build network first layer matrix 100k 10, , second layer 10 1, it's 1m numbers model. far, tried 1000 data points together, if machine load data together, , initialize layers together, there should @ 110m float numbers. used float32, on 64bit machine. according post , each number takes 60bytes @ most. so, whole initialization takes 6gb memory. if there variate different resources take memory, don't understand why cannot run on 128gb ram server. can suggest should into? just in case asks code, here is. what size minibatches? need remember activations take space in memory too.

sql server - Inner Join and Coalesce issue -

i running query , getting error: msg 102, level 15, state 1, line 3 incorrect syntax near '.'. msg 4145, level 15, state 1, line 6 expression of non-boolean type specified in context condition expected, near 'and'. my target table contains nulls , source contains nulls , data. i need fill target addresses source table. declare @fullstatement nvarchar(4000) set @fullstatement= ' using ' + @targettable+ ' itarget'+ ' using '+@currenttable+' isource select isource.[address], itarget.[address] isource inner join itarget on target.versionenddate null , target.researchpropertyid = source.researchpropertyid (coalesce(isource.[address], '') = coalesce(itarget.[addres], '')) , (coalesce(itarget.[address], '') = coalesce(isource.[address], ''))' if @debug = 1 print @fullstatement execute sp_executesql @fullstateme...

Python BeautifulSoup scrape Yahoo Finance value -

i attempting scrape 'full time employees' value of 110,000 yahoo finance website. the url is: http://finance.yahoo.com/quote/aapl/profile?p=aapl i have tried using beautiful soup, can't find value on page. when in dom explorer in ie, can see it. has tag parent tag has parent has parent . actual value in custom class of data-react-id . code have tried: from bs4 import beautifulsoup bs html=`http://finance.yahoo.com/quote/aapl/profile?p=aapl` r = requests.get(html).content soup = bs(r) not sure go. the problem in "requests" related part - the page download requests not same see in browser . browser executed of javascript, made multiple asynchronous requests needed load page. and, particular page quite dynamic itself. there lot happening on "client-side". what can load page in real browser automated selenium . working example: from selenium import webdriver selenium.webdriver.common.by import selenium.webdriver.support imp...

ios - TableView Cell background on edit not working -

Image
i have tableview transparent background, , content offset allow part of background image visible @ top of first cell. content offset set with: accordiantableview.contentinset = uiedgeinsetsmake(100, 0, 0, 0) as shown in following image, green highlighted rectangle first cell of tableview, has solid white background. cell in edit mode, there transparent section when cell dragged right, background image visible through cell though has white background... i cannot have background of table view solid white, since cause background image totally invisible through table view. how can make entire cell background white, when dragged right while editing? worked around issue adding empty uiview behind tableview, , changing position behind tableview - providing background color cells while in edit mode.

Javascript: Find object array value dupes matching multiple fields -

given object array: [ { source_q_id: 'q2b', target_q_id: null }, { source_q_id: 'q2b', target_q_id: null }, { source_q_id: 'q2b', target_q_id: null }, { source_q_id: 'q5c', target_q_id: 'q7' }, { source_q_id: 'q5c', target_q_id: 'q7' }, { source_q_id: 'q5c', target_q_id: 'q7' }, { source_q_id: 'q5d', target_q_id: 'q7' }, { source_q_id: 'q5d', target_q_id: 'q7' }, { source_q_id: 'q5d', target_q_id: 'q7' }, { source_q_id: 'q6a1', target_q_id: 'q7' }, { source_q_id: 'q6a1', target_q_id: 'q7' }, { source_q_id: 'q6a1', target_q_id: 'q7' }, { source_q_id: 'q6a2', target_q_id: null }, { source_q_id: 'q6a2', target_q_id: null }, { source_q_id: 'q6a3', target_q_id: 'q7' }, { source_q_id: 'q6a3', target_q_id: 'q7' }, { source_q_id: 'q6a3'...

c# - How to specify dependency of netcoreapp1.0 on local nuget package? -

i'm working latest release of .net core 1.0 ( dotnet-dev-1.0.0-preview2-003121 ) under ubuntu 16.04 lts. i have local shared library written under mono ported .net core (netstandard 1.6) , use dotnet pack produce .nupkg , .symbols.nupkg . now create netcoreapp1.0 using dotnet new , how can write dependencies in project.json add local dll or nuget package references, adding dll reference in vs/mono previously? i read .net core rc2 using own local nuget package: folder netstandard1.5 contains invalid version seems not solve problem. you need tell dotnet can find nuget package. can using nuget.config file, either local 1 or global one. to set directory package source locally, create file named nuget.config file in project directory, or 1 of directories directory tree it, containing like: <?xml version="1.0" encoding="utf-8"?> <configuration> <packagesources> <add key="my-local-source" value="p...

Facebook app friends list Laravel + Facebook SDK -

i using laravel + facebook sdk ( https://github.com/sammyk/laravelfacebooksdk ) friends list app. weird thing reason don't know why, users can fetch friends, users can't. for example, under own user, can fetch friends using app. however, have created new user in facebook testing. i've became friend of new user. in addition, user has approved app in facebook. result, can't see user in friends list , new user can't see me in friends list. my code base is $q = \facebook::get('/me/friends', $token); $friends = json_decode($q->getbody())->data; facebook v2.0 upgraded. can try "user_friends". refer link

GET request: Android + Node.js -

i needed implement autocomplete search box in android app node.js backend database heavy many rows. wanted search through android search keywords. fire , api call every text character entered via android autocomplete text search box. or other more efficient logic can implemented.

Why My android app crashes as soon as I open it in device 4.4.3 but not in device 5.0 or above -

i have used facebook sdk log in facebook , google map user current position. run in android 5.o or above crashes in android 4.4.3. have used following configuration. android { compilesdkversion 24 buildtoolsversion "24.0.0" defaultconfig { applicationid "com.example.nuevo.getsocial" minsdkversion 15 targetsdkversion 24 versioncode 1 versionname "1.0" multidexenabled true } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } dexoptions{ javamaxheapsize "4g" } } repositories { mavencentral() } dependencies...

How to use custom gradle plugin in library module project -

i have custom gradle plugin has uploaded jcenter, can use in android project like: root project build.gradle: dependencies { classpath 'com.android.tools.build:gradle:2.0.0' classpath 'com.myproject:projectname:1.0.1' } app's build.gradle: apply plugin: 'com.android.application' apply plugin: 'com.myproject.projectname' myconfig { ...... } it works fine. when use in android library module, show error message "gradle dsl method no found:'myconfig()'" library module's build.gradle apply plugin: 'com.android.library' apply plugin: 'com.myproject.projectname' myconfig { ...... } anyone known why? i found reason, in gradle plugin checked project this: if (project.getplugins().hasplugin(appplugin)) {....} so when call in library module, can't goto right branch.

implode - convert array into string without built in function php -

how convert array string without built in function php $array = array("a1","b1","c1","d1","e1","f1"); output: a1 b1 c1 d1 e1 f1; <?php $arr = array("a1","b1","c1","d1","e1","f1"); $str=""; foreach($arr $a) { $str=$str." ".$a; } echo $str; ?>

encryption - Using HTTPS or RSA for android's user data upload -

google says if want upload user data (like list of user's installed apps), need "transmit using modern cryptography (for example, on https)". have http server, i'm having problems converting https. can instead use rsa or encrypt user data? please tell me think.

java.lang.NoSuchMethodError - Ljava/lang/String;)Ljava/lang/String; -

my code giving error below; exception in thread "main" java.lang.nosuchmethoderror: com/myapp/client.cyphercbc(ljava/lang/string;)ljava/lang/string; but it's working fine in local environment. code far below; try{ system.out.println("encrypted cbc passwd : " +client.cyphercbc("cypherthepassword")); }catch(exception e){ e.printstacktrace(); } this due run-time jar or class mismatch. "client" class there @ time compile application has static method "cyphercbc" gets string parameter, @ run-time class loader has loaded "client" class doesn't have kind of method (same name same signature). if can debug application @ runtime, put break-point @ line exception thrown, try evaluate following expression, client.class.getresource("client.class") , can find class has been leaded from, can decompile , try troubleshoot issue.

tortoisehg - How to reduce the size of Mercurial hg store. Hg store size is above 5GB and server gets timeout before cloning -

accidently checked-in 5gb around of files mercurial. our build server started failing during cloning of repo. reverted checked- in files using remove command. .hg/store/data still containing files. , it's size on 5gb. have searched on internet , found few methods, like: hg convert. hg convert creating new repo not desired in our case. cannot extend timeout period of our build server. how remove bad check-in without making store in .hg/store/data? or how reduce size of .hg/store/data? here's need do: need strip changesets. since repository hosted on bitbucket, not have direct access files need use website provides. in repository project, under settings, there section stripping out changesets. note remove changesets committed on top of bad changeset. deal this. i stress this: make sure you have backups! here steps important: if developer on team has pending locally, changesets not yet having been pushed bitbucket, have cloned bad changeset ...

Unable to turn on "Snapshot" in Android Studio AVD Manager & save it -

Image
android studio 2.1.3 on windows 10 64 bit. go tools->android->avd manager. shows me error "android virtual device" failed load - click details see error. http://i.imgur.com/bcildbc.png when click details, not show error. http://i.imgur.com/1o8zb7c.png when click on edit & try turn of "host gpu" & turn on "snapshot" option, ok button remains grayed out - cannot save snapshot option. http://i.imgur.com/cwqmdgh.png the emulator runs fine - however, how turn on snapshot option. try going sdk manager , making sure updated. options different , believe it's because using older version. they have emulator accelerator. can select run off of hardware , choose number of cores cpu assign virtual device.

python - How to copy parameters from global model to thread-specific model -

context: i new tensorflow , i'm trying implement of algorithms in this paper require copying global shared model local thread-specific model. question: what best/correct way accomplish above task? i've provided dummy example of way doing below , error i'm getting. can please explain why error occurs? import tensorflow tf import threading class examplemodel(object): def __init__(self, graph): graph.as_default(): self.w = tf.variable(tf.constant(1, shape=[1,2])) sess = tf.interactivesession() graph = tf.get_default_graph() global_network = examplemodel(graph) sess.run(tf.initialize_all_variables()) def example(i): global global_network, graph local_network = examplemodel(graph) sess.run(local_network.w.assign(global_network.w)) threads = [] in range(5): t = threading.thread(target=example, args=(i,)) threads.append(t) t in threads: t.start() error: exception in thread thread-3: traceback (most recent call last): file "/user...

ios - Unable to open database ReferenceError: sqlitePlugin is not defined -

Image
i developing ios app in angular2 , ionic2. i have system information : my product.ts file code is: import { component} '@angular/core'; import {navcontroller, navparams, modal} 'ionic-angular'; import {platform, ionicbootstrap} 'ionic-angular'; import {statusbar, sqlite} 'ionic-native'; @component({ templateurl: 'build/pages/product/product.html', }) export class productpage { public database: sqlite; public peoples: array<object>; constructor(public platform: platform) { //this.createsqlitedb(); //this.opendb(); //this.adddb(); //this.refreshdb(); //this.showdbvalue(); } createsqlitedb() { console.log("createsqlitedb called."); let db = new sqlite(); db.opendatabase({ name: "data.db", location: "default" }).then(() => { db.executesql("create table if not exists people (id integer primary key autoincremen...

html - Custom Directive for Required/ngRequired -

i want validate dropdown required. default required works if value null or blank (correct me if i'm wrong). want required give error , make form invalid true if value ' not assigned '. <select name="first" class="select" title="select approver" ng-model="applications.first" ng-options="x.id x.value x in list1" ng-change="settoall(applications.first,'1')" required></select> using can show error message make form invalid <span class="error" ng-show="applications.first == 'not assigned'?true:false">select approver</span> solution:- 1) if want use required check shannon hochkins solution. <form name="formname"> <select name="first" class="select" title="select approver" ng-model="applications.first" ng-options="x.id x.value x in list1" ng-change="settoall(applica...

html - How to filter and Search a table with ngFilter? -

i have seen many examples , tutorials table search , tried work. issue search table results seen in current page. mean is, have used pagination , search filer works in page visible user. doesn't results in other paginated pages. i have implemented simple search, explained in every example. why approach behave this? appreciated. here's table.html <div class="row"> <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12"> <div class="input-group input-icon"> <input id="empid" ng-model="search.empid" type="text" class="form-control" name="empid" placeholder="search id"> <span class="input-group-addon"> <i class="fa fa-search s14"></i> </span> </div> </div> <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"> <div cla...

php - Change product category once the order status get completed -

i want apply new category product once order status "completed" in woocommerce. let's product in (category a) , want apply (category b) on order status "completed". is there way this? i found couple of tutorials don't know how combine them: https://wordpress.org/support/topic/automatically-add-posts-to-a-category-conditionally https://wordpress.org/support/topic/woocommerce-on-order-complete-insert-quantity-data-into-custom-database-table how can achieve this? thanks! updated (compatibility woocommerce 3+) as want change woocommerce category product, should use wp_set_object_terms() native wordpress function accept either category id or slug with 'product_cat' taxonomy parameter , not 'category' . the woocommerce_order_status_completed hook classically used fire callback function when order change status completed. this code: add_action('woocommerce_order_status_completed', 'add_category_...

javascript - How to put space of 1 inch between two paragraph in webpage? -

i want print part of page in a4 sheet , want paragraphs arranged few inch below top , 1 inch between paragraphs.. please me out html , css codes achieve same something on page, never eaxact because of printing diffrences between browsers, close enough. more exact results create css print file info here //css .top{padding-bottom:2em} p{padding-bottom:3em;} //html <div class="top">the heading</div> <p>the content</p>

javascript - Read data from sharepoint list using json Rest -

i have sharepoint list( testlist ) columns id , title , address , list contains number of items. want use json rest retrieve data list , bind html below <div id="maincontent" style="position:absolute;width:100%"> <h1 style="color: #5e9ca0;">&nbsp;</h1> <table style="width:100;border: 2px #d3d3d3 solid; border-radius: 10px;"> <tbody> <tr> <td align="center"><strong> <img src='c:\users\critical.png' alt="" style="float: left; text-align: center" /></strong></td> <td align="center" bgcolor="#d3d3d3"> <label id="subject">subject goes here</label> </td> </tr> <tr> <td rowspan="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> <td align="center" bgcolor="#d3d3d3" width="50%">&...

angular - Auth0 redirecting back to call url after login angular2 -

after login auth0 redirects me call url on angular2. how can make go path gave routing without redirecting call url. i've been working through same issue.. seems have couple options. a) use popup mode this easy implement auth0 recommends not use because of browser inconsistencies. (namely ie , chrome/firefox on ios ) it's simple adding flag lock options object var lockoptions = { auth: { redirect: false } } popup mode docs b) save state in localstorage auth0 suggests saving state localstorage if want allow users resume left off. so, before triggering lock.show() , save current url/path/state/etc local storage. in case, i'm using authguard. canactivate(route: activatedroutesnapshot, state: routerstatesnapshot): promise<boolean> { if (this.authservice.isloggedin) { return promise.resolve(true); } // store attempted url redirecting after auth localstorage.setitem('redirecturl', state.url); // n...

elixir - How to get client IP in Phoenix rest api -

i have rest api in elixir phoenix , want log every requester client ip. currently, using following code client ip: conn.remote_ip |> tuple.to_list |> enum.join(".") but, gave me local ip 127.0.0.1 . then, used following code: remote_ips = plug.conn.get_req_header(conn, "x-forwarded-for") remote_ip = list.first(remote_ips) and gave nil x-forwarded-for . please me solve issue.

php - In Codeigniter what is the purpose of hook ? Why we have to create? -

i new codeigniter. in every interview asked hooks. not getting hook why have use ? benefit of it. this example link use hooks in codeigniter https://qasimbadami.wordpress.com/2012/05/18/codeigniter-hooks-tutorial/ note : suppose have big project , 100 controller , if every time check session exists or not , each , every post request use hook

scheduler - Sybase performance issue -

dears, planning design database administration , maintenance tasks in sybase ase 15.0 , create stored procedure perform these tasks, wondering way more efficient schedule jobs executing stored procedures: sybase job scheduler or windows batch file executed according windows scheduler task? which choice better , why please advice both can work fine. dba, prefer o/s scheduler gives me ability create scripts more convenient things (like moving files around) having in sql.

drools - could not create constructor :: Kie Workbench -

i using kie workbench 6.3.0 create rules. trying run rule in stream mode. have created project in kie-wb , created kie-base in it. using kie server runtime this. kmodule code generated: <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <kbase name="mykiebase" default="false" eventprocessingmode="stream" equalsbehavior="identity" packages="*"/> </kmodule> and following persistence.xml file: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" version="2.0" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd http://ja...

c# - OnActionExecuting Loop MVC -

im using action filter 1 job in project. want if user's ip equals ip, go index without seeing login page. if ip different want redirect him login page. in login page ask password , id. have problem redirecting login page. here code, how can fix loop? filter public class intranetaction : actionfilterattribute { private const string localip = "192.168"; public override void onactionexecuting(actionexecutingcontext filtercontext) { var request = filtercontext.requestcontext.httpcontext.request; string ip1 = request.userhostaddress; string shortlocalip; if (ip1 != null && ip1.contains(".")) { string[] ipvalues = ip1.split('.'); shortlocalip = ipvalues[0] + "." + ipvalues[1]; } else { shortlocalip = "192.168"; } //var ip2 = request.servervariables["local_addr"]; //var ip3 = req...

android - USB debugging not dectecting for my mobile -

this question has answer here: device not detected in eclipse when connected usb cable 19 answers i using windows laptop,my mobile not detecting debugging in androidstudio, using lenovo vibep1a42 mobile.its detecting when using motorola mobiles. **i have turned on usb debugging option in developer options in mobile,still not working ** i have tried below link also check device drivers still didn't got solution. please me solve issue. thanks in advance. you can use usbdrivertool . you can toggle enabling usb debug through software

c# - How to get Microsoft.TeamFoundation.Framework.Client.TeamFoundationIdentity TFS API 2013? -

i'm trying make utility working tfs , owner value testcase , want change it: var gss = connection.projectcollection.getservice<igroupsecurityservice>(); identity validusersids = gss.readidentity(searchfactor.accountname, "team foundation valid users", querymembership.expanded); identity[] validusers = gss.readidentities(searchfactor.sid, validusersids.members, querymembership.none); var owner = validusers.firstordefault(x => x != null && accountname == "myaccountname"); but when trying set owner in testcase.owner error: cannot conver type "microsoft.teamfoundation.server.identity" type "microsoft.teamfoundation.framework.client.teamfoundationidentity" , cast gives error. how can microsoft.teamfoundation.framework.client.teamfoundationidentity collection set value in field testcase.owner ? you need use itestbase.owner property in itestcase interface teamfoundationidentity owner { get; set; } such b...

mysql - PHP print UTF8 string from database -

i trying print simple string in hebrew (utf8) mysql database. in database string correctly, when print string it's - ×—× ×•×ª_חיות . i happy if can me understand why happened , how can fix it. thanks. php - $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } mysqli_set_charset($conn,"utf8"); $sql = "select * items id = '$token'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo "," . $row["title"]; } } else { echo "not found row"; } mysqli_close($conn); how html document like? have set utf8 character set? should this: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>title</title> <link rel="stylesheet...

mp4 - Evaluate Traces in Evalvid -

i using evalvid 2.7, ns-2.35, ubuntu 14.04 evaluate video traffic. when use command: ~/myevalvid2$ ./etmp4 -f -0 sd_a01 rd_a01 st_a01 a01.mp4 a01out i receive error @ end: loss_a01out.txt: percentage of lost frames|packets column 1: (including h) column 2: p column 3: b column 4: overall delay_a01out.txt: jitter/delay statistics column 1: frame|packet id column 2: loss flag column 3: end-to-end delay s column 4: sender inter frame|packet lag s column 5: receiver inter [frame|packet] lag s column 6: cumulative jitter s hartanto et. al. rate_s_a01out.txt: sender rate column 1: time s column 2: momentary rate bytes/s column 3: cumulative rate bytes/s rate_r_a01out.txt: receiver rate column 1: time s column 2: momentary rate bytes/s column 3: cumulative rate bytes/s error in etmp4: double free or corruption (fasttop): 0x085ec028 aborted (core dumped) do have idea how solve problem expor...

Python - Select "Save link as" and save a file using Selenium -

newbie: there different files on webpage, can downloaded follows: 1. right click on file link 2. select "save link as" 3. click "save" button on new window. i tried following code(for first 2 steps), not working: selenium import webdriver selenium.webdriver import actionchains selenium.webdriver.common.keys import keys import time driver = webdriver.chrome() driver.maximize_window() driver.get('www.example.com') time.sleep(1) driver.find_element_by_link_text("marketfiles/").click() actionchains = actionchains(driver) download_file = "market_file1.csv" link = driver.find_element_by_link_text(download_file) actionchains.context_click(link).send_keys(keys.arrow_down).send_keys(keys.arrow_down).send_keys(keys.arrow_down).send_keys(keys.arrow_down).send_keys(keys.return).perform(); kindly suggest how download file using these 3 steps. thanks save link open system di...

json - How do I increment a filename in batch? -

i programming batch file can track lost android phones using google maps geolocation api. cannot understand wrong code. followed found on internet if run code, returns "the syntax incorrect" or that.it increments filename if basename exists. can show me wrong code , how correct it? :mainprocessnew cd c:\users\%username%\documents %%g in (*.json) ( set file = %%g ) set "basename=data" set "n=0" :loop set /a n+=1 if exist "%basename%%n%.json ( goto loop ) echo.>"c:\users\%username%\documents\data%n%.json" use batch code: :mainprocessnew cd /d "%userprofile%\documents" %%g in (*.json) set "filename=%%g" set "basename=data" set "filenumber=0" :filenameloop set /a filenumber+=1 if exist "%basename%%filenumber%.json" goto filenameloop echo.>"%userprofile%\documents\%basename%%filenumber%.json" the main mistake missing double quote in if condition line. but...