Posts

C++ QT QFileDialog does not close when using system() in triggered action -

void obj_loader::on_actionopen_triggered() { qstring filename = qfiledialog::getopenfilename(this, tr("open file")); if (!filename.isempty()) { filepath=filename.toutf8().constdata(); command.append(filepath); int tempnumone=command.size(); (int a=0;a<=tempnumone;a++) { //get letters char list can used system(); cmd[a]=command[a]; } openfile=true; if (openfile) { openfile=false; system(cmd); } } } when system(cmd); called qfiledialog window not close till system command finishes. know if can close search window after clicking open. the system function blocks event loop: user interaction requires event loop run, , runs when code isn't running. since system invocation in code, can't have block process. need use qprocess has asynchronous interface. this answer provides complete example of 1 process calling -- done single executable.

bluetooth - Can you use Nest for devices not directly related to smarthome? -

our company creates activity trackers family (like fitbit or jawbone), track steps (there no sleep feature or anything). i wondering if possible , allowed use nest central hub sync via bluetooth physical activity of family members entering house , send data server or app, if doesn't impact thermostats. nest documentation doesn't seem mention aspect, wasn't sure if possible. thanks! i don't believe nest has bluetooth hardware. , purpose of api enable control , reading of nest specific data.

Can Azure VM snapshots be deleted safely? -

i used cloudxplorer create snapshot on vhd of vm doing installs on. installs went okay, okay delete snapshots or need somehow merge them in ensure can backup current vm state? snapshots point-in-time representation of blob (in case, page blob storing vhd). it's read-only, , it's disposable. if page in vhd's page blob changed, new page created snapshot, represent original state of blob. once delete snapshot, list of pages, along created pages preserve snapshot's state, deleted (and no impact on original blob). note won't able delete original blob until first delete of snapshots (and can delete blob+snapshots @ once).

Embedded mongodb in camel service -

is there way can use embedded mongodb in camel peoject. know there camel-mongodb . couldn't find example of using embed mongodb . db should able use throughout camel service life time. camel java, can't embed native applications without serious efforts. technical issues put aside, have worry struggle license (agpl). i'd answer no. see following mongodb embedded in java

ios - Hide device Volume HUD view while adjusitng volume with MPVolumeView slider -

Image
i implementing video player mpmovieplayer in ipad application, used mpvolumeview volume control. problem when scroll volume view adjust volume showing device's volume hud overlay in screenshot below. how can disable system volume indicator hud? code : @property (weak, nonatomic) iboutlet mpvolumeview *playbackmpvolumeview; //customizing controller - (void)customizevolumecontroller { _playbackmpvolumeview.showsroutebutton = yes; _playbackmpvolumeview.showsvolumeslider = yes; [_playbackmpvolumeview setvolumethumbimage:[uiimage imagenamed:@"volume_slider_thumb.png"] forstate:uicontrolstatenormal]; } swift 3 let volumeview = mpvolumeview(frame: .zero) view.addsubview(volumeview)

graph - ISO C++ forbids intilization of member maxY -

that's code using graphs in arduino i'm getting error saying iso c++ forbids intilization of member maxy. can know why? class graph { float maxy = 0; float maxx = 0; int maxi = 0; boolean dot=true; boolean rightaxis; boolean errorflag=false; boolean showmouselines=true; because c++ forbids initialisation of instance members in-line that. you should initialise them in constructor or, if they're meant class variables (one shared across all instances) rather instance variables, make them static.

php - Call to undefined method DB::prepare() -

i using pdo statement fetch details db, below pdo using <?php define('db_host', 'localhost'); define('db_name', 's_ao'); define('db_user', 'sd'); define('db_pass', '****'); define('db_char', 'utf8'); class db { protected static $instance = null; final private function __construct() {} final private function __clone() {} public static function instance() { if (self::$instance === null) { $opt = array( pdo::attr_errmode => pdo::errmode_exception, pdo::attr_default_fetch_mode => pdo::fetch_assoc, pdo::attr_emulate_prepares => true, pdo::attr_statement_class => array('mypdostatement'), ); $dsn = 'mysql:host='.db_host.';dbname='.db_name.';charset='.db_char; self::$i...