Posts

Showing posts from June, 2014

php - Why Jenkins "BUILD SUCCESSFUL", but "Finished: FAILURE"? -

i set jenkins job php template http://jenkins-php.org/ , using https://github.com/sebastianbergmann/money test. after building finished, got message: build successful total time: 58 seconds [warnings] parsing warnings in console log parser php runtime [checkstyle] collecting checkstyle analysis files... [checkstyle] finding files match pattern build/logs/checkstyle.xml [checkstyle] parsing 1 file in /var/lib/jenkins/jobs/new job/workspace [checkstyle] parsed file /var/lib/jenkins/jobs/new job/workspace/build/logs/checkstyle.xml 0 unique warnings , 0 duplicates. [pmd] collecting pmd analysis files... [pmd] finding files match pattern build/logs/pmd.xml [pmd] parsing 1 file in /var/lib/jenkins/jobs/new job/workspace [pmd] parsed file /var/lib/jenkins/jobs/new job/workspace/build/logs/pmd.xml 0 unique warnings , 0 duplicates. [dry] collecting duplicate code analysis files... [dry] finding files match pattern build/logs/pmd-cpd.xml [dry] parsing 1 file in /var/lib/jenkins/jobs/new ...

jsf - commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated -

Image
sometimes, when using <h:commandlink> , <h:commandbutton> or <f:ajax> , action , actionlistener or listener method associated tag not being invoked. or, bean properties not updated submitted uiinput values. what possible causes , solutions this? introduction whenever uicommand component ( <h:commandxxx> , <p:commandxxx> , etc) fails invoke associated action method, or uiinput component ( <h:inputxxx> , <p:inputxxxx> , etc) fails process submitted values and/or update model values, , aren't seeing googlable exceptions and/or warnings in server log, not when configure ajax exception handler per exception handling in jsf ajax requests , nor when set below context parameter in web.xml , <context-param> <param-name>javax.faces.project_stage</param-name> <param-value>development</param-value> </context-param> and not seeing googlable errors and/or warnings in browser's jav...

Mysql workbench cannot connect to mysql server -

Image
since on ubuntu 15.10 (i on 14.10 before) can't connect mysql mysql-workbench, if connection test successful. there way make connection work? i have forced connection tcp, still doesn't work. mysql -u root -p --host=127.0.0.1 mysql -u root -p --protocol=tcp mysql ver 14.14 distrib 5.6.28, debian-linux-gnu (x86_64) using editline wrapper connection id: 55 current database: current user: root@localhost ssl: not in use current pager: stdout using outfile: '' using delimiter: ; server version: 5.6.28-0ubuntu0.15.10.1 (ubuntu) protocol version: 10 connection: localhost via tcp/ip server characterset: latin1 db characterset: latin1 client characterset: utf8 conn. characterset: utf8 tcp port: 3306 uptime: 9 min 38 sec

How to run php script without all limits? -

i know there many questions, how run php script without time execution limit, im curious, how run php script without limitations. (i think there max memory consumption, mysql timeout, etc...) i have script, mapping part of harddrive , reading directory , files content , storing data database. im expectating script take long time , huge chunk of memory. so question is, should set "infinite" script running maximum posible duration? as now, im using ini_set, reason script ends before finished. (and before 40 minutes time limit set) ini_set('max_execution_time', 2400); ini_set('display_errors',1); ini_set('mysql.connect_timeout', 2400); ini_set('default_socket_timeout', 2400); there's no way unset limit @ once. the best can @ php.ini directive , try figure out applies system, , increase them unlimited value, or when not applicable, big value. here's list of core php directives: https://secure.php.net/manual/en/ini.l...

swift - iOS: Passing Parameters to private Framework while Initializing a UIViewController -

i trying create custom framework can use across apps. when instantiate first viewcontroller framework in app, pass in 2 parameters. import uikit public class newvc: uiviewcontroller { public var startcolor: string? public var endcolor: string? public required init(startcolor: string, endcolor: string) { self.startcolor = startcolor self.endcolor = endcolor super.init(nibname: "sb", bundle: nil) } public required init?(coder adecoder: nscoder) { super.init(coder:adecoder) } } now, trying instantiate newvc in appdelegate : import newvcframework //... let vc = newvc(startcolor:"00ff33a", endcolor:"ff0c756") let s = uistoryboard(name: "sb", bundle: nsbundle(forclass: vc)) //i error on line above points @ vc self.window?.rootviewcontroller = s.instantiateinitialviewcontroller() below error get: error: cannot convert value of type 'newvc' expected argument type 'any...

android - Camera2 API picture taken wont show at gallery apps -

i have camera project , im using camera2 api link https://github.com/googlesamples/android-camera2basic i can save picture taken file manager located @ dcim/camera example, when open gallery, wont show last picture. can me? one more question, want make camera can list: example, when open "line" , want take picture camera, want camera appears , can chosen. this sample code tried saving picture custom path: @override public void onactivitycreated(bundle savedinstancestate) { super.onactivitycreated(savedinstancestate); mfile = new file("/storage/emulated/0/dcim/camera", "pic.jpg"); int counter=1; while (mfile.exists()) { mfile = new file("/storage/emulated/0/dcim/camera", "pic" + string.format("%02d", counter) + ".jpg"); counter++; } } to show images in gallery need add contentvalues, in example: https://github.com/googlesamples/android-camera2basic found ...

google app engine - appengine DataNucleus plugin 2.1.2 cache behaviour -

i have upgraded appengine sdk 1.8.0, appengine dn 2.1.2 , dn 3.1.3. working nice. in appengine docs states level2 caching enabled default. https://developers.google.com/appengine/docs/java/datastore/jpa/overview-dn2 i assume jpa l2 cache backed memcache. but when update entity datastore viewer jpa code still returning stale version of data. my jpa entity below @entity @cacheable(true) @namedqueries({ ....snip public class geolocationuser implements serializable { @id @generatedvalue(strategy = generationtype.identity) private key key; private double latitude; the query named query @namedquery(name = geolocationuser.find_by_user_key, query = "select p geolocationuser p p.parentkey = :userkey"), use case entity created using jpa code. i update field called 'latitude' in entity using datastore viewer '0.0' '1.0'. i run restful query on application using jpa. the entity returned has 'latitude' = '0.0...

ember.js - Ember-Simple-Auth: Authenticated data not accessbile on didTransistion or AfterRender -

when attempting access authenticated information console.log(this.get('session.data.authenticated.useremail')) => undefined controller or route never seems work when off of events didtransition or afterrender . accessible on button click actions. there event i’m missing (like afterauth) token accessible? i’ve been stuck on weeks , have been avoiding it. import ember 'ember'; export default ember.route.extend({ session: ember.inject.service('session'), model() { return this.store.createrecord('user'); }, actions{ didtransition: function (){ ember.run.schedule('afterrender', this, function () { console.log(this.get('session.data.authenticated.useremail') //returns undefined (works fine off button clicks) }) } } });

html - Dashed border with applied border-radius have wrong length in Firefox -

Image
i have noticed applying dashed border on div border-radius creates "dashed" wrong length. please @ image below near corners, problem appears on firefox 44 , 46 , looks fine on chrome 49. it looks a bug in ff . aware border-radius problematic on ff , know if there work around that. *, *:after, *:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } #target { width: 300px; height: 300px; background-color: red; border: 10px dashed purple; -moz-border-radius: 30px; -webkit-border-radius: 30px; border-radius: 30px; } <div id="target"></div> using css property of border can not achieve it. css rendering browser specific , think work around use image .

if statement - How to change a value in a column dependent on a grepl in R -

i change values in 1 column depending on match in grepl column in data.frame. example of data.frame: df shot class data_text shot1 missed missed jumper shot2 made made 3 point jumper shot3 made made jumper what have been trying: df$shot_type <- as.vector(0) #create new variable (i in 1:length(df)) { if(grepl("e jumper", df$data_text[i])) { df$shot_type <- "jumper" } else if(grepl("d jumper", df$data_text[i])) { df$shot_type <- "jumper" } else if(grepl("t jumper", df$data_text[i])) { df$shot_type <- "three" } } doing method each if statement overwrites last. my current results: df shot class data_text shot_type shot1 missed missed jumper 3 shot2 made made 3 point jumper 3 shot3 made made jumper 3 what results like: df shot class data_text shot_type shot1 missed missed...

html - How can I centre an object whose height I do not know in a list? -

it seems no matter can't text black background centre vertically. problem text on 1 line , on 2 or three. i'm trying automatically adjust can't. i have tried numerous approaches such listed on here. here code trying centre: .infogrid { display: inline-block; position: relative; bottom: 45px; right: 0; margin: 0px 1% -100% 1%; width: 98%; background-color: #f6f6f6; } .infogrid ul { margin: 0; padding: 0; text-align: center; } .infogrid li { display: inline-block; position: relative; background-color: white; width: 320px; margin: 1vw; height: 320px; transition: transform 0.4s; box-shadow: 0.2vh 0vh 0.8vh #888888; } .infogrid li:hover { transform: scale(1.05, 1.05); } .tilewrappertext { display: inline-block; color: white; visibility: hidden; z-index: 1; width: 100%; text-align: center; font-family: "century gothic", "arial", "sans-serif"; backg...

How can I create http outbound-gateway with JAVA config in Spring integration? -

i have following http outbound gateway. how can configuration java config or spring dsl? <int-http:outbound-gateway id="test" url="http://localhost:8080/" http-method="post" charset="utf-8" header-mapper="soapheadermapper" request-factory="requestfactory" request-channel="inputchannel"/> @bean public integrationflow httpout() { return integrationflows.from("inputchannel") .handle(http.outboundgateway("http://localhost:8080/") .charset("utf-8") .httpmethod(httpmethod.post) .headermapper(soapheadermapper()) .requestfactory(requestfactory()), e -> e.id("test")) .get(); } or @serviceactiva...

jquery - How to convert the SVG g element transform translate value to pixel -

as title. use translate attribute not css. how can convert translate value pixel. here's html code: <g transform="translate(95,-8)">...</g> update reason: why need convert pixel? because need web after loading, need css animation animation need follow element coordinate. div translate need unit need convert group translate specific unit, or anyway can count element width/height when web loading success. here's element more information: <g transform="translate(95,-8)"> <pattern class="snodes" id="image2" width="100%" height="100%" style="display: block;"><image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="images/1-01.png" id="node_id112" width="20px" height="20px"></image></pattern><circle r="10" class="snodes" id="node_id112" onclick="nodesdowninlv3(112)...

Upgrading elasticsearch from 0.20.5 to 0.90.0 -

i have 5 node 0.20.5 elasticsearch cluster, replicas set 2, shards set 5 , around 70 million documents upgrade 0.90.0 i can't seem find definitive instructions upgrading, thinking along these lines: issue cluster shutdown: curl -xpost 'http://localhost:9200/_cluster/nodes/_local/_shutdown' upgrade each of nodes using 0.90.0 deb package dpkg -i elasticsearch-0.20.5.deb start elasticsearch on each of nodes: /etc/init.d/elasticsearch start should @ changing of these settings prior? gateway.recover_after_nodes gateway.recover_after_time gateway.expected_nodes cheers!

python - Errors installing Pyrouge -

i'm trying install pyrouge, , i'm getting following errors ====================================================================== error: test_options (pyrouge.tests.rouge155_test.pyrougetest) ---------------------------------------------------------------------- traceback (most recent call last): file "/usr/local/lib/python2.7/dist-packages/pyrouge/tests/rouge155_test.py", line 218, in test_options pyrouge_output = check_output_clean(pyrouge_command) file "/usr/local/lib/python2.7/dist-packages/pyrouge/tests/rouge155_test.py", line 17, in <lambda> check_output_clean = lambda c: check_output(c).decode("utf-8").strip() file "/usr/lib/python2.7/subprocess.py", line 566, in check_output process = popen(stdout=pipe, *popenargs, **kwargs) file "/usr/lib/python2.7/subprocess.py", line 710, in __init__ errread, errwrite) file "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child...

Can't request for certificate form agent using ' puppet agent --test ' -

Image
i new puppet, configuring connecting between puppet master "puppet" have edited host file on agent & client have edited puppet.conf on agent node resolve master. can ping in between both servers. i checked on master cert list there no requests. but still getting error. how can fix this? my configuration : puppet master : name: puppet, agent: centos both on vm, both have same puppet version i figured out problem. issue in new version of puppet have run enable puppet server. starting puppet server & services not work have enable server well. following command starting server : puppet resource service puppetserver ensure=running this command enable server. puppet resource service puppetserver enable=true

python - creating a list of class objects -

i trying create list of python class objects. basically expecting list should follows: [<report {u'invoice_id': u'demo-1-2016-dummy', u'tenant_id': u'27724b57e3b744f89cbf1336da062b43'}>, <report {u'invoice_id': u'demo-2-2016', u'tenant_id': u'27724b57e3b744f89cbf1336da062b43'}>, <report {u'invoice_id': u'admin-2-2016', u'tenant_id': u'6cd02afa3f0f403489153c41e98d07bc'}>] i have tried following code same. from cloudkittyclient.common import base import json class reportresult(base.resource): key = 'report' def __repr__(self): return "<report %s>" % self._info class reportmanager(base.crudmanager): base_url = '/v1/report' resource_class = reportresult key = "report" collection_key = "reports" # list invoices, can accept all-tenants arg def list_invoice(self, all_tenan...

javascript - How Would I Style Dynamically Created jQuery UI elements using CSS3? -

i don't know how explain this, want apply different color styles dynamically created jquery ui buttons. think :nth-child(x) or nth-of-type(x) help, neither has worked yet. putting them in right order, or there else help? my js: var listcontent = '<div id="playerpicker">'; $(xml).find('character').each(function () { listcontent += '<input type="radio" id="rb_' + $(this).attr('first') + $(this).attr('last') + '" name="player" class="ui-button-text" style="background-color: transparent;"><label for="rb_' + $(this).attr('first') + $(this).attr('last') + '">' + $(this).attr('title') + ' ' + $(this).attr('first') + ' ' + $(this).attr('middle').charat(0) + '. ' + $(this).attr('last') + '</label>'; }); listcontent += '</div>...

css - change the width of the sidebar in a wordpress layout -

im new wordpress , responsive layouts designs. got domain , installed wordpress. installed new theme , editing according needs. website http://www.laktro.com/wp/ need make sidebar wider. need expert in wordpress that. here have tried. in css, #secondary{ width: 22% ; } i changed value 22 higher number(26%), sidebar goes down of content. cant find place change width of content. please me in issue. can provide additional details or resources needed. in style.css on line 601: #primary { float: left; margin: 0 -27% 0 0; /* change -27% lower (like -30%) */ padding: 0.7em; width: 98.2%; border-top: 4px solid #666; }

objective c - CLLocation data getting null in iOS -

Image
hello getting user location using cllocationmanager i can latitude,longitude,country name , administrative area. want city name or sub administrative area. nsstring *address = [nsstring stringwithformat:@"%@ %@\n%@ %@\n%@\n%@", self.placemark.subthoroughfare, self.placemark.thoroughfare, self.placemark.postalcode, self.placemark.sublocality, self.placemark.subadministrativearea, self. placemark.country]; but except country andthoroughfare other values null. why that? how can solve issue? please me. thanks you have country value , address string addressdictionary like nsdictionary *dictaddress = [nsdictionary dictionarywithdictionary:placemark.addressdictionary]; nsmutabledictionary *dicttxtdata = [nsmutabledictionary dictionary]; nslog(@"country:%@",dictaddress[@"country"]); you have other details placemark nslo...

I am working on Jmeter load test. I want to maintain the incremented counter value for the next requests, however, the counter value resets to 0 again -

i working on jmeter load test. want maintain incremented counter value next parallel requests [each request defined under throughput controller], however, counter value resets 0 again subsequent requests. here how test plan looks - +thread group +counter (starts 0 , increments 1 ; ref name : index) +throughput controller [total execution : 1] http request1 - uses index value 0 in request fine. +throughput controller [total execution : 2] http request2 - should use index value 1 , 2 , counter again resets 0 , uses value 0 , 1 2 executions. +throughput controller [ total execution : 3] http request3 - should use index value 3 , 4, 5 ; instead uses value 0,1,2 counter resets well. how maintain counter value can run these requests desired index values. thanks here. there no direct functionality in jmeter counter handle problem. either can use beanshell sampler or can handle scenario through workaround counter explained below: control number of ...

parsing - OCaml file reader -

i defining language in ocaml ocamllex , ocamlyacc. input language stream of ints file, example: 1 2 3 open_in takes file name , returns channel file. here give stdin channel.

Android show custom checkbox in custom table list view -

in android app have custom table list view hidden checkbox in each row. at moment have used code in activity make checkboxes visible on button press: x = 1; while (x < listview.getchildcount()) { checkbox selectcheckbox = (checkbox) listview.getchildat(x).findviewbyid(r.id.selectcheckbox); selectcheckbox.setchecked(false); selectcheckbox = (checkbox) listview.getchildat(x).findviewbyid(r.id.selectcheckbox); selectcheckbox.alpha = 1.0; x++; } problem is, code shows checkboxes of visible rows. found here solution change while ... part to: for ( int x = 0; x < listview.getadapter().getcount(); x++) { with code should select rows (not visible rows) next problem is, app crash @ point: checkbox selectcheckbox = (checkbox) listview.getchildat(x).findviewbyid(r.id.selectcheckbox); i think have line too. have change? thx :) log: java.lang.nullpointerexception: attempt invoke virtual method 'android.view.view android.view.view.findviewbyid(in...

ruby on rails - Paperclip model validation error message appears two times -

i have upload funtionality in rails, using rails paper clip. have defined model validation check image type. validates_attachment :company_logo, content_type: { content_type: ["image/jpg", "image/jpeg", "image/png", "image/gif"] } if upload other file extensions, showing 2 times message. want 1 message "company logo content type invalid" company logo content type invalid company logo invalid please tell me solution. in advance

php - $.post call from a loop -

i have ul 9 li elements. want load information these li elements through ajax in asynch mode. it's simple, isn't it? i created for(i = 1; i<=9; i++) loop, , called $.post . fail: i 10, because loop running more faster, $.post . let's search $.post in loop on net. i found 3 solutions. 2 here , , 1 here . all of has same effect: not works asynchronously. every time load first, second, third etc... order changing, every request wait while previous finish. i using win 10 64bit, apache 2.4 64 bit, php 5.6 64bit. tried on debian box, effect same. in php file, there sleep(1) , echo 'a' . my first attempt: $('.chartcontainer').each(function(index,obj) { var cnt = index + 1; $.post(getbaseurl() + 'ajax.php', {datetime: $('#chart_' + cnt).data('time'), action: 'getchartbydatetime'}, function (reponse) { $(obj).html(reponse); }); }); my second attempt: for (var = 1; <= 9; i++) ...

c# - ObjectResult<Nullable<System.DateTime>> does not getting stored procedure result -

i using stored procedure in asp mvc i have stored procedure function return objectresult public virtual objectresult<nullable<system.datetime>> abc() { } when execute in sql server return result when execute in asp mvc not return value abccontext db = new abccontext(); objectresult<nullable<datetime>> listabc = db.abc(); there no compilation error not getting result please guide me. note- piece of code try this. abccontext db = new abccontext(); var result = db.abc().firstordefault();

Sitecore 8.1 computed index field for image only indexing alt text on solr -

ran issue other day can't find yet (from googling) addresses issue. i using solr indexing engine. trying index image field in template. indexing working fine it's not indexing media url (that returning code) instead it's indexing alt text of image. if alt text not present it's indexing media url. have index configuration in separate file. i think below line in default sitecore.contentsearch.solr.defaultindexconfiguration.config file messing config. how overwrite "main_image" field. <fieldreader fieldtypename="image" fieldreadertype="sitecore.contentsearch.fieldreaders.imagefieldreader, sitecore.contentsearch" /> below how configuration looks like: <?xml version="1.0" encoding="utf-8" ?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <myindex> <indexconfigurations> <mysolrindexconfiguration ref="contentsea...

encryption - How Android adb can see my files when the storage is encrypted -

when connect android device computer, adb on android can see device files when encrypted. have explanation? mean how terminal can decrypt files without entering password? when enabled usb debugging on device in developer menu , authorized debugging, implicitly gave encryption secrets connected computer. disable adb debugging or revoke usb debugging authorizations in developer settings menu, , access files via adb shell should disappear.

Unit testing in Django / Tastypie -

i trying run few tests tastypie app following error. finding files... done. importing test modules ... traceback (most recent call last): file "c:\users\user\.p2\pool\plugins\org.python.pydev_4.4.0.201510052309\pysrc\pydev_runfiles.py", line 468, in __get_module_from_str mod = __import__(modname) file "djangotastypie/myapp\tests.py", line 2, in <module> tastypie.test import resourcetestcasemixin file "c:\python27\lib\site-packages\tastypie\test.py", line 9, in <module> tastypie.serializers import serializer file "c:\python27\lib\site-packages\tastypie\serializers.py", line 12, in <module> tastypie.exceptions import badrequest, unsupportedformat file "c:\python27\lib\site-packages\tastypie\exceptions.py", line 83, in <module> class immediatehttpresponse(tastypieerror): file "c:\python27\lib\site-packages\tastypie\exceptions.py", line 94, in immediatehttpresponse ...

java - Edit string array elements -

my array this: "keys": [ "first name", "second name", "date of birth", "name", "tle no", "other details" ] i want re-arrange above array data this: "keys": [ "first_name", "second_name", "date_of_birth", "name", "tle_no", "other_details" ] i want create using java code. how can create it? use string.replaceall() method: for (int = 0; < keys.length; i++) { keys[i] = keys[i].replaceall(" ", "_"); } reference: replaceall

VMs in Azure Availability Set showing same Fault Domain and Update Domain -

i created 2 vms in same resource group , availability set using azure portal. however, when @ availability set, see both vms in same fd , ud. i thought azure system selects fd , ud vms in same availability set. why setting same fd , ud. do need select different locations ensure vms fall in different fd/ud? had selected same location in basic settings dialog when creating vms. thanks i deleted vms , recreated them. once both running, vms showing in different ud, fd

Restrict dragging of a label out of its superView ios swift -

i have uiimageview inside of there label text have move on pan gesture. though able drag test having problem in restricting movement of text within image view. below code restricting movement in x direction whenever try implement similar approach y direction 2 conditions arise @ corner creates problem. there better approach please help. func dragtext(sender: uipangesturerecognizer) { let translation = sender.translationinview(self.view) print(translation) switch sender.state { case .changed: self.textlabeloriginx = (sender.view?.frame.origin.x)! if self.textlabeloriginx <= 10 { sender.view?.center = cgpointmake(sender.view!.center.x + 0.1, sender.view!.center.y + translation.y) } else if ((sender.view?.frame.origin.x)! + sender.view!.frame.width >= sender.view?.superview?.bounds.width) { sender.view?.center = cgpointmake(sender.view!.center.x - 0.1, sender.view!.center.y + t...

how to enable/disable button in eclipse plugin project -

Image
i need enable/disable toolbar button , menu button on project start. here toolbar code , image <toolbar id="socenterprise.toolbar"> <command commandid="socenterprise.ipxact.handler" helpcontextid="generate help" icon="icons/generate16.png" id="generator" label="generate xml (ip-xact)" style="pulldown" tooltip="ip-xact"> </command> </toolbar> and need enable/disable popupmenu button menu bar. here code <menu label="generate"> <command commandid="socenterprise.alloutputs.handler" label="all outputs" style="push" tooltip="generate outputs"> </command> <command commandid=...

java - DateChooser format changes on different machine -

i have used datechooser jar in project. on linux(ubuntu) when tested date displayed in format dd/mm/yy , when tested same project on windows machine date displayed in format mm/dd/yy . following code snippet: simpledateformat chooserdateformat = new simpledateformat("dd/mm/yy hh:mm:ss"); dtekcactdate = new datechoosercombo(); dtekcactdate.setbounds(new rectangle(11, 23, 164, 21)); dtekcactdate.setfieldfont(new font("verdana", font.plain, 12)); dtekcactdate.setnavigatefont(new font("verdana", font.plain, 12)); dtekcactdate.setformat(3); dtekcactdate.setcurrentnavigateindex(1); dtekcactdate.setnothingallowed(false); dtekcactdate.getselecteddate(); dtekcactdate.addselectionchangedlistener(new datechooser.events.selectionchangedlistener() { public void onselectionchange(datechooser.events.selectionchangedevent evt) { multydatechoosemode...

Python: AttributeError: 'Pong' object has no attribute 'render' -

came across error while following python tutorial create game pong: traceback (most recent call last): file "c:/users/gavin/pycharmprojects/lmagpong/game.py", line 98, in <module> main() file "c:/users/gavin/pycharmprojects/lmagpong/game.py", line 91, in main pong.render(screen) attributeerror: 'pong' object has no attribute 'render' this code used create pong object(render @ bottom): class pong(object): def __init__(self, screensize): self.screensize = screensize self.centerx = int(screensize[0] * 0.5) self.centery = int(screensize[1] * 0.5) self.radius = 8 self.rect = pygame.rect(self.centerx - self.radius, self.centery - self.radius, self.radius * 2, self.radius * 2) self.color = (100, 100, 255) self.direction = [1, 1] self.speed = 2 self.hit_edge_left = false self....

spring - Cannot convert value of type [com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle] to required type [javax.jms.ConnectionFactory] -

i have standard spring jms config <bean id="jmstemplate" class="org.springframework.jms.core.jmstemplate"> <property name="connectionfactory" ref="connectionfactory" /> <property name="defaultdestination" ref="jmsdestination" /> </bean> <bean id="connectionfactory" class="org.springframework.jndi.jndiobjectfactorybean"> <property name="jndiname" value="jms/mqauditqueueconnectionfactory" /> </bean> <bean id="jmsdestinationresolver" class="org.springframework.jndi.jndiobjectfactorybean"> <property name="jndiname" value="jms/mqauditqueue" /> </bean> and think standard mq on 8.5.5.2, when start web-app get: cannot convert value of type [com.ibm.ejs.jms.jmsqueueconnectionfactoryhandle] required type [javax.jms.connectionfactory]...

office365api - Office365 Graph API - Mark as Read/Unread not updating lastModifiedDateTime -

when emails marked read/unread doesn't seem update lastmodifieddatetime attribute, i'm not sure how application can pull down change. had been planning use query filter on lastmodifieddatetime check actions/changes emails. steps reproduce: 1) perform query in graph explorer https://graph.microsoft.com/v1.0/me/messages?$orderby=lastmodifieddatetime desc 2) mark email read or unread in outlook owa 3) perform above query again, , notice email marked read/unread has not jumped top of list any appreciated! marking read/unread has historically not modified message itself. trying track changes? if so, take @ message sync in preview. send change event if mark read/unread.

php array acces issue -

i have 2 arraws i'm storing data: activos[key][value] , pagos[key][value] the operation want each "activo" element value , coincides key on pagos sum value of array variable. i've tryed doesn't work supposed to: $t = 0; foreach ($activos $key => $value) { foreach ($pagos $key => $value) { if($activos[$value] == $pagos[$key]){ $t += $pagos[$key] } } } you've key , value both arrays, you've erased them !! $t = 0; foreach ($activos $keyactivos => $valueactivos) { foreach ($pagos $keypagos => $valuepagos) { if($valueactivos == $keypagos){ $t += $valuepagos; } } }

python - pip wont install .WHL files -

when try install .whl gohike typing cmd c:\users\owner\downloads>pip install ta_lib-0.4.9-cp27-none-win_amd64.whl i print out: `processing c:\users\owner\downloads\ta_lib-0.4.9-cp27-none-win_amd64.whl complete output command python setup.py egg_info: traceback <most recent call last>: file "<string>", line 1, in <module> ioerror: [errno 2] no such file or directory:'c:\\users\\owner\\appdata\\lo cal\\temp\\pip-9gwk2c-build\\setup.py' ----------------------------------------- command "python setup.py egg_info" failed error code 1 in c:\users\owner\ap pdata\local\temp\pip-9gwk2c-build\` the part between pip- , -build in pip-9gwk2c-build different on same file. i asked python 2.7.11 pip 8.0.3 can't install gohike whl of ta-lib 0.4.9 few days ago , decided ask differently. can me! you have outdated pip not understand wheels. wheels not supposed have setup.py inside. try upgrading pip pip in...

python - Restart Gunicorn_django via Fabric -

i'm building django application , decided investigate fabric automating deployment. i've got working, fails @ last step, , can't seem puzzle out why. i'm using nginx , gunicorn serve application, , want kill , restart gunicorn after changes have been pulled in , database updated. unfortunately seems fail @ last hurdle. the final command doesn't respond kind of error, application isn't getting served, , if ssh in there's no process , have restart manually. every other command works perfectly. my fabfile.py: #!/usr/bin/env python fabric.api import local, env, run fabric.context_managers import cd, prefix env.hosts = ['192.168.1.1'] env.path = "/home/matthew/sites/projectname" def deploy(): # push changes bitbucket local('git push origin master') # switch project directory cd(env.path): # pull changes server run('git pull origin master') # activate virtualenv pref...

php - Error :Not storing ID in DataBase -

actually storing 3 values in data base,it storing date, path not storing gallery id, here code using <?php ob_start(); session_start(); include("include/conf.php"); $getid=$_get['id_cms']; $galleryid=$_get['gallery']; $date=date("f j, y, g:i a"); $targetfolder = '/uploads'; // relative root $verifytoken = md5('unique_salt' . $_post['timestamp']); if (!empty($_files) && $_post['token'] == $verifytoken) { $tempfile = $_files['filedata']['tmp_name']; $targetpath = $_server['document_root'] . $targetfolder; //$targetfile = rtrim($targetpath,'/') . '/' . $_files['filedata']['name']; // validate file type $filetypes = array('jpg','jpeg','gif','png'); // file extensions $fileparts = pathinfo($_files['filedata']['name']); if (in_array($fileparts['extension'],$filetypes)) { //move_uploaded_file($t...

Gmail wraps certain HTML elements in a class called im -

i have been testing out html e-mail process i've created recently. of lately, when open e-mail in gmail, i'm noticing elements wrapped in class know didn't put in original html layout. in fact triple checked! when viewing html email in gmail, random sections of form being wrapped with... <div class="im"> .... </div> as result, text turns purple, while other text not. why happen? thanks gmail seems think quoting other emails in conversation , wrapping div.im around sections of code thinks previous bits in conversation. this might happen if code has table more 1 tr. around this, rather several trs in 1 table, use several tables 1 tr in each. this might happen if have multiple subject lines same, causing gmail think conversation. can fix making each subject line unique.

linux - How can i save file to flash in ramdisk filesystem? -

i new file systems , want ask, there methods save file secondary memory using ram disk file system ? if want save file in ramdisk filesystem have link file system partition of location in root filesystem , have copy file location , can read after restarting board. lets have example if have file system /dev/mtdblock1 (if using mtd drivers) , if have support jffs2 , can have mounting mount -t jffs2 /dev/mtdblock1 /mnt/ then after can copy files /mnt/ , unmount it. if want file have mount /mnt/ same command given above. working after restarting board. thank you.......!

linear programming - Algorithm of choosing several items with best characteristics to maximize profit -

Image
let's have items a1-a10 different characteristics. example a1 (x1=4; x2=2; x3=1; x4=3) . , have 5 categories c1-c5 put items into. x1 - matters category 1, x2 - category 2, x3 - category 3, x4 - categories 4 , 5. it must @ least 1 item in each category. our goal put items different categories way - output maximum. example: let's have 4 items a1 (x1=3; x2=1; x3=1), a2 (x1=2; x2=1; x3=2); a3 (x1=1; x2=1; x3=3); a4(x1=1; x2=3; x3=1) , 3 categories c1(x1); c2(x2); c3(x3). here best way put a1 category c1 (+3 on output); a3 category c3 (+3 on output); a4 category c2 (+3 on output) , a2 either category c1 or c3 (+2 on output). our output 11. here's picture bad solution of given example output 4. but easy example. have complex solve.

Android Webview: Override Contextual Action Bar -

i trying override contextual action bar in android webview. when long click on selected word, custom action bar displayed. however, when click on action bar button, nothing happens. it seems oncontextitemselected() function not called. code: @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.dictionary); mwebview = (webview) findviewbyid(r.id.wv); } @override public boolean oncontextitemselected(menuitem item) { switch (item.getitemid()) { case r.id.save_word: toast.maketext(checkdictionary.this,"save word meaning successfully",toast.length_long).show(); break; default: break; } if (mactionmode != null) { mactionmode.finish(); } return super.oncontextitemselected(item); } @override public void onactionmodestarted(actionmode mode) { if (mactionmode == null) { mactionmode = mode; mode.sett...