Posts

Showing posts from September, 2011

java - Downloading blob file on JDBC causes memory leak if internet is cutoff during preparedstatement.execute() -

i trying make robust application can download blob files mysql server. files executables or other binary files. download works well, want bullet proof survive internet cutoff midway in download. if internet cutoff occurs before preparedstatement.execute(),everything goes well, memory cleared of garbage , program exits gracefully . on other hand ,if cutoff internet 5 seconds execution of preparedstatement.execute(),the thread downloading hangs indefinitely , never cleared garbage collector , program never exits. main exits,the downloader manager exits,but downloading thread never exits. methodology: (1)main thread trigger downloadmanager object existence. (2)downloadermanager object trigggers separate puredownload object(in separate thread) invoke prepared statement get binary data make downloads. (3)downloadermanager polls puredownload object detect if cutoff connection has caused become unresponsive , tries kill it. observing heap dump on netbeans, puredownload o...

node.js - Socket.io + co: Is this how it's supposed to be used? -

i trying http://socket.io/ working co . i trying tasks asynchronously in code. io.on('connection', function (socket) { // <--- need heavy here socket.on('something', function (data) { // <--- need heavy here }); // <--- need heavy here }); that's how socket.io works. add co mix now. i've tried following: io.on('connection', function (socket) { co(function* () { yield something(); // <--- works socket.on('something', function (data) { yield something(); // <--- not work }); yield something(); // <--- works }); }); get error: syntaxerror: unexpected strict mode reserved word and this: io.on('connection', function (socket) { co(function* () { yield something(); // <--- works socket.on('something', function (data) { co(function* () { yield something(); // ...

c++ - cocos2d-x 3.8 - Use network extension -

i'm trying use httpclient in cocos2d-x project. i'm using cocos2d-x 3.8 , developing xcode. some things tried do: i looking cocos-ext.h file , saw network removed. in thread explains moved core: http://discuss.cocos2d-x.org/t/why-remove-network-on-cocos2d-x-3-0-beta/10804 i saw in network/httpasynconnection-apple.h there 2 namespaces declared, cocos2d , network when add code compiler says: no member named 'network' in namespace 'cocos2d' cocos2d::network::httprequest* request = new cocos2d::network::httprequest(); probably i'm missing something? need add preprocessor macro enable network? param in c++ compiler enable sub-namespaces? i read documentation here, in cocos2d-x.org , stackoverflow no success. any appreciated! this embarrassing, forgot including httprequest header file. missed: #include "network/httpclient.h"

vba - Copy from multiple sheets and paste into sheet 1 -

i trying data multiple worksheets , paste sheet 1 code isnt working properly. keeps copying sheet "table 1" on , on again. know wrong code? thanks option explicit sub test() dim ws worksheet dim integer each ws in thisworkbook.worksheets if ws.name <> "table 1" activesheet.range("a15:x35").select selection.copy worksheets("table 1").activate = 1 5000 if isempty(cells(i, 1)) = true , isempty(cells(i + 1, 1)) = true activesheet.cells(i, 1).select activesheet.paste exit end if next end if next ws end sub inside loop, copying activesheet , not ws . if activesheet "table 1" (in fact, activate table 1 in statement worksheets("table 1").activate ), of course if keep copying it. besides, better copy directly ran...

regex - Using R, how do I test a dataframe of phrases to see if it contains keywords -

i have 2 dataframes. 1 containing search phrases this search.phrases 1 quick 2 brown fox jumps 3 on lazy 5 dog 6 why 7 nobody knows ... and containing keywords keywords 1 quick 2 lazy 3 dog 4 knows ... ideally, want find search phrases contains 1 or more (either boolean or count) of the keywords search.phrases keyword.found 1 quick true 2 brown fox jumps false 3 on lazy true 5 dog true 6 why false 7 nobody knows true ... i've been trying while i'm stumped. appreciated. lots of love g you can use grepl() rgx <- paste(as.character(df2$keywords), collapse = "|") df$keyword.found <- grepl(rgx, df$search.phrases) result: search.phrases keyword.found 1 quick true 2 brown fox jumps false 3 on lazy true 5 dog true 6 why false 7 nobody k...

python - sqlalchemy yield_per() batch -

i'm trying 10000 records @ time using yield_per(). gives me records of query 1 one in stream, using cursor of length 10000. there way lists (of size 10000) of records instead of getting 1 one? for record in connection.query(my_query).yield_per(10000): foo(position)

javascript - Convert Ember Model Attribute to String -

i have template trying set input value of html form model.name value. however, don't want changes in box affect global store. can convert model.name string only ? you can use unbound helper: {{input value=(unbound model.name)}}

c# - How can i refresh one specific hWnd window every X minutes? -

what i'm doing capturing screenshot of windows in background. in listbox have items of windows i'm taking screenshots. idea windows in background don't need move windows foreground each time. in form1 constructor: this.listboxsnap.items.addrange(windowsnap.getallwindows(true, true).toarray()); then in form1 have refreshwindowslist method: private void refreshwindowslist() { graphics g; g = graphics.fromimage(img); g.clear(color.transparent); buttonsnap.enabled = true; this.listboxsnap.items.clear(); this.listboxsnap.items.addrange(windowsnap.getallwindows(true, true).toarray()); (int = listboxsnap.items.count - 1; >= 0; i--) { string tt = listboxsnap.items[i].tostring(); if (tt.contains(" ,")) { listboxsnap.items.removeat(i); } } string[] my...

javascript - deferred anti pattern of promises unclear example -

from https://github.com/petkaantonov/bluebird/wiki/promise-anti-patterns what promise talking about? myapp.factory('configurations', function (restangular, motorrestangular, $q) { var getconfigurations = function () { //just return promise have! return motorrestangular.all('motors').getlist().then(function (motors) { //group cofig var g = _.groupby(motors, 'configuration'); //return mapped array value of promise return _.map(g, function (m) { return { id: m[0].configuration, configuration: m[0].configuration, sizes: _.map(m, function (a) { return a.sizemm }) } }); }); }; return { config: getconfigurations() } }); where promise? me looks more it's anti pattern use pattern. cannot see promise in code apart ...

php - Include Class in Parent Based on Child Class -

i have child controller class extends base controller class. in child have defined static namespace string points model class want use when calling functions in base class. right now, have use call_user_func call function on correct model class. code looks this: child class class rolescontroller extends controller { const resource_name = 'roles'; const model = 'role'; } parent class class controller extends basecontroller { private $model; public function __construct() { $this->model = 'app\\models\\' . static::model; } public function getall(request $request) { $objects = call_user_func([$this->model, 'getall'], [ model::get_option_format => true ]); return response::success([ static::resource_name => $objects ]); } } i can't think design pattern incorrect. there better way accomplish trying without having rely on call_u...

C# Iterating over known textboxes from array -

i trying iterate on textboxes string in string array static string[] textboxes = { "empname", "sales", "basepay", "commission", "grosspay", "deductions", "housing", "foodandclothing", "entertainment", "misc" }; each of above parts of form example txthousing housing input element. , on , forth. and iteration takes place here private void btnclear_click(object sender, eventargs e) { (byte = 0; < textboxes.length; i++) { this["txt" + textboxes[i]].text = ""; } this.txtempname.focus(); } except i'm getting strange ...

rspec - Spec creating tmp file on circleCI is failing -

i have rspec test creates tmp file , read in test. circleci fails saying failure/error: file_name = generate_csv_file(items) errno::enoent: no such file or directory @ rb_sysopen - /home/ubuntu/project/tmp/batch_1443573588.csv cricleci default not have tmp directory rails projects. your options to: use system /tmp add tmp git repository add post checkout hook in circle.yml create it

Bash case statement with number ranges -

this question has answer here: using case range of numbers in bash 4 answers i in need of assistance cannot life of me seem understand bash case statements. i'm trying input user, annual income, , reply respective tax bracket. cannot seem cases work range of numbers. appreciated. thanks. here code far: #!/bin/bash echo -e "what annual income? " read annual_income case $annual_income in 0) echo "you have no taxable income." ;; [24100-42199]) echo "with annual income of $annual_income, in lowest income tax bracket total effective federal tax rate of 1.5%." ;; [42200-65399]) echo "with annual income of $annual_income, in second income tax bracket total effective federal tax rate of 7.2%." ;; [65400-95499]) echo "with annual income of $annual_income, in middle income tax bracket total effective federal...

xslt - what is the XSL to convert the following xml to another xml -

i have xml file of below format: -<table> <a> <a>x</a> <b>y</b> </a> <b> ... ... .... </b> <c> ... ... ... </c> </table> i want make "a" root node instead of table. there way code in xsl above xml looks below? <a a="x" b="y"> <b> ... ... ... </b> <c> ... ... ... </c> </a> try <xsl:template match="table"> <a> <xsl:for-each select="a/*"> <xsl:attribute name="{local-name()}"> <xsl:value-of select="."/> </xsl:attribute> </xsl:for-each> <xsl:copy-of select="*[not(self::a)]"/> </a> </xsl:template>

javascript - Which event to bind to after browser's window.location receives a file from the web server? -

i using window.location download file web server. process on server create file takes while , display progress bar in browser. the code line after window.location hides progress bar executes right after window.location executes immediately, therefore progress bar doesn't show. how show progress bar until browser gets file? there event fires when happens? attach event , that's can hide progress bar. addition: window.location going asp.net mvc action method (same app) returns filestreamresult.

Understand JavaScript scope within for-loop -

this question has answer here: javascript closure inside loops – simple practical example 31 answers the following piece of code prints out "k" 16 times. var rest = "klmnopqrstuvwxyz".split(""), fns = {}; (var i=0; i<rest.length; i++) { (function(i){ fns[rest[i]] = function() { console.log(rest[i]); }; fns.k(); })(i); } this piece of code prints out alphabets "k", "l" ....... "y", "z" var rest = "klmnopqrstuvwxyz".split(""), fns = {}; (var i=0; i<rest.length; i++) { fns[rest[i]] = function() { console.log(rest[i]); }; fns.k(); } i new javascript, , don't quite understand how use of iife in second example results in different behavior. can please clarify? var rest = "klmnopqrstuvwxyz...

jsf 2 - Add html content to faces message from Backing Bean -

this question has answer here: how add html code jsf facesmessage 4 answers i need add html content when method returns wanted result (any method, result) jsf page primefaces . html add simple : <div class="alert alert-success" role="alert"> <strong>well done!</strong> read important alert message. </div> but can't find way cleanly, i've read many posts how return html managed bean in jsf? bean need insert html when user doing e.g. submitting form result. also : there way save , show in case of redirection primefaces context.getexternalcontext().getflash().setkeepmessages(true); why not using h:messages tag ? customizable in terms of design , can affect styles , class without turn-around source : http://www.jsftoolbox.com/documentation/help/12-tagreference...

javascript - HTML input range hide thumb -

i got range input in ionic mobile app: <input class="clear-all" type="range" name="strange" on-release="updatecontent()" ng-model="rangedefault" min="1" max="{{rangescount}}" value="1" step="1" ng-disabled="isdisabled()"> with css applied it: .custom-range input[type='range']::-webkit-slider-thumb { width: 20%; /*display: none;*/ height: 1.6vh; background: rgb(255,255,255); box-shadow: 0px 0px 0px 2px rgba(0, 0, 0, 1); margin-top: -3px; border-radius: 5px; } depending on option want hide thumb keeping track. if comment out display: none; works. range input without thumb. want dynamically based on user interaction. i don't know how interact input on css. i'm using angularjs , javascript no jquery (i'll keep away project long can) i'm looking pure js solution. i read this , this , this among others solution. i...

c# - Ensure DB connection is closed on Background worker Cancel Async -

i have code far background worker run background worker: if (backgroundworker1.isbusy == true) { backgroundworker1.cancelasync(); } else { backgroundworker1.runworkerasync(); } will close out connection in backgrounder worker well? or need add lines of code progress change? private void backgroundworker1_dowork(object sender, doworkeventargs e) { try { superset = new dataset(); connectionstring = "driver={ibm db2 odbc driver}; database=" + lines[i] + "; hostname=" + lines[i] + "." + lines[i] + ".xxx; port = xxxx; protocol = tcpip; uid=xx; pwd= xxxx; } connection = new odbcconnection(connectionstring); adapter = new odbcdataadapter(masterquery, connection); connection.open(); adapter.fill(superset); superset.merge(superset); connection.close(); } } datagridview1.datasource = su...

.net - Architecture of Azure Mobile Services Application -

Image
i'm trying piece architecture windows universal app leveraging azure mobile services. it's lob app , need handle 100-250 offline\online tables. mobile services doesn't support nested complex objects on service side i've mapped of tables straight through entity framework. the question have whether should use separate layer reconstitute dto's or if should doing through service layer , view model. main concerns isolation of responsibility (large team) , performance overhead additional mapping. didn't have reputation add image here's link model. an example person object collection of addresses attached. have 3 dto objects: 1 person 1 address , 1 many many relationship. if i'm mapping straight through view model i'd need addressing service lookup address specific person. if insert "model" layer service returns person model collection of address on it. feels bit wrong though... the right choice depends on how doing querying...

mysql - Using inner joins gives too many results -

i'm having trouble inner joins. i'm assuming i'm making critical, yet basic error in theory. table structure: bookdb - table includes data books in our library (title, barcode, check out status, etc) librarydb - table includes data checked out book when studentdb - table includes data students (name, id number, etc) i made page listed books checked out using check out status of bookdb table. of course doesn't let me know has it. in order display has checked out book, want call librarydb, records checked out, call studentdb, contains name, etc of student. so made query this: select * bookdb inner join librarydb on bookdb.barcode = librarydb.barcode inner join studentdb on librarydb.studentid = studentdb.studentid bookdb.status = '$checkinstatus' order title asc the problem instead of getting result of person checked out recently, every person ever checked out. i realize simple i've tried looking @ other similar posts , can't seem...

python - sdl2 (pysdl2) without x11 using directFB or OpenGL ES -

i working on debian based embedded systems avoids overhead of windowing systems running graphics directly screen using fbcon (similar directfb). common raspberry pi screens , there plenty of resources pygame 1.9.1 (sdl1.2 based) , fbcon. python 2.7 , pygames 1.9.1 running fbcon working arrangement. i want move python 3 , improved sdl2 library (pygames updates slow), need retain lower level graphics capability. see little documentation of level of support besides couple mentions of directfb capability. i not using raspberry pi, specific solutions pi less helpful me. before going deep, wanted see if else has experience this. has run pysdl2 or sdl2 without x11? was there issues or changes besides flag directfb driver? has tried alpha pygames 1.9.2? besides being helpful myself think great community. see other asking similar questions minimal or no useful answers. thanks time references: pysdl2 libsdl

Filter list with substring javascript? -

var ctr; var lst = ["", "xml", "w1", "w2"]; var ids = []; ctr = 0; (y = 0; y < lst.length; y++) { if (lst[y].substring(0, 1) === "w") { ids[y] = lst[y]; ctr = ctr + 1; } } console.log([ids, ctr]); output: [[undefined, undefined, 'w1','w2'], 2] expected output: [['w1','w2'],2] what doing wrong? counter returned number have expected why getting 2 undefined in list? why happening? you need use ids.push(lst[y]); instead of ids[y] = lst[y]; , otherwise assigning values ids array @ random indexes - ie missing index values. in code values assigned @ indexes 2 , 3 missing indexes 0 , 1 causing said output, because not assigning values ids in iterations - skipping iterations based on condition

php - Data not saving through model in yii2 -

i newbie yii2 framework. i creating custom form , saving data table. tried every solution here or on google. i getting frustrated. can solve or give solution problem? if need can give code or access of site well. you cannot save data database using form model form model introduced in yii collect user data. later data used , discarded. can not save data database. to save data, should use active records

php - usage of array session in laravel 4.2 -

i'm kinda lost in using array session in laravel 4.2. in documentation, says session::push('user.teams', 'developers'); . i'm assuming user.team session name developers value. can this, session::push('book.id','1234'); session::push('book.name','sample book'); session::push('book.rating','5'); and i'll $bookname= session::get('book.name'); am doing right? or should use individual sessions? first thing put array want, push elements array using . symbol $user = ['name'=>'ahmed']; session::put('user' , $user); // put array session::push('user.age','15'); // push element //$user = session::get('user'); // retrieve array dd(session::get('user.age')); // retrieve 1 element

css - How to do responsive rows of images in HTML? -

Image
we want grid of images each row number of images same height potentially different widths. , whole thing needs grow , shrink browser width changes. the best solution have come far is: <div id="root"> <div><img src="img/r1a.jpg" style="max-width:33.334%; min-width:33.333%;"/><img src="img/r1b.jpg" style="max-width:33.334%; min-width:33.333%;"/><img src="img/r1c.jpg" style="max-width:33.334%; min-width:33.333%;"/></div> <div><img src="img/r2a.jpg" width="50%"/><img src="img/r2b.jpg" width="50%"/></div> <div><img src="img/r3a.jpg" style="max-width:33.334%; min-width:33.333%;"/><img src="img/r3b.jpg" style="max-width:33.334%; min-width:33.333%;"/><img src="img/r3c.jpg" style="max-width:33.334%; min-width:33.333%;...

java - StackOverflowError In Finding No of Ways -

hi trying write java code problem statement : find no of ways of distributing n coins m members 1 of them captain(distributor). each member can take 1 coin @ time , pass other members including captain. captain cant have first coin. however, when there 1 coin left the coin should given captain. how many ways possible ? i tied this. getting stackoverflowerror . please help. here making starting call solve(1,n) private static int solve(int r, int n) { int count = 0; if(n==2 && r!=1) { return 1; } if(n==2 && r==1) { return 2; } for(int i=1;i<=m;i++) { if(r!=i) count += solve(i,--n); } return count; } stack trace exception in thread "main" java.lang.stackoverflowerror @ noprey.solve(noprey.java:50) @ noprey.solve(noprey.java:62) @ noprey.solve(noprey.java:62) @ noprey.solve(noprey....

python - Django ManyToMany Relation with django.contrib.auth.models.User -

i have following model: class bm(models.model): created_date = models.datetimefield(auto_now_add=true, editable=false) birth_date = models.datetimefield(null=false, blank=false) name = models.charfield(null=false, blank=false, max_length = 255) relations = models.manytomanyfield(user) when try run test python manage.py test following error: django.db.utils.programmingerror: relation "auth_user" not exist this due trying create relation user table before table gets created itself. how can this? edited say: this happening because bm model table being created before auth user table, following statement run (according ./manage sqlall p : create table "p_baby_relations" ( "id" serial not null primary key, "baby_id" integer not null, "user_id" integer not null references "auth_user" ("id") deferrable deferred, unique ("baby_id", "user_id") ) ; the ...

Connect CouchDB with asp.net C# application -

how connect couchdb asp.net c# application? if 1 can give sample application. after installing nuget, create instance of mycouch.client , pass url of database. using (var client = new mycouchclient("http://127.0.0.1:5984/test")) { //consume here } the format is: {scheme}://[{username}:{password}]/{authority}/{localpath} . v0.11.0, there's specific mycouchuribuilder can use building uri. automatically e.g. apply uri.escapedatastring username , password when calling setbasiccredentials . var uribuilder = new mycouchuribuilder("http://localhost:5984/") .setdbname(testconstants.testdbname) .setbasiccredentials("foob@r", "p@ssword"); return new mycouchclient(uribuilder.build()); for more details click here

c - Mac OS X: If there's a header needed when compile linux kernel, but os x doesn't have, where should I put it to? -

here's situation: using mac compile linux kernel arm board, how happened: arch/arm/vdso/vdsomunge.c:48:10: fatal error: 'byteswap.h' file not found i googled , find out mac doesn't have 'byteswap.h', download 'byteswap.h' version based on 'osbyteorder.h' write others, don't know put header. any 1 can help? answer myself: put in /usr/include, , problem solved.

Switch to popup in python using selenium -

how switch popup window in below selenium program. i've looked possible solutions haven't been able head around them. please help!! from selenium import webdriver splinter import browser selenium.webdriver.common.keys import keys handle = [] driver = webdriver.firefox() driver.get("http://example.com/test.aspx") driver.find_element_by_link_text("site actions").click() driver.find_element_by_link_text('edit page').click() select = driver.find_element_by_id('ctl00_placeholdermain_ctl35_ctl00_selectresult') option in select.find_elements_by_xpath('//*[@id="ctl00_placeholdermain_ctl35_ctl00_selectresult"]/option'): if option.text != 'channel': option.select() # select() in earlier versions of webdriver driver.find_element_by_id('ctl00_placeholdermain_ctl35_ctl00_removebutton').click() parent_h = driver.current_window_handle #click activates popup. checkin = driver.find_elemen...

c# - Validation not firing on submit after clicking reset button -

validation not firing(not showing error messages) when click submit button after clicking cancel(reset) button. validation works when click submit button first before cancel button. have included javascript validations 2 fields , 1 validation clearing error messages. thats (javascript validation 2 textboxes alone working in above condition) aspx code <body> <h3>project details</h3> <form id="form1" runat="server"> <table align="center" cellpadding="30" > <!----- project name ----------------------------------------------------------> <tr> <td>project name</td> <td> <p>::</p> </td> <td class="pi"> <p> <asp:textbox id=...

c# - How to get last duplicate item from a list -

i have list contains duplicate items, , need last entry of items. what tried below, can't find further solution achieve need to. list<listitem> listitems = new list<listitem> { new listitem{ item1="item1", item2="item2"}, new listitem{ item1="item2", item2="item22"}, new listitem{ item1="item3", item2="item23"}, new listitem{ item1="item4", item2="item24"}, new listitem{ item1="item4", item2="item244"}, new listitem{ item1="item4", item2="item244"}, new listitem{ item1="item5", item2="item25"}, new listitem{ item1="item1", item2="item12"}, new listitem{ item1="item6", item2="item26"}, new listitem{ item1="item7", item2="item27"}, ...

theforeman - Foreman with Puppet node Net::HTTPNotFound Error -

i have installed foreman (v1.9.0) on rhel 7.1 vm per official documentation. my current environment consists of: 1 x puppet master/foreman 2 x agents (rhel 6.5 & 7) foreman configured enc service 9 environments (inc production). smart proxy has been configured in foreman foreman/puppetmaster. there no issues on agents in generating csr , getting signed puppet master. when run puppet agent on remote machine command puppet agent --no-daemonize --server <fqdn> --trace i following errors warning: unable fetch node definition, agent continue: warning: error 400 on server: failed find < agent fqdn> via exec: execution of '/etc/puppet/node.rb < agent fqdn>' returned 1: running referenced command on puppet master sudo -u puppet /etc/puppet/node.rb <agent fqdn> returns error: error retrieving node < agent fqdn> net::httpnotfound check foreman's /var/log/foreman/production.log more information. re...

html - Video is not shared to facebook account -

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <meta property="fb:app_id" content="appsid" /> <meta property="og:url" content="http://103.231.125.106/nesos/fblink.jsp" /> <meta property="og:video" content="http://103.231.125.106/nesos/videoappsuser/flowplayer-3.2.18.swf?config={'clip':{'url':'http://103.231.125.106/nesos/videoappsuser/151014150717samplevideo_1080x720_1mb.mp4'}}" /> <meta property="og:video:secure_url" content="https://103.231.125.106/nesos/videoappsuser/flowplayer-3.2.18.swf?config={'clip':{'url':'https://103.231.125.106/nesos/videoappsuser/151014150717samplevideo_1080x720_1mb.mp4'}}" /> <meta property="og:video:type" content="application/x-shockwave-flash" /> <meta property="og:video:width" content="400"...

"localizedStandardCompare" depends on the language preference of the iOS device -

nssortdescriptor *sortdescriptor = [[nssortdescriptor alloc] initwithkey:@"name" ascending:yes selector:@selector(localizedstandardcompare:)]; [fetchrequest setsortdescriptors:[nsarray arraywithobjects:sortdescriptor,nil]]; i working on app has list of names, names in Íslenska(icelandic) language. above code works fine if language selected apps in settings Íslenska(icelandic) sort descriptor fails if language other Íslenska(icelandic). is there way resolve dependency problem? this should create sortdescriptor compare strings using is_is locale. nssortdescriptor* sortdescriptior =[[nssortdescriptor alloc] initwithkey:@"name" ascending:yes comparator:^(nsstring* str1, nsstring* str2) { static nsstringcompareoptions comparisonoptions = nscaseinsensitivesearch | nsnumericsearch | nswidthinsensitivesearch | nsforcedorderingsearch; return [str1 compare:str2 options:comparisonoptions range:nsmakerange(0, str1.length) locale:[nslocale ...

model view controller - A potentially dangerous Request.Form value was detected from the client for mandrill webhook -

i using handle bounce mails on our server [validateinput(false)] public string mandrill(formcollection fc) { string json = fc["mandrill_events"]; } but getting error system.web.httprequestvalidationexception (0x80004005): potentially dangerous request.form value detected client (mandrill_events="...550 5.1.1 ..."). please solve issue.

android - @OnClick doesn't works after rotation in ButterKnife -

i have next fragment: public class myfragment extends fragment { @nullable @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = inflater.inflate(r.layout.my_fragment, container, false); return view; } @override public void onviewcreated(view view, bundle savedinstancestate) { butterknife.setdebug(true); butterknife.bind(this, view); } @onclick(r.id.button) public void onbuttonclicked () { //do stuff } } onclick method works charm first time , works fine until rotate device. when rotate device, method doesn't works more. log has no errors. do know problem? thanks you. try retain fragment avoid destroyed , created again.it may resolve problem

Configuring web host mysql database in jsp website made in Netbeans -

i have made jsp website in netbeans tried , tested on local server through tomcat(using access database) , worked fine. web host has provided me host, database name, username , password of database. want configure website use database. don't know how that. have seen system.properties file in web-inf/config folder content this: jndi_name=java:com/env/oracle/jndi db.login= db.password= driver=sun.jdbc.odbc.jdbcodbcdriver url=jdbc:odbc:mydb duser= dpass= logfile=log/aoc_log.txt dbname=my_db but confused how modify file. also, database accessible web host. below code shows how connection made (i think so...) public connection getconnection() { try { if(con==null) { try { properties p = getproperties(); class.forname(p.getproperty("driver")); system.out.println("driver loaded"); con = drivermanager.get...

Reading docker-compose environment variables in application code -

maybe i'm being really dumb , not understanding properly; want define docker-compose.yml file so: web: ... environment: foo: bar bar: foo and want expose environment variables runtime applications run inside container (i guess mapping them shell variables?). what's best way achieve this? i think have minor syntax issue in yml, try changing to: web: ... environment: - foo=bar - bar=foo you should able access variables in code expected.

c++ - does .so size affect virtual function performance -

recently, met performance problem. in vtune result, virtual function cost no.1 cost, when reduce size 48m 37m, performance seems better, raise 3.9%. i wanna know, .so size realy affect virtual function performance, if so, why? thanks! it not purely size (though of course affects paging after program loaded), number of adjustments loader must make when loading program. can see measured setting environment variable ld_debug=statistics virtual functions in particular require lot of adjustments during loading. discussion on this, measure time taken dynamically linking @ program startup? faster c++ program startups improving runtime linking efficiency. position independent executable (pie) performance

android - How to implement GPS Status change listener -

in android application sending location update server in each 5 minutes. using gms locationlistener. working fine. running inside service. wont work if user turned off gps. since running in service after turning on gps wait completing 5 minutes of update time. want when user turned on gps should trigger onlocationupdate listener. for have did follows have initialized gpsstatus.listener in service, , implemented onstatuschange function. after changing gps status on off/ off on ,the function not triggering . code public class locationupdateservice extends service implements gpsstatus.listener, com.google.android.gms.location.locationlistener{ oncreate(bundle b){ super.oncreate(); registergpsstatuslistener(); } private void registergpsstatuslistener() { locationmanager locationmanager = (locationmanager) getsystemservice(context.location_service); locationmanager.addgpsstatuslistener(this); } @o...

javascript - Charts using Jquery -

i want design pie chart using jquery,html,css how? how daily report in pie chart representation using code. teja <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["corechart"]}); google.setonloadcallback(drawchart); var test=new array(); function drawchart() { var jsondata = $.ajax({ url:'getdata.php', type:'get', datatype:'json', contenttype: 'application/x-www-form-urlencoded', async:false, success: function(data){ test=data; } }).responsetext; //alert(test); var data = google.visualization.arraytodat...

javascript - In Reactjs, how to send and respond to user defined event? -

in reactjs, how send user defined event? , response user defined event? can please give example? e.g. user.newitemaddtocart below code example responding standard dom event. var addfriend = react.createclass({ getinitialstate: function(){ return { newfriend: '' } }, updatenewfriend: function(e){ this.setstate({ newfriend: e.target.value }); }, handleaddnew: function(){ this.props.addnew(this.state.newfriend); this.setstate({ newfriend: '' }); }, render: function(){ return ( <div> <input type="text" value={this.state.newfriend} onchange={this.updatenewfriend} /> <button onclick={this.handleaddnew}> add friend </button> <span onuser.newitemaddtocart= {...}> work?</span> </div> ); } });

jsf - Primefaces Datatable coloring row -

closeditem returns boolean . add datatable rowstyleclass="#{(res.closeditem) eq true ? 'closed' : null}" my css <style type="text/css"> .closed { background-color: #6ce26c !important; background-image: none !important; color: #000000 !important; } </style> but doesn't work, pls help. try: rowstyleclass="#{res.closeditem ? 'closed' : ''}"

Assembly segmentation fault during retq -

i have bit of assembly code calls using callq . upon calling retq , program crashes segmentation fault. .globl main main: # def main(): pushq %rbp # movq %rsp, %rbp # callq input # input movq %rax, %r8 callq r8_digits_to_stack # program not getting here before segmentation fault jmp exit_0 # put binary digits of r8 on stack, last digit first (lowest) # uses: rcx, rbx r8_digits_to_stack: movq %r8, %rax # copy popping digits off loop_digits_to_stack: cmpq $0, %rax # if our copy zero, we're done! jle return movq %rax, %rcx # make copy extract digit andq $1, %rcx # last digit pushq %rcx # push last digit stack sarq %rax # knock off last digit next loop jmp loop_digits_to_stack # return wherever last called return: retq # exit code 0 exit_0: movq $0, %rax # return 0 ...