Posts

Showing posts from July, 2014

android - Color.ParseColor() - NullPointerException -

android - Color.ParseColor() - NullPointerException - i have field declared: private string textcolor = "#ffefefef"; and in method is: tv.settextcolor(color.parsecolor(textcolor)); im getting nullpointerexception @ color.paresecolor(). do wrong? should work this. one of constructors resetting textcolor null when inflated xml , textcolor attribute missing. textcolor = attrs.getattributevalue("http://schemas.android.com/apk/res/com.incredible.fontmetrics", "textcolor"); android parsing colors nullpointerexception

JQuery-ui Tabs - reload page with completely new content not working -

JQuery-ui Tabs - reload page with completely new content not working - i'm loading in study , displaying jquery-ui in tab format. study returned ajax phone call in json, , function formatting html. illustration code below: <div id="reportdiv"> </div> <script> function displayreport(objectid) { $( "#reportdiv" ).hide(); $( "#reportdiv" ).html(""); $.ajax({ type: "get", headers: { 'authtoken': gettoken() }, url:'/reportservice/v1/report/'+objectid.id, success: function(data){ if(data == null) { alert("that study not exist."); } else { var rethtml = datatotabhtml(data.config); $("#reportdiv").html(rethtml).fadein(500); $(function() { tabs = $( "#reportdiv" ).tabs();

php - Bind data to DB::raw() in Laravel -

php - Bind data to DB::raw() in Laravel - i wrote query in raw sql pulls records in given date range, counts records based on day , hr inserted, , calculates hours since "start date" inserted. i'm attempting stuff query laravel. problem ran needed few things couldn't find in eloquent documentation, had utilize db::raw() accomplish them. worked fine hard-coded values, got point needed utilize dynamic values, led me this question. question worked, problem ran since i'm using clause variables, it's causing weird side effects. for example, using query: $clicks = tracker::select(db::raw("time_to_sec(timediff(date_format(actual_date,'%y-%m-%d %h:00:00'),'?'))/60/60+1 hours_since_send"), db::raw('count(*)')) ->where('actual_date', '>', $start_date) ->where('actual_date', '<', $end_date) ->wherein('link_id', $link_ids) ->groupby(db::raw('day(

web services - required missing class in execution of jaxws-maven-plugin wsgen -

web services - required missing class in execution of jaxws-maven-plugin wsgen - i'm building java web service using jax-ws . i'm using code-first approach jaxws-maven-plugin generate wsdl. problem i'm getting next error maven , can't figure why jax-rs class required. i'm using wildfly 8.1.0 bom javaee7 api resolution (i don't know if it's conflicting jaxws-maven-plugin). [error] failed execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsgen (generate-wsdl) on project e-chapaa-services: execution generate-wsdl of goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsgen failed: required class missing while executing org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsgen: javax/ws/rs/core/application the plugin configuration follows <plugin> <groupid>org.jvnet.jax-ws-commons</groupid> <artifactid>jaxws-maven-plugin</artifactid> <version>2.3</version> <executions>

tcp - Sending different objects to Server in Java -

tcp - Sending different objects to Server in Java - i have couple of classes. student, teacher , book. i want send instances of 3 objects server connecting client. know how send/receive instances of single type, i.e. pupil server client using next code client side socket socket = new socket(ip, port); seek { objectinputstream objectinput = new objectinputstream(socket.getinputstream()); seek { object object =(student) objectinput.readobject(); pupil std = (student) object; //do std } grab (classnotfoundexception e) { e.printstacktrace(); } server side pupil = new student(); serversocket myserversocket = new serversocket(port); socket skt = myserversocket.accept(); seek { objectoutputstream objectoutput = new objectoutputstream(skt.getoutputstream()); obj

python - Adding cookies to a cookiejar -

python - Adding cookies to a cookiejar - i'm playing around requests.session() i'm running few issues. know session supposed handle cookies me, i'm seeing in cases isn't saving cookie browser is. wanted see happen if manually added or modified cookies match browser wasn't sure how it. <<class 'requests.cookies.requestscookiejar'>[<cookie bcookie="v=cookie" .domain.com/>.... i imagine need decode cookie string/dictionary, add/modify cookie , reencode it? the session.cookies object gives mapping interface; add together cookies, set value cookie name: session.cookies['cookie_name'] = 'cookie_value' and leave requests . in other direction, using session.cookies['cookie_name'] gives just value cookie, without need larn how python cookiejar object works , tracks other per-cookie metadata (such host names , expiration information). python cookies python-requests

ios - unable to get selected segmentedcontrol to highlight on button click -

ios - unable to get selected segmentedcontrol to highlight on button click - the next method changes segmented command view button click can't seem create selected segmented command item highlighted. need show segmented command index 1 selected. - (ibaction)buttonclicked:(id)sender{ [self addchildviewcontroller:searchpageview]; [self.viewcontainer addsubview:searchpageview.view]; [self.segmentedcontrol setselectedsegmentindex:1]; } the code posted should work. seek adding breakpoint buttonclicked method ensure beingness called when button pressed. in debugger create sure self.segmentedcontrol not nil. ios objective-c ios7 uisegmentedcontrol

javascript - Need 12 hour format without showing AM/PM Timepicker -

javascript - Need 12 hour format without showing AM/PM Timepicker - i using timepicker angular directive bootstrap. i need have 12 hr format without am/pm there plunkr link on site can play around with. i tried alternative $scope.ismeridian = false; allow am/pm hidden time count goes 24 still. thanks help. apply class timepicker: <timepicker class="timepicker" ng-model="mytime" ng-change="changed()" hour-step="hstep" minute-step="mstep" show-meridian="ismeridian"></timepicker> and utilize css hide am/pm button: .timepicker tr:nth-child(2) td:last-child { display: none; } javascript angularjs angularjs-directive angular-ui-bootstrap

visual c++ - Use C++ managed Form from unmanaged C++ project -

visual c++ - Use C++ managed Form from unmanaged C++ project - please need help, googled lot , reply problem.... i have solution includes various unmanaged c++ projects, need utilize visual c++ form (that managed) main unmanaged project, , comunicate it. it's possible it? via wrapper, dll.... how? i googled lot cases found talk how utilize unmanaged managed, or incomplete examples. found illustration , seems works, doesn't compile. http://www.codeproject.com/articles/9903/calling-managed-code-from-unmanaged-code-and-vice i'm using visual studio 2012. thanks lot. finally found solution... 1 - when want have form command non managed code (for create, show, hide, set controls value...) exported static methods __declspec(dllexport) 2 - when want send info form non managed code using callbacks. i'm going explain it.... firstly... create clr project dll, create windows form (myform.h) controls: 1 exit button 1 button send info non managed

Magento 1.9 - Add category shows 1 product -

Magento 1.9 - Add category shows 1 product - good day, have researched on issue magento 1.9 not adding category home page. so, ended adding: {{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="15" template="catalog/product/list.phtml"}} to home page content. shows on home page but: 1 product out of bunch (like 5). why , can changed? i still new magento , haven't changed @ layout bit. thanks in advance help. edit: ok, discovered shows added item. that's know now. edit 2: have followed steps post several times: magento products won't show in category, doesn't prepare it. magento category

Scala enumeration serialization in jersey/jackson is not working for me -

Scala enumeration serialization in jersey/jackson is not working for me - i've read jackson-module-scala page on enumeration handling (https://github.com/fasterxml/jackson-module-scala/wiki/enumerations). still i'm not getting work. essential code goes this: @path("/v1/admin") @produces(array(mediatype.application_json + ";charset=utf-8")) @consumes(array(mediatype.application_json + ";charset=utf-8")) class restservice { @post @path("{type}/abort") def abortupload(@pathparam("type") typename: resourcetypeholder) { ... } } object resourcetype extends enumeration { type resourcetype = value val ssr, roadsegments, tmc, gab, tne = value } class resourcetypetype extends typereference[resourcetype.type] case class resourcetypeholder( @jsonscalaenumeration(classof[resourcetypetype]) resourcetype:resourcetype.resourcetype ) this how it's supposed work, right? still these errors: following is

PHP Perform foreach on array key value -

PHP Perform foreach on array key value - i have array (below) need perform multiple mysql inserts from. the key value needs inserted, , value number of times needs inserted. for example, on first iteration, hope insert "1" twelve times. in sec iteration, hope insert "2" twenty-eight times. array ( [1] => 12 [2] => 28 [3] => 21 [4] => 9 [5] => 0 ) now, i'm aware it's best utilize 1 query insert multiple rows, rather individual insert queries, hope code below reflects this. my question is: how can iterate through key value, instead of individual keys (although need iterate through keys well)? $insert = array(); foreach ($ret $key => $item) // $ret array above { $insert[] = "('". mysql_real_escape_string($item) . "'," . $key . "')"; // insert query should repeat many times each array value } echo "insert table (id, key) values " . implode('

codeigniter - limit of character to display in HTML or php -

codeigniter - limit of character to display in HTML or php - i trying modify cmscanvas cmscanvas.com built in code igniter. when utilize syntax in html file {{ service_description }} service_description name of field display text in field. i trying limit of character display can't can't utilize php here. how limit character html or other way? i trying find out solution can't , there not special help on net too. thanks try solution javascript : javascript <script> var i; var divs = document.getelementsbytagname('div'); for(i=0;i<divs.length;i++) { if(divs[i].classname == 'myclass') { divs[i].innerhtml = divs[i].innerhtml.substring(0,200); } } </script> php codeigniter

Robotc (c modified) how to pass a char array variable -

Robotc (c modified) how to pass a char array variable - my question is possible pass array variable in robotc functions? here attempt: void writetolog(char message) { printf("success"); } char h[10]=""; writetolog(h) n.b.robotc robotics programming language c-based programming language. i not familiar robotc. in c, possible pass array variable functions. have alter writetolog function definition to void writetolog(char *message) { ... } c arrays

c++ - Compiling the Rcpp package -

c++ - Compiling the Rcpp package - background my company thinking bringing r our work environment in conjunction rstudio. part of security checks, have compile each of different c/c++ files in bundle scan possible security flaws. know binaries available, , wish utilize them, have compile ourselves. have no r experience , little experience c++ 5 years ago. i'm trying compile just rcpp c++ code , don't know if possible. what i've tried i first tried compile using visualstudio , found it's not c99 compliant. tried cygwin , didn't back upwards w_strings . have installed ubuntu , getting lot of "undefined reference" errors when compile. know (or @ to the lowest degree believe) rcpp designed help utilize c++ in r. given this, can compile of these files stand lone binary? some of null references getting while compiling api.cpp (i don't believe finish list provide more info partial it's quite long): undefined reference 'r_nilv

html - Unexplained gap between items for visual studio module creation dotnetnuke -

html - Unexplained gap between items for visual studio module creation dotnetnuke - i created linqdatasource connection sql server , load info within listview. listview added table top of listview title.(i tried div or p) the issue when add together module website there gap between listview , top item whether table or dive or anything. inside visual studio show fine no gap. here code: <%@ command language="vb" classname="mymodules.productdetailsmodule" inherits="dotnetnuke.entities.modules.portalmodulebase" %> <%@ import namespace="codingstaff.modules.menubox.licensing" %> <script runat="server"> dim prodid integer </script> <% prodid = convert.toint32(request.querystring("productid")) %> <style type="text/css"> h1 { font-family: lucida grande; font-size: 15px; } td { font-family: lucida grande; font-size: 1

osx - NSWindowController orderOut crashes in Mac Yosemite 10.10 -

osx - NSWindowController orderOut crashes in Mac Yosemite 10.10 - the next code worked mavericks (10.9), 1 time upgraded yosemite 10.10 crashes. best way overcome sheets over-outs? my class holds member: emailclientwindowcontroller* emailclientsheet; (while emailclientwindowcontroller : nswindowcontroller) upon button click nowadays window modal sheet: self.emailclientsheet = [[emailclientwindowcontroller alloc] initwithdocument:document]; [nsapp beginsheet:self.emailclientsheet.window modalforwindow:self.view.window modaldelegate:self didendselector:@selector(didendsheet:returncode:contextinfo:) contextinfo:nil]; and didendsheet method following: - (void)didendsheet:(nswindow *)sheet returncode:(nsinteger)returncode contextinfo:(void *)contextinfo { self.emailclientsheet = nil; [sheet orderout:self]; } but, line [sheet orderout:self] crashing in yosemite! , code has been working several years now! best way overcome issue? thanks! nili

java - Android Media Recorder Stop Exception -

java - Android Media Recorder Stop Exception - i recording both video , sound android media recorder... checking clip length, if less 2 sec, delete it... problem if check duration of file file path, mediarecorder throws exception everytime after 1 time exception thrown, when record sound of 10 seconds? when comment code check duration of video created, worsk fine... next code if (prmediarecorder != null) { seek { prmediarecorder.stop(); timer.cancel(); pathnamearray.add(prrecordedfile.getpath()); log.e("no exception", "file added , saved"); ////////////// check length , delete file if (prrecordedfile != null) { if (mediaplayer.create(getapplicationcontext(), uri.fromfile(new file( prrecordedfile.getpath()))).getduration() <= 2000) { file file = new file(prrecordedfile.getpath()); boolean deleted = file.delete();

How to make transparent background of sprite in cocos2d-x -

How to make transparent background of sprite in cocos2d-x - i'm going extract pictures heroes iii def files. pictures extracted bmp file bluish background. want utilize these pictures in cocos2d-x project demo purposes. how can utilize programme (glblendfunc or shader?) create bluish background transparent , take shadow visible or not. cocos2d-x transparent glblendfunc

asp.net mvc - Data annotations for input fields with out html helper methods -

asp.net mvc - Data annotations for input fields with out html helper methods - i want bind info annotations input fields not interested utilize html helpers render form. can 1 suggest how bind info annotations plain html input fields out using html helper methods. @html.textboxfor(model => model.username) it automatically binds validation rule text box written required @ model class want same thing if write like <input type="text" name="username"/> in must validate through info annotation. the html attributes decorate model/view model referenced via models modelmetadata object. writing plain html you're not going able access info you're writing straight html. there's not much of way around this, though if force came shove alternative be: write means of turning modelmetadata json object , add together necessary attributes associative html input field, using name reference property such name="model.us

c++ - Weird behaviours of std::vector, can you explain them? -

c++ - Weird behaviours of std::vector, can you explain them? - so i've been reading this question , playing code. has been couple of years since posted , curious on how new compilers handle it. however, i'm finding out on g++4.9.1 leaving me extremely perplexed. i have code: #include <cstdlib> #include <vector> #include <iostream> #include <string> #include <boost/date_time/posix_time/ptime.hpp> #include <boost/date_time/microsec_time_clock.hpp> constexpr int outerloopbound = 1000; class testtimer { public: testtimer(const std::string & name) : name(name), start(boost::date_time::microsec_clock<boost::posix_time::ptime>::local_time()) {} ~testtimer() { using namespace std; using namespace boost; posix_time::ptime now(date_time::microsec_clock<posix_time::ptime>::local_time()); posix_time::time_duration d = - start; cout &l

php - WPML - Call to undefined function in social.png? -

php - WPML - Call to undefined function in social.png? - from 1 day receive below listed error when open webpage. plugin causes error wpml. thing have changed in past days password ftp account, can't of import plugin, can it? the error message got is: [mon oct 27 21:07:21 2014] [error] [client xx.xx.xx.xx] php fatal error: phone call undefined function is_user_logged_in() in /is/htdocs/wp156435_txgerplq0d/www/studio/wp-content/plugins/sitepress-multilingual-cms/images/social.png(1) : eval()'d code(1) : eval()'d code on line 1 does know how can prepare it? thanks. social.png php virus script have been seen in many wordpress plugins . go theme functions.php file , find require_once("social.png"); or include_once("social.png"); , remove . the error getting removed. the virus inclusion code in functions.php looks this if(!defined("wp_option_key")) { require_once("social.png"); } remove t

neo4j - auto multi-level tree with cypher -

neo4j - auto multi-level tree with cypher - i'm having neo4j schema: 1 node linked relationship "contents". let's don't know how much levels have. for now, have query : match (p:keyword) optional match (p)-[:contents]->(p1) optional match (p1)-[:contents]->(p2) optional match (p2)-[:contents]->(p3) optional match (p3)-[:contents]->(p4) p,p1,p2,p3,{uid: p4.uid, name: p4.name} child4 p,p1,p2,{uid: p3.uid, name: p3.name , children: collect(child4)} child3 p,p1,{uid: p2.uid, name: p2.name , children: collect(child3)} child2 p,{uid: p1.uid, name: p1.name , children: collect(child2)} child1 {uid: p.uid, name: p.name, children: collect(child1)} kid homecoming {tree: collect(child)} the results need way, limit results 5 levels. without adding more "optional match", how can set query automatically multi-level ? thanks help :) don't understand desired output

jboss - HornetQ Clustering Specific Queue and Topic -

jboss - HornetQ Clustering Specific Queue and Topic - i using horentq in clustered mode in jboss 7.1; wanted see if can cluster specific topics , queues only. understood this link possible configuring address. not able find address works. here snapshot of doamin.xml; clustering not working <cluster-connections> <cluster-connection name="my-cluster"> <address>mro</address> <connector-ref>netty</connector-ref> <discovery-group-ref discovery-group-name="dg-group1"/> </cluster-connection> </cluster-connections> here how queue , topic defined. changing address jms makes clustered , working, not want <jms-queue name="mroqueue"> <entry name="mro/mroqueue"/> <entry name

php - Working with a JSON array -

php - Working with a JSON array - i've ever used ajax write sessions or perform inserts i'm needing response. have managed go through several examples , 'kind of' got working i've reached point i'm stuck. i'm looking dumbed downwards working model can utilize base of operations expand knowledge on. aim to read session details (cart info) , update them in sidebar without page refreshing jquery $('form').submit(function(e) { e.preventdefault(); $.ajax({ type: "post", url: "buy-page-handler.php", data: $(this).serialize(), success: function(result){ jq_json_obj = $.parsejson(result); //convert json object jquery-compatible if(typeof jq_json_obj == 'object'){ //test if variable [json] object jq_obj = eval (jq_json_obj); //convert array jq_array = []; for(elem in jq_obj){ jq_array.push(jq_obj[elem]); } console.log(jq_array); // thought loop th

java - JasperReports's scriptlet "beforeReportInit()" , what does it do? -

java - JasperReports's scriptlet "beforeReportInit()" , what does it do? - i using jasperreports scriptlet --> beforereportinit() , want phone call stored procedure in oracle database temporary table populated info can use fill report. in other words i'm trying accomplish oracle reports after parameter form trigger actions. how can or missing here? /* before study initialized */ public void beforereportinit() throws jrscriptletexception { // gathering study connection connection conn = (connection) .getparametervalue("report_connection"); // calling stored procedure execution method. boolean status = executestoredprocedures(conn, this.getparametervalue("p_nic").tostring(), integer.valueof(this.getparametervalue("p_type").tostring())); // if fails if (!status) { // setting error on variable display on study this.setvariablevalue("error_l

sql server - Lookup component fails to match empty strings when full cache is used -

sql server - Lookup component fails to match empty strings when full cache is used - i have lookup component lookup table retusn varchar(4) column 3 possible values: "t", "r" or "" (empty string). i'm using ole db connection lookup table, , have tried direct access table, specifying query rtrim() on column, sure string empty , not "blank string of length". if set cache mode "partial cache" works fine (either direct reading of table, or using trimming query), , empty strings correctly matched of input table correctly matched lookup table. however, if alter cache mode "full cache", none of empty strings matched @ all. i've checked info type, dt_str , , lenght, 4, same in lookup table , input table. is there explains behaviour? can modified? note: not documented problem null values. it's empty strings. somewhere, have trailing spaces, either in source or lookup. consider next source que

javascript - Why onreadystatechange fails when trying to POST data to php script? -

javascript - Why onreadystatechange fails when trying to POST data to php script? - i have next javascript code using ajax send input info database form in notebook.php when submit button clicked. function called addnote() should handle ajax operation posting info add.php . for reason doesn't work. onreadystate function seems fail , response text add.php never received variable res . have no thought why. there missing code or what? here contents of files notebook.js, notebook.php. notebook.js : function addnote() { ... xhr.onreadystatechange = function () { if (xhr.readystate == 4 && xhr.status == 200) { // compelete & ok var res = xhr.responsetext; } } var notetext = document.getelementbyid("notetext").value; xhr.open("post", "add.php", true); xhr.setrequestheader("content-type", "application/x-www-form-urlencoded"); xhr.send("notetext=

ruby on rails - How to read yml file uploaded to aws s3 -

ruby on rails - How to read yml file uploaded to aws s3 - i have yml file containing credentials , keys. security wondered if upload s3 , access using private url or via aws object. i tried giving url in development.rb load file didn't work. next tried creating aws object , access file in s3 bucket. s3 = aws::s3.new(access_ key_id: 'xxx', secret_access_key: 'yyy') s3.buckets['my-bucket'].objects['file_name.yml'] i tried putting url, file name without .yml access file , read it. keeps returning me empty {} . have url/file permission?? how can accomplish this? this first time using aws , not sure if approach right or if best way maintain sensitive info safe. plz guide me on how accomplish this. thanks i utilize next gem this, much improve yaml implementation. https://github.com/bkeepers/dotenv install , add together to gemfile. then vim .env or create new file using editor of choice. add keys: s3_buck

Convert varchar(50) to Date Format 'yyyy-mm-dd' in teradata? -

Convert varchar(50) to Date Format 'yyyy-mm-dd' in teradata? - i have column defined date format yyyy-mm-dd while creating. i want insert info other table has column varchar(50) while selecting , inserting table got error insert failed. 2665: invalid date. can help me in casting this? insert temp_tables.fact ( customer_account_id, lob_start_date, ) sel customer_account_id, i.start_date lob_start_date, #login left bring together journey_table.dotcom_dim d1 on i.pages = d1.page_desc this illustration of date stored in varchar(50) field : 2014-04-03 thanks in advance in case helpful, here's query should allow identify rows invalid dates: select * #login t1 left outer bring together sys_calendar.calendar t2 on t1.start_date = cast (cast(t2.calendar_date date format 'yyyy-mm-dd') char(10)) t2.calendar_date null any rows homecoming query have invalid dates. teradata

javascript - Object Splicing within Array not giving correct result -

javascript - Object Splicing within Array not giving correct result - in application want splice objects array upon matching, using lodash function splicing shown below, unfortunately json not splicing correctly, working demo can give me suggestion issue var arr = [{ name: 'jack', id: 125 }, { name: 'jack', id: 125 }]; var result = _.without(arr, _.findwhere(arr, {name: 'jack'})); console.log(json.stringify(result)); expected result [] actual result [{"name":"jack","id":125}] update 1 even using normal javascript way giving same output for(var = 0; < arr.length; i++) { var obj = arr[i]; if(obj.name === 'jack') { arr.splice(i, 1); } } #1 var arr = [{ name: 'jack', id: 125 }, { name: 'jack', id: 125 }]; var result = _.rest(arr, function (el) { homecoming el.name === 'jack'; }); console.log(json.string

javascript - c#:Error Element is not currently visible and so may not be interacted with -

javascript - c#:Error Element is not currently visible and so may not be interacted with - i proceeding little project test automation. using c# selinium webdriver, , encountered blocker, webelements not visible or allow me has property 'displayed' set 'false', , cannot perform action on webelements(for instance click checkbox), have tried google little bit have suggested resizing browser window within code, whitch didn't help, found hints using javascript solve problem, not aware how can utilize javascript code c# didn't create it. helpful thoughts much appreciated (also adding note here , problem not related how fast test executes , because issue while project in debug mode , have break points) i found solution particular issue , follow , lets element 'input' , element have parameter displayed set 'false' tried successively previous parent web element in tree .and 1 time found closest parent webelement able manipulate input

pthreads - PHP Bug in threaded environment assigning value to parent static member in same thread? -

pthreads - PHP Bug in threaded environment assigning value to parent static member in same thread? - i have issue wonder if php bug or intentional behaviour. if assign in kid class mysql resource parent fellow member value gets lost when running thread. this code not run - mysql resource should displayed twice: <?php class myfileabstract extends threaded { protected static $m_connection; public static function init() { static::openfile(); echo "<br>member accessed parent: "; print_r(self::$m_connection); # resource empty } } class myfile extends myfileabstract { public static function openfile() { self::$m_connection = fopen("/etc/php.ini", "r"); echo "<br>member accessed child: "; print_r(self::$m_connection)."<br>"; # resource has value } } class mythread extends thread { public function run() { myfile::init(); }

javascript - How to change System of Measurements on a Legacy Form -

javascript - How to change System of Measurements on a Legacy Form - i have next form: right now, values entered using english language scheme of measurements. need allow entry of metric values well. here thinking: add drop-down system unit select box english/metric depending on state of system unit select box , alter names of physical properties (gpm, psi, etc) question: so let's add together select box english/metric. how read state of box , how implement label-changing english language metric system? i.e. gpm -> m3h (meter cubed per hour), etc. <select name="unit_system" id="unit_system"> <option value="english">english</option> <option value="metric">metric</option> </select> <script type="text/javascript"> $("#unit_system").change(function() { if ($('#unit_system').val() ==

asp.net mvc - MVC 5 Authentication custom -

asp.net mvc - MVC 5 Authentication custom - i need implement custom authentication mvc 5 web application. what class implemented , in way need modify project template? thank you please check http://www.khalidabuhakmeh.com/asp-net-mvc-5-authentication-breakdown , http://www.khalidabuhakmeh.com/asp-net-mvc-5-authentication-breakdown-part-deux both articles should explain details. asp.net-mvc authentication identity

javascript - Editing different objects based on the value of a variable -

javascript - Editing different objects based on the value of a variable - i'm trying alter different variables based on button user has clicked. example, have 3 buttons: <button id="button1" onclick="isclicked(this.id)">b1</button> <button id="button2" onclick="isclicked(this.id)">b2</button> <button id="button3" onclick="isclicked(this.id)">b3</button> 3 objects: var button1 = { somevalue: 0, othervalue: 5 }; var button2 = { somevalue: 0, othervalue: 5 }; var button3 = { somevalue: 0, othervalue: 5 }; and id of button clicked passed javascript so function isclicked(clicked_id) { selectedid = (clicked_id); } what trying accomplish value applied variable based on button clicked - if button1 clicked, button1 object changed, if button2 clicked, button2 object changed. i have looked @ programmatically setting name of variable , programmatically set variable nam

android - Get current track info and media controls -

android - Get current track info and media controls - in android wear google play music seems integrate somehow generic music controls, in android 5 lollipop can done using mediasession , in pre lollipop can't. can utilize medicacontrollercompat seems not work, nil on pre lollipop. how can create music media contoller? android wear (or google music mini) can skip next or prev track spotify example) the remotecontroller older equivalent new mediacontroller api, made public in android 4.4 (kitkat) , has number of onerous requirements non-system apps (such beingness enabled notificationlistenerservice), hence why deprecated along older remotecontrolclient api apps spotify use. tl/dr: non-public before android 4.4, public hard utilize on android 4.4, , totally new api on android 5. android music android-wear google-music

Postgresql function returning record - accessing individual columns -

Postgresql function returning record - accessing individual columns - i have function f_product_price(lab uuid, price_list uuid, product_class uuid), returns record of useful items. if utilize function in clause, works fine in version 9.3: select a.item_name, pl.base_price, .... lab l, items a, f_product_pric(l.id, l.price_list, a.product_class) pl lab.guid=? ..... but need in version 9.2, returns error: there entry table "pl", cannot referenced part of query. know how modify select? purposes sufficient access individual item name in select list : select a.item_name, f_product_pric(l.id, l.price_list, a.product_class).base_price, .... lab l, items ....... lab.guid=? ..... but returns syntax error @ or near "." right syntax? i have written this: select a.item_name, (select base_price f_product_pric(l.id, l.price_list, a.product_class)) base_price lab l, items lab.guid=? ..... function postgresql record

php - Bolt CMS - Identifier "rootpath" is not defined -

php - Bolt CMS - Identifier "rootpath" is not defined - after moving working bolt installation local machine server, maintain getting errors, no matter do. moving done via copying contents of files , vendor , app/cache folders , running composer update completed successfully. when run anything, illustration php app/nut , exception: php fatal error: uncaught exception 'invalidargumentexception' message 'identifier "rootpath" not defined.' in xxxxxx/vendor/pimple/pimple/lib/pimple.php:78 it's bolt 1.6 installation. installed finish zip file website , "converted" composer installed version. still working on system. the new server error running linux apache 2.4 , php 5.4.34. just covering off give-and-take on irc hits same problem. bolt docs needing update master branch released version 2, copying 1.x files void warranty. a workaround git pull --all , git checkout release/1.6 1.x branch.

serial port - SerialEvent() interrupt with arduino -

serial port - SerialEvent() interrupt with arduino - i have function foo(a,b,c,) runs long time in every void loop() execution (some seconds several minutes depending on a,b,c) , blocks arduino quite time, although function idle quite time ( delay(x) ). additionally, send arduino configuration commands via serial interface, are, of course, not processed while foo running. is there way process these input interruption-based, serialevent() interrupt? not necessary loop continues after processing input, there no need halt & resume running task. another alternative rewrite chunk of code, in add-on making quite bit uglier, avoid step if in way possible. thanks lot in advance. serial-port arduino interrupt

html - child combinator and span -

html - child combinator and span - i have style ! div > .action{ color: blue; } and code <div> <p class="action"> hey, first action paragraph. <span> span within action</span> <h3>not direct child, not div, h3 block</h3> <div>not direct kid div</div> <span> span within action, , after closing block</span> </p> </div> as result, first span blue, when h3, div , next span black. (tested on chrome, ie , ff) is there inline/block hidden rule ? edit : i've set illegal elements within paragraph. changing p div makes blue. thought don't expect that, think should work specs before returning there. by html syntax rules, p element cannot contain h3 element. rule enforced browsers: when encounter <h3> tag while p element open, implicitly close p element. (this implies </p> tag later

From UML to Java, Simple association -

From UML to Java, Simple association - this image i'm going transfer uml java, don't know how lock them , don't know how create 1 bankaccount locked 1 person. how connect 2 classes?? here code far my main method public class upp5 { public static void main(string[] args) { person2 david = new person2(); bankaccount acc1 = new bankaccount(); bankaccount acc2 = new bankaccount(); david.setname("david"); david.setpnr("551012-8978"); acc1.setbnr("37"); acc2.setbnr("38"); system.out.println("namn: " + david.getname() + " \npersonnummer:" + david.getpnr()); system.out.println(acc1.getbnr() + "\n" + acc2.getbnr()); } } bankaccount.java: public class bankaccount { private string bnr; private double balance; public void credit() { } public void withdraw(){ } public string

c# - Facing issues while converting stored procedure into entity framework function -

c# - Facing issues while converting stored procedure into entity framework function - i new entity framework. have procedure save shipment info , have convert procedure entity framework function. simple insert/update able utilize entity framework particular procedure facing issue. in below procedure have update shipment table have addressid, shipmenstatusid , serviceid foreign key. particular shipment record if address exists add together existing address id in foreign key column otherwise first add together new address address table , pick newly address id , update shipment address id column , same step shipmentstatustype , service type. here procedure script. create procedure spsavepackage @trackingnbr varchar(50), @carrier varchar(10), @packagetype varchar(20) = null, @shippeddate datetime = null, @scheduleddate datetime = null, @addressline1 varchar(50)= null, @addressline2 varchar(50)= null, @city varchar(50) = null, @state varchar(2) = null, @country varchar(2) =