Posts

javascript - StringBuilder appends Boolean values differently -

Image
i building string using stringbuilder , return ui , use in javascript . however, noticed when append value of true or false in c#, appends value of true or false shown below. i return string ui , value of false , true incorrect javascript understand, need "true" or "false". why happen? , how return true , false valid javascript. rowitem of type object try pass value below: builder.append(false.tostring().tolower()).append(","); or, builder.append("false").append(","); wiki

java - NullPointerException on Heroku but in Glassfish everythin is ok? -

i'm developing simple application on java ee using jsf, jpa , maven. question is: why tomcat servlet on heroku returning null on time inject managedbean while in glassfish server fine? there codes: @managedbean(name = "homebean") @sessionscoped public class homebean { //simple properties @managedproperty(value="#{emfactorybean}") private entitymanagerfactorybean factorybean; @postconstruct public void init(){ sitioservice = new sitioservice(factorybean); sitios = sitioservice.getsitios(); } //getters , setters } the exception occurs when new instace of sitioservice created, in other words. here factorbean class: @applicationscoped public class entitymanagerfactorybean { private entitymanagerfactory entitymanagerfactory; public entitymanagerfactorybean() { this.entitymanagerfactory = persistence. createentitymanagerfactory("prueba"); } //getter , setter } my persistence.xml is: <?xml version="1...

ibm bluemix - I see errors using node-rdkafka but it seems to be working ok -

i have bluemix node.js (6.1.0) application uses node-rdkafka 1.0.3. seems working ok there tons of error events error: local: broker transport failure or error: local: authentication failure . producer options have set are: var producer_opts = { "metadata.broker.list":env.messagehub.brokers, "security.protocol":"sasl_ssl", "ssl.ca.location":env.messagehub.calocation, "sasl.mechanisms":"plain", "sasl.username":env.messagehub.user, "sasl.password":env.messagehub.password, "api.version.request":true, "socket.timeout.ms": 10000, "dr_msg_cb":true }; consumer has similar settings plus group.id tag. i wonder if should worrying theese errors , if there way eliminate them. thanks! you hitting https://github.com/edenhill/librdkafka/issues/1218 . in many cases, you've noticed, these errors harmless. library node-rdkafka based onto, librdkafka, ...

how to use oprah-proxy (a python script on github)? -

i want use oprah-proxy has page on: https://github.com/spaze/oprah-proxy/blob/master/readme.md as mentioned on page have run python script this: oprahproxy.py don't client_type , client_key mean. should type instead of client_type , client_key? wiki

c++ - How to Decode JPEG Using Win32? -

i have chunk of memory containing raw bytes of jpeg , convert 24-bit rgb can render using stretchdibits. i've looked around msdn jeez... don't want use third party libraries or c++ if don't have to. suggestions? wish there function decodejpeg() or something... i came solution uses wic , doesn't seem use c++, wasn't able following code compile c, not sure. took lot of time put pieces together, here is! #include <wincodec.h> #include <stdio.h> #pragma comment(lib, "ole32.lib") #pragma comment(lib, "windowscodecs.lib") #define min(a, b) (a < b ? : b) void win32decodejpeg(unsigned int imagedatasize, void *imagedata, unsigned int destsize, void *dest) { static iwicimagingfactory *iwicfactory; if(iwicfactory == null) { coinitializeex(null, coinit_multithreaded); cocreateinstance(clsid_wicimagingfactory, nullptr, clsctx_inproc_server, iid_ppv_args(&iwicfactory)); } ...

java - (Solved) Kafka 0.11.0.0 keeps reseting offset on restart -

i have problem kafka 0.11.0.0 when create new topic, put come data , consume java consumer, after restarting kafka 0.11.0.0 offsets consumer group disappear. topic stays , has same data in it, offsets purged. makes consumer download records topics again. weird, 1 topic have old, correct offsets, other offsets deleted, maybe because 1 topic there while. i commit consumed records commitsync(). offset saved on broker, can restart java consumer , starts correct offset after restarting entire kafka offset consumer groups resets 0. check current commits before consuming after restart kafka-consumer-groups.sh script , it's broker resets them. i had no problem in kafka 0.10.2.1. experience problem in 0.11.0.0 version. my consumer has auto.offset.reset set earliest, auto commit set false because i'm committing manually. kafka data stored in non-tmp directory necessary permissions. rest of broker configuration default. i need 0.11.0.0 version transactions. have no idea prob...

spring-xd twitter stream failure? -

i trying create twitter stream dashboard using spring-xd. following git hub link:- https://github.com/spring-projects/spring-xd-samples/tree/master/analytics-dashboard on readme note written need make changes in following files, i.e. $xd_module_config_location/source/twitterstream/twitterstream.properties can post answer exact dummy format twitter stream authentiation, require paste in twitterstream.properties file. wiki