HN user

akashakya

89 karma

Email: akashh246 [_at_] gmail [_dot_] com GitHub: https://github.com/akash-akya

Posts1
Comments30
View on HN

For lightweight sandboxing on Linux you can use bubblewrap or firejail instead of Docker. They are faster and _simpler_. Here is a bwrap script I wrote to run Claude in a minimal sandbox an hour back:

    exec bwrap \
      --ro-bind /usr /usr \
      --ro-bind /etc /etc \
      --ro-bind /run /run \
      --ro-bind "$NODE_PATH" /node \
      --proc /proc \
      --dev /dev \
      --symlink usr/lib64 /lib64 \
      --tmpfs /tmp \
      --unshare-all \
      --share-net \
      --die-with-parent \
      --new-session \
      --bind "$HOME/claude" /claude \
      --bind "$HOME/.claude.json" /claude/.claude.json \
      --bind "$HOME/.claude" /claude/.claude \
      --setenv HOME /claude \
      --setenv PATH "/node:/claude/bin:/usr/bin" \
      --bind "$(pwd)" /work \
      --chdir /work \
      /claude/bin/claude "$@"

Tl;dr fancy way to map 1D time to 2D image

If you imagine a movie as a line along the time axis with each frame as a pixel, there are multiple way to create an 2D image.

Bargraph is simple approach, but essentially it is still is a one dimensional. We are only using x axis.

Zig-zag pattern is another approach, where you start from top to bottom, left to right. But in this case the relative distance between close frames aren't fully preserved. Two distant frames might appear together, or close frames might end up far apart, which leads to odd looking artifacts.

Hilbert curve is a pattern to map 1D to fill space (2D) such that relative distance between any two points (frames) on the 1D line is somewhat preserved. That's why it appears as clump/blob.

Here it is hard to see the movie progression from start to end but all frames from a scene are always closer, which was what I was aiming. I find it interesting that visual aspect (color/scene) is easy to see here but temporal aspect isn't.

I was excited about the whole 1D to 2D mapping aspect at that time, leading to this toy.

I read the same book, also in Kannada. It was bought by my father when he was in high school. Of all the science books I have read, this one was more engaging and had a bigger impact on me growing up.

My father said he used to buy lot of soviet translations because they were cheap but the content was of high quality. Even after 30 years, when I picked them up, they were clearly distinct, including the Art, print quality and binding.

  Location: Bengaluru, India
  Remote: Yes
  Willing to relocate: Yes
  Technologies: Elixir & OTP, JS, Ruby, C/C++, Java, Lisp, Kafka, Kubernetes, Redis, React, SQL
  Résumé/CV: https://docs.google.com/document/d/1VZfV7HaVw1P_EQscJUli6Ot0BW8k3GsoxgQS5fK5SCQ/edit
  Email: akashh246 [_at_] gmail [_dot_] com
Software Engineer with 6+ years of experience. Currently working with a large scale distributed system involving Elixir. Worked on distributed job scheduler, event driven system, and RESTful microservices. I have experience architecting a product from ground up, leading a team for a while, working as an individual contributor and as a consultant. I am active in the Open Source community, contributing and maintaining a few projects.

GitHub: https://github.com/akash-akya

  Location: Bengaluru, India
  Remote: Yes
  Willing to relocate: Yes
  Technologies: Elixir & OTP, JS, Ruby, C/C++, Java, Lisp, Kafka, Kubernetes, Redis, React, SQL
  Résumé/CV: on request
  Email: akashh246 [_at_] gmail [_dot_] com
Software Engineer with 6+ years of experience. Currently working on a large scale distributed system involving Elixir. Worked on distributed job scheduler, event driven system, and RESTful microservices. I have experience architecting a product from ground up, leading a team, worked as an individual contributor and as a consultant. Outside work, I am active in the Open Source community, contributing and maintaining several projects.

I am looking for challenging roles involving complex problem/domain

GitHub: https://github.com/akash-akya

I don't know much about WASM, but how does this work with shared libraries? Is it even possible to call a shared library without any safety guarantees?

Streams, available in 5+ can handle a lot more use cases fluently

Stream does solve the backup queue issue, but not being able to filter messages from the consumer's pending list makes implementing retry mechanism and exponential backoff hard (without reaching to sorted set).

Though, I can understand the Redis team's decision to keep it simple.

The Bloom Clock 7 years ago

Ahh. You are right. I misread the (3)[....] notation. Its not reset but just different representation.

The Bloom Clock 7 years ago

one can increment a single value outside the bloom filter to keep the values in the bloom filter low. Example: Instead of storing bloom filter [4,3,3,5,7,4,3,3,5], one could store it as (3)[1,0,0,2,4,1,0,0,2].

CMIIW, This only works if it's guaranteed that the reset (transition from high values to low) is propagated to all the nodes. Which is not the case in a distributed system. Like, if a node is not reachable for a long time and every other node is reset except this one then its possible to have a state in which we can have false negatives.

By that logic anything which kills mass population is "not so bad". Why not just bomb cities. Infact if you read it as a response to "world wars", though not intended, that way of thinking justify that.

That depends on the usecase. Sometimes you do want to start with clean state. If the process is in some invalid state which caused the crash in the first place, restarting the process is useless in this case

ah, that was a bad example for so many reasons. slightly better example

  foo_bar -> fooBar()
  baz_car -> bazCar()
  some_thing -> someThing()
An even better example is doing the reverse
  fooBar() -> foo_bar
  bazCar() -> baz_car
  someThing() -> some_thing
You can put cursors at every line and then use subword movement to find the word boundary.

you still need some kind of regex to put the cursors at the right places, don't you?

I didn't say it replaces regex. You need regex just to place the cursors. you don't have to write complex regexp edit text (as shown in this example)

Agreed, I think of macro as a superset of multiple-cursors. Heck, with macro you can even run arbitrary code to generate text dynamically. I had the pleasure of doing this multiple times.

In Emacs, you can use multiple registers for storing code and data for this purpose

Yes, no silver bullet. But most of my use case I find a generic pattern so I don't check the individual edits. Anything more complex I'll switch to macros.

Btw, I meant undo like global undo which will let you undo the last keypress for all of the cursors. In your case, you meant undo for a particular instance of change I guess.

Also, let's say there is different character after _

  foo_bar -> fooBar
  baz_car -> bazCar
  some_thing -> someThing 
Maybe you can do this with regex. but for a new user, he has to look it up. With multiple-cursors, you don't even have to think about it.

However, you can use a macro.

With multiple cursors you are seeing the changes as you are editing. and you have all of the normal editing shortcuts at your disposal. Example, if you made a mistake while typing just hit undo.

Multiple-cursor is useful when you want to edit lines which have non-trivial edits or doesn't have a common string to use find-replace. simple example

   foo_bar -> fooBar
   bar_baz -> barBaz
Sometimes even this doesn't cut it and have to use mighty Emacs macros. (I'm sure something similar exits for VIM)

Loops are closer to what CPU actually does. A compiler is therefore simpler to implement and will likely contain less surprises.

I dont find the argument convincing. By that assembly is closer to what CPU actually does, why not write code using goto (or binary)? We all can agree on its easy to write reasonably good code high-level languages. I think it because high-level languages are closer to the problem domain (or our thinking), hence it's easier to define the solution in these languages. same for recursion.

It’s easier to use a debugger on procedural-style or OO code (step in/over/out, local variables) compared to recursive functional style advertised by SICP.

I feel exactly opposite. OO by definition have state bound to object outside the method (not actually local variable), so you have to watch all the objects method is affecting. Not pleasant experience when you have hundreds of objects. A recursive code on the other hand usually depends only on the local arguments so you can only focus on current step.

In most runtimes, call stack is limited to a small size, a couple of megabytes. Stack overflow exception is hard to handle in a reasonable way. When instead using a loop with a stack container for the state, it can be much larger, also easier to handle overflows i.e. implement soft and hard limits.

Well, depends on the platform you are working on. For desktop at least it's definitely not "a couple of megabytes".

I feel that most of the time choice is between readability and performance. Sometimes maybe the solution is inherently iterative/recursive making choice easier. ymmv though.

You should definitely check out different versions. The story they usually use in tv-series and 'parents' tell is the same version which is as you said boring, and plain good guy vs bad guy plot. But many ancient versions excellent[1][2] and they not dragged like the original!, even better if you are into prosody(kavya)[3].

[1] https://en.wikipedia.org/wiki/Urubhanga

[2] https://en.wikipedia.org/wiki/Vikramarjuna_Vijaya

[3] https://en.wikipedia.org/wiki/Sanskrit_prosody

Vachana Sahitya[1] is less known outside I guess.

Vachana Sahitya is a form of rhythmic writing in Kannada that evolved in the 11th century CE as a part of the Sharana movement, a revolt against all the social evils of the traditionalistic society that time. Subject varying from their revolutionary ideas regarding human rights, society, democracy, god, and life.

It's not actually a book, more like Haiku maybe.

[1] http://books.google.co.in/books?hl=en&lr=&id=kLs3AAAAIAAJ&oi...

http://www.manushi-india.org/pdfs_issues/articles/Talking%20...

http://vsnanc.org/newsite/wp-content/uploads/2014/02/AllamaP...

On top of that, there are hundreds of versions of Rāmāyaṇa and Mahābhārata with different themes and story[1]. Excluding retellings in different languages with a different style and changes story depending on languages, region & religion. My mother tongue (Kannada) alone has more than 10 ancient version or so which I heard of.

It seems that old writers had a different idea of storytelling. They were focused more on the theme & prosody[2] than the story. I think it set the bar very high since everyone know the base story. No wonder they had this complex structure and ideas for prosody[2]

[1] https://en.wikipedia.org/wiki/Rama_in_Jainism

[2] https://en.wikipedia.org/wiki/Sanskrit_prosody

But this will solve the problem only for the languages which are similar to English, because they share the same grammatical structure differing mainly only in the keywords. This is trivial to fix with approach you mentioned, But for the rest of the family of languages this require more change, (Sometimes change in the whole programming model)

For example in Kannada language (or any other Dravidian language) sentence formation itself is different. In English you can read 'if' statement as a proper sentence ("If a equals to Zero") but in Kannada conjunction appear at the end, 'if' sentence is more like "a equals to zero 'then'", so these kind of changes requires non-trivial changes to programming languages. As an example I was trying to 'alias' basic functions (if, for, define... etc) to Kannada languages in Lisp (because its easy in lisp!), but these kind changes breaks "S-Expression" format due to change of the position of the function in the list.

And typing in these languages in typical US-en keyboard is whole new problem in itself!

But I believe that some problems can be expressed better in languages with different structure or at least better to its native speaker.

The Tamil language currently used is not same as the one when the other Dravidian languages separated, So calling other languages 'derived' from the Tamil is not correct. All Dravidian languages have same root, so calling it 'Dravidian Language' and Tamil, Kannada, Malayalam & Telugu etc. derived from that language is more accurate and avoids the confusion

reading English is more difficult than speaking it

I'm a non-native English speaker. I agree, reading English is easier than speaking. In rural places basic grammar is not taught properly. Even if they do learn to read somehow with the help of dictionary or internet, Speaking English is far out of their reach. For using App reading ability is enough. But for overall, English as medium of communication this is very problematic. This is more frustrating when you are among elite (for academics or career purpose) who speak English fluently.

Most important thing is they can't express their idea. For using App this isn't big problem, but as overall expressing idea this is a barrier.

prefer one language to unite us all

Its not a bad thing if that happens properly. But instead currently we have small number of 'elite' people who always prefer English over native language and we have large number of people we don't know how to read & write English. Since the output(business/knowledge/tech) of this 'elite' group almost always in English and by definition they are in control its not easy for person who don't know English to break loop. Its very easy for the person who know English to get the job compared to who don't. One might say, just learn English and become the 'elite'! Well, learning English is not at all easy for a kid from rural background. This initial barrier dividing among ourselves and now we now have invisible class system based on language. this is apparent if you visit any restaurants/supermarket in cities or just visit city outskirts. My point is process of implementation of single language for all is very difficult.