Details
-
AboutI like the MIT engineers moto, but I don't have much money yet, so I break code instead.
-
Skillsreverse, python, rust, /C[#+]*/, poorly made /regexp?/, js, bs, and other stuff
-
Github
Joined devRant on 7/3/2017
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
Ever since I started using the dbg! macro in rust, I tend to emulate it in python or js whenever I write in these. This function is an identity function with the side effect of printing whatever was passed to it (in rust it will also print the filename, line, and code of the printed expression).
So in python, it's just:
def dbg(x):
print(x)
return x
A kinda stupid, but very convenient function -
I like mermaid :)
Tikz can also be a good option.
I recently felt like making a bigass specing tool, I have free time again now after all... Still, probably a bit too ambitious and I might end up dropping it '^' -
Yes, but you're also exactly the wrongest you possibly could be
-
@HiFiWiFiSciFi and then silently switch the feed from "live number of instances" to "(integer) value of bitcoin with a delay of X months such they the switch is seamless", don't forget to take pictures of the paramedics coming to get him after his heart attack...
-
Instore a new, dynamic system where an automatic need turret shoots him with green darts when new instances are spun up and red ones when one shuts down.
-
Maybe try a "it varies from X to Y, averaging at Z", and add quantiles for more flare?
-
@iiii Thanks. It still doesn't really help with structures with borrowed fields (without shared_ptr to do it at runtime), but I'm happy to have a standard for the rest of the cases.
Said structures with borrowed fields (such as iterators) are where lifetimes shine, and will shine even brighter when we get generic associated types and lifetimes on stable. -
@iiii About pointer lifetime and ownership? Since when? Please send a link because I am properly interested in that 'o'
-
Lifetimes are the most original post of Rust's type system, but also quite possibly the best. Being able to specify "I need this reference to stay alive for exactly that long" is extremely powerful, as is the fact that the compiler ensures that.
Rust can be overly pedantic at times, but most of the time, it is right and will beat memory safety into your skull to the point that, when back to C/C++, you'll just keep specifying lifetimes and ownership in comments.
The only thing I miss in rust compared to C++ is generic specialization, but I am hopeful that it will come to stable some wonderful day. -
I like the single file approach for html and he because they're so tied together anyway that they belong together imho.
For CSS, I like the scoping feature, since it makes it easy to style things quickly without worrying too much about possible collisions.
But then again, I'm not a web dev, so I can't speak for proper big projects -
Also, keep in mind that image processing plays a big role in picture quality for modern smartphones. One more reason to trust only actual pictures taken be each
-
So did mine, real annoying since I usually spend a good chunk of my days off on both sides of the new year mark... They did announce it a good while in advance, but still, it's annoying.
Days off should just be individual tokens earned as time goes and with individual expiration dates (I get that a company doesn't want to have its employees retain huge stocks of days off). Most companies use automated solutions to keep track of days off anyway, and most of that software is awfully outdated and could use an update; might as well update to a system that makes sense -
@CptFox solar* storm, darn autocorrect
-
I'm starting to think your hardware has some pretty severe malfunctions (or you live inside a dollar storm), because your examples all sound like extremely severe memory corruption problems
-
@Parzi weird. You sure that's not a race condition messing you up? Race conditions like to mess with people '^'
-
What do you mean by "forgetting how if statements work" ? I always like to hear about languages behaving weirdly
-
@NeatNerdPrime For a moment I thought we were preparing to blackmail the wasp into leaving us alone...
-
When all else fails, punch your own heart out to activate the tiny nuke that other scientists who wanted the wasp dead implanted in your body, and set to explode upon your tragic death in combat.
Pepper in some "Let me show you the true terror that is humanity" to add an emotional bang to the normal bang. -
@irene okay then, I'd probably go with neither commeOts nor split, to be fair; unless these abstractions are extremely complex x)
-
@irene If you have at all decent refactoring tools, changing a method name is just as trivial as updating a comment.
Heck, that might help you find misuses of your newly updated method of the changes are breaking in any way. But if you're making breaking changes to the method's abstract behaviour, I'd say renaming it isn't what you should worry about (most of the time, at least).
Still, by "code doesn't lie", I meant that using methods, you can abstract complex code from its context in order to make it more readable. Of course a method name can be misleading, but it's much easier to read a few short method to understand what they really do than a single big one.
Code is already expressing ideas, why repeat yourself with comments that might become misleading in the future?
But as always, there may be exceptions where comments are valuable, maybe this was such a case and your senior just needed to bitch about something. I was mostly playing devil's advocate -
Comments can lie, code can't, I'm with your senior on this one... Even if they're accurate to begin with, there's no guarantee they'll be updated if something changes.
-
@FinlayDaG33k As much as I love the idea, I'm not the only one setting up the routers on which we plug them (we have a few of these, with one router per prototype), and my colleagues don't seem to care much, since they only set up the one they use. But since I'm the one coding for the pies, I need to SSH into them every now and then, and that gets annoying real quick when I need to play the guessing game
-
Ooh, possibly fun one: an ethernet dongle with integrated IP display: basically a passthrough, but when an IP frame is sent from the device connected to its male-ended side, the sender filed is read and displayed on a tiny LCD on the dongle.
(Can you tell I spend too much time figuring out which IP to connect to on the various raspis I interact with at work?) -
Also, considering you display the local IP, might as well only show the bits that aren't in masked, that'll shorten read time significantly
(I'm taking way too much of an interest in this) -
To be fair, that's 2 minutes (at best, you may need to wait for the end signal to be able to start reading) of intense concentration required to get all the information.
He should add a hamming code to be able to error-correct 1 misread and detect 2, and would only need to suffer through 8 more bits for it :D
(Or he could make an app to scan the led and get his code, bonus is he can make the blinking faster)
(Or use Morse code) -
@gitpush The thing some find hard to understand is that (in most languages where it exists), `i++` is not just a statement (like `i += 1`, although some languages might still treat it as an expression, haven't really checked, sorry), but also an expression which returns the value of `i` before incrementation, in contrast with `++i` which returns the new value of `i`.
It's really useful when reading through an array, but can confuse people less familiar with this mutations that return an old value. That's why a lot of new language opt not to have ++ any more. But removing it after laugh, damn that's a big ass breaking change... -
3Blue1Brown on YouTube is a really nice channel with a very visual take on teaching math.
He's made series on Linear Algebra, a bit of Signal Processing, and Calculus. Maybe you could give it a whirl ? -
My company pays a hefty sum to have a conglomerate of outdated versioning and ticketing software, just so that they can call it theirs and have someone to blame for the daily occurrences of it not working properly.
The web UI for it is slow AF, but makes sure that you need at least 20 clicks to get to whatever you want, because why make it simple when you can make it complicated ? -
What I love about Rust is how much of the documentation can be translated into the type system.
MDN's JS documentation can be very hit or miss, especially in the form of "this function does <insert general concept here with no mention of details, input and return 'types' or edge cases>", so I kind of hate it sometimes. -
My main motivation is novelty and getting better, but I'll admit to being lazy and easily distracted, so maybe my motivation isn't strong enough