HNHacker News
TopNewBestAskShowJobs

laszlokorte

1,199 karma · joined September 10, 2015

submissionscomments
laszlokorte··on Show HN: Fourier Transform Visualized via WebGL
Thanks! I will put the source code on github but actually its just plain html/css/js that has not been preprocessed so the source code can be viewed right in the browser.
laszlokorte··on Show HN: Fourier Transform Visualized via WebGL
Yes, I mean 'time and spectral domain'. The idea of the gif is to represent the two domains orthogonal to each other graphically. The signal in the time domain is a complex function (time->(magnitude,phase)) so it can be plotted in 3 dimensions. The same is true for the spectral domain. So really there are only 2 3d plots. But moving from the time to the signal domain can also be thought of as a 90 degree rotation. In the gif you can see two blue planes are orthogonal to each other. But the gif shows only the 2d magnitude plots of the time domain and spectral domain.

The cuboid embeds a 3d plot of each domain on each of it's side in order to plot the imaginary values as well.

The slicing allows you to select up to two frequencies from the frequency domain and plot the corresponding basis function on the top side of the cuboid. The top side of the cube corresponds to the 3d coordinate system in the gif.

In hope this helps to clarify.

laszlokorte··on Show HN: Fourier Transform Visualized via WebGL
I built this visualization while taking a signal processing course. The goal is to demonstrate the duality between transformations in the time and spectral domain.

For example shifting the signal along the time axis results in a linear phase twist in the spectral domain.

In most textbooks I came across the phase and magnitute are plotted separately and even in digital 3d plots often only one domain at a time is plotted.

Inspired by graphics like this [1] my idea was to plot both time and spectral domains at once onto the sides of a rotating cuboid. So each 90deg rotation of the cuboid represents one fourier transform (... -> s(t) -> S(f) -> s(-t) -> S(-f) -> ...).

[1]: https://mri-q.com/uploads/3/4/5/7/34572113/3311485_orig.gif

laszlokorte··on Facebook plans to change its name as part of company rebrand
They hope one day you will join them... and dont forget to press the like button, subscribe to the channel and hit the bell to get all the notifications
laszlokorte··on Web SQL Database: In Memoriam (2014)
Wouldn't it have been simple/easy to define a facade in front of sqlite as the standard?

Like some basic SQL select/insert/update/create table/drop table syntax and semantics? In a way such that advanced/specific features are not available in order to not be relied on and then let all browsers just use sqlite as implementation detail?

laszlokorte··on Poincaré, Heisenberg, Gödel and the limits of scientific knowledge
„Valid“ does not mean syntactically valid but „true in any case“
laszlokorte··on Kite: An interactive visualization tool for graph theory
On the left side there are some tools for running algorithms on the graph. some are not implemented yet. But for example the "play" icons allows you to run djikstra or topological sort algorithm.
laszlokorte··on Kite: An interactive visualization tool for graph theory
Wow, this looks really nice and reminds me alot of a tool I built myself 2 years ago. [0] The overlap in ideas is really astounding. I really like the way the nodes can be grouped in bags and how each step of running topo-sort or dijkstra is saved as a separate graph.

The way nodes are created by clicking on an existing edge feels almost exactly as in my project and I remember how excited I was coming up with the idea on my own. But obviously this project predates my project by about 2 years.

Really nice work.

[0] https://algorithms.laszlokorte.de

laszlokorte··on Write an SQL query builder in 150 lines of Python
Except if you build a complete query builder as a stored procedure I do not see the problem solved.

Simply stated the problem is: Viewing code as data (in a lisp sense) and transforming arbitrary data into a query that can be executed.

laszlokorte··on Write an SQL query builder in 150 lines of Python
The issue with plain SQL is simply that you can not compose queries at runtime.

For example let user decide which columns to select, in which order to fetch the rows, which table to query etc. Or not even let the user decide but decide based on some config file or the system state.

You end up with a bunch of string manipulation that is fragile and does not compose well.

What solution is there except from simulating SQL via your languages nestable data structures?

laszlokorte··on A catalog of naturally occurring images whose Apple NeuralHash is identical
I agree with you in that I do not understand why anybody doing something illegal would upload related data to a cloud storage.

But if nobody would import CSAM into their icloud library why do all the pictures need to be scanned in the first place? I would imagine anybody doing major illegal stuff being informed about important measures in order to not be caught.

laszlokorte··on C++20 Concepts: The Definitive Guide
One of the major motivations for concepts is to allow better error messages.
laszlokorte··on Exploring Clang/LLVM optimization on programming horror
big O() notation is simply not precise enough (and not meant to be) to be used in such nitpicky discussions. Everything is O(1) for a large anough constant, for example O(live time of the universe).

There are other notations like small o(), Omega(), omega() or theta() to capture the asymtotic runtime behavior more or less precisely.

laszlokorte··on macOS in Svelte
Looks pretty neat but one thing immediatly noticed:

When clicking in in the menu bar to open a menu (for example on the apple logo) and then moving the mouse down, but diagonally in a way that the cursor cross the next to the right menu item (eg finder):

- in this demo the hover triggers the finder menu to open

- on a real map the diagonal down movement prevents that and keeps the current menu open

laszlokorte··on IPv6 Watch
It says the O2 (ISP) has no IPv6 support but as a O2 DSL customer in Germany I have an IPv6 address for at least a few years.
laszlokorte··on Math Problems for children from 5 to 15 (2004) [pdf]
Funny in germany we learn the formular for just that:

Area_triangle = Base_triangle * Height_triangle / 2

/edit: fixed factor of two

laszlokorte··on Apple sued by teen wrongly accused of shoplifting by unreliable facial-rec tech
Like a membership card of some store/club only used for collecting discounts.
laszlokorte··on Open Insulin Foundation
A fun song by Acapella Science featuring the discovery of insulin [0]

[0]: https://www.youtube.com/watch?v=He7X5jGt8lY

laszlokorte··on Against SQL
Could you give a concrete example for such a check constraint? I imagine each shape-table would need to have it's own check to test the existence of the same id in all other shape tables, which scales qudratically.

Or if you inverse the FK to make the user-table reference the shape tables you would need multiple potential nullable columns and a check constrain that exactly one is non-null. And it would still not solve the query side of things.

laszlokorte··on Against SQL
As I said in response to a sibling: But can you can not (in a simple way) prevent that both a circle and a triangle point to the same user and you can not enforce a NOT NULL for a user to must have a favourite shape.
laszlokorte··on Against SQL
But can you can not (in a simple way) prevent that both a circle and a triangle point to the same user and you can not enforce a NOT NULL for a user to must have a favourite shape.
laszlokorte··on Against SQL
Thinking a bit more about it I think this would be a very elegant solution for Tagged-Unions in SQL:

- simply allow tagged unions for foreign key constraints: CONSTRAINT my_fk FOREIGN KEY (own_column) REFERENCES EITHER table_a (a_id) OR table_b (b_id) OR table_c (c_id)

- add join syntax to join via defined foreign key: FROM own_table JOIN VIA my_fk

The union FK would store an additional flag determining the target table and the JOIN VIA would switch on that flag and it would be allowed to use any columns from all target tables in the query but only the matching ones would be not null.

laszlokorte··on Against SQL
But if I have a circle relation and a triangle relation, how do I create a foreign key for the favourite_shape column in my user relation?
laszlokorte··on Data Structure Visualizations
I really like the style of your visualizations!

I built something similar while learning for my algorithms course ate university. [0]

It not fully polished yet and not algorithms I had planned to implement are done yet. But I learned a lot doing it and some algorithms like "rotating calippers" or delaunay triangulation are really fun to watch.

Usage: click the canvas to create nodes, drag from their border to connect them. Click the "algorithms" tab on the top and select an algorithm to run in the right sidebar. The use the slider to step through the result.

[0] https://algorithms.laszlokorte.de

laszlokorte··on SQL Join Types Explained in Visuals
Still does not make sense to me:

OrigTableA = {(ruby, 5), (rust,7), (php, 3)}

OrigTableB = {(red, 5), (black, 7), (purple, 3)}

OrigTableA \cap OrigTableB would be empty, makes no sense

OrigTableA \cup OrigTableB would conain all 6 elements, would be a SQL UNION, makes no sense for join

OrigTableA \times OrigTableB would be the the cross product:

{ ((ruby, 5), (red, 5)), ((ruby, 5), (black, 7)), ((ruby, 5), (purple, 3)), ((rust,7), (red, 5)), ((rust,7), (black, 7)), ((rust,7), (purple, 3)), ((php, 3), (red, 5)), ((php, 3), (black, 7)), ((php, 3), (purple, 3)) }

Yes the cross product is what happens on a cross join (with the nested tuples being flattened) but now you have a single large set of all combinations and the filtering of only matching tuples (eg where the second element each tuple-pair matches) is simply not a binary operation on two sets but a unary operation on the single cross product set. Or if you tink of it as a binary pairing operation on the two original sets it is neither a set-union nor a set-intersection.

laszlokorte··on SQL Join Types Explained in Visuals
Yeah the overlapping circles make absolutely no sense because typically they are used to visualize operations on sets of the same kind resulting in a third set of also the same kind.

But when joining two tables the two base sets are of different type (containing tuples/rows of different length/element type) and the resulting set containes neither tuples from the one nor from the other original set but totally new concatinated tuples combined from the base sets.

It makes absolutely no sense and everytime I see an article explaining joins I just check if it contains those venn-diagrams and if so, just skip it.

laszlokorte··on Hackers breach Electronic Arts, stealing game source code and tools
before you copy my code I own [the only copy] after you steel/copy it I no longer own [the only copy]
laszlokorte··on iOS4 Built in SwiftUI
I agree that ideally the code could be organized a lot better, but think about it like this:

It is the fully working safari UI in only 1000 lines of code. Additionally the declarative approach of SwiftUI together with the type system makes it certainly correct in many ways: no rendering bugs, no invalid states, probably no memory leaks, no cyclic dependencies creeping in.

Try to build this in Java Swing, UIKit, Html/Css/Js or any other UI library. Flutter might come close, react/vue/svelte as well, if you assume sensible predefined components. But they work similar to SwiftUI and the resulting one-file might look pretty similar.

laszlokorte··on French set to replace English as EU’s ‘working language’
Ultimately it will be JavaScript anyway :)
laszlokorte··on WWDC21: Apple Keynote [Live]
It says in the final credits: "no Ipads were harmed in the making of this event." [1]

[1]: https://ipfs.io/ipfs/QmcbGVA8nAYJN1pjXYHjUfrnAJAoCob1vxRvsAH...

← PreviousPage 6 of 12Next →