Posts

Distributed Java desktop app mySQL database -

i'm in process of learning java , swing , in doing trying create desktop app. part of app have set mysql database app connected to, i'm uncertain how work if distribute app other users, how create database able use on system if don't have mysql installed or database initiated. help appreciated. you should use embedded database. not recommend mysql commercial applications, because expensive. try use hsqldb - fast , not has memory leaks (at least didn't noticed). here implementation example: private static connection conn; /** * gets database connection. * * @return database connection. * @throws sqlexception if database error occurs. */ public static connection getconnection() throws sqlexception { if (conn == null || conn.isclosed()) { conn = drivermanager.getconnection("jdbc:hsqldb:file:data", "somedb", ""); // conn.setautocommit(false); } return conn; } make sure have added hsqldb.ja...

logging - Collect logs from Mesos Cluster -

my team deploying new cluster on amazon ec2 instances. after bit of research, decided go apache mesos cluster manager , spark computation. the first question asked ourself best way collect logs machines, each different framework. till now, developed custom bash/python scripts collect logs predefined locations, zip them , send compressed file s3. kind of rotation activated cron job, runs every hour. i have been searching "best" (or standard) way this. found apache flume , data collector logs, don't understand how integrated in mesos cluster collect logs (and spark). i found this "similar" question, solutions not open source or no more supported. is there better way rotate logs or standard way i'm missing? thank much there no perfect answer this. if using spark , interested in using flume, have either write custom flume -> spark interface 1 doesn't exist far know. however, can this: use flume ingest log data in realtime. ha...

php - guzzle 6 post method is not working -

This summary is not available. Please click here to view the post.

Rust FFI. Casting to void pointer -

i've function has prototype below //opaque struct struct mosquitto; struct mosquitto *mosquitto_new(const char *id, bool clean_session, void *obj); in c code, i'm calling below. struct mosquitto *m = mosquitto_new(buf, true, null); now want call above api in rust code. rust-bindgen generated following bindings pub enum struct_mosquitto { } pub fn mosquitto_new(id: *const ::libc::c_char, clean_session: u8, obj: *mut ::libc::c_void) -> *mut struct_mosquitto; when i'm trying call above api, i'm getting mismatch @ 3rd argument. let s = cstring::new("ravi").unwrap(); let mqtt = mosquitto::mosquitto_new(s.as_ptr(), 1, ptr::null()); how pass null *mut c_void? bonus question: how pass rust struct *mut c_void ? the ptr::null() function returns *const t , want ptr::null_mut() function, since argument function of type *mut ::libc::c_void . for passing actual value, have @ answer working c_void in ffi

java - ArrayList Adapter constructor fails (?) -

edit: need know how create arraylist filled textview i trying create arrayadapter multidimensional (2d) arraylist : final arrayadapter<arrayadapter<arraylist<string>>> adapternames = new arrayadapter<arrayadapter<arraylist<string>>>(this,android.r.layout.simple_list_item_1, android.r.id.text1, arraynamesone); this log error get: error:(28, 76) error: no suitable constructor found arrayadapter(mainactivity,int,int,arraylist>) constructor arrayadapter.arrayadapter(context,int,int,arrayadapter>[]) not applicable (argument mismatch; arraylist> cannot converted arrayadapter>[]) constructor arrayadapter.arrayadapter(context,int,int,list>>) not applicable (argument mismatch; arraylist> cannot converted list>>) if prefer take better @ whole code interested, here go: public class mainactivity extends actionbaractivity { //1st declaration arraylist<arraylist<string>> arraynam...

backbone.js - Returned gameScore Parse.Object object from Parse.Query.get documentation gives undefined gameScore object -

directly parse.com javascript guide : var gamescore = parse.object.extend("gamescore"); var query = new parse.query(gamescore); query.get("xwmyz4yegz", { success: function(gamescore) { // object retrieved successfully. }, error: function(object, error) { // object not retrieved successfully. // error parse.error error code , message. } }); var score = gamescore.get("score"); var playername = gamescore.get("playername"); var cheatmode = gamescore.get("cheatmode"); basically gives uncaught referenceerror: gamescore not defined... here code troubleshoot this: // retrieve class var gamescore = parse.object.extend("gamescore"); //redefine gamescore class based on cloud. var query = new parse.query(gamescore); var my_object; var some_object = query.get("sqv1dzxv5p", { success: function(gamescore) { //gamescore retrieved object. alert('object retrieved, object id: ' + gam...

javascript - Append link to href from JSON -

can explain me how can append link json file a href ? grab images have no idea how links. this code using <body style="background: #e5e5e5"> <div class="container"> <div class="row"> <div class="col-sm-4"> <a href=""> <div class="cover" id="img"></div> </a> </div> </div> </div> <script> var data = { "info": [{ "cover": "highlighted/1.gif", "link":"http://google.com" }, { "cover": "highlighted/1.gif", "link":"http://google.com" }] }; data.info.foreach( function(obj) { ...