News for hackers. Stuff that matters.

tmpfile

Re:SQLite should have (Rust-style) editions on Thursday July 16, 2026 @12:33AM (#48930380)
I should have been more clear, I meant a sqlite.conf can configure a program rather than have it apply globally. For example, a config file placed in same directory as its .wal file to tune it for specific instances. That way you don’t need to lookup what “editions” apply which pragmas or settings. With sqlite.conf you can tune your specific database connections by uncommenting the default settings to enable current features/best practices
Re:SQLite should have (Rust-style) editions on Wednesday July 15, 2026 @10:48PM (#48929829)
Why not a .conf file like everything in /etc or postgresql.conf?
> 2. Those people and many more besides have no idea what "add it to home page" even means.

If Apple supported the beforeinstallprompt event (available in Chrome since 2015) then people would have same experience as installing app [0]. Instead, you must create a wrapper around webpage and submit thru App Store.

[0] https://developer.mozilla.org/en-US/docs/Web/API/Window/befo...

Re:Temporal: The 9-Year Journey to Fix Time in JavaScript on Wednesday March 11, 2026 @06:51PM (#47343469)
I’d like to have interval types for example

   const D = new Temporal()
   const t = new Interval({minutes:5})
   const v = D.add(t)
Re:Temporal: The 9-Year Journey to Fix Time in JavaScript on Wednesday March 11, 2026 @06:48PM (#47343430)
Or const now = new Temporal();
If you find your compiles are slow, I found a bug in vscode where builds would compile significantly faster when the status bar and panel are hidden. Compiles that took 20s would take 4s with those panels hidden.

https://github.com/microsoft/vscode/issues/160118

You could write a pl/pgsql function that does that mapping for you. For example, insert into table values (intern(str), …) where intern returns the intern_id from your strings table.
Re:Joins 13 Ways on Tuesday July 04, 2023 @12:37AM (#36582291)
Great article. Side note: his normalization example reminded me how I used to design tables using a numeric primary key thinking they were more performant than strings. But then I’d have a meaningless id which required a join to get the unique value I actually wanted. One day I realized I could use the same unique key in both tables and save a join.

Simple realization. Big payoff

You:

> You may be surprised to know that, when doing a "conventional" CC transaction, you are most certainly not giving any stranger information that would allow them to perform a transaction in your name on another merchant.

How do you know as a client the merchant doesn’t have a skimmer embedded in their payment page? Or that they don’t post directly to their servers (whether accidentally or not)? Are the PCI police going to catch them? Maybe they want to store cards to process later and don’t know or care about pci.

The problem is using the same details for every transaction in a loosely authorized way.

In a perfect world the merchant won’t have access to the card details (like with one-time payments) and everything would go thru a provider with a preauthorized payment. But we don’t live in that world right now.

I’m not sure what you’re replying to?

He says:

> You shouldn't share a secret that someone else could use to generate payments. You should share some type of payload that is only valid for the payment you're making.

He’s advocating for a more secure one-time way of making a payment.

It would be more secure since it’s one-time and could not be reused even if the merchant didn’t use a pci compliant design

You’re arguing that using a PCI compliant PSP solves the problem of credit card number harvesting, but that’s not correct unless the entire transaction takes place on the psp (like PayPal). Once the payment details are collected in environments outside the psp’s control, it’s not protected. For example, payment info could be skimmed by devs with access to payment pages using js like in the NewEgg Magecart attack
> You may be surprised to know that, when doing a "conventional" CC transaction, you are most certainly not giving any stranger information that would allow them to perform a transaction in your name on another merchant.

No. In best case, you’re giving your payment details to a PSP. A couple years ago NewEgg had a javascript skimmer on their checkout page that harvested all their customers payment details for months. Obviously anyone with access and intent could do the same for any payment page.

Re:SQLite the only database you will ever need in most cases on Friday February 17, 2023 @01:35AM (#34831544)
The output is apples and oranges tho. Since I was downvoted by someone I'll added a simple example to show the difference between the two interfaces. I shouldn't have assumed anyone here was familiar with the respective representations.

Sample data:

    CREATE TABLE users (user_id serial, name text);
    CREATE TABLE comments (comment_id serial, user_id int, comment text unique);
    CREATE VIEW user_comment_view as select u.user_id, u.name, c.comment from users u, comments c where u.user_id = c.user_id;
    INSERT INTO users VALUES (1, 'Bob');
    INSERT INTO users VALUES (2, 'Sally');
SQLITE3 OUTPUT

    sqlite> .schema
    CREATE TABLE users (user_id serial, name text);
    CREATE TABLE comments (comment_id serial, user_id int, comment text unique);
    CREATE VIEW user_comment_view as select u.user_id, u.name, c.comment from users u, comments c where u.user_id = c.user_id
    /* user_comment_view(user_id,comment) */;


    sqlite> .schema users
    CREATE TABLE users (user_id serial, name text);


    sqlite> select * from users;
    1|Bob
    2|Sally

POSTGRESQL OUTPUT

    test=# \d
                    List of relations
     Schema |          Name           |   Type   |  Owner   
    --------+-------------------------+----------+----------
     public | comments                | table    | postgres
     public | comments_comment_id_seq | sequence | postgres
     public | user_comment_view       | view     | postgres
     public | users                   | table    | postgres
     public | users_user_id_seq       | sequence | postgres
    (5 rows)


    test=# \d users
                                Table "public.users"
     Column  |  Type   | Collation | Nullable |                Default                 
    ---------+---------+-----------+----------+----------------------------------------
     user_id | integer |           | not null | nextval('users_user_id_seq'::regclass)
     name    | text    |           |          | 


    test=# select * from users;
     user_id | name  
    ---------+-------
           1 | Bob
           2 | Sally
    (2 rows)

Postgres also supports adding + to commands to get additional extended information, eg, \d+. You can also filter by tables (\dt), filter by views (\dv), filter by functions (\df), etc. It's allows much more natural enumeration of the DB which I wish sqlite had as well.
* * *
* * *
Re:SQLite the only database you will ever need in most cases on Wednesday February 15, 2023 @10:07PM (#34814494)
I wish sqlite made their terminal interface a bit more robust or emulated psql’s interface. Simple things like \d tablename would be great.
Re:Is TypeScript actually worth It? on Friday January 13, 2023 @03:23PM (#34373383)
That's fair. It appears his issue is more related to libraries with broken, undocumented types and typescript's opaque errors when an error occurs in said library. Unfortunately I think he's conflating typescript's role and a library with broken type definitions (I have no idea whether the type definitions he's had problems with are provided by the library or a community effort that may not keep pace with the official library). When the type definitions don't match the official library it can definitely cause a tremendous amount of frustration and make one doubt the usefulness of types.
Re:Is TypeScript actually worth It? on Friday January 13, 2023 @12:07AM (#34364174)
> Is Typescript worth it? > I want to skip over the static typing benefits argument…

Typescript, as the name implies, adds types to your script. If you don’t see the benefits of types then typescript may not be for you.

> My issue is with the amount of extra work it places on developers… and doesn't deliver all that much value.

If you think adding types doesn't add much value then typescript may not be for you. In my experience, types are defined once then provide a lifetime of value.

> you are at the whim of TypeScript developers and how they decide to progress with the language.

This is true of any library, programming language, operating system, hardware, etc. But adding types isn’t somewhere I’d worry about backward compatibility being broken. All the newer versions of typescript are backward compatible. If you have a library that requires a newer version of ts then upgrading ts won’t break anything dependent on earlier versions.

Pet peeve: would be nice if they offered a Chapter View or Single Page View or PDF of their documentation.
Re:SimulaVR Has Been Subpoenaed by Meta Platforms, Inc on Thursday October 06, 2022 @01:16PM (#33111074)
Couldn't SimulaVR request all the same documents from Meta in response? Or is it a one-way process?

I'm sure Meta's legal team would find reasons why they wouldn't have to be responsive or other ways narrow the scope. SimulaVR in turn could use the same arguments against Meta.

Nope. It's only compiling relevant files. Nothing is output during the build. Can you confirm faster builds with the panel hidden too?
Wanted to add a little more detail and make the link accessible [0] which also shows the output from --extendedDiagnostics. The Panel is the window where the output from a build is shown [1]. It is displayed automatically on build. It's visibility can be toggled with CTRL+J (I'm on Linux) or from View > Appearance > Panel. When it's hidden the build is x5 faster with no other changes.

Wondering if anyone else can confirm faster builds with it hidden?

[0] https://github.com/microsoft/vscode/issues/160118

[1] https://code.visualstudio.com/docs/editor/tasks

Ask HN: Compiling VSCode project substantially faster with Panel closed

I recently noticed that my project builds substantially faster with the Panel closed (CTRL+J). It opens automatically on build and I closed it the other day and noticed a huge performance increase. I pretty much use default tsconfig.json configuration. Wondering if anyone else can recreate?Timing with panel open: 19.86s Timing with panel closed: 4.60sI filed an issue at...

( Read More... | 6 comments | 16 points | on HN )
Re:Ask HN: What developer tools would you like to see? on Wednesday May 25, 2022 @01:03AM (#31500798)
For #2 you can hold CTRL when hovering over a type to expand the type definition. If you hold CTRL+click it will go to the definition.
It's cool they use the same source so it's always the current version. I always assume projects like these aren't current or are several versions behind.
Definitely. Settings that have the perception of "streaming a video feed of your entire desktop" should be treated with more care.
> make it clear and easy to disable for those who care

Exactly. Telemetry can be a useful like you said and should be clear to users when they are being opted into it. Especially if someone has disabled all telemetry, they should be prompted to enable it or configure it with the new settings. If you silently re-enable it on their device when they already went thru the trouble of disabling it (and not expecting the settings to change day-to-day), you'll get some knee-jerk assumptions and reactions, whether your intentions where noble or not.

Older »