HNHacker News
TopNewBestAskShowJobs

gituliar

67 karma · joined January 25, 2011

Iblog about programming and quantitative finance at https://tastycode.dev
submissionscomments
gituliar··on Carbon Language: An experimental successor to C++
For me Go is a success story.
gituliar··on How-To Calibrate American Options Really Fast in C++
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.

gituliar··on Ask HN: Alternatives to the Pomodoro technique?
> 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.

gituliar··on Ask HN: Alternatives to the Pomodoro technique?
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.

gituliar··on Ask HN: Are tech layoffs happening abroad?
This is because you run your own company. Things are different if one works for a company as an employee.
gituliar··on Ask HN: Are tech layoffs happening abroad?
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.

gituliar··on Ask HN: Are tech layoffs happening abroad?
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/...

gituliar··on Pricing Americans with finite-difference
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.

gituliar··on Pricing Americans with finite-difference
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.

gituliar··on Pricing Americans with finite-difference
Curious to see some references to people doing this. Have any ?
gituliar··on Pricing Americans with finite-difference
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.
gituliar··on Pricing Americans with finite-difference
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. :)
gituliar··on Moore vs. United States: Tax Unrealized Income Case
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.

gituliar··on How to convert an enum to string in C++
> 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.

gituliar··on How to convert an enum to string in C++
So far, I'm happy with this simple solution:

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

  constexpr const char* toString[kSize] = {
    "Monday",
    "Tuesday",
    ...
  }

  auto day = toString[kTuesday];
Edit: For `constexpr` replace `std::string` with `const char *`.
gituliar··on Insider trade on Splunk acquisition?
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.

Edit: The total contracts is 127, so it gives 127 x $18 x 100 ~ $230'000 profit. (Seems like the post on Twitter is missing x10 factor.)

gituliar··on Insider trade on Splunk acquisition?
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.

gituliar··on C++ Papercuts
> 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.

gituliar··on Tmux has forever changed the way I write code [video]
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` ?

gituliar··on Show HN: Faster FastAPI with simdjson and io_uring on Linux 5.19
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.

gituliar··on I got hacked and Facebook banned me
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.

gituliar··on What One-person SaaS Healthchecks.io uses for hosting, hardware and software
Great post, thanks for sharing your experience.

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

gituliar··on What One-person SaaS Healthchecks.io uses for hosting, hardware and software
My guess: https hits HAProxy from external world, afterwards all is just http. There is no need to encrypt internal trafic.
gituliar··on Ask HN: Serious mathematics books that can replace a good teacher?
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.

gituliar··on Safety and Performance – Threadsafe Datastructures in C++
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 ?
gituliar··on Ask HN: 6-hour workdays more important than 4-day workweeks IMO
Given that we have a limited number of productive hours per day, say 3-4, the overall performance is better with 5-day workweek. Add 2-3 hours of tuning your mind, meetings, emails, etc. Which gives 5-7 hours. In line with what you said.

So, next time you negotiate a raise with you manager, ask for less hours instead of more $$$.

gituliar··on Ask HN: Lenovo laptop with decent 4K support
My ThinkPad P14s Gen1 has 10th Gen i7 with Intel UHD GPU, which is 2x slower than Iris Xe.

I do not play either. Most noticeable lags I have are 4K youtube videos. Is it OK for you ?

gituliar··on Modern JavaScript Tutorial
Avoiding smart pointers for those reasons is a bad idea.

Smart pointers are unified since C++11 standard with support in all modern compilers for various platform. Invest some time to get familiar with them and you will not regret.

gituliar··on Sci-Hub: Public access to research papers
That is right, researchers are paid by the universities. BUT, to be hired researchers need a strong list of publications in peer-reviewed journals. This is usually the most influential factor for ranking. For this reasons some journals charge fees for publishing your paper, not saying about being paid.
gituliar··on Diet that mimics fasting appears to slow aging
What 5:2 stands for: 2 days of fasting per week? If so, what days do you fast at?
Page 1 of 2Next →