Posts

javascript - How do I make sure my function works for my variable? -

function numbertotime(num){ var d = 0, h = 0, m = 0; var numtominutes = num*60; while(numtominutes > 59){ numtominutes -= 60; h++; if(h > 23){ h-= 24; d++; } m = numtominutes; } if( d > 0){ return d + " days " + h + " hours " + m +" minutes "; }else{ return h+":"+m; } this code given me nice user here on stack overflow. since new programming, javascript have no idea put variable. have var howlong = (0,1 * amount + 0,2 * time) want convert hours , minutes code above, don't know how tell function it's var howlong . can me out? may this? var ndays = math.floor(sec/86400); var nhours = math.floor((sec%86400)/3600); var nminutes = math.floor(((sec%86400)%3600)/60); var nseconds = ((sec%86400)%3600)%60; return ndays + " days " + nhours + " hours " + nminutes + " minutes " + nseconds + " seconds";

java - AspectJ: How to log the successful completion of a method? -

so working aspectj refactor program remove logging calls main classes. instead, logging calls occur via aspects. far, here's i've done successfully: catching exceptions. since have exception handling pretty unified begin (exceptions propagate call stack until reach controller, caught), wasn't difficult. using handle(exception) i've got every catch block tied aspect log exception before catch block executes. debug information logging. basic things entering particular method, etc. again, relatively simple using before() and, sometimes, args() or thisjoinpoint.getargs() capture parameters. the final thing need do, though, log successful completion of key methods. here minor example, of block of code exists in program, can better explain meaning here: private static void loaddefaultproperties(){ defaultproperties = new properties(); try { defaultproperties.load( main.class.getclassloader().getresourceasstream( ...

configuration - Why brunch compile everything it found when using function in joinTo -

i don't understand why brunchjs compile files (in bower_components) when use function (coffeescript): modules = ['i18n', 'pager', 'core', 'module-comment'] javascripts: jointo: # main '/js/master.js': () -> paths = ['bower_components/bootstrap/**/*', 'app/**/*'] o in modules fs.exists '../../../../workbench/dynamix/' + o, (exists) -> if exists paths.push '../../../../workbench/dynamix/' + o + '/public/public/**/*' else paths.push '../../../../vendor/dynamix/' + o + '/public/public/**/*' return paths i want test if path exist, if yes put complete path in variable return jointo. have successfuly files in workbench/vendor undesired files bower_components (don't specified?!) i optimize : javascripts: jointo: # main '/js/master.js': 'bower_components/boots...

Output custom query to Excel format in MS Access -

i know there docmd.transferspreadsheet acexport, requires hard query name. i trying loop on recordset , exporting file per view, example exporting excel file "select * myquery arguments=arg1" , file "select * myquery arguments=arg2" , , on. is there way create such excel file based on "custom" on fly sql query this? use copyfromrecordset dumps vba recordsets excel worksheet range (referencing the upper left corner cell). below subroutine using access vba: public sub actoxlrecordsets() dim xlapp object, xlwkb object dim db database dim rst recordset dim args collection, arg variant dim strpath string, strsql string dim integer dim fld field ' initialize objects set db = currentdb() set xlapp = createobject("excel.application") args.add ("arg1") args.add ("arg2") args.add ("arg3") strpath = "c:\path\to\excel\files" = 1 ...

android - Can I use Glide to have CircleImage with overlapping icon like in Facebook messenger? -

i'm searching library me make cricular image view's in facebook messenger (with z blue messenger icon or grey facebook icon). how came it? can done glide? if not, then? 1.i suggest checkout image management library facebook fresco pretty awesome , mature compared other image loading library. 2.fresco has simpledraweeview custom image view supports rounded corners , circles link , supports animated(.gif, .webp) normal images(.jpg, .png). 3.fresco handles things caching of images 3 tier architecture ( bitmap_memory_cache , encoded_memory_cache , disk_cache ). reduces oom(out of memory) issues. when image in view goes out of screen automatically recycles bitmap, hence releasing memory.

Autolayout differences between iOS 8 and iOS 9 -

Image
if run same code on ios 8 , ios 9 layout comes out differently. icon , label should even. i'm using custom font i'd assume font size / height same in both oses. if adjust spacing constraint right on 9 shows wrong on 8. any ideas? update here existing constraint:

Meteor AutoForm. How to button group for days of week in AutoForm and SimpleSchema -

i want this buttons each day of week . can pick monday , tuesday, no other days. there's couple of ways (with lots of template code), nothing awesome comes out. what's simplest simpleschema , autoform possibly work? here first attempt: officedaysofweek: { // mon,tue,wed,thu,fri,sat,sun - 7 booleans days of week. type: [boolean], defaultvalue: [true,false,true,false,false,false,false] }, after that, thought of making sub-schema individual days seemed alot of code in schema , template. any suggestions? thanks! mike as @mark recommended made sub-schema handle this.