The Official Status Thread
-
@mott555 said in The Official Status Thread:
@Tsaukpaetra That looks like an ancient sewing machine.
Eight points and a thimble! I'm running out of virtual goods...
-
@topspin said in The Official Status Thread:
@TwelveBaud said in The Official Status Thread:
@topspin said in The Official Status Thread:
@Cursorkeys said in The Official Status Thread:
I've only got 354 Bytes of RAM free currently, every little helps.
How does 1 vs 2 or 4 bytes of a stack variable in a leaf function affect free RAM?
Where do you think the stack is? Hammerspace?
He said he has 354 bytes free, so he's not running out of space inside this function by using 4 more bytes. And then when you leave the leaf function, that variable is gone.
Using a word instead of a byte for
x
will probably increase the size of the code, as well.
-
@pie_flavor One rustfmt later... 170K lines. Yee-haw. Every time I type a character it's a full second before it shows up. CLion is currently taking 92% of my CPU to run
cargo check
. 3GB of RAM too.
-
@Cursorkeys said in The Official Status Thread:
chars are 8-bit on this platform
Yeah they tend to be.
You know what C needs (among many, many other things)? An
int<x>
datatype, that lets you store values up to X. So in this case you'd just doint<BUFFER ELEMENTS>
and problem solved.
-
@pie_flavor said in The Official Status Thread:
@pie_flavor One rustfmt later... 170K lines. Yee-haw. Every time I type a character it's a full second before it shows up. CLion is currently taking 92% of my CPU to run
cargo check
. 3GB of RAM too.Try Visual Studio. I've used it to edit files with millions of lines without a problem.
-
@anonymous234 said in The Official Status Thread:
@Cursorkeys said in The Official Status Thread:
chars are 8-bit on this platform
Yeah they tend to be.
You know what C needs (among many, many other things)? An
int<x>
datatype, that lets you store values up to X. So in this case you'd just doint<BUFFER ELEMENTS>
and problem solved.Why? It would have to be determined at compile time, and in many cases, it couldn't be. The result would probably be either the maximum buffer size, or the largest integer the system is capable of storing, whichever is smaller. Just go with one of those values, and then all you have to worry about is a buffer so large that
BUFFER ELEMENTS+1
is an invalid integer and your code loops back to element 0 and probably just continues looping forever.edit: it'd just be
BUFFER ELEMENTS
, I think, but maybe you could still end up in situations where the last increment inside the loop causes it to roll over and your end test never becomes true.
-
@Gąska In Rust, though?
-
@pie_flavor there's this Visual Rust addon. I haven't used it in ages, and it's probably is shitty and long dead, but it's there. Or you can do the changes you want in VS but do everything else still in CLion. From what it sounds, it's only a problem if the file is open, and for as long as you keep it closed, all is fine?
-
@pie_flavor or try this:
-
@Gąska right, but that doesn't use code analysis because of how it works. IJ can open large files (it's only like 5MB), it just won't do code analysis on them without configuring it to do so. And code analysis is the bit I want.
-
@pie_flavor why do you want code analysis on 170KLOC generated file? Just what are you trying to do?
-
@Gąska fix the compiler errors because either the tool or the input file is shit.
I did finally get it working.
-
@pie_flavor well, there's always the good old edit->compile->edit->compile loop.
-
Status: If I make headlines for getting arrested for murder, it was in a good cause. Surely no jury could convict me for strangling whoever designed the way Skype for Business uses certificates & DNS names (and the documentation for it) with my own two hands...
-
@izzion said in The Official Status Thread:
Surely no jury could convict me for strangling whoever designed the way Skype for Business
uses certificates & DNS names (and the documentation for it) with my own two hands...Acquitted.
-
@brie said in The Official Status Thread:
@anonymous234 said in The Official Status Thread:
@Cursorkeys said in The Official Status Thread:
chars are 8-bit on this platform
Yeah they tend to be.
You know what C needs (among many, many other things)? An
int<x>
datatype, that lets you store values up to X. So in this case you'd just doint<BUFFER ELEMENTS>
and problem solved.Why? It would have to be determined at compile time, and in many cases, it couldn't be. The result would probably be either the maximum buffer size, or the largest integer the system is capable of storing, whichever is smaller. Just go with one of those values, and then all you have to worry about is a buffer so large that
BUFFER ELEMENTS+1
is an invalid integer and your code loops back to element 0 and probably just continues looping forever.edit: it'd just be
BUFFER ELEMENTS
, I think, but maybe you could still end up in situations where the last increment inside the loop causes it to roll over and your end test never becomes true.I once had some code which needed to loop over the entire ipv4 address space (step size was variable, /32 in some specific locations but more like /16 most of the time). I tried to get it done with a 32-bit index variable, but ended up giving up and using a 64bit one instead.
-
@PleegWat You can
i = 0; do { // stuff } while (++ i);
-
@brie said in The Official Status Thread:
@PleegWat You can
i = 0; do { // stuff } while (++ i);
Probably, as long as
i
is declared unsigned. I don't recall the full details. The code has gone on to the eternal hunting grounds as we don't need it anymore since we're using the vendor's data format directly now.
-
@PleegWat Yeah, I was about to say. Unsigned integer is defined to wrap around on overflow. Signed integer overflow is UB.
-
@brie And since I was dealing with IP addresses my variable would have been unsigned anyway.
-
@PleegWat I'd hope so.
-
@PleegWat said in The Official Status Thread:
@brie And since I was dealing with IP addresses my variable would have been unsigned anyway.
"One little hack to double your IP space!" ISP's hate it! </buzzfeed>
yes, I know this doesn't work. But people are stupid...
-
@brie said in The Official Status Thread:
Why?
It follows the same logic that every other int type follows (except the exact width ones). You tell it what you want to store and it gives you whichever amount of memory it thinks will work best.
It would have to be determined at compile time, and in many cases, it couldn't be.
"x" was meant to be a constant, not a variable. Just round up to however many bits you can work with with reasonable efficiency. So probably still 8 or 16 or 32, but it could theoretically be 9 or 14.
-
@anonymous234 So, like
VARCHAR(n)
, and would be used exactly the same way.
-
Status: Fuck me-from-five-months-ago, who commented out a single line (that was probably pretty important) without leaving a comment why it was so.
Yeah, way to go, me. Very descriptive.
I'm uncommenting it back again, and watching for complaints of broken now...
-
@dkf said in The Official Status Thread:
@PleegWat Exactly. You need an axle and (typically) a wheel with a decent bit of mass out from the middle. Depending on which sort of wheel (or wheel-like thing), that's two or three pieces.
4 is just profligacy.
Just built one with 18 pieces, with a turntable part. Works pretty well.
I'm considering if I can do one with the large (~18cm diameter) gear racks but I've only got two available right now; those will probably be a bugger to mount symmetrically.
-
@Tsaukpaetra said in The Official Status Thread:
Status: Fuck me-from-five-months-ago, who commented out a single line (that was probably pretty important) without leaving a comment why it was so.
I have bad news for you - this is not five months; it's seventeen.
-
@Gąska said in The Official Status Thread:
@Tsaukpaetra said in The Official Status Thread:
Status: Fuck me-from-five-months-ago, who commented out a single line (that was probably pretty important) without leaving a comment why it was so.
I have bad news for you - this is not five months; it's seventeen.
I'll get used to the fact that it's now 2019 in about ten months or so...
-
@pie_flavor said in The Official Status Thread:
we have the luxury of saying 'I think this is shit' while you're burdened by having to think 'I could have done this better'.
It's not as debilitating as you might think. Almost better, because you get that smug feeling of superiority that you don't even have improve much.
-
@kazitor that's not the feeling I have when doing code review for my colleagues.
-
@Gąska Probably because code review takes up your time and isn't something you can ignore.
If I actually had to do every shit thing I see better, it would be less fun.
-
@kazitor said in The Official Status Thread:
@Gąska Probably because code review takes up your time and isn't something you can ignore.
Quite the opposite - I can ignore it just fine, someone else will approve it eventually; but then I end up with this code polluting our master branch.
-
@Gąska said in The Official Status Thread:
I have bad news for you - this is not five months; it's seventeen.
Hm. The points you gained for using a semicolon were lost by using a hyphen.
-
@kazitor yeah, I should've gone with colon-hyphen instead. It would be less awkward to read.
-
Status: apparently, sleeping for five days straight is an easy way to fuck up your graphics card.
Anyone know what five beeps means? The shitty manufacturer doesn't have beep codes on their website, and I have no idea what brand of BIOS it's using (again, shitty manufacturer).
Fucking Zotac.
-
-
@Tsaukpaetra said in The Official Status Thread:
Status: ten Internet points to whoever can guess what this is!
it even has replacement parts!
No I'll, let you actually guess. But it still works!
I'm late to the game — I see there are several answers already, and I'm sure somebody must have answered correctly, but I'll answer anyway. I know exactly what that is.
Just in case nobody has gotten it right...
It is a treadle sewing machine. It looks exactly like my grandmother's. (I wonder what ever happened to it. I certainly don't have it.) The machine itself is hinged and is stored in the center section of the cabinet, under the lid on the top. The black metal plate at the bottom pivots and is connected by a rod to a crank/flywheel/pulley. The pulley rotates when the treadle is rocked with a foot, driving a belt that drives the machine. (The electrical cord has nothing to do with the sewing machine; it's for the lamp sitting on it.)
-
@anonymous234 said in The Official Status Thread:
You know what C needs (among many, many other things)? An
int<x>
datatype, that lets you store values up to X.Having worked with languages that had such a thing, no, C really doesn't need it (except in the one place it has it: as a storage-only type in mapped bitfields in structures). The type handling logic in the compiler explodes and that's quite complicated enough already.
-
Status: was considering disconnecting the power button of my computer chassis and attaching the reset button to take its place so that malicious agents couldn't force a shutdown, but upon inspection it appears I simply do not have a reset button.
-
Status: One of my neighbours has just had a tall cedar blow down. Thankfully not onto my property. The winds overnight from Storm Erik have been pretty strong…
-
Vivaldi lost all my open tabs. AGAIN.
Edit: wait, nevermind, found them in the "windows" section in the side panel.
-
www.status.com: Yet another reason not to go to the movies: You get to sit through Thirty. Five. Fucking. Minutes. of ads, AND THEN twenty minutes of previews.
-
@HardwareGeek excellent! Ten points, a balloon, and two deluxe cookies!
-
Status: Making holiday plans. Good fucking lord, hotel prices in NYC are insane.
-
Status: Everything's coming up Milhouse
-
@Tsaukpaetra said in The Official Status Thread:
@HardwareGeek excellent! Ten points, a balloon, and two deluxe cookies!
Only if they're gluten free, thanks.
-
@HardwareGeek said in The Official Status Thread:
@Tsaukpaetra said in The Official Status Thread:
@HardwareGeek excellent! Ten points, a balloon, and two deluxe cookies!
Only if they're gluten free, thanks.
They're made of light, I'm sure you'll be safe...
-
Status: I am, by far, the biggest klutz in the world, no contestants.
That red stuff I spilled all over the laptop, the couch, glass table, floor, and basically everywhere else? Soda? Nope. Jelly? Nope.
It's candle wax. Awesome. Well, I guess at least the laptop is waterproof now.
-
@Tsaukpaetra Without looking at any of the other replies, I say a sewing machine.
-
@dcon you get seven cookies because I'm running out of them.