Better HN
topnewbestaskshowjobs
Log inSign up

t0mek

685 karma · joined Feb 27, 2016 (10y ago) · 96 submissions

Site: tomek.rekawek.eu Blog: blog.rekawek.eu
Submissions

comment 6d ago · link · parent

In "Empire of AI", the author mentions that when OpenAI included public GitHub repositories in its training data, the resulting model achieved better results even in fields unrelated to programming.

Aside from the obvious applications in biochemistry, could protein sequences also be used as a new training data source to improve overall model quality? If that's true, it's quite fascinating that we can take highly complex data we don't fully understand and use it to improve LLM training, simply because it contains so many significant structures and relationships.

comment 3w ago · link · parent

I think with the AI it's not only question about following the spec, but about the completness of the spec. Before the AI, if specification wasn't complete, then program would lack of a feature, won't start correctly or crash. Nowadays, agents will happily fill any missing specification parts with random stuff, often looking reasonable at the first glance. This random content can be different with every iteration of the LLM work.

To find the right position in this spectrum, I think we need to find a level of specification that we care about.

comment 3w ago · link · parent

> We must take the same attitude in computing: use abstractions, refactor, refine scope, invent and adopt higher-level languages, until we can hold the code in our head.

I want to believe this is true. But as an counterexample, do we need to hold machine code or assembly, generated from our C or Golang programs, in our heads? Or rather the Golang code is a high-level abstraction which is good enough?

If that's the case, does it mean we should go even further and treat design docs as the code suitable to hold in head and treat Golang program as a derivative? Or maybe design docs are also too low-level and the general vibe "create me an app, make no mistakes" is actually enough?

What's the right abstraction level? How to find it?

comment 1mo ago · link · parent

I assume you're talking about the Atari 2600 console (VCS), which uses a limited version of that CPU, called 6507. It has the addressing space reduced to 16 KB.

This machine indeed has 128 bytes of RAM, but the code and data live on the cartridges, which can include up to 64 KB of ROM (exposing 4 KB at a time, with bank switching). Also, graphics is created on the fly ("racing the beam") at TV display, so there's no need to spend precious RAM on the framebuffer.

In comparison to the later constructions based on the 6502, like NES or C64, it was certainly not an easy platform to develop games, but not as hard as your comment is suggesting.

comment 3mo ago · link · parent

I used the "FX" option and I think there's a bug. The center tiles on each side always stay in the same position.

comment 6mo ago · link · parent

I like the "challenges" part at the end, especially the varying difficulty levels:

* A quadratic formula program, which outputs the number of roots and the x-intercepts upon the user inputting the values of A, B, and C.

* A fighting game, with health, a store, different enemies, weapons, armor, etc, with graphics and animation.

comment 8mo ago · link · parent

Only tangentially related (but hey, it's HN) - I'm so happy about the support/requirements for trailing commas in the modern language syntax:

    x = [
      123,
      456,
      789,
    ];
It makes editing such a list so much easier. Also, the commit diffs are cleaner (you don't need to add comma to the last element when appending a new one).

8.

Building a multiplayer Gameboy emulator with rollback netplay(blog.rekawek.eu ↗)

1 points · by t0mek · 1y ago · discuss

9.

Show HN: Rollback netplay for Game Boy emulator(blog.rekawek.eu ↗)

2 points · by t0mek · 1y ago · discuss

comment 1y ago · link · parent

Not a tutorial per-se, but here are 2 slides describing how I've done it:

https://www.slideshare.net/slideshow/emulating-game-boy-in-j...

Essentially, there are 4 channels, each providing a number 0-15 on every tick. Emulator should mix them together (arithmetic average), scale up to 0-255 and feed to the sound buffer, adjusting the tick rate (4.19MHz) to the sound output rate (e.g.: 22 kHz) - taking every ~190 value (4.19MHz / 22 kHz) is a good start.

Now the 0..15 value that should be produced by each channel depends on its characteristics, but it's well documented:

https://gbdev.gg8.se/wiki/articles/Gameboy_sound_hardware

Channels 1 and 2 produce square waves, so a bunch of low (0) and high (15) values, with optional volume envelope (gradually going down from 15 to 0 on the "high" part of the square) and frequency sweep (alternating 0s and 15s slower or faster).

Channel 3 allows an arbitrary waveform, read from the memory.

Channel 4 is a random noise, generated by the LSFR.

See SoundModeX.java for the reference:

https://github.com/trekawek/coffee-gb/tree/master/src/main/j...

comment 1y ago · link · parent

Famous example from the pop-culture is Burr vs Hamilton:

> If you stand for nothing, Burr, what'll you fall for?

comment 1y ago · link · parent

The article doesn't mention the recent development in Amiga extension cards - PiStorm is an easy (and affordable) way to max out the specs of any Amiga, A600 included.

comment 1y ago · link · parent

I've always seen A600 more like a budget version of A1200 rather than a new variant of A500: better graphics chip, IDE port, PCMCIA and new look-and-feel of the Workbench 2.04 (at the first sight hardly distinguishable from the Workbench 3.0) gave a taste of something new.

comment 1y ago · link · parent

12 years ago, when we already had Arduino but no ESP32 yet, I built this thing:

https://newton-net-pl.translate.goog/2012/01/robot/?_x_tr_sl...

It was made of an old HTC Magic phone, acting as camera+wifi transmitter, connected to Arduino via its serial port and level shifter, to control the servo and a RGB LED. I had a lot of fan with that, even if the connection wasn't really to stable.

Thanks for sharing, maybe it's time to revive the project with the next generation of the microcontroller.

comment 1y ago · link · parent

Yes, the liar have some hats. There are two ways how to conclude this:

1. If they don't have any hats, then any sentence about them would be truth.

2. The negation of the sentence, which must be truth, is "not all my hats are green". For this to be true, there must be some hats that are not green, so there must be some hats in general.

comment 2y ago · link · parent

Programming a chess program was an important challenge for the "first generation of hackers" working on the mainframe machines like TX-0 and PDP-1 in '50 and '60, as described in "Hackers: Heroes of the Computer Revolution" by Steven Levy. I highly recommend this book, I think a lot of people here can recognize their own passion and interests in the stories described there.

Also, there's interesting implementation for the ZX-81, created over 20 years later and fitting in just 1024 bytes: https://users.ox.ac.uk/~uzdm0006/scans/1kchess/

comment 2y ago · link · parent

I love the slow pace of the video, including a few minutes presentation of all available programs. And indeed, there are programs to test dice and coin bias:

* https://youtu.be/bJiOia5PoGE?si=IEhbNJk0C0-7_2Nj&t=229

* https://youtu.be/bJiOia5PoGE?si=3Se3lYFVAAkElx0w&t=245

comment 2y ago · link · parent

We can also assume that the p/q=√2 is already the simplest form of the fraction, since every fraction must have one, as in the first section of the article.

Then if we figure out that both p and q are even, it means that p/q can be simplified (by dividing p and q by 2), which contradicts the assumption about the simplest form - and we don't need to use the infinite descent.

comment 2y ago · link · parent

Similar, but in Haskell: https://github.com/DataKinds/sixty-five-oh-two

It's a DSL for writing 6502 assembly.

comment 2y ago · link · parent

A few years ago, I spent a fair share of time trying to copy files from and to a Macintosh Plus. I decided to use a 100 MB ZIP drive (actually two of them, SCSI for the Mac Plus and USB for a modern computer) and later a serial port connection with terminal software [1].

Now there's a much better and cheaper option: BlueSCSI [2]. It's a SCSI HDD emulator that allows to mount .img files stored on a SD card as HDD disks. It also supports CD and network card emulation.

Once the files are copied on a such a virtual drive, they can be extracted on a modern machine using via some kind of HFS explorer or an emulator.

[1] https://blog.rekawek.eu/2016/12/08/mac-plus#hard-drive

[2] https://bluescsi.com/

comment 2y ago · link · parent

And if you have even older Mac (128/512/Plus) and want to use an almost modern PS/2 keyboard with it, please check my https://github.com/trekawek/mac-plus-ps2

comment 2y ago · link · parent

Same with Dell P3223QE.

comment 2y ago · link · parent

I remember having similar effects after long sessions of Lemmings. I saw the damn rodents when I was closing my eyes in bed, but it didn’t disturb my sleep (I guess they acted as sheeps to count).

comment 2y ago · link · parent

Trivia: this one was created by Adrian Zandberg, currently a Polish MP.

comment 2y ago · link · parent

This is similar to Kotlin single-expression functions, which are actually pretty useful:

    fun double(x: Int) = x * 2
https://kotlinlang.org/docs/functions.html#single-expression...

However, in Kotlin there's no single-line constraint, so it's possible to define an expression function e.g. with a long chain of collection methods: `filter().map().findFirst()...`

comment 3y ago · link · parent

The results are correct, but the explanation is wrong, e.g.:

    By using our Celsius to Fahrenheit conversion tool, you know that one Celsius is equivalent to 33.8
    1000 C = 1000 x 33.8 = 1832 F
Probably the explanation engine doesn't support the offset in the underlying linear formula.

comment 3y ago · link · parent

Hey,

  SBC:
    result = byte1 - byte2 - carry
    carry = result < 0
    return result & 0xff

  ADC:
    result = byte1 + byte2 + carry
    carry = result > 0xff
    return result & 0xff
Source - my implementation, passes tests. Look for SBC & ADC in https://github.com/trekawek/coffee-gb/blob/master/src/main/j...

comment 3y ago · link · parent

Procedural generation was also used to generate levels in the Pitfall game for Atari 2600. A single level was represented with a byte (!) and bits were controlling the number of rolling logs, holes, etc. There were 255 levels there and LFSR was used to go from one level to another, so the actual level bytes wasn't even stored in the ROM.

For more details and screenshots see this great blog post: https://evoniuk.github.io/posts/pitfall.html

comment 3y ago · link · parent

Archived version of the original Mastodon post: https://archive.is/fM06z

comment 3y ago · link · parent

https://aqi.eco/

Open-source, crowd-sourced air quality page. I’m running it for 3 years now. Owners of private air quality detectors can use it to built micro-communities in their neighbourhoods. Eg. organization registered at https://mosina.aqi.eco installed dozens of sensors in their home town and is advocating for improving the air quality there.

Around 13k unique users and 40k sessions per month. Cost is about $35 for VMs and storage on DigitalOcean.

1234