Posts

Showing posts from January, 2013

c# - String not recognized a timespan -

hope me this. yesterday code working, after did cleaning stop working , keeps on saying: string not recognized valid timespan datatable dt = new datatable(); dt = database.getschedule(); timespan amtime; timespan pmtime; timespan nntime; timespan _timenow = timespan.parse(timenow); foreach (datarow row in dt.rows) { amtime = timespan.parse(row["amintake"].tostring()); pmtime = timespan.parse(row["pmintake"].tostring()); nntime = timespan.parse(row["nnintake"].tostring()); if (amtime == _timenow || pmtime == _timenow || nntime == _timenow) { messagebox.show("drink medicine"); } else { /*do nothing*/ }

java - Adding a profile to a child container does not replicate in the other child containers in an ensemble? -

i have started working on fabric8 in have created ensemble of 3 fabric servers - node1, node2 , node3. each fabric server has child preferably node1-child1, node2-child1 , node3-child1 respectively. i want add profile child containers. thought because in cluster, adding profile in 1 child container replicate profile in other child containers well. not happen! is there way can achieve above without going each container , adding profile? adding profile 1 child container not automatically add other child containers. in case, child containers in cluster duplicates of each other, not desirable. you have add profile every child container has run contents of profile. once done, if change in profile, containers profile update automatically.

mysql - Convert all the data of table (which have both encoding data) into single encoding either utf8 or latin1 -

we have table consists of 2 different encoding data (utf8 , latin1) has been inserted 2 different use cases of application. getting broken strings issue other languages text if data in 1 encoding.we need convert total table data single encoding. eg: table x id name data encoded 1 ébarber - utf8 2 à gogo - latin1 if use "latin1" connection charset, issue "ébarber"(broken strings). if use "utf8" connection charset, issue "à gogo"(broken strings). how can convert table data single encoding either utf8 or latin1? please share thoughts fix issue. it possible. painful. convert binary identify rows contain encoding. can automated, may not 100% correct. do special update against rows. convert utf8 . details: step 1: convert binary: alter table tbl modify column col varbinary(...) ...; -- suitable matching other stuff, or alter table tbl modify column col blob ...; -- if text. step 2: find latin

cookies - Okta Session hand-over from desktop application to web application -

we have desktop application used upload content web application, both use okta authentication. before uploading, desktop application authenticates user via okta using embedded browser control. later in workflow want open user's default browser he/she can start using web application directly. @ moment user need login second time when default browser opens. we planned implement mechanism generate one-time key (transferable session token) can passed url parameter when browser opened. our application's own token can achieve need transfer okta session (cookie) , have not found way transfer desktop browser control standalone browser. what options available achieve this? edit: acceptable if new session created standalone browser long user identity stays same , user not have provide login details second time. unfortunately, okta not have way transfer 1 active session describe. however, if have enough control on organization's environment, simulate behavior. okt

java - AngularJS $http.post method passing null arguments to JAX-RS API -

i'm trying pass arguments angularjs post method: function create(email, password, phonenumber) { return $http.post('resources/users/register', {email: email, password: password, phonenumber: phonenumber}).then(handlesuccess, handleerror('error creating user')); } to jax-rs method : @post @produces(mediatype.application_json ) @path("/register") public response register(@formparam("email") string email, @formparam("password") string password, @formparam("phonenumber") string phonenumber) { i have loggers before $http.post , on beggining of register method, when arguments on web side contains info, every argument on server null -> trying use curl method - fine! anyone have idea? try change json object : {'email': email, 'password': password, 'phonenumber': phonenumber} javascript var ---> string name values json data written name/

sql - Selecting different number of columns in a CSV file -

the task extract data multiple csv files according criteria. file contains sampleid (this criteria) , other columns. @ end of file there measurement values under 0...100 named columns (the numbers actual names of columns). make bit more interesting there can variations in different csv files, depending on customer needs. means measurement data count can 15, 25, 50 etc. no more 100 , no variations within 1 file. data placed in end of line, there set of columns before numbers. i'd have sql statement can accept parameters: select {0} {1} sampleid = {2} 0 numbers, 1 csv file name , 2 sampleid looking for. other solution came mind columns after last fix column. don't know possible or not, thinking out loud. please descriptive, sql knowledge basic. appreciated. so managed solve it. code in vb.net, logic quite clear. private function getdatafromcsv(sampleids integer()) list(of keyvaluepair(of string, list(of integer))) dim datafiles() string = sy

android - how to open an activity from a speech to text output -

here code: public void promptspeechinput(){ intent = new intent(recognizerintent.action_recognize_speech); i.putextra(recognizerintent.extra_language_model, recognizerintent.language_model_free_form); i.putextra(recognizerintent.extra_language, locale.getdefault()); i.putextra(recognizerintent.extra_prompt, "say something!"); try{ startactivityforresult(i, 100); } catch(activitynotfoundexception a){ toast.maketext(voicesearch.this, "sorry! device doesn't support speech language!", toast.length_long).show(); } } public void onactivityresult(int request_code, int result_code, intent i){ super.onactivityresult(request_code,result_code,i); switch(request_code){ case 100: if(result_code == result_ok && != null){ arraylist<string> result = i.getstringarraylistextra(recognizerintent.extra_results); resulttext.settext(result.get(1)); string text =

select - Querying SQL for multiple records -

i have table containing information, , wish make select query retrieve wanted informations. my table looks like, column1 column2 column3 ... company1 doc1 company1 doc2 company1 doc3 company2 doc1 company2 doc3 company3 doc1 ... so want is, select companies containing 3 documents. is, if compan1 contains doc1, doc2, doc3, select it. if contains doc2 , doc3, or else, not select it. so overall, want overview of companies containing exact 3 documents. hope gives sense :). select column1 the_table column2 in ('doc1', 'doc2', 'doc3') group column1 having count(distinct column2) = 3;

python - Tic Tac Toe - Finding empty grid tiles -

this continuation of previous question regarding tic tac toe game. making function collect empty grid tiles of tic tac toe board, , return them in list. function recursive, in keep looking empty grid tiles adjacent move made. this: <-------> < x o - > < - - x > < o x - > <-------> so lets user (or in case, code wrote computer playing against computer) wants know grid tiles empty picking tile. above example, tiles numbered 0 1 2 3 4 5 6 7 8 and lets computer chose tile 1 - search adjacent tiles (so in case, top, left, right, , bottom) , see if can make moves there. if finds adjacent tile empty, finds adjacent tiles of tile well, until exhausts possibilities. want able call function current board , playermove, , find adjacent tiles empty, , append them list. tips? def whatisempty(movelist,move): emptytiles = [] #something allows find adjacent tiles of move #something allows find adjacent tiles of tiles found above, until found

asp.net mvc - The test method is not being shown in test explorer VS2013 -

i'm @ beginning of testing calculation method. did clean, rebuild, x64 adjustments project , have nunit test adapter , other related dlls yet still cannot see test method in test explorer pane. help, there missing code or what? namespace ninja.tests { [testfixture] public class singlepricingtests { [test] public void shouldcalculate() { var pricingmodeltest = new pricingmodel(); var sut = new pricecalculationservice(); // sut: system under test var result = sut.calculate(pricingmodeltest); var testparameters = new pricingcostparameters(); assert.that(result, is.equalto(testparameters)); } } } i sure have wrong adapter nunit framework. if use nunit 3.0 or later need use "nunit 3.0 test adapter" can download here https://www.nuget.org/packages/nunit3testadapter/3.0.8-ctp-8 . remove other adapters don't need.

perl - Performing a one-liner on multiple input files specified by extension -

i'm using following line split , process tab-delimited .txt file: perl -lane 'next unless $. >30; @array = split /[:,\/]+/, $f[2]; print if $array[1]/$array[2] >0.5 && $array[4] >2' input.txt > output.txt is there way alter one-liner in order perform on multiple input files without specifying each individually? ideally accomplished performing on files within current directory holding .txt (or other) file extension - , outputting set of modified files names e.g.: input: test1.txt test2.txt output: test1mod.txt test2mod.txt i know can access filename modify $argv not know how go getting run on multiple files. solution : perl -i.mod -lane 'next unless $. >30; @array = split /[:,\/]+/, $f[2]; print if $array[1]/$array[2] >0.5 && $array[4] >2; close argv if eof;' *.txt $. needs reset otherwise throws division 0 error. if don't mind different output file name, perl -i.mod -lane' next unl

javascript - Wodry js animations -

heyy, on angular website, using 'wodry js' plugin create animated effect shown in example 2 link 1: http://daynin.github.io/wodry/#examples https://github.com/daynin/wodry i have installed wodry using bower , grunt , working extent. however if have 3 words eg. word1, word2, word3 it starts on word1, spins show word1word2 , spins show word2word3 etc. instead of showing 1 word @ time. this code within html doc: <script> $('.wodry').wodry({ animation: 'rotatex', delay: 1000, animationduration: 800, }); </script> <div> trial run <span class="wodry">word1|word2|word3</span> </div> how can correct please? thanks!!

setuptools - python setup.py sdist and custom setup keywords don't play together -

subtitle: not sdist i trying setup.py file of package i'm working on play nicely sdist . relevant parts of setup.py file are: from setuptools.command.test import test [...] class tox(test): "as described in http://tox.readthedocs.org/en/latest/example/basic.html?highlight=setuptools#integration-with-setuptools-distribute-test-commands" [...] def run_tests(self): if self.distribution.install_requires: self.distribution.fetch_build_eggs( self.distribution.install_requires) if self.distribution.tox_requires: self.distribution.fetch_build_eggs(self.distribution.tox_requires) # import here, cause outside eggs aren't loaded import tox import shlex args = self.tox_args if args: args = shlex.split(self.tox_args) else: args = "" errno = tox.cmdline(args=args) sys.exit(errno) entry_points ={} distutils_ext = {'distutils.setup_keywords': [

javascript - How to enable keyboard event after customizing my own snippet in aptana3? -

i have custom snippet, snippets.rb in javascript bubble project . , see definition in snippets view after restarting aptana, double click trigger. how enable keyboard trigger. i think found reason. definited line s.trigger="log" in snippets.rb file, forgot add difinition console_log: "console log" in project/config/locales/en.yml , way enable keyboard shortcut.

ruby on rails - Locale based information on International site -

we're building education platform. site it's going published in different countries, having each country own subfolder. example, france: http://myedusite.com/fr/ spain: http://myedusite.com/es/ the site has courses belonging providers courses have different themes (arts, business, science) , these themes have sub-themes (i'm planning use ancestry have tree structure model) courses providers can create courses if have account. courses created published in domain created. example, if i'm course's provider , create account in http://myedusite.com/fr/ , courses create should published in http://myedusite.com/fr/ . for purpose, thought of defining country model field iso_3166 . field populated country codes defined in iso 3166 . then, courses have target_country (class: country ), enabling possibility of choosing course published (if course's target_country france should visible in http://myedusite.com/fr/ ). themes for themes hap

mysql - laravel split table in two table for one model -

i have 1 model car , table cars. in table cars have lot of filed required there. is there way split table filed f1,f2,f3 go in table 'cars' , f6, f7, f8 in 'cars2'. my goal @ end not write 2 query 2 tables. possible eloquent. apparently not recommend idea of splitting table. because cars , cars2 make db redundant 1 , thereby causing lot of ambiguity coders come. however, recommend use of join queries gracefully access data needed 2 tables planning use , using single query.

c# - Convert a string in a label to int not working properly -

i have following code: int = int32.parse(weight.text); double b = 0; if (this.wcf.selecteditem == weighing) { b = (a * 1.03) / 1000; wll.content = b.tostring(); } weight name of textbox , in textbox input made 50000 . wll label calculation of b shown. wll shows 51.5 correct. i want use value of b in calculation further down , therefore have defined new int : int p = convert.toint32(b); double g = 0; double sq = math.sqrt(50 / p); the value of sq should 0,985 , shown in label daf , program shows 1,492 . not correct here, can me? g = (1.09 + (0.41 * sq)); daf.content = g.tostring(); beware of this: int p = convert.toint32(b); double g = 0; double sq = math.sqrt(50 / p); //int/int this make have math.sqrt(int) , losing precision. instead, should do: double sq = math.sqrt(50d / p); //double/int or double sq = math.sqrt((double)50 / p); //double/int or double sq = math.sqrt(50.0 / p); //double/int declare 50

How to make Nutch crawler to crawl only specific URLS? -

i'm aware regex can used restrict pages downloaded. but, crawl pages anchor link in given page in set of urls. example, have array words ['computer','software','hardware','operating system','thread'], crawl urls anchor text contains 1 of these words in array. should implement kind of logic in nutch? thank you. as pointed out, urlfilters aren't use deal url string only. achieve described implementing custom htmlparsefilter in you'd access parsedata current document. contains outlinks filter based on anchor value. there loads of examples online on how write plugin and/or custom htmlparsefilter, see instance metatagsparser .

How asp.net Bundling works internally -

Image
i curious know how asp.net bundling works. i know we've add scripts , css , images bundle browser initiate single request resources. i 've confusion how pages refer these bundled resources client browser. let's take @ happens when use bundling in system.web.optimization. in example used "empty asp.net mvc 4 template" , grabbed latest "microsoft.aspnet.web.optimization" package nuget. i proceeded register 2 javascript files. 1 jquery , bootstrap. public static void registerbundles(bundlecollection bundles) { var javascriptbundle = new bundle("~/bundles/javascripts") .include("~/scripts/jquery-{version}.js") .include("~/content/bootstrap/js/bootstrap.js"); bundles.add(javascriptbundle); } now have our setup done, let's see happens when view page. you can see both javascript files included do. happens when have "debug" flag set in web.config. let's turn fa

networking - Akka remoting binds to hostname instead of bind-hostname -

context i trying run akka application on node , make work other nodes using akka remoting capabilities. my node has ip address, 10.254.55.10 , , there external ip, 10.10.10.44 , redirecting former. external ip 1 on want other nodes contact me. extract akka app config: akka { remote { netty.tcp { hostname = "10.10.10.44" port = 2551 bind-hostname = "10.254.55.10" bind-port = 2551 } } } i know works fine on network side, because when listen on ip netcat, can send messages myself via telnet using external ip. in other words, when running these 2 commands in separate shells: $ nc -l 10.254.55.10 2551 $ telnet 10.10.10.44 2551 i'm able communicate myself, proving network redirection works fine between 2 ips. problem when launching application, crashes bind error:

java - com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure -

i'm working on getting database talk java programs. can give me quick , dirty sample program using jdbc? i'm getting rather stupendous error: exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.communicationsexception: communications link failure last packet sent server 0 milliseconds ago. driver has not received packets server. @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:39) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:27) @ java.lang.reflect.constructor.newinstance(constructor.java:513) @ com.mysql.jdbc.util.handlenewinstance(util.java:409) @ com.mysql.jdbc.sqlerror.createcommunicationsexception(sqlerror.java:1122) @ com.mysql.jdbc.connectionimpl.createnewio(connectionimpl.java:2260) @ com.mysql.jdbc.connectionimpl.<init>(connectionimpl.

django - Idiomatic way of counting number of related objects -

this how doing currently: class article(models.model): ... def nr_notes(self): return len(note.objects.filter(article=self.pk)) class note(models.model): article = models.foreignkey(article, on_delete=models.cascade) but thought "there must better way". accessing the generated notes_set field? what right way implement method nr_notes ? yes, use count , count query on database rather evaluating filter note.objects.filter(article=self.pk).count() from evaluating querysets : a queryset evaluated when call len() on it. this, might expect, returns length of result list. note: if need determine number of records in set (and don’t need actual objects), it’s more efficient handle count @ database level using sql’s select count(*). django provides count() method precisely reason.

javascript - Get Posts from Facebook Page PHP -

so i've done lot of searching on world wide web can't seem find i'm looking for. want able of posts in order of upload specific facebook page without needing user login. want data coming in json format , using either php or if needed javascript. i know don't have code i've spent many hours trying answer behind , asking here last resort really. :) what looking in official facebook docs, including example code: https://developers.facebook.com/docs/graph-api/reference/page/feed#read it´s first entry when search "get facebook page posts" google ;) without user login, can posts of page if it´s not restricted age or location. can use app access token that. more information tokens , how generate them: https://developers.facebook.com/docs/facebook-login/access-tokens http://www.devils-heaven.com/facebook-access-tokens/

c++ - Overloading insertion operator in Boost.Log (Boost 1.60.0) -

i trying overload operator<< can log vector<t> s in boost.log. tried overloading formatting_ostream : template <typename t> inline boost::log::formatting_ostream & operator<< (boost::log::formatting_ostream & o, const std::vector<t> & v) { return o; } this not compile boost 1.60.0 i using following logger: typedef boost::log::sources::severity_logger< boost::log::trivial::severity_level > my_logger_t; the errors see are: .../boost_1_60_0/build/include/boost/log/utility/formatting_ostream.hpp:799:19: error: no match operator<< (operand types boost::log::v2s_mt_posix::basic_formatting_ostream<char>::ostream_type {aka std::basic_ostream<char>} , const std::vector<int> ) strm.stream() << value as understand, overloading doesn't work!! because compiler still calling pre-defined operator<< makes strm.stream() << value call. am doing wrong? what&#

USB Light HID control with Node.JS & node-usb - flash only? -

i've got delcom usb light - think build light ( http://www.delcomproducts.com/products_usblmp.asp ) i'm trying control node.js (running on ubuntu if makes difference) i'm using node-usb ( https://github.com/schakko/node-usb ) , can connect & claim device. can "flash" (just when first plug in), can't stay lit, let alone change colours var usb_driver = require("../usb.js"), assert = require('assert'); // setup our vars var lightvid = 0x0fc5 var lightpid = 0xb080 // search ledlight var usb = usb_driver.create() var thelight_devices = usb.find_by_vid_and_pid(lightvid, lightpid); assert.ok((thelight_devices.length >= 1)); console.log("total lights found: " + thelight_devices.length); // light var thelight = thelight_devices[0]; var thelightinterfaces = thelight.getinterfaces(); assert.ok((thelightinterfaces.length >= 1)); console.log("the light contains interfaces: " + thelightinterfaces.length);

coffeescript - Curly Braces when Extending Node.js Class -

why wrap our variables in curly braces, {eventemitter} = require 'events' , when extending node.js class? for example, trevor burnham, in tutorial on event-driven coffeescript, extends node's eventemitter way: {eventemitter} = require 'events' class rooster extends eventemitter constructor: -> @on 'wake', -> console.log 'cockadoodledoo!' (foghorn = new rooster).emit 'wake' # cockadoodledoo! this: {eventemitter} = require 'events' is equivalent javascript: var eventemitter; eventemitter = require('events').eventemitter; when require 'events' , you're getting object module's exports, 1 of exports eventemitter "class". using {eventemitter} idiomatic shortcut pulling eventemitter out of object require 'events' returns; this: eventemitter = require('events').eventemitter if prefer. braced version starts come in handy when want extract more 1 p

objective c - How to make a keyboard Shortcut <Command + S> to save from multiple windows -

ok, having project having many xib's , each xib contains many nswindows. i need use keyboard shortcut save each of window. do need create muliple mainmenu nsmenuitems each of xib. problem there how single cmd+s know window in focus , how method invoked. no need not make multiple nsmenuitems. the 1 coming mainmenu.xib serves purpose. make ibaction of file->save menu , use : - (ibaction)savemenu:(id)sender { nswindow *currentwindow=[nsapp keywindow]; nslog(@"this key window : %@", currentwindow.title); } this give active window. in each of controllers, need override - (void)savedocument:(id)sender; and bind using ib.

html - Unable to form the foooter -

i'm new in coding. watching tutorial , though copied code (i think) background color not applied on footer , paddings not working. @charset "utf-8"; /* css document */ body { margin:0; font-family:georgia, "times new roman", times, serif; } .wrapper { width: 960px; margin: 0 auto; } .clear { clear: both; } #phonebar { background-color:#343434; color: #b0b0b0; font-size:12px; padding: 8px 0; text-align:right; } header { background-color:#e6e6e6; padding: 18px 0; } h1 { font-weight: normal; color:#696969; font-size:34px; margin:0; float:left; } ul { margin:0 } nav { float:right; } li { list-style-type:none; float:left; margin-left: 25px; font-weight:bold; font-size: 14px; color:#5a5a5a; margin-top:12px; } #important { padding: 40px 0; } #left { float:left; width: 510px; } #left h1 {

android how do i crete folder and show on screen -

Image
i'd create gallery folder in internal memory in screenshot below: when click on album, want show list of images inside it. string dirpath = getfilesdir().getabsolutepath() + file.separator + "newfoldername"; file projdir = new file(dirpath); for creating folder app here code below takes string name of folder , checks if sd card available , if creates folder of name in pictures folder else if sd card not present creates folder same name in internal memory app installed data/data.com.myapp/files/yourfolder public file createdirectoryforapp(context con, string dirname) { file directory=null; /* * sections checks phone see if there sd card. if * there sd card, directory created on sd card */ if (isexternalstoragewritable()) { // search directory on sd card directory = new file(environment.getexternalstoragepublicdirectory(environment.directory_pictures) + "/"+dirname+"/");

ruby - Misunderstanding about Object#tap -

here simple test code: def test_function 0.tap |v| v += 10 end end p test_function why 0 here ? waiting 10. update: class testclass def initialize @v = 0 end def inc @v = @v + 1 end end def test_function 0.tap |v| v += 10 end end def test_function_2 testclass.new.tap { |obj| obj.inc } end p test_function p test_function_2 0 testclass:0x29244f0 @v=1 the reason original object not changed += operator. happens create reference in block, change reference point other object, larger 10 , return. value of 0 stays same. and thing -- want happen. += operator not change object operates on. returns another different object , assigns reference it. like: v = 0 v = v + 10 you wouldn't expect 0 == 10 true after this, right?

ios - Difference between two identical NSTimeInterval is different than zero -

edit : this not strictly floating point question nstimeinterval derived double. added floating point tags related. problem: when computing difference between 2 identical nstimeinterval value different zero (-0.0000013etc..). question: why that? understanding double values behaviour should consistent (if float type different). swift code: let timedifference : nstimeinterval = timevalue.timeintervalsince1970 - timestarted!.timeintervalsince1970

logging - How do you get a git log output from a shelljs.exec command? -

i need put git log file. command line works fine git log command line result but if call command grunt task using shelljs.exec, dont output git log grunt task using shelljs.exec here grunt code : /*global module:false,require,console*/ 'use strict'; var shell = require('shelljs'); module.exports = function (grunt) { // project configuration. grunt.initconfig({ // task configuration. }); grunt.task.registertask('git-log', 'git log output', function () { console.log('result : ', shell.exec('git log head...head^ --oneline',{silent : true}).output); }); // default task. grunt.registertask('default', ['git-log']); }; i checked shelljs docs , tried different ways (including async) no success... any idea ? thx try use .stdout instead of .output . in code: shell.exec( 'git log head...head^ --oneline', {silent : true} ).output; change t

sublime text 2 php build - php installed - system unable to find file -

been struggling weeks , read can find on no solution. have php version 5.6.17 installed verified accessing basic php file browser/localhost. below error message receive when testing basic php script running in sublime text php build setup. [error 2] system cannot find file specified [cmd: [u'c:/php/php5.6.17/php.exe', u'c:\users\james\documents\responsive riven web\contact.php']] [dir: c:\users\james\documents\responsive riven web] [path: c:\program files (x86)\intel\icls client\;c:\program files\intel\icls client\;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\syste m32\windowspowershell\v1.0\;c:\program files\intel\intel(r) management engine components\dal;c:\program files\intel\intel(r) management engine components\ipt;c:\program files (x86)\intel\intel(r) management engine components\dal;c:\program files (x86)\intel\intel(r) management engine components\ipt;c:\program files (x86)\intel\opencl sdk\2.0\bin\x86;c:

r - Visualization of risk table with 4 dimensions -

Image
i have data set consisting of customers, distributed distinct , complete countries , customer levels. each country/level combination has size , risk attribute. risk attribute indicates how big problem is, size attribute how large associated population is. example data (r): http://www.r-fiddle.org/#/fiddle?id=kvmctmz8&version=12 how visualize data in order show 4 dimensions (conceptually, not coding-wise)? my initial idea create 2-dimensional table/lattice (country x level), size bubbles , risk color scale, i'm worried effectiveness of bubble plots. edit: code link correction i keep answer separate should data - depends on trends within data , message trying convey. using ggplot2 , ways can summarize data geom_point object captured aes() argument. these are: x y alpha colour fill shape size stroke this gives potential 8 dimensions can graph data on. few of these, color , fill, can use in combination right shape (pch = 21 - 25, see here ).

javascript - Angular: applying filters to a ng-repeat -

i'm trying apply filter array, changes in js, changes in html (due two-way-binding). controller i'm using: app.controller('controlador1', ["filterfilter", "$scope", function(filterfilter, $scope) { this.array = [ {name: 'tobias'}, {name: 'jeff'}, {name: 'brian'}, {name: 'igor'}, {name: 'james'}, {name: 'brad'} ]; var active = false; $scope.applyfilter = function(){ if(!active){ $scope.arrayfiltrado = filterfilter(this.array, "a"); active = true; }else{ $scope.arrayfiltrado = this.array; active = false; } } $scope.arrayfiltrado = this.array; }]); also, html template: <!doctype html> <html ng-app="miapp"> <head> <meta charset="utf-8"> <script src="angular.js"></script> <script src="mainmodule.js"></script>

java - Unable to parse xml with different vale of name in android -

my xml code this:- <mmp> <script id="tinyhippos-injected"/> <merchant> <response> <url>https://www.google.com</url> <param name="ttype">nbfundtransfer</param> <param name="temptxnid">650398</param> <param name="token">7ohxxw7ndm0ft%2b02bkgihb0n0ekameia2oeajwtjis</param> <param name="txnstage">1</param> </response> </merchant> </mmp> here want value of token , txnstage and android code :- try { url url = new url(url1); documentbuilderfactory dbf = documentbuilderfactory .newinstance(); documentbuilder db = dbf.newdocumentbuilder(); // download xml file doc = db.parse(new inputsource(url.openstream())); doc.getdocumentelement().normalize();

c# - Operator >= cannot be applied to operands of type string and datetime -

the user enters 2 parameters in url start date , end date , entered in format yyyymmddhhmm string. i'm attempting take these strings , turn them dates can query database. [responsetype(typeof(detail))] public ihttpactionresult getdetail(string startdate, string enddate) { datetime startdatetime; datetime enddatetime; startdatetime = new datetime(); enddatetime = new datetime(); startdatetime = datetime.parseexact(startdate, "yyyymmddhhmm", null); enddatetime = datetime.parseexact(enddate, "yyyymmddhhmm", null); var detail = in db.details (a.calldate >= startdatetime && a.calldate <= enddatetime) select a; var response = new detailresponse() { status = true, calls = detail }; return ok(response); } however error >= can't used in datetime , strings. edit: sake of 1 of answer i'm including model class i'm using display data. detailresponse.cs public class detailresponse { publi

asp.net mvc - MVC ajax form submission returns default date of DateTime property -

Image
i using below ajax form select , post date ranges. view model: public class viewformsubmissionsvm { public string formname { get; set; } public guid formid { get; set; } [display(name="from:")] public datetime { get; set; } [display(name = "to:")] public datetime { get; set; } } razor/html: @model viewformsubmissionsvm @using (ajax.beginform("viewformsubmissions", "form", new ajaxoptions { httpmethod = "post", onsuccess = "ongetsubmissionsuccess", onfailure = "ongetsubmissionerror" }, new { @class = "form-horizontal" })) { @html.antiforgerytoken() @html.hiddenfor(x => x.formid) <div class="row col-md-12"> <div class="pull-right"> <label class="control-label col-md-3">@html.displaynamefor(x => x.from)</label>

SharePoint Business Data Web Part custom -

i'm working on sharepoint website linked sql server database. on 1 page, 1st part business data filter sends information 2nd part, business data item, , 3rd part, business data related list. you can see page here any idea how can add "edit candidate" link in business data item web part? , "add result" link in business data related list? i cannot figure out. i'm quite new sharepoint. help. business data item webpart supports xsl file, if want add link in webparts can use xslt file (in other terms, display templates) , customize user interface including edit candidate , add result link . for more details business data item webpart, can visit link: http://www.c-sharpcorner.com/uploadfile/anavijai/business-data-item-web-part-in-sharepoint-2010/ hope you!

c++ - OpenCV face deteciton returns too many faces -

i have little problem. trying make face detection via kinect v1.i data kinect , convert opencv mat. trying detect faces in image function return face.size() = cca 250000000. know problem ? void getkinectdata(glubyte* dest) { nui_image_frame imageframe; //structure of frame ( number,res etc ) nui_locked_rect lockedrect; //pointer actual data if (sensor->nuiimagestreamgetnextframe(rgbstream, 0, &imageframe) < 0) return; inuiframetexture* texture = imageframe.pframetexture; // manages frame data texture->lockrect(0, &lockedrect, null, 0); iplimage* image = cvcreateimageheader(cvsize(color_width, color_hight), ipl_depth_8u, 4); if (lockedrect.pitch != 0) // pitch - how many bytes in each row of frame { byte* curr = (byte*)lockedrect.pbits; cvsetdata(image, curr, lockedrect.pitch); const byte* dataend = curr + (widthx*heightx) * 4; while (curr < dataend) { *dest++ = *curr++; } }

qt - Temporarily block signals between two QObjects -

i generically , temporarily block signals between 2 qobjects without modifying other signals/slots behavior, , without knowing contexts. something qobject::blocksignals(bool) , acting between 2 qobjects . that is, implementing following signalblocker::blocksignals(bool) function: class signalblocker { public: signalblocker(qobject *sender, qobject *receiver) : msender(sender), mreceiver(receiver) {} void blocksignals(bool block); private: qobject *msender, *mreceiver; } it possible disconneting , re-connecting objects, first list of signals/slots have stored. introspection methods don't seem powerful enough achieve (i looked @ qmetaobject , qsignalspy without success). qt have no capabilities disable signal-slot pair only. try workaround: struct signaldisabler { signaldisabler(const qobject *sender, const char *signal, const qobject *receiver, const char *member) : sender(sender) , signal(signal) , receiver(receiver

scala - How to add 'testListener' to custom test reporter in SBT -

i'm having difficulty implementing custom test reporter in scala using sbt . i have basic sbt project set build.sbt file: name := "test framework" version := "0.1" scalaversion := "2.11.7" scalacoptions += "-deprecation" scalacoptions += "-feature" librarydependencies += "org.scalatest" % "scalatest_2.11" % "2.2.4" % "test" librarydependencies += "org.scalacheck" %% "scalacheck" % "1.12.4" % "test" testframeworks += new testframework("custom.framework.mytest") testlisteners += new mytest() my mytest.scala class located in projects folder under projects/custom/framework/mytest.scala , looks this: import sbt.testslistener._ import sbt.testreportlistener._ class mytest extends testreportlistener { def doinit(): unit = { println("starting test") } def testevent(event: testevent): unit = {

json - Remove item in list of dictionaries if value is empty, "null" or None in Python -

i have json object contains sorts of unnecessary values "null" , "" , none . i'd remove whole object if contains such value. >>> json.dumps(event, indent=4) "event" = { "status": "completed", "datavalues": [ { "key": "wiidcsq5pdq", "value": "25" }, { "key": "rsz4gqzwpwu", "value": "null" }, { "key": "l7ao70bcrbp", "value": "" }, { "key": "gy6pxrwdthm", "value": "null" }, { "key": "x1708y0c4c7", "value": false } ] } my failed attempts: no_values = ["null", "", none] # no changes/deletions: [elem elem in event['datavalues'] if elem['value'] not in no_