is it possible to create a chrome extension with clj/cljs?
apparently, yes. https://github.com/binaryage/chromex
@sova I think this thing might make it almost as easy to set up as using JavaScript: https://borkdude.github.io/sci-script-tag/
Random thought: I’ve come to think that many lambdas (in the AWS sense) that I stumble across could better be implemented as static site data. Sometimes data > code, and using a lambda can trick you into not utilising that.
Sounds intriguing, but I don't fully understand. Do you have an example of such a case?
I’ve recently converted a lambda that took two string arguments: a locale, and an ID. Then based on these arguments compiled a list of configurations which it returned. I moved the logic the lambda’s logic to a script (that I use babashka for running). It outputs an EDN config per possible ID and locale which is deployed to a static site. Now, instead of rewriting the lambda code for a new or updated combination of locale/ID and redeploy, I add the config to a sheet, and a CI pipeline runs the script and publishes the new/updated configs. (Not sure how much sense this is making, but for me the win here is to minimize the risk for introducing a bug.)
It all started with me refactoring the lambda down to it being mostly a data structure, then realizing I didn’t need a lambda to serve the data structure. 😃
Can anyone beat this request for absurdity, you have a table in a sql database, one of the fields isa GUID field. You get asked to change the GUID in that field for one particular row as it looks too similar to the GUID on the row underneath, if you looked at it part of it upside down (never mind the fact that there wasn't even an order by on the sql query... so the ordering he was seeing was fairly arbitrary anyway). I can't even.
I would like to know the status of Datomic. Actually how many companies are using it (except Nubank). Seems the discussion in the #datomic slack channel and also the activity on its offical forum are very quite.
quiet.
Well, we're using it in production, and we're a fairly large logistics management company.
Perhaps because it's a proprietary product with a support contract people are using different mediums? (We're also using Datomic in production in a manufacturing related product.)
Haha. Thanks. That gives more courage again.
Suggested fix: Tell stakeholder to not look at GUIDs 😉
Seriously though, it sounds like there’s some root cause that should be solved instead of tampering with GUIDs. In my experience when you field requests like this you’re sort of acting like a primary care physicians; if someone bursts into your office asking for prescription drugs you have to sort of walk them back up the chain of reasoning to get to the actual problem
This was from a tech lead 😞
he knows the guids are references, that no user will ever have to see or interact with a guid and nobody should ever be looking at that table in the db anyway. But still ¯\(ツ)/¯
Whats some of the dumbest code you've seen in production? I nominate these examples from a hideous old code base here: Thankfully at least this function was never actually called:
Checking if a list doesnt contain only a single item, obviously means you have to count it twice:
wow
A pattern that gets used a lot here that I've come to call if - meh - else.
So paranoid:
I know naming is hard, but c'mon
beware of calling someone’s code “the dumbest” )) there are always a person behind it and sometimes there is a reason to put it like you see it.
Maybe politely suggest he look at a hash instead 😅
I'm pretty sure this deserves a very unapologetic "the dumbest" label. Yes, saw it in real code. It was a fun place to work at.
private static boolean check(Boolean flag) {
if (flag.toString().length() == 5) {
return false;
}
return true;
}
apparently <https://thedailywtf.com/>
is still online! this was my old “go to” for this sort of thing
but yeah, I agree, you lose the context when looking at a snippet like this
and I’d venture to guess in most of these cases, someone didn’t write that block in one sitting. it probably got changed and tweaked a hundred times from something else
How do you perform unit test with the database? Loading the in-memory database ?
I think they do a lot of their either direct/1:1 or via this forum? https://forum.datomic.com/
(list (symbol 'foo) (str "bar") ,,, )
Real code, in prod
No, we use mocks (i.e. with-redefs
).
I’ve used S3 for serving json files that don’t change “too often”. No need to run any code if there’s really no logic involved 😉
I remember once that we had an internal XML payload. Inside that payload, there was a link to an IP, for another internal service to download a cover from a magazine and keep on their service. The PM asked us to add a DNS for that IP, because he could not understand what's that supposed to mean. Remember: it was an internal URL inside an internal XML that was only used to sync two internal services...
There was another situation where we had a very lengthy discussion about validations. The workflow was the following: 1. Service A sends us an UUID with some data 2. Service B asks us to validade if that UUID did get the data they sent us 3. One of the validations we had to do is that if that UUID was a valid UUID-version-whatever. The catch: only "Service A" would be able to generate these UUIDs. They wanted the "Service B" to validate if THEY did generate a valid UUID...
I once had a boss that had a PhD in software development (in Brazil). He asked us to make a system where every role was a different class.
So, for example, you would have an AdminHandler
class that would concentrate every URL, handler, etc that an Admin needs. An GuestHandler
, what the guest need... and so on.
Worked someplace that interviewed a guy with a physics PhD for software developer role. That was a very short interview when he refused to do tue technical test, his reasoning being he has a PhD. He isn't doing tests... Id kinda get it if his PhD was in computing...
Yes, I also have to make a disclaimer: most of my "bizarre stories" were from when I was working in a public company in Brazil. Everything is so outdated that sometimes you measure the "deprecation time" in decades...
I remember once that a person asked me if our software would be secure. I talked a little bit about SSL, Two-factor auth, etc, and they asked "but will it have username/password"? Afraid of the answer, I said "yes..." and the person continued: "Oh, thanks, ours only had usernames and they were auto-generated, so people were discovering their bosses' logins and..."
Not much better here, i spend significant time at work still maintaining old visual basic legacy application.
Which version of Visual Basic? 😄
Vb. Net, we actually have a file in the solution called javascript.vb, it's vb that's strings together javascript to send to frontend... I hate it.
A "wait for one second" routine that counted to 1 million. Then on inspection realised the JVM optimised it out
Yup. That was the thing that confuses me because it is not active by any measure.
interesting talk: https://www.youtube.com/watch?v=kZRE7HIO3vk
This rand really reminds of of the premise behind Urbit "everything is a mess", and Urbit's answer was "let's rewrite it from scratch" (kinda) It's a VM, compiler, OS, and more which is small enough for one person to understand and hold in their head. Pretty interesting from a technical perspective
I hadn’t heard of Urbit!
It's certainly esoteric and controversial (don't mention it on HN), yet it doesn't make it less technically interesting
yes, it looks that way, from the little I've read
I thought it was a bit odd to bring cryptocurrency wallets into the mix
but otherwise I thought they had some interesting ideas
I think the bitcoint wallet, besides being a cool goal, is a pretty nice way of integrating identity and payment systems. sort of like wechat does it, but with crypto
so maybe a static html page is better than memoize if you're using something that actually does not change long-term. a solid reminder
Is there any reason to have them human readable? iPod serial numbers, for example, do not use L or i because it can be confused with 1 and there is no "o" because it can be mistaken as a zero...
Bitcoins also have a similar optimization going on for addresses, because it's desirable for them to be human-readable.