Startup uses AI to create programs from simple screenshots


Startup uses AI to create programs from simple screenshots
http://ift.tt/2rdZPpX

Submitted May 31, 2017 at 11:17PM by Weas
via reddit http://ift.tt/2sng957

Advertisements

easy way to set properties in construction?


easy way to set properties in construction?

function widget( length, width, depth ) { this.length = length; this.width = width; this.depth = depth; } var zonk = new widget( 4,5,6 ); 

is there a shortcut for setting properties on the object itself?

if i wanted to encapuslate them in a property i can do the following neat syntax:

 this.dimensions = { length, width, depth } 

but i can't do this on the object itself?

thanks for any help!

Submitted May 31, 2017 at 10:16PM by jfjjfjff
via reddit http://ift.tt/2qABJH8

Is it possible to get all permutations in exactly n! steps of run time?


Is it possible to get all permutations in exactly n! steps of run time?

As described in http://ift.tt/2rUa83o, there are two typical ways of implementing permutations. But unlike using imperative programming language which can mutate mask to mark whether an element has been used, when you do this in Haskell, you need to generate n instances of cases for the subproblem of size (n – 1) for recursion. However, either "interleave" or "pickup" method (as pointed out in the link) will incur O( n2 ) time complexity instead of O(n), which means the potential running time is O( n!2 ) rather than O(n!). Any ideas?

Submitted May 31, 2017 at 10:25PM by Tederminant
via reddit http://ift.tt/2roS3Ka