HNHacker News
TopNewBestAskShowJobs

abhirag

312 karma · joined February 9, 2017

[ my public key: https://keybase.io/abhirag; my proof: https://keybase.io/abhirag/sigs/uFY5p-Y3Fc9Jpy2S3f9nBdGV48xT-UaGpXcGlpUWFxM ]
submissionscomments
abhirag··on What makes a good REPL?
You seem to be using SublimeText, check out SublimeREPL extension[https://github.com/wuub/SublimeREPL/blob/master/README.md]. Once setup you'll be able to evaluate code blocks in a running REPL :) Also, Emacs modes of most languages with REPLs will have this functionality inbuilt.
abhirag··on Fun vs. Computer Science (2016)
"About a decade ago, I built a small web app using Common Lisp (SNACK) and a lot of the development I did was done through adding new features and debugging in the REPL. While I saved the VM, reading the code months later to add a feature was terrible because the app was hacked together. I wonder of there's a way to fix this." -- I think you might like clojure.spec, I feel that it is a step in the right direction towards keeping the flexibility and interactivity of lisp while making the code more maintainable. You can find more about it here -- [https://clojure.org/about/spec].

I also wrote a small article on it, not very detailed but maybe it can help you get a rough idea of the power of clojure.spec when combined with generative testing -- [http://abhirag.in/articles/spec_oracle.html]

abhirag··on Life Aboard the Longest Train Ride Through India
Thanks :) if you look at part 2 -- [http://abhirag.in/articles/train_of_thought_2.html] I already have a decent algorithm to find stations with wrong coordinates, regarding geocoding, if you zoom into the map, you will find that the stations are marked with a star so OpenStreetMaps presumably has that data already. Cleaning up the location data is definitely doable but wouldn't be easy. One main issue is the duplicate names of stations, although the station codes would be different, we still need to have a rough idea of where the station is. I did try and improve my results using the MapQuest geocoding api, but I would label that effort as "work under progress" for now :)
abhirag··on Life Aboard the Longest Train Ride Through India
Glad you liked it :) I am not using any theme, custom built the css to my liking.
abhirag··on Life Aboard the Longest Train Ride Through India
Apologies for the blog spam but you don't find something about Indian Railways on hn everyday :) I recently tried visualization of routes and live running status of trains in India using jupyter notebook -- [http://abhirag.in/articles/train_of_thought_1.html]. Someone here might find it useful :)
abhirag··on It's Never Too Late to Learn Guitar
May I suggest concentrating on playing scales first, your fingers have to get used to putting enough pressure on the strings that the notes are not muted and you can slowly build that strength by playing individual notes first :)

Also the perspective that helps me learn an instrument is that it's like you are developing a friendship with your instrument. One day you will be so comfortable that playing an instrument would feel like talking to a friend but making a friend takes time :) You have to have some awkward conversations first, feel like this is going nowhere and someday it won't feel awkward anymore and you would pick up your instrument and it would understand you like a friend does :)

I used to play a guitar and now often spend my time playing the mandolin so this perspective has definitely helped me, maybe it would be of some help to you too :)

abhirag··on Clojure will affect the way you think about programming
Glad you liked it :)
abhirag··on Clojure will affect the way you think about programming
If you are curious about core.async and want to learn more you can have a look at the post I wrote on it-- [http://abhirag.in/articles/batman_clojure.html]. I wrote it while trying to learn it myself so not the most advanced resource but I hope somebody finds it helpful :) Note -- The page is kinda resource intensive because it contains a running clojurescript interpreter for interactive code snippets.
abhirag··on Alone on the Open Road: Truckers Feel Like ‘Throwaway People’
"I spend a lot of time learning this and that and have a small portfolio that can be viewed. But still no joy." -- You should try posting with a non-disposable account then, I agree showing your work is a hard thing but this community is filled with people who try to be helpful to others.

Also if you are interested in all this stuff try this -- [https://www.visualstudio.com/dev-essentials/] you get free 3 months trials for Pluralsight and Linux Academy, you can download and watch some video courses during commute and that might reduce your study time at home a bit.

Disclaimer -- not affiliated with Microsoft or Linux Academy or Pluralsight, just trying to be of some help :)

abhirag··on Why don't schools teach debugging? (2014)
I think avoiding what you call "debugger-induced tunnel vision" can be done by using a debugger to step through the code just to read it, debuggers can also be tools to better understand what the code is really doing because you not only see the code but also the state the system is in while debugging.

The added benefit is that when you actually break out the debugger to squash a bug you better understand what might be going wrong as you can try and pattern match from the time it worked perfectly.

I treat the debugger as a tool for understanding code, buggy or otherwise, no "debugger-induced tunnel vision" for me, it widens my field of view :)

abhirag··on Why don't schools teach debugging? (2014)
I absolutely agree with the pre-requisites --

"(1) An accurate mental model of how the program should behave, with sufficient detail to hypothesize about why it's not behaving that way" -- While working as a firmware engineer, I once got a bug from a customer, he reported that they were in Argentina and the device with the firmware would lose an hour in the time displayed every time they had a power loss and that the problem goes away when they put the time-zone to Brazil, this much was enough to know that the problem was with the day light saving time part of code. Some engineer hypothesized that problem might be with the NTP server but his hypothesis was wrong because NTP server was dealing in UTC.

"(2) Available tools and instrumentation that allow you to inspect a running program (I'm old enough to remember debugging by adding commands to print state to the console)" -- I dealt with code which installs the firmware, frequent power cycles made keeping a debugger attached an exercise in futility so I just continuously logged the top two frames of the stack by using a system call. Crude way to trace the control flow but helped me in understanding the installation process a lot.

"(3) sufficient experience and sophisticated understanding of the system to be able to make valid hypotheses and design tests." -- This was even more important while dealing with firmware hangs, dealing with hangs made dealing with crashes look easy. Crashes were the messy criminals leaving a lot of clues behind. Hangs are the type of criminals who would have to be caught while committing the crime.

I would also like to add one more --

"(4) When debuggers fail you, git-bisect is your only true friend." -- I once was dealing with a memory corruption bug, in a piece of memory which was shared by two systems, the number of processes with access to that piece of memory was bonkers. I decided to brute-force my way out, it worked in the last release, it stopped working this release, I just kept doing a git-bisect between clean and dirty states and found the code which caused the bug. This way was definitely not the clever way to do it, but brute-force is sometimes the only option left.

abhirag··on Behind Carder Kingpin Roman Seleznev’s Record 27 Year Sentence
The letter he wrote to the court was an interesting read(https://www.nytimes.com/interactive/2017/04/21/technology/do...), still don't know what to make of it though.
abhirag··on Python, as Reviewed by a C++ Programmer
"Variables in Python are object references. When you call a Python function the arguments are copies of the references to the original object." -- I personally wouldn't worry about what to call it(though call by reference would be my pick too), in the end I just visualize it as being similar to how assignment works in Python.
abhirag··on Bonobo – A data processing toolkit for Python 3.5+
You should also have a look at this book(http://www.goodreads.com/book/show/14744694-python-for-data-...), it helps that author of pandas library is also the author of the book. From the description of your use-case, you seem to be doing exploratory data analysis, pandas can definitely handle that.
abhirag··on Resources on creating programming languages
Agree with the recommendation of "Concepts, Techniques, and Models of Computer Programming". You can also have a look at "Essentials of Programming Languages"(http://www.eopl3.com/).
abhirag··on Why MIT Switched from Scheme to Python (2009)
This book(http://composingprograms.com/) is in Python and is based on SICP. I found it interesting enough to include it in my ever-growing to-read list, worth checking out.
abhirag··on Ask HN: Which companies have the best blogs written by their engineering team?
My vote would go to Discord's blog -- https://blog.discordapp.com/
abhirag··on New IPython release drops Python 2.7 support
I think we already have such languages, I would never be able to make better arguments than a Turing award winner so I'll just leave this link(http://www.jsoftware.com/papers/tot.htm) "Notation as a Tool of Thought" by Kenneth E. Iverson.
abhirag··on New IPython release drops Python 2.7 support
Now that I have a better idea of your dev setup I think I can be of a bit more help :)

1. If you are prototyping and prefer working on a remote server, have a look at(https://notebooks.azure.com/), memory is limited to 4Gb but its free and jupyter notebooks are great for prototyping.

2. For prototyping you should try and do REPL driven development, what I mean is that you should be ok with just playing around with the library API before you write a longish-running processing task, that would reduce(not remove) the chances of a runtime error. Jupyter notebooks excel in this too as you can just try out code in a cell, learn from it, rinse and repeat. You can also use your IDE to send code fragments to REPL and get immediate feedback on them. This way of iterative development would make sure that the speed of your feedback cycle isn't slow. If python's feedback cycle seems slower to you than C++, you are definitely not using the REPL enough :)

3. If debugging is a pain point definitely give an IDE a try, I prefer Visual Studio as I am on Windows. You can very well go with Pycharm or vscode(not technically an IDE but has a debugger so that's that). I personally prefer Jupyter notebook or Emacs with my code and REPL in split windows for prototyping, different strokes for different folks.

I personally love working with python, I even write my blog posts in a Jupyter Notebook so although it isn't perfect, it doesn't have to be frustrating either :) Hope my suggestions can be of some help!

abhirag··on New IPython release drops Python 2.7 support
Sorry, I forgot giving a link to Python Tools for Visual Studio which includes the debugging and profiling utilities I linked to(https://www.visualstudio.com/vs/python/).
abhirag··on New IPython release drops Python 2.7 support
"I would kill for an easy to use tool like xcodes Time Profiler" -- maybe this(https://www.visualstudio.com/vs/debugging-and-diagnostics/) can help. "I really miss c++ (or even better swift)." -- maybe this(http://mypy-lang.org/) can help. I am just trying to help and have no intention of going into static vs dynamic typing but if you want to do data science stuff in a statically typed language, you should have a look at F# and its type providers(http://fsharp.org/guides/data-science/). I personally don't agree with a few of your criticisms of python, but you needed to rant so I'll just ignore them :)
abhirag··on File System Improvements to the Windows Subsystem for Linux
Yes SSHFS support would be great, till then WinSCP(https://winscp.net/eng/download.php) helps reduce my troubles a bit.
abhirag··on Support for tagging of Lambda functions and for the Python 3.6 runtime
Finally Zappa(https://github.com/Miserlou/Zappa) would be able to support web services written in python 3!
abhirag··on Why ML/OCaml are good for writing compilers (1998)
Haven't used OCaml but the recommended practice in Erlang/Elixir is to break down complex pattern matches into separate function clauses, as function calls are also driven by pattern matching.
abhirag··on John Coltrane Draws a Picture Illustrating the Mathematics of Music
I see you are using emacs :) Setting up Overtone isn't that difficult and Overtone + Emacs Live(https://overtone.github.io/emacs-live/) makes for a great live coding setup :) Both of them are by Sam Aaron, I find his work inspiring. Anyways, have fun with live coding!
abhirag··on GDNative – A scripting language module for Godot
I love heartbeast's tutorials and he has a few videos on Godot Engine(https://youtu.be/ntYjl_obUDo?list=PL9FzW-m48fn1iR6WL4mjXtGi8...).
abhirag··on Embedded developers need an open source OTA software updater without the lock-in
"Embedded firmware updates - especially for M2M devices that are not necessarily user-facing - are sort of like changing the engine of your car while driving down the highway. It's a very tricky thing to get right. Plus if something goes wrong, it's not like you can just SSH into your server or kill that cloud instance and start a new one :)" -- I worked on marking 'embedded firmware installation' process better in a previous job of mine and you described the problems involved perfectly. There was a part of the process in which communicating with the device and attaching debuggers was a major pain and I had to rely on extensive tracing to keep an eye on the process. I personally believe that the better way would be to emulate what NixOS does(https://nixos.org/~eelco/pubs/nixos-jfp-final.pdf). Painless rollbacks and reliable updates would help embedded development a lot and treating the state of the device as immutable is a great way of doing that.
abhirag··on John Coltrane Draws a Picture Illustrating the Mathematics of Music
You should definitely try Overtone (http://overtone.github.io) and Sonic Pi (http://sonic-pi.net), if you haven't already.
abhirag··on MathJax CDN shutting down on April 30, 2017
Jupyter Notebooks containing maths and exported as html are also going to get affected. I personally write my articles in a Jupyter Notebook and export them to html and put them on my site so need to update a few of them.
abhirag··on The Power of Prolog
You should have a look at https://mitpress.mit.edu/books/reasoned-schemer
← PreviousPage 4 of 5Next →