Posts

Showing posts from July, 2011

MySQL Unknown Column Error 1054 Simple Update -

using mysql workbench, i'm getting odd behavior when attempting execute following statement: update jobs set customer = 'ben' po = 1011; the output of is: error code: 1054. unknown column 'jobs.po' in 'where clause' the goal here update statement, or equivalent, execute. can't determine issue. what's particularly odd following statements: select * jobs; select po jobs; select * jobs po = 1011; select po jobs po = 1011; all function expected. specifically, no errors, returns , displays entries asked for. why might select execute without 1054 error when update can't? the create table statement (if it's helpful), executed sql script through workbench: create table `jobs` ( po mediumint not null, part tinyint unsigned not null default 1, `last dash` smallint unsigned not null default 0, customer varchar(80), description varchar(350), completed date, notes varchar(350), constraint pkjobs primary

calculate Cookie Size in PHP -

i wanted read cookie , calculate length on server side using php, can't find direct method so. how achieve task ? what ? setcookie("user", "dino babu kannampuzha", time() + 3600); if (isset($_cookie["user"])) { $data = $_cookie["user"]; $serialized_data = serialize($data); $size = strlen($serialized_data); echo 'length : ' . strlen($data); echo "<br/>"; echo 'size : ' . ($size * 8 / 1024) . ' kb'; } // output length : 21 size : 0.232 kb

parse.com - Migrate from parse to backendless -

i want install backendless terminal in ubuntu 14.04 server @ home , don't have clue. after migrating parse backendless, need change parse client sdk ? thank you. i think might have few misconceptions. backendless mbaas parse, not iaas as heroku & mongodblabs together. stated parse server migration steps , heroku hosts parse-server source via nodejs, , points mongodb instance via config vars. however, can migrate parse baas endless utilizing export/import of tables , objects. if migrating backendless, need conform api/sdk. means rewriting code work them. if wish continue using parse api/sdk, need create server running nodejs express run parse-server, , link mongodb instance via heroku config vars connection using driver via standard mongodb uri. however, parse-server limited in scope @ point. may time before sorted out. why parse suggest setting local instance develop on, migrating hosted version before jumping in. things login authentication have issues ,

iphone - iTunes sync apps failed to install using Phonegap -

i have created .ipa file using phonegap. testing uploaded developer certificates , device udid. working fine. now, want distribute apps using application loader. uploaded apple distributor certificate , distribute mobile provision file on phonegap cloud , generated .ipa file. when tried apps iphone 6.3.1, giving me error: itunes sync apps failed install please me out of problem.. are trying submit app (you mentioned application loader used submitting apps) or install on devices testing? assuming trying install on devices testing. if app fails install, check 1 of these the mobileprovision using has device's udid. test apps can installed on devices udid included in mobileprovision (unless distributing enterprises) the mobileprovision installed on device (try using service testflight - you'll know whether device has necessary setup)

PHP PDO / Retrieving OUT Parameters from MySQL Stored Procedure -

i need retrieve out parameters mysql stored procedure. can't find explains (and makes sense me). try { $dsn = 'mysql:dbname=db_name;host=localhost'; $dbh = new pdo($dsn, 'usr_name', 'password'); } catch (pdoexception $e) { echo 'connection failed: ' . $e->getmessage(); } $stmt = $dbh->prepare("call db.stprnewuser(:usremail,:newuserok,:stprcomment)"); $stmt->bindparam(':usremail', $tmpemail, pdo::param_str); $stmt->bindparam(':newuserok', $newuserok, pdo::param_int,1); $stmt->bindparam(':stprcomment', $stprcomment, pdo::param_str,100); $stmt->execute(); $outputarray = $dbh->query("select @newuserok, @stprcomment")->fetch(pdo::fetch_assoc); print "procedure returned [" . $outputarray['@newuserok'] . $outputarray['@stprcomment'] . "]\n"; i found last 2 lines on item, returns null values. try this... see if works... try {

javascript - Parse string and loop angularjs -

i take string in format this: "something example $takethis $takethisalso". want parse string , list of strings have $ ($xxx). this: foreach($xxx in list) { var field = xxx; // here want field have value takethis // field } so best practice in angular. use old plain javascript or maybe have angular. sounds want filter function on angular, can accept predicate https://docs.angularjs.org/api/ng/filter/filter

java - How to start drawable animation after click ImageView? -

i have problem. want make drawable animation after click "imageview". found answer question , didn't find. my code looks like: import java.util.locale; import android.app.activity; import android.graphics.drawable.animationdrawable; import android.os.bundle; import android.speech.tts.texttospeech; import android.util.log; import android.view.motionevent; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.imageview; public class talking extends activity implements texttospeech.oninitlistener { private texttospeech tts; private button button1; private edittext edittext1; private animationdrawable penguinanimation; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.talking); tts = new texttospeech(this, this); button1 =

excel vba - Macro populating dynamic array (from userform checkbox selections) -

i have array (i have 4 of these) populated based on user selecting between 1 , 4 checkboxes. my question is: why can't populate array directly looping through checkboxes , finding selected ones? this doesn't work: dim chkbox control dim sectarr() variant dim s long s = 0 each chkbox in me.sectorsframe.controls 'sector-level frame if typename(chkbox) = "checkbox" , chkbox.value = true sectarr(s) = chkbox.caption s = s + 1 end if next this works: dim chkbox control dim sectarr variant, sectstr string sectstr = "" each chkbox in me.sectorsframe.controls 'sector-level frame if typename(chkbox) = "checkbox" , chkbox.value = true sectstr = sectstr & "|" & chkbox.caption end if next sectstr = right(sectstr, len(sectstr) - 1) sectarr = split(sectstr, "|") i either "subscript out of range" (with parenthesis on array) or type mismatch (without parenthesis). i'

ios9 - ObjectAL clipping popping with iOS 9 -

my drum app working fine until ios 9 update. when playing sounds rapidly there clipping popping type noise. until ios 9. not sure how fix? using objectal love there fix. thanks! link app handpan (by jacob cole) jacob cole https://appsto.re/us/cubj8.i one thing i've found it's samples buffered make popping sound. help - (void)playd1 { // [[oalsimpleaudio sharedinstance] playeffect:@"d1a.caf" ]; int randomsoundnumber = arc4random() % 3; //random number 0 2 albuffer *buffer = self.d1buffers[randomsoundnumber]; nslog(@"random sound number = %i", randomsoundnumber); self.d1sources = [alsource source]; [self.d1sources stop]; [self.d1sources play:buffer];

java - Authenticate users using servlet -

this question has answer here: authenticating username, password using filters in java (contacting database) 4 answers i implemented simple servlet checks if user exists in db, , if can continue main site. the servlet: protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { try { //obtain customerdb data source tomcat's context context context = new initialcontext(); basicdatasource ds = (basicdatasource)context.lookup(testappconstants.db_datasource); connection conn = ds.getconnection(); //checks if username , password exists in db preparedstatement ps = conn.preparestatement(testappconstants.select_users_by_name_stmt); ps.setstring(1,request.getparameter("username")); resultset rs =

wordpress - How to show one random post from a specific post type for 24 hours then refresh -

i'm not sure if possible, wondering if there anyway create wordpress query select post @ 00:00 in morning , show post 24 hours. when hits 00:00 following morning should refresh , show anther random post 24 hours. possible, if how? you can using wordpress transients api , wp_query class . $random_id = ''; if ( false === ( $random_id = get_transient( 'some_random_post_id' ) ) ) { // transient expired, create $args = array( 'posts_per_page' => 1, #return 1 value 'orderby' => 'rand', 'post_type' => 'yourposttype' ); $single_post_query = new wp_query( $args ); while( $single_post_query->have_posts() ){ $single_post_query->the_post(); $random_id = get_the_id(); set_transient('some_random_post_id', $random_id, 60*60*24); # save id returned } } //do stuff $random_id post id. note may not 24 hours since w

Nancy - Unable to resolve type: NHibernate.ISession -

my custombootstrapper looks below public class custombootstrapper : defaultnancybootstrapper { protected override nancyinternalconfiguration internalconfiguration { { //this tell nancy won't have in nhibernate assemblies implementations of our interfaces. return nancyinternalconfiguration .default .withignoredassembly(asm => asm.fullname.startswith("nhibernate", stringcomparison.invariantculture)) .withignoredassembly(asm => asm.fullname.startswith("fluent", stringcomparison.invariantculture)) .withignoredassembly(asm => asm.fullname.startswith("iesi", stringcomparison.invariantculture)); } } protected override void configurerequestcontainer(tinyioccontainer container, nancycontext context) { base.configurerequestcontainer(container, context); //container.register((c, p) => sessionfactor

Find logarithm in cuda -

how find logarithm in cuda? i'm looking device function. thanks you can use: logf(x) __logf(x) log2f(x) __log2f(x) log10f(x) __log10f(x) taken cuda programming guide (appendix d).

javascript - Get the id of <li> tag containing a specific value -

i have list as: <ul> <li id="l1">1</li> <li id="l2">2</li> <li id="l3">hi</li> </ul> by using jquery, got know if <li> contains value(say) hi. used: if($('li:contains('hi')')){ alert('got value'); } now want know id of <li> in found value 'hi'. how id? use this: var id = $('li:contains("hi")').attr('id'); jsfiddle

ios - How do I horizontally center the UIView in my UITableView section footer? -

Image
i'm adding either or down arrow image in uitableview section's footer so: uiview *view = [[uiview alloc] initwithframe:cgrectzero]; view.backgroundcolor = [uicolor whitecolor]; morebutton *morebutton = [morebutton buttonwithtype:uibuttontypecustom]; morebutton.frame = cgrectmake(0, 0, 60, 22); morebutton.sectionindex = section; if (self.expandedsection == -1){ [morebutton setimage:[uiimage imagenamed:@"downarrow.png"] forstate:uicontrolstatenormal]; } else { if (self.expandedsection == section) { [morebutton setimage:[uiimage imagenamed:@"uparrow.png"] forstate:uicontrolstatenormal]; } else { [morebutton setimage:[uiimage imagenamed:@"downarrow.png"] forstate:uicontrolstatenormal]; } } [morebutton addtarget:self action:@selector(morebuttonselected:) forcontrolevents:uicontroleventtouchupinside]; [view addsubview:morebutton]; return view; this works fine, except fact has image positioned way on left

java - How to use Kryo with RMI -

i see lot of questions if kryo can used replace default jvm serialization rmi uses, nothing in way of how set up. i've heard kryo "drop-in" replacement jvm serialization, , not sure if means can swap out jars runtime classpath (as case slf4j bindings, etc.), or else. so ask: how rmi using kryo instead of default jvm serialization java ships with? in advance! kryo not drop-in replacement java object serialization: new api; , rmi cannot made use it.

javascript - Create a button that changes between red and green -

i want create simple button changes between colors red , green click them indicate has been completed. know of simple way button change , forth between colors? setup of page isn't how want yet button needs configured before can format rest of page how like. left out css deals body , other things headings. here have far after looking online while: function colorchange(id) { var e1 = document.getelementbyid(id); var currentclass = el.getattribute("class"); if(currentclass == 'classa') { el.setattribute("class", "classb"); } else { el.setattribute("class", "classa"); } } #select { width: 10em; height: 1.5em; } .classa { background: red; } .classb { background: green; } <input type="button" id="select" onclick="colorchange('select')" class="classa" /> here native javascript version. first q

django - Why is template inheritance Failing? -

edit : please not mislead question, fault changes not working out. happen have projects named same( not smart idea ) confused everything, making changes in different project working in. sorry stackoverflow folks mislead. i have base template public_base.html <!doctype html> <!-- [if ie ]> <html class="no-js"> <![endif] --> <head> <!-- favicon web browser , smartphones --> <link rel="icon" href="{{ static_url }}images/img.png" type="image/x-png"> <link rel="apple-touch-icon" href="{{ static_url }}img/apple-touch-icon.png"> <!-- google fonts --> <link href='http://fonts.googleapis.com/css?family=homenaje|molengo' rel='stylesheet' type='text/css'> <!-- css section --> <link type="text/css" rel="stylesheet" href="{{ static_url }}maincss/bootstrap.min.css"> <link type="tex

visual studio 2010 - C# check if XML file is not corrupted before deserialization -

i didn't find problem in internet. deserialize data playlists. he code : using (var fs = new filestream("playlist.xml", filemode.openorcreate)) { xmlserializer xml = new xmlserializer(typeof(observablecollection<playlist>)); if (fs.length > 0) pl = (observablecollection<playlist>)xml.deserialize(fs); else pl = new observablecollection<playlist>(); } here result xml : <?xml version="1.0"?> <arrayofplaylist xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <playlist> <name>playlist1</name> <list> <media> <path>c:\users\tchiko\videos\suit tie (official lyric video).mp4</path> <name>suit tie (official lyric video).mp4</name> <type>video</type> </media> </l

kubernetes - Google Cloud Logging + google-fluentd Dropping Messages -

Image
i have rather small (1-2 node) kubernetes cluster running in gke ±40 pods running. problem @ hand it's not logging gce console properly. see lots of messages fluentd container(s) in following format: $ kubectl logs fluentd-cloud-logging-gke-xxxxxxxx-node-xxxx 2016-02-02 23:30:09 +0000 [warn]: dropping 10 log message(s) error_class="google::apiclient::clienterror" error="project has not enabled api. please use google developers console activate 'logging' api project." 2016-02-02 23:30:09 +0000 [warn]: dropping 1 log message(s) error_class="google::apiclient::clienterror" error="project has not enabled api. please use google developers console activate 'logging' api project." 2016-02-02 23:30:09 +0000 [warn]: dropping 3 log message(s) error_class="google::apiclient::clienterror" error="project has not enabled api. please use google developers console activate 'logging' api project." 2016-02-02

c# - EF - Error in converting type Dataaccess.Employees to ViewModels.Employee -

i have view model class called employee , ef entity called employees. if write below query error stating "cannot convert types, explicit conversion exists) know how solve using select new viewmodel.employee clause, wondering there concise way resolve ? appreciated -thanks var selectedemployee = (from q in emsctx.employees q.id == employee.id select q).tolist().firstordefault(); employeedata.employees = selectedemployee; if have 2 different types, if have same properties, need mapping between them. can in many different ways, tool automapper can help. automapper if have types largely (or completely) similar in public properties have. automapper allow make mapping configuration between 2 types , map them. for example, this: mapper.createmap<dataaccess.employee, viewmodels.employee>(); var dataemployee = // data access var viewmo

javascript - Pattern for global object in React Native -

is there well-established pattern allowing single object available modules in react native application? know can pass object routemapper every particular scene , access way, feels lot of boilerplate , repeated code when absolutely need accessible entire application. in fact, need listening events @ times. well, there react context. https://facebook.github.io/react/docs/context.html general wisdom is: don't use it.

How do I convert from url to embed code for vimeo youtube etc. using Javascript -

i have code var videoreg = new regexp(/^(<iframe.*? src=")(.*?)(\??)(.*?)(".*)$/mg); if( document.getelementbyid('area1').value.match(videoreg)) { var c1 = document.getelementbyid('area1').value; var divelement = document.createelement("div"); divelement.id = "mydiv"; divelement.classname = "mydivclass"; divelement.innerhtml = c1; document.body.appendchild(divelement); form1.reset(); var button = document.getelementbyid("remove"); button.addeventlistener("click", function() { divelement.parentnode.removechild(divelement); }); } else{ alert("please insert correct embed code!"); } } i want change paste in url , changes embed code iframe appears on screen.

php - How do i restrict a user accessing my site other than office which has got many branches -

i have site need restrict users downloading data when accessed outside office. office may 1 or more. have setting cookie in mind. not sure if safer method. computer cannot identified static ip. there other method? you can use .htaccess rule , add office multiple ip for example. rewritecond %{remote_host} !^127\.100\.110\.175 rewritecond %{remote_host} !^127\.106\.2\.36 rewriterule $ http://www.redirectdomain.net [r=301,l]

Ember.js: action with explicit target fails -

i guess i'm missing basic, following fails the action 'login' did not exist on app.appcontroller . template: <h2>click button , watch console</h2> <button type="button" {{action login target="app.appcontroller"}}>log in</button> controller: app.appcontroller = ember.controller.extend({ login: function() { // never gets here debugger; }, send: function() { // or here debugger; } }); jsbin: http://jsbin.com/okuqiv/5/edit (this pointing ember latest, it's same behavior 1.0-rc2, version i've been using couple of days; haven't tried on previous versions). upon debugging, seems somehow controller mixin not exposing functions should -- login() function added, send() ember function. it's missing other functions get(). i saw in app login() function exists on object app.appcontroller.prototype, while in jsbin exists on 1 of objects in mixin chain. at point i'd happy handle log

objective c - iOS Refactoring/design: One view controller to manage different models/streams? -

i'm working on app have different types of "streams" (think twitter). in have - pretty big - view controller manages of this. stream consists of 2 main entities - user , post - in different formats. in view controller have nsstring property determine kind of stream is. leads lot of this: if ([self.posttype isequaltostring:@"stream"]) { // stuff } else if [self.posttype ... [...] [...] i don't know if best solution design wise, , leads lot of coupling. thing avoid lot of duplication. there better/nicer way same thing? typedef enum{ stream, --, -- }posttype; better use this.. switch (_posttype) { case stream: //do want break; case --: break; case --: break; }

jquery - how to isolate CSS in a website gadget? -

this question has answer here: css in javascript widget colliding target page css 3 answers i have livescore website , trying make gadget of website show part of in others websites,the problem face how isolate code (javascript , css) code of host site gadget. use "anonymous function" this: (function() { // localize jquery variable var jquery; /******** load jquery if not present *********/ if (window.jquery === undefined || window.jquery.fn.jquery !== '1.8.3') { var script_tag = document.createelement('script'); script_tag.setattribute("type","text/javascript"); script_tag.setattribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"); if (script_tag.readystate) { script_tag.onreadystatechange = function () { // old versions of ie if (

php - Slim 3 access response/request object from another class -

i have utils class, need use $response/$request slim 3 use useful methods (ex: $request->geturi()->getpath()), how can access $request or $response that: class appcore { public static function allowroutepass($request, $response) { $reqmethod =$request->geturi()->getpath(); if (in_array($reqmethod, appconfig::ignore_routes)) return true; return false; } } thank everyone! ok, create question in githup slim repository here: slim 3 access response/request object class . there no way implement util class described above. check out link see more informations. in case, must change logics , implement util class in way.

android - How to read response from loadUrl()? -

i'm trying fetch , display webpage using webview, there chances of page redirection when webpage loaded, there option of reading url's coming response first request? have perform condition checks based on response url. look @ shouldoverrideurlloading(): webviewclient wvc = new webviewclient() { @override public boolean shouldoverrideurlloading(webview view,string url) { if (!url.startswith("http://m.youtube.com/")) { // return true; } else if (url.startswith("http://m.youtube.com/watch?")) { // different return true; } return false; } };

go - Can you target a specific port using icmp? -

i believe title pretty self explanatory, in case, i'll explain further. i writing function in go uses icmp check if particular service running. got idea ping implemented in go. when try command line ping, can not resolve 127.0.0.1:8080 , , function follows suit, makes sense. can use icmp check address , port missing? or should stick tcp target port? right have simple function, , could use tcp, i'm curious if use icmp. func (c *controller) ping() error { conn, connerr := net.dial("ip4:icmp", c.apiserverip) if connerr != nil { return connerr } conn.setdeadline(time.now().add(3 * time.second)) defer conn.close() return nil } no. there no ports in icmp. if want know whether specific tcp server running, try connect it.

osx - Where is the .idlerc folder for Python IDLE on Mac? -

i'm looking .idlerc folder idle. setup python 2.7.9 + mac osx el capitan. folder contains "config-highlight.cfg" file apply new custom themes. .idlerc should in home directory. code reading , writing in directory in idlelib/confighandler.py, in getusercfgdir 'method'. copied below, useless self parameter removed, , needed imports added. import os, sys def getusercfgdir(): """return filesystem directory storing user config files. creates if required. """ cfgdir = '.idlerc' userdir = os.path.expanduser('~') if userdir != '~': # expanduser() found user home dir if not os.path.exists(userdir): warn = ('\n warning: os.path.expanduser("~") points to\n ' + userdir + ',\n path not exist.') try: print(warn, file=sys.stderr) except oserror: pass

ruby on rails 4 - Cascading multiple models -

i'm deleting place , it's cascading rows of placeupload, cascade rows of match , tagcostumer while deleting place. how can that? class place < activerecord::base has_many :place_uploads end class placeupload < activerecord::base belongs_to :place has_many :matches has_many :tags_customers end class tagscustomer < activerecord::base belongs_to :place_upload belongs_to :tag end class match < activerecord::base belongs_to :place_upload belongs_to :customer end the solution use destroy , create callback automatically deep cascading. class place < activerecord::base before_destroy :delete_children_objects has_many :place_uploads, :dependent => :destroy protected def delete_children_objects @places = placeupload.where(place_id: id) @places.each |place| tagscustomer.where(place_upload_id: place.id).destroy_all match.where(place_upload_id

android - take a screen shot periodically -

to take one-shot, there's solution(closed). take screen shot programmatically is there sample takes screen shot periodically on background thread? basically want repeat steps mentioned in solution every x seconds? this thread give idea on begin.

arrays - Use Perl to only print only if the value of column A appears with every different value of Column B -

so in perl how can go through sample file so: 1 d z 1 e f 1 g l 2 d 2 e l 3 d p 3 g l so here want able print out values have value in first column appears every different value of second column. the output this: 1 d z 1 e f 1 g l cat test 1 d z 1 e f 1 g l 2 d i 2 e l 3 d p 3 g l perl -a -lne 'unless ( $h{ $f[1] } ) { print }; $h{ $f[1] } = 1; ' test 1 d z 1 e f 1 g l

c# - Tweak Visio 2013 context menu -

Image
is possible disable functions context menu in visio 2013 visio control? i want remove buttons painting , changing shapes want use specific shapes in visiocontrol. found solution replace shape button. can set pagelockreplace property of pagesheet true : visiocontrol1.document.pages[1].pagesheet.cells["pagelockreplace"].formulau = "true";

c# - How to get Dynamic Span id in jquery? -

iam using jquery in asp.net i have 1 user control in have div , in div table , in table tr , in tr td , in td have lables. ascx : <div id="container" runat="server" class="dvcontainer"> <table id="table" class = "tablecs"> <thead><tr> <td colspan="2"> <asp:label id="lbl1" text="swiss" runat="server" /></td> </tr> </thead> <tr> <td>abc</td> <td>def</td> </tr> <tr> <td><asp:label id="lblpa" text="sun 12/21 05:04" runat="server" /></td> <td ><asp:label id="lblpd" text="sun 12/21 19:00" runat="server" /></td> </tr> <tr> <td><asp:label id="lblaa" text="sun 12/

jquery - Body Click to Hide Element -

i have website i'm making, , have hidden menu, far works correctly, want when visible have option click on body make hide. so far have code, doesn't work, since i'm coding on codeine gives me error "attempting assign readonly property", plus, makes entire page disappear. here code segment, using in website parallax.js , fullpage.js //function hidemenu { //var $menu_visivel = $('.menu2').is(":visible"); //if ($menu_visivel) { //$('body').click(function() { //}); //} else { //}; //} here full pen , , debug page. in advance. check out working example in codepen . you can add click event document hide element. @ same time, need add stoppropagation event element well: $(document).click(function(event) { //check out clicking on element .menu , .menubutton if(!$(event.target).closest('.menu, .menubutton').length && !$(event.target).is('.menu, .menubutton&#

Cannot resolve class in same package, async android development using eclipse -

this first android project please excuse ignorance if have missed something! i trying change register form using json/php/mysql using async, error getting registertask cannot resolved type on line new registertask().execute(); my complete code this: package com.app.pubcrawlorganiser; import org.json.jsonexception; import org.json.jsonobject; import com.app.pubcrawlorganiser.library.databasehandler; import com.app.pubcrawlorganiser.library.jsonparser; import com.app.pubcrawlorganiser.library.userfunctions; import android.app.activity; import android.content.intent; import android.os.asynctask; import android.os.bundle; import android.os.strictmode; import android.os.strictmode.threadpolicy; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.textview; @suppresswarnings("unused") public class registeractivity extends activity {

r - interaction plot, not plotting a particular value -

i've created interaction plot , realized 1 line breaks in middle , because 2 factors on x axis has no value particular factor, although other factors, has value. looks (assume lines shown connected): _ / _ / 1 2 3 4 5 6 7 x axis basically there value 4, not 3 , 5 that's why looks does. how correct this? have set factor i read use na.rm doesn't work , looks same. thanks

localization - Combining keys and full text when working with gettext and .po files -

i looking @ gettext , .po files creating multilingual application. understanding in .po file msgid source , msgstr translation. accordingly see 2 ways of defining msgid : using full text (e.g. "my name %s.\n" ) following advantages: when calling gettext can see translated it's easier translate .po files because contain actual content translated using key (e.g. my-name %s ) following advantages: when source text long (e.g. paragraph company), gettext calls more concise makes views cleaner easier maintain several .po files , views, because key less change (e.g. key of company-description far less change actual company description) hence question: is there way of working gettext , .po files allows combining advantages of both methods, is: -usage of keys gettext calls -ability translator see full text needs translated? i answered similar (much older) question here . short version: the po file format simple, possible gene

javascript - Is there any viewWillAppear like-function in Sencha Touch -

i trying call function every time when view shows up. gets called first time , thenafter doesn't. there event-function viewwillappear of ios. using 'initialize' event function , gets called once. please help. view: ext.define('abc.view.abc', { extend: 'ext.list', xtype: 'runninglist', requires: ['abc.store.instancesstore','ext.data.proxy.jsonp',], config: { title: 'running', id: 'instancelist',/* itemtpl: '<div class="serached_listview">'+ '<div>{key} {key} </div>' + '<div><b>{key}</b> </div>' + '<div> {key}</div>' + '</div>' ,*/ store: 'runninginstancestore', listeners: [{ fn: 'initialize', event: 'initialize' } ] } }); controller: ext.define("abc.contr

c++ - How do I instantiate an array's size later? -

let's have base class called class base { public: std::string array[]; }; the size string array not decided until class extends it, what's correct syntax doing so? eg, later on in derived class derived::derived() { array[] = new array[40]; } if want use c-style array, size must fixed , known @ compile-time . , in case, use safer, zero-overhead std::array<> wrapper instead. if size of container not known @ compile-time, practice use std::vector (or std::deque in cases, based on requirements in terms of memory allocation) , avoid manual memory management through raw pointers, new[] , delete[] : #include <string> // std::string #include <vector> // std::vector class base { public: std::vector<std::string> myvector; }; besides, design won't require dedicated work in constructor (and destructor) of derived . if done derived 's default constructor allocate array, can avoid explicitly defining default constru

javascript - Multiple html stuff stuff stuff -

i have jquery code replaces whole column of buttons (when 1 clicked) short html line " new html if understand question correctly sounds want like: $(document).ready(function() { $('a').click(function(){myfunction()}); }); function myfunction() { $('#stuff').empty().append("<p>new html</p>") }

android - You need to use a Theme.AppCompat theme (or descendant) with this activity -

android studio 0.4.5 android documentation creating custom dialog boxes: http://developer.android.com/guide/topics/ui/dialogs.html if want custom dialog, can instead display activity dialog instead of using dialog apis. create activity , set theme theme.holo.dialog in <activity> manifest element: <activity android:theme="@android:style/theme.holo.dialog" > however, when tried following exception: java.lang.illegalstateexception: need use theme.appcompat theme (or descendant) activity i supporting following, , can't using greater 10 min: minsdkversion 10 targetsdkversion 19 in styles have following: <!-- base application theme. --> <style name="apptheme" parent="theme.appcompat.light.darkactionbar"> and in manifest have activity: <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name"

iphone - Core-plot legend title -

i trying add overall title legend using core plot on piechart cannot find seems support this, has managed through core plot library? use annotation. can add legend layer. use padding on legend create space along edge make room label.

Instant run in Android Studio 2.0 (how to turn off) -

Image
how disable instant run in android studio 2.0 preview. when go settings see it: and can not remove tick "enable instant run..." i use android studio 2.0 preview 9, error present in android studio 2.0 preview 7 also. update latest stable version of android studio. now, per stable available version 2.3.3 of android studio, if need turn off instant run, go file → settings → build, execution, deployment → instant run , uncheck enable instant run .

javascript - How to apply toggleClass to an element? Galleria -

i try build custom theme, based on "galleria theme classic", i'm straggling trigger class on button, think, miss something, this.addelement('play').appendchild('container','play'); var g = this; this.$('play').text('play').bind('mouseup', function() { g.playtoggle(); g.toggleclass("highlight"); // - line don't work }); i error @typeerror: g.toggleclass not function@ it looks you're calling toggleclass on wrong element, or element not jquery wrapped (not quite clear posted code). try this: $(g).toggleclass('highlight'); or this: g.$('play').toggleclass('highlight');

html - How to center a div horizontally with a varying width -

i did lot of research on , found if set width, can use margin: 0 auto left: 0; , right: 0 , , position: absolute , saw had declared width. well in case, doing button cursor: pointer; , not want set width because cursor turn pointer. in addition link , mess more. so, said, question is, how can div centered absolute value without declaring width. .blue-section { background-color: #9bd0d2; height: 500px; width: 100%; position: relative; } #blue-info-container { top: 20%; position: absolute; left: 0; right: 0; width: 70%; margin: 0 auto; text-align: center; } #blue-section-title { color: #fff; font-size: 1.4em; padding-bottom: 75px; } #blue-section-description { color: #fff; font-size: 1.2em; } #blue-section-button { position: absolute; bottom: 20%; left: 0; right: 0; width: 300px; margin: 0 auto; cursor: pointer; } #blue-section-button span { border: 1px solid #fff; text-align: center; c

c++ - How to design a public API to read configration settings? -

this general design question. have following format configuration file , i'd design api read it. should parse strings loaded config file , assign converted values related typed objects (to int or string in example). parsing errors occur during process. <configuration> <appsettings> <add key="countoffiles" value="7" /> <add key="logfilelocation" value="abc.txt" /> </appsettings> </configuration> i can think of 2 methods. problems these 2 designs? comments appreciated. one template method pattern: class config { public: virtual bool parsevalues() = 0; virtual void setdefaultvalues() = 0; bool trysetvaluesordefault() { if (!parsevalues()) { setdefaultvalues(); return false; } return true; } } class inttype::config { string str; public: int output_int; inttype(string str){ this.str = str;

php - codeigniter view data for each month based on location and date -

i have table below : image here and mysql structure : +--------+-------------------+---------+-------+----------+ | id_log | nama_kec | tanggal | bulan |kadar_ispu| +--------+-------------------+---------+-------+----------+ | 1001 | bengkalis | 1 | 12 | 100 | | 1002 | bengkalis | 5 | 12 | 0 | | 1003 | bandar sei kijang | 1 | 12 | 10 | | 1004 | bandar petalangan | 1 | 12 | 0 | +--------+-------------------+---------+-------+----------+ edit : here's controller call data public function tampil($id_bulan='') { //get $id_bulan $ambil_bulan = $this->db->select('nama_bulan,id_bulan') ->get('bpbd_bpbd_bulan')->result(); $output['ambil_bulan'] = $ambil_bulan; //get data nama_kec,tanggal, bulan, kadar_ispu $data = $this->db->select('a.id_log,a.nama_kec,a.tanggal,a.bulan,a.kadar_ispu,b.nama,c.nama

javascript - Trigger default event on styled select on android -

i have custom wrapper on select box. when click want display native select android. tried triggering "focus", "click" , "mouseenter" on hidden select none of options worked. ok, created fiddle after tinkering , worked (turns out webkit only). if comes better solution, appreciated. html <button id="clickme" value="click me!">click me!</button> <select id="select"> <option>default</option> <option value="1">1</option> <option value="2">2</option> </select> jquery var clickme = jquery("#clickme"), select = jquery("#select"); clickme.on("mousedown", function (e) { proxymouseevent(e, select[0]); }); clickme.on("click", function (e) { proxymouseevent(e, select[0]); }); function proxymouseevent(event, element) { var evt = document.createevent("mouseevents");

c# - What are the softwares prerequisite to run SQL Server on machine? -

i working on project in on client server architecture (network), want place sql server 2008 express database on centralised server, , .net windows application should able access them @ client machines. what minimum software requirements needed on server run sql server database such multiple client applications able connect simultaneously? the sql server installer checks prerequisites. if prerequisite not there, automatically install them or give link download them.

ibm mobilefirst - stop execution of worklight procedure -

can stop execution of worklight procedure(adapter).i have form.on submit click calls webservice through worklight adapter .and cancel button.how can stop execution on cancel button click? what asking not possible @ time in worklight.

javascript - Why does my Angular.js $location.path(url) loop back to root? -

using angular.js, i'm attempting create button when clicked pushes member new url (no page reload) , have $routeprovider set $routeparams controller use when making json call data. my $routeprovider setup so: app.config(function ($routeprovider) { $routeprovider.when('/list/:base/:keyword', { templateurl: 'list', controller: 'listctrl' }) }); this loads listctrl , using "list" template. on listctrl make call data so: app.controller('listctrl', function ($scope, $routeparams, $location, $http) { console.log('listctrl called'); $http.get('urlfordata&kw=' + $routeparams.keyword).success(function (data) { $scope.results = data; }); }); this works fine if hit url manually /#/list/basename/keyword puts right $routeparams listctrl , json call works. i'd user route on click, in homectrl have method change routes, so: app.controller('homectrl', function ($scope, $route