Share an example or two?
If you're a software engineer, memorizing an ASCII table (particularly the hex numbers of each character code) is definitely helpful. If for no other reason than so that you can read things that are randomly written in binary without having to consult a table.
Something not really otherwise terribly useful that nonetheless helped me keep my sanity: learn how to convert to base64 in your head. At work, we had really boring 8-hours-a-day training for a couple of weeks. To pass the time, I came up with random strings to base64 encode in my head. "
Hatis48 61 7a. The first six bits are010010which in base64 is anS. The next six bits would be000110which in base64 isG." Etc. I'd write down the base64 strings character by character as I derived them and then check my results for errors when I got back to my desk.How to convert various units of measurement. (Including between imperial and metric.)
2.54 centimeters in an inch. Degrees Fahrenheit is nine fifths of degrees Celsius plus 32. Stuff like that.
The password is "girlfriend".
I pronounce it "AUR" of course.
Are rear view cameras really "fancy" these days?
Oh good. Missouri in the national news again. :\
I'm amazed the movie didn't kill any chance of more movies/series dead.
Java, Postgres mostly but also LDAP and random in-house-written RESTful services, almost 20 years.
- The objects we store in the Postgres database are very "hierarchical" in nature, with one top-level object and lots of child/grandchild/great-grandchild objects. (We asked for a Mongo database but the infra team at the time said "make do with Postgres.)
- As I mentioned, some of that hierarchy is in LDAP or RESTful services, not in Postgres, so we needed something capable of dealing with multiple storage backends that would stitch the objects together as necessary. So the "ORM" needed to have backends for multiple backend systems.
- We knew clients would need a vast number of different queries. So we made a RESTful endpoint that gave the full power of the ORM to (authorized) clients. If they needed different data, we'd be like "change your query like this" and they didn't have to wait on us.
- Early in the project, we consciously designed an extensible JSON representation of our hierarchical objects. That is what's returned from the aforementioned RESTful endpoint.
- However, we also created a "shortcuts" system to allow us to "balance" how much of the logic lived on the server vs in the client. (It can mix and match. Like "apply this shortcut, but also filter this way and paginate" or whatever.)
- We made the API of the ORM such that it could both be used to query from the database/LDAP/RESTful systems, or be used as a client SDK for the aforementioned RESTful query endpoint that the application exposed.
- It's both "more than an ORM" (querying from non-database sort of backends) and not fully an ORM (read only, doesn't handle schema evolution.) But it's fair to say it's more "an ORM" than "not an ORM".
- The implementation of the Postgres backend part of it is heavily inspired by Django's ORM.
We couldn't have pressed Hibernate into this use case. It doesn't really deal with hierarchical data and sure as hell doesn't know how to query from LDAP. I don't know that anything existed at the time (nor am I sure anything exists now) that would fulfill our use case.
And the alternative to what we built was a massive, unmaintainable DAO with ridiculous numbers of individual queries in it that would have to be modified or added to endlessly every time someone needed to filter a bit differently or whatever.
This was a developed-in-house e-commerce web application at a major e-retailer. So fortunately that monstrosity of a cookie-handling mess was only ever used by one company.
You know what, though? Talking about this reminds me of another story about the same e-commerce application.
After a customer placed an order on this e-commerce site, the company's fraud department had to evaluate the order to make sure it wasn't fraudulently placed. (As in, with a credit card not owned or authorized for use by the purchaser.) Once that was done, the order had to be communicated to a worker at the warehouse so they could pack the right items into a box, put on a shipping label, and set the box aside to be picked up by the UPS truck which would come once a day near the end of the day.
The application used by the fraud department and the application that displayed new orders to warehouse workers was one and the same application. Whether a user had fraud-evaluating powers or pack-items-in-boxes powers just depended on what permissions their particular user had. (That may have been decided by LDAP groups. I don't remember for sure.)
Meanwhile, the e-commerce site offered gift cards for sale online. The gift card would be shipped to the customer. And there was a box where you could write a message associated with the gift card. So, for instance, someone could buy a gift card to be sent to their nephew's address or whatever and include a little note like "Happy Birthday. Don't spend it all at once." or whatever. And the fraud/pick-and-pack application would display all details of the order including any messages associated with the gift cards.
Well, I found a stored cross-site scripting vulnerability where if you put
<script>...</script>tags with some JavaScript in the gift card message box and completed the order, the JavaScript would execute any time someone viewed the details page for the order in the fraud/pick-and-pack application. And of course, the JavaScript could do within that application just about anything the user could do with their given permissions.The main danger was that a malicious actor with sufficient knowledge of how our fraud application worked could place an order fraudulently with someone else's credit card and include in the order a gift card with a malicious JavaScript payload in the message box, and then that malicious JavaScript could automatically mark the order "a-ok, no fraud here" when a fraud department worker loaded the order details page, letting the order be fulfilled without any actual fraud review.
The fix was pretty simple. Just stick a
<c:out>...</c:out>in the appropriate place in the fraud/pick-and-pack application code. But it was an interesting example of a vulnerability in a not-customer-facing application that could none-the-less be exploited by any public customer/user without any particular special access.If you're interested in one more interesting story about the same e-commerce application, see this comment I made a while ago.
Never roll your own ORM
I've done this. Probably 10 years ago. Even today, I maintain the same application that has the ORM in it that I designed. If I could go back in time and do something else, I'd do the same thing again. Honest to god. For my use case, I feel it was warranted. It was risky, but it worked out surprisingly well.
Java webapp. Customer facing. E-commerce application, so in PCI scope and dealt with credit card info and such.
There was one specific cookie that stored some site-wide preference for the customer. (Why not just put that preference in the database associated with the user? Because that would make too much sense is why.)
But the way they encoded the data to go into the cookie? Take the data, use the Java serialization framework (which is like Python's "Pickle" or Go's "Gob") to turn that into a string. But that string has binary data in it and raw binary data is kindof weird to put in a cookie, so you base64 encode the result. (The base64 encoding was the only sane step in the whole process.) Then you do the reverse when you receive the cookie back from the browser. (And no, there was no signature check or anything.)
The thing about the Java serialization framework, though is that decoding back into Java objects runs arbitrary object constructors and such. As in, arbitrary code execution. And there's no checking in the deserialization part of the Java serialization framework until your code tries to cast the object to whatever type you're expecting. And by that point, the arbitrary code execution has already happened. In short, this left a gaping vulnerability that could easily have been used to extremely ill effect, like a payment information breach or some such.
So all a malicious user had to do to run arbitrary code on our application server was serialize something, base64 encode it, and then send it to our servers as a cookie value. (Insert nail biting here.)
When we found out that there was a severe vulnerability, I got the task of closing the hole. But the existing cookies had to continue to be honored. The boss wasn't ok with just not honoring the old cookies and developing a new cookie format that didn't involve the Java serialization framework.
So I went and learned enough about the internal workings of how the Java serialization framework turned a Java value into a binary blob to write custom code that worked for only the subset of the Java serialization format that we absolutely needed for this use case and no more. And my custom code did not allow for arbitrary code execution. It was weird and gross and I made sure to leave a great big comment talking about why we'd do such a thing. But it closed the vulnerability while still honoring all the existing cookies, making it so that customers didn't lose the preference they'd set. I was proud of it, even though it was weird and gross.
The value that was serialized to put into the cookie? A single Java int. Not a big POJO of any sort. Just a single solitary integer. They could just as well have "serialized" it using base-10 rather than using the Java serialization framework plus base64.
Re-posted since LW removed it…
Any idea why?
The costs of distribution aren't really that expensive for big companies.
You can't really trust that users are going to be willing to donate hard drive space and upload bandwidth to help your maps service or whatever work. (Though, to be fair, you did mention things like OpenStreetMap which is probably more likely for users to be willing to support that way.)
Bittorrent isn't something you can seamlessly integrate into browser-based apps.
But also, there are newer technologes based on a very Bittorrent-like P2P way of doing things. IPFS is basically reskinned Bittorrent. And Peertube uses in-browser P2P to distribute videos. I don't think there's any standard in, say, HTML5 that allows for P2P without some hacks, but it sounds like there's a good chance such a standard is likely to make its way into browsers in the relatively near future. Also, it sounds like Chrome supports more than Firefox in that area right now.
And every day a Butlerian Jihad gets a little more tempting.
It's wild to meet Any Austin fans in the wild. I was watching his stuff and supporting him on Patreon when he was really obscure. Now that he's really popular, it's a whole different thing.
Point Crow or Summoning Salt? Either way, I hadn't heard anything.
I do know Point Crow used to do a lot of content of games like Breath of the Wild with mods that would do things like multiplayer mode or "the floor is lava". And Nintendo recently got YouTube to mass delete lots of modded Nintendo game content. (I don't think mods of Nintendo games are even illegal, but Nintendo is known for calling the perfectly legal illegal.) And Point Crow's channel was pretty hard hit because that made up a lot of his content.
Man. Maybe I should consider boycotting YouTube. Heh.
Edit: Oh. Speedrunner historian guy. You're asking about Summoning Salt. I can't read. Yeah, I don't know anything, but I'll look into it. You're not thinking of Karl Jobst, are you? He was sued by Billy Mitchell, but Mitchell is 100% provably in the wrong. And a liar. And a scammer. And a cheating cheater who cheats. (If you aren't familiar with Mitchell, I recommend starting with the documentary "King of Kong: A Fistful of Quarters".) Also, unless you've heard something I haven't, I would recommend Jobst's channel. It's mostly about cheaters in e-sports and speedrunning.
- I wouldn't want to encourage others to patronize WotC. (And, if I'm running a 5e campaign - which I did for a short time - players who want to play are going to want books even if only the PHB.) So I wouldn't want to run 5e. I might play 5e as a player if invited. But I'm kindof a "forever GM."
- Yeah, I'm good with acquiring stuff in ways that doesn't support WotC. I don't consider buying used to be permissable, however. If I buy used, that's one used copy that won't be available to someone else who may instead resort to buying new from WotC. And WotC profits directly from DM's Guild. Piracy is the only way I'd be ok with it. (And if I don't want to run 5e, and given that I already have all the core books, the only WotC content I'd be interested in pirating would be Eberron stuff. If I wanted to support Keith Baker without supporting WotC/DM's Guild, I could just pirate and join Baker's Patreon. Assuming I can find a good place to pirate that stuff from, of course.)
- I specifically do want to participate in TTRPG ecosystems that are more explicitly dedicated to more sane licensing schemes and have very explicitly Ulysses Pact'ed themselves in no-takebacksies ways. Like maybe Paizo/Pathfinder 2e for instance. (I'm currently between groups... and have yet to acquire the PF2e books... and honestly am enjoying a bit of a hiatus from GMing... but when I get back to it, I'd love to do either PF2e or... I dunno. Something not 5e. Even though the 5e system is pretty decent, I think.)
- There was a short period of time during which I thought WotC was backing down after the OGL 2.0 debacle, and if they hadn't immediately proved themselves 100% evil with the Pinkerton fiasco, I would have ended my boycott. But they did, so my boycott remains.
- I haven't seen the D&D movie, nor do I intend to. And I'm not just boycotting WotC. I'm boycotting Hasbro. So, no Transformers movies either.
No, the ketchup goes on the keys and the fries on the touchpad.
Too bad you don't have a CD tray. I'm guessing that's why you didn't order a drink.