Posts

Showing posts from May, 2012

Finding newest or flagged row in a one to many relationship in MySQL -

sorry if title poor, i'm trying join primary table related table , return single row matches flagged or recent row in related table. primary table, let's call group, has columns: id, name related table, let's call user, has columns: id, group_id, email, default, updated_datetime the query should return single 'group', , either matching record 'user' default=1 (preferred), or if no rows have default=1 row max(updated_datettime). 'user' have 1-n rows group.id = user.group_id. example result: group.id, group.name, user.email, user.default, user.updated_datetime 1, 'test', 'email', '0', '2015-06-10 12:00' 2, 'other', 'email', 1', '2015-06-08 10:00' both tables contain lot of data i'd prefer join's , not subqueries. know how subqueries i'm having trouble doing joins since grouping has multiple conditions. i'm fine doing aliases, eg: select a.* (query) i&#

angularjs - Using ng-repeat/ng-option select expression in custom directive -

ng-repeat , ng-select allow user pass in expression in style select x x.name. i'm wondering if it's possible use style of expression in custom directive. i've had through angular source ng-options , repeat, i've not been able find how evaluate these attributes. if point me example or documentation appreciated! edit: use case angular typeahead component, wish able pass in both arrays of primitives , objects, change how displayed assigned ng-model. own knowledge should ever become requirement use in work.

vba - Visual Basic - Screen shot then insert into email -

i new using visual basic. using visual basic in ms excel. struggling work out have paste screen shot email. have following, please tell need enter. thanks sub addtonaughtylist() ' ' addtonaughtylist macro ' range("y3:z3").select application.cutcopymode = false selection.insert shift:=xldown, copyorigin:=xlformatfromleftorabove range("u2:v2").select selection.copy range("y3:z3").select selection.pastespecial paste:=xlpastevalues, operation:=xlnone, skipblanks _ :=false, transpose:=false range("e2").select dim aoutlook object dim aemail object dim studentname string dim sendaddress string ' copy picture range("c6:s39").select selection.copypicture appearance:=xlscreen, format:=xlbitmap 'setup email set aoutlook = createobject("outlook.application") set aemail = aoutlook.createitem(0) studentname = activec

python - List of lists changes reflected across sublists unexpectedly -

i needed create list of lists in python, typed following: mylist = [[1] * 4] * 3 the list looked this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]] then changed 1 of innermost values: mylist[0][0] = 5 now list looks this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]] which not wanted or expected. can please explain what's going on, , how around it? when write [x]*3 get, essentially, list [x, x, x] . is, list 3 references same x . when modify single x visible via 3 references it. to fix it, need make sure create new list @ each position. 1 way is [[1]*4 n in range(3)] the multiplication operator * operates on objects, without seeing expressions. when use * multiply [[1] * 4] 3, * sees 1-element list [[1] * 4] evaluates to, not [[1] * 4 expression text. * has no idea how make copies of element, no idea how reevaluate [[1] * 4] , , no idea want copies, , in general, there might not way copy element. the option * has make new referenc

javascript - Meteor: getting route param on page loading -

here issue: trying make api call when loading page load 1 entity, saving few of entity attributes session - make 1 call, , use attributes whenever need them. but when try id param route, router.current() @ beginning of script, null. on other hand, when call same router.current() on helper , can param. any idea wrong / how can param before calling helpers ? here html using 1 of attribute: <input type="text" name="name" id="addcampaigninputname" value="{{currentcampaignname}}" placeholder="new campaign name"> and js: if (meteor.isclient) { $(function () { console.log( router.current()); ==>> null if( router.current() !== null) { meteor.call("getapicampaignsbyid", router.current().params.id, function(error, results) { session.set('currentcampaigndetailsname', results.data.name); session.set('currentcampaigndetailstrackingmethod', results.data.tra

android - AutocompleteTextView not showing its dropdown -

i've tried everything. initially trying set 2 adapters on same autocompletetextview (one @ time). first 1 worked removed that, , placed in place of it. arrayadapter<string> aa = new arrayadapter<string>(con, r.layout.dropdown_autocomplete, new string[]{"1", "2"}); pickup_at.setthreshold(1); pickup_at.setadapter(aa); aa.notifydatasetchanged(); this simplest possible code , should work. or making stupid mistake? your threshold 1 , length of string 1 too. change threshold 0 or increase length of string.

android - Add data fromEeditText to double -

i have app user can enter amount edittext want able add or subtract to/from double able display double textview within activity. i'm not sure how go , appreciate help. in advance! edit: forgot mention want data kept between app launches/closes. in activity accepts input edittext : double value = double.parsedouble(youredittext.gettext().tostring()); sharedpreferences prefs = preferencemanager.getdefaultsharedpreferences(this); if (adding) { value = prefs.getfloat("your.float.key", 0f) + value; } else { value = prefs.getfloat("your.float.key", 0f) - value; } sharedpreferences.editor editor = prefs.edit(); editor.putfloat("your.float.key", value); editor.apply(); in activity shows value: sharedpreferences prefs = preferencemanager.getdefaultsharedpreferences(this); double value = prefs.getfloat("your.float.key", 0f); yourtextview.settext(value.tostring());

javascript - How to modify the content of WebRTC MediaStream video track? -

i use webrtc in scenario in client video stream recorded on third-party server https://tokbox.com/ . put kind of watermark in recorded video. investigation brought me page http://w3c.github.io/webrtc-pc/#mediastreamtrack , seems technically possible since says that: a mediastream acquired using getusermedia() is, default, accessible application. means application able access contents of tracks, modify content, , send media peer chooses. this need, didn't find examples or explanation of function. i'd advice webrtc experts. you need use canvas route video getusermedia to, modify there, , use canvas.capturestream() turn mediastream. great - except canvas.capturestream(), while agreed in wg hasn't been included in spec yet. (there's pull request proposed verbiage mozilla wrote.) as far implementations: initial implementation of capturestream() landed in firefox nightly (41), , it's still behind pref until bug or 2 fixed. can enable canvas.ca

ember.js - Ember i18n dynamic link inside of translation -

i wondering how pass link {{t}} helper. using v3.0.1 of ember i18n @ moment. obviously cannot pass link helper t helper (something like {{ t "some-translation-string" link={{#link-to 'page' model}}page{{/link-to}} }} won't work of course). so thinking, maybe can create custom prop returns whole link. again, how create link?. know of method has same arguments link-to helper, returns link (in case 'page' , model )? you might able achieve basic link, doubt you'll able toss live link-to component inside translation. so instead split translation string pieces: {{t 'gotosettingpage-before'}} {{link-to (t 'gotosettingpage-link') 'route.name'}} {{t 'gotosettingpage-after'}} 'gotosettingpage-before': 'go to' 'gotosettingpage-link': 'settings' 'gotosettingpage-after': 'page.'

tomcat - Why is JMS messaging client unable to start, with fedora-commons 3.8.1? -

i trying upgrade fedora-commons , tomcat repository, run .jar install.properties used old install of fedora-commons. seems start fine without issues few seconds after start error message in catalina.out: exception in thread "thread-5" java.lang.runtimeexception: unable start jms messaging client, 5 attempts made, each attempt resulted in java.net.connectexception. messaging broker @ tcp://localhost:61616 not available @ com.yourmediashelf.fedora.client.messaging.messagingclient$jmsbrokerconnector.connect(messagingclient.java:389) @ com.yourmediashelf.fedora.client.messaging.messagingclient$jmsbrokerconnector.run(messagingclient.java:349) i found error message in fedora.log, here is: error 2015-06-10 11:41:57.966 [http-bio-8080-exec-23] (contextloader) context initialization failed org.springframework.beans.factory.beancreationexception: error creating bean name 'org.fcrepo.server.server' defined in servletcontext resource [/web-inf/applicationcontext.xml]: i

How to use predicates with LINQ to query CRM 2011 -

i trying use linqkit predicate. getting following code when trying compile. public void testpredicate(guid[] productids) { var predicate = predicatebuilder.false<product>(); foreach (var productid in productids) { var tempguid = productid; predicate = predicate.or(p => p.productid== tempguid); } } var query = p in context.createquery("product") .asexpandable().where(predicate) select p; } error 1: 'system.linq.iqueryable' not contain definition 'where' , best extension method overload 'system.linq.queryable.where(system.linq.iqueryable, system.linq.expressions.expression>)' has invalid arguments error 2 argument 2: cannot convert 'system.linq.expressions.expression>' 'system.linq.expressions.expression> please suggest me need fix it. thanks i believe using dynamics crm. following should work you. var query = p in context.productset .asexpan

Importing jHipster projects into intellij -

i start using intellij have used eclipse. imported same jhipster project have been working on in eclipse , intellij says missing springboot file. has ever encountered issue before? how did work through issue? now keep in mind still learning way around intellij , have ultimate version free 1 year (student version). turned on several reasons , want give solid shot. event log: 5:39:25 pm unknown natures detected imported projects contain unknown natures: org.eclipse.wst.common.modulecore.modulecorenature org.eclipse.m2e.core.maven2nature org.eclipse.jem.workbench.javaemfnature org.eclipse.wst.common.project.facet.core.nature org.eclipse.wst.jsdt.core.jsnature settings may lost after import. 5:39:26 pm error importing module 'hillcresttooldie': not find .springbeans 5:39:34 pm non-managed pom.xml file found: /users/drewjocham/documents/metal/hillcresttooldie/pom.xml add mave

python - How to read a asp.net page with BeautifulSoup? -

i trying scrape data webpage using beautiful soup. i running problems when try convert html document beautifulsoup object. when run code soup = beautifulsoup(html_doc) the error message im getting : syntaxerror: non-ascii character '\xa9' in file c:/users/mlee/pycharmprojects/bstest/htmlparse.py on line 683, no encoding declared; see http://python.org/dev/peps/pep-0263/ details i believe because there asp.net viewstate objects in html base64 encoded. is there suggested workaround or have use different tool? also, interested in getting javascript generated portions of text. there better way of doing this? thank you! put header #!/usr/bin/env python # -*- coding: utf-8 -*- on first line of htmlparse.py file, make sure pycharm saves file utf-8 encoded. this has nothing asp/viewstate. have utf characters in file. i interested in getting javascript generated portions of text. there better way of doing this? you might want use seleni

ios - Issue with Parse & Facebook -

i started develop app using parse , facebook. i've added both sdks. this viewcontroller code(the fblogin button of "connect facebook"): class viewcontroller: uiviewcontroller { override func viewdidload() { super.viewdidload() } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } @ibaction func fblogin(sender: anyobject) { var permissions = ["email"] pffacebookutils.logininbackgroundwithreadpermissions(permissions) { (user: pfuser?, error: nserror?) -> void in if let user = user { if user.isnew { println("user signed , logged in through facebook!") } else { println("user logged in through facebook!") } } else { println("uh oh. user cancelled facebook login.") } } }} this app delegate code: import uikit import parse imp

python - Understanding inheritance in practice. Printing values of an instance -

i have class of agents working __str__ method. have class of family(agents) . family structured dictionary agent id key. after allocating agents families, iterate on my_families : when print members.keys() , correct keys. when print members.values() , list of instances but, cannot access values inside instances. when try use method get_money() answer family class not have method. help? for family in my_families: print family.members.values() thanks providing more information. family class class family(agents.agent): """ class set of agents """ def __init__(self, family_id): self.family_id = family_id # _members stores agent set members in dictionary keyed id self.members = {} def add_agent(self, agent): "adds new agent set." self.members[agent.get_id()] = agent class of agents class agent(): "class agent objects." def __init__(self, id, qualification, mone

python - pandas read_gbq returns httplib.ResponseNotReady -

i using python google bigquery operations. i have google bigquery project names data-wagon. created dataset 'vols' , table 'flights'. this code i'm testing: # import pandas pd projectid = "data-wagon" data_frame = pd.read_gbq('select * vols.flights', project_id = projectid) print data_frame.head() # when run eclipse, web page displayed ask authorization, click yes have error message: your browser has been opened visit: https://accounts.google.com/o/oauth2/auth?scope=.................... if browser on different machine exit , re-run application command-line parameter --noauth_local_webserver traceback (most recent call last): file "c:\users\a452618\workspace\bigdatatutos\script_big_query.py", line 16, in <module> data_frame = pd.read_gbq('select * vols.flights', project_id = projectid) file "c:\python27\lib\site-packages\pandas\io\gbq.py", line 334, in read_gbq connecto

sql - Using the same table in a join -

i using microsoft sample database , questions sqlzoo.net learn sql job. stuck on question: for every customer 'main office' in dallas show addressline1 of 'main office' , addressline1 of 'shipping' address - if there no shipping address leave blank. use 1 row per customer. how use same table? you need alias table join onto itself. example: select t1.column1, t2.column2, ... table1 t1 join table1 t2 on t1.column1 = t2.column1

java - Docker tomcat edit expanded war files -

i using docker deploy tomcat container running third party war file. my dockerfile looks this from tomcat:7-jre8 add my.war ${catalina_home}/webapps/my.war when run container tomcat expands war @ runtime , can happily access app @ http://my.ip.addr:8080/mywar/ . however problem want edit couple of config files within war . don't want unpack , repack war file seems messy , hard maintain. i hoping able tell tomcat expand war part of run steps , use add put in custom files can't seem find way of doing this. war gets expanded when cmd executes , can't edit files after that. i not sure how achieve docker or else, dont see anyway ask tomcat expand war before starts. per standard practices not idea explode war , tweak contents. kills entire purpose of making war. rather should make changes app read configuration << tomcat_home >>/conf. if achieve thing need tell docker add configuration file containers tomcat conf folder. or if mu

c++ - how to use std::atomic<> -

i have class wan use in different threads , think may able use std::atomic such this: classs { int x; public: a() { x=0; } void add() { x++; } void sub() { x--; } }; and in code: std::atomic<a> a; and in different thread: a.add(); and a.sub(); but when getting error a.add() not known. how can achieve this? is there better way this? edit 1 please note sample example, , want make sure access class threadsafe, can not use std::atomic<int> x; how can make class thread safe using std::atomic ? you need make x attribute atomic, , not whole class, followed: class { std::atomic<int> x; public: a() { x=0; } void add() { x++; } void sub() { x--; } }; the error in original code normal: there no std::atomic<a>::add method (see here ) unless provide specialization std::atomic<a&

iostream - what is the difference between binary and txt modes in C++ -

this question has answer here: difference between files writen in binary , text mode 5 answers i began use c++ recently,and may seem nieve queation couldn't find answer it. when creating fstream object, have 2 options mode, binary , txt. fstream f ("file.txt",ios::out|ios::binary); , fstream f ("file.txt,ios::out|ios::binary); both write same strings when use overloaded operator << . question differwnce between 2 modes , affect number of bytes used write characters stream, need diifferent seekg when read data written each fstream ? certain special characters may changed depending on mode using. also, special characters changed may depend on os or computer system code runs on. with binary files sure file read as-is, on computer , regardless of contents of file. difference in kind of file io says all: text mode text based files, b

javascript - Neither .on or .live functions are recognized -

i frustrated right now. have been trying past half hour event delegation work. tried using .on , chrome told me wasn't function. i searched question $(...).on not function - jquery error and thought because using earlier version of jquery. because of that, decided include latest version of jquery google developer's website https://developers.google.com/speed/libraries/ here's included @ end of body tag <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> i thought solve problem if click on link under view source (ctrl + u) , click on jquery file, source code, leads me believe loaded properly. i tried use .live function , found out wasn't function either. there's no chance have syntax error either $("td > a")[0].on("click", function() { alert('hi') }) yet, following output console uncaught typeerror: $(...)[0].on not function @ :2:16

javascript - How do I show php error message when I'm submitting the form asynchronously? -

i'm using phpmailer send email ajax. so need send mail , have error messages submit.php , display on contact.php at moment every submission displays. message sent if hasn't. contact.php <div class="contact-form"> <div class="container"> <h2>we'd love hear you.</h2> <p>get in touch , lets kickstart project!</p> <form action="/submit" method="post" class="form"> <label> <input type="text" name="name" placeholder="name"> </label> <label> <input type="text" name="company" placeholder="company"> </label> <label> <input type="text" name="phone" placeholder="phone">

Java, How to subtract Date objects whilst considering DST -

i have piece of code used calculate number of days between 2 date objects, , in instances, works fine. however, if date range between 2 objects includes end of march, result 1 less should be. e.g march 31 2014 - march 29 2014 = 1, whereas should 2. i understand due fact march has 30 days of 24 hours , 1 day of 23 hours due dst, cause of value being 1 less. however, not sure best way account missing hour. // have int numdays = (int) ((dateto.gettime() - datefrom.gettime()) / (1000 * 60 * 60 * 24)); // have tried rounding, since should have 23 hours left over, didn't work. int numdays = (math.round(dateto.gettime() - datefrom.gettime()) / (1000 * 60 * 60 * 24)); any help/pointers appreciated. i , have use java 7 , not able use jodatime unfortunately. your second example close. parentheses math.round() surround subtraction, though, since that's integer (well, long really), nothing happens, , divide. other problem second bit of code doing int

c# - linq multi left join to same property -

is possible write linq query? (in .net 3.5) select tt.id ,tt.detailscount ,ttdmx.detailorder ,ttdmx.detailtype ,ttdm1.detailorder ,ttdm1.detailtype ,ttdm2.detailorder ,ttdm2.detailtype test.testtable tt left join test.testtabledetails ttdmx on tt.id = ttdmx.causeid , tt.maxcausedetailorder = ttdmx.detailorder left join test.testtabledetails ttdm1 on tt.id = ttdm1.causeid , tt.maxcausedetailorder - 1 = ttdm1.detailorder left join test.testtabledetails ttdm2 on tt.id = ttdm2.causeid , tt.maxcausedetailorder - 2 = ttdm2.detailorder the classes this: public class test { public int id {get;set;} public ilist<testdetails> details {get;set} } and public class testdetails { public int id {get;set;} public int detailorder {get;set;} public int detailtype {get;set;} } i tried queryover can't join same property twice. the easiest way write: ... ttdmx in db.testtabledetails.where(x => tt.id ==

sql - Cannot insert data over Linked Server into Redshift -

we've setup new linked server using amazon redshift odbc driver (x64) in sql server 2014 express. select statements work expected using openquery, eg: select * openquery(redshift_linked_server, 'select * tablea') however cannot use insert functionality of openquery, eg: insert openquery( redshift_linked_server, 'select singlevalue tablea') values ( '2' ) when run following error message back: ole db provider "msdasql" linked server "redshift_linked_server" returned message "unspecified error". ole db provider "msdasql" linked server "redshift_linked_server" returned message "transaction cannot have multiple recordsets cursor type. change cursor type, commit transaction, or close 1 of recordsets.". msg 7343, level 16, state 2, line 9 ole db provider "msdasql" linked server "redshift_linked_server" not insert table "[msdasql]".

python - Optimizing Push Task Queues -

i use google app engine (python) backend of mobile game, includes social network integration (twitter) , global & relative leaderboards. application makes use of 2 task queues, 1 building out relationships between players, , 1 updating objects when player's score changes. model class relativeuserscore(ndb.model): id_format = "%s:%s" # "friend_id:follower_id" #--- ndb properties follower_id = ndb.stringproperty(indexed=true) # follower user_id = ndb.stringproperty(indexed=true) # followed (aka friend) points = ndb.integerproperty(indexed=true) # user data denormalization screen_name = ndb.stringproperty(indexed=false) # user data denormalization profile_image_url = ndb.stringproperty(indexed=false) # user data denormalization this allows me build relative leaderboards querying objects requesting user follower. push task queues i have 2 major tasks performed: sync-twitter

php - Unable to find wrapper when testing Guzzle call with PHPUnit -

i writing unit test api developing. api written in codeigniter framework, calls api using guzzle. test writing verifies api call returns correct response. the test.php file contains following code require '/application/libraries/apiwrappers/breathehr.php'; class breathehrtest extends phpunit_framework_testcase { public function testcanreturnemployeearray() { $breathehr = new breathehr(); $employees = $breathehr->list_employees(1); $this->assertarrayhaskey('employees', $employees); } } the method being tested follows class breathehr { function __construct() { } public function list_employees($page) { $client = new guzzlehttp\client( ['base_uri' => 'https://xxx/', 'headers' => ['x-api-key' => 'xxx'], 'verify' => false] ); $request = $client->get('employees?page='

c# - The name 'Maps' does not exist in the current context error using google maps in asp.net -

i trying integrate google map in asp.net application, following error: the name " 'maps' not exist in current context " here code: @{ viewbag.title = "map"; } <!doctype html> <html lang="en"> <head> <title>map address</title> <script src="~/scripts/jquery-1.6.4.min.js" type="text/javascript"></script> </head> <body> <h1>map address</h1> <form method="post"> <fieldset> <div> <label for="address">address:</label> <input style="width: 300px" type="text" name="address" value="@request["england"]"/> <input type="submit" value="map it!" /> </div> </fieldset> </form> @if(ispost) { @maps.getgooglehtml(requ

business intelligence - MDX union members in different hierarchies -

what want create query shows members 2 different hierarchies side-by-side on same axis. example, this: ----------------------------------------------------------------- | | product | ----------------------------------------------------------------- | location | total amount | qty of product | qty of product b | ----------------------------------------------------------------- | usa | 9,249.23 | 2,382 | 1,009 | ----------------------------------------------------------------- | uk | 9,998.09 | 5,282 | 5,129 | ----------------------------------------------------------------- it’s clear can results need running 2 different queries, follows: select [measures].[sales amount] on 0, [country].[usa],[country].[uk] on 1 [cube] [time].[year].[2010] select crossjoin([product].[type].members, [measures].[sales quantity]) on 0, [country].[usa],[country].[uk] on 1 [cube]

JavaScript method of object not working -

i'm trying create simple object method changes value of 1 of keys. want initialize isfoodwarm key false, output value, change true, output again. expected output false , true, method should change true, getting error. tried removing parentheses mybreakfast.heat();, got rid of error, didn't change value. doing wrong? here code. function breakfast(food, drink, isfoodwarm) { this.food = food, this.drink = drink, this.isfoodwarm = isfoodwarm, heat = function() { if (isfoodwarm === false){ isfoodwarm = true; console.log("your food warm"); } } } var mybreakfast = new breakfast("english muffin", "oj", "false"); console.log(mybreakfast.isfoodwarm); mybreakfast.heat(); console.log(mybreakfast.isfoodwarm); i following console output: false uncaught typeerror: mybreakfast.heat not function you need attach heat method constructor breakfast too. , isfoodwarm property m

gorm - Find instance by name where query is any part of its name, Grails -

in java, string search its' substring goes this: string string = "madam, adam"; b = string.matches("(?i).*i am.*"); how find instance in grails name query part of name? i think you're looking for domainclass.findbynameilike("%i am%") that case insensitive search record name containing "i am". not efficient way query database, if application experience kind of load, should use sparingly. edit: documentation

apache spark sql - Scala extraction/pattern matching using a companion object -

the below code taken spark sql. performs extraction, casttype companion object - 1 call typecast.castto("abc", stringtype) . please explain how pattern matching works companion objects under hood? private[csv] def castto(datum: string, casttype: datatype): = { casttype match { case _: bytetype => datum.tobyte case _: shorttype => datum.toshort case _: integertype => datum.toint case _: longtype => datum.tolong case _: floattype => datum.tofloat case _: doubletype => datum.todouble case _: booleantype => datum.toboolean case _: decimaltype => new bigdecimal(datum.replaceall(",", ""))

c# - Timer Background transition -

i trying have form's background change when press button transition. i figured simple , fast way put white panel on form, blank backcolor, , change alpha component 0 250 250 0 when click button. when alpha reaches maximum value, want change background image. technique worked hour ago, color not change @ all, , code not entirely executed. here's function called timer : private void changeindex(object sender, eventargs e) { if (progressbar.value == progressbar.maximum-progressbar.step) { t.stop(); btndébut.enabled = true; btnfin.enabled = true; btnprécédent.enabled = true; btnsuivant.enabled = true; if (indicecourant >= dt.rows.count) { this.indicecourant = 0; } lblchargement.visible = false; progressbar.visible = false; remplitchamps(indicecourant); } progressbar.step = 10; progressbar.maximum = 200; progressbar.performstep(); mess

arrays - PHP: "Notice: Undefined variable", "Notice: Undefined index", and "Notice: Undefined offset" -

i running php script, , keep getting errors like: notice: undefined variable: my_variable_name in c:\wamp\www\mypath\index.php on line 10 notice: undefined index: my_index c:\wamp\www\mypath\index.php on line 11 line 10 , 11 looks this: echo "my variable value is: " . $my_variable_name; echo "my index value is: " . $my_array["my_index"]; what these errors mean? why appear of sudden? used use script years , i've never had problem. what need fix them? this general reference question people link duplicate, instead of having explain issue on , on again. feel necessary because real-world answers on issue specific. related meta discussion: what can done repetitive questions? do “reference questions” make sense? notice: undefined variable from vast wisdom of php manual : relying on default value of uninitialized variable problematic in case of including 1 file uses same variable name. majo

ibm bluemix - We are tring to configure for the first time Text To Speech bt Watson in Node Red with no luck -

please find attached node-red example, using watson's apis, no luck. tried connect mqlight components, javascript functions accessing api, , more. please find attached json files import in node-red. [{ "id":"e40a3407.1bf5c8", "type":"inject", "name":"", "topic":"", "payload":"watson please talk", "payloadtype":"string", "repeat":"10", "crontab":"", "once":false, "x":205, "y":176, "z":"8e90dcc6.716f2", "wires":[["df84c369.207b4"]]}, {"id":"df84c369.207b4", "type":"watson-text-to-speech", "name":"watson text-to-speech", "voice":"voiceenusmichael", "x":416, "y":262.9999237060547

javascript - Deprecated io.use() and io.get() with socket.io -

i'm writing game of tutorial : http://portal.bluejack.binus.ac.id/tutorials/creatingmultiplayerwebgameusingwebsocketnodejsandsocketio-part1-serverside and have problem deprecated socket.io. i have read guide : http://socket.io/docs/migrating-from-0-9/ but don't know how can change it... i have problem socket.set() , socket.get(). for example : var idx = playerin.push(slot); socket.set('playerslot', idx-1); or socket.get('playerslot', function(err, idx){ var slot = playerin[idx]; socket.emit('serverplayerstatus', slot); }); how can change it? thanks guys :) btw error : missing error handler on socket . typeerror: undefined not function @ socket. (/home/adelante/tutorial/app.js:87:16) @ socket.emit (events.js:107:17) @ socket.onevent (/home/adelante/tutorial/node_modules/socket.io/lib/socket.js:330:8) @ socket.onpacket (/home/adelante/tutorial/node_modules/socket.io/lib/socket

wordpress - Reorder woocommerce checkout -

i'm looking reorder woocommerce checkout page. it's post found here . but payment section remain @ bottom can seem able separate order info , payment info. the layout achieve is - cart review info - billing/shipping info - payment info thanks help you'll need edit form-checkout.php file within: public_html/yourfolder/wp-content/plugins/woocommerce/templates/checkout within file you'll see html skeleton, php injectors/hooks within. you'll need div's contain billing/shipping info , cart review/payment info. once you've found these, you'll need move hooks billing/shipping info newly created div/container between cart review/payment info information. billing/shipping info hooks: <?php do_action( 'woocommerce_checkout_before_customer_details' ); ?> <?php do_action( 'woocommerce_checkout_billing' ); ?> <?php do_action( 'woocommerce_checkout_shipping' ); ?> <?php do_actio

javascript - Is there a cost to jQuerying an existing jQuery object? -

i'm wondering whether lazily doing $( ) without first checking whether something jquery instance has performance downsides? the use case i'm thinking of function following: function foo( element ){ var $element = $( element ); // $element... } if pass jquery instance function, re-wrapping jquery instance jquery instance? , have performance implications (say, on many iterations)? foo( $( "#somediv" ) ); looking @ source code (v 2.1.4 of question), see jquery.fn.init checking selector that's passed it, , if it's not string, dom element or function, pass through jquery.makearray , return result. so there doesn't appear explicit checking within jquery "constructor" short-circuits if selector jquery instance. matter? makearray uses merge and/or push , there's bit of processing, significant? all right, since seem never able walk away yak needs shaving, here's jsperf test , seems suggest checking , short-circ

mysql - WebMatrix PHP Query Not working -

just heads have been writing php 3 days. having trouble query. when run query in query tool finds looking for. have tried every variation of syntax can think of using (how right now) , = , cannot work. sure there simpler way rest of code main concern right query. help. $incident_d = $_post['incident_d']; $incident_d = strtotime($incident_d); $incident_t = $_post['incident_t']; $incident_t = strtotime($incident_t); $incident_t = ($incident_t % 86400); $incident_dt = $incident_d + $incident_t; $sql = "select dept.department department dept inner join near_miss nm on dept.dept_index = nm.dept_index nm.incident_dt '%" . $incident_dt . "%'"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { // output data of each row while($row = mysqli_fetch_assoc($result)) { $result1 = $row['department'];

c# - How to make a radio button an image in ASP.NET webforms? -

i trying make basic form uses asp.net radiobuttons 5 different smiley faces. want remove radiobutton default , use image gets border when selected. far have been avoiding jquery , hoping done asp.net , c# code. general code each radiobutton far <asp:radiobutton runat="server" id="exceeded" groupname="experience" /> <label for="exceeded"> <img src="images/exceeded.png" /> </label>

vba - Linking Excel Tables in Access Gives Read-Only Error -

i have couple of excel 2010 files mapped , linked access 2010 database. need add file 3 mapped instead of two. linked excel file import , link tab under external database . seems okay. when run code re-maps excel file, gives me runtime error 3027: database or object read only. none of files or database read-only. this code re-map files new location (ex. x-drive mail w-drive), add new excel file. should added here let me add new files? private sub cmdacceptpath_click() dim db dao.database dim rs dao.recordset dim strsql string dim strpath string dim strfilename string dim strsourcedb string dim strtablename string dim slist string dim gmsgboxtitle string on error goto error_handler: docmd.setwarnings false strsourcedb = me.texcelpath.value set db = currentdb strsql = "update tblbackendfiles set setting=" & setdata(strsourcedb) & " code='sourceexcel'" docmd.runsql strsql '-- verify linked tables refreshing strsql = "select setting

java - Using AsyncTask to login user -

i need user , save variable. public class mainactivity extends actionbaractivity { user user = new logintask2().execute(""); } class logintask2 extends asynctask<string, void, user> { private exception exception; public string hash = ""; protected string doinbackground(string... t) { restclient restclient = new httprestclient(); restclient.setuseragent("bot/1.0 name"); // connect user user user = new user(restclient, "user", "somepass"); try { user.connect(); //hash = user.getmodhash(); return user; } catch (exception e) { e.printstacktrace(); this.exception = e; return null; } } protected void onpostexecute(string string) { } } it looks work, don't know how user . code error: error:(49, 47) error: incompatible types required: string found: asynctask<

javascript - Preload images that will be drawn on fabric.js canvas -

hello i'm building website display images on fabric canvas hovering on text content on site. there many text links connected many different images. there 1 image on canvas being displayed, there many in 'bank'. @ every hover call change source parameter of fabric.js image object. image never part of dom. my problem when page loads , user hovers on link takes @ least 2 'hovers', meaning user has enter , leave text link area @ least twice, display image. first hover-over downloads image, , when image loaded second hover-over displays it. is there way how preload these images pop on first hover? i'm using fabric.js image object. this how display first image. fabric.image.fromurl(source, function(img) { cnvs.add(img); }); and how change source parameter function changeimage(new_img_source) { var tmp=cnvs.item(0).getelement(); var src = tmp.src; tmp.setattribute("src", img_source); cn

c# - Equivalent operators and expression for &=, ~, |= in VB.NET -

i need convert following lines of code in vb.net confused operators, can describe name of these operators , equivalent in vb: long style= getwindowlong(hwnd, gwl_style); style &= ~(ws_visible); // works - window become invisible style |= ws_ex_toolwindow; // flags don't work - windows remains in taskbar style &= ~(ws_ex_appwindow); since vb uses keywords bitwise operators, doesn't offer shorthand self-assignment operator. have use: x = x , y , x = x or y also, equivalent '~' 'not' (same keyword logical 'not', different behaviour).

java - JavaFX Tooltip - border color bug -

Image
i have problem tooltips in javafx. illustration core of problem created new javafx project through intellij idea. root pane of project hbox alignment="center" , hbox contains 4 buttons (text: button a-d). every button has set tooltip text: sample tooltip a-b. through fxml file loading cascading styles saved in file named styles.css. problem description: launch application , when hover mouse on first button, it's tooltip looks css file describes. when hovering on second button, right border of tooltip brighter. when hover mouse on third or fourth button, right red border of tooltip visible, rather can see mix of it's background (yellow) , border color. none of others borders doing that, right border. it's strange behavioral. what tried: tried change font family, font size , padding. my question: causes issue? have got solution problem? , have got trouble too? screenshot shows issue described *mouse cursor hovering on button c main.java packa