Better HN
topnewbestaskshowjobs
Log inSign up

SyrupThinker

241 karma · joined Jan 24, 2017 (9y ago) · 88 submissions

Submissions

comment 1y ago · link · parent

Ah, that reminds me of my own university days.

Early on I've made the mistake of sharing my solutions with people I knew. Unfortunately they kept sharing the solution too, and so on.

Two times I was pulled into a profs office after the relevant lecture, to be questioned about it.

After it became clear that I was the author, and what happened, nothing ever came of it (for me).

Ironically both times the copiers supposedly failed to remove the git repo that was part of the handoff, so it was primarily about verifying I was the original author.

Lesson learned: "invisible" watermarks work, because people are generally lazy (also don't share graded work, just offer to help)

comment 1y ago · link · parent

What a boring website...

It fails to differentiate between JavaScript engines, a core language implementation, and runtimes, an engine plus the useful parts needed for writing software (os, event loop etc.).

It lists engines like boa, duktape or Hermes as if they are the same thing as Node, Deno or Bun, but at the same time doesn't even mention SpiderMonkey, V8 or JavaScriptCore, as if realizing they are not actually in the same class.

I guess the snark wouldn't work as well if a chunk of the list gets eliminated by thinking about it.

comment 1y ago · link · parent

Yes, the limits are important to keep in mind, I should have contextualized that before.

For my case it happened to work out because it was a CDC based deduplicating format that compressed batches of chunks. Lots of flexibility with working within the limits given that.

The primary goal here was also making the reader as simple as possible whilst still having decent performance.

I think my workload is very unfair towards (typical) compressing archivers: small incremental additions, needs random access, indeed frequent incompressible files, at least if seen in isolation.

I've really brought up 7z because it is good at what it does, it is just (ironically) too flexible for what was needed. There probably some way of getting it to perform way better here.

zpack is probably a better comparison in terms of functionality, but I didn't want to assume familiarity with that one. (Also I can't really keep up with it, my solution is not tweaked to that level, even ignoring the SQLite overhead)

comment 1y ago · link · parent

From my own experience SQLite works just fine as the container for an archive format.

It ends up having some overhead compared to established ones, but the ability to query over the attributes of 10000s of files is pretty nice, and definitely faster than the worst case of tar.

My archiver could even keep up with 7z in some cases (for size and access speed).

Implementing it is also not particularly tricky, and SQLite even allows streaming the blobs.

Making readers for such a format seems more accessible to me.

comment 1y ago · link · parent

I think this is good insight, and I would extend this further to “coming from a less strict language to a very strict one”.

As someone who self-learned Rust around 1.0, after half a year of high school level Java 6, I’ve never had the problems people (even now) report with concepts like the ownership system. And that despite Rust 1.0 being far more restrictive than modern Rust, and learning with a supposedly harder to understand version of “The Book”.

I think it’s because I, and other early Rust learners I’ve talked to about this, had little preconceived notions of how a programming language should work. Thus the restrictions imposed by Rust were just as “arbitrary” as any other PL, and there was no perceived “better” way of accomplishing something.

Generally the more popular languages like JS or Python allow you to mold the patterns you want to use sufficiently, so that they fit into it. At least to me with languages like Rust or Haskell, if you try to do this with too different concepts, the code gets pretty ugly. This can give the impression the PL “does not do what you need” and “imposes restrictions”.

I also think that this goes the other way, and might just be a sort of developed taste.

comment 1y ago · link · parent

Possibly “(ver)änderbar” (changeable) to have a distinct keyword. “Mutierbar” would also work fine in German, but it was probably changed with the same reasoning that fn was to fk.

comment 1y ago · link · parent

While I can't speak for MicroLua, this can indeed be accomplished with vanilla Lua.

There are two things in play here:

First, the _ENV variable here is special.

It is implicitly used to lookup any identifier that has no visible binding, locally or in the surrounding scopes.

Thus a script just containing print("Hello world") is really _ENV.print("Hello world").

Usually _ENV is just implicitly defined to be the global environment (available as _G), but it can be overridden within a lexical scope to a custom value.

Second, the jump labels just make use of the alternate function call syntax of object:method(args), which is equivalent to object.method(object, args).

The whitespace is non-significant, which allows it to be written like that.

In combination with metatables you can use _ENV to track variable reads, calls etc. within a function, which you can (abuse) to create DSLs.

You can get an idea of whats possible by just tracking what we can intercept with _ENV. Adding the following code after the pio_timer function, and running the script with Lua 5.4, already gives us quite a bit for just the first three lines of the function.

local loggerMetatable = {} function loggerMetatable:__bnot() print("Called bnot on " .. rawget(self, "name")) end function loggerMetatable:__call(...) local name = rawget(self, "name") print("Invoked " .. name .. " with " .. #table.pack(...) .. " args") -- Return another logger table to visualize variable interactions return setmetatable({ name = name .. "(...)" }, loggerMetatable) end function loggerMetatable:__index(key) local name = rawget(self, "name") print("Accessed key " .. key .. " on " .. name) -- Return another logger table to visualize variable interactions return setmetatable({ name = name .. "." .. key }, loggerMetatable) end

local pio_env = setmetatable({ name = "_ENV" }, loggerMetatable) pio_timer(pio_env)

-- Output:

Accessed key public on _ENV

Accessed key start on _ENV

Invoked _ENV.public with 1 args

Accessed key set on _ENV.public(...)

Accessed key y on _ENV

Invoked _ENV.public(...).set with 3 args

Accessed key mov on _ENV

Accessed key y on _ENV

Accessed key y on _ENV

Called bnot on _ENV.y

Invoked _ENV.mov with 1 args

[...snip...]

comment 1y ago · link · parent

Close to zero from the DSA given thats how several European cloud providers have acted for the last decade.

Theres certainly other (German) legislation in place that might be relevant, but whats the point of speculating if we can’t blame the EU for it.

comment 2y ago · link · parent

Very fun. Unfortunately there is a way to, in my opinion, cheese it. I made it to 2485 on my second attempt.

Reversed to avoid spoiling the game: .gard ot reyalp eht gnicrof yb devlos eb dluoc siht ebyaM .kcab ot kcab tsrub eht reggirt ylbailer ot mhtyhr a ni taht od ot eunitnoc tsuj nac uoy ,kcilc ot ecalp thgir eht dnif uoy fI

comment 2y ago · link · parent

You are missing that the TOTP secret will only be presented once during setup.

It is now a second factor because you need to prove possession of the secret by entering the current TOTP code during login. It will not be presented again, so an attacker needs to have been able to intercept the initial secret exchange. (well or phish for it etc.)

You are usually prompted to enter the code during setup to ensure the secret has actually been put into some authenticator and is not immediately going to be lost.

comment 2y ago · link · parent

Interesting, I've recently spent an unhealthy amount of time researching archival formats to build the same setup of using SQLite with ZStd.

My use case is extremely redundant data (specific website dumps + logs) that I want decently quick random access into, and I was unhappy with either the access speed, quality/usability or even existence of libraries for several formats.

Glancing over the code this seems to use the following setup:

- Aggregate files

- Chunk into blocks

- Compress blocks of fixed size

- Store file to chunk and chunk to block associations

What I did not see is a deduplication step for the chunks, or an attempt to group files (and by extend, blocks) by similarity in an attempt improve compression.

But I might have just missed that due to lack of familiarity with Pascal.

For anyone interested in this strategy, take a look at ZPAQ [1] by Matt Mahoney, you might know him from the Hutter Prize competition [2] / Large Text Compression Benchmark. It takes 14th place with tuned parameters.

There's also a maintained fork called zpaqfranz, but I ran into some issues like incorrect disk size estimates with it. For me the code was also sometimes hard to read due to being a mix of English and Italian. So your mileage may vary.

[1]: http://mattmahoney.net/dc/zpaq.html [2]: http://prize.hutter1.net [3]: https://github.com/fcorbelli/zpaqfranz

comment 2y ago · link · parent

Seems about right for "Science and Technology", a variant of this question also shows up in German IHK (chamber of commerce) exams for software developer certifications, with a similar expected answer.

Although you do sometimes get weights… the important part is explaining that you evaluate some weighted sum and take the best result.

How much impact would this question have on the final result for the licensure exam?

IIRC during my own IHK examination this was worth around 5pp, which is almost enough to drop you an entire grade.

comment 3y ago · link · parent

I imagine the author would disagree with that because it does not have the “right” behavior by default.

For example indexing and length of the string are done by codeunit. [1]

On the other hand Rakus Str type does behave similarly to Swifts: indexing, length and iteration by grapheme; view methods for specific encodings. [2]

[1]: https://docs.julialang.org/en/v1/base/strings/ [2]: https://docs.raku.org/type/Str#routine_chars

comment 3y ago · link · parent

Well… that was supposedly considered at some point:

https://youtube.com/watch?v=BJIfPFpaMRI&t=1891 (~1m)

comment 3y ago · link · parent

Using a `debugger;` statement allows you to trigger a breakpoint with code.

This only gets activated when the devtools window is opened, so placing this statement in a frequently executed piece code will continuously interrupt whatever you are doing in the devtools when you use them.

I assume in the past the tooling might not have had the necessary configuration options to suppress that, but nowadays you can just disable debugger statement breakpoints to avoid it.

comment 3y ago · link · parent

Am I misunderstanding something, I think that gesture exists on iOS?

Swiping from the left screen edge to the right navigates back in any properly designed app.

Alternatively sheets are usually dismissed by swiping down.

Do you have particular apps or contexts in mind where this did not work?

comment 3y ago · link · parent

I must be misunderstanding the pricing (talk about confusing) or the value proposition.

The way I understand it those $5 give you all the management features and $5 worth of compute.

But compute costs $10 GB/month for RAM and $20 per vCPU/month.

So in comparison to a VPS this costs $30 for a full-time 1vCPU/1GB machine, ignoring network egress.

At least as a VPS replacement this really doesn’t seem worth it. For that money I can get a 12 vCPU / 24 GB machine with my current provider, which includes 80TB traffic.

comment 3y ago · link · parent

Not making any statement regarding the mentioned workflow issues (I mostly agree with them), I really like iSH [1] for this sort thing.

It’s a “good enough” solution for the “I just quickly need to do something in a terminal” problems.

And because it’s an x86 Alpine Linux it can even run simple binaries if needed.

But for me it still couldn’t replace a dedicated laptop for proper tasks.

[1]: https://github.com/ish-app/ish

comment 3y ago · link · parent

Sure you can, you can run something like Wipr [1] and SponsorBlock [2] in Safari on an iPad for an ad-free YouTube experience, in the browser.

Of course there is a compromise on the video quality (1080p max) and convenience of the official app.

[1]: https://kaylees.site/wipr.html [2]: https://sponsor.ajay.app

comment 3y ago · link · parent

You said before that you are acting as a business here, so I don’t think these apply, but just to mention it.

(1) A trader who maintains a website or uses terms and conditions shall, […]

1. […] inform consumers of the extent to which it is willing or obliged to take part in dispute resolution procedures before a consumer conciliation body […]

I imagine there is equivalent legislation for B2B, this one applies to consumer matters.

Or maybe the notice is a catch-all for exactly this law.

DE: https://www.gesetze-im-internet.de/vsbg/BJNR025410016.html#B... EN: https://www.gesetze-im-internet.de/englisch_vsbg/englisch_vs...

comment 3y ago · link · parent

Many parts of the Swift toolchain are already open source [1], there is a Windows and even a WASM port [2].

The caveats are:

- Xcode indeed isn’t, but you can use sourcekit-lsp for Swift development with some compromises. The experience has really improved the last few months thanks to the Swift Server Work Group [3].

- Apple platforms have their own Foundation implementation and the open-source one is incomplete.

[1]: https://www.swift.org/source-code/

[2]: https://swiftwasm.org/

[3]: https://www.swift.org/blog/vscode-extension/

comment 3y ago · link · parent

To be fair the grandparent post did not elaborate, but not everyone is locked into doing nothing during their commute.

People using public transport might be able to do all sorts of things like reading or creative work.

That’s of course hard if you need to drive yourself.

But if you are able to make good use of that time one could consider it not lost.

Maybe commute should be clocked in for jobs that don’t rely on physical presence?

comment 3y ago · link · parent

But if you do follow that advice consider if it is worth just using a different escape character for all interpolations. That way could still make use of this very sensible syntax of reusing the escape for interpolation whilst avoiding the backslash issues.

comment 3y ago · link · parent

> I knew they would eventually cave and implement it […]

Let’s see how long it takes until Deno is just NodeJS Mark 2, with little value of adopting it.

Hopefully the answer is never, but considering the type checking changes last year and deprecation of bundle now I have little faith that the features that, at least to me, made Deno a worthwhile improvement over NodeJS will stay.

comment 3y ago · link · parent

Almost a year ago with Deno 1.22 type checking for TypeScript was default disabled. (i.E. you must manually request checking on the CLI, editors still do typechecking as before)

At least in my microcosm of Deno-use the package quality degraded since then with more and more packages having subtle type bugs that could have been caught easily by anyone with checks enabled.

Compared to what was before that is to me a drawback, but of course it depends on whether your bigger priority is to reduce friction.

Apparently `deno bundle` has now been deprecated too, because it couldn’t be used for web bundling and because NodeJS support is hard.

So early adopters that possibly wanted to get away from the web and NPM get punished by these ecosystems now.

Hope my 2 cents answer your question.

comment 3y ago · link · parent

Does every project need to strive for maximum adoption? I guess because Deno is a company the answer is yes.

But I think one of Deno’s initial appeals was “A JS/TS runtime for people that don’t want to deal with JavaScript status quo”. Its accomplishment would have been to be bold and try something different, similar to for example Zig.

comment 3y ago · link · parent

Thanks for clarifying, I did not find anything decisive searching persistent in combination with Clojure, weird.

> Because "tuple" for an immutable sequence is rather specific to Python.

As someone with a background in Swift, Rust and C#, all of which have the concept of a tuple, I did not make that connection, but thanks again.

comment 3y ago · link · parent

> Closure is not a language so hopefully not?

Very true, the typo is strong in this one.

> rather than the persistent data structures you'd expect from a strong clj inspiration

What do you mean by persistent here? I assume some kind of shared memory instead of copying? Or something with more practical implications like deep immutability?

> looks a lot more like a description of Python datatypes

I am surprised where this sentiment comes from. Because of the initial comment? Basically any language nowadays has maps, sequences and byte strings. If I had to draw a similarity to Python it would be something along the lines of first-class generators.

comment 3y ago · link · parent

I'm pretty sure GP meant Closure, considering the language has matching immutable data structures for mutable ones [^1] and even its own (limited) version of EDN called JDN. It’s definitely also inspired by it.

[^1]: https://janet-lang.org/docs/data_structures/index.html

comment 3y ago · link · parent

> We're talking about fingerprinting here.

I think the whole subthread is more mixed in terms of fingerprinting and social interactions. But if you only consider the the former then yes, one would probably only care about what I called "resourceful actors" to which you would end up standing out.

I was more referring to the social aspect, were if you give someone a name they will (usually) not immediately assume it is false. Thus giving a false name does not make you "stand out" unless there is already other information in play. But I'm just clarifying what I meant, considering your point was meant for a different context.

123