Sunday, 15 June 2014

Creating dynamic content on Project page with Jenkins Plugin -



Creating dynamic content on Project page with Jenkins Plugin -

i'm getting started writing plugins jenkins, , i'm having problem making much headway in exceptionally terse documentation i've been able find it. main thing i'm trying generate dynamic content place on top-level page particular project. specifically, want show content derived recent build of project.

based on skeleton project , htmlpublisher plugin, i've been able create publisher plugin creates action getprojectactions, , action has floatingbox.jelly view, contents rendered @ top of project page. far, good.

now want create content dynamic. instance, publisher plugin might generate html content post-build step, , want display html (from latest build) @ top of project page. or (more likely), i'll want generate html based on builds, , display (e.g., plot showing some kind of "quality mesaurement" each of lastly n builds).

i'm brand new maven , jelly, , quite new jenkins matter, help useful.

update

i've found can utilize ${it} within jelly scripts access project object, can access publisher instance there, in order invoke methods on generate content?

the thing i've come far iterate on list of publishers provided getpublisherslist() on project object, , 1 class name matches class. can't find way instanceof in jelly script.

<j:foreach items="${it.publisherslist}" var="pub"> <j:if test='${pub.class.name == "com.example.mypluginname.mypublisherclassname"}'> <!-- ${pub} publisher instance, can invoke methods on it. --> </j:if> </j:foreach>

alternatively, if utilize jobmain.jelly instead of floatingbox.jelly, in case ${it} action itself.

jenkins-plugins

node.js - using octave script with Heroku app -



node.js - using octave script with Heroku app -

i have web application trying force heroku relies largely on calling octave script. development/testing, using ec2 instance , node.js. on ec2 instance have installed octave.

however when force heroku , seek phone call octave script (via ajax call), error: https://devcenter.heroku.com/articles/error-codes#h13-connection-closed-without-response

i read heroku runs on aws instances, assuming possible somehow phone call octave script, since have done on own ec2 instance.

scattered documentation makes me think have tell heroku install octave when force heroku, not sure how this. in node start script (and if so, how)? or else missing?

edit: thinking may instead have done through heroku buildpack -- can confirm this?

edit 2: think reply need octave buildpack, similar to: https://github.com/virtualstaticvoid/heroku-buildpack-r octave instead of r. looks 1 not exist seek hand @ making custom buildpack.

yes, have utilize buildpack. made 1 allows run octave scripts:

https://github.com/wclark3/heroku-buildpack-octave-dynare

it includes dynare, macro-modeling package. if come across reply , need octave, fork repo , take out lines include dynare bin/compile.

node.js heroku amazon-ec2 octave

iOS Crash Reporting with Manual Uploads -



iOS Crash Reporting with Manual Uploads -

i'm working on enterprise ios app unusual utilize case of running exclusively in background under various background modes. we'd implement remote crash reporting our app (we can't utilize itunes connect since it's not app store app) solutions we've been looking seem send crash logs next time app launched foreground. obviously, doesn't work us.

so, know of crash reporting tools out there capable of uploading crash logs in background or allow developer manually trigger upload when us?

you can utilize bugsense (https://www.bugsense.com/) finish , can configure send crash when occur or when app starts

ios crash-reports

objective c - How can you implement this multiline string literal macro in Swift? -



objective c - How can you implement this multiline string literal macro in Swift? -

in objective-c code gpuimage framework, have next macro:

#define stringize(x) #x #define stringize2(x) stringize(x) #define shader_string(text) @ stringize2(text)

which allows me inline multiline vertex , fragment shaders nsstring literals within custom filter subclasses, this:

nsstring *const kgpuimagepassthroughfragmentshaderstring = shader_string ( varying highp vec2 texturecoordinate; uniform sampler2d inputimagetexture; void main() { gl_fragcolor = texture2d(inputimagetexture, texturecoordinate); } );

gpuimage needs in order provide formatted vertex , fragment shaders included in body text of filter subclasses. shipping them separate files create framework unable compiled static library. using above macro, can create these shaders able copied , pasted between framework code , external shader files without ridiculous amount of reformatting work.

swift away compiler macros, , documentation has say:

complex macros used in c , objective-c have no counterpart in swift. complex macros macros not define constants, including parenthesized, function-like macros. utilize complex macros in c , objective-c avoid type-checking constraints or avoid retyping big amounts of boilerplate code. however, macros can create debugging , refactoring difficult. in swift, can utilize functions , generics accomplish same results without compromises. therefore, complex macros in c , objective-c source files not made available swift code.

per line "in swift, can utilize functions , generics accomplish same results without compromises", there way in swift provide multiline string literals without resorting string of concatenation operations?

alas swift multiline strings still not available, far know. when doing research regarding this, found workaround useful. combination of these items:

a quick hack quote swift strings in playground - describing how create service replacing , fixing texts the comment pyrtsa, regarding using "\n".join(...) emulate multiline strings setup automated service

using automator set service next properties:

a single action of "run shell script" tick off "output replaces selected text" change shell /usr/bin/perl add code excerpt below action window save "replace quoted swift multiline join" code excerpt print "\"\\n\".join([\n"; # start bring together operation # each line, reformat , print while(<>) { print " "; # little indentation chomp; # loose newline s/([\\\"])/\\$1/g; # replace \ , " escaped variants print "\"$_\""; # add together quotes around line print "," unless eof # add together comma, unless lastly line print "\n"; # end line, preserving original line count } print " ])"; # close bring together operation

you of course of study free utilize whatever shell , code want, chose perl familiar me, , here comments:

i used "\n".join(...) version create multiline string, utilize extension reply swift - split string on multiple lines, or + variant, i'll leave exercise user i opted little indentation spaces, , replace \ , " create little sturdier comments of course of study optional, , shorten code somewhat. tried opt clarity , readability the code, is, preserves spaces, edited if not wanted. left exercise user usage of service

open playground or code editor, , insert/write multline text:

mark text block execute xcode (or similar) > services > replace quoted swift multiline join

you have multiline string in proper swift coding. here illustration of before , after text:

here multiline text illustration both " , \ within text "\n".join([ "here multiline text ", "example both \" and", "a \\ within text" ])

objective-c swift

android - Live Streaming Video On App Inventor -



android - Live Streaming Video On App Inventor -

there live streaming video in 1 of app 1 of websites http://shirdisaiholidays.com/live-dharsan-3/.

i used activity starter uri rtsp://cam.live-s.cdn.bitgravity.com/cdn-live2-b1/_definst_/cam/live/secure/feed022/playlist.m3u8?e=0&h=ba7f5c5f6bf8a02d29f909dfa8d0c075. worked time has stopped altogether. said can utilize video player or player url source have used without success. shows error 702. other apps using same live streaming working fine.

android video-streaming app-inventor

php - insert into database error SQLSTATE[HY093] -



php - insert into database error SQLSTATE[HY093] -

i have been on busy script save info form

the connect.php sets connection database

(sorry dutch comments in between code)

<?php include('connect.php'); //gebruik de method ->exec(). raadpleeg de reader hoe je deze method moet gebruiken. $kijkerv =$_post['kijkerv']; $kijkert_v =$_post['kijkert_v']; $kijkera=$_post['kijkera']; $email = $_post['email']; $showid = $_post['showid']; seek { $sql = 'insert tblkijker (kijkerv, kijkert_v, kijkera, email, showid) values (:kijkerv, :kijkert_v, :kijkera, :email, :showid'; //het statement wordt toegevoegd aan een pdo statement object $s = $pdo->prepare($sql); //koppelen van parameters in de query string met de te inserten waardes $s->bindvalue(':kijkerv', $kijkerv, pdo::param_str); $s->bindvalue(':kijkert_v', $kijkert_v, pdo::param_str); $s->bindvalue(':kijkera', $kijkera, pdo::param_str); $s->bindvalue(':email', $email, pdo::param_str); $s->bindvalue(':showid', $showid, pdo::param_str); var_dump($kijkerv); var_dump($kijkert_v); var_dump($kijkera); var_dump($email); var_dump($showid); var_dump($sql); var_dump($s); //nu kan de query worden uitgevoerd $s->execute(); //id een auto_increment veld nu bepaald $stoelnummer = $pdo->lastinsertid(); $output = "uw kaarten zijn gereseveerd u heeftb stoelnummer: ".$stoelnummer; } grab (pdoexception $e) { $output = 'fout bij inserten van een rij: ' . $e->getmessage(); } ?> <html> <head></head> <body> <?php echo $output ?> </body> </html>

the error making appearance: fout bij inserten van een rij: (as set catch)

error sqlstate[42000]: syntax error or access violation: 1064 have error in sql syntax; check manual corresponds mysql server version right syntax utilize near '' @ line 2

what has gone wrong here?

you seem not close parantheses.

this:

$sql = 'insert tblkijker (kijkerv, kijkert_v, kijkera, email, showid) values (:kijkerv, :kijkert_v, :kijkera, :email, :showid';

should

$sql = 'insert tblijker (kijkerv, kijkert_v, kijkera, email, showid) values (:kijkv, :kijkert_v, :kijkera, :email, :showid)';

this should prepare error you're getting.

php mysql database insert connection

visual studio 2013 - How to disable CodeLens' references display in C# -



visual studio 2013 - How to disable CodeLens' references display in C# -

this question has reply here:

how turn off codelens-references 3 answers

i'm next a thread suggesting approach. image below shows, 1 can't disable feature show references languages.

when discovered that, tried c# lone (since that's language code in listed references' count annoyance). however, far can see, there's nil codelens under c# specifically.

do need turn off whole codelens thingy or there way disable aforementioned alternative only?

show references lot of heavy lifting other lenses. constructs phone call tree that's used compute tested by/tests relation reference count , test status. such cannot disabled without turning off other options.

there no way disable codelens on per-language basis. codelens supports vb.net , c# , it's all-or-nothing thing, since depends on roslyn under hood no other languages supported.

apart doing heavy lifting, reference indicator set in place placeholder prevent editor "stuttering" while other lenses loading. in beta worked way , incredibly annoying. there has been version showed empty space, , replaced showing reference indicator. both because should available , because it's quick compute , available offline.

i suggest file specific request changes want see on visual studio user voice. believe perfect time send microsoft feedback on topic, they're in between releases.

c# visual-studio-2013 codelens

asp.net - Usp_updateXXXX is throwing has too many arguements -



asp.net - Usp_updateXXXX is throwing has too many arguements -

we working on deadlock issue , went solution catching deadlock exception , resubmitting 6 times. users happy didnt errors new error thrown after 2 hours moved production below error "usp_updatexxxx throwing has many arguements" . issue happening whenever app encounters deaadlock exception.

please find code snippet below { //msg = string.empty;

sqlconnection _con = new sqlconnection(conn); sqlcommand _cmd = new sqlcommand(); sqldataadapter _adp = new sqldataadapter(_cmd); _cmd.connection = _con; bool isdeadlock = false; int retry = 0; //check deadlock , retry 6 times send same request { msg = string.empty; seek { _con.open(); _cmd.commandtype = commandtype.storedprocedure; _cmd.commandtext = "usp_updatexxxx"; //assign command parametrs _cmd.executenonquery(); isdeadlock = false; } grab (exception ex) { if ((ex.message.contains("was deadlocked on lock resources process , has been chosen deadlock victim")) || (ex.message.contains("deadlock")) || (ex.message.contains("transaction (process id"))) { isdeadlock = true; thread.sleep(5000); retry++; } else { msg = ex.message; isdeadlock = false; } } { con.close(); } } while (retry < 6 && isdeadlock == true);

can 1 help me code bug causing throw exception.

regards prashant

the issue happened because of looping used. when exception happens 1 time again going phone call loop without clearing existing parameters hence adding new parameters .

to resolve issue cleared parameters 1 time in exception section.

try{ //statements here } grab (exception ex) { if ((ex.message.contains("was deadlocked on lock resources process , has been chosen deadlock victim")) || (ex.message.contains("deadlock")) || (ex.message.contains("transaction (process id"))) { //used below statement command.parameters.clear() ; isdeadlock = true; thread.sleep(5000); retry++; } else { msg = ex.message; isdeadlock = false; } }

this resolved prob.

regards prashant

asp.net sql-server-2008 exception stored-procedures

swing - Java - UIManager.setLookAndFeel isn't working -



swing - Java - UIManager.setLookAndFeel isn't working -

i'm trying , sense work no success. i'm creating frame , painting applet within it. no exceptions thrown when execute program.

appscreen < applet:

public class appscreen extends applet implements runnable { protected appframe frame; protected graphics appgraphics; public void createframe(int width, int height) throws exception { uimanager.setlookandfeel("org.jvnet.substance.skin.substanceravengraphiteglasslookandfeel"); frame = new appframe(this, width, height); appgraphics = getappcomponent().getgraphics(); startthread(this, 1); } public void startthread(runnable runnable, int i) { final thread thread = new thread(runnable); thread.start(); thread.setpriority(i); } public component getappcomponent() { if (frame != null) homecoming frame; else homecoming this; } }

appframe < frame:

public final class appframe extends frame { private final appscreen screen; public appframe(appscreen screen, int width, int height) { this.screen = screen; setbounds(500, 500, width, height); setresizable(false); setvisible(true); tofront(); } @override public final void update(graphics g) { screen.update(g); } @override public final void paint(graphics g) { screen.paint(g); } }

for instance, phone call createframe(width, height) method.

java swing awt look-and-feel uimanager

jsf - dynamic view injection or routing -



jsf - dynamic view injection or routing -

i have jsf projekt , in there have different views, backed managedbeans.

what accomplish alter views while others remain are. has happen dynamically. in other words. want inject , remove views xhtml page without page refresh. have no clue how accomplish this.

even improve dynamic view injection based on urls. angularjs well. without routing great.

thanks in advance.

here illustration in pseudo code:

<nav> <h:link action="navigationbean.changeview(view1)" method="ajax">link1</h:link> <h:link action="navigationbean.changeview(view2)" method="ajax">link2</h:link> </nav> <h:viewcontainer> // view selected clicking nav links should injected here without page reload </h:viewcontainer>

what inquire improve done using facelet templating. you'll able way have page template shared content (the navigation menu in case) , create rest of views inherit it.

what can see suggested solution you're abusing post calls. #{fragmentspresenter.changeview('viewone')} doesn't create sense because know want go when press link (to viewone), you'll improve using plain links that.

here you've got illustration showing how handle navigation in proper way. let's suppose you've got view controller won't need in of cases:

viewcontroller.java

/** * give scope want bean depending on operations * oriented to. illustration @applicationscoped * * @author amaeztu * */ @managedbean @sessionscoped public class viewcontroller { /** * gets current view path , switches other 1 * * @return */ public string changeview() { string viewid = facescontext.getcurrentinstance().getviewroot() .getviewid(); if (viewid.equals("/view1.xhtml")) { homecoming "/view2"; } else { homecoming "/view1"; } } }

this controller's job check view coming , switch other one. it's pointless perform post request (to send form) navigate other view, while evaluate before page rendering.

here you've got how template view built:

template.xhtml

class="lang-xhtml prettyprint-override"><ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"> <h:head /> <h:body> <h:form> <!-- utilize post requests when have determine destination dinamically @ server side --> <h:commandbutton value="switch view post" action="#{viewcontroller.changeview}" /> <br /> </h:form> <!-- plain navigation, utilize requests --> <h:link value="go view 1" outcome="/view1" /> <br /> <!-- determine @ page rendering time , evaluate other view path --> <h:link value="switch view without post" outcome="#{view.viewid eq '/view1.xhtml' ? '/view2' : '/view1'}" /> <br /> <br /> <ui:insert name="content" /> </h:body> </ui:composition>

this template page defines shared button/link set , calls content. i've implemented different kind of navigation options. using <h:link /> is, in case, straight-forward way. check sec link, here evaluate current view id when gets rendered , link go opposite 1 created. cool, isn't it?

now here implementation of kid views:

view1.xhtml

class="lang-xhtml prettyprint-override"><ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" template="/template.xhtml"> <ui:define name="content"> <!-- here have @viewscoped bean managing content i.e. #{view1bean} --> view 1 </ui:define> </ui:composition>

view2.xhtml

class="lang-xhtml prettyprint-override"><ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" template="/template.xhtml"> <ui:define name="content"> view 2 </ui:define> </ui:composition>

you'll able type address in browser , see them, that's what's called bookmarkable ;-)

see also:

get current page programmatically

jsf facelets templating

passing click button event to different c# file -



passing click button event to different c# file -

i've added new cs file project (some function), , want start running when click button on main form. these 2 different files. used same namespace in both of these files, how pass click button event new cs file?

thx.

declare method in sec class static , phone call event.

void clickevent (...) { secondclass.staticdesiredmethod(...); }

instantiate sec class , phone call method.

void clickevent (...) { var secondclass = new secondclass(); secondclass.desiredmethod(); }

c#

knockout.js - Possible to use hasFocus binding in Knockout to determine table current row index -



knockout.js - Possible to use hasFocus binding in Knockout to determine table current row index -

i know row in table user has navigated or clicked on.

can knockout's hasfocus binding used track current row index, within view model can row index value needed?

the table populated in manner:

<tbody data-bind="foreach: siteslist"> <tr> <td data-bind ... > </td> <td data-bind ... > </td> . . . et cetera

there improve way but...

html:

<table> <tbody data-bind="foreach: siteslist"> <tr data-bind="event: { focusout: $parent.updateselectedrow }"> <td data-bind="text: $data"></td> </tr> </tbody> </table> index: <span data-bind="text: selectedrowindex"></span>

js:

function viewmodel() { var self = this; self.selectedrowindex = ko.observable(); self.siteslist = ko.observablearray(["google.com", "bing.com", "yahoo.com"]); self.updateselectedrow = function(row) { self.selectedrowindex(self.siteslist.indexof(row)); }; } ko.applybindings(new viewmodel());

here link fiddle demonstrates working: http://jsfiddle.net/trueeddie/l3yp4/2/

edit:

changed utilize event binding. got working mouseenter. maybe utilize onfocus event instead?

knockout.js

c# - Get MP3 from Google Translate special letters -



c# - Get MP3 from Google Translate special letters -

i using code:

using system.net; function() { using (webclient client = new webclient()) { client.downloadfile("http://translate.google.com/translate_tts?tl=en&q=hello", "a.mp3"); } }

its working fine. notice please english language language downloading. main problem comes when i'd same language using non-latin letter, illustration thai:

using system.net; function() { using (webclient client = new webclient()) { client.downloadfile("http://translate.google.com/translate_tts?tl=th&q=สวัสดี", "a.mp3"); } }

but giving me such nonsence mp3 without word sound. how prepare please?

notice main construction of website:

...translate.google.com/translate_tts?tl=**en**&q=**hello**"

...translate.google.com/translate_tts?tl=**th**&q=**สวัสดี**"

use httputility.urlpathencode("สวัสดี") encode unicode characters.

c# download mp3 translate letter

drools planner - Asymetric Distance Matrix for VRP in the OptaPlanner don't work correctly -



drools planner - Asymetric Distance Matrix for VRP in the OptaPlanner don't work correctly -

i implemented asymetric distance matrix vrp in examples of optaplanner suggested in alternative b of reply http://stackoverflow.com/a/19420978/3743175

however values of soft constraints not coincide total value of calculated distance of routes in tests.

anyone have thought of cause of this? i've checked several times, matrix right , problem not occur symmetric instances.

any help welcome.

thanks.

solution found:

i found problem in lines softscore calculation of examples: softscore calculated reverse arcs.

i replaced lines in vehicleroutingincrementalscorecalculator class:

class="lang-java prettyprint-override">... softscore -= vehicle.getlocation().getdistance(customer.getlocation()); ... softscore += vehicle.getlocation().getdistance(customer.getlocation());

with:

... softscore -= customer.getlocation().getdistance(vehicle.getlocation()); ... softscore += customer.getlocation().getdistance(vehicle.getlocation());

and fixed client class next method:

class="lang-java prettyprint-override">public int getdistancetopreviousstandstill() { if (previousstandstill == null) { homecoming 0; } homecoming previousstandstill.getlocation().getdistance(location); }

thanks.

optaplanner drools-planner

javascript - Passing additional (custom) arguments to a bootstrap modal -



javascript - Passing additional (custom) arguments to a bootstrap modal -

i'm using twitter bootstrap modal on page. need pass custom arguments it. how can it? , how access them within modal?

<!-- show modal --> $("#mymodal").modal("show"); <!-- modal --> #mymodal.modal.fade{tabindex: -1, role: :dialog, "aria-labelledby" => "mymodallabel", "aria-hidden" => true} .modal-dialog .modal-content .modal-header %button{type: :button, class: "close", "data-dismiss" => :modal, "aria-hidden" => true} &times; %h4.modal-title#mymodallabel take address .modal-body modal body .modal-footer %button{type: :button, class: "btn btn-primary"} ok

you seek using data-* attribute , jquery.data() api.

set argument declaratively using data-* attribute in modal tag:

<div class="modal fade" id="mymodal" data-argument="the_argument" ...> ... </div>

or set programatically using jquery.data() api:

$('#mymodal').data('argument', the_argument);

then, access argument within modal, query using jquery.data() api:

var the_argument = $('#mymodal').data('argument');

jsfiddle example: http://jsfiddle.net/drk6c/

javascript jquery twitter-bootstrap twitter-bootstrap-3

asp.net - Loop through programmatically added html in literal control -



asp.net - Loop through programmatically added html in literal control -

i wondering if there way loop through html checkboxes have added in literal codebehind.

i have tried:

protected sub splitpdfpagesbutton_click(sender object, e eventargs) handles splitpdfpagesbutton.click dim integer = 0 each c command in page.controls if typeof c htmlinputcheckbox dim cb htmlinputcheckbox = directcast(c, htmlinputcheckbox) if cb.checked = true += 1 end if end if next msgbox(i) end sub

but think problem loop finds literal container(?).

the reason doing because don't know how many checkboxes generated before runtime.

this code far (as notice commented out section, have tried adding asp.net controls , replacing htmlinputcheckbox snippet above checkbox):

for each fil fileinfo in allfiles '########################################################## 'add image controls 'dim hl new hyperlink 'hl.id = pagecount 'hl.cssclass = "preview" 'hl.navigateurl = "xxx" 'hl.imageurl = "xxx" 'hl.width = 20% 'hl.height = 20% 'form1.controls.add(hl) 'form1.controls.add(new literalcontrol("<br />")) ''add checkboxes 'dim chb new checkbox 'chb.id = pagecount 'chb.text = "break here" 'dim lb new label 'lb.text = "page #" & pagecount 'form1.controls.add(lb) 'form1.controls.add(chb) 'form1.controls.add(new literalcontrol("<br />")) 'pagecount += 1 '############################################################ str '.appendline("<img src=""xxx"" style=""width:50%; height:50%""/><br />") .appendline("<b>page #: " & pagecount & "</b>") .appendline("<div class=""leavespace""></div>") .appendline("<a href=""xxx"" & """ class=""preview""><img src=""xxx & """ style=""width:20%; height:20%;""/></a><br />") '.appendline(environment.newline) .appendline("-------------------<br />") .appendline("<input type=""checkbox"" value=" & pagecount & ">break here</input><br />") .appendline("-------------------<br />") .appendline("<div class=""leavespace""></div>") '.appendline(environment.newline) end pagecount += 1 next str.appendline("</div>") literal1.text = str.tostring

in general way to @ regular html elements code behind add together attribute runat="server", not believe possible within asp.net literal control, literal used represent static elements , text on page. may not right though.

take @ this: http://msdn.microsoft.com/en-us/library/system.web.ui.literalcontrol(v=vs.110).aspx

html asp.net vb.net

mod wsgi - mod_wsgi: Multiple instances of the same app, with different configurations -



mod wsgi - mod_wsgi: Multiple instances of the same app, with different configurations -

i want host multiple instances of application different configurations. have set this:

wsgiscriptalias /foo /path/to/app.wsgi <location /foo> setenv config foo.conf </location> wsgiscriptalias /bar /path/to/app.wsgi <location /bar> setenv config bar.conf </location>

app.wsgi looks this:

def application(environ, start_response): if not config.is_loaded: config.load(environ.get("config")) [...]

this seems work, wonder if right - ie requests /foo always arrive @ instance of app loaded foo.conf?

also, there improve way set up? (note: need run on windows)

i think figured out through rtfm :-)

the default wsgiapplicationgroup %{resource} should apply, %{resource} beingness distinct /foo , /bar aliases.

since each application grouping executed in it's own sub-interpreter, there should in fact distinct instances of application 2 locations.

mod-wsgi

maven - Preventing a plugin from executing a lifecycle phase -



maven - Preventing a plugin from executing a lifecycle phase -

i invoke maven using next command sequence

c:>\mvn install tomcat7:redeploy

this produces next (heavily) edited output

[info] --- maven-resources-plugin:2.6:resources (default-resources) @ geomaster --- [info] copying 0 resource [info] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ geomaster --- [info] no sources compile [info] --- maven-resources-plugin:2.6:testresources (default-testresources) @ geomaster --- [info] copying 0 resource [info] --- maven-compiler-plugin:2.5.1:testcompile (default-testcompile) @ geomaster --- [info] no sources compile [info] --- maven-surefire-plugin:2.12.4:test (default-test) @ geomaster --- [info] --- maven-war-plugin:2.2:war (default-war) @ geomaster --- [info] --- maven-install-plugin:2.4:install (default-install) @ geomaster --- [info] [info] >>> tomcat7-maven-plugin:2.2:redeploy (default-cli) @ geomaster >>> [info] [info] --- maven-resources-plugin:2.6:resources (default-resources) @ geomaster --- [info] copying 0 resource [info] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ geomaster --- [info] no sources compile [info] --- maven-resources-plugin:2.6:testresources (default-testresources) @ geomaster --- [info] copying 0 resource [info] --- maven-compiler-plugin:2.5.1:testcompile (default-testcompile) @ geomaster --- [info] no sources compile [info] --- maven-surefire-plugin:2.12.4:test (default-test) @ geomaster --- [info] skipping execution of surefire because has been run configuration [info] --- maven-war-plugin:2.2:war (default-war) @ geomaster --- [info] [info] <<< tomcat7-maven-plugin:2.2:redeploy (default-cli) @ geomaster <<< [info] [info] --- tomcat7-maven-plugin:2.2:redeploy (default-cli) @ geomaster ---

please ignore fact have no resources or source code in project. not crux of question.

the install target used place generated war maven repository. tomcat7:redeploy target used place generated war tomcat server.

i have tried various invocations , different configurations cannot prevent tomcat plugin performing it's own build despite install target having done it.

the surefire plugin seems have 'smarts' has detected has been run before. why can't maven have 'smarts' also?

there additional infomation tomcat plugin can found here: tomcat7-maven-plugin

while sec build executed tomcat plugin not substantial, in more substantial project, how can prevent beingness executed @ exclusively redundant?

is bug in either maven or tomcat plugin? basis request enhancement? or expected behaviour has lived with?

from tomcat page link regarding deploy goal, states it:

invokes execution of lifecycle phase bundle prior executing itself.

so why doing own build. deliberate feature, , far can tell can not turned off.

however deploy-only goal exists which:

deploy war tomcat without forking bundle lifecycle

so if alter command be:

mvn install tomcat7:deploy-only

then should want.

maven maven-plugin

c# - TCP listener data type conversion -



c# - TCP listener data type conversion -

i'm developing 1 tcp server application tcp listener class. here server application getting info on every sec client.

client sending info in predefined format. received info contains 15 messages separated "\0". e.g "12\012345\012.12\0" , on. after getting info split info , convert in string array. have string array of 15 elements. after each element converted specific info type , whole record goes in database.

here info send/receive happens on every second. problem i'm facing application not sending info on every sec client application.

when remove info type conversion code working expected. conversion code took more milliseconds , application not able send info client in time.

below code. if remove info type conversion code "mapvariables" function working well.

please please can 1 help me on this?

private async void processclient(tcpclient tcpclient, cancellationtoken ct) { seek { while (!ct.iscancellationrequested) { var stream = tcpclient.getstream(); var buffer = new byte[buffersize]; var amountread = await stream.readasync(buffer, 0, buffersize); var message = encoding.ascii.getstring(buffer, 0, amountread); string[] datafromclient = code.common.splitbylength(message, messagesize).toarray(); datafromclient = datafromclient.select(x => parsemessage(x)).toarray(); common.mapvariables(datafromclient); string serverresponse = string.join(", ", datafromclient); //byte[] sendbytes = encoding.ascii.getbytes(serverresponse); byte[] sendbytes = encoding.ascii.getbytes(message); await stream.writeasync(sendbytes, 0, sendbytes.length, ct); stream.flush(); } } grab (system.io.ioexception ex) { //loge exception } grab (exception ex) { //loge exception } } public void mapvariables(string[] variables) { variables.variable1 = int.parse(variables[0]); variables.variable2 = int.parse(variables[1]); variables.variable3 = int.parse(variables[2]); variables.variable4 = int.parse(variables[3]); variables.variable5 = int.parse(variables[4]); variables.variable6 = int.parse(variables[5]); variables.variable7 = int.parse(variables[6]); variables.variable8 = decimal.parse(variables[7]); variables.variable9 = decimal.parse(variables[8]); variables.variable10 = decimal.parse(variables[9]); variables.variable11 = decimal.parse(variables[10]); variables.variable12 = int.parse(variables[11]); variables.variable13 = int.parse(variables[12]); variables.variable14 = decimal.parse(variables[13]); variables.variable15 = decimal.parse(variables[14]); insertintodatabase(); }

looking @ code, send sent except comma delimited.

you move mapvariables(...) phone call separate thread , utilize that. guess insertintodatabase phone call true bottleneck.

you effort move mapvariables(...) done after reply since doesn't impact doing afterwards.

c# tcplistener

java - Why is JSON invalid when commas in string? -



java - Why is JSON invalid when commas in string? -

anyone know why json invalid?

{"street_address":"stone house lane, peckforton
, tarporley
, london, cheshire"}

i'm using jackson java , it's complaining about

java.lang.illegalargumentexception: com.fasterxml.jackson.core.jsonparseexception: unexpected end-of-input: expecting closing quote string value @ [source: java.io.stringreader@6ad16fc1; line: 1, column: 405]

i noticed json considered invalid on online site well: http://jsonviewer.stack.hu/

answer: thanks, curious i've removed these unreadable characters using tr -cd '\11\12\15\40-\176' < file > cleanfile

after copying/pasting exact text, shows invalid json variable. then, copied/pasted same content notepad (using windows 7) , noted there unusual characters in string (these characters cannot seen in page nor in web editors, i'm using blank space instead):

{"street_address":"stone house lane, peckforton
 , tarporley
 , london, cheshire"} ^ ^ here , here

i removed them , worked expected. copy/paste here:

{"street_address":"stone house lane, peckforton, tarporley, london, cheshire"}

after more in-depth evaluation, hexadecimal representation of char \u80a8.

java json jackson

Informatica - Getting multiple records using Teradata stored procedure -



Informatica - Getting multiple records using Teradata stored procedure -

i trying resultset teradata stored procedure mapping.

the stored procedure hold multiple select statements , final output sent informatica. below sample of how select statement looks

sel 'inh1' qc_code,count(*) table 1 union sel 'inh2' qc_code,count(*) table 2 union sel 'inh3' qc_code,count(*) table 3

i need stored procedure can send output of above query (2 columns, 3 records) informatica, can phone call stored procedure in source qualifier or through sp transformation

any help??

you can phone call stored procedure in source qualifier transformation using sql query property. create sure ports, order , datatypes reflect columns returned stored procedure.

stored-procedures teradata informatica

objective c - iOS how to change push notification title when app is running in foreground? -



objective c - iOS how to change push notification title when app is running in foreground? -

i'm using urban airship in app receive force notifications , works expected. problem when app running in foreground , force received shows notification title along info in payload.but want show title notis instead notification tried this-

- (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo { if ( application.applicationstate == uiapplicationstateactive ) { nsdictionary* aps = [userinfo valueforkey:@"aps"]; uialertview* alert = [[uialertview alloc] initwithtitle:@"notis" message:[aps valueforkey:@"alert"] delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil, nil]; [alert show]; } else { uitabbarcontroller *tabbarcontroller = (uitabbarcontroller *)self.window.rootviewcontroller; tabbarcontroller.selectedindex=2; [self loadstatisticsinbackground]; [[uapush shared] handlenotification:userinfo applicationstate:application.applicationstate]; } [[uapush shared] resetbadge]; }

but shows 2 alerts 1 defined , scheme defined. help appreciated. edit: ok.. if not possible alter title of force notification there way can prevent force alert when app running in foreground?i don't want show when app running in foreground?

you can observe if app running in foreground , if does, don't pass notification uapush in -application:didreceiveremotenotification:.

ios objective-c apple-push-notifications urbanairship.com

ios - MKMapView customized pin image lose its accuracy when zoom in/out the map -



ios - MKMapView customized pin image lose its accuracy when zoom in/out the map -

i have mapview in app, , i'm using own image mkannotationview, the pin image. here code setting it.

-(rmannotationview *)mapview:(mkmapview *)mapview viewforannotation:(rentpin *)annotation{ static nsstring *identifier = @"mylocation"; if ([annotation iskindofclass:[rentpin class]]) { rmannotationview *annotationview = (rmannotationview *)[self.mapview dequeuereusableannotationviewwithidentifier:identifier]; if(annotationview == nil){ annotationview = [[rmannotationview alloc] initwithannotation:annotation reuseidentifier:identifier]; annotationview.enabled = yes; annotationview.canshowcallout = no; annotationview.image = [uiimage imagenamed:@"home44.png"]; annotationview.centeroffset = cgpointmake(-10, -10); }else{ annotationview.annotation = annotation; } homecoming annotationview; } homecoming nil; }

it working fine , customized image showing properly, when pinch mapview zooming in/out map, noticed customized image loses accuracy on map. please have images following.

https://www.dropbox.com/s/irrgmohppf08fzr/image1.png image shows pin @ position, quite accurate.

https://www.dropbox.com/s/vvlr4ckk6molqd7/image2.png after zoomed out mapview, pin crossed street , showing address in lake....

(sorry links, since can't post images because of insufficient reputation.)

anyone help me regarding this? pin image 44x44 , tried setting centeroffset of pin, cannot dynamically solved problem in zoom levels.

it's wrong center offset. aware center offset depends on type of annotation view using. don't know rmannotationview is. if it's subclass of mkannotationview, centeroffset should cgpointmake(0, -imageheight / 2).

ios cocoa-touch mkmapview

c - Strange pointer casting with void * -



c - Strange pointer casting with void * -

we working on project embedded linux c , c++ together. recenty encountered unusual statement in function:

bool strangefunction(void* arg1, void* arg2, void* arg3) { (void)arg1; (void)arg2; (void)arg3; unsigned long keycode = (unsigned long)arg2; switch(keycode) { ...

i have 2 question in code above

what mean (void)arg1; ? is possible , ok utilize unsigned long keycode = (unsigned long)arg2;

if don't mind, need explanation , related links explaining subjects. thanks.

it quiet compiler warnings unused parameters.

it possible not portable. if on given platform address fits unsigned long, it's fine. utilize uintptr_t on platforms available create code portable.

c casting void-pointers

batch file - .BAT to filter data in a csv with a line containing in the 3rd token -



batch file - .BAT to filter data in a csv with a line containing in the 3rd token -

i have sample csv file

alvin,am,7,11,math,sci

mary,am,7,11,math,sci

andrew,am,11,3,english,history

i want create resulting csv

alvin,am,7,11,math,sci

mary,am,7,11,math,sci

i have code

@echo off /f "eol=- tokens=1,2,3,4,5,6 delims=," %%1 in (abcd.csv) if %%3 equ 7 echo %%1 %%2 %%3 %%4 %%5 %%6 >> output.csv

i readied output.csv considering utilize redirection code >> appends rather > creates. please allow me know why isn't working.

just replace spaces commas:

@echo off del output.csv /f "eol=- tokens=1,2,3,4,5,6 delims=," %%1 in (abcd.csv) if %%3 equ 7 echo %%1,%%2,%%3,%%4,%%5,%%6 >> output.csv

and you'll have expected result:

alvin,am,7,11,math,sci mary,am,7,11,math,sci

also improve delete output.csv before appending (to avoid duplication of info in case of multiple phone call of script).

batch-file csv

html - jQuery Mobile CSS Conflicting With My Other CSS file -



html - jQuery Mobile CSS Conflicting With My Other CSS file -

i using jquery mobile css responsive table. turns out column in responsive table contains login form using css altogether styling. desired layout, jquery mobile conflicts styling of login form giving different , sense 1 intended. styling login form contained in seperate css file referenced in "head" tag, same jquery mobile css.

i attempted using "!important" in layout.css overwrite jquery conflicts still didn't work. here's code login form:

/**login form**/ #card { width: 220px !important; /*margin: auto;*/ margin-top:0px !important; position:relative !important; float:left !important; } #card h2 { text-shadow: 0 1px 0 #27ae60 !important; font-size: 1.62em !important; color: #2ecc71 !important; display: block !important; width: 100% !important; padding-bottom: .4em !important; margin-bottom: .6em !important; border-bottom: 2px solid #2ecc71 !important; /*box-shadow*/ -webkit-box-shadow: 0 1px 0 #27ae60 !important; -moz-box-shadow: 0 1px 0 #27ae60 !important; box-shadow: 0 1px 0 #27ae60 !important; } #card { color: #27ae60 !important; } #card label { font-size: 10px !important; display: block !important; float: right !important; clear: left !important; line-height: 2.4 !important; margin: -30px 0 0 !important; padding: 0 !important; width: 190px !important; height: 20px !important; } input[type="text"],input[type="password"], input[type="submit"] { clear: both !important; float: left !important; display: block !important; border: 1px solid #ccc !important; background: #ebebeb !important; margin: 6px 0 !important; padding: 4px 10px !important; width: 100% !important; height: 34px !important; outline: 0 !important; color: #34495e !important; font-size: 14px !important; } input[type=submit] { background: #27ae60 !important; color: #ecf0f1 !important; border: 0 !important; border-bottom: 2px solid #2ecc71 !important; margin: 10px 0 0 !important; width:100% !important; } input[type=checkbox] { display: block !important; float: left !important; width: 16px !important; height: 16px !important; margin: 10px 12px 10px 0 !important; /*border-radius*/ -webkit-border-radius: 0px !important; -moz-border-radius: 0px !important; border-radius: 0px !important; border: 0 !important; } input[type=checkbox]:before { content: "" !important; display: block !important; border: 2px solid #ccc !important; border-bottom: 1px solid #ccc !important; /*box-shadow*/ -webkit-box-shadow: 0 2px 0 #bdc3c7 !important; -moz-box-shadow: 0 2px 0 #bdc3c7 !important; box-shadow: 0 2px 0 #bdc3c7 !important; width: 16px !important; height: 16px !important; padding: 0px !important; margin: -2px !important; /*border-radius*/ -webkit-border-radius: 0px !important; -moz-border-radius: 0px !important; border-radius: 0px !important; } input[type=checkbox]:active, input[type=checkbox]:focus { /*box-shadow*/ -webkit-box-shadow: 0 0 0 !important; -moz-box-shadow: 0 0 0 !important; box-shadow: 0 0 0 !important; } input[type=checkbox]:checked { background: #27ae60 !important; } input[type=checkbox]:checked:before { content: "✔" !important; color: #2ecc71 !important; text-align: center !important; line-height: 1.6 !important; font-size: 10px !important; /*box-shadow*/ -webkit-box-shadow: 0 2px 0 #bdc3c7 ,inset 0 1px 0px 0 #107a3d !important; -moz-box-shadow: 0 2px 0 #bdc3c7 ,inset 0 1px 0px 0 #107a3d !important; box-shadow: 0 2px 0 #bdc3c7 ,inset 0 1px 0px 0 #107a3d !important; text-shadow: 0 -1px 0 #107a3d !important; width: 16px !important; height: 16px !important; padding: 0px !important; margin: -2px !important; /*border-radius*/ -webkit-border-radius: 0px !important; -moz-border-radius: 0px !important; border-radius: 0px !important; } input[type=text]:not([value*=" "]):active, input[type=text]:not([value*=" "]):focus { /*box-shadow*/ -webkit-box-shadow: inset 8px 0px 0 #2ecc71 !important; -moz-box-shadow: inset 8px 0px 0 #2ecc71 !important; box-shadow: inset 8px 0px 0 #2ecc71 !important; padding-left: : !important; : x !important; } input[type=password]:not([value*=" "]):active, input[type=password]:not([value*=" "]):focus { /*box-shadow*/ -webkit-box-shadow: inset 8px 0px 0 #2ecc71 !important; -moz-box-shadow: inset 8px 0px 0 #2ecc71 !important; box-shadow: inset 8px 0px 0 #2ecc71 !important; padding-left: : !important; : x !important; } input[type=submit]:active, input[type=submit]:focus { background: #2ecc71 !important; color: #ecf0f1 !important; border: 0 !important; position: relative !important; top: 1px !important; border-bottom: 1px solid !important; } input[value*=" facebook"] { background: #3b5998 !important; border-color: #1f4189 !important; width: 50% !important; float: left !important; clear: none !important; margin-left: 0 !important; } input[value*=" twitter"] { background: #0396c7 !important; border-color: #0078a6 !important; width: 50% !important; float: left !important; clear: none !important; } input[value*=" facebook"]:active, input[value*=" facebook"]:focus { color: #ecf0f1 !important; background: #1f4189 !important; } input[value*=" twitter"]:active, input[value*=" twitter"]:focus { color: #ecf0f1 !important; background: #0078a6 !important; }

please how resolve this? thanks

jquery html css responsive-design

java - Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1) from logcat debuging -



java - Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1) from logcat debuging -

i'm debugging android project c code, logcat message shows that:

i/debug (13509): backtrace: i/debug (13509): #00 pc 000106dc /system/lib/libc.so (dlmalloc+1463) i/debug (13509): #01 pc 0000cf3f /system/lib/libc.so (malloc+10) i/debug (13509): #02 pc 00011d0d /system/lib/libutils.so (android::sharedbuffer::alloc(unsigned int)+8) i/debug (13509): #03 pc 00014cf7 /system/lib/libutils.so (android::vectorimpl::setcapacity(unsigned int)+22) i/debug (13509): #04 pc 0007fd79 /system/lib/libandroid_runtime.so (android::textlayoutvalue::textlayoutvalue(unsigned int)+108) i/debug (13509): #05 pc 000811a9 /system/lib/libandroid_runtime.so (android::textlayoutcache::getvalue(skpaint const*, unsigned short const*, int, int, int, int)+184) i/debug (13509): #06 pc 00081589 /system/lib/libandroid_runtime.so (android::textlayoutengine::getvalue(skpaint const*, unsigned short const*, int, int, int, int)+36) i/debug (13509): #07 pc 0007f799 /system/lib/libandroid_runtime.so (android::textlayout::gettextrunadvances(skpaint*, unsigned short const*, int, int, int, int, float*, float*)+42) i/debug (13509): #08 pc 0007c60d /system/lib/libandroid_runtime.so i/debug (13509): #09 pc 0007c7f9 /system/lib/libandroid_runtime.so i/debug (13509): #10 pc 0001e690 /system/lib/libdvm.so (dvmplatforminvoke+112) i/debug (13509): #11 pc 0005100f /system/lib/libdvm.so (dvmcalljnimethod(unsigned int const*, jvalue*, method const*, thread*)+426) i/debug (13509): #12 pc 00027aa0 /system/lib/libdvm.so i/debug (13509): #13 pc 0002ce84 /system/lib/libdvm.so (dvminterpret(thread*, method const*, jvalue*)+232) i/debug (13509): #14 pc 000674bf /system/lib/libdvm.so (dvminvokemethod(object*, method const*, arrayobject*, arrayobject*, classobject*, bool)+374) i/debug (13509): #15 pc 0007066f /system/lib/libdvm.so i/debug (13509): #16 pc 00027aa0 /system/lib/libdvm.so i/debug (13509): #17 pc 0002ce84 /system/lib/libdvm.so (dvminterpret(thread*, method const*, jvalue*)+232) i/debug (13509): #18 pc 000671a1 /system/lib/libdvm.so (dvmcallmethodv(thread*, method const*, object*, bool, jvalue*, std::__va_list)+272) i/debug (13509): #19 pc 0004d2d7 /system/lib/libdvm.so i/debug (13509): #20 pc 0004d391 /system/lib/libandroid_runtime.so i/debug (13509): #21 pc 0004e22d /system/lib/libandroid_runtime.so (android::androidruntime::start(char const*, char const*)+540) i/debug (13509): #22 pc 00000e67 /system/bin/app_process i/debug (13509): #23 pc 000128b3 /system/lib/libc.so (__libc_init+38) i/debug (13509): #24 pc 00000b74 /system/bin/app_process

the message tell me problem malloc, seems bug libandroid_runtim.

how know problem in project? because message show nil code location, includes java , c.

please kindly help me prepare problem. it's bother me long time. much.

you got null dereference (that's 0x00000000 indicates). since it's in malloc, means corrupted memory allocator's internal structures writing outside malloc's returned area @ time before signal. suggest using valgrind observe exact point, think it's usable on android effort.

java android c android-ndk android-logcat

html - Internet Explorer has no post data (request body), whereas Google Chrome does, same actions? -



html - Internet Explorer has no post data (request body), whereas Google Chrome does, same actions? -

the form loaded ajax page based on selection separate form. google chrome posts data, ie posts no info speak of. issue here?

forms (initial select , next form) in ie:

<div id="client-form-div" style="padding-top: 15px; clear: both;"><form name="clientregistrationform" disabled="0" id="clientregistrationform" action="" enctype="application/x-www-form-urlencoded" method="post" country="1" identity="901221025" firstname="" middlename="" lastname="" race="1" emailaddress="" phonenumber="0110801" faxnumber="" cellnumber="" usertype="4" code="" sat_id="0" new="0" gender="0" dob="1990-12-21" region_id="0" smme_id="26" active="1" entrydate="2013-01-22 10:30:17" username="" userid="63164"><dl class="zend_form"> <dt id="country-label">&nbsp;</dt> <dd id="country-element"> <input name="country" id="country" type="hidden" value="1"></dd> <div class="col-md-12 field-box"><dt id="identity-label"><label class="required" for="identity">id number:</label></dt> <dd id="identity-element"> <input name="identity" class="col-md-9 form-control" id="identity" type="text" maxlength="13" readonly="" value="90125"><ul class="good" id="good-identity"><li class="color-green"><i class="color-green align-glyph glyphicons circle_ok"></i> </li></ul></dd></div> <dt id="userid-label">&nbsp;</dt> <dd id="userid-element"> <input name="userid" id="userid" type="hidden" value="63164"></dd> <div class="col-md-12 field-box"><dt id="firstname-label"><label class="required" for="firstname">first name:</label></dt> <input name="cellnumber" class="col-md-9 form-control" id="cellnumber" type="text" maxlength="10" value=""></dd></div> <dt id="region-label">&nbsp;</dt> <dd id="region-element"> <input name="region" id="region" type="hidden" value="0"></dd> <dt id="usertype-label">&nbsp;</dt> <dd id="usertype-element"> <input name="usertype" id="usertype" type="hidden" value="4"></dd> <dt id="submit-label">&nbsp;</dt><dd id="submit-element"> <input name="submit" class="btn-flat primary btn-next pull-right" id="submit" style="margin-right: 15px;" type="submit" value="next"></dd></dl></form></div>

forms in chrome:

<div id="init-form-div"><form enctype="application/x-www-form-urlencoded" action="" method="post"><dl class="zend_form"> <div class="col-md-12 field-box"><dt id="type-label"><label for="type" class="optional">identification type:</label></dt> <dd class="ui-custom span5"> <select name="type" id="type"> <option value="0" label="---select---">---select---</option> <option value="1" label="south african id number">south african id number</option> <option value="2" label="passport number">passport number</option> </select></dd></div></dl></form></div> <div id="client-form-div" style="padding-top: 15px;clear: both;"><form id="clientregistrationform" name="clientregistrationform" enctype="application/x-www-form-urlencoded" method="post" userid="63164" username="" usertype="4" emailaddress="" entrydate="2013-01-22 10:30:17" active="1" firstname="bue" middlename="nt" lastname="masemola" phonenumber="0110852001" faxnumber="" cellnumber="" smme_id="269" region_id="0" dob="1990-12-21" gender="0" race="1" disabled="0" new="0" country="1" identity="90185" sat_id="0" code="" action=""><dl class="zend_form"> <dt id="country-label">&nbsp;</dt> <dd id="country-element"> <input type="hidden" name="country" value="1" id="country"></dd> <div class="col-md-12 field-box"><dt id="identity-label"><label for="identity" class="required">id number:</label></dt> <dd id="identity-element"> <input type="text" name="identity" id="identity" value="901285" class="col-md-9 form-control" maxlength="13" readonly="" ><ul id="good-identity" class="good"><li class="color-green"><i class="color-green align-glyph glyphicons circle_ok"></i> </li></ul></dd></div> <select name="race" id="race"> <option value="0" label="---select---">---select---</option> <option value="1" label="black" selected="selected">black</option> <option value="2" label="coloured">coloured</option> <option value="3" label="asian">asian</option> <option value="4" label="white">white</option> </select></dd></div> <div class="col-md-12 field-box"><dt id="disabled-label"><label for="disabled" class="required">disabled:</label></dt> <dd class="ui-custom span5"> <select name="disabled" id="disabled"> <option value="0" label="no" selected="selected">no</option> <option value="1" label="yes">yes</option> </select></dd></div> <div class="col-md-12 field-box"><dt id="emailaddress-label"><label for="emailaddress" class="optional">e-mail address:</label></dt> <dd id="emailaddress-element"> <input type="text" name="emailaddress" id="emailaddress" value="" class="col-md-9 form-control"></dd></div> <div class="col-md-12 field-box"><dt id="phonenumber-label"><label for="phonenumber" class="optional">phone number:</label></dt> <dd id="phonenumber-element"> <input type="text" name="phonenumber" id="phonenumber" value="0110852001" class="col-md-9 form-control" maxlength="10"></dd></div> <div class="col-md-12 field-box"><dt id="faxnumber-label"><label for="faxnumber" class="optional">fax number:</label></dt> <dd id="region-element"> <input type="hidden" name="region" value="0" id="region"></dd> <dt id="usertype-label">&nbsp;</dt> <dd id="usertype-element"> <input type="hidden" name="usertype" value="4" id="usertype"></dd> <dt id="submit-label">&nbsp;</dt><dd id="submit-element"> <input type="submit" name="submit" id="submit" value="next" class="btn-flat primary btn-next pull-right" style="margin-right:15px;"></dd></dl></form></div>

google chrome post data:

country:1 identity:901285 userid:63164 firstname:busi middlename:biseng lastname:mala race:1 disabled:0 emailaddress: phonenumber:011001 faxnumber: cellnumber: region:0 usertype:4 submit:next

ie request body:

(empty)

the problem this:

<form name="clientregistrationform" disabled="0" id="clientregistrationform" action="" enctype="application/x-www-form-urlencoded" method="post" country="1" identity="9012" firstname="b" middlename="nthabi" lastname="m" emailaddress="" faxnumber="" cellnumber="" usertype="4" code="" sat_id="0" new="0" gender="0" dob="1990-12-21" region_id="0" active="1" entrydate="2013-01-22 10:30:17" username="" userid="63164">

specifically the: disabled="0" part.

in ie11, disables form , prevents post info beingness posted.

it recommended not set parameters in form, security risk , useless.

the reason happening because using zend framework zend form __construct(). when constructing use:

parent::__construct($record);

where should be

parent::__construct();

html forms internet-explorer google-chrome

ios - Changed frame returns to default when view disappears and appears again -



ios - Changed frame returns to default when view disappears and appears again -

i have tab bar application using storyboard , in 1 view, alter frame of uibutton animated within method. thing method continuing while tab bar item presented (so view controller not dismissed disappeared) when first view appears again, button frame had changed in default position again, set in interface builder. know if there's easy way prevent behaviour , maintain current frames when view disappears?

are using auto layout? (storyboard > utilities (right panel) > file inspector - has utilize auto layout checkbox). if so, seek uncheck it. if works right, need alter layout constrains, not frame. parameters frame , center ignored under auto layout. instead, constrains have parameter called constant can changed , animated.

ios objective-c frame

Date picker in Grails with JQuery UI: Resource not found error -



Date picker in Grails with JQuery UI: Resource not found error -

i trying utilize date picker jqquery ui in grails. source files are

applicationresources.groovy

modules = { application { dependson 'jquery' resource url:'js/application.js' resource url:'css/main.css' resource url:'css/mobile.css' resource url:'css/mobile.css' } overrides { 'jquery-theme' { resource id:'theme', url:'../plugins/jquery-ui-1.10.3/web-app/jquery-ui/themes/blitzer/jquery-ui-1.10.4.custom.css' } } }

and html file includes code

<r:require module="jquery"/> <r:require module="jquery-ui"/> <jqui:resources theme="blitzer" /> <r:script> $(document).ready(function() { $("#datepicker").datepicker({dateformat: 'yy/mm/dd'}); }) </r:script>

when load html page, next errors

error 2014-06-24 12:25:35,766 [http-bio-8080-exec-10] error resource.resourcemeta - resource not found: /plugins/jquery-ui-1.10.3/jquery-ui/themes/blitzer/jquery-ui-1.10.3.custom.css error 2014-06-24 12:25:36,570 [http-bio-8080-exec-10] error resource.resourcemeta - resource not found: /plugins/jquery-ui-1.10.3/jquery-ui/themes/blitzer/jquery-ui-1.10.3.custom.css error 2014-06-24 12:25:36,631 [http-bio-8080-exec-1] error resource.resourcemeta - resource not found: /plugins/jquery-ui-1.10.3/web-app/jquery-ui/themes/blitzer/jquery-ui-1.10.4.custom.css

how can resolve these errors , apply custom theme?

without attempting defaults attempting override jquery-ui. recommendation seek out defaults , progress there: per instructions: http://grails.org/plugin/jquery-ui

install jquery-ui adding

compile ":jquery-ui:1.10.3"

to buildconfig

refresh-dependencies

then add together main.gsp

<r:require module="jquery-ui"/>

see how goes effort override

grails grails-2.0 grails-plugin

function - Haskell: Alternative to patterns of where f = foo e, e = bar d, d = baz c -



function - Haskell: Alternative to patterns of where f = foo e, e = bar d, d = baz c -

i have function growing , getting pattern shown bellow. proper alternative these f = fooed e equal bared e equal bazed d...?

myfunc:: string -> options -> string myfunc somestring opts = topstr ++ editedmidstr ++ botstr editedmidstr = foo f f = bar e e = baz d d = qux c ... = ...

use function composition!

myfunc mystring opts = topstr ++ editedmidstr ++ botstr editedmidstr = (foo . bar . baz . qux . makeacfrommystring) mystring

function haskell functional-programming where

php - Unable to create web app in yii from console -



php - Unable to create web app in yii from console -

i need create skeleton application in yiic console. tried running next command:

yiic webapp demo

my yii , frameworks folders placed here:

c:\wamp\www\yii\yii-1.1.14.f0fee9\framework

my htdoc folder's path here:

c:\wamp\bin\apache\apache2.4.9\htdocs

can guide me here please? thanks

the yiic.bat file needs edited. have provide total path our php.exe file placed in bin folder.

php yii

php - ZF2 Skeleton app Routing - children routes -



php - ZF2 Skeleton app Routing - children routes -

i'm trying working routing in app based on zend skeleton application.

i need next mapping:

localhost/ => aplication/controller/indexcontroller => indexaction() --> this works localhost/portfolio/section => application/controller/portfoliocontroller => indexaction() localhost/portfolio/section/action/id => application/controller/portfoliocontroller => specifi_cactionaction()

i have (module.config.php):

'router' => array( 'routes' => array( 'home' => array( 'type' => 'zend\mvc\router\http\literal', 'options' => array( 'route' => '/', 'defaults' => array( 'controller' => 'application\controller\index', 'action' => 'index', ), ), 'may_terminate' => true, 'child_routes' => array( 'portfolio' => array( 'type' => 'zend\mvc\router\http\segment', 'options' => array( 'route' => '[/portfolio/:section[/:action][/:id]]', 'constraints' => array( 'section' => '[a-za-z][a-za-z0-9_-]*', 'action' => '[a-za-z][a-za-z0-9_-]*', 'id' => '[0-9]+', ), 'defaults' => array( '__namespace__' => 'application\controller', 'controller' => 'portfolio', 'action' => 'index', ), ), ), ) ), ), ), 'controllers' => array( 'invokables' => array( 'application\controller\index' => 'application\controller\indexcontroller', 'application\controller\portfolio' => 'application\controller\portfoliocontroller', ), ),

now, if go localhost/portfolio/graphics/ error: 404 error occurred page not found. requested url not matched routing. no exception available

i tried in kid route (without / on start):

'route' => '[portfolio/:section[/:action][/:id]]',

i don't it. why not work?

php routing zend-framework2

javascript - "prompt not defined" using node from command line? -



javascript - "prompt not defined" using node from command line? -

i'm trying run simple javascript programme command line , getting unexpected error. prompt seems simple javascript command; not sure why it's not defined.

my test.js file:

console.log("i inquire name."); var name = prompt("enter name"); console.log("hello ".concat(name, ". how you"));

i'm running this:

c:\directory\node test.js inquire name. c:\directory\test.js:2 var name = prompt("enter name"); reference error: prompt not defined

i think might interested in code :

console.log("i inquire name."); process.stdin.setencoding('utf8'); var name; process.stdin.on('readable', function() { name = process.stdin.read(); if (name !== null) { console.log("hello ".concat(name, ". how you")); process.exit(); } });

this node.js way of doing need do. hope helps!

javascript node.js

angularjs - Show Variables on Markup Using Angular Directive With Isolate Scope -



angularjs - Show Variables on Markup Using Angular Directive With Isolate Scope -

i have directive isolate scope , own controller. i'd pass value parent scope , print out value onto markup. thought simply pass this:

scope: { isoprop: '=' }

i set watches on link , controller, see value beingness passed properly. however, don't know how utilize value on markup itself.

i've set plunker illustrate issue. on line 17 in index.html, expecting {{dirctrl.isoprop}} or {{isoprop}} print out value passed in, don't seem to.

can explain i'm doing wrong?

you can seek set markup template this:

template: '{{isoprop}}'

angularjs angularjs-directive angularjs-scope

jasmine - ptor.findElements always returns true -



jasmine - ptor.findElements always returns true -

i have next code, never runs error portion

ptor.findelements(protractor.by.css(elementcss)).then(function (elems) { element = elems; elementfound = true; // if element.all(...).count() console.log("inside clause , element found"); }, function (err) { console.error("waiting element( " + elementcss + " ) found " + currentcount + "/" + timeout); }); //ptor.findelement

even if elementcss ='abc', junk value, resolve clause , not reject/error junk css name.

findelement on other hand behaves expected. missing here ?

the api findelement returns en error if element not found given selector.

the api findelements homecoming empty list if selector not match element.

from findelement documentation :

if element cannot found, bot.errorcode.no_such_element result returned driver

jasmine protractor

email - php swiftmailer sending mail with smtp transport timeout -



email - php swiftmailer sending mail with smtp transport timeout -

i trying send mail service via mandrill app using swift mailer. code:

$transport = swift_smtptransport::newinstance('smtp.mandrillapp.com',587); $transport->setusername($username); $transport->setpassword($password); // create mailer using created transport $mailer = swift_mailer::newinstance($transport); // create message $message = swift_message::newinstance() // give message subject ->setsubject('new order '.$reservationnumber) // set address associative array ->setfrom(array('noreply@domain.com' => 'domain.com')) // set addresses associative array ->setto('test@domain.com') // give body ->setbody($body,'text/html'); $mailer->send($message);

credentials 100% good. , timeout error: connection not established host smtp.mandrillapp.com [connection timed out #110].

it looks blocking connection. maybe issue server configurations? using whm software on our centos server

i've been doing battle same problem, smtp.gmail.com. not work, though username/password etc correct.

in case seems when php tries connect smtp.gmail.com, gets ipv6 address - server seems not listening on that, since swiftmailer responds same timeout error get.

but when swapped in ipv4 address (got ping-ing it), connected , sent email fine.

so find out smtp.mandrillapp.com's ipv4 address , seek that ip in place of hostname in code. connect , send now? did me.

it's not ideal coding in ip address - given alter @ min - @ to the lowest degree emails sent

php email smtp centos swiftmailer

android - Service callback throws: Uncaught remote exception! (Exceptions are not yet supported across processes.) -



android - Service callback throws: Uncaught remote exception! (Exceptions are not yet supported across processes.) -

i'm having issues callbacks. here code:

activity:

private icallback callback = new icallback.stub() { @override public void fire() throws remoteexception { mtextview.settext("fired"); } }; //then in oncreate add: mmanger.registercallback(callback);

icallback (aidl)

interface icallback { void fire(); }

manager:

public void registercallback(icallback callback) { seek { mservice.registercallback(callback); } grab (remoteexception e) { log.e(tag, "service dead"); } } private void notifycallbacks() { seek { mservice.notifycallbacks(); } grab (remoteexception e) { log.e(tag, "service dead"); } }

service:

public void registercallback(icallback callback) { if (callback != null) { mcallbacks.register(callback); } } public void notifycallbacks() { final int n = mcallbacks.beginbroadcast(); (int i=0;i<n;i++) { seek { mcallbacks.getbroadcastitem(i).fire(); } grab (remoteexception e) { } } mcallbacks.finishbroadcast(); }

my callbacks notified run when seek set textview text:

e/javabinder﹕ * uncaught remote exception! (exceptions not yet supported across processes.) android.view.viewrootimpl$calledfromwrongthreadexception: original thread created view hierarchy can touch views.

like error message says, seek update view wrong thread. fire() method called remote service runs in thread, need create sure, code updates ui runs in ui thread. accomplish this, seek following:

public void fire() throws remoteexception { //the activity provides method able run code in ui thread runonuithread(new runnable(){ @override public void run(){ mtextview.settext("fired"); } }) }

android service callback android-service aidl

html - How to make the same hover like the other tr's -



html - How to make the same hover like the other tr's -

i'm having problem don't understand. want same hover tr's, right 1 hover working on cell b

somebody can explain me, error?

this hover css:

.table-hover tr:hover, .table-hover tr td:hover { background-color: #595959!important; color: #fff; font-style: italic; }

http://jsfiddle.net/luiggi/ur22x/3/

working demo

your problem this:

.table-striped>tbody>tr:nth-child(odd)>td, .table-striped>tbody>tr:nth-child(odd)>th{ background-color: #f9f9f9!important; }

your style didn't overwrite this, notice in fiddle changed:

.table-hover tr td:hover

to this:

.table-hover tr:hover td

because want alter td's under :hovered tr.. right?

html css table

Why can't speed be changed on CSS animation with JavaScript -



Why can't speed be changed on CSS animation with JavaScript -

i've made css animation , javascript code update animation speed. seems javascript code valid 1 time speed set in css can no longer updated. if don't set speed in css javascript works fine.

#circle1 { width: 200px; height: 200px; background: blue; -webkit-animation: updown 5s infinite; /* safari , chrome */ animation: updown 5s infinite; }

if lastly 2 lines in css above removed next javascript works

document.getelementbyid('circle1').style.webkitanimationname = 'updown'; document.getelementbyid('circle1').style.webkitanimationduration = '40s';

see js fiddle more details http://jsfiddle.net/usjv8/1/

it looks it's rendering issue (you'd need re-render element visualize changes). came "solution" don't know if work you, based on removing , re-appending element dom:

document.getelementbyid('circle1').style.webkitanimationduration = '40s'; var aux = document.getelementbyid('circle1'); document.getelementbyid("maincenter").removechild(document.getelementbyid('circle1')); document.getelementbyid('maincenter').appendchild(aux);

you can see working here: http://jsfiddle.net/usjv8/9/ (notice added id center tag)

javascript css html5 css3 animation

Cassandra inside Docker -



Cassandra inside Docker -

i'm planning deploy several cassandra nodes using docker containers. if each node within separate docker container, can still build cluster these nodes?

i'm thinking might have many problems because opening necessary ports might hard of them random.

i haven't tried this, found zmarcantel/cassandra image on docker.io, claims, can run cluster.

cassandra docker

php - cakephp form helper for a date: how to make minYear and maxYear work -



php - cakephp form helper for a date: how to make minYear and maxYear work -

i'm trying implement date selector in cake-1.3. problem i'm having i've not been able confine year selector desired set of years, 2012 through current year, whatever might be. i've tried 3 or 4 ways of coding this, based on own thoughts , on examples cakephp site, stack overflow, , @ to the lowest degree 1 other site. no matter approach take, years in selection list range 1994 2034.

here current version of code this:

echo "<div class='date'>" . $this->form->input('start_date', array('type'=>'date', 'default'=>array('month'=>$yesterday['month'], 'day'=>$yesterday['mday'], 'year' => $today['year'], array('dateformat' => 'mdy', 'minyear' => 2012, 'maxyear' => $yesterday['year'], selected) ) ) ) . "</div>";

any suggestions highly appreciated.

your input options should in single unnested array.

echo "<div class='date'>" . $this->form->input('start_date', array('type'=>'date', 'default'=>array('month'=>$yesterday['month'], 'day'=>$yesterday['mday'], 'year' => $today['year']), 'dateformat' => 'mdy', 'minyear' => 2012, 'maxyear' => $yesterday['year'] ) ) . "</div>";

php cakephp cakephp-1.3

javascript - Require Specific First Characters from Form Post -



javascript - Require Specific First Characters from Form Post -

i'm putting out there see if can grab drift , give hand.. work public library , in process of making "self checkin" machine. here's code - there's form called "checkin" input called "barcode" - result of "barcode" posted php file sends info library scheme , receives message passed table "completed-checkins".

it's working fine - need set conditions on info accepted form.. conditions first 2 characters need t00 .

i've been searching web , trying borrow/adapt code others create work, got from;

<script type="text/javascript"> function checkcode() { var form = document.getelementbyid('checkin'); var x = form.elements.barcode.value.substring(0, 2); // var x = this.value.substring(0, 2); if (x == 't00') document.getelementbyid('#barcode').style.display = 'none'; } </script>

i'm no real coder wondering if can see how work? (it doesn't @ moment).

thanks much looking,

jordan.

and here's html scripts;

<body onload="$('#barcode').focus();" style="padding:40px;"> <center> <p> <img src="selfchecklogo.png" /> </p> <div class="formbarwrapper"> <div class="formbar"> <form method="post" name="checkin" id="checkin" onsubmit="return checkcode()" /> <input name="barcode" id="barcode" placeholder="scan item..." autocomplete="off" maxlength="9" /> </form> </div> </div> <div class="result"> <table id="completed-checkins"> <tbody> <tr> <td id="cell"></td> </tr> </tbody> </table> </div> </center> </body> <script type="text/javascript"> function checkcode() { var form = document.getelementbyid('checkin'); var x = form.elements.barcode.value.substring(0, 2); // var x = this.value.substring(0, 2); if (x == 't00') document.getelementbyid('#barcode').style.display = 'none'; } </script> <script type="text/javascript"> $(document).ready(function() { $('#checkin').submit(function() { $.post("index.php", { barcode: $('#barcode').val() }, function(data) { var content = ''; content += '<div class="result">'; content += '<tbody>'; content += '<tr>'; content += '<td>' + info + '</td>'; content += '</tr>'; content += '</tbody>'; content += '</div>'; $('#barcode').val('').focus(); $('#completed-checkins tbody').html(content); }); homecoming false; }); }); </script> </html>

have tried printing "x" console? think problem line

var x = form.elements.barcode.value.substring(0, 2);

only selects first 2 characters out of string, , compare "t00", 3 characters long , evaluate false.

also, might want consider using "===" operator instead of "==" operator. in case both work, using "===" habit in to. "===" works way expect work, whereas "==" has little gotchas in javascript. instance

0 == '0' //this evaluates true 0 === '0' //this evaluates false

basically, "==" doesn't check type, , "===" does.

javascript php forms validation input

python - Axis bug on Pandas groupby boxplots -



python - Axis bug on Pandas groupby boxplots -

the head of pandas dataframe , df, shown below:

count1 count2 totalcount season 0 3 13 16 1 1 8 32 40 1 2 5 27 32 1 3 3 10 13 1 4 0 1 1 1

i'd create boxplots of count1, count2, , totalcount, grouped season (there 4 seasons) , have each set of box plots show on own subplot in single figure.

when 2 of columns, count1 , count2, looks great.

df.boxplot(['count1', 'count2'], by='season')

but when add together totalcount mix, axis limits go haywire.

df.boxplot(['count1', 'count2', 'totalcount'], by='season')

this happens irregardless of order of columns. realize there several ways around problem, much more convenient if worked properly.

am missing something? known bug in pandas? wasn't able find in first pass of pandas bug reports.

i'm using pandas 0.14.0 , matplotlib 1.3.1.

did tried upgrade pandas/matplotlib packages?

i'm using pandas 0.13.1 + matplotlib 1.2.1 , plot get:

in [31]: df out[34]: count1 count2 totalcount season 0 3 13 16 1 1 8 32 40 1 2 5 27 32 1 3 3 10 13 1 4 0 1 1 1 5 3 13 16 2 6 8 32 40 2 7 5 27 32 3 8 3 10 13 3 9 0 1 1 4 10 3 10 13 4 11 3 13 16 4 [12 rows x 4 columns]

python matplotlib pandas

c# - ServiceStack Ormlite - Joins on child classes -



c# - ServiceStack Ormlite - Joins on child classes -

i'm using latest servicestack ormlite (v4.0.23), provides new bring together back upwards joining on multiple columns.

my entities inherit baseentity:

public class baseentity : ibaseentity { [autoincrement] [primarykey] public long id { get; set; } public datetime created { get; set; } public datetime updated { get; set; } public datetime? deleted { get; set; } public bool isdeleted { get; set; } }

say have 2 entities, userentity , answerentity, inherit base of operations class. when using joinsqlbuilder in v4.0.19 bring together these using this:

var joinbuilder = new joinsqlbuilder<answerentity, userentity>(); joinbuilder = joinbuilder.join<answerentity, userentity>( l => l.userid, r => r.id, x => new { x.id, x.answervalue, x.questionid, x.created, x.updated, x.deleted, x.isdeleted }, null, lx => lx.isdeleted == false, rx => rx.isdeleted == false);

after updating, error:

mysql.data.mysqlclient.mysqlexception : unknown column 'baseentity.isdeleted' in 'where clause' @ mysql.data.mysqlclient.mysqlstream.readpacket() @ mysql.data.mysqlclient.nativedriver.getresult(int32& affectedrow, int64& insertedid)...

using new bring together support, same error:

expression.join<answerentity, userentity>((l, r) => l.userid == r.id); expression.where<answerentity>(x => x.isdeleted == false);

should resolved in this commit that's available v4.0.23+ of servicestack that's currently available on myget. if have existing v4.0.23 packages myget installed need uninstalled first able pull downwards updated packages.

c# join ormlite-servicestack mysql.data

Understanding simple array logic for itemDetails(itemNo) = {size/colour/quantity} in javascript -



Understanding simple array logic for itemDetails(itemNo) = {size/colour/quantity} in javascript -

can help me array logic , how set in javascript? thanks!

//hidden array info var itemno = 0; var itemdetails[itemno]= {size:"big", colour:"yellow", quantity:5}; var itemdetails[itemno+1]= {size:"small", colour:"blue", quantity:3}; var itemdetails[itemno+2]= {size:"smaller", colour:"red", quantity:8}; //allow user alter of details held single item itemno = 2; //eg itemdetails[itemno].colour = "yellow" //use sets item2's colour value //list details of items held echo here's overview of details stored each item size colour quantity item 0: big yellowish 5 item 1: little bluish 3 item 2: smaller yellowish 8 echo there no more items list.

many thanks!

you need first declare itemdetails:

var itemdetails = [];

if want to, can set objects in array when declare it:

var itemdetails = [ {size:"big", colour:"yellow", quantity:5}, {size:"small", colour:"blue", quantity:3}, {size:"smaller", colour:"red", quantity:8} ];

if still want utilize itemno, can, it's unnecessary utilize numbers. in case, utilize var when you're declaring variable. otherwise, omit because you're making assignment: itemdetails[itemno]= {size:"big", colour:"yellow", quantity:5}; itemdetails[itemno+1]= {size:"small", colour:"blue", quantity:3}; itemdetails[itemno+2]= {size:"smaller", colour:"red", quantity:8};

in review, here corrected programme (with itemno):

var itemdetails = []; itemdetails[itemno]= {size:"big", colour:"yellow", quantity:5}; itemdetails[itemno+1]= {size:"small", colour:"blue", quantity:3}; itemdetails[itemno+2]= {size:"smaller", colour:"red", quantity:8}; itemno = 2; itemdetails[itemno].colour = "yellow";

javascript arrays variables indexing

android - Need help for adding button in menu screen using LIBGDX -



android - Need help for adding button in menu screen using LIBGDX -

i having 3 different screens contains splash screen, after menu screen , game screen. splash > menu > gamestarts.

how can add together image button ??

i want implement 3 buttons within menu screen, not getting thought start.

public class menuscreen implements screen { private spacegame game; private spritebatch batch; private sprite sprite; private texture texture; textureregion bg,play,spacegamelogo,button; orthographiccamera camera; vector3 touchpoint; private skin buttonskin; public menuscreen(spacegame game) { touchpoint = new vector3(); this.game=game; batch=new spritebatch(); bg=assetloader.bg; spacedebrislogo=assetloader.spacedebrislogo; button=assetloader.button; } @override public void show() { float w = gdx.graphics.getwidth(); float h = gdx.graphics.getheight(); photographic camera = new orthographiccamera(1, h / w); sprite = new sprite(bg); sprite.flip(false, true); sprite.setsize(1.0f, 1.0f * sprite.getheight() / sprite.getwidth() ); sprite.setorigin(sprite.getwidth() / 2, sprite.getheight() / 2); sprite.setposition(-sprite.getwidth() / 2, -sprite.getheight() / 2); } @override public void render(float delta) { batch.setprojectionmatrix(camera.combined); batch.begin(); sprite.draw(batch); batch.draw(spacedebrislogo, 33, 54, 50, 40); batch.end(); if (gdx.input.istouched()) { game.setscreen(new gamescreen()); dispose(); } }

there lot of methods it.. tell way do. first create button image, add together assets folder , load texture region. create sprite out of it.

sprite button1=new sprite(mytextureregion);

to check if button touched can utilize rectangle sprite check if touched image. in touchup method like

if(button1.getboundingrectangle.contains(screenx,screeny)) // thing

to create game more interesting add together rotation or scaling of sprite when clicked, looks better, can play it, or can create 2 textures, 1 touched downwards , 1 touched up.

android libgdx

regex - Name of input file in replacement output of stream editor? -



regex - Name of input file in replacement output of stream editor? -

i have list of files pass sed:

echo abc > test0; echo cab > test1; echo xyz > test2

i need have grouping captured and filename in output of sed like

$ cat test0 test1 test2 | sed -e 's/(\b[abc]+\b)/found \1 in file \?/' found abc in file ? found cab in file ? xyz

with question marks replaced respective filenames. possible? if yes, how :d

thanks in advance

edit: know can have simply

grep -e '(\b[abc]+\b)' test0 test1 test2

but need own output generate code in language

i utilize loop. can utilize bash:

for in test0 test1 test2; sed -e "s/(\b[abc]+\b)/found \1 in file $i/" "$i" done

regex bash sed

javascript - give two function in one button in Yii framework -



javascript - give two function in one button in Yii framework -

i have question yii framework, have problem submit button, want given 2 fungsi save , update in 1 submit button, can tell me how set function on form ?

<div class="row buttons"> <?php echo chtml::submitbutton($model->isnewrecord ? 'create' : 'save'); ?> </div>

i alter 'save' 'update' it's still have error primary key added, how can create 2 function update , save in 1 force button ?

public function actioncreate() { $model=new tbluasuts; // uncomment next line if ajax validation needed // $this->performajaxvalidation($model); if(isset($_post['tbluasuts'])) { $model->attributes=$_post['tbluasuts']; if($model->save()) $this->redirect(array('view','id'=>$model->nim_mhs)); } if(isset($_post['tbluasuts']) { $model->attributes=$_post['tbluasuts']; if($model->update()) $this->redirect(array('view','id'=>$model->nim_mhs)); } $this->render('update',array( 'model'=>$model, )); }

in form, can utilize :

<div class="row buttons"> <?php echo chtml::submitbutton($model->isnewrecord ? 'create' : 'update'); ?> </div>

as far processing different actions on backend code, there few options, example, :-

direct form different urls set (hidden) field (for illustration id) , parse that. use default action activeform, directs invoking action, illustration actioncreate(), or actionupdate()

in lite of updates, please extend controller per initial suggestion have action actionupdate()

the main difference between actioncreate(), or actionupdate() actions create action create new (empty) tbluasuts object, while update action populates tbluasuts object database.

public function actioncreate() { $model=new tbluasuts; ... ... things $model ... ... $model->save(); } public function actionupdate { // id of existing entry passed in url. illustration // ...http:// .... /update/id/10 // $model = tbluasuts::model()->findbypk($_get['id']); ... ... things $model ... ... $model->save(); }

javascript php button yii

Android Path bended/waved line -



Android Path bended/waved line -

i have java list points needs drawn path in canvas. create curved line point list.

an illustration of line can found here: http://postimg.org/image/67p4ztil1/

thanx

have checked fingerpaint demo in android sdk examples. can utilize path.quadto() or path.cubicto() that.

this may useful - bezier curve , canvas.

edit: line path: bezier curves

http://rengelbert.com/blog/line-path-bezier-curves/

android android-canvas

javascript - How to build a Firefox addon to always show bookmark-stored-details (e.g. tags) for current tab -



javascript - How to build a Firefox addon to always show bookmark-stored-details (e.g. tags) for current tab -

problem

in firefox, when current tab contains bookmarked page, need see details stored in corresponding bookmark (name, folder, tags, etc.), without single additional click.

i need help on how solve (seemingly solvable) problem.

possible solutions:

show bookmark details text appended title bar show bookmark details through controls dynamically built on dedicated toolbar

technical questions

is there event fired when bookmark [for current tab] changed? can addon respond such event? can addon modify text shown in title bar current tab? can provide link source code simple, ~modern, addon adds toolbar? know / utilize s3 download statusbar 1 quite advanced firefox development skills.

nice idea.

this how tags url.

var navbookmarksservice = components.classes["@mozilla.org/browser/nav-bookmarks-service;1"].getservice(components.interfaces.nsinavbookmarksservice); var urltocheckifbookmarked = 'https://www.bing.com/'; var uri = services.io.newuri(urltocheckifbookmarked, null, null); console.log(navbookmarksservice.isbookmarked(uri)) //this line tells if url bookmarked var taggingsvc = components.classes["@mozilla.org/browser/tagging-service;1"].getservice(components.interfaces.nsitaggingservice); var tags = taggingsvc.gettagsforuri(uri) console.log(tags)

see tagging service: https://developer.mozilla.org/en-us/docs/mozilla/tech/xpcom/reference/interface/nsitaggingservice

is there event fired when bookmark [for current tab] changed? can addon respond such event?

yes have utilize bookmark observer service: https://developer.mozilla.org/en-us/docs/mozilla/tech/xpcom/reference/interface/nsinavbookmarksservice#beginupdatebatch%28%29 https://developer.mozilla.org/en-us/add-ons/code_snippets/bookmarks#observing_changes_to_bookmarks_and_tags

can addon modify text shown in title bar current tab?

yes. can either alter title of document loaded. or domwindow , modify it's title attribute. ie: document.queryselector('#main-window').setattribute('title','rawr')

javascript firefox firefox-addon firefox-addon-sdk