akashakya

Joined 10 years ago

Karma
89
Submissions
31
Member since
May 28
Email: akashh246 [_at_] gmail [_dot_] com GitHub: https://github.com/akash-akya
View on Hacker News

Recent submissions

Comment · 1 year ago
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 "$@"
Comment · 1 year ago
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.

Comment · 1 year ago
Comment · 2 years ago
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.

Comment · 4 years ago
Comment · 4 years ago
Comment · 6 years ago
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?
Comment · 6 years ago
> 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.

Comment · 7 years ago
Ahh. You are right. I misread the (3)[....] notation. Its not reset but just different representation.
Comment · 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.

Comment · 7 years ago
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.
Comment · 7 years ago
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
Comment · 8 years ago
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)

Comment · 8 years ago
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

Comment · 8 years ago
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.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton