Posts

dataframe - Handling integer times in R -

times in data frame recorded integers in: 1005,1405,745,1130,2030 etc. how convert these integers r understand , use in functions such strptime. in advance help solution using strptime() as pointed out psidom in comment, can convert integers character , use strptime() : int_times <- c(1005,1405,745,1130,2030) strptime(as.character(int_times), format="%h%m") ## [1] "2016-04-21 10:05:00 cest" "2016-04-21 14:05:00 cest" na ## [4] "2016-04-21 11:30:00 cest" "2016-04-21 20:30:00 cest" however, can see, run trouble number has 3 digits. can around using formatc() format integers character 4 digits , leading 0 (if needed): char_times <- formatc(int_times, flag = 0, width = 4) char_times [1] "1005" "1405" "0745" "1130" "2030" now, conversion works: strptime(char_times, format="%h%m") ## [1] "2016-04-21 10:05:00 cest" ...

gulp - laravel elixir - combine compiled coffeescript/browserify files with sourcemaps -

i trying compile coffeescript code 1 file , browserify another, combine them. works fine , each file gets source-map in build directory, can't combine them while generating combined source-map. any way of doing elixir or need gulp pipe chain? elixir(function(mix){ mix.browserify(['vendor-modules.js'], 'resources/assets/js/build/vendor-modules.js') .coffee([ '_classes/*.coffee', 'main.coffee', 'react/home/*.coffee', 'react/home.coffee', ], 'resources/assets/js/build/app-main.js') .scripts([ 'build/vendor-modules.js', 'build/app-main.js', ], 'public/assets/js/app.js'); });

python 3.x - opencv VideoCapture doesn't read from avi -

i upgraded ubuntu 16.04 , installed anaconda3 , installed opencv3 conda install -c https://conda.anaconda.org/menpo opencv3 . tried reading avi file, cap = cv2.videocapture('/path/to/avi') cap.read() returns (false,none) . capturing webcam works fine. have idea causing problem? read might have ffmpeg , have it: $ ffmpeg -version ffmpeg version n-79139-gde1a0d4 copyright (c) 2000-2016 ffmpeg developers built gcc 4.8 (ubuntu 4.8.4-2ubuntu1~14.04.1) configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid...

RMI Java server and client will not communicate -

rmiclient, client package rmiclient; import java.rmi.rmisecuritymanager; import java.rmi.registry.locateregistry; import java.rmi.registry.registry; import java.util.*; public class rmiclient { public static void main(string[] args) { rmiclient client = new rmiclient(); system.setsecuritymanager(new rmisecuritymanager()); if(args.length == 0) { system.out.println("please enter correct server, exiting."); system.exit(0); } client.runmenu(args); }//end main() public void runmenu(string[] args) { while (true) { int commandtorun = 0; int numberofthreads; scanner commandscanner = new scanner(system.in); scanner threadscanner = new scanner(system.in); system.out.println(); system.out.println("enter number command wish execute."); system.out.println("1. date & time \n" + "2. server uptime \n" + "3. memory usage \n"...

javascript - BR is not working in Ckeditor -

does know why br not working in ckeditor? i'm wondering why br tag not working in dataprocessor . i've been searching , posted in ckeditor forum no 1 responded. actually, br inserted if use enter or shift + enter . here's plugin.js: // run these after attaching ang detaching ckeditor. afterinit: function (editor) { var dataprocessor = editor.dataprocessor, // ckeditor in state enabled. datafilter = dataprocessor && dataprocessor.datafilter, // ckeditor in state disabled. htmlfilter = dataprocessor && dataprocessor.htmlfilter; if ( htmlfilter ) { htmlfilter.addrules({ // loop through elements elements: { // perform when found image tag. img : function( element) { if (element.attributes.class == 'wysiwyg-addbr') { return new ckeditor.htmlparser.element( 'br', {'class': 'clear-both'}); } } } }); } } se...

java - Creating a login type of activity and forcing it the only opening point -

i have been doing research, feel if missing something. i have app login. each time open app, should forced through login page. should never able resume onto activity other login. in manifest have android:cleartaskonlaunch="true" on main activity wish use login activity, and android:finishontasklaunch="true" as android:excludefromrecents="true" on rest of activities. the problamatic situation occurs when go login activity, hit home, , relaunch app via icon. should jump login page, doesnt. idea? i have been installing regular apk, not via eclipse know there issue eclipse , of manifest attributes. perhaps if there way detect activity launch came app icon press, manage way, dont think possible either. in either onresume or onrestart check series of flags, such login timeout, force user login activity using intent , while @ same time finishing original activity. i method in favor or finishing app ...

Salesforce Apex: how to test if trigger was called -

i have trigger in apex. how write unit test checks if trigger called? account account = new account(name='test account'); insert account; checkifinserttriggercalled(); // how implement this? you should testing trigger does, not if called or not. trigger do? if trying see if inserted then: account account = new account(name='test account'); insert account; list<account> alist = [select id, name account]; system.assertequals(1,alist.size()); side note: have left comment, few rep short on site. edit: here standard page gets linked lot: https://developer.salesforce.com/page/how_to_write_good_unit_tests