ctrl-minus to shrink
ctrl-plus to magnify
Recursive algorithms can be slow because they end up solving the same little problems over and over again. To speed them up, you can use a technique called "memoization." Memoization allows algorithms go much more quickly by remembering solutions to problems they have already solved. I’m the recursive algorithm. This blog is my memoization.
Friday, June 5, 2015
Friday, May 29, 2015
Lots of named tabs--like a scite session but for Gnome Terminal
Open a bunch of bash tabs simultaneously and give them different titles. Nice!
#!/bin/sh
gnome-terminal \
--tab -t "notes" --working-directory=$HOME/notes \
--tab -t "puppet" --working-directory=$HOME/puppet \
--tab -t "beamish" --profile=root-beamish \
--tab -t "odyssey" --profile=odyssey \
--tab -t "root" --profile=root
Friday, May 22, 2015
More organized javascript
I do a lot of writing in Python and everything seems to be nicely arranged and easy to follow and then I go to what I've written in Javascript and jQuery and it looks like a mess. It's comparatively hard to follow even much smaller tracts of code.
So here are a couple of resources on organizing Javascript code.
http://alistapart.com/article/the-design-of-code-organizing-javascript
http://addyosmani.com/resources/essentialjsdesignpatterns/book/
http://rmurphey.com/blog/2009/10/15/using-objects-to-organize-your-code/
So here are a couple of resources on organizing Javascript code.
http://alistapart.com/article/the-design-of-code-organizing-javascript
http://addyosmani.com/resources/essentialjsdesignpatterns/book/
http://rmurphey.com/blog/2009/10/15/using-objects-to-organize-your-code/
Wednesday, May 20, 2015
Today I learned that properties can't be accessed as functions
It took a long time for me to debug something that was simple.
I had a method defined as a property and I built another method that took its output.
Out of habit, I called the function. And my operation failed. The lesson was pretty simple: don't try to call a property. It's a value now, not a method.
I had a method defined as a property and I built another method that took its output.
Out of habit, I called the function. And my operation failed. The lesson was pretty simple: don't try to call a property. It's a value now, not a method.
Thursday, May 14, 2015
Reintroduction to javascript
I found this really nice:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript
https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript
Friday, May 8, 2015
Monday, April 6, 2015
ajax post request: simple
An ajax post request can be as simple as any form in django. Just remember the csrf token!
Subscribe to:
Posts (Atom)