Posts

ruby on rails - Cassandra cql comparator type counter -

ruby on rails - Cassandra cql comparator type counter - i want utilize next code updating field... @@db.execute("update user_count set counters = counters + #{val} cid = 1 ") first time tried got next fail: cassandracql::error::invalidrequestexception: invalid operation non commutative columnfamily user_count found out have utilize comparator counter, cant find how can setup cassandra-cql gem... know how can work? below there code not work ... @@db.execute("create columnfamily user_count(cid varchar primary key, counters counter) comparator = counter " ) @@db.execute("insert user_count (cid, counters) values (?,?)", 1, 0) you need set default_validation=countercolumntype instead of comparator. @@db.execute("create columnfamily user_count(cid varchar primary key, counters counter) default_validation=countercolumntype") @@db.execute("update user_count set counters = counters + 1 cid = 1") you must utilize ...

php - Selenium/PHPUnit: End a session when re-using browser sessions? -

php - Selenium/PHPUnit: End a session when re-using browser sessions? - i'm runnig selenium tests phpunit. i have long test sequences split several test files create them easier maintain. higher speed re-use browser session these cases. i able reuse sessions (phpunit_extensions_seleniumtestcase::sharesession(true)), cannot figure out how end session , open new 1 before starting next tests (which require fresh browser session). i have tried using next line in teardown() method of test kill current browser session $this->stop(); this kills browser, generates error: "session xxxxxx not exist or ended" => exactly, how selenium start new session in case? thanks clues. when create few tests method in test class (test file), i don't use $this->stop(); in teardown() method. noticed @ end of each test, browser closes itself. set browser , browser url in setup() method , open in every test method using $this->open('/'); ...

ms access - How to find count of multiple records with different where conditions from same table -

ms access - How to find count of multiple records with different where conditions from same table - i have table such this id | cid |lightness | darkness | color ------|-------|-------------|--------------|--------- 1 | 5 |10 | 20 | greenish 2 | 5 |10 | 08 | greenish 3 | 5 |10 | 10 | greenish 4 | 5 |20 | 05 | greenish 5 | 8 |10 | 20 | reddish 6 | 8 |10 | 16 | reddish 7 | 8 |33 | 20 | reddish 8 | 5 |10 | 10 | greenish i want find out following: count of records color has lightness 10 count of records color has darkness 20 so output should be color | lightness | darkness | total ---------|-------------|------------|--------- greenish | 4 | 1 | 5 reddish | 2 | 2 | 4 total |...

javascript - Have element change select form value -

javascript - Have element change select form value - how can link actions of click function select form jquery. for exmaple if image 1 clicked. how can allow form know image 1 clicked changing 'selected' alternative in form. <a href="#" rel="green">green</a> <select> <option value="green">green</option> </select> when "green" clicked "selected" alternative added selection i know i've seen done before. cannot find anywhere. thanks, robert $('a').click(function() { $('select').val($(this).attr('rel')); }); demo: http://jsfiddle.net/mz7ns/ javascript jquery

javascript - Calling onclick with local variable -

javascript - Calling onclick with local variable - first, apologies asking must answered here somewhere (i've been looking!) i want this: var i; (i = 0; < 5; i++) { ... // add together anchor dom ... a.onclick = goog.bind(this.dosomething, this); ... } namespace.clazz.prototype.dosomething = function(event, index) { console.log('index: ' + index); } i want 5 anchors each pass different value i dosomething when clicked (along click event). want maintain context of this in dosomething (hence bind). if can reverse order arguments received, should able this... a.onclick = goog.bind(this.dosomething, this, i); so dosomething should this... namespace.clazz.prototype.dosomething = function(index, event) { console.log('index: ' + index); }; at to the lowest degree that's how looks the google closure library source. javascript google-closure

windows - Recursive Unzipping with 7z.exe -

windows - Recursive Unzipping with 7z.exe - i stumbled across below line means of extracting every .zip file in every subfolder. for /f "usebackq" %a in (`dir /s /b *.zip`) 7z.exe e %a i've tried on winxp cmd.exe prompt , error: "a unexpected @ time." can please tell me whats wrong above line. 7z.exe error or there wrong batch script syntax. did cutting , paste .bat file. cheers try alter %a %%a: for /f "usebackq" %%a in (`dir /s /b *.zip`) 7z.exe e %%a windows batch-file unzip 7zip

ruby - Rails SelectTag include_blank not working -

ruby - Rails SelectTag include_blank not working - i using select_tag , populating database using this. <%= select_tag 'project', options_from_collection_for_select(@issue_statuses,"id", "name"), :include_blank => 'select' , html_options = { :onblur => "myblur(this);", :onchange=> "submit_selected(this);", :style=> "visibility:visible;" } %> but on including ":include_blank" getting next error: compile error /home/hitesh/redmine-1.3.0-1/apps/redmine/vendor/plugins/redmine_polls/app/views/questions/index.html.erb:42: syntax error, unexpected ')', expecting tassoc ...le=> "visibility:visible;" } ).to_s); @output_buffer.concat ... ^ how include blank or prompt value in above code. thnx. enclose :include_blank phone call within this: {} <%= select_tag 'project', options_from_collection_for_select([],"id...