HNHacker News
TopNewBestAskShowJobs

naiquevin

222 karma · joined September 12, 2011

https://www.naiquev.in/
submissionscomments
naiquevin··on Ask HN: What do you use to organize your knowledge?
Org-mode[1] has support for embedded latex math fragments[2] which might be worth trying.

[1]: org-mode is a mode for the emacs editor - http://orgmode.org/

[2]: http://orgmode.org/manual/LaTeX-fragments.html#LaTeX-fragmen...

naiquevin··on Click – Python library for command-line interfaces
There's also Clint by Kenneth Reitz (https://github.com/kennethreitz/clint)
naiquevin··on Poor man's autotest for any language
Nice. I learnt about inotifywait only a couple of days back and chose it over bazillion other watch modules in various languages. In fact I think it could be called the "Poor man's auto-anything for any language" :-) For eg. I use it to auto-recompile less files to css as follows

#!/bin/sh

while inotifywait -e modify resources/public/css/less/.less; do lessc resources/public/css/less/.less resources/public/css/*.css; done

naiquevin··on 2048 – multiplayer
When I was in college, me and my project team mates used to go to this fabrication workshop for project work once per week. I was kind of a counter strike addict in those days. The workshop was inside an old building and at one particular spot, I used to feel like hiding behind the wall!
naiquevin··on Python web scraping
> It could just be me, but I prefer more control, and using the requests library gave me that

I had the exact same opinion until a month back when I started using scrapy + scrapyd[1] for a serious scraping task. Yes, it's a long running spider which is why I decided to use Scrapy in the first place. But so far I have been really impressed with it in general and might consider it even for one-off crawling in future. IMO, pipelines etc. are worth learning. I would also recommend using the httpcache middleware during development which makes testing and debugging easy without having to download content again and again.

On a separate note, for one-off scraping, it's also worth checking whether a python script is required at all. For example, if you just need to download all images, wget with recursive download option should work pretty well in most cases. For eg. a while back I wanted to download all game of life configs (plain text files with .cells extension) from a certain site[2]. Initially I wrote a Python script, but when I learnt about wget's -r option, I replaced it with the following one-liner:

$ wget -P ./cells -nd -r -l 2 -A cells http://www.bitstorm.org/gameoflife/lexicon/

[1]: http://scrapyd.readthedocs.org/en/latest/

[2]: http://www.bitstorm.org/gameoflife/lexicon/

naiquevin··on Butterfly: Your everyday terminal in your web browser
> Everyone should absolutely be running from a virtualenv. Never touch the system python.

Why exactly? I find it convenient to have some packages installed system wide so that they can be used by quickly loading up a python shell without having to activate a virtualenv first or if they need to be used outside any specific project eg. requests, nose, jedi, pyflakes, sphinx etc.

naiquevin··on REPL: To JSON what Excel is to CSV
+1. Also, being written in uppercase, it seems to be an abbreviation but I couldn't find a possible expansion on the site (Assuming the intended meaning is something other than Read-Eval-Print-Loop)
naiquevin··on Why Class?
I can somewhat relate to the conversations in the article. While I admit that I don't think I used OOP correctly, since I started using more functions instead of classes (in Python, my primary language), I observed that it has been more convenient to reuse and refactor existing code.

Another observation is that it's far easier to read someone else's code if there is no mutation. For eg. I have enrolled for the proglang course[1] on coursera and only yesterday I completed this weeks homework which involves enhancing an already written game of Tetris in Ruby. Major part of the assignment was about reading and understanding the provided code that uses OOP and makes heavy use of mutation. It was quite difficult to understand what one method does without having a picture of the current state of the object, specially with side effecting methods that call other side effecting methods. A few times I had to add print statements here and there to actually understand which one is being when and how many times. While I could score full marks in the end, I am still not confident about completely understanding the code and have a feeling that if I ever need to work with it again, the amount of time it will take to load up everything again into my mind's memory will be equal to what it took for the first time.

Of course, one could only make a true comparison by studying an implementation of Tetris written in FP style. But from my experience with reading and writing code in Erlang (for production) and Racket, Clojure (as hobby) I find it relatively easier to study functional code written by others.

[1]: https://www.coursera.org/course/proglang

naiquevin··on Thank You DHH (and others)
Fair enough, but why not render the content along with the page for the first time instead of showing nothing for a few seconds?
naiquevin··on Thank You DHH (and others)
Heads up - On every blog post it seems to be showing the same figure for "x other readers are here" which is misleading.
naiquevin··on Thank You DHH (and others)
> on a useless "We work at Cintrifuse" page the rest of the time

Looks like it's the header and footer joint together waiting for content to appear in between delivered via websockets.

Never tried Meteor but I don't get the point of using websockets for blog posts unless it's purely for learning. Does Meteor encourage such use of websockets? If yes, why? (Genuinely curious)

naiquevin··on Show HN: Gitter – Chat for GitHub
Just tried signing up with github and got the message -

"Gitter isn't ready yet. If we get enough support, we will launch this in a few months. Help spread the word by Tweeting about us and follow @GitChat for updates."

From the other comments here, it looks like people are able to try out a demo or something. What am I missing?

naiquevin··on Publishing JSON over XMPP
+1. Thanks for putting it so clearly.

An (old but) related article: http://metajack.im/2010/02/01/json-versus-xml-not-as-simple-...

naiquevin··on Don't use Hadoop when your data isn't that big
I have no experience with hadoop at all and it may be slightly off topic but this reminds me of a post titled "Taco bell programming"[1], after reading which I started learning and using Unix tools and commands much more than before instead of writing silly Python scripts for almost anything that needed automation.

[1]: http://web.archive.org/web/20110220110013/http://teddziuba.c...

naiquevin··on Schema for Clojure(Script) Data Shape Declaration and Validation
I had come across another schema validation lib for Python on Github a while back (but never tried/used it):

https://github.com/halst/schema

naiquevin··on Sync org-mode file and Trello
Wow! This is exactly what I needed. And it also reminds me that my Emacs config desperately needs a refactor. Today seems to be a good time to do it :-) Thanks for sharing! (and of course, for writing it too in case you are also the author)
naiquevin··on Refactoring GitHub's Design
I clone repos very often to browse the files in my editor so I didn't like the change initially (and I still don't like it very much) but then after getting used to it I felt that the clone-download section could be positioned above the right side menu which would also allow the menu to be aligned with the box that lists files and dirs.

Anyway, I liked the article even though I am not a UI person

naiquevin··on Processing and Racket
As the other reply points out, Quack indents exactly like DrRacket but your other reasons for sticking with DrRacket are totally valid. My primary motivation to move to emacs is that I find myself doing too much of "C-x o" in DrRacket!
naiquevin··on Processing and Racket
What do you mean by "DrRacket indents better"? (Genuine question :-) and not to start a war between emacs and DrRacket)

Just this week I made the switch from MIT/GNU Scheme to Racket for solving SICP exercises. Have been using DrRacket but as I am writing this I am in the middle of configuring emacs for Racket development. So far I have installed Quack and it works reasonably well. Didn't really find any differences between it's indentation and DrRacket's. Next, I will be installing Geiser that will bring the inline image support for working with the picture language exercises.

Quack: http://www.neilvandyke.org/quack/

Geiser: https://github.com/jaor/geiser

naiquevin··on A look at some of Python's useful itertools
> Nowadays developers seem to code without reading.

As someone who started programming 4 year back (which from the conversation seems to be pretty much "nowadays" :-)), I think it is a bit of a generalization. I am not saying it's not true. There are certainly places such as StackOverflow, mailing lists etc that attract newbies early on because they provide quick answers or even code, but at some point every developer who is serious about computer programming as a long term profession does need to start reading the docs. There is no other alternative and one eventually comes to realize that it's much faster than arbitrarily hunting for code and asking questions on mailing lists and IRC.

It also depends upon the style of programming language (imperative/functional) and the previous experience of the developer IMO. For eg. I find my self reading the docs significantly more in Erlang/Scala than in Python than in PHP/JS. It is also the reverse order in which I learnt these languages. Of course that is my personal experience.

naiquevin··on A look at some of Python's useful itertools
It's very tempting. Frankly, I had enrolled for the course mainly for functional programming and not Scala but towards the end I started liking it. But, at the moment my main languages at work are Python, Erlang and Javascript and I still have a long way to go with these so planning to stick to them for a while.
naiquevin··on A look at some of Python's useful itertools
Thanks for the corrections. I have made an edit (although not sure how long it will take to clear the github-pages cache)
naiquevin··on A look at some of Python's useful itertools
Author here. I completely agree with you. Could have known all this before had I just read the itertools docs beyond permutations and combinations. It was only after using Scala's groupby while solving an assignment problem that I thought about finding out an equivalent in python. And thanks to having worked with the Stream class from Scala collections, for the first time the rest of the itertools also made sense. Better late than never I guess :-)
naiquevin··on Can You Teach Yourself Synesthesia?
Yes, it's different from the money-green association. I wonder what made me think it was normal and everyone else thought this way too!
naiquevin··on Can You Teach Yourself Synesthesia?
Whoa! I think I may be having a weaker version of the same type of synesthesia that you have described. I tend to "imagine" colours when I think of certain letters, numbers, days or months. I don't feel this way for each one of them though.. for eg. 2 = red, 4 = green, 5 = pink, 6 = blue, 7 = purple whereas nothing for 0, 1, 3, 8 and 9 (may be black?). Similarly, E = yellow, F = pink, saturday = green, march = yellow etc. Also, I don't "see" colours while reading text, just when I happen to think more about a letter, number or word.

All this while I was thinking this is common and normal in all people like photographic memory or something. Learnt something new today :-)

naiquevin··on Twitter: music Page is Live.
SignInOverflow
naiquevin··on Collaborative chat done right
+1 for using backbone models/collections for message/messages. I have been working a lot with XMPP and Strophe.js lately. Will definitely give it a try.
naiquevin··on A new blog dedicated to Emacs
and another one worth checking, emacsmovies -http://emacsmovies.org/
naiquevin··on Google backslides on federated instant messaging, on purpose?
This makes perfect sense to me. Chat is an important part of a service that my company provides to our users. We received great response after launching "gtalk integration" for chat until some new users started reporting problems due to this issue. We tried the other way around ie. having them send an invite to us but sadly that doesn't work as well. Hope google comes up with a better solution soon.
naiquevin··on Django 1.5 released
I agree about the slow running time of Django tests although I have found that using sqlite database backend for tests reduces the time significantly.
← PreviousPage 2 of 3Next →