Posts

Showing posts from July, 2015

Randomly occurs with Meteor: "TypeError: Cannot read property 'invalidate' of undefined" -

on seems random occasions, when user on website tries answer question on quiz page, following error occurs: typeerror: cannot read property 'invalidate' of undefined @ tracker.dependency.changed (tracker.js:388) @ reactivevar.set (reactive-var.js:82) @ null. (builtins.js:22) @ view.js:191 @ function.template._withtemplateinstancefunc (template.js:437) @ view.js:190 @ object.blaze._withcurrentview (view.js:523) @ viewautorun (view.js:189) @ tracker.computation._compute (tracker.js:294) @ tracker.computation._recompute (tracker.js:313) i unsure why occurs, , not entirely sure when error means if point me in right direction, great! note: error seems occur when using chrome. i'll hazard guess, here's culprit code in tracker.dependency tracker.dependency.prototype.changed = function () { var self = this; (var id in self._dependentsbyid) // comment - we're expecting `tracker.computation` has `.invalidate()` method! self._dependentsbyid[id]

wordpress - How to modify uploaded file URL in Gravity Forms using "gform_save_field_value" filter -

i want modify uploaded file url before saving database when user submits gravity form. i trying acheive using "gform_save_field_value" filter in gravity form. when print fields inside filter function never file upload field id. other fields accessable inside filter function except file upload input field. add_filter( 'gform_save_field_value', 'save_field_value', 10, 4 ); function save_field_value( $value, $lead, $field, $form ) { print_r($field); } the gform_upload_path filter allow change upload path of file (and url). add_filter( 'gform_upload_path', 'change_upload_path', 10, 2 ); function change_upload_path( $path_info, $form_id ) { $path_info['path'] = '/home/public_html/yourdomainfolder/new/path/'; $path_info['url'] = 'http://yourdomainhere.com/new/path/'; return $path_info; } if need change actual name of file, here snippet makes cinch. http://gravitywiz.com/rename-up

php - How do you use Scrutinizer's dependency_paths config setting to hide issues in certain folders? -

i'm using scrutinizer-ci's static analysis functions provide feedback on php code. per their documentation , have .scrutinizer.yml file in root of project seems configuring scrutinizer's options way want them be. almost. one of options dependency_paths , allows me specify path contains dependency. according communicated @ scrutinizer... "the paths listed in dependencies different entirely excluded paths in @ them find classes or functions define make analysis of other files more accurate. not issues in these files." unfortunately, doesn't seem working me. i'm using saml authentication, , therefore have simplesamlphp folder in source code. (you can't include simplesamlphp via composer because have edit of config files , such based on how you're using it). the relevant part of .scrutinizer.yml file looks this: filter: paths: - application/* tools: php_analyzer: dependency_paths: - applicatio

java - How can I evaluate a hash table implementation? (Using HashMap as reference) -

problem: i need compare 2 hash table implementations (well hashmap one) , make reasonable conclusion. i not interested in 100% accuracy being in right direction in estimation. i interested in difference not per operation on hashtable "whole". i don't have strict requirement on speed if other implementation reasonably slower can accept do expect/require memory usage better (since 1 of hashtables backed primitive table). what did far: originally created own custom "benchmark" loops , many calls hint gc feeling of difference reading online using standard tool more reliable/appropriate. example of approach (mapinterface wrapper can switch among implementations.): int[] keys = new int[10000000]; string[] values = new string[10000000]; for(int = 0; < keys.length; ++i) { keys[i] = i; values[i] = "" + i; } if(operation.equals("put", keys, values)) { runputoperation(map); } public static long[]

Update Markers on Map from Searchresult using Leaflet, Search-Source and Meteor -

i want update markers on map. i'm using meteorhacks:search-source package searching. works. at moment markers set observing collection like: collection.find({}).observe({ now want 'observe' search result. can me? you can use observe of cursor cursor = collection.find({}) cursor.observe(function() { ... }) or can put collection.find() in template helper, meteor create observer watch changes of database , update related view template

disable textbox from taking special character in winforms C# -

i want disable special character text box in winforms (specially + , - symbol). have idea of e.handled, can't use using components exposes keyascii property me. public sealed class keypresseventargs : system.eventargs { public int keyascii = 0; public keypresseventargs(int keyascii): base() { this.keyascii = keyascii; } } you may take @ validators. https://msdn.microsoft.com/en-us/library/ms229603%28v=vs.110%29.aspx or create custom control (textbox). http://www.codeproject.com/articles/2016/writing-your-custom-control-step-by-step

android - codenameone server build error -

i designing android application using codenameone. after running application on codenameone simulator decided build, build server giving me following error log : executing: /home/ec2-user/android-sdk/tools/android create project --target android-21 --name application --path /tmp/build2045678520977010415xxx/application --activity applicationstub --package com.microserve.mssn created directory /tmp/build2045678520977010415xxx/application/src/com/microserve/mssn added file /tmp/build2045678520977010415xxx/application/src/com/microserve/mssn/applicationstub.java created directory /tmp/build2045678520977010415xxx/application/res created directory /tmp/build2045678520977010415xxx/application/bin created directory /tmp/build2045678520977010415xxx/application/libs created directory /tmp/build2045678520977010415xxx/application/res/values added file /tmp/build2045678520977010415xxx/application/res/values/strings.xml created directory /tmp/build2045678520977010415xxx/application/res/layout

Working of javascript inline functions -

i not able grasp how function(match, p1, p2) working. what use of match parameter? code breaks if don't write match parameter. function incrementstring(input) { if (isnan(parseint(input[input.length - 1]))) return input + '1'; return input.replace(/(0*)([0-9]+$)/, function(match, p1, p2) { var = parseint(p2) + 1; return up.tostring().length > p2.length ? p1.slice(0, -1) + : p1 + up; }); } p.s: new entirely using js development. however, have been working on jsf , java since past few years. from mdn : str.replace(regexp|substr, newsubstr|function[, flags]) in case, can see 2 arguments passed replace , regular expression literal , function expression. that's: str.replace(regexp, function) and mdn tells are: function (replacement) a function invoked create new substring (to put in place of substring received parameter 1). arguments supplied function described in "specifying function parameter" se

javascript - Uncaught TypeError: Cannot read property 'documentElement' of null Googlemap -

i realise question asked before, however, have strange bug. trying output data googlemap pgsql. when write query parameters coming form, data not outputted. xml file being created , query works in phppgadmin. however, if same query hard-coded, data outputted. ask why happens here code. <script type="text/javascript"> //<![cdata[ var customicons = { 7634: { icon: 'images/markers/1.png' }, 7644: { icon: 'images/markers/7.png' }, 7632: { icon: 'images/markers/8.png' }, 7633: { icon: 'images/markers/9.png' }, 7639: { icon: 'images/markers/10.png' }, 7646: { icon: 'images/markers/11.png' }, 7657: { icon: 'images/markers/12.png' }, 7649: { icon: 'images/markers/3.png' }, 7636: { icon: 'images/markers/4.png' }, 7648: { icon: 'images/markers/5.png' }, 7640: { icon: 'images/markers/6.png'

ios - CloudKit subscription Error: apsd[81] <Warning>: Silent Push: Deny app not available -

Image
i'm trying silent push cloudkit. works when app in foreground (or when launched xcode, in case notifications delivered in background too). i've enabled corresponding background modes. registered remotenotifications , specified background fetchinterval in didfinishlaunchingwithoptions uiapplication.sharedapplication().setminimumbackgroundfetchinterval(uiapplicationbackgroundfetchintervalminimum) application.registerforremotenotifications() i'm getting didregisterforremotenotificationswithdevicetoken no problems here. i've implemented method handling remotenotifications: func application(application: uiapplication, didreceiveremotenotification userinfo: [nsobject : anyobject], fetchcompletionhandler completionhandler: (uibackgroundfetchresult) -> void) { nslog(__function__) let identifier : uibackgroundtaskidentifier = uiapplication.sharedapplication().beginbackgroundtaskwithexpirationhandler(){ } coredat

php - MySQL: How to query multiple 'statistics' in a single query? -

this more of question rather problem need solve. backend fast , queries running great, it's not that important. okay, let's it. i have 4 panels of statistics on dashboard regarding number of views today, yesterday, week , month; each taking 1 query in database. wondering is, how 1 put queries ease load on database/server? i looking through stackoverflow before asking , saw 1 saying like: sum(case when status = 'open' 1 else 0 end) [open], sum(case when status = 'closed' 1 else 0 end) [closed] source: gathering multiple statistics table in single query which need, like: sum(case when date(created_at) = '2015-07-23' 1 else 0 end) today, sum(case when date(created_at) = '2015-07-22' 1 else 0 end) yesterday, sum(case when week(created_at) = '29' 1 else 0 end) week, sum(case when month(created_at) = '7' 1 else 0 end) month i wondering if has better suggestions, have applied function , works fine. the commen

ios - Using Swift Argo framework : Could not find an overload for '<*>' -

i using argo runes , box framework , have followed carthage way of adding frameworks. here model class cities import argo import runes struct cities { let cityname: string let citystate: string } extension cities: decodable { static func create(cityname: string)(citystate: string!) -> cities { return cities(cityname: cityname, citystate: citystate) } static func decode(j: json) -> decoded<cities> { return cities.create <*> j <| "cityname" <*> j <| "citystate" } } i following error : not find overload '<*>' accepts supplied arguments @ return cities.create <*> j <| "cityname" <*> j <| "citystate" how can fix issue? sample json : {"cityname":"panaji","citystate":"goa"} xcode: v6.4 after cities.create must put <^> operator here modified code: import argo import runes struct cities { let citynam

laravel - Eloquent Model has parent model -

i have model called user stuff name, country , relationships. now want model, e.g. vendor, having same functions , variables user including more stuff i thought was: class user extends model implements authenticatablecontract { use authenticatable; softdeletes; protected $dates = ['deleted_at', 'last_login']; protected $fillable = [ 'name', 'password', 'country', ]; protected $hidden = ['password']; public function logs() { return $this->hasmany('app\log'); } } and vendor model: class vendor extends user { protected $fillable = [ 'description' ]; public function user() { return $this->belongsto('app\user'); } public function products() { return $this->hasmany('app\product', 'vendor_id'); } the controller checks role of user , loads user model or vendor m

actionscript 3 - accessing current rowData of dataprovider in flex view -

i have view <view:sampledatagridview rowcount="{math.min(max_row_count, hostcomponent.datalist.length)}" dataprovider="{hostcomponent.datalist}" buttonmode="true" click="clickrow(event)" /> i want row clicked. tried using currenttarget , target event object wasn't of use. is there way can pass parameter in clickevent function clickevent(rowdata) or clickevent(currentrowindex) ? is there property when use dataprovider show currentindex ? data grid <mx:datagrid id="employeedatagrid" doubleclickenabled="true" itemdoubleclick="selectemployee(event);" dataprovider={employeelist} > handler protected function selectemployee(event:listevent):void { var selectedemployee:employee = event.currenttarget.selecteditem employee; }

php - how to unset query variable -

in order fetch data database (mysql) appending query depending upon user requirement chooses filters i've given him. @ specific point if condition met, want unset field (submissiondate) set variable before , set new field variable. e.g query is: $query = "select * table2 date(submissiondate) between '$variablename3' , '$variablename4'" but if following condition true: if($variablename8=="approved") so have append previous query , add $query = "$query , date(newdate) between '$variablename3' , '$variablename4'" note appending depending upon conditions met. can't write query again . different fields set different values if condition met have unset submissiondate , set newdate field b/w var3 , var4 , unset previous part was: date(submissiondate) between '$variablename3' , '$variablename4' so have neglect submissiondate effect while remain in query. there possible way sort type of p

html - Dynamically specify height of parent based on the tallest child element? -

i trying best figure out how set 2 columns' a-elements 100% of parent element, without specifying height, having chosen based on taller of 2 columns. @ same time, want vertically align a-element within it's column. current code: <div class="post-nav group"> <div class="post-nav-prev"> <div class="post-nav-border border-reset-right"> <?php previous_post('%', '', 'yes'); ?> </div> </div> <div class="post-nav-next"> <div class="post-nav-border"> <?php next_post('%', '', 'yes'); ?> </div> </div> </div> css: .post-nav { } .post-nav-prev, .post-nav-next { float: left; width: 50%; height: 100%; }

Android: ItemClickListener in ListView, which contains GridView -

i have listview , every item in listview contains gridview , header textview. want recognize when user clicks anywhere on whole item, tried set onitemclicklistener. unfortunately doesn't seem work because didn't debug log added click method. my listview looks following <listview android:id="@+id/listview_previous_issues" android:layout_width="match_parent" android:layout_height="wrap_content" android:descendantfocusability="blocksdescendants" android:layout_marginbottom="@dimen/article_separator_margin_topbottom" android:divider="@null" android:dividerheight="0dp" /> and gridview of list items this: <gridview android:id="@+id/read_news" android:layout_width="match_parent" android:layout_height="wrap_content" android:numcolumns="auto_fit"

Or condition in mongoDB -

i use operator "$or" in query. eg find({ $or: [{ quantity: { $lt: 20 }}, { price: 10 }]}) is there way tag records found criterion "price: 10"? no. returned list homogeneous, not know in list if entries found because quantity less 20, or price 10. just filter array, or iterate: var allmyentries = find({ $or: [{ quantity: { $lt: 20 }}, { price: 10 }]}); each entry in allmyentries: if entry.price == 10 //do whatever //do else of them

javascript - how to bind the following to the local this context variable on button click event? -

i need on this. how print lat , long using button click event like: <button id="geo" onclick="ongeoclick()"> location </button> i have following code: var getgeo = { showposition : function showposition(position) { self = this; console.log(self) self.lat = position.coords.latitude; self.lng = position.coords.longitude; console.log(self); }, showerror : function showerror(error) { switch(error.code) { case error.permission_denied: this.err = "user denied request geolocation."; break; case error.position_unavailable: this.err = "location information unavailable."; break; case error.timeout: this.err = "the request user location timed out."; break; case error.unknown_error: this.err = "a

javascript - Change the style of an input when submit is pressed -

https://jsfiddle.net/3vz45os8/7/ i've got jsfiddle want change background color of input text in specific color if word type , in 1 if word not type. it's doesn't work got no error in console. if u guys me. this js function, log every step , didn't error: function iscorrect() { var test = document.getelementbyid('test').value; if (test.value === "hello") { test.classname = "correct" return true; } else { test.classname = "incorrect" return false; } } var test = document.getelementbyid('test').value; if (test.value === "hello") { you're calling .value twice. take off first line, because otherwise you'll adding classname (which should camel-cased way) string value instead of input element. here corrected code , working copy : function iscorrect() { var test = document.getelementbyid('test'); if (test.value === "hello") { test

jpa - How i can achieve relational data using Hibernate Search? -

i using jparepository, chose hibernate search implementing search functionality. here link : http://hibernate.org/search/documentation/getting-started/ using entitymanager (jpa) rebuild index fulltextentitymanager ftem = search.getfulltextentitymanager(entitymanager); ftem.createindexer().startandwait(); suppose have 2 entity classes company.java & employee.java . employees(e_id) saved under company(c_id) , relation stored in table "company_employee". i want implement search on employees(not employees of other companies) associated company account. for eg: select e_id company_employee c_id = ? assume getting 3 employees of company , want fetch record of these 3 employees , not others. you fetch company , not employee : querybuilder qb = fulltextentitymanager.getsearchfactory() .buildquerybuilder().forentity(company.class).get(); in lucene query : lucenequery = querybuilder.keyword().wildcard().onfields("employees.employeename&qu

salesforce - getting Failed to enqueue tests.: Unknown Exception while running test class -

while running test class in developer console getting error failed enqueue tests.: unknown exception. the reason error have hit maximum salesforce limit. if using other unlimited edition. have wait 24hr reset.

apache - Redirect overwrites different rules in .htaccess -

i want redirect (301) 900 urls. made whole list, without errors, behaves string replace. take example line: redirect 301 /assortiment/artikelen_ingedeeld_per_branche/transporteurs_verhuisbedrijven3/verhuisdekens____baal_a_25_stuks_.html?id=979 http://example.com/221-transport-en-verhuisbedrijven and there line: redirect 301 /assortiment/ http://example.com/alle-producten when visit /assortiment/artikelen_ingedeeld_per_branche/transporteurs_verhuisbedrijven3/verhuisdekens____baal_a_25_stuks_.html?id=979 redirects /alle-productenartikelen_ingedeeld_per_branche/transporteurs_verhuisbedrijven3/verhuisdekens____baal_a_25_stuks_.html?id=979 notic assortiment --> alle-producten replacement @ beginning. if rewritten 'str_replace' see happening, don't understand .htaccess enough. the first redirect nothing. can't put query string in redirect . second working intended. way redirect works, sort of "starts with" approach. if directive

javascript - ReactJs error - Warning: setState(...): Can only update a mounted or mounting component -

i getting error can please tell me how can debug further? warning: setstate(...): can update mounted or mounting component. means called setstate() on unmounted component. no-op. can help? this component causing error: var postal = require('postal'), contactchannel = postal.channel("contact"), react = require('react'); var contactselector = react.createclass({ getinitialstate: function() { return { selectedcontacts:[] }; }, handlechange: function(e) { var id = e.target.attributes['data-ref'].value; if (e.target.checked === true){ contactchannel.publish({ channel: "contact", topic: "selectedcontact", data: { id: id }}); } else{ contactchannel.publish({ channel: "contact", topic: "deselectedcontact", data: {

gcc - How to make g++ force me to adhere to C++ standard -

i trying learn c++ having no previous experience or c, , see training materials trying teach me c coding instead of c++. as don't have enough knowledge discern if books trying teach me proper c++ or not, thought set parameter on g++ compiler save me problem. here question is: how can set g++ compiler in windows won't compile if writing not pure c++ standard? many in advance how can set g++ compiler in windows won't compile if writing not pure c++ standard? you cannot. agree of @lightness said in answer. not compiler's job warn of ways might invoking undefined behaviour (some of aren't detectable @ compile time). however , not agree part of answer equates -wall -wextra -pedantic "warnings turned way high". quoting gcc manuals (v5.2) on options mean, emphasis mine: -wall this enables all warnings constructions users consider questionable, , that easy avoid [...] -wextra this enables some warning flags

java - Setting connection reference to null after closing it -

is required/good practice set connection reference null after closing it? i closing connections in finally block. conn.close(); conn = null; i facing connection wait timeout exception during performance testing maximum connections getting exceeded. you'll see pattern in use when people want explicitly throw away reference, , aid garbage collection, , trigger finalisers. virtually redundant. if conn variable used indicate new connection required (by making field, perhaps, , resetting null before later reference) that's different pattern, unrelated immediate resource management.

Google Places API Web Service (PHP): how to get 'administrative_area_2 place_id' for a given 'place_id' -

my webapp receives place_id user-selected geo. example: if user chooses on frontend place called "comacchio" (it's town, part of administrative_area_level_2 called province of ferrara ) webapp recives place_id comacchio: chij0yhebbb1fkcr7yujotes0da . when query maps.googleapis.com said place_id, whole lot of information (see below) not 1 need: what need place_id administrative_area_level_2 of input place_id (which chij7y4reyxcfkcrwh-6_aubbwm provincia di ferrara ). as can see below, provincia di ferrara returned string, not place_id need. array ( [html_attributions] => array( ) [result] => array ( [address_components] => array ( [0] => array ( [long_name] => comacchio [short_name] => comacchio [types] => array ( [0] => locality [1] => political ) ) [1] => array (

jquery - Select element 100% width bug if option with long text is selected (Select2 bootstrap theme) -

i using select2 bootstrap 3 theme , select2 element overflow container if option long text selected , width of element 100%. this happens in mozilla firefox!! i create example .select2-container { width: 100% !important; } this code affect on element overflow span.select2-selection__rendered { white-space: nowrap; } set inline style: <select class="select2" style="width:100%"> comment .select2-container css: /*.select2-container { width: 100% !important; }*/ add 'element' width on select2 init: $('.select2').select2({ width: 'element', minimumresultsforsearch: infinity }); }); example: http://jsfiddle.net/chemark/z9slqlbx/ if using bootstrap try solution instead: http://xcellerant.net/2015/09/17/fixing-the-width-of-a-select-2-with-a-long-value-in-a-bootstrap-form-group-or-input-group/

css - HTML li class=youarehere not working -

am doing html website, , have main menu - home, etc . have several html pages , each page want menu li change color #e38400 . here code: <div id="nav"> <ul> <li class="youarehere"><a href="#"><h3>menuitem</h3></a></li> <li><a href="#"><h3>menuitem</h3></a></li> <li><a href="#"><h3>menuitem</h3></a></li> <li><a href="#"><h3>menuitem</h3></a></li> <li><a href="#"><h3>menuitem</h3></a></li> </ul> </div> and style.css code: .header #nav ul li .youarehere { background:#e38400; border-radius:5px; color:#fff; } but first list item still shows same color etc. want use neither jquery nor other script, why not working? you need remove li or place .

javascript - React error "Uncaught TypeError: type.toUpperCase is not a function" on a hello world app -

i have started dabbling reactjs, , on following tutorial , got error on title, on running simple hello world app. below single page code have: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>document</title> <script src="https://fb.me/react-0.13.3.js"></script> <script src="https://fb.me/jsxtransformer-0.13.3.js"></script> </head> <body> <script type="text/jsx"> // define class var helloworld = react.createclass({ render: function() { return <div> hello world! </div> } }); // create element class var element = react.createelement({helloworld}); // render class , place in body tag react.render(element, document.body); </script> </body&g

android - creating scrollable spinner to show some items -

i used spinner show items works when items less 5 items, , when want show 10 items error happens : unfortunately stopped :( how can use scrollable spinner show items in spinner here is: spinner.xml :and main <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/shw" android:orientation="vertical" > <textview android:id="@+id/txt3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_centerhorizontal="true" android:text="which" android:textcolor="#ffffff" /> <linearlayout android:id="@+id/linearlayout1" android:layout_width="match_parent&

html - How to set up a height for a <div> in responsive css designs? -

i trying make responsive website. issue if not setting div height bottom of div content has come , overlay top div contents. if sets height, when see in responsive takes full height , show white space. can guys please sort out? you want this: <div style="height:20%"> content </div> or <div style="height:40px"> content </div> use % specify amount of space div in current container or px number of pixels http://www.w3schools.com/cssref/pr_dim_height.asp

java - How to inject the variable in the abstract class while unit testing the subclass? -

i have abstract class basetemplate , multiple classes extending it. in 1 of concrete class( smstemplate extends basetemplate ), have private variable gson . have same private variable( gson ) in abstract class well. while unit tesing concrete class, methods in abstract class getting called concrete class. in unit test, using whitebox.setinternalstate(smstemplateobj, gsonobj); inject gson object private members of smstemplate , basetemplate gson getting injected in subclass. in abstract class, null , meaning not injected. below implementation. can please tell how inject gson object in abstract class? abstract class basetemplate{ private gson gson;//here not getting injected protected string getcontent(content content){ return gson.tojson(content); // error - gson here throws npe not injected } } class smstemplate extends basetemplate{ private gson gson;//here getting injected public string processtemplate(content content){ string st

java - How to run Custom application in WSO2 ESB -

i have wso2 esb 1 of esb option develop/deploy application, don't see documentation explains how deploy normal (not web, not ws...) main class in wso2 esb , see status of same. can suggest how run simple java application -- file reader , see/monitor application status/log in esb ? appreciate help. thanks , regards raaghu.k you can execute custom java code in wso2esb using "class" mediator , calling custom class, see https://docs.wso2.com/display/esb481/class+mediator , https://docs.wso2.com/display/esb481/writing+a+wso2+esb+mediator

javacard - Test RSA Keys For EMV card -

as per emv standard require 2 rsa keys. 1) issuer rsa keys ( use 1408 bit) 2) icc rsa keys ( use 1152 bit) here issuer rsa private keys use calculate icc public key certificate. emv card contain various tag 8f , 90 (issuer public key certificate) 9f46 (icc public key certificate) etc use in sda/dda. actually want personalize emv card using java language , want handle calculation own. require rsa keys ( sda/dda need rsa stuff) also emv have dgi8201-8205 that contain icc rsa private key in crt format. i know complex way understand emv technology in deep. body tell me how can rsa keys can solve purpose , can use in emv calculation. in advance. how can rsa keys you can generate own rsa crt keys testing purpose. wrote following code snippet generate rsa crt 1408 bit. note, interfaces , classes used found in java.security.* public static string bytetohex(byte[] data){ string r = ""; for(int i=0;i<data.length;i++){

mysql - SQL 3-table join unrecognized column -

i'm trying join 3 tables in order generate list of our users , locations. the first table lists of our users 2 separate ids--userid , uid. second table "orders" table user location data (delivery zone , billing zone) stored uid, , have third table acts location key (e.g., zone_id 18 = zone_name florida). what want each userid, plus converted human-readable zone_name each user's billing zone and delivery zone. my code works fine when try convert 1 of these zones. query works great: select u.userid, o.delivery_postal_code, o.billing_postal_code, z1.zone_name webapp.users u left outer join practice_drupal.uc_orders o on u.uid = o.uid left outer join practice_drupal.uc_zones z1 on o.billing_zone = z1.zone_id; but error when try generate zone_name second zone (delivery). error "unknown column 'z2.zone_name' in 'field list' ". here's query: select u.userid, o.delivery_postal_code, z1.zone_name, o.billing_postal_

External database connection via TYPO3 within a userfunction -

i using typo3 6.2.x , have second extern database , need update value table of database. so have implemented simple userfunction following example (pseudocode): public function updatevalue() { $updatedata = array( 'field1' => '1', 'field2' => '2' ); $globals['typo3_db']->exec_updatequery( 'example', 'value = 1234', $updatedata ); } that's not problem far, table "example" table of extern database. reason have activated dbal , adodb via extension manager. after have created file typo3conf/additionalconfiguration.php contains following configuration: <?php $typo3_conf_vars['extconf']['dbal']['handlercfg'] = array ( '_default' => array ( 'type' => 'native', 'config' => array( 'username' => '', 'password' => '',

python - How can I get PyGame's fullscreen mode to scale consistently on different computers? -

in short: same python script , same monitor, using pygame in fullscreen mode produces 2 different sized images on 2 different computers. i trying run pygame script on 2 computers, , need images displayed match each other in size on both computers. each computer has same monitor. without using fullscreen, pygame windows (and images of surfaces displayed) same size. when using pygame.display.set_mode((width,height),pygame.fullscreen) the images same size on both computers when ratio of (width,height) matches aspect ratio of native resolution of monitor. if use combination not on list, instance in case (1250, 850), images on screen scaled differently each computer. computers similar, not have same graphics adapter. in pygame documentation can find when requesting fullscreen display modes, exact match the requested resolution cannot made. in these situations pygame select closest compatible match. is pygame picking different match each computer? maybe can

multithreading - C# Garbage Collector, Threading and Compiler/Jitter optimization -

let's assume our program has central point (an instance of document class), kinds of information referenced. have 2 threads. both threads have access our "document" , "document" contains reference let's "params" (an object holds kind of information). if have reference "document" can use "document.params" our params object. thread 1 following: params tempparams = document.params; // local reference documents.params int = tempparams.a; // read data params // thread 1 (this thread) gets interrupted thread 2 int b = tempparams.b; // read data params int c = tempparams.c; // read data params thread 2 following: params newparams = new params(); ... // fill newparams new parameters lock(obj) { document.params = newparams; // update params in document } so content of "params" never changed, if change needed new copy generated , reference "document.params" get's updated new params block atomic ac

How to convert value #define'd in a macro to a char* (c++) -

in .cpp, want output file directory created @ compile time (determined time of compilation). have passed value via -dcompiletime=$(stuff time) in makefile. pass value stored in compiletime sprintf can create filepath string use place output file. i have tried: #define str(x) #x sprintf(filepath,"\"%s\file\"",str(compiletime)); as as #define str(x) #x #define strname(name) str(name) sprintf(filepath,"\"%s\file\"",strname(compiletime)); but ever get "compiletime/file" as output. your macros fine. here's test program: #include <stdio.h> #define str(x) #x #define strname(name) str(name) int main() { printf("\"%s/file\"\n",strname(compiletime)); return 0; } build command: cc -wall -o soc soc.c output: "compiletime/file" build command: cc -wall -o soc soc.c -dcompiletime=abcd output: "abcd/file" tested under gcc 4.9.2. the problem facing

angularjs - Uploading blob file to Amazon s3 -

i using ngcropimage crop image , want upload following this link: ngcropimage directive returning me datauri of image , converting blob (after converting blob object: has size , type), converted datauri blob using following code: /*html*/ <img-crop image="myimage" result-image="mycroppedimage" result-image-size="250"></img-crop> $scope.myimage=''; $scope.mycroppedimage = {image: ''} var blob; //called when user crops var handlefileselect=function(evt) { var file=evt.currenttarget.files[0]; var reader = new filereader(); reader.onload = function (evt) { $scope.$apply(function($scope){ $scope.myimage=evt.target.result; }); }; console.log($scope.mycroppedimage) reader.readasdataurl(file); var link = document.createelement('link'); blob = datauritoblob($scope.mycroppedimage) console.log(blob) }; angular.element(document.queryselector('#fileinput')).on('change',han

java - How to get (generic) type from class object -

i this: get "class" object generic type t but other way round. type of class objects. in pseudocode want this: public class exampleclass { public static final class<?>[] classes = new class[]{myclass1.class, myclass2.class, myclass3.class, myclass4.class, myclass5.class}; public void mymethod() { (class<?> c : databaseconfigutils.classes ) { myobjectdao<c.gettype(), integer> myobjectdao = getmyobjectdao(c); arraylist<c.gettype()> list = myobjectdao.queryall(); (c.gettype() element : list) { processelement(element); } } } public <t> myobjectdao<t, integer> getmyobjectdao(class<t> c) { return dosomething(c); } } but there nothing class.gettype() . how type of class object? your generic method getmyobjectdao seems answer own question. if have variable wildcard in type, can use generic helper method whe

html - Fixed position footer isn't scrollable horizontally off-screen -

i need footer stay fixed bottom of page @ times, , need give minimum-width left content , right content don't collide each other (as per designer's mock up). problem arises if user's viewport skinny, right side of content gets cut off screen, , there's no way access it. i'd not have change way menu behaves (adding media query breakpoints or something) , rather have menu acts more position:absolute @ bottom la position:fixed . any ideas? .footer { width: 100%; min-width: 500px; position: fixed; bottom: 0; left: 0; background: #eee; height: 50px; } .left { float: left; } .right { float: right; } } <div class="footer"> <div class="left">my left content</div> <div class="right">my right content</div> </div> try setting min-width property each side as .left { float: left; min-width:250px; } .righ