Random thought of the day
-
@Vixen I believe it's in General.
-
@jinpa said in Random thought of the day:
@sockpuppet7 said in Random thought of the day:
I just realized I got too old to hope anything cool like FTL travel being invented to happen in my lifetime
I'm on the side of Einstein on this one. I don't think FTL travel will ever be invented - it's a hard limit.
The Alcubierre Drive is a theoretically possible way to move at effective speeds greater than the speed of light. Recent measurements of gravity waves by LIGO so far support the validity of the theory.
-
@abarker said in Random thought of the day:
The Alcubierre Drive is a theoretically possible way to move at effective speeds greater than the speed of light.
All you need is negative mass. Petty details.
-
@abarker It's mathematically possible within the framework of GR, but it requires large amounts of negative mass-energy and nobody knows what that means or if it even exists.
-
@jinpa said in Random thought of the day:
@abarker said in Random thought of the day:
The Alcubierre Drive is a theoretically possible way to move at effective speeds greater than the speed of light.
All you need is negative mass. Petty details.
@mott555 said in Random thought of the day:
@abarker It's mathematically possible within the framework of GR, but it requires large amounts of negative mass-energy and nobody knows what that means or if it even exists.
I wasn't saying that it would be anytime soon. I was simply saying that @jinpa was wrong.
-
@jinpa said in Random thought of the day:
All you need is negative mass.
And, in order to preserve causality, to have the travel system set up so that light will have had a chance to travel the entire route conventionally first between creation and use. I've no idea what the warping would be like in the intervening period when causality concerns would be forbidding entry, but I would really like to not be close to anyone trying to build an Alcubierre Drive for the duration, just in case…
-
@boomzilla said in Random thought of the day:
- If your toes are really taking the most of the impact force, then it isn't an instep kick. Or maybe just a really poorly executed one.
It can be either the toes or the top of the foot, depending on how you strike.
- When you kick your foot probably tenses up for impact, which stabilizes the joints and prevents the sort of joint injury that happens when you stub your toe.
- When you are in a very stimulating environment your brain "turns down the volume." The same stimulus coming in the midst of fewer strong stimuli results in a very different sensation. Ever watch TV at night and have to turn it up to hear? Then turn the TV on in the morning and have the feeling that it's super loud? Or how different the radio volume in the car seems from when you shut it down to the next time you drive?
These are good points.
-
@dkf said in Random thought of the day:
in order to preserve causality
But why would anyone want to do that?
-
@dkf said in Random thought of the day:
@jinpa said in Random thought of the day:
All you need is negative mass.
And, in order to preserve causality, to have the travel system set up so that light will have had a chance to travel the entire route conventionally first between creation and use. I've no idea what the warping would be like in the intervening period when causality concerns would be forbidding entry, but I would really like to not be close to anyone trying to build an Alcubierre Drive for the duration, just in case…
My GR is pretty rusty because the mathematical formalism is way over my head, but my understanding was that causality issues only occur when something locally exceeds the speed of light, and certain solutions in GR (such as the Alcubierre Drive) never allow the object to locally achieve FTL and thus there is always a way for light to travel faster than the "FTL" object (e.g. light signals caught in the drive's "warp" bubble still locally travel faster than the ship and will arrive ahead of it).
-
@boomzilla you’re wrong, but that’s okay.
It’s just not cut perfectly straight.
-
@boomzilla said in Random thought of the day:
Or how different the radio volume in the car seems from when you shut it down to the next time you drive?
That's because it resets to a default and I have to crank it up to deafening again
-
You know those stupid-ass youtube clickbait thumbnails and titles?
Fortnite AMAZING moments You Won't Believe What Happens Next [HD] | [1080p] | 2020 BEST OF!
Here's the thought: will PornHub videos ever look like that?
-
@anonymous234 said in Random thought of the day:
Here's the thought: will PornHub videos ever look like that?
You mean with someone with an open mouth?
-
@anonymous234 said in Random thought of the day:
You know those stupid-ass youtube clickbait thumbnails and titles?
Fortnite AMAZING moments You Won't Believe What Happens Next [HD] | [1080p] | 2020 BEST OF!
Here's the thought: will PornHub videos ever look like that?
He catches his Stepmom masturbating. What happens next will blow your load
-
@anonymous234 he does look like he’s preparing to eat a banana.
-
The worst part of writing compilers, code generators and other similar dev tools, is coming up with names for all those variables that hold arbitrary types. Because
type
is usually reserved keyword andtyp
is already in use.
-
@Gąska said in Random thought of the day:
The worst part of writing compilers, code generators and other similar dev tools, is coming up with names for all those variables that hold arbitrary types. Because
type
is usually reserved keyword andtyp
is already in use.I use typeA, typeB, etc. All the way to typwO
-
@Gąska In C# you can make a variable with a reserved name by writing @int, or @this or @typeof (type isn't reserved though).
Which is an order of magnitude more confusing than just using a different name.
-
@Tsaukpaetra said in Random thought of the day:
@Gąska said in Random thought of the day:
The worst part of writing compilers, code generators and other similar dev tools, is coming up with names for all those variables that hold arbitrary types. Because
type
is usually reserved keyword andtyp
is already in use.I use typeA, typeB, etc. All the way to typwO
Keep going. Handle it the same way Excel handles columns.
typeAA, typeAB, etc.
-
@Gąska said in Random thought of the day:
The worst part of writing compilers, code generators and other similar dev tools, is coming up with names for all those variables that hold arbitrary types. Because
type
is usually reserved keyword andtyp
is already in use.Generally this is solved by using "unspeakable" names: you have a name generator tool in the compiler that will create a name containing characters that are valid in the output, but not valid to parse as an identifier.
-
@Mason_Wheeler I mean writing the generator. Dunno about you, but I don't find randomly generated names very readable.
-
@Gąska
you mean your username isn't random?
-
-
@Gąska said in Random thought of the day:
@Mason_Wheeler I mean writing the generator. Dunno about you, but I don't find randomly generated names very readable.
They're not randomly generated. They tend to consist of three parts: human-readable context, unspeakable characters, and a serial number. What you get is something that looks weird, but not unreadable.
-
@Mason_Wheeler said in Random thought of the day:
@Gąska said in Random thought of the day:
@Mason_Wheeler I mean writing the generator. Dunno about you, but I don't find randomly generated names very readable.
They're not randomly generated. They tend to consist of three parts: human-readable context, unspeakable characters, and a serial number. What you get is something that looks weird, but not unreadable.
Are you talking about the source code of the generator, or the source code generated by the generator?
-
@PleegWat The code generated by the generator, because that's the only context where his comment as-written makes sense.
-
@Mason_Wheeler I meant code of the generator itself. When you do code inspection of statically typed language, you usually want to know types of the values (at least I do in my current project), so it's useful to have a type that describes the type, and a field on the value object that specifies the type. And a lot of local variables and function arguments will hold a type as well.
Anyway, I partially solved the problem for now by doing some unrelated refactoring, which forced me to rename
typ
type toType
, freeing uptyp
for local variables.
-
@Mason_Wheeler said in Random thought of the day:
Generally this is solved by using "unspeakable" names
He's writing a compiler, not summoning a demon
-
@hungrier said in Random thought of the day:
@Mason_Wheeler said in Random thought of the day:
Generally this is solved by using "unspeakable" names
He's writing a compiler, not summoning a demon
but demons are cute!
-
@Vixen said in Random thought of the day:
@hungrier said in Random thought of the day:
@Mason_Wheeler said in Random thought of the day:
Generally this is solved by using "unspeakable" names
He's writing a compiler, not summoning a demon
but demons are cute!
-
@hungrier said in Random thought of the day:
@Mason_Wheeler said in Random thought of the day:
Generally this is solved by using "unspeakable" names
He's writing a compiler, not summoning a demon
In C++, both are usually the same operation.
-
@topspin Ph'nglui mglw'nafh ADC EAX JNZ
-
@topspin Only if you use templates.
-
@anonymous234 said in Random thought of the day:
@topspin Only if you use templates.
Or trying to write a compiler.
-
Do shitlords obey the Rule of Two?
-
@hungrier said in Random thought of the day:
@Mason_Wheeler said in Random thought of the day:
Generally this is solved by using "unspeakable" names
He's writing a compiler, not summoning a demon
You rang?
-
@jinpa said in Random thought of the day:
@hungrier said in Random thought of the day:
@Mason_Wheeler said in Random thought of the day:
Generally this is solved by using "unspeakable" names
He's writing a compiler, not summoning a demon
You rang?
Context for newbies: http://worsethanfailure.com/articles/The_Call_of_Codethulhu
-
-
-
@Tsaukpaetra They're no snitches.
-
Not sure if this is off-topic, but just came across this, which made me think of an earlier discussion:
"All of the world’s 500 fastest supercomputers are running Linux."
https://www.howtogeek.com/440147/did-linux-kill-commercial-unix/
-
The truncate command in Unix/Linux is the opposite from what it should be in terms of use cases. Mostly it is used for dealing with log files that have become too big. You must specify the -s parameter, which tells it how many bytes to keep. It keeps the bytes at the beginning - there is no option to keep the bytes at the end. If you want to truncate a log file, you almost certainly want to get rid of the oldest lines, not the newest ones.
There are ways, of course, of getting around this, but it is not part of the command itself.
I cannot think of any reason (apart from pathological examples) why someone would want to keep the lines at the beginning of the file.
-
@jinpa said in Random thought of the day:
I cannot think of any reason (apart from pathological examples) why someone would want to keep the lines at the beginning of the file.
I can't think why you'd want to keep the file at all. logrotate that b****h. every day at midnight local have logfile copied to logfile.0 (after logfile.0 was moved to logfile.1, and so on) then truncate logfile to 0 bytes. have a weekly cronkob delete the really old logs. and if your'er particularly paranoid about not losing log entries.... let a system daemon do the log rotation for you. there's one for every major *nix by now.
-
@Vixen said in Random thought of the day:
@jinpa said in Random thought of the day:
I cannot think of any reason (apart from pathological examples) why someone would want to keep the lines at the beginning of the file.
I can't think why you'd want to keep the file at all. logrotate that b****h. every day at midnight local have logfile copied to logfile.0 (after logfile.0 was moved to logfile.1, and so on) then truncate logfile to 0 bytes. have a weekly cronkob delete the really old logs. and if your'er particularly paranoid about not losing log entries.... let a system daemon do the log rotation for you. there's one for every major *nix by now.
Mostly having to do with privileges and simplicity. Current situation is a very restricted environment. I'm lucky I can do logging at all. I'd been told we could not.
If the truncate command had been designed to have a parameter to keep the last lines, in many cases people wouldn't have to bother with log rotation at all. You would write a simple script to truncate the files and make a cron job out of it, and you'd be done with it.
-
@Vixen said in Random thought of the day:
have a weekly cronkob delete the really old logs.
logrotate does it for youEx.:
/var/log/nginx/error.log { rotate 30 daily compress missingok notifempty }
Will rotate daily and keep 30 days of logs.
-
@jinpa said in Random thought of the day:
If the truncate command had been designed to have a parameter to keep the last lines,
Wrong tool
tail -n 50 filename.log
will echo the last 50 lines of that file.
Just redirect the output to a file
-
@jinpa It's the easier thing to implement in the filesystem.
Some Unix utilities are made for being useful. Some are made to be building blocks for other stuff.
-
@anonymous234 said in Random thought of the day:
Some Unix utilities are made for being useful in the 1970s.
FTFY
-
@Mason_Wheeler said in Random thought of the day:
@anonymous234 said in Random thought of the day:
Some Unix utilities are made for being useful in the 1970s.
FTFY
My position is that it (the truncate command) wasn't even useful then.
-
@TimeBandit said in Random thought of the day:
@jinpa said in Random thought of the day:
If the truncate command had been designed to have a parameter to keep the last lines,
Wrong tool
tail -n 50 filename.log
will echo the last 50 lines of that file.
Just redirect the output to a file
Just do not use the same file. Just keeping a single backup is easier.
You could do something like:
[ "$(wc -l filename.log)" -gt 200 ] && sed -i '1,150d' filename.log
Remember deleting from the end is an in-place operation. Deleting from the start is by necessity a copying operation.