HNHacker News
TopNewBestAskShowJobs

Monkeyget

636 karma · joined March 20, 2008

@tburette
submissionscomments
Monkeyget··on Transforming Code into Beautiful, Idiomatic Python [video]
Slides: https://speakerdeck.com/pyconslides/transforming-code-into-b...

Notes: https://gist.github.com/JeffPaine/6213790

Monkeyget··on Super Pixel Quest
This reminisced me of Apple LC times big time. Marcel Proust's Madeleine style. Dithering, games such as Beyond Dark Castle[0], HyperCard games.

[0] https://www.youtube.com/watch?v=ISP9su7okHo

Monkeyget··on Code review without your glasses
You can do this more efficiently and for the entire code base at once by using code visualization tools:

CodeCity [1]. A city represents a code base. Each class is represented as a building. The aspect of a building gives information on the corresponding class. For example: the color is the number of lines, the height is the number of methods and the width is the number of attributes.

System Complexity View and Class Blueprint [2]. Like CodeCity the color and shape represent various attributes. An added benefit compared to the codecity is that you can also show links between the code elements. For example inheritance or invocation.

NDepend [3] for .NET also has many interesting code diagrams.

[1] http://www.inf.usi.ch/phd/wettel/codecity.html

[2] http://www.moosetechnology.org/docs/polymetricviews

[3] http://www.ndepend.com/Features.aspx#Diagrams

Monkeyget··on James Hague
I read the original erroneous code, the mistake and attempted to write a correct solution. I ended up with '(2048 - (size % 2048)) + size', the same expression as the original :/.

Us humans just don't do well with edge cases in ranges/bounds. Another seemingly simple task which is easy to trip over is : determining if a time interval overlaps another.

Monkeyget··on Jrnl – A simple command line journal application
I keep a coding journal of all those unsettled questions and thoughts that pop in my mind. The questions I ask myself, the things I could improve,... It turns out to be highly valuable in my projects and I recommend anyone to try it.

I started a comment but it became gargantuan so I turned it into a blog post : http://tburette.github.io/blog/2014/06/25/the-power-of-keepi...

Monkeyget··on Passwords in plain text
Apparently the list of offending sites is hardcoded in the extension ( https://github.com/klinskyc/PTOAlert/blob/master/sites.json ) and the extension is not updated to reflect changes on the sites.
Monkeyget··on Browse formulae – All packages available via the Homebrew package manager
Search is a feature missing on the brew website.

Speaking of search, I wish there were a brew search on the project description instead of just the name of the project.

Monkeyget··on Passwords in plain text
The case where you get your new password by mail when you just changed it does not necessarily mean it is stored in plain text. They could keep it around in memory just long enough to send it by mail.

Doesn't mean it is a good idea though.

Monkeyget··on Binary electronic data specification (BED)
How does it compare to BSON?
Monkeyget··on Lifetramp: Be someone else for a day
It would be great for children who have a narrow view of their career possibilities.
Monkeyget··on Obesity research confirms long-term weight loss almost impossible
There is more than just DNA. The state of a pregnant mother can have an important impact on the offspring even if it doesn't affect its DNA. The same DNA can create different persons because of different gene expression. This is what epigenetics is all about.

Mother obesity affects The brain and metabolism of the baby. This includes the way fat is managed. This is even before birth.

Monkeyget··on Watch a Ph.D. thesis dissertation being written in (somewhat) realtime
Related, I loved watching pg writing an essay live : https://code.stypi.com/hacks/13sentences
Monkeyget··on Why Atom Can’t Replace Vim – Learning the lesson of vi
As mentioned in the article Emacs creation of arbitrary new functions and Vi creation of new shortcuts are both application of the same basic principle : composability. All you need is :

- primitives

- a way to combine primitives

Combining instructions together (and giving it a name) is just a function. This is nothing extraordinary for us programmers. However exposing that ability to users of a program for extensibility is rarely done, Yet it yields immense power for little complexity from the user comprehension standpoint.

Monkeyget··on How to Write a Lisp Interpreter in Python (2010)
I love Norvig's writing. He has a way of writing in concisely and make code appear effortless.
Monkeyget··on Show HN: Manage your gif collection, search and drag/drop from a desktop app
Nice concept. I like the points idea to incite tagging.

The homepage does a poor job of convincing me to install the application : an image (carousels don't count) and two lines of text for a visual application.

Monkeyget··on Absolute Zero
In Our Time episode regarding absolute zero : http://www.bbc.co.uk/programmes/b01r113g
Monkeyget··on So You Want to Write Your Own CSV code
No idea. I've been bitten by a library that turned out well into a project to have pernicious flaws.

It would be awesome if someone made a table with CSV features in one dimension and application/library behaviour in the other.

Monkeyget··on CSVjs: Basic CSV parsing and encoding in JavaScript
The CSV 'format' is hell. I just wrote a blog highlighting some of the issues : http://tburette.github.io/blog/2014/05/25/so-you-want-to-wri...
Monkeyget··on CSVjs: Basic CSV parsing and encoding in JavaScript
I wish there had been a github when I was his age. I remember writing a .ini file parser in Java. I showed it to my friends who couldn't care less and... that was the end of it.
Monkeyget··on Fira Sans: a Free, Open Source Typeface Commissioned by Mozilla
Fira Mono takes an awful lot of vertical space. To me it looks like inconsolata but less legible due to extra serif.
Monkeyget··on On Primary Keys
I am glad that twitter, github and stackoverflow allowed me to change my username. You could call it 'display name'. I wish hn would allow it.
Monkeyget··on Remembering, as an Extreme Sport
If you are interested in the topic I recommend the book “Moonwalking With Einstein” mentioned in the article. It's both entertaining and informative. I particularly liked the parts about mastering a skill as efficiently as possible.

I tried some memorizing techniques. It's a great feeling to improve 10x at a (specific) memorizing tasks in very little and effort time by using one weird trick©.

I used to try to remember random words during my commute and recall them when coming back. I took a list of random words from /usr/dict and set myself a timer of a few minutes to remember 30 words using memory palace. I used various places from the commute itself to store words. It was fun to see the words pop-up automatically in specific places on my way back. My performance declined after a while because I wasn't able to erase the previous words.

Monkeyget··on You already use Lisp syntax
Stopping at the syntax when talking about Lisp is pretty narrow-minded and completely misses what makes Lisp so great. It's like saying to a car driver that motorcycles are nice because they only have two wheels and thus take less parking space. Technically true but not what makes them exciting. When you describe to the coffee-drinking radio-listening commuter about taking corners and being one with the road he won't understand what the point is. But if he were to drive a bike around a circuit, oh boy! I'm probably going to fail miserably but let me attempt to explain cornering and being one with the road in Lisp.

What's so great about Lisp? : its extreme malleability in the way you write code and the data it uses.

Code and data are the exact same things in lisp. They are represented the same way : lists represented with braces around them who can be nested. It's called s-expressions and they are in the form (<operator> <operand1> <operand2> <operand3>). There is no fundamental difference between code and data they are just list represented as s-expressions:

  (list 1 (list 2 3))
  (+ 1 (+ 2 3))
Another example :

  (task 
    (time 14 00)
    (log "beginning of task")
    (job (backup-files (important-files-in (list-files))))
    (job (delete (list-files))))
Quick, what's that above, code or data? How about both?

The one nice thing about s-expressions (sexp) instead of classical curly braces is that the code written in sexp IS ITSELF the abstract syntax tree of that code.

For example, think of a function function add(a, b){return a+b;}

You could convert this function into its syntax tree like this :

  (define-function (name add) (parameters a b)
  (body (return (+ a b))))
If we simplify things a bit we end up with :

  (defun add (a b)
    (+ a b))
Lo and behold, the example above IS Lisp code. Is that code or data? How about both?

The syntax of Lisp is the same as its internal represention. That's called homoiconicity.

What's so great about that? Well, mix that with macros whose language is Lisp itself and can do anything with s-expressions and you end up wielding great powers.

A simple example. Let's go back to our task example. We can treat it as data :

  //not actual lisp code but you get the point
  var my-task = (task 
    (time 14 00)
    (log "beginning of" )
    (job (backup-files (important-files-in (list-files))))
    (job (delete (list-files))))
my-task is now a list containing sub lists representing a task. What if we did this now :

  //not actual lisp code
  (defun time (hour minutes) (print "%d:%d" hour minutes))
  (defun log (string) (print string))
  //we say that task is a function
  //that should call each list it contains as a function
  (defun task () /*execute each list it contains*/) 
  //...
Now we can just do:

  (my-task)
What do you think is going to happen? Yes, the data, the task is being executed.

Now for the last touch : add to Lisp a powerful macro system that can take any s-expression (any list) and transform it any way it see fits and you end up yielding great power. What's that language? It's Lisp itself. Code is data. Lisp code evaluting other lisp code. I am so enlightened.

Not enlightened? Didn't get anything out of my post? Then give Lisp a try! You have to dive into Lisp to be able to get it. As Eric raymond put it : "Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot." - ESR

Monkeyget··on Draw a Cat
Reminds me of http://www.onemilliongiraffes.com/
Monkeyget··on Why Van Halen's tour contract had a "no brown M&M's" clause
It reminds me of the orange juice test. You organize an annual convention for hundreds of people.

You tell the banquet manager of the hotel you are considering that the morning breakfast must include a large glass of freshly squeezed orange juice for everyone of the attendees. It must be squeezed no more than two hours before the breakfast.

It is not possible to do so. Squeezing that much orange in much a short amount of time would be prohibitively expensive.

If the manager says yes he is either lying or incompetent and you'd better find someone else who will tell you it's not possible.

Monkeyget··on OS X Command Line Utilities
In practice I find Terminal/tmux/emacs a more pleasant experience to me than GUI emacs/frame and window/shell.

GUI emacs does brings nice features: -multiple fonts / font sizes at the same time (nice for minimap http://www.emacswiki.org/emacs/MiniMap !) -more shortcut possibilities with s- added to the usual C- and M-- -more colours

Shell/ansi-term modes don't work well enough. There's always problems with shortcuts/encoding/escape sequences/Ncurse.

Monkeyget··on OS X Command Line Utilities
iterm has special integration with tmux. The big advantage is that you can quickly scroll the history with the mouse which is way faster and more convenient that going back up screen by screen with a shortcut.

Also with some work you can synchronize the OSX clipboard with tmux's one.

Monkeyget··on OS X Command Line Utilities
This was supposed to be few lines of remarks. It expanded quickly in relation with my enthusiasm for this topic.

I've been investing some time in the command line on my Mac. I am moving from a dilettante going to the shell on a per-need basis to a more seasoned terminal native. It pays off handesomely! It's hard to convey how nice it to have to have a keyboard-based unified environment instead of a series of disjoined mouse-based GUI experiences.

Here are some recommendations pertaining to mastering the command line on a Mac specifically:

-You can make the terminal start instantaneously instead of it taking several seconds. Remove the .asl files in /private/var/log/asl/. Also remove the file /users/<username>/Library/Preferences/com.apple.terminal.plist

- Install iterm2. It possesses many fancy features but honestly I hardly ever use them. The main reason to use it instead of the default Terminal application is that It just works©.

-Make your terminal look gorgeous. It may sound superficial but it actually is important when you spend expanded period of time in the terminal. You go from this http://i.imgur.com/cx3zZL8.png to this http://i.imgur.com/MQbx8yK.png . You become eager to go to your terminal instead of reluctant. Pick a nice color scheme https://code.google.com/p/iterm2/wiki/ColorGallery . Use a nice font (Monaco, Source Code Pro, Inconsolata are popular). Make it anti aliased.

-Go fullscreen. Not so much for the real estate but for the mental switch. Fullscreen mode is a way to immerse yourself into your productive development world. No browser, no mail, no application notification. Only code.

-Install Alfred. It's the command line for the GUI/Apple part of your system. Since I installed it I stopped using the dock and Spotlight. Press ⌘+space then type what you want and it comes up. In just a few keystrokes you can open an application, open gmail/twitter/imdb/..., make a webs search, find a file (by name, by text content), open a directory,... It's difficult to describe how empowering it is to being able to go from 'I want to check something out in the directory x which is somewhere deep deep in my dev folders' to having it displayed in 2 seconds flat.

-Make a few symlinks from your home directory to the directories you use frequently. Instead of doing cd this/that/code/python/project/ you just do cd ~/project.

-Learn the shell. I recommend the (free) book The Linux Command Line: http://linuxcommand.org/tlcl.php . It guides you gently from simple directory navigation all the way up to shell scripting.

-Use tmux. Essential if you want to spend some time in the terminal. You can split the window in multiple independent panes. Your screen will have multiple terminals displayed simultaneously that you can edit independently. For example I'll have the code in one side and on the other side a REPL or a browser. You can also have multiple windows each with its own set of panes and switch from on to the other. With the multiple windows I can switch from one aspect of a project to another instantly. E.g: one window for the front-end dev, a second one for the backend and another for misc file management/git/whatever.

-Pick an editor and work towards mastery. I don't care if you choose vi or emacs. You'll be surprised how simple features can make a big change in how you type. You'll be even more surprised at how good it feels

The terminal is here to stay. It's a skill that bears a lot of fruits and that deprecate slowly. The more you sow the more you reap.

Monkeyget··on Google offering $1M prize for a much smaller power inverter
Note that it's the norm in the film industry. For a new movie project they'll peocure the element and people they need, do the movie and then disband.

In The Nature of the Firm [1] Ronald Coase wondered why companies didn't contract out instead of having employees and why indeed firms exist in the first place instead of using the movie industry system.

His answer was that there are transaction costs associated to using the market. There are also other costs such as search/informgation, bargaining, trade secrets,.. The costs of going to the market makes it less attractive. He got the Nobel Prize for that.

Internet lowers that cost and makes it possible where it was impossible before. It's definitely a new opportunity companies don't exploit.

Kaggle [2] does it for predictive modelling.

[1] https://en.wikipedia.org/wiki/The_Nature_of_the_Firm [2] http://www.kaggle.com/competitions

Monkeyget··on Shit HN Says
SRS = serious (not reddit).
← PreviousPage 2 of 5Next →