HNHacker News
TopNewBestAskShowJobs

bakul

647 karma · joined July 29, 2013

submissionscomments
bakul··on ngn/k, an AGPL K interpreter
I use a slightly different DO macro. For example,

  DO(count(v)) v[i]=i;
  DO(3,4) a+=i*10+j;
  DO(3,4,5) a[i][k]+=b[i][j]*c[j][k];
Where i,j,k are first, second and third indices. So i in the last example takes values 0..2, for each i value j takes values 0..3 and for each j value k takes values 0..4.
bakul··on ngn/k, an AGPL K interpreter
If you are interested, try something like this to start making sense of the code:

  cc -E m.c | indent | grep -v INDENT | less
and separately read k.h for typedefs etc.
bakul··on ngn/k, an AGPL K interpreter
I think this is what you really want to ask: “This style of programming is totally foreign to me. Clearly this is intentional — I am curious as to why you chose it. Can you explain?” :-)

Understanding why someone else makes a difference choice can be illuminating. Given that the author of the original k has written at least 5 or 6 versions of the language interpreter from scratch every time in this style, he must be doing something right. Right?

bakul··on Go + Services = One Goliath Project
IMHO a microservice should follow the unix philosophy of doing one thing well. But interfacing with other services is not as simple as unix pipes. In particular it is more of a request/response communication. Consequently, interfacing needs to be thought through carefully and made as simple as possible. They should evolve much more slowly than individual service code. While you may use (g)rpc or http at a lower level, your specific protocols will have many more constraints. Ideally you have codified assertions about their behavior in tests early on.

Note that they are not all going to start/stop at exactly the same time and during development they may even crash so each microservice should survive such transitions. You may have two different versions of service code or even completely different implementations or two different version of the API in use at the same time. This can happen as different services evolve at a different rate. And you may want to transition to a new version in a piecemeal manner so as to not bring the whole service down. All these considerations complicate things. So ideally you have factored out these common tasks in shared library/packages. And ideally you write your code such that if necessary more than one service can be compiled into the same binary for performance reasons.

In a monolith some things become easier since everything dies at once! But somethings become more complicated - such as supporting evolving code. And monolitha require more discipline to keep things modular. Over time this gets harder and harder. Lack of modularity means you have to understand a lot more code and when you evolve things, more code will have to change and there may be unforeseen side-effects. And scaling can become harder.

bakul··on APL and J (2015)
Note that converting a boolean matrix m to an adjacency list is easy. In k:

  adj: ,/(!#m),''&:'m
In fact for something like SCC, &:'m is good enough since you are going to iterate over all the rows any way.
bakul··on A Dropbox account gave me stomach ulcers
Reminds me of HP's 11.1 Billion dollar blunder of buying Autonomy....

https://www.nytimes.com/2012/12/01/business/hps-autonomy-blu...

bakul··on SATA HATs support up to four drives on Raspberry Pi 4 or Rock Pi 4
Note: the Jmicron site explicitly mentions support for the TRIM feature for the JMS580 but not earlier bridge devices including 561. This matters if you connect SATA SSDs.
bakul··on What Is Systems Programming, Really? (2018)
You can write a user level filesystem in any programming language if it can talk the 9p protocol!
bakul··on Local Linux User Tries FreeBSD
It is the default for a new user in FreeBSD. The OP seems to be confusing pfsense (which is based on FreeBSD) with FreeBSD itself.
bakul··on Local Linux User Tries FreeBSD
The default shell (what "adduser" offers as the default login shell) in FreeBSD is sh (/bin/sh). The root's shell is /bin/csh given FreeBSD's BSD roots. Though pfsense may have changed its defaults compared to a stock FreeBSD release.
bakul··on Cooling off your Raspberry Pi 4
Note that the main issue here is to avoid cpu throttling due to excessive heat. IIRC you can allow a higher cut-off temp (100ºC instead 77ºC) by setting a config parameter. This will possibly reduce the chip lifespan from whatever it is to decades! But make sure no one can accidentally touch the chip.

I have one case with a fan and one case where part of the case body attaches to the chip top with thermal goop. The fan works better.

bakul··on Surviving Software Dependencies
To me the Equifax story is the Nth such story that points out a crying need for a better security model. In 99%+ cases single teams can no longer produce 100% of the code that companies rely on. Most teams do not have (or can not afford to hire) people with expertise to audit or even an ability to understand the implementation details of the third party codes they use. Consequently any 3rd party code should only be allowed to access resources or data structures that it absolutely needs to carry out some work on behalf of its caller. This is separate from managing the scale complexity of s/w dependencies.
bakul··on Interested in improving your relationships? Try Nonviolent Communication
It's also known as Compassionate Communication.
bakul··on Ken Thompson's Unix Password
ken replied to the thread about this on TUHS 4-5 days prior to the actual crack. But you are right. No one actually said "hey ken, better change your password if you haven't because I am going to crack the password you used in 1980".
bakul··on Ken Thompson's Unix Password
A password is supposed to be very hard to guess by others but not so hard for you to remember so it can be said to be PII! And no, it is not assumed that IT will crack your password. Because how do you know how far IT would go to crack your password and how do you know they are not looking at your data as well? Employee/company officers' email may contain data that could be highly sensitive and something IT should not be looking at.
bakul··on Ken Thompson's Unix Password
The /etc/passwd file from which this password was unearthed has a date of Jan 5 1980 (from a 3BSD tar file). Presumably ken has updated his password since then.
bakul··on Ken Thompson's Unix Password
A proper policy would’ve been to not have any human look at a user’s password and just email them a warning about their weak password. A password should be considered a PPI (personal, private information) and off limits to others, no matter how creepy (exception being a legal warrant). These days you might gotten in trouble!
bakul··on An Antique Toaster That's Better Than Today’s [video]
I was shocked when I first discovered that US sockets do not have a switch!
bakul··on Oppenheimer and the Gita (2014)
I think Wellerstein reads more into what Oppenheimer said (years later) about what he thought when he saw the explosion than what he may have meant. My take is that Oppenheimer was saying the quote from the Bhagvad Geeta accurately described his thoughts at the time. That with the atom-bomb we (the United States) have (the power to) become the destroyer of the whole world. I think what he said about Vishnu and Arjuna was to merely provide the context of the quote. He did not mean imply anything about his own duty. This is borne out by what he says next: “I suppose we all thought that, one way or another”. No matter what their personal motivation may be for working on the bomb, they must all have sensed the enormous destructive power of the bomb.
bakul··on Apple’s Use of Swift in iOS 13
They’re certainly wrong about Scheme. They used MIT-Scheme to count keywords, when they should’ve used R5RS Scheme or newer. R5RS has 20 keywords + 4 if you add support for macros. With define-syntax you can define many special forms such as let, let* etc in a smaller language so may be the actual number is much smaller!
bakul··on Stanford researchers find lead in turmeric
If you have proof, you should provide it.
bakul··on A Million Digits of Pi in 9 Lines of JavaScript
> this simple one still converges at about 0.6 decimal digits per term.

The Chudnovsky brothers’ algorithm computes 14.18... digits per term. Its implementation in Scheme is only about a couple dozen lines of code. It computes a million pi digits in about 17.5 seconds on raspberry pi 4 in Gambit Scheme (57 seconds on the original raspberry pi, IIRC).

bakul··on A Personal History of Modeless Text Editing and Cut/Copy-Paste (2012) [pdf]
In vi you can operate on N chars, words, lines etc. quite efficiently. Mouse based editing, at least beyond what you see on the screen, is more laborious and less accurate. Typing a regexp to find or replace, or moving to a specific location in the file is still modal in a mode less editor.
bakul··on AI made from a sheet of glass can recognise numbers just by looking
I wonder if one can create a similar auditory transfer function that is attuned to a specific voice.... basically evolve a sound cavity of specific shape
bakul··on Impending kOS (2014)
k (specifically k3) runs on FreeBSD if you use linux emulation. The same is true of q. IIRC, there are no limits on the 32 bit version of q (unlike the old k3). kona is more portable but needs work.
bakul··on People who get goosebumps from music have different brains (2017)
I don’t understand most of the words in his qawwalis but yes. His singing was out of this world. Like at the WOMAD festival in 1988: https://www.youtube.com/watch?v=AEIKmwVpOhQ
bakul··on Battle testing data integrity verification with ZFS and Btrfs
I first started using zfs in 2005 when my hardware raid failed. Since then I’ve moved the disks to a new server in 2009 and replaced all the disks twice (one at a time for redirecting). Finally I built a new server this year. This time I’m using zfs send/recv to copy data to the new disks. The old server is still working 10 years later & its latest disks have been in use 24x7 for over 5 years now. Zpool scrub on the old server takes days now (compared to one hour on copied zpool on the new server).

Even back in 2009 I heard some Linux enthusiasts tell me how btrfs was going to be better than zfs!

bakul··on Nasa Says Earth Is Greener Today Than 20 Years Ago Thanks to China, India
https://www.nasa.gov/feature/ames/human-activity-in-china-an...

This NASA article points something out that is missing from the Forbes article based on the same research: 82% of increased greening in India and 32% in China is due to intense agricultural activity — harvesting multiple crops per year. This does not increase biomass as much as by reforestation. Forests support rich ecosystems and do not use up groundwater unlike intensive farming.

bakul··on A history of tea, the second most-consumed beverage in the world (2017)
I now use 1:3 or less especially when using whole milk, 1:2 or 1:2.5 when using 2% fat milk. Experiment and see what you like! There is no one true recipe!

Definitely no refilling with hot water! As the whole process takes time, I used to make 3-4 cups in the morning and take the remaining tea in a thermos to work.

bakul··on A history of tea, the second most-consumed beverage in the world (2017)
Sugar as per taste but milk is a must! I use 1:2 water:milk but you can vary it. About 1 tsp of masala per cup or mug. Typically you’d heat the whole concoction till the milky water rises once or twice. I don’t put in the tea (loose or tea bag) from the start as it tends to become bitter but it must still boil with the rest for a minute or two.
← PreviousPage 8 of 12Next →