Posts

c++ - libconfig++ : adding a setting to the root of the configuration tree -

i have configuration file mycfg.cfg looks : keya = 1.0 keyb = 2 keyc = "hello" note settings @ root of configuration tree. i want c++ program load file add new setting key keyd , assign integer value 5 . eventually, mycfg should in memory : keya = 1.0 keyb = 2 keyc = "hello" keyd = 5 first mycfg.cfg file loaded construct mycfg . setting keyd must added root of mycfg . libconfig documentation indicates setting::add() method : add[s] new child setting given name , type setting, must group however, there isn't group in mycfg … how add setting root of config object ? it looks need is: getroot () . here example: #include <iostream> #include "libconfig.h++" int main () { libconfig::config mycfg; std::string file = "mycfg.cfg"; try { mycfg.readfile (file.c_str () ); libconfig::setting & root = mycfg.getroot (); // works. // libconfig::setting & ro...

android - Selector for a drawable within an EditText -

i have edittext drawableend. want change drawable when it's pressed. i've created selector no image visible now. possible in way or maybe i'm doing wrong? layout <edittext android:drawableend="@drawable/selector" android:layout_height="wrap_content" android:layout_width="match_parent"/> selector <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/image_on" android:state_enabled="true" android:state_pressed="true"/> <item android:drawable="@drawable/image_off" android:state_enabled="true"/> </selector> your selector seems wrong, have declare 1 statement in 1 item. , set 2 items state_enabled="true". needs be: <item android:drawable="@drawable/pressed_image" android:state_pressed="...

java - Button copying text to clipboard -

i trying copy text clipboard when button pressed. have found other questions this, can't figure out code. here code trying use now: button button = (button)this.findviewbyid(r.id.button1); clipboardmanager clipboard = (clipboardmanager) getsystemservice(context.clipboard_service); clipdata clip = clipdata.newplaintext("label","woop woop in clipboard"); clipboard.setprimaryclip(clip); but confused on how button action. use button onclicklistener button.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { clipboardmanager clipboard = (clipboardmanager) getsystemservice(context.clipboard_service); clipdata clip = clipdata.newplaintext("label", "woop woop in clipboard"); clipboard.setprimaryclip(clip); }});

javascript - Js changes are not reflecting in the browser unless we redeploy the war file -

i have developed spring boot web application using intellij. every js , html change have redeploy war file in order changes reflected on browser. there way changes reflected on fly without redeploying? you can implement real time caching nginx. create seperate project css , ui related changes , link assets folder of nginx. have start nginx server. when u changes in files, no need restart server again , again. more info https://www.nginx.com/blog/scaling-web-applications-nginx-part-ii-caching-monitoring/#caching

javascript - Angular Datatables: Unknown provider -

hej guys. i'm new js , angular trying implement angular-datatable version in project. first used "angular-way", turned out bad decision based on performance. have lot of rows in table. i've decided try building datatable ajax , building columns dtoptionsbuilder , filling table using dtoptions. however, i'm having complications... unkown provider error.. more specifically: error: [$injector:unpr] unknown provider: datatablesprovider <- datatables <- overviewctrl i'm not quite sure, i'm doing wrong? here's controller. angular.module("invoices").controller("overviewctrl", ["apiservice", "datatables", 'utilsservice', "$q", "invoiceservice", "ngdialog", "$controller", "authfactory", "redirectservice", "$rootscope", overviewctrl]); function overviewctrl(apiservice, utilsservice, dtoptionsbuilder, dtcolumnbuilder, ...

windows - How to get the ODBC name from this trace logs that an application is using to connect -

how odbc name trace logs application using connect (in case: firebird database) autoreps 1f8c-140c enter sqlallocenv henv * 0x5d67b1ac autoreps 1f8c-140c exit sqlallocenv return code 0 (sql_success) henv * 0x5d67b1ac ( 0x02e61078) autoreps 1f8c-140c enter sqlgetenvattr sqlhenv 0x02e61078 sqlinteger 201 <sql_attr_connection_pooling> sqlpointer 0x0012ea64 sqlinteger 4 sqlinteger * 0x0012ea60 autoreps 1f8c-140c exit sqlgetenvattr return code 0 (sql_success) sqlhenv 0x02e61078 sqlinteger 201 <sql_attr_connection_pooling> sqlpointer 0x0012ea64 (0) <sql_cp_off> sqlinteger 4 sqlinteger * 0x0012ea60 (0) autoreps 1f8c-140c enter sqlallocenv henv * 0x5d...

audiounit - Reading chunks of audio with ringbuffer -

i analyze chunks of audio data of 1 second. purpose implemented audio unit fills ringbuffer (tpcircularbuffer michael tyson). in file try read chunks of 1 second using nstimer. unfortunately, receive errors consuming these data. the buffer filled in kaudiooutputunitproperty_setinputcallback , works fine device * = (__bridge device *)inrefcon; // render audio buffer audiobufferlist bufferlist; bufferlist.mnumberbuffers = 1; bufferlist.mbuffers[0].mnumberchannels = 2; bufferlist.mbuffers[0].mdata = null; bufferlist.mbuffers[0].mdatabytesize = innumberframes * sizeof(sint16) * 2; checkerror(audiounitrender(this -> riounit, ioactionflags, intimestamp, 1, innumberframes, &bufferlist), "audiounitrender"); // put audio circular buffer tpcircularbufferproducebytes(&circbuffer, bufferlist.mbuffers[0].mdata, innumberframes * 2 * sizeof(sint16)); to read 1 second of samples implemented te following code: - (void)initializetimer { timer = [nstimer sche...