Posts

python - Pylab is not installing on my macbook -

mitx 6.00 pylab not installing on macbook running mountain lion running python 2.7.3. have tried installing multiple times can not work. have posted error message below not sure telling me do. if explain error , how fix great. >>> ================================ restart ================================ >>> import pylab traceback (most recent call last): file "<pyshell#5>", line 1, in <module> import pylab file "/library/python/2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.8-intel.egg/pylab.py", line 1, in <module> matplotlib.pylab import * file "/library/python/2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.8-intel.egg/matplotlib/__init__.py", line 133, in <module> matplotlib.cbook import matplotlibdeprecationwarning file "/library/python/2.7/site-packages/matplotlib-1.3.x-py2.7-macosx-10.8-intel.egg/matplotlib/cbook.py", line 29, in <module> import numpy np ...

enums - Any simplier way to 'read' enumerated types in pascal? -

user inputs integer corresponds value of defined enumerated type. need assign value variable t . thought of: type test = (red,green,blue,fish); var t:test; n,i:integer; begin readln(n); t:=red; i:=1 n t:=succ(t); end. am overcomplicating task? possible write simpler alogrithm? you should able cast integer enumerated type, example: t := test(n); if want go other way, use ord : n := ord(t); that should let move numerically item in list. can check bounds with: ord(low(test))) and ord(high(test)) ..where test type.

javascript - Accordion does not make page longer -

Image
i using accordion this: the html looks like: <div id="cal-container"> <div id="cal-side"> <div class="accordion" id="accordion2"> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle project-header" data-toggle="collapse" data-parent="#accordion2" href="#project-list">projects </a> </div> <div id="project-list" class="accordion-body collapse"> <div class="accordion-inner"> <div class="event-container project-container"> </div> </div> </div> ...

javascript - Check checkboxes by value -

i have been using code comma separated list of checkboxes checked. $(".hidfeedsids").val($.map($(':checkbox[name=channel\[\]]:checked'), function (n, i) { return n.value; }).join(',')); now need opposite, have list need check checkboxes values on it. can tell me how done? aside fact code isn't syntactically valid... $('input:checkbox').filter(function() { return valuesarray.indexof(this.value) > -1 }).prop('checked', true);

unit testing - using memoize in groovy -

i practicing test driven development in groovy using spock. have 1 set of tests 3 different implementations doing same thing: iterative, recursive, , memoized. have created abstract class hold tests, , created 3 different files return concrete class implementation run tests. have iterative , recursive working, having issues memoize() import spock.lang.specification abstract class fibonaccitest extends specification { private calculator abstract def getcalculator() def setup() { calculator = getcalculator() } def "test canary"() { expect: true } // more tests } class recursivefibonaccitest extends fibonaccitest { def getcalculator() { new recursivecalculator() } } class iterativefibonaccitest extends fibonaccitest { def getcalculator() { new iterativecalculator() } } class memoizefibonaccitest extends fibonaccitest { def getcalculator() { new memoizecalculator() } } cl...

android - How do I give superuser access to my app on a device I own and control? -

background we build , control hardware devices on app run. (edit)we build custom version of android os well. we're building app expect "always-on." we want app able self-update, independent of market. hence, hosting service client app periodically poll updates, download apk, , install it. therein lies... the problem i want updateservice install downloaded app update without giving user usual permission , update prompts - after all, control hardware , software. that, think need give app superuser permissions (tho, if there other way, question becomes different). can't figure out how that. i have read superuser app can installed - seems user solution users want root own phones. or solution devs want distribute app needs superuser, don't control device on users install it. is there file somewhere in android os lists apps or users should have su? if so, it's no problem; control everything. first download , run uninstall , install ( s...

html - HTML5 (& CSS3?) Create a grid of squares in the background -

i had idea background don't know if can done, , if can, best method be. let idea, it's grid of squares background page when mouse on 1 changes color , shifts back(i know how animation portion). grid supposed span entire page, width , height, , overflow hidden. i'd wish re size if page does so i'm wondering if can done. if can, how generate grid? i'm @ complete loss. ideas? i use <canvas> . or maybe fill entire body equally sized div's height , width defined in percentages. lets grid of 10x10 div's. or can create on -the-fly jquery many div want (to fill whole height). can float div's fill entire viewport, , if window resized use media queries arrange them. on hover, can apply animation on every div. of course, can put other elements on div's.