Posts

Showing posts from March, 2014

Call jQuery plugin's method on items added dynamically -

Call jQuery plugin's method on items added dynamically - i have page there's button add together new content. button adds elements dom, , 1 of them bootstrap-select component. the page have @ to the lowest degree 1 grouping of elements, , first 1 can utilize class="selectpicker" , works fine. however, new items added, doesn't work, think should phone call the method through javascript $('.selectpicker').selectpicker(); the problem don't know how trigger function can phone call selectpicker() method. call selectpicker refresh parameter newly added items $('.selectpicker').selectpicker('refresh'); jquery

statistics - plot a binomial negative with alpha and beta parameters in R -

statistics - plot a binomial negative with alpha and beta parameters in R - how can plot negative binomial parameters alpha=1.71 , beta=1.05 i've traied barplot(table(rnbinom(10000,1.71,1.05))/10000) r statistics distribution probability bayesian

ios - Keeping a reference to the Parent in View Controller Containment -

ios - Keeping a reference to the Parent in View Controller Containment - consider basic uiviewcontroller, contained in uinavigationcontroller or uitabbarcontroller. view controller has reference container, either: self.navigationcontroller self.tabbarcontroller now consider basic illustration of view controller containment without navigation controller or tab bar controller: [self addchildviewcontroller: child]; [[child view] setframe: [[self view] bounds]]; [[self view] addsubview: [child view]]; [child didmovetoparentviewcontroller: self]; if want kid view controller have reference container, what's best method doing that? my guess in child: @property (weak, nonatomic) mycontainercontroller *container; and set @ same time i'm adding kid parent, so: [child setcontainer: self]; is correct? i want ensure can reference container child, i'm concerned memory issues. believe strong property prevent arc releasing child, if remove container.

php - I don't get why my form isn't working -

php - I don't get why my form isn't working - this question has reply here: php mail service form doesn't finish sending e-mail 19 answers my code did work few minutes ago. didn't alter anything, tried 1 time again tests, nil working. wanted simple form email : html <form action="mail.php" method="post" id="inscription"> <input name="nom" type="text" id="nom" placeholder="nom"> <input name="prenom" type="text" id="prenom" placeholder="prénom"> <input name="email" type="email" id="email" placeholder="e-mail"> <input name="tel" type="tel" id="tel" placeholder="01.23.45.67.89"> <input name="company"

ios - isEqual: and isKindOfClass: - Which is faster? -

ios - isEqual: and isKindOfClass: - Which is faster? - for various reasons, in order maintain array's indexes aligned other things, have [nsnull null] within array. this: nsarray *arr = @[obj1, obj2, obj3, [nsnull null], obj4]; there 2 methods i'm considering using when iterating through array create sure ignore null value, i'm not sure faster. method 1 for (id obj in arr) { if (![[nsnull null] isequal:obj]) { //do stiff } } method 2 for (id obj in arr) { if ([obj iskindofclass:[myobject class]]) { //do stiff } } my question is: since i'm iterating through array appropriately handle tiled scroll view (therefore it's beingness executed many times user scrolls , it's crucial runs possible), which 1 of these methods faster? [nsnull null] singleton, easiest things check if object pointer same. if want fast, this: for (id obj in arr) { if ([nsnull null]!=obj) { //do stuff

android - Change Material Design AppCompat ActionBar Color -

android - Change Material Design AppCompat ActionBar Color - i used alter appcompat status bar color actionbarstyle , , creating style background color want. now, material design appcompat, method doesn't work anymore. can help me? thanks. there's new attribute called colorprimary can define in theme. give actionbar or toolbar solid color. following little example: <style name="apptheme" parent="theme.appcompat.light"> <!-- colorprimary used default action bar background --> <item name="colorprimary">@color/my_action_bar_color</item> </style> please note: has colorprimary , not android:colorprimary , in every values-folder except values-v21 one. you can read more customizing color palette on developer.android.com. android android-actionbar appcompat material-design

javascript - Open Modal and change URL without change the view in AngularJS -

javascript - Open Modal and change URL without change the view in AngularJS - i'm trying open modal angularjs. my route task list is: /client/:id/task/list its working fine. now, i'm trying show task info in modal, above list. my route is: /client/:id/task/:id how can open modal above list view, alter url, don't alter view? i saw lot of topics this, none solution. thanks. you can specify states want show modal , when handled, homecoming state want to. example; app.config(function ($stateprovider) { $stateprovider.state('tasks', { url: '/tasks', templateurl: 'tasks.html', controller: 'tasksctrl' }).state("tasks.show", { url: "/tasks/:id", onenter: function($stateparams, $state, $modal) { $modal.open({ templateurl: "show.html", resolve: {}, controller: function($scope, $state) { $scope.ok = function () {

Android database can't update -

Android database can't update - i'll seek update database can't update. insert correctly don't alter rows new ones. mydatabase = getmydatabase();// this.getwritabledatabase(); contentvalues devices = new contentvalues(); devices.put(key_name, name); devices.put(key_address, address); devices.put(key_grade, grade); devices.put(key_array,gradearray); try{ mydatabase.insertorthrow(database_table, null, devices); } grab (sqliteconstraintexception e) { string = "'"+address+"'='"+key_address+"'"; mydatabase.update(database_table, devices, where,null); } mydatabase.close(); this code in function take different grade , gradearray values. strings. database create statement: string create = string.format("create table %s ( %s integer primary key autoincrement,"+ " %s text ,%s text not null unique , %s text not null

asp.net mvc - Is this MVC Fire and Forget approach bad Design? -

asp.net mvc - Is this MVC Fire and Forget approach bad Design? - i have controller's action performs task , @ end, sends confirmation e-mail user. e-mail part of not important, not want create action break if sending of e-mail throws exception, , don't want http response wait e-mail sent either. want fire , forget thing. in nutshell, how approached it: public async task<actionresult> myaction(){ // stuff await dostuff(); thread sendemailthread = new thread(sendemail); sendemailthread.start(); homecoming result; } private async void sendemail(){ await smtpclient.sendmessageasync(); } approach proper? it not thought start new thread whenever new email arrived. alternative approach (especially email) we run background scheduling scheme behind application. example, quartz.net then queue email in queue (or database), , allow background thread pick queue (or database), , preform process. by doing so, can re-sen

Kendo-grid locked column and grouping -

Kendo-grid locked column and grouping - i have grid locked (frozen) column , grouping this: demos.telerik.com/kendo-ui/grid/frozen-columns but have 1 frozen column , little width. and when grouping column long string values (eg ship address), these grouping values in grouping header displayed in multiple lines. screen how show grouping header in 1 line if first part of grid (with locked columns) has little width? source $(document).ready(function() { $("#grid").kendogrid({ datasource: { type: "odata", transport: { read: "http://demos.telerik.com/kendo-ui/service/northwind.svc/orders" }, schema: { model: { fields: { orderid: { type: "number" }, shipcountry: { type: "string" }, shipname

c# - Bind object properties to a datagrid in WPF -

c# - Bind object properties to a datagrid in WPF - i have next class: public class sp3ditem { public sp3ditem() { items= new observablecollection<sp3ditem>(); } public string oid { get; set; } public string name { get; set; } public string type { get; set; } public observablecollection<sp3ditem> items { get; set; } } i need show properties of instance of object datagrid (or other type of grid). properties window in visual studio. there properties don't care, 'items', need show properties of string type, , ones non empty values (this lastly 1 plus, not real need). the question is, can binding or have assembly info on grid manually? sounds want property grid view properties of single object instance, each property/value pair 'row', yes? if that's case, of third-party property grid controls. wp

Handling multiple distribution methods with a git repo -

Handling multiple distribution methods with a git repo - i've been co-working on browser puzzle based game using html , js , css , , uses git source control. can run game using index.html of coarse , hosted on server soon. lately i've been thinking creating chrome app version/package of project can distribute on chrome web store too. , consider other markets soon. require additional files added git repo, specific chrome-app version of repo. along minor code changes allow total integration within chrome . would improve create fork of original repo , handle chrome-app files there. original/plain game separate chrome-app port? or considering minor code changes required, totally separate git repo improve , manually re-create updates between repos? i think there few ways go managing product lines, depending on comfort level managing repos, branches, tags etc. one way create new chrome-app repo, , introduce original (maybe phone call baseline ) repo subm

In Coldfusion how do you order a list alphabetically then numerically -

In Coldfusion how do you order a list alphabetically then numerically - say have next list: <cfset mylist = "1a,2b,3c,aa,bb,cc" > how sort list "aa,bb,cc,1a,2b,3c"? in other words, want starts number @ end of list , in order of number starts with. this work if on cf10+. <cfscript> values = listtoarray("1a,2b,3c,aa,bb,cc"); arraysort(values, function(e1, e2) { var diff = val(e1) - val(e2); if(diff != 0) homecoming diff; homecoming e1 < e2 ? -1 : 1; }); writedump(values); </cfscript> run: http://www.trycf.com/scratch-pad/pastebin?id=kky9y2nn update but since you're using cf9: <cfscript> function customsort(input) { var sorted = false; while (!sorted) { sorted = true; (var = 1; < arraylen(input); i++) { var e1 = input[i]; var e2 = input[i + 1]; var di

php - The connection was interrupted on https -

php - The connection was interrupted on https - i using ubuntu nodejs , php checking url **https://example.com:8124/sign_in** getting error. the connection interrupted.the connection example.com:8124 interrupted while page loading. i have configured ssl on example.com. if access http://example.com:8124/sign_in this working fine. i attaching screenshot in firefox php node.js ubuntu ssl

Sass add % and em -

Sass add % and em - this question has reply here: sass calculate percent minus px 5 answers i have margin that's defined in em. i want width: 100% + 3em; but units won't play nice. in local development environment, got work interpolation so width: #{100%} + #{$code-padding-h}; but when seek precompile, precompiling fails error sass::unitconversionerror: incompatible units: 'em' , '%' you can trick calc method in css: width: calc(100% + 3em); sass

javascript - spring mvc json response to ajax -

javascript - spring mvc json response to ajax - i have issue json parsing syntaxerror: "json.parse: bad escaped character" while proceeding ajax success : clear ajax code : $("#ajaxform").submit(function(e) { $.ajax({ url : '/cart/add', type : 'post', contenttype : 'application/x-www-form-urlencoded', info : $(this).serializearray(), datatype: 'json', success : function(content) { $("#result").append(content.addtocartlayer); $.fancybox({ href : '#result', showclosebutton : false, enableescapebutton : false, hideonoverlayclick:false }); }, error : function(xht, status, ex) { console.log("error : " + ex);//json.parse: bad escaped character } }); } and java code : @requestmapping(value = "/cart/add&q

algorithm - Maximize the score of circular arrangement of numbers -

algorithm - Maximize the score of circular arrangement of numbers - i looking efficient algorithm solve problem of arranging circular set of numbers between 1-12 highest score. the score of arrangement given sum of score of adjacent pairs to score of adjacent pair (a,b), next steps calculated: 1. find x such (a+x) mod 12 = b 2. x in score table 3. value in score table @ index 'x' score of pair (a,b). this repeated every adjacent pair , sum score of arrangement. here example: suppose score table [5,4,6,7,2,7,-2,-6,-8,-2,6,12,13] consider these numbers: 5, 12, 8, 9 each adjacent pairs, values x are: 5 -> 12: 7 12 -> 8: 8 8 -> 9: 1 9 -> 5: 8 values score[x] are: score[7] = -6 score[8] = -8 score[1] = 4 score[8] = -6 sum of score[x] values is: (-6) + (-8) + (4) + (-6)

java - Recursively assigning positions to node in binary search tree -

java - Recursively assigning positions to node in binary search tree - hello i'm looking way recursively assign positions of tree int index value of node @ position can set array. the desired tree positions designated in level-order root position 1 (i) , left kid of @ position 2i , right kid 2i + 1 - heap structure. null children not position assigned them. 1 / \ 2 3 /\ /\ 4 5 6 7 ... [1, 2, 3, 4, 5, 6, 7. ...] and largest position in tree should size of array. add-on of nulls "space" desired output test node values. private int largestpos // first call: assignpositions(root, 1) assignpositions(node cur, int pos) { parent = new node; if curpos > largestpos largestpos = curpos if cur == null parent.pos = pos else current.pos = pos parent = cur if cur.left != null pos = 2 * pos assignpositions(cur.left, pos) if cur.right != null pos = 2 * pos + 1

How to get a value from an incomplete class object in PHP? -

How to get a value from an incomplete class object in PHP? - i have serialized php object, looks next when unserialize it: __php_incomplete_class object ( [__php_incomplete_class_name] => model_baubeschreibung [prototype:persistence_table:private] => array ( [model_baubeschreibung] => array ( [table] => rp_baubeschreibung // ... more stuff here ) ) [table:persistence_table:private] => rp_baubeschreibung [id:persistence_table:private] => 170 [properties:persistence_table:private] => array ( [name] => name [description] => description [category] => category ) [references:persistence_table:private] => array ( // more stuff here ) [objects:persistence_table:private] => array ( ) [callback:persistence_table:private] =>

f# - Avoiding "let mutable" cleanly with pattern matching and bitwise combining enum flags in fsharp -

f# - Avoiding "let mutable" cleanly with pattern matching and bitwise combining enum flags in fsharp - consider next (mutable) example: let getregexflax flags = allow mutable res = regexoptions.none ch in flags match ch | 's' -> res <- res ||| regexoptions.singleline | 'x' -> res <- res ||| regexoptions.ignorepatternwhitespace | 'i' -> res <- res ||| regexoptions.ignorecase | 'm' -> res <- res ||| regexoptions.multiline | _ -> raise (exception("invalid flag")) res i used illustration exemplify situation encounter. thought simple: based on string (or complex condition), need combine 0 or more enum flags. the easiest way that, think, above, mutable. if not utilize mutable, can think of myriad of other ways, none seem clean: recursive function combining homecoming flags (cumbersome) enum.combine don syme suggests, if-condi

python - A Module-level variable and a function argument having the same name: bad practice? -

python - A Module-level variable and a function argument having the same name: bad practice? - is having x both module-level variable name , function argument name bad practice? x = 2 def f(x): print x f(x) i asking because pylint complains it: w: 3, 6: redefining name 'x' outer scope (line 1) (redefined-outer-name) no, not, , why seeing warning (w) , not error (e). in general, depends on utilize case. if example, have alternate variable name can convey same meaning current variable name, improve utilize avoid unnecessary confusion. sample in code, can use: def f(n): print n the unnecessary confusion indeed wanted utilize global variable x, or might end comparing values of x different scopes , ending debugging why values not same. but if using defined variable name in scope best way convey info variable supposed convey, go it. python python-2.7 pylint

c# - Add multiple controls to GridView column in windows form app -

c# - Add multiple controls to GridView column in windows form app - i adding 2 columns gridview below datagridviewlinkcolumn editlink = new datagridviewlinkcolumn(); editlink.usecolumntextforlinkvalue = true; editlink.headertext = "edit"; editlink.datapropertyname = "lnkcolumn"; editlink.linkbehavior = linkbehavior.systemdefault; editlink.text = "edit"; datagridview1.columns.add(editlink); datagridviewlinkcolumn deletelink = new datagridviewlinkcolumn(); deletelink.usecolumntextforlinkvalue = true; deletelink.headertext = "delete"; deletelink.datapropertyname = "lnkcolumn"; deletelink.linkbehavior = linkbehavior.systemdefault; deletelink.text = "delete"; datagridview1.columns.add(deletelink); can add together both buttons under same column? for datagrid

Having issues when HTML5 loads video in IE11-Invalid Source, and in Safari-Missing Plugin -

Having issues when HTML5 loads video in IE11-Invalid Source, and in Safari-Missing Plugin - we learning utilize html5, css, , css3. if able help me this, please specific can be, , please include couple of screen-shots if possible. i coded html5 embedded video shows poster image of video @ first (before embed video tag. before, , after, embed video displays invalid source. happens in ie , safari (safari says missing plugin). have ie11, chrome, safari, , firefox installed have issues in ie , safari. tested in chrome , firefox. whatever reason, in safari says missing plugin. of this, on top of "invalid source" ie11. help appreciated! i've attached code. <!doctype html> <html lang="en"> <head> <title>lighthouse cruise</title> <meta charset="utf-8"> <h1>lighthouse cruise</h1> <style> video { width: 100%; height: auto; max-width: 320px; } </style> <

c# - simple linq issue, but I can't figure it out -

c# - simple linq issue, but I can't figure it out - i have simple linq issue. i'm trying query list , match fellow member id lists id , homecoming text: var idtext = idmethod(membid); var t = ctext in cidtext ctext.cid.tostring() == membid select cxt.c_id; viewbag.thisid = t.tostring(); all returns is: system.linq.enumerable+whereselectarrayiterator`2[pu15.models.c_id,system.int32] but never changes or shows want show. what doing wrong? you want utilize single or singleordefault or first or firstordefault , depending on want exactly, e.g.: viewbag.thisid = t.single(); single throw exception if there more 1 result or if there no results. if you'll utilize singleordefault instead homecoming null in case of more 1 result or no result. first on other hand fail empty collection - when there more 1 element homecoming first one. the tolerant, firstordefault homecoming null empty result list, , first element if t

javascript - Limit number of parallel http requests in node js -

javascript - Limit number of parallel http requests in node js - hi guys i'm new in node js. i have script start several http requests within loop let's have create 1000 http requests. thing can 1 http request per ip , have 10 ips so, after 10 parallel requests have wait response create one. how wait without block script 1 response http request start one? my problem if execute while waiting free ip whole script blocked , not receive response. thanks. use async module this. you can utilize async#eachlimit limit concurrent requests 10. var urls = [ // list of 100 urls ]; function makerequest(url, callback) { /* create http request */ callback(); // when done, callback } async.eachlimit(urls, 10, makerequest, function(err) { if(err) throw err; }); this code loop through list of urls , phone call makerequest each one. stop @ 10 concurrent requests , not proceed 11th request until 1 of first 10 have finished. javascript node.js

c - Pipe and Process managment -

c - Pipe and Process managment - i working on tiny shell(tsh) implemented in c(it's assignment). 1 part of assignment belongs piping. have pipe command's output command. e.g: ls -l | sort when run shell, every command execute on it, processed kid process spawns. after kid finishes result returned. piping wanted implement harcoded illustration first check how works. wrote method, partially works. problems when run pipe command, after kid process finishes, whole programme quits it! not handling kid process signal properly(method code below). my question: how process management pipe() works? if run command ls -l | sort create kid process ls -l , process sort ? piping examples have seen far, 1 process created(fork()). when sec command ( sort our example) processed, how can process id? edit: while running code result twice. don't know why runs twice, there no loop in there. here code: pid_t pipeit(void){ pid_t pid; int pipefd[2]; if

For loop Searching ID's Javascript -

For loop Searching ID's Javascript - okay little baffled one, i'll show code first , explain. var number = 1; var maxguess = 6; /*make array of possible words*/ var arr = ["horse", "cow", "blueberry", "apples", "time", "hollow", "pumpkin", "telephone", "computer", "calculator", "tower", "castle"]; /*write shuffler code*/ function shuffle(array) { var currentindex = array.length, temporaryvalue, randomindex ; // while there remain elements shuffle... while (0 !== currentindex) { // pick remaining element... randomindex = math.floor(math.random() * currentindex); currentindex -= 1; // , swap current element. temporaryvalue = array[currentindex]; array[currentindex] = array[randomindex]; array[randomindex] = temporaryvalue; } homecoming array; } /*shuffle array*/ shuffle(arr); /*

linux - Install java plugin in chrome in Ubuntu 14.04 -

linux - Install java plugin in chrome in Ubuntu 14.04 - i have installed oracle java 7 in /home directory next steps given here (by changing path of installation). still cannot see plugin listed in chrome://plugins tab. i cannot see running in javatester or here. have tried enabling next steps provided here nil works. some specifications: operating system: ubuntu 14.04 output of java -version : java version "1.7.0_67" java(tm) se runtime environment (build 1.7.0_67-b01) java hotspot(tm) 64-bit server vm (build 24.65-b04, mixed mode) please comment if more needed resolving problem just pull webupd8 servers. follow directions @ next link. http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html also, belongs on different forum. forum programming questions, installing chrome plugin isn't do. next time post ubuntu stack exchange located here. java linux google-chrome ubuntu

ruby - How to setup relation so I can add multiple associations to self? -

ruby - How to setup relation so I can add multiple associations to self? - i have 2 classes class project < activerecord::base has_many :related_projects has_many :projects, through: :related_projects end class relatedproject < activerecord::base belongs_to :project belongs_to :related_project, class_name: 'project', foreign_key: 'related_project_id' end relatedproject association table stores projects related each other. project has many-to-many relation itself. what can't figure out how set can like project.project_ids = [2,3] update project have 2 related projects. should automatically add together association on save. works fine if not doing many many relationship same model. what missing? if understand correctly, think need utilize has_and_belongs_to_many create many many association table. replace relatedproject model. look @ docs relation. ruby ruby-on-rails-4 model-associations

python - Alternative of PIL/Pillow for using ImageField in Django Models -

python - Alternative of PIL/Pillow for using ImageField in Django Models - i setting django project on shared hosting server using virtualenv don't have root access . sudo doesn't works.i using imagefield in models require pil/pillow installed.but when seek pip install pillow i error: unable execute gcc: permission denied error: command 'gcc' failed exit status 1 so there alternative available pil/pillow can installed without root access , gcc permissions ? (no permissions in virtualenv) imagefield requires pillow library, see here: https://docs.djangoproject.com/en/dev/ref/models/fields/, no 2 ways around that. need install it. there several solutions in case: install/get permission run gcc on server compile somewhere else, setup identical , re-create files change code not utilize imagefield python django pip shared-hosting

python - Unexpected character after line continuation character -

python - Unexpected character after line continuation character - i'm trying run python script using terminal in mac os x. #!/usr/bin/env python import re lept = open("nc_005823.gbk", "r+") line in lept : if re.match("unknown function", line ): print line but gives me error: file "test.py", line 1 {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 ^ syntaxerror: unexpected character after line continuation character i can' t figure out what's wrong. code runs on online editors. how prepare this? python osx terminal

category - Runtime or compile time error for type check in Objective C -

category - Runtime or compile time error for type check in Objective C - currently in our sdk allow user set key/value info on user record, info date, string or number. created protocol phone call attribute, extended (category) nsstring , nsdate , confirm protocol. in our method sets these attributes, inquire value argument confirm attribute protocol. help compile time check, wonder if necessary due dynamic nature of objective c (i’m java developer), improve run time check , homecoming nserror if value not of type nsstring nsdate or nsnumber ? a decision depend on application behavior wrong data. it's unnecessary create error if it's wrong info @ release, should check values , converse, example, int nsnumber when user typed data, not after operations. it's choice, lead 1 or check if(error) etc.. objective-c category

jquery - Date Validation with Mask -

jquery - Date Validation with Mask - i using jquery mask date input. thing works expected, if type in 13343454, turn right format 13/34/3454. doesn't create sense! how can validate form? live code html enter dob <input type="text" id="dob"> js $('#dob').mask('00/00/0000'); jquery

Ruby - method changes input variable value -

Ruby - method changes input variable value - i'm new ruby , i'm having problem understanding what's happening in method. i create phone call in rails controller - @arr = someclass.find_max_option(params[:x], @pos, params[:y], some_var) i'm trying homecoming value @arr , happens successfully, manipulations create @pos within method beingness brought well; value of @pos changes when i'm trying value @arr . here's more details on method #before going method @pos = [a,b] def self.find_max_option(x, pos, y, some_var) pos.collect! { |element| (element == b) ? [c,d] : element } end #new value of pos = [a, [c,d]] fine within in method ... #some calculations not relevant question, pos gets used generate some_array homecoming some_array but when method finished , gets controller, value of @pos [a,[c,d]] well. what's going on here? thought pos treated separately @pos , value wouldn't carry back. workaround create

How to Delete Application folder in Javascript/Html Metro App for windows -

How to Delete Application folder in Javascript/Html Metro App for windows - var applicationdata = windows.storage.applicationdata.current; var path = applicationdata.localfolder.path; path = path.replace('\\localstate', ''); var folder = windows.storage.storagefolder.getfolderfrompathasync(path).done(function () { }); folder.deleteasync().done(function () { }); window.close(); executing code exception im not allowed access hidden folder , have alter file attribute of it. please suggest me solution. please note want delete entire application folder , not application data. javascript windows windows-phone-8 windows-phone-8.1 winjs

junit - Is it possible to get mstest with /publish option without needing to install Visual Studio? -

junit - Is it possible to get mstest with /publish option without needing to install Visual Studio? - i trying publish junit.xml test results tfs build - have transformed them .trx files , display fine, long utilize mstest.exe /publish - have many users not have version of mstest installed on build agents. according command-line options publishing test results, prerequisites version of mstest /publish alternative are: visual studio ultimate, visual studio premium, or visual studio test professional also, test agents (e.g. visual studio 2013 test agent) seem install version of mstest without publish functionality. is there way (for example, can redistribute?) mstest.exe publishing functionality onto tfs build agents without needing purchase (and install) 1 of copies of visual studio? visual-studio junit tfs mstest

Copying bat file (itself) to appdata -

Copying bat file (itself) to appdata - i'm trying create bat re-create appdata folder. have tried this copy %0 "%appdata%\windows.bat" > nul but doesn't re-create itself. right way ? @copy "%~f0" "%appdata%\windows.bat" > nul do have spaces in file name? if yes require file name set in double quotes. have used cd or pushd command? if yes you'll need utilize total path instead of relative (with %~f ). have used shift command somewhere in script? can alter %0 value. file batch-file exe

javascript - Expand/Collapsible list of objects -

javascript - Expand/Collapsible list of objects - i'm trying display list of object models (robots), models have field parent can robot. i've implemented nested list using mptt django: {% load mptt_tags %} <ul> {% recursetree nodes %} <li> <a href="{{ node.get_absolute_url }}">{{ node.name }}</a> {% if not node.is_leaf_node %} <ul class="children"> {{ children }} </ul> {% endif %} </li> {% endrecursetree %} </ul> i'd create list exandable/collapsable - eg can shrink nodes children. i'm having problem using javascript because nodes of same class. there other simple way of implementing this? you can figure out level you're @ in tree using node.level , need add together additional css class top level, this: <ul id="node-{{ node.pk }}" class="childr

java - Regular expression of -digit -

java - Regular expression of -digit - i need regular look match strings : -2,-3,-10,-100 ... i know regular look of number \\d how can negation before it? can help me? assuming don't want match strings "-0" , "-0123" , want look "-[1-9]\\d*" which requires have minus sign, digit 1 9, , number of additional digits - or none of them. additional digits might include 0. first backslash there escape sec one; , strictly speaking isn't part of regular expression. java regex

android - Grow heap (frag case) on ListView Fragment using custom ParseQueryAdapter on fast scrolling -

android - Grow heap (frag case) on ListView Fragment using custom ParseQueryAdapter on fast scrolling - i using parse.com android sdk. within tabsactivity.java , have searchfragment extends listfragment in order populate listview custom parsequeryadapter. within custom adapter declare custom list row layout called search_list_item.xml . layout contains parseimageview . my problem when fast scroll downwards list logcat gets total of i/dalvikvm-heap﹕ grow heap (frag case) ...mb byte allocation and the listview returns initial position(that means gets first item). if on other hand scroll list can @ end of items without error. how prepare this?? additionally, if utilize default parsequeryadapter without customizing rows search_list_item.xml don't have such problem. below post code think useful: the code of search_list_item.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.

json - Java data transformation library -

json - Java data transformation library - throwing error jsonreader can not resolved type how handle it?? public class flatten { private static final string file = "employee.json"; public static void main(string[] args) throws throwable { datareader reader = new jsonreader(new file(file)) .addfield("empmid", "//empmid") .addfield("comments", "//comments") .addfield("col1", "//col1") .addfield("contactaddress", "//contact//address") .addfield("contactfreetext", "//contact//freetext") .addfield("gender", "//gender") .addrecordbreak("//employee/array/object"); datawriter author = new csvwriter(new outputstreamwriter(system.out)); jobtemplate.default.transfer(reader, writer); } } do u need "common jars&q

javascript - readyState does not get past 1 -

javascript - readyState does not get past 1 - trying set info xml through javascripts open() function. website not past readystate 1, below the javascript code function additem() { var name = document.getelementbyid('iname').value; var cost = document.getelementbyid('iprice').value; var quantity = document.getelementbyid('iquantity').value; var description = document.getelementbyid('idescription').value; xhrobject.open("get", "listing.php", true); xhrobject.onreadystatechange = function() { if (xhrobject.readystate == 4 && xhrobject.status == 200) { document.getelementbyid('information').innerhtml = xhrobject.responsetext; xhrobject.send(null); } } } i not know if error php, quite big post in if required. javascript php ajax

javascript - Dynamically adding angularjs directive with a $http to get -

javascript - Dynamically adding angularjs directive with a $http to get - i stuck interesting problem, i trying create soemthing of sort: input key 1 , input value 1 input key 2 , input value 2 < button add together more > < submit button > basically user can click submit , issue request given url. when click add together more new row appears 2 input fields, can add together more http paarmeters. i tried coding up, close this: http://jsfiddle.net/d2jl2n35/1/ could please help me... two questions: how dynamically add together new row after plus box clicked? myapp.directive('options',function(){ homecoming { restrict:"e", template:"<div><input placeholder='params1' type='text'/><input placeholder='params2' type='text'><button><i class='glyphicon glyphicon-plus'></i></button></div>" } }) ok solved fi

regex - How to delete empty lines in a file by Emacs? -

regex - How to delete empty lines in a file by Emacs? - in emacs, how remove empty lines (including tabs , spaces) in file ? can m-x replace-regexp trick? i can find empty lines regexp: ^[st]*$, don't know how replace deleting. thanks! ^ , $ match starts , ends of lines, not actual end-of-line characters. have explicitly type newline in look replace it. to accomplish goal, replace-regexp ^[[:space:]]*^j with nil (empty text). come in ^j , first press command , q, command , j. in entry field, shows actual line change. regex emacs str-replace

javascript - Make selected area on uploaded area transparent -

javascript - Make selected area on uploaded area transparent - i uploading image form (in wordpress), , want allow users utilize pencil tool draw line around area. think of lasso tool in photoshop. users can 'mark' area modified. what see, if possible utilize either imagemagik, gd, or client side js library find selected area, , convert within transparent. here illustration image. person wants upload image, , using uploader, marked reddish line select transparent. so image within reddish line, should detected imagemagik/gd/client js, , in there transparent. i not find see if possible or not. on server using php can there if needed imgmagik/gd if possible. need know if can take within of reddish area , create transparent. prefer, if find client side js library or jquery plugin, allow end user on client side via image upload utility. , upload final modified version of image. any help or input on appreciated. there's few tools out there usin

radio - Are there SDRs that will let me program with a PC and then run a particular program on their own? -

radio - Are there SDRs that will let me program with a PC and then run a particular program on their own? - i'd programme transmitter output routine each time button pressed. way don't have connected computer each time want utilize it. exist? sure, there embedded devices ettus e-series can set this. note you'll need experience in embedded systems if want utilize such system. however, low-performance apps (e.g. low-bandwidth signals) might able run grc flow graph on embedded device without lot of modifications. radio redhawksdr gnuradio

magento - child products of configurable products seen as simple products -

magento - child products of configurable products seen as simple products - i have created few configyrable product on magento bike store, on frontend see associated products simple products , no picture. need have main products (configurable products) , no kid products seen simple products. did wrong? screenshot: thanks magento configurable-product

Python strange override behaviour for "__" functions -

Python strange override behaviour for "__" functions - i found "strange" behaviour in python overriding "__" functions class a(object): def foo1(self): print "foo1 a" self.test1() def foo2(self): print "foo2 a" self.__test2() def test1(self): print "test1 a" def __test2(self): print "test2 a" class b(a): def test1(self): print "test1 b" def __test2(self): print "test2 b" ia = a() ib = b() ib.foo1() ib.foo2() gives result: foo1 test1 b foo2 test2 instead of: foo1 test1 b foo2 test2 b is normal behaviour python "__" functions? the behaviour see stated intent of using leading double underscore name in class attribute or method. names leading double underscore 'mangled'; have name of class prefixed, explicitly prevent name clashes subclasses. see reserved c

How to convert px from photoshop to css -

How to convert px from photoshop to css - i saw lot of people have issue photoshop font-size didn't find problem. i converted preferences pt px font size there no difference. my problem have text set 30px on photoshop seems 16px on css. annoying convert psd template coded website because have no clue how converted.. did else encounter issue , prepare it? (my file set 72dpi, tried 96dpi nil changed, , visualize file @ 100%) thx answers , sorry if made english language mistakes. i found answer: http://i.stack.imgur.com/pou1b.jpg theses params set default @ 60% fonts 40% tinyer should be. 30px real 30px :) css photoshop font-size

SQL Server circular data query -

SQL Server circular data query - i have simple table of 3 records below: childid | parentid | name -------------------------- 1 | null | abc 2 | null | def 3 | 1 | ghi what need query lists out name , parent name. in case of null should homecoming no parent, of sort: childid | name | parent_name -------------------------------- 1 | abc | no parent 2 | def | no parent 3 | ghi | abc since i'm new sql server i'm not sure how approach question. have tried search in vain. comments appreciated a simple left outer join job. seek this create table #tttt ( childid int, parentid int, name varchar(50) ) insert #tttt values (1,null,'abc'), (2,null,'def'), (3,1,'ghi') select a.childid, a.name, isnull(b.name, 'no parent') parent_name #tttt left bring together #tttt b on

android - Can't add more than one row in Listview at a Fragment -

android - Can't add more than one row in Listview at a Fragment - i have listfragment info json. when click on list item, info sent fragment (detalhesfragment.java). if user confirms data, nail button in detalhesfragment send info list on right of main activity (pedidosfragment.java). it's working! info middle fragment appears on first row of listview on pedidosfragment. but, if seek take item send there, row overwrited new data..isn't adding row under first row. can help me, guys? here, codes.. detalhesfragment.java package com.example.waitersoriginal; import android.app.fragment; import android.content.dialoginterface; import android.content.dialoginterface.onclicklistener; import android.os.bundle; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.absolutelayout; import android.widget.button; import android.widget.textview; public class detalhesfragment extends fragment implements

ios - How to set a CVPixelBuffer as an input for a vertex shader? -

ios - How to set a CVPixelBuffer as an input for a vertex shader? - i utilize apple metal render path processing cvpixelbuffer. how can transform cvpixelbuffer conform input vertex shader? not sure how extract color/position values cvpixelbuffer able setting them host. here's code utilize convert cvpixelbuffer info metal texture. #pragma mark - avcapturevideodataoutputsamplebufferdelegate - (void)captureoutput:(avcaptureoutput *)captureoutput didoutputsamplebuffer:(cmsamplebufferref)samplebuffer fromconnection:(avcaptureconnection *)connection { cvpixelbufferref pixelbuffer = cmsamplebuffergetimagebuffer(samplebuffer); id<mtltexture> texture = nil; { size_t width = cvpixelbuffergetwidth(pixelbuffer); size_t height = cvpixelbuffergetheight(pixelbuffer); mtlpixelformat pixelformat = mtlpixelformatbgra8unorm; cvmetaltextureref metaltextureref = null; cvreturn status = cvmetaltexturecachecreatetexturefromimage(null, _texturecach

javascript - Updating domain values of multiline graph after line drag event -

javascript - Updating domain values of multiline graph after line drag event - i developing simple multi-line graph dual time axes , zooming/dragging features. please take @ jsfiddle. i trying implement drag feature on line graph, whereupon dragging particular line result in respective axis getting updated. every time drag applied graph, trying update domain values of respective axis, , redraw both axis , line graph. here logic implemented update domain values (referenced d3 example): var mousepoint = d3.mouse(this); x1 = x1scale.domain()[0], x2 = x1scale.domain()[1], console.log("x1 = "+x1+", x2 = " +x2); xextent = x1 - x2; x1 += mousepoint[0]; x2 += mousepoint[0]; var newdomain = [x1, x2]; x1scale.domain(newdomain); when implement logic, nan error. right way update domain values after drag? if so, how solve nan error , accomplish desired functionality? it of import convert numbers date objects, there typo

ant - Could not execute jacoco on jenkins -

ant - Could not execute jacoco on jenkins - when trying gt sonar code coverage of project through jenkins, getting next error: not load definitions resource org/jacoco/ant/antlib.xml. not found. but when executing through eclipse not show error. code same in both case , have checked in case of jenkins jacocoant.jar included. here code: <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml"> <classpath path="../monet-main/lib/dev/sonar/jacocoant.jar" /> </taskdef> <property name="sonar.tests" value="test" /> <property name="sonar.dynamicanalysis" value="reusereports" /> <property name="sonar.surefire.reportspath" value="output/site/jacoco" /> <property name="sonar.java.coverageplugin" value="jacoco" /> <property name="sonar.jacoco.reportpath" value="output/jacoco.exec" />

asp.net mvc - MVC4 should i use HttpUtility for validating input -

asp.net mvc - MVC4 should i use HttpUtility for validating input - i wonder should validate inputs. allways i'm not set validateinput attribute beacause default framework handle should add together security httputility.htmlencode encode input values. is there vulnerability way? you defining info annotation validator, rendering there. asp.net-mvc

javascript - Remove Polylines on a map from mapbox -

javascript - Remove Polylines on a map from mapbox - does know how can remove polylines have on map. hve tried many things remove lines taht drawn up. not dissapear. code used draw lines : var geojson = [ { "type": "feature", "geometry": { "type": "linestring", "coordinates": [ [10.39799, 63.43074], [10.3987, 63.431] ] }, "properties": { "stroke": "#fc4353", "stroke-width": 5 } },{ "type": "feature", "geometry": { "type": "linestring", "coordinates": [ [10.397958755, 63.431], [10.39868, 63.43073] ] }, "properties": { "stroke": "#fc4353", "stroke-width": 5 } } ]; l.geojson(geojson, { style: l.mapbox.simplestyle.style }).addto(map); stor

osx - How to programmatically disable iOS 8 video capture in Mac Yosemite? -

osx - How to programmatically disable iOS 8 video capture in Mac Yosemite? - apple released new feature allowing film recording via quicktime player. need connect ios 8 device mac yosemite machine, run quicktime , set connected device source of movie. (like explained here: http://www.tekrevue.com/tip/record-iphone-screen-quicktime/) i prevent quicktime record film while application running. thought how can that? any value can alter in plist? special event can hear to? other creative way disrupt process? thanks! nili according apple's developer technical support, not possible opt apps out of screen capture :\ time file enhancement request guess. ios osx cocoa ios8 osx-yosemite

hadoop - Apache Pig Error -- Unable to trace -

hadoop - Apache Pig Error -- Unable to trace - when seek run below pig query, getting error while using sort command. if omit sort transform, query able execute. grunt> month1 = load 'hdfs://localhost.localdomain:8020/user/cloudera/data/big1/climate_month1.txt' using pigstorage(','); grunt> month2 = load 'hdfs://localhost.localdomain:8020/user/cloudera/data/big1/climate_month2.txt' using pigstorage(','); grunt> month3 = load 'hdfs://localhost.localdomain:8020/user/cloudera/data/big1/climate_month3.txt' using pigstorage(','); grunt> month4 = load 'hdfs://localhost.localdomain:8020/user/cloudera/data/big1/climate_month4.txt' using pigstorage(','); grunt> month5 = load 'hdfs://localhost.localdomain:8020/user/cloudera/data/big1/climate_month5.txt' using pigstorage(','); grunt> months = union month1, month2, month3, month4, month5; grunt> clearweather = filter months skycondit