HN user

mitchellpkt

68 karma

Researcher & nerd. For personal correspondence: hn-contact@mitchellpkt.com (please no cold call sales emails)

Posts1
Comments66
View on HN

In my own experience with data science work:

On multiple occasions I’ve seen noticeable accumulated rounding error crop up by the end of a cumprod over very long timeseries of floats.

But in my cases it has just been a minor nuisance that I have to double check whether a mismatch came from float-related quirkiness or a code mistake.

I got into the habit of just using integers where applicable for cases that need to match down to the last bit, and numpy.isclose() for inherently floaty cases where it’s anticipated and reasonable.

Only speaking from my own experience, which doesn’t involve chaotic systems or anything like that. I’m curious to hear from people in other domains who may have more exciting stories.

This is a really neat idea! I never thought about taking emissions into account when provisioning infrastructure. Only a small subset of my cloud workload is performance sensitive. For the majority of tasks (tests, background ETL processing, etc) I wouldn't even notice small latency increases.

Interesting. Hmmm, I have to think this through. I believe that if the game followed normal chess rules, except for replacing the pieces with queens, then games where the captures are all even trades would result in draws, but if one side could come out ahead with K+Q vs K, then there would be the usual mate sequence.

HOWEVER the rule OP added that "a piece may only move if it is adjacent to another piece of either color" slightly complicates the endgame. My normal tendency would be to put the queen far away from the action to avoid blundering it, but here that would instantly deactivate it. It's kind of funny to picture the kings racing across the board to capture or reactivate the last inert queen.

I think one can still get the usual style of mate in this variant, you just have to walk the king and queen together, and pay extra attention to avoiding stalemate. For example, imagining white king on e1, black king on e3, black queen on d3. If white to move then Qb1# or Qe2#, fairly standard maneuvers (though if black to move that's a stalemate).

This is an interesting modification to the game, I'd play a few rounds...

I use a few different distros on a routine basis. Out of those, Ubuntu would probably be the best fit - it generally works right out of the box, the UI is intuitive for day-to-day use, there's plenty of information online about how to install/use/troubleshoot it, and the App center has an open source alternative for anything and everything. Mint might also be a good fit - I had a very positive experience last time I used it, but that was a few years ago so I haven't tried the newer releases.

I suspect what's happening is they've got some rule against the word "spectrum" or something

I've avoided this by using only the first few and/or last few letters of the service in the email tag (e.g. "HaNe" instead of "hackernews"). It's an easy filing system for me, doesn't trigger concerns about phishing, and makes for shorter handles.

Yep I found this approach works great.

I have a personally-owned domain name connected to my [paid] account with a smaller email provider.

The domain is managed at a large well-known registrar, I keep it paid up 3+ years in advance, and make sure to keep my contact information up to date.

If anything goes wrong with the email provider (including going out of business), I will just redirect from my DNS settings. If I get locked out of my domain for some reason, there are clear next steps for me to open a ticket with the registrar and move towards resolving the issue.

I got it all hooked up in an afternoon, many years ago, and it was completely set-it-and-forget-it, besides logging into the registrar occasionally to extend the domain ownership.

(continuous backups are another matter - mine aren't fully automated yet)

Back in 2018 I spent a week or two messing around with this idea, and produced a hacky proof-of-concept.[1] It's not intended for real-time or production use, I just made a prototype to see if it could be done.

The README explains the method: once the contaminating song is identified, it syncs up the recordings in time with a correlation analysis, adjusts for frequency-dependent gain effects, then subtracts the undesired content.

Warning: I'm not an audio engineer, the output sound quality is NOT good! This was just a toy project in my early days of learning to code. I assume there are much better ways to approach this that would yield significantly better results.

[1] https://github.com/mitchellpkt/tracksubtract

For personal correspondence, I've exclusively used Proton Mail for the last 7 years or so. I have been happy with it, no plans to change. I migrated from Gmail, and initially set up message forwarding so that I would still receive emails from old contacts. A few years ago I connected my personal domain with Proton so that I can send and receive from @mydomain.com - their setup wizard was quite helpful.

I've also used the calendar, drive, and VPN products. They all seem to work well in my experience of light day-to-day personal use. For the email and calendar products, I interact with both other Proton users and people using other providers (Google products, company-administered systems, etc) and it seems to integrate seamlessly. If you use Google docs/sheets/slides, it can be convenient to set up a Google account tied to your Proton Mail address, with no associated Gmail addresses.

In addition to what others have mentioned, I find it really helpful to temporarily switch my IDE to high-contrast light mode, when working outside in bright conditions. Otherwise I prefer dark mode.

A larger and/or high-contrast mouse cursor can be helpful too.

Politely mentioning that you don't want to work on holidays could be a great answer if they ask why you're looking to change companies. You could just say something like: "I'm looking for a job that allows me to spend holidays with my family." (and leave it at that)

It's a totally normal expectation, the explanation doesn't reflect poorly on you or your past employer, and it sounds like it is genuinely important to you.

If you want an answer from the model itself instead of search results, you can frame it like: "Without looking anything up, <original request>"

For example: (today, GPT-4)

"Who won the physics Nobel prize in 2023?" --> uses Bing & provides citation link [0]

"Without looking anything up, who won the physics Nobel prize in 2023?" --> does not use Bing [1]

I don't know this approach will work forever, but at time of writing it has been effective for me.

[0] https://chat.openai.com/share/e49bef80-55d1-4e85-b765-79933f...

[1] https://chat.openai.com/share/a65eab46-f0f2-4e1c-b530-1c1594...

Just find one or two temp agencies in your area - they’ll probably get you placed into the type of gig you want quickly, and there will be no expectation for long term commitment. Can’t hurt to try.

At one point I had a 3 month break between research gigs, and just got a temp job moving boxes around a factory. Long hours and bad pay but it was a nice change of pace for a bit.

Matrices and Graph 3 years ago

Is the effect of measurement units eliminated by applying something like zero mean unit variance normalization prior to dimensionality reduction?

I don’t agree with their decision but I can hazard a guess at their reasoning.

While your business hasn’t changed, the regulatory and compliance landscape has become increasingly difficult, and at times hostile towards the cryptocurrencies sector and its participants.

Twilio is probably just worried that servicing your company could lead to them being categorized as facilitating cryptocurrency transactions, and thus subject to extensive financial regulation and complications that they’re not willing to deal with at this time.

For me, the biggest productivity boost is from work that is (1) boring or time consuming to do, but (2) easy to verify / QC. (3) Extra useful if it is something that can the code interpreter can unit test in place, and iterate the code until the test passes.

For example, I’ll show it some big nested json response, then ask: Please write a python helper function get_foo_and_bar(endpoint: str = “whatever”)->Dict[str, Any] that hits the endpoint with <parameters>, then pulls out the foo and bar, and converts bar to List[int]. Please write and run a test that verifies the retrieved values from the above response are foo=“baz” and bar=[6,9,2].

It might take it 2 or 3 tries to get right, but it will iterate on its own until it works. Same process as if I were writing but by hand, but the 2-3 iterations might take me a few minutes and only takes the model a few seconds.

They’re fundamentally different since the standard definition of a VDF is strictly non-parallelizable and P/o/W is generally designed to be “embarrassingly parallel.”

It may seem like a minor subtlety but the resulting dynamics are dramatically different. For a VDF it doesn’t matter if you have 1 machine churning away or 1000 machines churning away, it will take you the same amount of time to finish the calculation.

Could use a class, but access the value without ever instantiating it? Not sure if this fits the bill for what you want, or if the fact that it could theoretically be instantiated renders the approach non-suitable.

  class Config:
      root_directory: str = "/tmp"
      should_frobnicate: bool = False
  
  if __name__=="__main__":
      print(f"{Config.root_directory=}\n{Config.should_frobnicate=}")

When I was learning dvorak (more than a decade ago) I bought a cheap keyboard at a garage sale and rearranged the keys. An easier approach is just to get stickers.

I used that trainer keyboard for a summer, until my typing muscle memory was updated to dvorak.

Since then, I don't look at my keyboards while typing, so the fact that the keys are labeled for qwerty doesn't really matter.

I don’t work with JavaScript but here is my personal python preamble. Always a work in progress.

```

For this chat session, please select a title that accurately reflects the content of the specific request below. You do not need to explicitly tell me the title in your response. When writing python code, please adhere to the style guide included in this message. Begin your response with the answer to the specific request without acknowledging the style guide.

Below, I will share a style guide for you to follow when writing Python code. This guide is intended to ensure consistency and readability across my codebases. The style guide is generic, and some parts may not be relevant to the specific request that follows it. Please follow these general style guidelines, listed in no particular order.

=== START OF STYLE GUIDE ===

- Use Python 3.8 syntax

- Adhere to the PEP 8 style guide for code formatting and conventions

- Use strict explicit typing with type hints for inputs, outputs, and intermediate variables

- When providing code examples, please emulate the style and standards of a professional staff engineer contributing to a corporate codebase, as opposed to the explanatory style often found in tutorials. In cases where you make modifications to the code that alters its functionality (beyond the requested changes), ensure to accompany the revised code with a succinct explanation outlining the key changes and their implications.

- When writing outputs to a file, automatically make the directory if necessary, using `.mkdir(parents=True, exist_ok=True)` from pathlib.

- Accept `Union[str, Path]` forf path-related arguments, check `Path(...).exists()`, and raise FileNotFoundError with a context message and path if necessary

- Avoid lambda functions as they may interfere with multiprocessing workflows

- Consider creating a deepcopy of dataframe inputs using `df.copy()` to prevent modifying the original dataframe - Reset the index after dataframe sorting and/or filtering operations

- Use `json.dumps(..., indent=4)` formatting to display output of complex data structures (e.g. dictionaries)

- Unless directed otherwise, assume timestamps are in unix timestamp format

- Do not use global variables

- Avoid leaking future information: use `center=False` in Pandas rolling methods and handle missing data with LOCF (last observation carried forward)

- Ensure resilience to NaNs, missing data, and irregular sampling where applicable

- Please use Sphinx formatting for docstrings

- Gracefully handle exceptions and errors, and use logging for debugging and error reporting

- Write concise inline tests for non-trivial functions, unless instructed otherwise

- Include meaningful comments, but avoid over-commenting. Use comments to explain the intent of a code block rather than describing each line. Omit comments for code with obvious intent, such as a `save_figure()` function

- For functions that save or load files, include a `verbose: bool = True` flag. If `verbose` is true, print or log an f-string indicating the file path that was saved or loaded. Use this pattern for other functions on a case-by-case basis or when appropriate

- To print a preview of a pandas DataFrame, use the following code for better formatting: `dataframe.head().transpose()`

- Please do not use the `append` function of pandas; please instead use `List[pd.DataFrame]` as a buffer and then use `pandas.concat(...)` to combine them.

- For class creation, use the 'pydantic BaseModel' as your base template

- When developing API clients, first establish a generic class or function that manages request formation, submission, and error handling using meaningful exceptions. Specific tasks should utilize or extend this generic code

- Please employ generators for tasks involving the traversal of large data structures, particularly when the goal is simply to determine whether a certain condition is met anywhere within the structure. This approach helps optimize performance by avoiding unnecessary computation and memory usage.

- Avoid using mutable data types as default values for keyword arguments in function definitions. Implement a pattern like this: ... arg_name: List[str] = None, and manage defaults with the following: if arg_name is None: …

- Use f-strings for string formatting, as they are more readable and efficient

- Leverage list, dictionary, and set comprehensions for readability and performance improvements when possible.

- Use the Black autoformatter style to ensure consistent formatting across the entire codebase

- Consider using the pytest framework for writing and organizing unit tests

- Avoid using the walrus operator (`:=`) due to occasional interference with automatic formatting tools

- When dealing with time-consuming loops, follow these steps:

   1. Import the tqdm progress bar using from `tqdm.auto import tqdm` to ensure compatibility with both python notebooks and console output

   2. Initialize any necessary collector variables (e.g., empty lists or dictionaries for storing results)

   3. Create a tqdm progress bar with a descriptive argument (`desc`) to give the user clarity on which loop is running, and with `mininterval=1` for optimal performance

   4. Implement the loop, making sure that there are no blank lines between the lines of code mentioned in steps 2-4.

   5. Refrain from including any code comments about initializing or updating the progress bar, as the usage of tqdm should be self-explanatory
- If you are a model capable of running Python code in a restricted environment, please split your work across multiple cells to avoid character limits when necessary, and run the imports in their own separate cell first.

=== END OF STYLE GUIDE ===

--- Specific Request ---

Here is the specific request:

```