Programming

You can learn a lot from the Python docs:

RealPython is also a great source for deep dives on discrete features that you want to learn more about.

Peter Norvig has a good free online course:

Finally, Fluent Python is really good, although some of it is probably a bit heavy for a beginner.

1 Like

gsfdgsdhh this is really starting to annoy me.

I’m getting an arbitrary string (“content”) from a third party source and because of reasons I’m putting it in a Javascript object like this:

{ “url”: url, “content”: content }

Then calling JSON.stringify on it and passing it off somewhere else and calling JSON.parse, but when I do I get this:

Uncaught SyntaxError: Unexpected token in JSON at position 1306

I mean, it’s the one who created the damn JSON in the first place, now apparently I’m expected to deal with the fact that it’s poorly formed. The string has Chinese characters in it and so forth, I don’t want to have to care what’s in it, I want the language to deal with that.

How the hell are stringify and parse not transitive? Is there something built into the language that I can do to the string first to escape whatever this character is? I can’t get a straight answer to this googling it.

Is content a valid JavaScript string? Is the object valid before you stringify it?

You could use TextEncoder to get UTF8, then convert that to Base64, then reverse to decode.

It transpires that some script on the page is fucking with my string. The stringified object is added to a div which is appended to the body, again because of reasons, and some script native to the site I’m using my extension on is somehow messing with my string. Also wrapping it in two <font style="vertical-align: inherit;"> tags. I don’t even want to know why. I should be able to work around this.

Can you put it in a <pre> tag?

If I do that it will just do the same thing to the pre tag - i.e. insert font tags into it and mess around with the contents. It seems to have some hideous global MutationObserver or something that messes around with any element that gets added to the page.

Looks like the workaround is to append the element to the head instead, then whatever this script is won’t fuck with it. Chrome will allow me to append div elements to the head, which is not supposed to be allowed but whatever. Seems to work. If that ever gets outlawed I can switch to using meta elements.

Pre tags are supposed to be for raw formatted text, including line breaks, etc. That script might ignore what’s inside it.

How the NSO’s zero click exploit worked

1 Like

The moderators of this message board, otatop, L.Washington, WichitaDM, Yuv, JonnyA, RiskyFlush, and SvenO, are cowards who let abusers dox and harrass other long time posters.

The company I’m at pays 25% less if you are remote / midwest. Still 300k+ is normal even before share appreciation. As for the next step, it doesn’t hurt to take the interviews now that all interviewing is remote. PM me for a referral.

The moderators of this message board, otatop, L.Washington, WichitaDM, Yuv, JonnyA, RiskyFlush, and SvenO, are cowards who let abusers dox and harrass other long time posters.

Somebody somewhere posted about something that outlined what people starting out make at Microsoft, google, and Meta. Any idea where that is?

The moderators of this message board, otatop, L.Washington, WichitaDM, Yuv, JonnyA, RiskyFlush, and SvenO, are cowards who let abusers dox and harrass other long time posters.

Thanks!

1 Like

What’s a “refresher”?
What’s ‘TC’ (as in 'a 300K +TC job)?

TC is total compensation. It wraps all your salary, stock, and bonuses into one number.

A refresher is an additional stock grant

Probably should have figured that one out. I assume you’re not counting stuff like health insurance, though. I think the + threw me off. I read it as 300K plus something else, instead of ‘over 300K’.

This one I have definitely never heard of.

Our stock is down quite a bit. I’m likely to get promoted (DS junior manager → senior manager) in a few months, but if they quote my stock at $300 when giving me RSUs instead of the $200 it is, gonna start hitting the leetcode (and DS equivalents) in the next year. I got recruiters banging down my door right now.

We’re currently quoting $300 to new hires, which is just insane. I can’t imagine many companies are this bad at doing stock price setting for RSUs, but maybe it’s just because we are crazy volatile.