News for hackers. Stuff that matters.

gituliar

Re:Carbon Language: An experimental successor to C++ on Friday August 01, 2025 @03:42AM (#44754032)
For me Go is a success story.
Re:How-To Calibrate American Options Really Fast in C++ on Tuesday February 27, 2024 @02:55PM (#39528919)
Good observation!

Basically `Error` is an alias to `std::string`. This way code is more meaningful as returning just std::string is too generic.

It's also my convention to report errors as return arguments in this particular codebase, instead of throwing exceptions for example.

Re:Ask HN: Alternatives to the Pomodoro Technique? on Monday February 12, 2024 @03:47PM (#39350258)
> You can totally use both

Definitely, some can use both.

Again, it very much depends on the persona. All I need to be productive is a clear to-do list and no destruction, to focus on my work. No extra techniques, like Pomodoro, is necessary in my case.

Re:Ask HN: Alternatives to the Pomodoro Technique? on Monday February 12, 2024 @02:51PM (#39349487)
I gave pomodoro a try years ago, but failed. It simply doesn't fit my personality, don't like deadlines and time pressure.

Instead, I put my tasks in a Moleskine notebook, mixed with other notes and ideas of mine. In front of each task I put a square box, to be checked when the task is completed in the future. Usually tasks are 1-2 hours long, they are for evenings, longer tasks are for weekends. It's crucial to keep tasks small, no longer than 1 day of work, so split big tasks into small. This is crucial, as abstract tasks lead to procrastination and make you lose focus. The checkbox gives satisfaction when done and remains in the notebook, so that you can see a lot of completed by reviewing your notes.

I use this technique for 3 years now and it works for me. Not sure if it's known by other name as I came to it myself. Hopefully, this can be useful for others as well.

Re:Ask HN: Are tech layoffs happening abroad? on Friday January 12, 2024 @10:10AM (#38968940)
This is because you run your own company. Things are different if one works for a company as an employee.
Re:Ask HN: Are tech layoffs happening abroad? on Thursday January 11, 2024 @05:39PM (#38960441)
At first you pay taxes in the country the company you work for is registered (there might be b2b options, which might differ). Then you pay rest in the country where you have a tax residency.

In your example, at first you pay taxes in Germany and if Estonian taxes are bigger, you pay the difference there.

Re:Ask HN: Are tech layoffs happening abroad? on Thursday January 11, 2024 @05:31PM (#38960346)
In EU since Jul'23 cross-border remote work is free of extra taxes and similar obligation if done up to 50% abroad. One can come to Germany for 3 days and come back to his country to work for 2 days remotely and spend weekend.

More here https://socialsecurity.belgium.be/en/internationally-active/...

Re:Pricing Americans with Finite-Difference on Saturday December 23, 2023 @01:19PM (#38746556)
Real historical data might not cover current market state.

For example, option price among other params depends on the interest rate. For the last decade interest rate was around 0% in Europe and slightly higher in US. If you train on that data only, there is no chance to "learn" option prices in the high-interest-rate environment which we saw for the last few years. Hence, you need synthetic data to learn that region of the market space.

Re:Pricing Americans with Finite-Difference on Saturday December 23, 2023 @04:50AM (#38742964)
Indeed, Andersen-Lake method is much faster, but is limited to vanilla problems.

The finite-difference covers wider range of problems, including stochastic volatility models, like SABR or Heston.

Re:Pricing Americans with Finite-Difference on Saturday December 23, 2023 @04:44AM (#38742935)
Curious to see some references to people doing this. Have any ?
Re:Pricing Americans with Finite-Difference on Saturday December 23, 2023 @04:40AM (#38742919)
You don't need fancy math to study financial modeling, like measure theory. Focus on market dynamic, like in physics try to model that with math and programming. Newton built solid models without advanced math of XX or XIX centuries. Of course, some advanced effects require advanced math, but those are built on top of simple theories, like General Relativity on top of the Newton theory.
Re:Pricing Americans with Finite-Difference on Saturday December 23, 2023 @04:31AM (#38742865)
As already mentioned American / European / Bermuda / Asian options vary by features of option contracts. They don't belong to a particular regulatory regime. For some reason its names are associated to the geo locations. I'm sure there are people who can wrap that in a nice narrative. :)
Re:Moore vs. United States: Tax Unrealized Income Case on Sunday December 10, 2023 @03:16AM (#38590027)
Here in Denmark, both realized and unrealized gains are taxed at the year end. The losses are transferred to next years and deducted from the gains.

This might be an advantage if paying 27% lower-tier tax over the years, rather than being taxed once on cash out and hitting a higher-tier of 42%. However, given the compounding effect, it seems more preferable to accumulate gains and pay higher tax at the very end.

Re:How to convert an enum to string in C++ on Saturday September 30, 2023 @11:02AM (#37716085)
> Your "simple solution" misses the point of the article which is to have the compiler automatically generating the serialized string representation of the enum without a human programmer having to manually code the switch case statements or array lookups and also avoid manually keep the enum & array in sync.

I agree, in some cases automatic generation might save you some typing.

It might be also painful to maintain, as changing a string requires to change a corresponding enum everywhere in the code.

Re:How to convert an enum to string in C++ on Saturday September 30, 2023 @04:13AM (#37713560)
So far, I'm happy with this simple solution:

enum _ : u8 { kMonday, kTuesday, ... kSize };

const std::string toString[kSize] = { "Monday", "Tuesday", ... }

auto day = toString[kTuesday];

Re:Insider trade on Splunk acquisition for 45,650% return on Thursday September 21, 2023 @04:24PM (#37603771)
I'm not sure this is a true story.

Open Interest is 420 contracts, this is a max number of options someone can hold (for that strike and expiry). See the first line on the first screenshot, just below "Historical Volume / OI". Nobody could hold more than that much contract.

Re:Insider trade on Splunk acquisition for 45,650% return on Thursday September 21, 2023 @04:14PM (#37603634)
Can anyone confirm this unusual volume (to ensure this is not a clickbait) ?

The option chain I have shows regular volume, with open interest to be ~420 contracts.

Re:C++ Papercuts on Monday August 28, 2023 @09:34AM (#37293708)
> Unfortunately, I am all too well aware of why these decisions were made, and it is exactly one reason: Compatibility with legacy code. C++ has no editions system, no way to deprecate core language features.

Actually, I'm curious if somebody is working on a flavor of the modern C++ that abandons backward compatibility ?

The Carbon project feels like a completely new language. What I'd expect instead is something that adopts best features and practices from modern C++, so that an average C++ project would require just minor changes to migrate, in spirit of Python 2 -> 3 migration.

Re:Tmux has forever changed the way I write code [video] on Friday August 18, 2023 @06:35AM (#37173771)
I am verry happy with `screen` which I use for ~10 years.

Hear about `tmux` here and there, but so far not sure about the benefits. Any particular reason it's better over `screen` ?

Is it also the case for floating point data?

I know about fast_float (which is by the same author as simdjson), however my believe is that binary format is impossible to beat here.

Re:I got hacked and Facebook banned me on Wednesday June 01, 2022 @09:12AM (#31581326)
Exactly the same attack happened with me about a month ago, also with expired domain name and recovery email associated with it. Fortunately I also had an active phone number assigned, which I believe ruined hacker’s attempt.

Funny facts:

- the domain was registered at the same date as attack happened

- attack happened from Hamburg IP and Android phone. This data was in my reset email from FB. This was true when I stopped using FB 5+ years ago.

- domain registration costs money, hence success rate of such attacks should be rather high

- since I stopped renewing this domain, it was registered by one more entity. According to archive.org with just some ads.

Take care folks, remember about your expired domains.

Great post, thanks for sharing your experience.

Could you also share what is you strategy for marketing and acquiring new users ?

My guess: https hits HAProxy from external world, afterwards all is just http. There is no need to encrypt internal trafic.
Absolutely agree.

Exercises are the key for learning. Like with riding a bicycle -- you learn by trying not reading or watching. Composing an exercise section is hard, so thoughtful books usually have one.

Also, I'd pick just one book for a subject and stick to it, pick it carefully to fit your style and language.

The story is managable as long as we use local operations, like read/write a value. Once we need iterators (read "aggregate operations") life becomes tough. In this case only copy-on-write strategy seem to work, doesn't it ?

Older »