Posts

Showing posts from May, 2015

c# - Comma escape in stringbuilder -

here's simple issue i'm running into, knowledge limited. have program turns existing database csv; however, many of fields contain commas , need them escape. i've tried couple of things no avail (under objecttocsvdata), included snippet appreciated. using system; using system.collections.generic; using system.linq; using system.text; using system.collections; using system.reflection; namespace ofasort { public static class utility { public static string collectiontocsv(ilist collection) { stringbuilder sb = new stringbuilder(); (int index = 0; index < collection.count; index++) { object item = collection[index]; if (index == 0) { sb.append(objecttocsvheader(item)); } sb.append(objecttocsvdata(item)); sb.append(environment.newline); } return sb.tostring(); } public static string objecttocsvdata(object obj) {

dax - Count Unique Occurrences PowerPivot -

i new powerpivot , dax formulas. assume trying basic , has been answered somewhere, don't know search on find it. i trying determine percent of sales people had sale in given quarters. have 2 tables, 1 lists sales people , 1 list sales quarter. example employee id 123 456 789 sales id - emp id - amount 135645 ---- 123 ----- $50 876531 ---- 123 ----- $127 258546 ---- 123 ----- $37 516589 ---- 789 ----- $128 998513 ---- 789 ----- $79 as result, pivot table this: emp id - % w/ sales 123 -------- 100% 456 -------- 0% 789 -------- 100% total ------- 66% if can point me post has been addressed or let me know best way address appreciate it. thank you. here's simple way of doing (assuming table names emps , sales ): =if (distinctcount ( sales[emp id] ) = blank (), 0, distinctcount ( sales[emp id] ) ) / countrows ( emps ) the if() required ensure people haven't made sale appear in pivot. actual formula doing dividing number of s

python - Dynamic nested dictionaries -

just begin know there couple similarly-titled questions on here, none explained quite way nor problem scope same. i want add nested dictionary entries dynamically. the use case thus: have python script monitoring network. dictionary created each observed ip protocol (tcp, udp, icmp) observed. sub-dictionary created key destination port (if 1 exists) each of these ip protocols (80, 443, etc.) (note doesn't matter whether sees server port source or destination, servers destination picked http , https examples). each of these destination ports key created corresponding server ip (e.g., ip www.google.com). , dictionary timestamp session first observed key , data/value key being client's ip. however, want need populated time goes on since won't have data before execution nor @ initialization. the output akin to: { 'icmp' : { 'echo-request' : { '<ip_of_www.google.com>' : { '<timestamp>' : <some

linux - IPv6 vs IPv4 connectivity load -

one of our applications uses cross-platform tcp connectivity layer. layer has connectivity stress-test. test launches 20 client threads , 20 server threads; each client connect/small-data-exchange/close several randomly chosen server threads. the test done 4 connectivity variants (ipv4 ipv4, ipv6 ipv6, ipv4 dual-mode, , ipv6 dual-mode). passes on everywhere except on one particular 64-bit linux machine 4 machines of running redhat 2.6.18-8.el5. ipv4 connectivity (both ipv4 , dual-mode) passes on this machine these machines, ipv6 can handle tenth of should able to. gets timeout errors, few connection-reset errors. cpu, memory, descriptors, etc. not issue. i've reviewed network settings on machine, nothing seems have been messed with. using localhost vs host name changes nothing. (in particular, i'm ruling out faulty network card, fails on loop-back.) netstat shows nothing unusual. (a lot of sockets in time_wait, that's expected given nature of test.) i'd

How can I access a character in the middle of a line in c++? -

i working on project consists of reading input file called input.txt has infinite number of lines. each line has roman numeral, space, plus or minus, space, , roman numeral. supposed add 2 numbers , write answer file called output.txt. however, can't think of way access operator. here sample input file: xv + vii xii + viii can give me idea of how can access plus sign each line of code? if you're reading file standard input, can whitespace delimited tokens using extraction operator. #include <string> #include <iostream> int main(int argc, char *argv[]) { std::string token; while (std::cin >> token) { // parse tokens here ... // example, i'll print out stream of tokens. std::cout << token << std::endl; } } if you'd assume have 3 tokens per line, can this: #include <string> #include <iostream> int main(int argc, char *argv[]) { std::string first, middle, last; while

replace - Trying to remove all spaces, tabs, carriage returns using VBScript -

i trying assign results of command below variable. goal obtain pid number. service_name: msftpsvc type : 10 win32_own_process state : 3 stop_pending (stoppable, not_pausable, accepts_shutdown) win32_exit_code : 0 (0x0) service_exit_code : 0 (0x0) checkpoint : 0x0 wait_hint : 0x0 pid : 7888 flags : if have better idea let me know. trying remove spaces, tabs, carriage returns, etc... search "pid:" string , "flags" , copy pid number. i haven't been able remove spaces , have in 1 single string. here code: dim wshshell set wshshell = wscript.createobject("wscript.shell") dim commandtorun, scriptstdout, scriptstderr, exitcode dim results commandtorun = "sc.exe queryex msftpsvc" exitcode = execscript(commandtorun) results = replace(scriptstdout, vbcrlf, "

sql - MySQL proportionate subset of returned rows -

i have query so select t.trial, count(*), max(d.value) data d inner join trial_info t on d.instance_timestamp between t.trial_start_timestamp , t.trial_end_timestamp group t.trial; which returns t.trial | count(*) | max(d.value) --------------------------------- 1 | 80 | 176 2 | 63 | 219 3 | 49 | 109 4 | 67 | 155 one row of d represents 1 second, condensing on t.trial means count(*) return number of seconds in each trial, , max(d.value) largest value observed in seconds. question : how can whittle results return middle 50% of each trial and max value in time ? want throw out first 25% of trial time last 25%. subquery skills aren't hot... here idea far. substituting join works when computedvalue set static number. want computedvalue percentage of rows returned (displayed in count(*) result column above). inner join trial_info t on d.instance_timestamp between date_add(t.trial_start_timestam

javascript - Issues setting DTM Data Element by either returning value or setting data element directly -

not sure why can't update data element in dtm. i'm trying add listener , update "custom link name" whenever element html5 custom attribute exists , clicked. haven't had luck , don't know i'm doing wrong? function addevent(el, ev, fn, uc) { if (el.addeventlistener) { el.addeventlistener(ev, fn, uc); } else if (el.attachevent) { // ie8- el.attachevent('on'+ev, fn); } } addevent(document, 'click', function(e) { e = e || window.event; var target = e.target || e.srcelement; var customlinkname = target.getattribute("data-analytics-tracking-name"); if(customlinkname){ //return customlinkname; _satellite.setvar("custom link name", customlinkname); } }, false); when ever check value of data element default value set in ui. idea how make data element update every time qualifying element clicked? code runs custom script data element in dtm, not being run event.

ruby on rails - Using associations with pluck -

im trying array project name , task title. task title in projects model. should use pluck or select or where? @completed_tasks = task.where(completed:true).select("projects.project_name", :title) first of all, should use join data projects table. , can use either pluck or select . for example (suppose in task model have belongs_to :project ) @completed_tasks = task.where(completed:true).join(:project).select("projects.project_name", :title)

java - Computer shut off while running eclipse -

my computer shut off while running eclipse due power failure. after restarted it, can no longer start eclipse. running eclipse luna , log message getting this: !session 2014-12-01 18:58:51.825 ----------------------------------------------- eclipse.buildid=unknown java.version=1.7.0_67 java.vendor=oracle corporation bootloader constants: os=win32, arch=x86_64, ws=win32, nl=en_ca framework arguments: -product org.eclipse.epp.package.java.product command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product !entry org.eclipse.osgi 4 0 2014-12-01 18:58:52.410 !message application error !stack 1 java.lang.illegalstateexception: unable acquire application service. ensure org.eclipse.core.runtime bundle resolved , started (see config.ini). @ org.eclipse.core.runtime.internal.adaptor.eclipseapplauncher.start(eclipseapplauncher.java:78) @ org.eclipse.core.runtime.adaptor.eclipsestarter.run(eclipsestarter.java:382) @ org.eclipse.core

python - What' the meaning of the brackets in the class? -

in python, when read others' code, meet situation class defined , after there pair of brackets. class astarfoodsearchagent(searchagent): def __init__(): #.... i don't know meaning of '(searchagent)',because meet , use doesn't seem that. it indicates astarfoodsearchagent subclass of searchagent . it's part of concept called inheritance . what inheritance? here's example. might have car class, , racecar class. when implementing racecar class, may find has lot of behavior similar, or same, car . in case, you'd make racecar subclass of car`. class car(object): #car subclass of python's base objeect. reasons this, , reasons why #see classes without (object) or other class between brackets beyond scope #of answer. def get_number_of_wheels(self): return 4 def get_engine(self): return carengine(fuel=30) class racecar(car): #racecar subclass of car def get_engine(self):

java - Cannot set header. Response already committed - httpClient.execute error -

i getting error subject when evoking httpclient.execute call rest web service. read 2 interesting thread have thing similiar case. both thread believe increasing buffer in websphere 8 liberty profile might me see better description of problem don't know increase in 8.5 liberty profile (there isn't admin console). don't know if relevant placed (1) threads used guide me, important instruction have in (2) applicationcontext.xml, (3) mvc-dispatcher-servlet.xml, (4) client rest web service , (5) pom.xml. iguess there thing wrong libraries because such project working before converted maven project. can tell me if missing instraction in pom? 1) websphere response buffering cannot set header in jsp. response committed 2) applicationcontext.xml ... 3) mvc-dispatcher-servlet.xml /web-inf/pages/

cocoa - Fullscreen animation effects with CoreAnimation? -

i'm trying perform fullscreen animation effects moving/scaling windows , effects how files "jump" download folder in safari. my first attempt make windows nsimageview content view , use coreanimation move window around screen. failed terribly because coreanimation apparently slow @ animating windows way (nsviewanimation failed). surprisingly not writing on over web either suggesting no 1 or aren't having performance problems. the other thoughts have left making fullscreen transparent window , animating nsviews inside window (using coreanimation) or doing fullscreen transparent opengl context sprites. what other options or there way make ca animate windows fluidly? should easy coreanimation i'm confused. guys! i gave on months until found link example: http://www.cimgf.com/2008/03/15/core-animation-tutorial-dashboard-effect/ the basic solution works best use fullscreen transparent window , calayers exclusively (without shadows if possible) ,

c# - Trying to use async method TextReader.ReadBlockAsync, but getting "the 'await' operator can only be used within an async method" -

this question has answer here: issue regarding asynchronous programming async , await c# [duplicate] 2 answers i want call asynchronous reader method of textreader , compile error: var buffer = new char[10]; textreader reader = new streamreader(@"d:\temp\abc.txt"); // following statement compile error var readcount = await reader.readblockasync(buffer, 0, buffer.length); this error: the 'await' operator can used within async method. consider marking method 'async' modifier , changing return type 'task'. what right way use readblockasync ? you need mark method async identifier mentioned others. method needs return task , task<t> or void . void returning async methods reserved async event handlers. in case you'd want return task<string> public async task<string> readasync() { v

php - How to make Frontend_controller in codeigniter? -

i want create frontend_controller extend my_controller , extend ci_controller below code in configure created __autoload function calling class name , file function __autoload($classname) { if (strpos($classname, 'ci_') !== 0) { $file = apppath . 'libraries/' . $classname . '.php'; if (file_exists($file)) { @include_once($file); } } } here wellcome pages class welcome extends frontend_controler { public function __construct(){ parent::__construct(); } public function index() { $this->load->view('welcome_message'); } } this frontend_controller <?php class frontend_controler extends my_controler{ public function __construct(){ parent::__construct(); } } ?> this my_controller <?php class my_controler extends ci_controller{ public function __construct(){ parent::__construct(); } } and create .htaccess

github - undoing several commits to just one in git -

i made contribution open source project on github , received, didn't conform commit message standards asked so, , instead of doing 1 change per commit, should make 1 commit changes proposed in it. so, how can undo previous commits , 1 changes in it? you can use git interactive rebase "squash" commits one. # squash 2 commits git rebase -i head~2 or # squash specific commit identified it's sha1 git rebase -i a3ea79f if have commit history this:- git log --oneline --decorate * d6f7bbd (head, master) added test2 * 35dde7a added test1 * a3ea79f initial commit rebasing either of rebase commands above open editor. , modifying "pick" lines adjust commits:- pick 35dde7a added test1 pick d6f7bbd added test2 # rebase a3ea79f..d6f7bbd onto a3ea79f # # commands: # p, pick = use commit # r, reword = use commit, edit commit message # e, edit = use commit, stop amending # s, squash = use commit, meld previous commit # f, fixup = "squ

Facebook share show image in popup, but not in timeline -

i know there lot questions simillar mine. non of them helped me. site on opencart, when press share button, popup come image. image disapear after been shared on facebook, leave blank square. put following meta og tags in head: <meta property="og:title" content="i love bombshell bums"> <meta property="og:type" content="website"> <meta property="og:url" content="http://http://www.bombshellbums.com/i-love-bombshell-bums-shirt"> <meta property="og:image" content="http://www.bombshellbums.com/image/cache/data/i_love_bombshell_colours-630x630.jpg"> <meta property="og:site_name" content="bombshell bums"/> <meta property="fb:app_id" content="669535109829867"/> <meta property="og:description" content="this styled shirt spin off traditional &quot;i heart ny&quot; t-shirts. &quot;i love bombshell bums&q

scheme - Multiply two lists in Racket -

i using racket multiply list same length. far have tried: (define (multiply-list b) (if ([(empty? a) (empty)]) else (cons(*car(a)car(b))) cdr(a) cdr(b))) i having trouble understanding syntax of racket. want update list it's cdr . cannot right a , b lists. i believe aiming this: (define (multiply-list b) (if (empty? a) empty (cons (* (car a) (car b)) (multiply-list (cdr a) (cdr b))))) explanation: in scheme, have very, careful put pair of () . in code, parentheses unnecessary , others misplaced. ide put them in right place for instance, pair of [] surrounding condition wrong, , this: (empty) because empty not function, surround () when want call function and don't call function this: car(a) . correct way is: (car a) when use if , alternative part of expression must not preceded else , maybe you're confusing if expression cond expression. and last not least: don't forget call re

html - Setting widths of elements in percentages for responsiveness -

if set container ( div ) containing 4 items 100% , make elements ( li ) 25% no margins or paddings on of elements, shouldn't each of elements fit on 1 line in container? why not , why last 1 run onto next line? html ( jsfiddle ) <div> <ul> <li><img src="http://static.comicvine.com/uploads/original/2/29462/582674-kenny.png" /></li> <li><img src="http://static.comicvine.com/uploads/original/2/29462/582674-kenny.png" /></li> <li><img src="http://static.comicvine.com/uploads/original/2/29462/582674-kenny.png" /></li> <li><img src="http://static.comicvine.com/uploads/original/2/29462/582674-kenny.png" /></li> </ul> </div> css * { margin: 0; padding: 0; } div { width: 100%; } li { display: inline-block; list-style: none; width: 25%; } img { width: 100px; } l

android - Why Thread.sleep() from Service is not working? -

my code : callreader.speak("incoming call " + contactname, texttospeech.queue_add, null); backnormalmode(); // try { // thread.sleep(5000); // } catch (interruptedexception e) { // // todo auto-generated catch block // e.printstacktrace(); // } callreader.speak("incoming call " + contactname, texttospeech.queue_add, null); // try { // thread.sleep(5000); // } catch (interruptedexception e) { // // todo auto-generated catch block //

cryptography - Error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1 -

i have these codes in java used encryption , decryption prince. these codes sbox , sbox inverse. whenever run program, , error message of: exception in thread "main" java.lang.arrayindexoutofboundsexception: -1 @ prince.sinv(prince.java:146) @ prince.encrypt(prince.java:485) @ prince_analysis_main.main(prince_analysis_main.java:21) i have implemented try , catch method referring http://mcnewton.org/blog/tag/exception-in-thread-main-java-lang-arrayindexoutofboundsexception-5/ not solve problem. can know if error message caused limited memory allocation or there error of implementation? public static long s(long x) { long[] sbox_8bits = new long[] { 0xbb, 0xbf, 0xb3, 0xb2, 0xba, 0xbc, 0xb9, 0xb1, 0xb6, 0xb7, 0xb8, 0xb0, 0xbe, 0xb5, 0xbd, 0xb4, 0xfb, 0xff, 0xf3, 0xf2, 0xfa, 0xfc, 0xf9, 0xf1, 0xf6, 0xf7, 0xf8, 0xf0, 0xfe, 0xf5, 0xfd, 0xf4, 0x3b, 0x3f, 0x33, 0x32, 0x3a, 0x3c, 0x39, 0

android - Why doesn't my app run on xlarge resolution of the GenyMotion emulator? -

i trying run app on genymotion emulator(custom tablet) has following specifications: 1536 x 1152 dimensions. 320dpi-i.e xhdpi. i have following resources: 1.drawable-sw720dp-land-xhdpi 2.layout-sw720dp-land 3.values-sw720dp-land-xhdpi i have following code in the mainifest file: <supports-screens android:largescreens="true" android:normalscreens="true" android:smallscreens="true" android:xlargescreens="true" /> i have designed app work on small xlarge screen resolutions. have customized emulator work on mdpi,hdpi screens of tablet, in case of xhdpi app doesn't take xhdpi resources. can tell me going on? by resolution can't actual size of device , sw720 10 inch tablet , sw600 7 inch tablet. so table in testing may 7 inch tablet use sw600. may

php - Add class in some tags via twig template? -

this question has answer here: add specific css-class symfony2 form 1 answer add class form tag i made form $form = $this->createformbuilder() ->add('name') ->add('tel') ->add('save','submit') ->getform(); in index.html.twig {{ form_start(form)}} {{ form_rest(form)}} {{ form_end(form)}} normally works well but want add class form tag this <form class=“niceform”> <button type="submit" class="btn btn-primary"> how can kind of things via formbuilder , twig template?? via doc: http://symfony.com/doc/current/reference/forms/twig_reference.html#form-widget-view-variables form_widget(view, variables) {# render widget, add "foo" class #} {{ form_widget(form.name, {'attr': {'class': 'foo'}}) }}

pluralize without count number in rails 4 -

i building blog app. i'd able pluralize word "article" if more 1 "post" "published." like so: available articles or available article this have.... available <%= pluralize @posts.published, "article" %>: i've tried available <%= pluralize @posts.published.count, "article" %>: and works...but don't want number. shouldn't read available 5 articles....it should have no number. i have been looking answer myself , wasn't satisfied of existing ones. here's tidiest solution found: available <%= "article".pluralize(@posts.published.count) %>: documentation here . relevant bits: returns plural form of word in string. if optional parameter count specified, singular form returned if count == 1. other value of count plural returned. 'post'.pluralize # => "posts" 'apple'.pluralize(1) # => "appl

selenium webdriver - Specflow for UI automation -

for our project, tdd approach followed developed team. ba's write user story in same format of example as : anonymous customer (acust) want : filter search results colour : can see products in colours like if ba's write user story in more generalized format, developers break user stories multiple stories. , our manual testers write test cases in given-when-then form given automation tester (us) automate. we automation testers sbi's having single test case associated it. now using specflow-selenium automate our test cases using pageobject pattern. , using mtm associate test scripts test cases , run them mtm. what should our approach above scenario, how should create our scenario , feature files in specflow? any information great. you should start happy scenario like: (you can used "scenario outline" instead of "regular scenario") feature: filter results page of "anonymous customer" in order anonymous customer

Actual Pipelining, not Batch Processing, in PHP+Redis -

there's lot of information on "pipelining" in php+redis on web. however, when start looking @ examples, not single 1 of them actual pipelining. batch processing. examples, let's take predis ->pipeline() ( https://github.com/nrk/predis ) , phpredis ->multi() ( https://github.com/nicolasff/phpredis ). suspend execution of commands , instead collect commands buffer, execute them batch when calling ->execute() / ->exec() later. disadvantages: - has allocate command buffer can grow large many commands - needs round-trip server once every batch of commands the behaviour expect pipelining mode is: start sending commands pass them client, not buffer them. return before response command has arrived. allow send more , more commands while previous ones "in flight". once in while, collect responses client have arrived, without waiting responses have not yet arrived. the strange thing examples pass constants client called "pipelining", yet

java - displaying a Prepopulated database as a listview -

this question has answer here: listview error: “your content must have listview id attribute 'android.r.id.list'” 1 answer i trying display multiple columns of database inside listview. using sqliteasset helper , row.xml , main.xml. mainactivity extends listactivity. error i'm getting findviewbyid can't find linear layout "r.id.list" activity_main.xml has it. this main class displays database info on list. public class mainactivity extends listactivity { private cursor schedule; private mydatabase db; listview listview; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); db = new mydatabase(this); schedule = db.getschedule(); listview listview = (listview) findviewbyid(android.r.id.list);

Remove tooltip of QAction when add it to QToolBar in Qt -

i added qaction on qtoolbar , can't remove tooltip button. i tried overide event , eventfilter using event->type == qt::tooltip didn't help. please me. why happens when add action on toolbar: it creates qtoolbutton calls qtoolbutton::setdefaultaction passing action argument. this method calls settooltip(action->tooltip()); action->tooltip() returns whether tooltip or if tooltip empty returns text . you'll have tooltip on button. what do using explanation above can think of lots of ways solve problem. for example, when qtoolbar created (and possibly shown) use toolbar->findchildren<qtoolbutton*> find buttons: foreach(qtoolbutton* button, toolbar->findchildren<qtoolbutton*>()) { button->settooltip(qstring()); } note: when change text of action, appropriate button recreate tooltip. can use event filter button process tooltip event. edit: added example : ui contains toolbar action. testwindow::

java - Automating Combo Box (drop down + checkbox) using Selenium -

i trying automate drop down in website naukri.com. drop down consists of multi select check-boxes. how can automate using selenium web driver? the structure of drop list is: <div class="ddwrap"> <ul class="ddsearch"> <li class="tagit" data-id="tg_indcja_a8_a"> <span class="tagtxt">accounting , finance</span> <span class="dcross"></span> </li> <li class="frst" style="float: left;"> <input id="cjaind" class="srchtxt" type="text" placeholder="" name="" autocomplete="off" style="width: 30px;"> <input id="hid_indcja" type="hidden" name="indtype" value="["8"]"> </li> </ul> </div> can me regarding this? check out code below, navigates concerned form, o

android - Dynamic Grid View as Array -

hey guys building app show data grid view , grid view may multiple depend on web service data using dynamic grid view objects array when initializing grid view objects.. showing me compile time error(null pointer exception) 1 have answer question. public class foodlevelpageone extends activity { private button home; private button back; private linearlayout linearlayout; private httpresponse httpresponse; ..... ... private arraylist<jsondata> al1[]; private gridview gv[]; .... .... .... protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate);` ... ... gv[i] = new gridview(getapplicationcontext()); you have not initialized , specified size of array. you should follow these steps: get size of response of webservice data, i.e. how many gridviews shown/filled. jsonarray arrayfromwebservice = new jsonarray(webserviceresponse); int size_of_grid = arrayfromwebservice.length; now, initialize grid array size_of_grid

how can detect a php file is still running on apache? -

i have php script unlimited while, must run 24/7 in php file, how can check file running on server or stopped? how can send signal apache stop , re-execute file? i'm going assign numbers files. file running 24/7 the first file , file change state of first 1 called the second file . now, first file can write file or in database, let's say, every 10 minutes. way know if it's running checking file , last date when wrote file. create second file or database table , write in state want first file be. example: active or disabled. read file/table first file, if it's disabled, stop executing script.

php - Function executing twice -

i've been charged migrating quite old site new server, means upgrading (late, know) php 5. most of went quite smoothly there's 1 error can't understand. the site used online language course , text in exercises shown twice. can see what's wrong function (which used retrieving text)? function getblankwithendformatedexercisetext($type, $highlightnr = 0) { $lastwhereendofline = true; foreach ($this->children $sentence) { if ($sentence->order == $highlightnr) { $returnstring .= "<span class=\"highlightedexercisesentence\">"; } $sentence->selectworddbinstances(); foreach ($sentence->words $word) { if ($lastwhereendofline) { if ($word->indent) { ($i=0; $i < $word->indent; $i++) { $returnstring .= "&nbsp;&nbsp;&nbsp;"; } }

ios - How to share video on flickr -

i m working ios app in needs share video/(or video link) on flickr . search lot didn't required . plz provide me code or clue doing . thanks in advance. check out: https://github.com/lukhnos/objectiveflickr all api documentation available on there

YCSB not able to load data into cassandra multinode -

i trying load data using ycsb tool cassandra multinode set up, using below command. ./ycsb load cassandra-10 -p ../workloads/workloadb -s but getting following output. put hosts parameter in workload server's ip address. p.s. able create multinode set-up , created db 'usertable' table 'data' 2014-12-02 02:55:25:013 0 sec: 0 operations; 2014-12-02 02:55:35:014 10 sec: 0 operations; 2014-12-02 02:55:45:015 20 sec: 0 operations; 2014-12-02 02:55:55:016 30 sec: 0 operations; 2014-12-02 02:56:05:017 40 sec: 0 operations; 2014-12-02 02:56:15:018 50 sec: 0 operations; 2014-12-02 02:56:25:019 60 sec: 0 operations; 2014-12-02 02:56:35:020 70 sec: 0 operations; 2014-12-02 02:56:45:020 80 sec: 0 operations; 2014-12-02 02:56:55:021 90 sec: 0 operations; 2014-12-02 02:57:05:023 100 sec: 0 operations; 2014-12-02 02:57:15:024 110 sec: 0 operations; 2014-12-02 02:57:25:024 120 sec: 0 operations; 2014-12-02 02:57:35:025 130 sec: 0 operations;

c# - WPF "Expand All" Control Load Time -

i have integrated feature in tool allows me expand recursively. realise slow process anyway currently. have maybe 100 nested controls expanded @ once, calling expand means each control/datatemplate etc processed @ once. this causes tool lock 10 seconds before responding. of course, once view hierarchy has been constructed, fast (i can collapse , expand instantly on). seems little odd there isn't faster way generate large forms, wouldn't consider 100-500~ controls many. i have looked virtualisation, doesn't appear useful me in case because controls expanded @ once. fine if expand them on singular basis. edit: updates we're needed question describe layout of window is: i have number of textboxes, comboboxes, sliders nested inside of number of expanders. each expander can contain n number of expanders, recursive extent. depending on how data laid out. of these data types (which represented datatemplates) may contain stackpanels if needed , numerous grids layo

swing - Java, drag and drop to change the order of panels -

Image
ok have set follows. have java 1.7 project uses javax.swing ui. first project outside of following tutorials, initiative tracker familiar table top. have class extends jpanel (and implements comparable<>) can add dynamically , story different data each class. the panels added layout, y position depending on how many panels there. added arraylist sort them in order. list can sorted 1 of properties of class. what running want manually able drag , drop them change order, both in layout , in arraylist. added note can't remove , re-add 1 because lose values saved in class. toward end made jbutton needs following: so long mouse pressed down on button, panel belongs needs dragged mouse. when mouse released needs check position , if necessary go spot. so example i have tried drop , drag tutorials can't seem find 1 can adjust want. edit1: tried. mouselistener listener = new dragmouseadapter(); dragbutton.addmouselistener(listener); dragbutton.settransferhand

html - <main> inside <article> in HTML5 -

plot: when building coupons website realize can content not unique page should used inside <main><article> ..here..</article></main> . problem: because w3schools state : the content inside element should unique document. should not contain content repeated across documents. but have content inside article. every time example a coupon can used entering code deal can activated going landing page. repeated in every 'coupon' post publish. tried use was. <main><article><main>unique content</main> <aside>a coupon can used entering code deal can activated going landing page</aside></article></main> but again : note: there must not more 1 <main> element in document. <main> element must not descendent of <article>, <aside>, <footer>, <header>, or <nav> element. so best way format un-unique content inside <main> and/or <article>

java - How to execute mvn command using IntelliJ IDEA? -

Image
i trying add oracle jdbc driver in local maven repo. have found this link so. i want same inside intellij idea. there way execute mvn commands intellij idea? there button in maven menu of intellij idea: also can use "terminal"

javascript - Angularjs unit testing with Karma -

having few issues testing directive - our application trying modular hence need module.exports exports angular module; module.exports = angular.module('project', []) .config(function ($stateprovider) { $stateprovider .state('alive', { url: '/college', templateurl: 'dashboard.html', controller: 'collegectrl', authenticate: true }); }) .factory('college', require('./services/college.service.js')) .controller('collegectrl', require('./dashboard/college.controller.js')) .directive('collegetile', require('./dashboard/tile/tile.directive.js')) .run(function ($rootscope, sidefactory) { sidefactory.push({ 'priority': 1, 'icon': 'fa-th-large' }); }); directive looks this; <div class="thu