HNHacker News
TopNewBestAskShowJobs

bakul

647 karma · joined July 29, 2013

submissionscomments
bakul··on Ask HN: How to learn about text editor architectures and implementations?
I have a different suggestion. Start with a single line. define an api for move, insert and delete. figure out how to display this line, associate the cursor with the current position and how to map keystrokes to these simple functions. Add commands to load/save this one line file. Also some convenience functions (move to star/end of a line etc). Add simple search, search and replace. Next extend this to as many lines as you can display on your screen. Add more commands. Add commands to operate on a sequence of lines. Next allow arbitrary number of lines, and arbitrary length lines (now you can see only a rectangular slice of the file). Add commands to move that window, move lines around etc. Resist the urge to micro optimize or do so early. Just use the simplest data structures that help you write the clearest code. Later you can profile the code and fix slow parts.

I suggest this as it will force you to solve problems yourself as opposed reading about other people’s solutions. Basically learn by doing. Learn by struggling to come up with solutions and data structures, thereby developing some insight. The stepwise development should help focus on a small subset of problems at a time. Don’t be afraid of changing data structures as you gain knowledge. In fact write code to make it easy! Use a language that won’t trip you up in low level issues such as memory management. The api will make testing easier. Armed with this knowledge you’ll better appreciate and understand other people’s solutions as well!

bakul··on Elizabeth Holmes found guilty
More commonly Shani is the harbinger of bad luck & retribution, which is why you’ll rarely see any Indian origin person named Shani. In a Hindu mythology Shani is the elder brother of Yama, the lord of death & justice.

Sometime people named Sunil, such as the cricketer Sunil Gavaskar, use Sunny as a nickname.

bakul··on Microsoft forked MIT licensed repo and changed the copyright [fixed]
> I took the comment to be a refreshing dose of reality.

This is how I meant it but I could have phrased it or presented it differently as this point got lost at least with the moderators and may be many more. Will try to be more careful in the future.

I appreciate your speaking up. And I also appreciate the moderators in trying to keep the discussion standards high. They have a tough job trying to decipher the intent of every commenter.

bakul··on Microsoft forked MIT licensed repo and changed the copyright [fixed]
I too don't think there is any "moral obligation" involved but I did feel it was perfectly fine to point out what I did. I quoted their "I work for MS" to provide the context for my comment, nothing more.
bakul··on Why Is C Faster Than Java (2009)
> My argument has always been and still is...a language x written in language y cannot by definition be faster than language y.

While this may be true in theory, in practice it is often not true as usually there are time constraints.

Working in a low level language Y can take much more time & effort than a high level language X. This can mean you can profile and iterate the program design to improve performance much faster in X than in Y. Worse, if you have optimized a program in Y following algorithm A, it would be much harder to switch to optimizing following algorithm B. Because almost always "optimization" makes program logic more complex and removes clarity. Some time so much so that you may not even try an alternative! Such increased complexity can also happen in an HLL program but a modular program can often be rewritten more easily.

bakul··on Microsoft forked MIT licensed repo and changed the copyright [fixed]
Just pointing out this (reality distortion) is a general phenomenon. Have seen the same in all big companies (& many small). As an employee you want the best for the company and you naturally imbibe the company culture and that is perfectly fine. But there is a line and this is something one has to watch out for as an employee. As an example, seeing any critical comment from outside as an attack on the company.

It is good that an employee explained how this particular event happened and that is to their credit.

bakul··on Microsoft forked MIT licensed repo and changed the copyright [fixed]
How is running a bot to change copyright notices a /mistake/?

> Full disclosure: I work for MS

It is difficult to see the reality distortion field you are in from the inside.

bakul··on Sleep technique used by Salvador Dalí works
This may have to do with being relaxed, not really thinking about the problem at hand and letting your intuition take over. I have had experiences where working intensely on a problem, even for weeks, didn't solve it but walking away from it and being totally relaxed and the solution just popped in my head. It could be in a shower, having a meal with friends, in the middle of the night or on a walk. You already have the necessary facts and observations but somehow you have not made that last intuitive leap. And when you do, you instantly know it is right as all of a sudden the cloud of possibilities collapses to a single point!

I don't think of it as creativity as much as sparking one's intuition. The "sleep technique" test also relies pattern recognition, which is sort of a limited creativity. You are making the final connection as opposed to opening up a whole new world of possibilities.

bakul··on A talk with Walter Bright about Empire
> 1. Everyone agrees with that. And then they create a mess. They are generally unable to see the mess. One cannot learn without experiencing failure, and when one cannot see the failure, one cannot learn.

Hence "early intervention"! Usually one's own experience is not going to be enough but if one can learn from real experts what to avoid and what works well, one can develop a sense. You can get some of that by careful reading of such people's code.

> 2. Some features are far more susceptible to this than others.

True. This happens when the language developer creates a mess! I am reminded of Tony Hoare's "Hints on Programming Language Design".

> 3. These also come about from my discussions with managers of programming teams and the problems they have to deal with.

They should be listened to for the problems they face but not necessarily solutions :-)

bakul··on A talk with Walter Bright about Empire
> My friend said "I can fix that" and fixed the bug and checked it in in two hours. The manager, astonished, asked him how he figured it out. He said "I didn't figure it out. I disassembled the object code using Walter's disassembler that turns it into assembler source code, found the bug, fixed it, and checked in the new asm source code!"

Nice! But this trick doesn't work when a bad program is written in a HLL! I once speeded up a C++ program that took 3 minutes & was in the critical path for 40-50 engineers. It was badly written and the logic was spread all over the place. It was not fixable so I took the easy way out. I looked at its inputs+outputs, fed various smaller samples to figure out the IO logic and reimplemented it from scratch. The new program ran in 0.5 seconds. It wasn't a difficult problem but nobody wanted to touch the program because it was so badly written.

I think the moral is that bad programmers will misuse whatever features they have access to. The "dark side" is less that of the feature in question and more in the lack of early intervention and proper training! People need to be taught how to use power tools responsibly & judiciously. If you take away all the power tools for the fear of misuse, you will only see mediocre work. Or worse.

bakul··on Vaccination blunts, but does not defeat Delta
Perhaps this will be a spur to invent a better mask? I believe fear will subside as over time most people tend to adjust to new realities.
bakul··on GNU nano is my editor of choice
ed.
bakul··on Thunderbird 91.0
The master-slave terminology is used outside of CS as well. For example in EE we have master-slave edge-triggered D or JK flip-flops. I don’t feel strongly either way about such word use but I am fine with renaming them too. The fact that such change is so triggering to some people is strange!
bakul··on New carnivorous plant discovered in Pacific Northwest
what could go wrong, right?
bakul··on Schizophrenia linked to marijuana use disorder is on the rise, study finds
Could it be that schizophrenics are more likely to partake marijuana? Since it is a mental disorder and tends to run in families, the underlying genetics may predispose such people to marijuana, or marijuana may have a stronger effect on such people. That is, a strong correlation should result in a deeper look at this connection rather than directly influence marijuana legalization.
bakul··on Collusion rings threaten the integrity of computer science research
Jugaad is very different from this sort of collusion.
bakul··on Initial Stress-Derived Noun
I don't know what you mean.
bakul··on Initial Stress-Derived Noun
Sanskrit has free word order. For example, "krishnam naro'shvam prashyati sundaram" -- the man sees the beautiful black horse. Here Krishnam == black, sundaram == beautiful. naro'sham is the combined form (sandhi) of narah (man) + ashvam (horse) and prashyati == sees.

Though Indian languages derived from Sanskrit have simpler rules and the adjectives are roughly in the same order as English (but the endings have to match the noun).

bakul··on The data model behind Notion's flexibility
Didn’t Marvin Minsky come up with frames by 1974? Or are Clarisworks frames different?
bakul··on A man is looking for the friends who shipped him overseas in a crate in 1965
:-) :-)
bakul··on Female Founder Secrets: Men Clamming Up
Surely the solution is to get female investors involved where this is a concern?
bakul··on Can You Identify This Mysterious Old Writing?
could be the Balinese script as it seems (to me) to be less loopy than the Javanese script. Both are abugidas and their alphabets seem to be organized just like Devanagari and scripts for other Sanskrit derived languages.

https://en.wikipedia.org/wiki/Balinese_script

https://en.wikipedia.org/wiki/Javanese_script

https://en.wikipedia.org/wiki/Abugida

bakul··on V (Vlang) 0.2
The V playground seems to be up and running.
bakul··on AT&T Fiber in the SF Bay Area is flipping bits
This is unlikely, given how many people are seeing this. And now the problem has gone away for me!
bakul··on AT&T Fiber in the SF Bay Area is flipping bits
I recall hardly any of the details now but IIRC I talked to the AT&T support person and they changed some settings. Looking at the settings now, I see in "Home Networks->Subnets & DHCP" the [public subnet mode] is on. I haven't had to deal with any EAP authentication (but again I may be forgetting!).

And IP Passthrough is off. Basically the modem is routing between the public and private subnets.

BTW, I do have a static IP block from AT&T.

bakul··on AT&T Fiber in the SF Bay Area is flipping bits
Some new data.... I ran the same script on two different machines connected via the same AT&T provided modem. Machine A is NATted, B uses a public address. A always gets the error within 50-60 fetches. B doesn't (I ran the test a number of times for a few seconds each). I even ran them both concurrently (repeated the test on A since it keeps failing) but it was always A that got the error.

I am wondering if this is modem related -- may be they silently "upgraded" it or changed some default such as TCP checksum offload? Just guessing, I haven't checked.

Experiment 2: I switched machine A to use a public address (from my static IP address block) and the problem disappeared! I then switched it back to the way it was and still there are no errors. Not sure what to make of this...

bakul··on AT&T Fiber in the SF Bay Area is flipping bits
I see no errors running the same script from another host that doesn't go through at&t.
bakul··on AT&T Fiber in the SF Bay Area is flipping bits
The same here. It is always the 0x08 bit. (p-x, d-l, g-o etc.).
bakul··on Ragya – Indian classical music played by time of the day
You may wish to check out https://en.wikipedia.org/wiki/Indian_classical_music
bakul··on Indian developer jailed for making unauthorized train ticket booking app
His punishment should have been to work with the Indian Railway to design a better system that meets their requirements & their customers’ needs as equitably as possible.
← PreviousPage 6 of 12Next →