Posts

Showing posts from April, 2012

java - javax validation not validating complex object attributes -

i trying validate class using javax.validation.validator. below doing. final set<constraintviolation<paymentdetailsform>> set = validator.validate(accountpaymentdetailsform); my paymentdetailform looks this public class paymentdetailsform { private string paymentid; private string cardtypecode; private boolean newbillingaddress; private addressform billingaddress; private string securitycode; when submitting form validating paymentid,cardtypecode, etc. not validating billingaddress form inside paymentdetailsform. do need give anotation on getbillingaddress() method?

google maps - How can I get value of html element in sap ui5 xml view -

i'm trying google maps api example sap ui5 , following xml view: <html:input id="pac_input" class="controls" type="text" placeholder="enter location" /> <html:div id="type_selector" class="controls"> <html:input type="radio" name="type" id="changetype-all" checked="checked" /> <html:label for="changetype_all">all</html:label> <html:input type="radio" name="type" id="changetype_establishment" /> <html:label for="changetype_establishment">establishments</html:label> <html:input type="radio" name="type" id="changetype_address" /> <html:label for="changetype_address">addresses</html:label> <html:input type="radio" name="type" id=...

Installer created with Wix fails to be installed as system -

i have quite simple installer created wix toolset. users complaints can't deploy installer system user. have user. however, have learned installers can deployed system user. tell me need in wxs file can deploy system user? we typically deploy our msis using microsoft sccm system. use psexec invoke cmd prompt system our dev testing before sending sccm. there 2 reasons installer fail system: 1) user error: can't tell how many times i've seen packages put sccm invalid command line arguments. 1 of favorite quotation marks turned unicode quotation marks via email transmission. logging directory doesn't exist. forgetting tell msi run silently. sits there , hangs. awesome 1 typing msi name wrong. it's awesome because give me sccm log when ask msi log. no msi log means it's not msi's fault. 2) installer design error: have tested silent installs? have custom actions make assumptions user context / environment? 1 of old favorites (not) ...

mysql - Why this database migration error after I upgrade my version django-mptt? -

Image
my django application has requirements.txt file (shown here ) use install modules in virtual environment. works fine. however, i'm trying upgrade django-mptt 0.6.1 latest version. (i don't care upgrade django-mptt. want upgrade version of django. seems upgrade django, must first upgrade django-mptt described here ). pip install -u django-mptt . causes django-mptt go 0.6.1 0.7.4 , django go 1.7.1 1.8.2. , causes django-cache-machine origin master. can see changes in screenshot below. then when manage.py runserver prompts me migrate. that. no problems. subsequently if drop tables , run migrate again, error during migration: django.db.utils.operationalerror: (1005, 'can\'t create table `mydb_instance`.`#sql-21b_1e` (errno: 150 "foreign key constraint incorrectly formed")') full stack trace here . what error? have fact i'm using mariadb (server version: 10.0.15-mariadb homebrew) instead of mysql database? edit: portion below point adde...

html - display tooltip bottom of the button when hover state -

here website link in first row of button,, when hover, tooltip displayed , hidden background image. so need display bottom of button first row. i tried css: .swatch .tooltip, .bullet li .tooltip{ text-align:center; background:gray; color:#fff; bottom:80%; padding-top: 5px; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; display:block; position:absolute; width:100px; left:-23px; margin-bottom:10px; /* make invisible default */ filter:alpha(opacity=0); -khtml-opacity: 0; -moz-opacity: 0; opacity:0; visibility:hidden; /* animations */ -webkit-transform: translatey(10px); -moz-transform: translatey(10px); -ms-transform: translatey(10px); -o-transform: translatey(10px); transform: translatey(10px); -webkit-transition: .25s ease-out; -moz-transition: .25s ease-out; -ms-transition: .25s ease-out; -o-transition: .25s ease-out; transition: .25s ease-out; -webkit-box-shad...

jsf - Ajax call inside dataTable not working -

i trying make ajax call inside jsf datatable on checkobx value change. corresponding backing bean not getting fired. when tried same thing outside datatable, ajax call getting invoked , sop's getting printed. following code <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" > <h:body> <h:head></h:head> <section class="box"> <h:form> <f:event type="prerenderview" listener="#{adminaccounts.getappinfonew()}" /> <div class="row-fluid"> <div class="span7" style=""> <span class="heading">manage accounts</span> </div> ...

c# - No method 'Contains' exists on type 'System.Data.Linq.DataQuery`1[System.Object]' -

i trying build contains expression. private expression<func<t, bool>> contains<t>(string property, ienumerable<dynamic> values, t item) { parameterexpression pe = expression.parameter(item.gettype(), "c"); expression columnnameproperty = expression.property(pe, property); var somevaluecontain = expression.constant(values, values.gettype()); var convertexpression = expression.convert(columnnameproperty, typeof(guid)); expression expression = expression.call(somevaluecontain, "contains", new type[] { }, convertexpression); return expression.lambda<func<t, bool>>(expression, pe); } at run time got exception. "no method 'contains' exists on type 'system.data.linq.dataquery`1[system.object]'." the soultion cast values parameter list private expression<func<t, bool>> contains<t>(string property, ienumerable<dynamic> values, t item) { param...

c++ - Barnes-Hut and recursion limit -

i have implemented "barnes-hut" algorithm n-body simulator, , have run problem. my program crash, memory related exceptions, stack overflow exception. the thing makes strange error receive not occur @ fixed times, seems come out of blue. using task manager can see there no memory leak, , have been careful avoid this. though, use recursion, , objects in objects. is possible need include maximum depth of oct-tree , causing error? the maximal recursion depth indeed limited stack size. stack size not same full ram memory size. eg. on windows, default stack size (per thread) 1mb, nothing more. it´s possible reconfigure program, and/or "catch" stack overflow error without whole program crashing (latter rather dirty, @ least possible). nonetheless best solution modified code rid of recursion. recursions can replaced iterative solutions, bit more complicated. , data of each function call can moved vector etc. 1 entry per call, dynamic allocated ...

c++ - What does `clang-check` do without `-analyze` option? -

clang-check , clang's built-in static analysis tool, has -analyze option, string says "run static analysis engine." flag, see little output running clang-check on several of files; without it, see lot of warnings. isn't running static analysis engine main purpose of running clang-check , static analysis tool? why see less output when running engine, , tool without flag? running clang-check without options runs -fsyntax-only mode (checking correct syntax). if specify -analyze , static analysis tool executed, see http://clang-analyzer.llvm.org/available_checks.html full list of executed checks. note 1: can various other stuff clang-check, e.g. ast dumping. note 2: cannot specify -fsyntax-only , -analyze @ same time.

unicode - My Emoji Soft Keyboard is not supporting for Message EditText Field in android -

Image
my emoji soft keyboard not supporting message edittext field in android. other application whatsapp supported. example, in whatsapp , wechat application, textfield support emoji keyboard characters, in mobile messaging textfield shows ? or _ each character type using emoji soft keyboard. want integrate emoji character support in mobile messaging edittext field in android application. if please give me way solve problem, extremely gratitude answer. just try it: int unicode = 0x1f60a; string text = string.valueof(character.tochars(unicode)); //inputconnection.committext(text,mcomposing.length()); mcomposing.append(text); sss.append(text); committyped(getcurrentinputconnection());

javascript - Zooming on hover -

i have image color overlay , want add zooming on image when user hover on image. i'm trying achieve without jquery result don't mind using jquery. thanks in advance jsfiddle html: <div class="rss-output"> <div class="body"> <a target="_blank" href="#"> <div class="overlay-feed"></div> <div class="imagefix zooming" style="float:none;"> <img src="http://www.gettyimages.co.uk/cms/staticcontent/1391099215267_hero2.jpg" alt="" height="337" width="600"/></a> </div> </div> </div> css: div.rss-output { float: left; width: 33.333%; position: relative; padding: 15px !important; overflow: hidden; } .rss-output .body { width: 100%; position: relative; } .rss-output .overlay-feed { background: #000 none repeat scroll 0% 0%; z-index: 2; position: absolute; width: 100%; height: 200px; opacity: 0...

hadoop - "Permission denied" for almost everything after a successful ssh into gcloud instance that was created using bdutil -

just created instance , deployed cluster using bdutil. ssh works fine can ssh instance using ./bdutil shell . when try access directories such hadoop, hdfs etc., throws error: permission denied the terminal appears username@hadoop-m $ know hadoop-m name of instance. username? says name don't know got or password is. i using ubuntu ssh instance. not hadoop expert, can answer bit generally. on gce when ssh in gcloud creates username google account name. hadoop directories such hadoop or hdfs owned different user. please try using sudo chmod make give username permissions read/write directories need.

css - Make Class Inherit Styling From Another External Class -

this question has answer here: can css class inherit 1 or more other classes? 27 answers is possible make class inherit class (from different css file)? /* make class have .form.control's styling. form.control located in separate standard .css file*/ .token-input-list-facebook { .form-control; } edit further information: html element class 'token-input-list-facebook form-control' dynamically generated third party library. input gets turned input hidden ul auto-suggests things. go , edit 3rd party javascript. styling through stylesheets (css or less) more elegant method class="token-input-list-facebook form-control"

php - How to use my corporate account to login to Wordpress? -

i work @ company create wordpress website, need use corporate id login other employees don't have login every time should automatically logged in using corporate id (could auto detection ad login credentials or else). ideas welcome. there way can that? maybe ldap ad plugin help: https://wordpress.org/plugins/active-directory-integration/ there support forum on plugin page, suggest go there help. or attempt contact plugin creator.

android - Which type of database does Parse use? (SQL or NoSQL)? -

i new in parse.com don't know parse use database link sql or nosql. i use parse android application. appraising move parse platform not sure how database structure parse use , android app framework recommend? mongo db. similar question here

Python generate string based on regex format -

i have difficulties learning regex in python. want parse tornado web route configuration along arguments request path string without handlers request.path method. example, have route patterns like: /entities/([0-9]+) /product/([0-9]+/actions the expected result combine integer parameter (123) string like: /entities/123 /product/123/actions how generate string based on pattern? thank in advance! this might possible duplicate to: reversing regular expression in python generate string matches regex in python using answer provided @bjmc solution works this: >>> import rstr >>> intermediate = rstr.xeger(\d+) >>> path = '/product/' + intermediate + '/actions' depending on how long want intermediate integer, replace regex: \d{1,3}

java - Does String interning causes a String to be both in heap and in native memory? -

here javadoc string#intern: /** * returns canonical representation string object. * <p> * pool of strings, empty, maintained privately * class {@code string}. * <p> * when intern method invoked, if pool contains * string equal {@code string} object determined * {@link #equals(object)} method, string pool * returned. otherwise, {@code string} object added * pool , reference {@code string} object returned. * <p> * follows 2 strings {@code s} , {@code t}, * {@code s.intern() == t.intern()} {@code true} * if , if {@code s.equals(t)} {@code true}. * <p> * literal strings , string-valued constant expressions * interned. string literals defined in section 3.10.5 of * <cite>the java&trade; language specification</cite>. * * @return string has same contents string, * guaranteed pool of unique strings. */ lets have next code: string ref1 = "ref"; string ref2 = ref1.intern(); at point of time when ref in...

deployment - Windows PowerShell to Deploy Windows Store Appx Side Loading -

i trying set windows store app side loading. i have been following instructions such this one run troubles ms scheme , certificates . being unable code signing certificate work due bug in above thread - next step has been try , side loading work app , certificate use windows store. my current trouble comes when try add package using windows powershell. i have certificate signed app in current user & local computer certificate stores under both personal & trusted root certificate authorities certificates. i have app file sitting in current location: c:\temp\myapp.appxupload. next enter: add-appxpackage c:\temp\myapp.appxupload when run command - receive "deployment failed hresult: 0x80073cf0, package not opened." the log contains bit more information stating: "openerror: (c:\temp\myapp.appxupload) [add-appxpackage], filenotfoundexception". this article tells me there number of possibilities error be: the package couldn't o...

How to delete list item using SharePoint Online 2013 Rest API in C# -

i trying delete list item sharepoint 2013 online using rest apis c# managed code. here's essence of code: using (var client = new webclient()) { client.headers.add("x-forms_based_auth_accepted", "f"); client.credentials = myspcreds; client.headers.add(httprequestheader.contenttype, "application/json;odata=verbose"); client.headers.add(httprequestheader.accept, "application/json;odata=verbose"); client.headers.add("x-http-method", "delete"); client.headers.add("if-match", "*"); var requesturi = new uri("https://mysharepointsite.../_api/web/lists/getbytitle('mylist')/items(123)"); client.uploadstring(requesturi, string.empty); } i'm getting 403 permission denied, using similar pattern able create list item. using credentials webclient sharepointonlinecredentials object. sharepoint site administrator. so, wondering if have syntax/approac...

java - Fixing Android apps size -

im made first little app on android. i've been using android studio developing quite problem app designed fits 5.5" display. on other devices small or larger. don't know how make autosize according size of device. is there way fix or there way make different apks different mobiles (according display sizes) ps: there isn't picture in app. writing , calculations. kind of calculator beginners(me). :) if dont have images on app, set layouts , views width (when needed) 'match_parent' instead of 'wrap_content' or fixed size. set parent layouts height 'match_parent' , if have background fits screen, set too. check reference of layoutparams values: http://developer.android.com/reference/android/view/viewgroup.layoutparams.html if want add images go http://developer.android.com/guide/practices/screens_support.html , try understand concepts of densities independence , supporting multiple devices.

php - Warning: preg_replace(): Unknown modifier ']' -

i have following error : warning: preg_replace(): unknown modifier ']' in xxx.php on line 38 this code on line 38 : <?php echo str_replace("</ul></div>", "", preg_replace("<div[^>]*><ul[^>]*>", "", wp_nav_menu(array('theme_location' => 'nav', 'echo' => false)) )); ?> can please me fix problem? why error occurs in php, regular expression needs enclosed within pair of delimiters . delimiter can non-alphanumeric, non-backslash, non-whitespace character; / , # , ~ commonly used ones. note possible use bracket style delimiters opening , closing brackets starting , ending delimiter, i.e. <pattern_goes_here> , [pattern_goes_here] etc. valid. the " unknown modifier x " error occurs in following 2 cases: when regular expression missing delimiters . when use delimiter inside pattern without escaping it. in case, regular ...

python - How to insert text to QLineEdit in PyQt? -

i have error when insert data qlineedit . can see in button1clicked(self) method, can't execute : q.exec_("insert company (id, name, age, address, salary) values (self.idedit.text(),self.nameedit.text(),self.ageedit.text(),self.addressedit.text(),self.salaryedit.text())") but can text when use print(self.idedit.text()) . i don't understand why. hope can me. #-*- coding: utf-8 -*- import sys import sqlite3 pyqt4 import qtcore, qtgui pyqt4.qtsql import * def createconnection(): db=qsqldatabase.adddatabase("qsqlite") db.setdatabasename("test.db") db.open() def createtable(): q=qsqlquery() # q.exec_("create table if not exists company (id int primary key not null,name text not null,age int not null,address char(50),salary real)") q.exec_("commit") class model(qsqltablemodel): def __init__(self,parent): qsqltablemodel.__init__(self,parent) self.settable("comp...

express checkout - PayPal ignores response to instant update callback -

paypal ignoring response instant update callback. i'm on sandbox i'm getting callback i'm returning exact example result in documentation ...and paypal continues show default shipping fee here's return callback (the example response @ end of this page ): method=callbackresponse&offerinsuranceoption=true&l_shippingoptionname0=ups next day air&l_shippingoptionamount0=20.00&l_taxamt0=2.20&l_insuranceamount0=1.51&l_shippingoptionisdefault0=false&l_shippingoptionname1=ups express 2 days&l_shippingoptionamount1=10.00&l_taxamt1=2.00&l_insuranceamount1=1.35&l_shippingoptionisdefault1=true&l_shippingoptionname2=ups ground2 7 days&l_shippingoptionamount2=9.99&l_taxamt2=1.99&l_insuranceamount2=1.28&l_shippingoptionisdefault2=false i've tried simpler response no change in effect: l_shippingoptionamount0=20.00&offerinsuranceoption=false&l_shippingoptionisdefault0=true&l_shippingopti...

PHP: Parse CSS file, find quoted font-family value, copy rules/selectors without that quoted font, add class to all selectors with that font name -

here's simple example showing css. example input: html { font-family: "pt sans", helvetica, arial, sans-serif; color: #222222; } desired output: html { font-family: helvetica, arial, sans-serif; color: #222222; } .pt-sans html { font-family: "pt sans", helvetica, arial, sans-serif; color: #222222; } i've been using https://github.com/sabberworm/php-css-parser examples not detailed enough me figure out. this have far: <?php $css_string = ' html { font-family: "pt sans", helvetica, arial, sans-serif; color: #222222; }'; // create parser. $osettings = sabberworm\css\settings::create()->withmultibytesupport(false); $ocssparser = new sabberworm\css\parser($css_string, $osettings); $ocssdocument = $ocssparser->parse(); // font-family rules. foreach($ocssdocument->getallrulesets() $key0 => $oruleset) { $rules = $oruleset->getrules('font-family'); if (!empty($rules))...

Swift 2.0 String of JSON to JSON -

i'm working in swift 2.0 , struggling json. pulling json website in form of swift.optional<nsdata> . can convert string using if let x = nsstring(data: data!, encoding: nsutf8stringencoding){ let y = x string } i'm trying json data dictionary in swift , struggling. what's best way this? update let task = nsurlsession.sharedsession().datataskwithurl(url!) {(data, response, error) in if let z = nsjsonserialization.jsonobjectwithdata(data!, options:[]) as? [nsobject: anyobject] { } it errors with type of expression ambiguous without more context call can throw, not marked 'try' , error not handled in swift 2, if function "throws" (as nsjsonserialization does), have handle function call inside do ... catch block , use try before throwing function, this: let task = nsurlsession.sharedsession().datataskwithurl(url!) {(data, response, error) in { let z = try nsjsonserialization.jsonobjectwithdata(data!,...

asp.net mvc - How to set default value to select list in MVC during run time -

Image
i have view in loop through model , display details in editable mode. 1 of model value select list below @if (model != null) { (int = 0; < model.provider_service_dtls.count; i++) { <tr> <td> @html.dropdownlistfor(m => m.provider_service_dtls[i].activity_code_type, (selectlist)@viewbag.activity_code_type, "--- select activity code type ---", new { @class = "m-wrap" })</td> <td>@html.textboxfor(m => m.provider_service_dtls[i].activity_name)</td> </tr> } } here viewbag.activity_code_type contain values internal & standard when submitting if user selected internal value 1 pass controller , if standard 2 , here default value "--- select activity code type ---" now when open same request in edit mode if model value provider_service_dtls[i].activity_code_type 1 select list should default select internal , standard if 2 . i coded this @html.dr...

vi - How do you move the cursor to the end of a string in Vim? -

let's i'm editing line of javascript in vim: var opener = 'as gregor samsa awoke 1 morning uneasy dreams found himself transformed in bed gigantic insect'; if cursor on g in gregor , how move t in insect ? i'm not talking moving end of line . i'm talking moving end of javascript string encapsulated in single quotation marks. (i know can /'h , i'm wondering if there's more generic command—maybe % .) there's vi'<esc> , goes visual mode selection comprising interior of current string, , cursor @ end of selection — leaves visual mode. i'm not sure if there's better way.

MySQL Query to Select All and Convert Date -

how write query in mysql select , convert 2 unix date columns readable, i.e. - from_unixtime(received_date) without needing manually write out each of other column names in select statement? you can use select *, from_unixtime(received_date), from_unixtime(other_date_field) table; you have 2 date columns shown in both time stamp , readable formats in result. might want use rename readable columns so: select *, from_unixtime(received_date) date1, from_unixtime(other_date_field) date2 table; note wild card has come first: select *, field from... you'll error if select field, * from... i hope helps.

windows - cmd error: 'ANT' is not recognized as an internal or external command -

new here else discussed on site! anyway, i'm trying install ant on machine i'm getting error cmd: 'ant' not recognized internal or external command, operable program or batch file when running ant -version or ant -v . i'm using windows 7 machine (sp 1). echo %path% command returns c:\programdata\oracle\java\javapath;c:\oracle11g\product\11.2.0\client_1\bin;c:\ program files (x86)\intel\icls client\;c:\program files\intel\icls client\;c:\wi ndows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspo wershell\v1.0\;c:\program files\intel\intel(r) management engine components\dal; c:\program files (x86)\intel\intel(r) management engine components\dal;c:\progra m files\intel\intel(r) management engine components\ipt;c:\program files (x86)\i ntel\intel(r) management engine components\ipt;c:\program files\tortoisesvn\bin; c:\users\hat10024\desktop\eclipse\apache-ant-1.9.4\bin;c:\program files\nodejs\; c:\users\hat10032\appdata\roaming\np...

Error 18456 while connecting error while trying to connect to SQL Server -

i new databases.. doing small application needs connect sql server database. my sql server installed on company server i trying login sql server local system steps have tried far: since have admin credentials company server have logged in , included myself (sql server authentication) under security -> logins so when try connect local computer giving me "login failed user (microsoft sql server error 18456)". can 1 please me this? goal: want connect companies server local machine.

node.js - mongoose middleware pre update -

i using schema.pre('save', function (next) { if (this.ismodified('field')) { //do } }); but need use same function ismodified in schema.pre('update' hook, not exists. know how can use same functionality in update hook? not possible according this : query middleware differs document middleware in subtle important way: in document middleware, refers document being updated. in query middleware, mongoose doesn't have reference document being updated, refers query object rather document being updated. update query middleware , this refers query object has no ismodified method.

python - C# boolean capitalization -

i'm working in python c# library have edit. in python, booleans specified true/false. in c#, true/false. driving me crazy. there way use #define or make c# recognize true/false true/false? one way declare constant reflects true value. public const bool true = true; i wouldn't go down path though seems more personal choice. may confuse other developers , doesn't add general value.

Multiple Grails Application + tomcat-slf4j-logback, how to get application name into logfile -

we deploying several grails (2.4.4) applications tomcat 7 server , have configured logging described here tomcat-slf4j-logback . the desire configure grails applications via 1 logback.xml file log applications single file, discriminate log messages application name defined in grails' application.properties: #grails metadata file app.name=my-application our logback.xml appender looks this: <appender name="file" class="ch.qos.logback.core.rolling.rollingfileappender"> <file>${catalina.base}/logs/all.log</file> <append>true</append> <encoder> <charset>utf-8</charset> <pattern>%d [%x{appname:-null}] %-5level %logger : %msg%n</pattern> </encoder> ... </appender> as can see pulling 'appname' mdc (mapped diagnostic context). placed there grails filter in grails plugin shared applications looks application.properties file. produces ...

how to make javascript to only count the second? -

i have found following script online useful countdown time, want count seconds, e.g count 86400 seconds instead of 10days. if divide 60 @ first one, calculate seconds correctly, , show number, however, static , not moving since second should change every second.how can achieve that? don't understand why divide 1000 @ beginning either because don't know current_date format. appreciate helps. // set date we're counting down var target_date = new date("jul 10, 2016").gettime(); // variables time units var days, hours, minutes, seconds; // tag element var countdown = document.getelementbyid("countdown"); // update tag id "countdown" every 1 second setinterval(function () { // find amount of "seconds" between , target var current_date = new date().gettime(); var seconds_left = (target_date - current_date) / 1000; // format countdown string + set tag value countdown.innerhtml = secon...

javascript - model.fetch({success: function() }); taking long time to get the server response and getting delayed to load -

i'm writing model.fetch success function , taking time json response , delayed in loading. when debugging every time looping until success , again after in next iteration looping inside function my code follow: functionone: function (evt) { if (this.model.get('code') !== code) { // need handle selected type this.model.set('code', id); this.model.fetch({ success: function () { this.functiontwo(); } }); } }, functiontwo: function () { this.ui.list.trigger('change'); // if required reset single list this.initialize(this.options); this.method(); }

c++ - Runtime event handler in cpp? -

working on cpp project, need runtime event handler. primary goal keep track of various events takes place in sample program , based on events specific handlers triggered. these event triggering handlers/functions not contributing global objective of sample program, keeping track on various events in cpp sample program. my question prossible create soemthing custom eventhandlers in cpp? if yes, there tutorial creating such custom eventhandler? eg: event failed enter while loop. entered while loop, created object, deleted object, changed global variable etc. the simplest form of event handler registered callback function pointer: enum events { failedenteringwhileloop , successfullyenteredwhileloop , }; typedef void(eventhandler*)(events); void myeventhandler(events ev) { switch(ev) { case failedenteringwhileloop: // break; case successfullyenteredwhileloop: // break; } } eventhandler evh = myeventha...

javascript - Google Maps API v3 InfoWindow first appears in incorrect location, then loads correctly -

see page for reason, in first second of loading map, infowindow incorrectly appearing @ left edge , appearing in correct, middle position of map. want infowindow automatically in middle of map whenever loaded. there way can fix rough transition? in code out of order? seems if loading should smoother this. <div id="map-canvas"></div> <script> function initialize() { var mylatlng = new google.maps.latlng(29.950217, -90.075517); var centerpos = new google.maps.latlng(29.952365, -90.075853); var mapoptions = { zoom : 15, center : centerpos, styles : [{"featuretype":"administrative","elementtype":"all","stylers":[{"visibility":"on"},{"lightness":33}]},{"featuretype":"administrative","elementtype":"labe...

php - Class 'App\Libs\Emotes' not found (Laravel & Blade) -

i'm having issue laravel (5), been long time since haven't touched laravel since versions of 4, , laravel 5 released boarded train , thought have go it, emote phraser. basically over-all issue i'm having class "app\libs\emote not found" although think i've registered alias correctly us, prove me wrong. <!doctype html> <html> <head> <title>laravel</title> <link href="//fonts.googleapis.com/css?family=lato:100" rel="stylesheet" type="text/css"> <style> html, body { height: 100%; } body { margin: 0; padding: 0; width: 100%; display: table; font-weight: 100; font-family: 'lato'; } .container { text-align: center; display: table-cell; ...

java - Ctrl + Space autocomplete won't work in eclipse luna -

i have looked @ on page 1 of ctrl + space not working in eclipse in google. im using eclipse on windows 7 in java. i have checked: windows -> preferences -> java -> editor -> content assist -> advanced -> java proposals checked on windows, control panel –> region , language options –> advance tab –> language non-unicode program –> , made sure english(us) selected i have looked how check if eclipse hijacked couldn't find looking for. help? navigate windows->preferences->general->keys , check key binding content assist. if not there set control+space

c# - Get inner array of a list without using ToArray() -

i have method needs list or array. don't want create overload because it's not trivial method. decided make this: public float boundingbox(roadnode[] nodes) the roadnodes have on client side in array , in list. when client has list have call toarray() on list , call method that's unacceptable copies items new array. performance big issue don't want time consuming. should do? if you're enumerating on this, can change single signature: public float boundingbox(ienumerable<roadnode> nodes) if you're needing indexing behavior of both lists , arrays, can change signature to: public float boundingbox(ilist<roadnode> nodes) the first can more desirable, in can write code this: public float boundingbox(ienumerable<roadnode> nodes){ ilist<roadnode> list; if (nodes ilist<roadnode>) list = (ilist<roadnode>)nodes; else list = nodes.tolist(); //do list }

javascript - How to access an object member from event callback function in a class object on Ecmascript 6 (ES6) -

i've got : class register { render(){ return (<div onchange={this.afunction}></div>) }; afunction(event){ this.printsomething(); //uncaught typeerror: undefined not function } printsomething(){ console.log('horray'); } } how can call printsomething within afunction? es6 confuses me. thank you. you'll notice when using es6 classes react a lot has changed . also, es6 classes don't autobind way es5 react.createclass would. as result, need bind this of function you have 2 options 1. use arrow function render(){ return <div onchange={event => this.afunction(event)}></div>; } 2. use binding render(){ return <div onchange={this.afunction.bind(this)}></div>; } i assume you're using react.js this. if are, need update class register to class register extends react.component