Posts

Showing posts from May, 2011

html - Keep drop down list scrollbar a fixed height -

html - Keep drop down list scrollbar a fixed height - i have 3 drop downwards lists varying amounts of items in them. possible maintain scrollable height fixed? e.g if have 3 items in 1 list , 8 items in list, when click on either list drop downwards part stays same height. @ moment drop downwards area of list 8 items much larger obviously. <select id="picdd1" > <option value="0">new leaf green</option> <option value="1">air forcefulness blue</option> <option value="2">grecian purple</option> <option value="3">antique gold</option> <option value="4">deep coral red</option> <option value="5">yellow</option> <option value="6">pink</option> <option value="7">grey</option> <option value="8">white</o

wpf combobox event for 'item not found' -

wpf combobox event for 'item not found' - can know if text not compatible no iten in list <combobox iseditable="true" itemsource="..."/> there event or property determine if no item found textsearch you check selecteditem property on combobox , if null while changing, means there no match in list. here have little demo how work. xaml part: <window x:class="wpfapplication1.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <grid> <combobox itemssource="{binding itemssource, updatesourcetrigger=propertychanged}" iseditable="true" text="{binding typedtext, updatesourcetrigger=propertychanged}" height="36" verticalalignment=

linux - Loop through api call in bash script -

linux - Loop through api call in bash script - i have api returns 50 users. is there way of looping through api call expand=users%5b1%3a50%5d the 1 after b starting number , pull until 50 number after a i have script store responses text file how can loop through adding increments of 50? for example. having variable in place of numbers expand=users%5b$num1%3a$num2%5d expand=users%5b{1..50}%3a50%5d the {1..5} expand 1 2 3 4 5 for illustration $ echo abc{1..5}def abc1def abc2def abc3def abc4def abc5def now need loop on expand for api in $expand #do done linux bash shell

SQL Server running totals (sum over order by) -

SQL Server running totals (sum over order by) - i looking "running totals" sql server. easy query. wrote this: select firstname, lastname, thetot, sum(thetot) on (order lastname) runningtot customers you'd think accurate running total output. not true. here's spit out: firstname lastname thetot runningtot billy bobthornton 0.01 4.46 billy bobthornton 4.45 4.46 bob hope 3.52 7.98 jimmy johnson 4.84 12.82 jason meyers 3.50 16.32 ted turner 1.77 18.09 is me or should first record's running 0.01 ? the self reply provided drastically changes semantics. in question calculating running total ordered firstname, arbitrarily switching order pk brings resultset answers exclusively different question. the reason resultset seeing documented in books online if rows/range not specified order specified, range unbounded preceding , current row

php - Pass the variable in regular expression within heredoc (MYSQL) -

php - Pass the variable in regular expression within heredoc (MYSQL) - i got parse error. passed variable in regular look within heredoc mysql query expression? $sql = <<<sql select name, full_code m_category full_code regexp '^00'.$var.'[0-9][0-9][0-9]$' order full_code asc sql; originally code was $sql = " select name, full_code m_category full_code regexp '^00".$var."[0-9][0-9][0-9]$' order full_code asc"; $sql = <<<sql select name, full_code m_category full_code regexp '^00{$var}[0-9][0-9][0-9]$' order full_code asc sql; please, read heredoc: http://php.net/manual/ru/language.types.string.php#language.types.string.syntax.heredoc php mysql

c# - what is the common practice in organizing PageMethods for Ajax calls -

c# - what is the common practice in organizing PageMethods for Ajax calls - i have been using pagemethods in develping asp.net c# applications long time. i realized have phone call same method different pages, , re-create , paste same method pages. this creates redundancy problems, know. would fine create separate *aspx pages hosting related pagemethods. what mutual practice in this? i recommend switch ajax-enabled wcf service. requires bit more configuration 1 time working 1 service can copy/paste another. @ point add together proxy js page , utilize pretty much same way utilize pagemethods. of course of study there multiple other ways ajax ajax-enabled wcf services drop-in replacement page methods... almost. c# asp.net ajax pagemethods

Convert string of strings to string array in LabVIEW -

Convert string of strings to string array in LabVIEW - is there way convert string of strings string array in labview. eg. "test hello yeh ok" becomes [0] = test [1] = hello [2] = yeh [3] = ok i'm working memory here, bear me. utilize convert spreadsheet string vi in strings palette. set delimiter space. arrays string labview

Don't run rails server -

Don't run rails server - i want run server, console show me error. /usr/local/rvm/gems/ruby-2.1.3/gems/execjs-2.2.0/lib/execjs/runtimes.rb:51:in `autodetect': not find javascript runtime. see https://github.com/sstephenson/execjs list of available runtimes. (execjs::runtimeunavailable) /usr/local/rvm/gems/ruby-2.1.3/gems/execjs-2.2.0/lib/execjs.rb:5:in `<module:execjs>' how prepare issue? try set in gemfile: gem 'execjs' gem 'therubyracer' and after bundle install or bundle if still have problems, delete gemfile.lock , 1 time again bundle ruby-on-rails

android - Where is my launcher icon? -

android - Where is my launcher icon? - a quiet basic question: i'm developing app should run on fire tv. there anyway add together icon launcher? i know can go long way on settings start app, not handy. i'm confused how need create icon launcher standard launcher icon wrong, because amazon uses differnt icon sizes. found confusing informations launcher icons come amazon store only. true? if sideloading apk ( adb install or pushing development environment) on firetv won't see icon in launcher app, rightly point out see settings | applications | manage applications menu. the way have icon appear there either submit , publish it, or utilize live app testing if you're not ready submit , publish publicly want invite beta testers (you can multiple submissions through live app testing before going live) when submit app (either live app testing, or total submission) there alternative in developer portal upload various assets - icons, screenshots, descri

jquery - $('#MyForm').valid() always returning false -

jquery - $('#MyForm').valid() always returning false - i trying post form using ajax post in mvc razor. , trying validate form before posting database. though form valid, blocking form post. $(function () { $('#myform').submit(function () { if ($('#myform').valid()) { //$("#divloading").show(); $.ajax({ type: "post", url: '@url.action("something", "something")', data: $('#myform').serialize(), datatype: 'json', error: function (xhr) { $("#message").text(xhr.statustext); $('#divloading').hide('fast'); }, success: function (result) { //$('#divloading').hide('fast'); if (result.issuccess) { $("#message").html(result.message); $(

Android: How to extend video to full screen? -

Android: How to extend video to full screen? - i got videoview, plays in landscape. when rotating device want switch total screen. youtube does. in solution when going landscape start new activity in total screen mode , trying go on playing stopped. the problem takes long , there black screen moment. have suggestion how improve this? android video

c++ - Binding member function to a member variable -

c++ - Binding member function to a member variable - precondition: here function: typedef std::function<void (int)> handler; void g(const handler& h) { h(100); } , , class(original version): class { public: a(int arg) : m(arg) {} void f0(int n) { std::cout << m + n << std::endl; } void f() { ::g(std::bind(&a::f0, this, std::placeholders::_1)); } private: const int m; }; and print 2 lines, '101' , '102': int main() { a1(1); a1.f(); a2(2); a2.f(); homecoming 0; } now realized a::f() called frequently, modified this(new version): class { public: a(int arg) : m(arg), handler(std::bind(&a::f0, this, std::placeholders::_1)) {} void f0(int n) { std::cout << m + n << std::endl; } void f() { ::g(handler); } private: const int m; const handler handler; }; my questions: is safe bind this pointer fellow member variable? is

jquery - bootstrap responsive utilities -

jquery - bootstrap responsive utilities - i have code used create menus phone in header <?php if ($categories) { ?> <div class="container visible-phone"> <nav id="menu" class="navbar"> <div class="navbar-header"><span id="category" class="visible-xs"><?php echo $text_category; ?></span> <button type="button" class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"><i class="fa fa-bars"></i></button> </div> // , other tags creating menu </nav> </div> <?php } ?> and along want create vertical menu, desktop , little devices m hidding hidden-xs, creating through <div class="container" id="left-menu"> <nav id="menu" class="navbar-nav"> <ul class="nav s

Android - Having trouble with calling a service from an action button of a notification -

Android - Having trouble with calling a service from an action button of a notification - i want able have button copies text notification clipboard. notification sent through google's gcm service. the first time notification arrives when press "copy" button fine , text goes clipboard service button sends intent to. sec time notification arrives different text when press "copy" button content of first notification goes clipboard instead of new one. when debug code, seems intent that's calling service has new content, service puts clipboard runs parameters of old notification, if same session of service awaken old intent. any clue why happening? // called gcm notification handler private void sendnotification(string msg) { mnotificationmanager = (notificationmanager) this.getsystemservice(context.notification_service); pendingintent contentintent = pendingintent.getactivity(this, 0,new intent(this, mainactivity.class), 0);

javascript - Get value/id of activated input in an ASP MVC Ajax.BeginForm OnBegin method -

javascript - Get value/id of activated input in an ASP MVC Ajax.BeginForm OnBegin method - my asp mvc cshtml code using (ajax.beginform("action", "controller", new {para=123}, new ajaxoptions { httpmethod = "post", onbegin = "doonbegin", })) { <input type="submit" value="foo" id="foosubmit" /> <input type="submit" value="bar" id="barsubmit" /> } and javascript function doonbegin() { if(value of activated input element == "foo"){ // } else { // else } } is possible value of input element clicked , if is, how? $(this) element contains form seems can't selected input. either pure javascript or jquery solution fine javascript jquery asp.net ajax asp.net-mvc

reporting services - SSRS : New calculated field based on where condition -

reporting services - SSRS : New calculated field based on where condition - i'm new ssrs reporting , i'm need of help... i have dataset fields "process", "level" , "workweek" process level ww ------- ----- -- test lvl_0 3 test lvl_1 28 test lvl_2 48 samp lvl_0 10 samp lvl_1 39 samp lvl_2 51 what want create 2 more calculated fields called start_ww , pro_start has values ww field. ww of lvl_0 considered process_start. the logic process level ww start_ww pro_start ------- ----- -- -------- --------- test lvl_0 3 0 3 test lvl_1 28 3 3 test lvl_2 48 28 3 samp lvl_0 10 0 10 samp lvl_1 39 10 10 samp lvl_2 51 39 10 i know similar sql update table set start_ww=(select ww table level='lvl_0') level='lvl_1' update table set proc_start=(select ww table level='lvl_0') i'm not sure how write look

.net - Matching numbers with regular expressions — only digits and commas -

.net - Matching numbers with regular expressions — only digits and commas - i can't figure out how build regex illustration values: 123,456,789 -12,34 1234 -8 could help me? if want allow digits , commas, ^[-,0-9]+$ regex. if want allow spaces, utilize ^[-,0-9 ]+$ . however, if want allow proper numbers, improve go this: ^([-+] ?)?[0-9]+(,[0-9]+)?$ or utilize .net's number parser (for various numberstyles, see msdn): try { double.parse(yourstring, numberstyle.number); } catch(formatexception ex) { /* number not in accepted format */ } .net regex numbers matching

linux command line running java program connect to db2 -

linux command line running java program connect to db2 - i have java programme connects db2 database , cleanning, it's working fine eclipse, however, want set server's crontab, can run automatically every other week here essential command utilize eclipse java -cp /some/path/my/jar/files -connectionurl jdbc:db2://localhost:50000/stats other_argument (i have stats database on same machine) works eclipse however, when run command line in linux, gives me such error error: [packetdispatcher.cpp:100] run: exception in connection: transportexception [510/202] connection failed (error code: -249) i wondering if because cannot utilize jdbc straight command line or there other problem it. please, help, reply appreciated java linux

impossible to create text file in PHP (nginx) -

impossible to create text file in PHP (nginx) - i have in root of website directory: $filename = "test01.txt"; //the name of our file. $content = "this our test file"; //what writing our file. $strlength = strlen($content); //gets length of our $content string. $create = fopen($filename, "w"); //uses fopen create our file. $write = fwrite($create, $content, $strlength); //writes our string our file. $close = fclose($create); //closes our file echo("file created, click <a href='$filename'> here </a> view it."); i want create text file php script, doesn't work. have thought ? give thanks you make sure dir writable (group www), , can utilize function file_put_contents file_put_contents($create, $content); php nginx

javascript - angularjs filter: ng-options removing duplicates -

javascript - angularjs filter: ng-options removing duplicates - is there way remove duplicated values alternative field in angularjs when getting info json. ex: have many json objects this { productcat: "g" productcatdesc: "general" productcode: "1" productdes: "local" subproductcode: "10" } { productcat: "g" productcatdesc: "general" productcode: "1" productdes: "foreign" subproductcode: "10" } { productcat: "g" productcatdesc: "religion" productcode: "1" productdes: "gen" subproductcode: "10" } { productcat: "g" productcatdesc: "religion" productcode: "1" productdes: "rel" subproductcode: "10" } note: there many objects these.my task show 'productdes's according 'productcatdesc' . have hardcoded 'productcatdesc'.so ex: if take general selection a

shell - Mac OSX cmd works from command line, fails from php shell_exec() -

shell - Mac OSX cmd works from command line, fails from php shell_exec() - i on mac os x 10.9.4 i can run command command line produce image or google.com wkhtmltoimage http://www.google.com /users/me/sites/google.jpg but when tried execute same command within website using php command $cmd='wkhtmltoimage http://www.google.com /users/me/sites/google.jpg'; shell_exec($cmd); i next error: sh: wkhtmltoimage: command not found is permission issue? if how can work? ==== update i set total path @mureinik suggested , made progress error message is loading page (1/2) [> ] 0% [======> ] 10% [=============> ] 23% [==================> ] 31% [===================> ] 33% [========================>

android pay - API to change the credit card used by a google wallet subscription? -

android pay - API to change the credit card used by a google wallet subscription? - again frustrated lack of documentation involved in developing using google wallet payment gateway , may switch service. my new question follows: can programmatically alter payment card utilized google wallet digital goods subscription? if card utilized in subscription expires, on user, however, if not provide means of changing payment card elegantly, on me! does know how can done? or have create whole new subscription produce effect? should basic feature of payment gateway assuming missing something. it should noted creating new subscription may problematic without ability cancel previous subscription via api. provided both old , new cards still valid, effort process payments both subscriptions! on side note, why seem google wallet api missing many key features? (annual subscriptions, subscription cancellation, issue mentioned above, etc...?) thanks 1 time again everyone! i

javascript - Find duplicate item in unordered list -

javascript - Find duplicate item in unordered list - i have 2 unordered lists. 1 unordered lists populated dynamically , double click it's items add together other unordered list. i'm trying figure out how observe if item on dynamically populated list isn't in other list. if is. shouldn't added again. don't want add together duplicate items. the code populates ul: .done(function(html) { var results = jquery.parsejson(html); $('#store_sel').children().remove(); (var = 0; <= results.length; i++){ $("#store_selection").append("<li class='" + results[i].name + " stores'" + "id= " + results[i].uuid + + ">" + results[i].name + "</li>"); } }); the event: $('#store_selection').on('dblclick', 'li', function(e) { e.stoppropagation(); e.preventdefault();

rest - how to configure lighttpd with cgi and json -

rest - how to configure lighttpd with cgi and json - i want utilize lighttpd server mod_cgi module how can write cgi script parse post json requests , send out json response requests. what needs configured in lighthttpd server can have restful service. don't see json mime type in conf file. is there json parser or module can include lighttpd web server. i didn't find examples or info on net regarding this. can u give me direction can research more on this json rest webserver cgi lighttpd

c# - Debug Assertion Failed on \$InstallDir\VC\atlmfc\src\mfc\olelock.cpp line 62 on MFC programming -

c# - Debug Assertion Failed on \$InstallDir\VC\atlmfc\src\mfc\olelock.cpp line 62 on MFC programming - i have phone call sample mfc view in c# application, using visual studio 2012. utilize c++/cli project , phone call c++ class c#. have utilize line of code afx_manage_state(afxgetstaticmodulestate()); this phone call resource handle of mfc dll resource instead of default resource (exe file on c#). mfc view runs ok, appears exception (as c message box): debug assertion failed on \$installdir\vc\atlmfc\src\mfc\olelock.cpp line 62 here source code checked on install dir: void afxapi afxoleunlockapp() { afx_module_state* pmodulestate = afxgetmodulestate(); assert(pmodulestate->m_nobjectcount != 0); if (interlockeddecrement(&pmodulestate->m_nobjectcount) == 0) { // allow application shut downwards when objects have // been released ::afxoleonreleaseallobjects(); } } how can avoid assertion? give thanks

php - Select row that has similar name -

php - Select row that has similar name - so have tbl_total this. name | total | month ========================= david | 87 | jan mike | 67 | jan david | 90 | feb mike | 100 | feb and want display this. please tell me how coz i've no thought @ how display in php. name | jan | feb =================== david | 87 | 90 mike | 67 | 100 select name, sum(case when month = 'jan' total else 0 end) jan, sum(case when month = 'feb' total else 0 end) feb, sum(case when month = 'mar' total else 0 end) mar, sum(case when month = 'apr' total else 0 end) apr, sum(case when month = 'may' total else 0 end) may, sum(case when month = 'jun' total else 0 end) jun, sum(case when month = 'jul' total else 0 end) jul, sum(case when month = 'aug' total else 0 end) aug, sum(case when month = 'sep' total else 0 end) sep,

Set Iterator toString - JAVA -

Set Iterator toString - JAVA - i'm doing assignment , within class, have set in order read multiple authors book class. i'm trying figure out how implement tostring. tostring normal , implement iterator such this: public string tostring(){ iterator itr = set.iterator(); while(itr.hasnext()){ object element = itr.next(); } homecoming "book, isbn:" + isbn +", author:" + element } does create sense? first of all, have utilize same method signature of tostring, is: public string tostring() second, first line in implementation homecoming statement, renders rest of lines unreachable. third, putting homecoming statement in loop debatable. although not quite sure how want implement tostring, need alter these first. java iterator set tostring

php - what is the source of this method in laravel? -

php - what is the source of this method in laravel? - this question has reply here: laravel 4 - using carbon homecoming 'ago' time 2 answers i saw method in laravel project convert actual date "xxx minutes ago" {{ $post->created_at->diffforhumans() }} i looked @ laravel documentation , api there nil diffforhumans, source of method, how know if there method works kind of tasks, there source beside documentation contain little tasks that's part of carbon library laravel uses manage eloquent timestamp fields. and specified in documentation: http://laravel.com/docs/4.2/eloquent#date-mutators php laravel laravel-4

jquery - Adding a dropdown input box by clicking a plus button -

jquery - Adding a dropdown input box by clicking a plus button - i trying add together box predefined values in clicking plus button variable number in define max add-on of new boxes. native language:<br> <select name="nativelang" id="nativelangdrop"> <?php if ($file = @fopen('txt/languages.txt', 'r')) { while(($line = fgets($file)) !== false) { echo "<option>{$line}</option>"; } fclose($file); } ?> </select> i have in html file , want, if user selects language, user has oportunity click "plus button/ link" add together 1 more of same box. want limit amount of addable selects variable number can alter if needed. i have found similar examples here dont know jquery , not sure how phone call process, hope

p2p - Cherry pick peers using Rasterbar libtorrent in Python -

p2p - Cherry pick peers using Rasterbar libtorrent in Python - does know if it's possible cherry pick peers connect using libtorrent? is, after tracker returns list of peer ips , ports, selected few connected based on defined criteria. thanks you can remove peers set using set_ip_filter(). can add together peers set using connect_peer(). that's command have. priority of peers set connect in order hard coded. python p2p bittorrent libtorrent libtorrent-rasterbar

mysql - More efficient way of counting occurrences of different column values? -

mysql - More efficient way of counting occurrences of different column values? - i've seen related questions, didn't seem same situation, help appreciated. i have current query: select count(case when training_enhancments.reason_id = 0 1 end) '0count', count(case when training_enhancments.reason_id = 1 1 end) '1count', count(case when training_enhancments.reason_id = 2 1 end) '2count', count(case when training_enhancments.reason_id = 3 1 end) '3count', count(case when training_enhancments.reason_id = 8 1 end) '4count', ... count(case when training_enhancments.reason_id = 40 1 end) '40count', claims claims inner bring together users users on claims.surveyor_id = users.user_id inner bring together insurers insurers on claims.insurer_id = insurers.insurer_id left bring together training_enhancments training_enhancments on claims.claim_id = training_enhancments.claim_id cl

android - Creating a custom receiver with the Google Cast - Media Player Library -

android - Creating a custom receiver with the Google Cast - Media Player Library - i implement media player functionality custom receiver. on google developer website, found description implement sender , styled media receiver application. i have done sample, , works fine. can cast mp3 file hosted on google drive chromecast device. now, have implemented custom receiver (see attachment) should able play url refered m3u8 file. this, using media player library suggested google. <body> <div> <p id='text'> </p> <video id='vid'> </video> </div> <script type="text/javascript" src="https://www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js"></script> <script type="text/javascript" src="https://www.gstatic.com/cast/sdk/libs/mediaplayer/1.0.0/media_player.js"></script> <script type="text/javascript"> // if set ?debug=true in url, suc

facebook - How to add (with user_id) friend request for c# sdk -

facebook - How to add (with user_id) friend request for c# sdk - my codes : facebookclient appp = new facebookclient(accesstoken); dynamic parameters = new expandoobject(); dynamic success = appp.post("pageid&photoid/likes", parameters ); i can like, codes pages or photos. how can add together friend using code? how edit? this > dynamic success = appp.post("user_id/friend_add", parameters ); example please :( you can´t add together friends using facebook api. c# facebook api sdk

jQuery Autocomplete - how to make matching text bold -

jQuery Autocomplete - how to make matching text bold - i'm using jquery's autocomplete display suggestions user text input field , i'm having hard time making matching text in suggestion list bold. example, if user starts type in "balt", text "balt" in each of autocomplete suggestions displayed should bolded this: "baltimore, usa - baltimore intl. (bwi)" (similar kayak.com on search form). js: var airportlist = [ {"iata":"bwi","city":"baltimore","airp":"baltimore intl.","country":"usa"}, {"iata":"sea","city":"seattle","airp":"seattle tacoma intl.","country":"usa"}, {"iata":"lax","city":"los angeles","airp":"los angeles intl.","country":"usa"}, {"iata":"jfk","city":&

optimization - Is it legal for a C++ optimizer to reorder calls to clock()? -

optimization - Is it legal for a C++ optimizer to reorder calls to clock()? - the c++ programming language 4th edition, page 225 reads: a compiler may reorder code improve performance long result identical of simple order of execution. compilers, e.g. visual c++ in release mode, reorder code: #include <time.h> ... auto t0 = clock(); auto r = verylongcomputation(); auto t1 = clock(); std::cout << r << " time: " << t1-t0 << endl; into form: auto t0 = clock(); auto t1 = clock(); auto r = verylongcomputation(); std::cout << r << " time: " << t1-t0 << endl; which guarantees different result original code (zero vs. greater 0 time reported). see my other question detailed example. behavior compliant c++ standard? the compiler cannot exchange 2 clock calls. t1 must set after t0 . both calls observable side effects. compiler may reorder between observable effects, , on observable side effec

Make a list of different objects Java -

Make a list of different objects Java - i'm trying create list of different objects. i know can create list of object, example: arraylist<matrices> list = new arraylist<matrices>(); list.add( new matrices(1,1,10) ); list.add( new matrices(1,2,20) ); but want create list can this: list.add (new object1(a,b,c)); list.add (new object2(e,f)); obviously object1 , object2 different. please, give me hand here. vytenis' reply technically correct, not should doing on regular basis. more extensible solution create interface , have both objects implement, letting list hold both objects without losing safety , advantages come statically typed lists. while java not multiple inheritance classes, implementing multiple interfaces no problem. for example, take class declarations: class object1{ ... } ... class object2{ ... } and add together next interface declaration @ top level somewhere - public interface sharedtype{ ...

php - Not able to re-index Magento Catalog search Index using shell command -

php - Not able to re-index Magento Catalog search Index using shell command - i have magento installation has 25,000+ products. when im trying re-index using next shell command php -f indexer.php -- -reindex catalogsearch_fulltext the next error appearing when run mentioned command in putty catalog search index index process unknown error: exception 'pdoexception' message 'sqlstate[08s01]: communication link failure: 1153 got packet bigger 'max_allowed_packet' bytes' in /var/www/html/lib/zend/db/statement/pdo.php:228 im not able load site since index wrong. how can re-index catalog search? that's mysql error not in magento. have big tables. need alter value max_allowed_packet in mysql configuration. can alter value in my.ini file in server max_allowed_packet=16m reatart mysql server (if linux srever) service mysqld start or sudo /etc/init.d/mysql start , or shell command (for need logged in mysql server) set glob

c# - EF 6.0 incorrect items after where clause -

c# - EF 6.0 incorrect items after where clause - i had question ef 6.0 after fetching item db ef (firstordefault) modifying value , asking same item in collection clause. for instance assume class foo 3 properties: id, desc, statusid foos entityset. after first fetch: var item = foos.firstordefault(f => f.id = 5); // item values are: id:5, desc:"whatever", statusid:1 after fetching database // alter statusid item.statusid = 5 // statusitems not contain above object however... var statusitems = foos.where(f => f.statusid == 5).tolist(); // allitems contain item, statusid = 5 var allitems = foos.tolist() // or firstordefault is behaviour expected ef? if so, can forcefulness clause run on attached objects in dbcontext without specifying .tolist() first? a possible prepare found above is: var item = foos.firstordefault(f => f.id = 5); // item value are: id:5, desc:"whatever", statusid: 1 after fetching database // alter statusid item.s

C++ Template, Linker undefined reference despite instantiation? -

C++ Template, Linker undefined reference despite instantiation? - this question has reply here: why can templates implemented in header file? 9 answers i tried create template class implementation of 3d vector. relevant snippet of 2 files (vec3d.h , vec3d.cpp) here on pastebin. the main.cpp follows: #include "vec3d.h" #include <iostream> using namespace std; int main() { vec3d<double> a(1,2,3), b(2,4,5), c; c = 2.3*b; cout<<c._x; homecoming 0; } on compiling g++ main.cpp vec3d.cpp vec3d.h next error occurs: in function `main': main.cpp:(.text+0x124): undefined reference `vec3d<double> const operator*<double>(double, vec3d<double> const&)' collect2: error: ld returned 1 exit status i have set definition , declarations of functions separately, have instantiated template double

html - Drop Down List and PHP -

html - Drop Down List and PHP - i have drop downwards list select alternative , info written within retrieved database query . <select name="moto"> <?php include 'connessione.php'; $qry = "select nomeoggetto oggetto"; $result = mysql_query($qry); while($row = mysql_fetch_array($result)) { echo '<option value='.$row["nomeoggetto"].'>'.$row["nomeoggetto"].'</option>'; } ?> </select> the problem if in menu have name of motorbike 1 space between name , illustration ( kawasaki ninja) , when send php page post method displays kawasaki . how can show entire name space included ? php page : <?php echo $_post['moto']; ?> you have set quotes around attribute values in html from echo '<option value='.$row["nomeoggetto"].'>'.$row["nomeogge

Eclipse cannot recognize the linked 'res' folder for an android project -

Eclipse cannot recognize the linked 'res' folder for an android project - i tried reuse "drawable" folder of first android project. sec project "drawable" file, created linked folder "res" of first project , expected alter on "drawable" of first project reflected on sec one. scheme not recognize virtual folder, how can prepare without copying , pasting? error appears on lines like: android:background="@drawable/button_deepskyblue" android eclipse folder drawable

python - Find unique rows in numpy.array -

python - Find unique rows in numpy.array - i need find unique rows in numpy.array . for example: >>> # have array([[1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 1, 1, 0]]) >>> new_a # want array([[1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 1, 1, 1, 0]]) i know can create set , loop on array, looking efficient pure numpy solution. believe there way set info type void , utilize numpy.unique , couldn't figure out how create work. another alternative utilize of structured arrays using view of void type joins whole row single item: a = np.array([[1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 1, 1, 0]]) b = np.ascontiguousarray(a).view(np.dtype((np.void, a.dtype.itemsize * a.shape[1]))) _, idx = np.unique(b, return_index=true) unique_a = a[idx] >>

c - EDID info and HDMI configuration -

c - EDID info and HDMI configuration - i'm working tda19988 hdmi framer , having troubles understanding how translate edid info configure framer output. for example, edid can see next parsed info: 1280x720 0x41 74.2mhz h : 1280 start 1390 end 1430 total 1650 clock 45.0khz v : 720 start 725 end 730 total 750 clock 60.0hz now, hdmi framer allows next configured: refpix (preset pixel) = ? refline (preset line) = ? npix (number of input pixels) = ? nline (number of input lines) = ? vs_line_start_1 (vertical synchronization line start) = ? vs_pix_start_1 (vertical synchronization pixel start) = ? vs_line_end_1 (vertical synchronization line end) = ? vs_pix_end_1 (vertical synchronization pixel end) = ? hs_pix_start (horizontal synchronization pixel number) = ? vwin_start_1 (vertical window start) = ? vwin_end_1 (vertical window end) = ? de_start (data enable start) = ? de_end (data enable end) = ? i haven't been able understand how edid info translated

angularjs - How to Show/Hide buttons with Angular-UI static tabs -

angularjs - How to Show/Hide buttons with Angular-UI static tabs - i need hide/show different buttons when sec tab clicked, , same when default tab clicked plubkr <tabset> <tab heading="home" select="showme=true"></tab> <tab heading="detail" select="showme=true"></tab> </tabset> <div> <input ng-hide="showme" type="button" value="update home"/> <input ng-hide="showme" type="submit" value="save home"/> <input ng-show ="showme" type="button" value="update detail"/> <input ng-show="showme" type="submit" value="save detail" /> </div> put content of tab within <tab> , remove ng-hide / ng-show : <tabset> <tab heading="home" select="showme=true"> <input type="button" value="

haskell - Testing type classes with Quickcheck, variable number of parameters -

haskell - Testing type classes with Quickcheck, variable number of parameters - i have ring type class looks this: class ring addid :: addinverse :: -> mulid :: add together :: -> -> mul :: -> -> for class have several instances, e.g. instance ring matrix ... instance ring integer ... instance ring modulo ... in order test these instances, have next quickcheck tests: prop_addid :: (ring a, eq a, arbitrary a) => -> bool prop_addinv :: (ring a, eq a, arbitrary a) => -> bool prop_mulid :: (ring a, eq a, arbitrary a) => -> bool prop_addcommutative :: (ring a, eq a, arbitrary a) => -> -> bool prop_addassociative :: (ring a, eq a, arbitrary a) => -> -> -> bool prop_mulassociative :: (ring a, eq a, arbitrary a) => -> -> -> bool prop_distributive :: (ring a, eq a, arbitrary a) => -> -> -> bool i'm unsure how run these testcases class instances. found solution here leads follow

Need help understanding basic computer architecture -

Need help understanding basic computer architecture - we're learning how computer executes c programme in class. i'm unclear how next pieces fit together: processor (or cpu), register files, runtime stack, programme counter, virtual addresses, programme memory. let me explain know or think understand: the processor (or cpu) compile .c file executable machine level code computer can understand , execute. there exists stack onto instructions can pushed computer can execute said instructions. questions: stack register located in regards cpu? instructions beingness pulled from? this stack can hold registers %eax, %ecx, %edx, etc. holds numerical values , holds addresses point items stored in "memory". question: 1 time again memory located? there exists programme memory contains executable machine code program, blocks of memory user allocates, , runtime stack managing procedural calls , returns. questions: again, programme memory located in relationshi

Backbone Marionette: Add to region -

Backbone Marionette: Add to region - instead of using region.show(view), add together multiple views part without destroying view nowadays in region. have tried using preventdestroy: true, isnt working out. part shows lastly "application". var fetchingapplications = app.request('application:entities'); $.when(fetchingapplications).done(function(applications) { console.log(applications); applications.each(function(application) { var applicationview = new list.application({ model: application }); app.layout.mainregion.show(applicationview, { preventdestroy: true }); }); i know illustration weird, because simply utilize collectionview. however, using collectionview not want do. i think should works dynamically add together part , fadein. add together class or inline style 'display: none' not displayed , in view set 'onshow : function(){ this.$el.fadein(); }' marionette

java - Android ListView with ArrayAdapter doesn't show anything -

java - Android ListView with ArrayAdapter doesn't show anything - i know there lot of posts on how create android listview, after looking through of them can't figure out problem is. i'm new android , bit overwhelmed. activity runs without showing content. this activity: package com.example.myfirstapp; import android.app.activity; import android.os.bundle; import android.view.menu; import android.view.menuitem; import android.widget.listview; public class historyactivity extends activity { customrowadapter customrowadapter; listview listview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_history); listview = (listview)findviewbyid(r.id.listview); customrowadapter = new customrowadapter(getapplicationcontext()); listview.setadapter(customrowadapter); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar

tomcat - Openshift Origin-rhc app create tomcat7 error - Failed to execute: : 'control start' -

tomcat - Openshift Origin-rhc app create tomcat7 error - Failed to execute: : 'control start' - after installing jboss ews 2.0 cartridge, app create command leads error shown below. openshift origin installed on virtual box centos 6.5 environment. help much appreciated. rhc app create myjava7 tomcat7 --trace using jbossews-2.0 (tomcat 7 (jboss ews 2.0)) 'tomcat7' application options domain: mydomain cartridges: jbossews-2.0 gear size: default scaling: no creating application 'myjava7' ... starting jbossews cartridge jbossews process failed start /usr/lib/ruby/gems/1.8/gems/rhc-1.26.9.1/lib/rhc/rest/client.rb:737:in handle_error!': failed execute: 'control start' /var/lib/openshift/544c1df34fe5a091c8000153/jbossews (rhc::rest::validationexception) /usr/lib/ruby/gems/1.8/gems/rhc-1.26.9.1/lib/rhc/rest/client.rb:394:in request' /usr/lib/ruby/gems/1.8/gems/rhc-1.26.9.1/lib/rhc/rest/client.rb:376:in attempt'

Filling inner part of svg -

Filling inner part of svg - probably super easy question, have no thought how utilize svgs. have got code: <svg height="16px" version="1.1" viewbox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" xmlns:xlink="http://www.w3.org/1999/xlink"><title/><defs/><g fill="none" fill-rule="evenodd" id="icons numbers" stroke="none" stroke-width="1"><g fill="#000000" id="group" transform="translate(-48.000000, -432.000000)"><path d="m54.8796844,443.0591 l54.8796844,445 l57.2307692,445 l57.2307692,443.0591 z m56,448 c51.5817218,448 48,444.418278 48,440 c48,435.581722 51.5817218,432 56,432 c60.4182782,432 64,435.581722 64,440 c64,444.418278 60.4182782,448 56,448 z m53.5700197,435.51041 c52.5864514,436.043208 52.0631167,436.947609 52,438.223

android - Alarm Manager - triggers after every 2 hours -

android - Alarm Manager - triggers after every 2 hours - i have next piece of code gets called once. notification gets triggered after every 2 hours want triggered after 2 days. tried options, still not working public int setalarm(){ calendar calendar_object = calendar.getinstance(); /* calendar_object.set(calendar.month,6); calendar_object.set(calendar.year, 2013); calendar_object.set(calendar.day_of_month, 18);*/ // myview current activity, , alarmreceiver // boradcastreceiver intent myintent = new intent(splash.this, timealarm.class); pendingintent pendingintent = pendingintent.getbroadcast(this, 0, myintent, pendingintent.flag_cancel_current); long wkuptime = calendar_object.gettimeinmillis() + 36000; alarmmanager alarmmanager = (alarmmanager) getsystemservice(alarm_service); // log.w("alarm set " , calendar_object.gettime().tostring ());

json - Elasticsearch search templates -

json - Elasticsearch search templates - i tried using es's search template conditional clause specified here. i'm sending request /[my_index]/_search/template endpoint. request fails because of json parsing issues, makes sense because after adding conditional clause payload no longer valid json. how supposed utilize search templates? there designated endpoint non-json templates? you need escape template in wrapping string. from same link referenced: as written above, template not valid json because includes section markers {{#line_no}}. reason, template should either stored in file (see section called “pre-registered templateedit”) or, when used via rest api, should written string: "template": "{\"query\":{\"filtered\":{\"query\":{\"match\":{\"line\":\"{{text}}\"}},\"filter\":{{{#line_no}}\"range\":{\"line_no\":{{{#start}}\"gte\"