@RaceProUK said in Tales of a Corporate Collapse: Gov't Contractor Edition:
... after all, bankers
candid lose all our money but stillgetgot a massive bonus
Dubbed in American English.
@RaceProUK said in Tales of a Corporate Collapse: Gov't Contractor Edition:
... after all, bankers
candid lose all our money but stillgetgot a massive bonus
Dubbed in American English.
Very good explanation of the story. One bit that I would add to, though:
@anotherusername said in Onan! What is best in life?:
One of the sons, Perez, goes on to become a great-great-ancestor of the Jesus Christ hisself, which was sort of God's way of saying "ya done goofed... but see, I worked it all out".
To some people, Perez was more importantly the ancestor of David. I vaguely recall that it isn't clear that Jesus was a descendant of David (i.e. something about Joseph being a descendant, but for Christians, Joseph wasn't Jesus' father). I could be imagining that, though.
It might not be blakeyrat that's right, but instead me that was wrong. I'm not certain if PHP checks for recursion depth in normal function calls, or if I was mixing that up with the regex processor. PHP might just segfault when you run off the end of the stack.
If it's segfaulting when trying to convert a template object to a string, it might be hitting the recursion limit. Possibly not a in PHP (for a change).
Useful feedback would be nice, but I do expect at least more than radio silence. Even if it's at least a canned "We don't think you would be a good fit", I think it's pretty impolite to leave someone not knowing what, if anything, is happening.
@anonymous234 Is it the same as the Commodore version that I had? I don't think I could ever get through the last stage as a kid, but I don't remember it being specifically broken.
E.T., on the other hand...
@Yamikuronue said in 24/7 surveillance power given to irresponsible IT. WCGW?:
oh. OH! I've just understood while typing this: They didn't wiretap his phone sex, they recorded his physical life using the phone as a mic! Oh wow, that's fucked up.
Don't worry, it also took me a minute to realize that it wasn't about phone sex using the company cell phone.
@anotherusername said in Lets run Arbitrary SQL code!:
I'm actually really curious if someone had a realistic idea of whether my transactions idea could work.
As far as I know, certain things will automatically commit the transaction, like dropping tables. Starting and rolling back a transaction around the query should help with some things, like accidental updates, but it definitely won't prevent any kind of dedicated attacker.
@antiquarian said in Is this candidate a genius or a potential disaster?:
If you really are new here, one thing you need to know about blakeyrat is that he puts forward his own personal opinions about
how software should workeverything as if they were universal, objective truth.
</troll>
There is one legitimate reason to use AJAX to do a form submission - it doesn't result in reloading the page.
Being able to decide whether or not that's worth the added complexity is what distinguishes good software engineers from bad ones.
@pydsigner said in Is this candidate a genius or a potential disaster?:
@blakeyrat said in Is this candidate a genius or a potential disaster?:
open source software sucks
This is where I realized that your opinion on software became hopelessly broken at some point.
Look, a newcomer! Welcome to WTDWTF!
@asdf said in The US: saving the world from itself:
Also, it's not like the US ever really cared about doping any more than Russia. That may be changing, but historically doping was as systematic in the US as on the other side of the cold war.
I'll have you know that we in the United States have always cared about fairness in athletic competition and vigorously prosecuted anyone who has illegally used drugs to gain an unfair advantage.
Now if you'll excuse me, I have a baseball game to go to.
This reminds me of all the people who make up fake domains and email addresses to use in documentation. There's already a set of reserved domain names specifically for this purpose: example.com, example.net, etc. Anyone who uses anything else deserves to have their documentation link to porn sites.
@ScholRLEA said in Wordpress.... I hate you.:
Hence the original expansion of the name, "Programmable HTML Preprocessor" (later changed to "PHP Hypertext Preprocessor").
The original name was "Personal Home Page"
@Lorne-Kates said in The Web is Doom...:
@xaade said in The Web is Doom...:
@Lorne-Kates dammit.... we have to limit the number of posts or we are going to run out of months.
We'll always have Smarch.
But the weather is always lousy.
@anotherusername said in PUBLIC HEALTH CRISIS in UTAH!:
But for the purposes of this discussion, assume you're making something that you intend for human consumption. Like... say... salad dressing. Does "equal parts" mean equal volumes or equal weights? Or is "equal parts" just a phrase that you'd never find in a process such as that?
I don't remember if cooking/baking instructions ever use "equal parts", but in mixing alcoholic drinks, it always refers to equal volumes.
@cartman82 It's not just you. Installing CPU heat sinks has really, really sucked for at least as long as I've been building computers (~15 years).
@accalia Sometimes fire isn't enough. Sometimes you also need a really big sword.
@dkf Yeah, the dictionary with integer keys that are just a sequence of 0..n is pretty special. It makes me wonder if the person has ever heard the terms "array" or "list".
I expected it be some whiny complaints about slightly suboptimal code to create the data structure for the lines from the CSV file.
Instead, I got a giant . Well done, sir.
@flabdablet said in Need to call a function? Use reflection!:
@Dragnslcr said in Need to call a function? Use reflection!:
For those not familiar with it, getattr(hashlib, 'md5')() is the same as hashlib.md5()
Is there a performance difference? For the parallel constructions in Javascript (
hashlib['md5']()
vs.hashlib.md5()
) I don't believe there is.
Probably not much of a difference. Just the overhead of calling getattr
.
Is
getattr()
an actual function call in Python, or just syntactic sugar for whatever the engine would have to do to find a method by name anyway?
It's a built-in function, but I don't know if the interpreter does some magic to optimize it.
Also, is there any difference in Python between calling a method via its containing object and calling it via a function reference?
Functionally, nope, it's exactly the same. I don't know if there might be some very small performance penalty for doing the variable lookup.
@Eldelshell said in Could you pass TDWTF citizenship test?:
- Irish girl is?
- a meme
- a user
- a bot
- a discodev
None of the above.
I guess technically she became a meme, but a better question would be what she was originally.
@AyGeePlus said in Need to call a function? Use reflection!:
hashlib.md5 has no block_size attribute, but maybe it's in python 3 or a weird version of something, whatever.
It's been there since at least 2.7:
Python 2.7.8 (default, Nov 10 2014, 08:19:18)
>>> import hashlib
>>> hashlib.md5().block_size
64L
Even if it did, why couldn't you just write '512'? If you can hardcode 'md5' you can hardcode '512', surely. Why read it in one kb at a time? Because of the way md5 works you'll still accumulate 100% of the data in memory(unless you're collecting hashes of 1kb chunks? as a checksum?).
You could hard-code the number of bytes to read at a time. I don't know for certain, but I would guess that you'll get somewhat better performance by processing a multiple of the block_size
at a time. 128 KB is probably too small, though; I think the optimal disk read size is a few MB these days.
f.read() would return the whole file with only one call to os.read() which'll make caching a hell of a lot easier on the hard drive. Unless f is a 'file-like' object? A socket or something?
It's only doing MD5 hashes of entire files, but the files could potentially be pretty large, so we don't want to read the entire file into memory.
I know exactly who it is. Unfortunately, I'm not the person in charge, so constructive criticism generally isn't appreciated.
As for the loop that reads in the file to be hashed:
for bytes in iter(lambda: os.read(f, 2048*func.block_size), b''):
Fortunately, reflection in Python is quite a bit simpler than in some other languages. This still made me go though:
func = getattr(hashlib, 'md5')()
...
func.update(string)
...
func.hexdigest()
For those not familiar with it, getattr(hashlib, 'md5')()
is the same as hashlib.md5()
There needs to be a version of the name chart that creates names like Big McLargehuge.
@accalia said in Organic Farm Denies Use of Dihydrogen Monoxide:
ook! ook oook eeeek! oook!
Hey, stop monkeying around.
Oh. Shit. Oh shit oh shit oh shit oh shit oh shit.
@loopback0 said in The state of Ubuntu on Windows:
@fbmac said in The state of Ubuntu on Windows:
because Linux isn't an OS you know
Let's not start that again.
Oops, sorry.
@fbmac said in The state of Ubuntu on Windows:
because Linux isn't an OS you know
Er, yes, it is. Linux is the kernel, i.e. the piece of software responsible for the operation of the system. All the other things that you think are "the OS" are just programs running on the kernel.
Android and Ubuntu work in very different ways on this service thing.
Maybe from the user's perspective, but not from the computer's perspective. Android's services are still just programs running on the kernel. The difference is that a lot of Android's services are Java programs, while other Linux distributions don't typically have many system software written in Java.
@blakeyrat said in tactical bacon (yes, it really exists!):
Right; but what makes it tactical instead of, say, "canned bacon"?
You can deploy it over a much more precise area than regular, large-scale bacon.
I always keep a serial
field as the primary key. The biggest reason, even though the SO post you saw listed it second, is that you never have to worry about it changing. Even if you are absolutely certain that your natural primary key will never change, it will eventually change. It is possible to handle (e.g. with triggers), but if you don't get it perfectly correct, your data will end up corrupted.
Having an index on the name
field will make access by name
pretty much just as fast as access by the id
field. Also, in case that's the SQL that you're executing, you don't need to create an index on name
; making it unique will create an index for you anyway.
@heterodox said in autorun.inf tomfoolery:
Oracle... why would you do that...
Is it a sane idea? If not, then your question is answered.
There are usually at least a few different brands of tequila in liquor stores in the US. Typically, you get what you pay for. If you spend $10 on a bottle, it's going to be terrible, a $20 bottle will be okay, and a $30 bottle should be pretty good.
Mexico is, of course, on a completely different level when it comes to tequila.
@asdf said in The painful break up thread:
I hope you're talking about good tequila, not the cheap supermarket stuff, because that's disgusting.
Oh, definitely. I don't known the brands very well, but I've generally found that something like $8 per shot is a good price point at a bar. Would probably be about $30 for a bottle in a liquor store?
@asdf said in The painful break up thread:
@DoctorJones said in The painful break up thread:
We'd take you out for a beer if we could.
Or two. Or three. And add some scotch while we're at it. ;)
Or if you're like me, I'll gladly replace the scotch with something good, like tequila.
This site may be the last place you should go for sane advice, unless you're really good at ignoring trolls, but we'll all gladly agree with any rants you'd like to get out.
@Captain said in Found in our enterprisey business object factory:
The "factory pattern" implements a functor over its argument.
Functors are good. You can use them to encapsulate effects all the business objects need, without forcing them into a class hierarchy.
Inheritance is bad. Don't do inheritance. Do functors.
7/10, would recommend to others.
@accalia said:
twitter is still relevant and a thing?
Yup. A lot of giant international corporations and athletes/teams use it for press releases.
@Polygeekery said:
If he unplugs the GitLab server in order to be able to print...please tell me that there is something else that is more important than version control that he leaves plugged in? I mean...I don't know what that would be...I am just hoping there is something?
The company's web site? The production server?
@Lorne-Kates said:
Also, borders around posts in a thread and on a list. Because FUCK YOU, I don't want to just guess where one whitespace-filled node ends and a nother whitespace-filled node begins.
I don't know what you're talking about. A 1-pixel wide, very light gray line isn't enough of a divider for you?
@FrostCat said:
...remember the kind who bit a pop-tart into a sort of gun shape and teachers freaked out, apparently because they thought he might...kill them with jelly?
Have you ever eaten a Pop Tart? I'd say being killed is a legitimate concern.
In general, learning a programming language is easy; it's learning programming that's hard. It sounds like you already know at least the basics of programming in general - converting "do something" into a series of small steps, control structures, functions, etc. You might try starting with Python's tutorial at https://docs.python.org/3/tutorial/index.html, and if you're having trouble with the general concepts of programming, then you can go back and look for resources that spend more time on programming in general.
Of course, sometimes the best way to learn is to just experiment and then ask specific questions. At least a few of us around here aren't complete s.
There are ~15 different ways (one for each data field in object). Which gives me 15 different comparison functions. They're all one-liners. Do you really think creating 15 5-line files would be more readable than having anonymous classes?Of course, the best solution would be lambdas, but Java 1.4 doesn't have lambdas.
Sometimes it feels like I'm the only person who thinks that yes, having 15 different 5-line classes (not necessarily all in their own file, though) is more readable. Of course, my point of view is probably skewed by the number of times I've had to read someone else's code that has anonymous inner classes and/or lambdas that are 50+ lines long and 5 layers deep.
Nice find on the -S
option. I hadn't noticed that one, and not needing sort
and awk
definitely makes things simpler.
I'm not certain that -i
will work correctly if you have a snapshot in between that you've created manually. You can use -I
instead, which does send all snapshots in between.
You might have to do the initial send manually. You can just take a snapshot (or use one that gets created by your script, if it gets that far) and then do a send
without the -i
option.
Nothing at the moment, though that is something I need to implement.
BTW,# zfs list -t snapshot NAME USED AVAIL REFER MOUNTPOINT storage/backup/git/daily@2016-03-16 8K - 1.96G - storage/backup/git/daily@2016-03-16-2 8K - 1.96G - storage/backup/git/daily@2016-03-16-3 72K - 1.96G - zroot/usr/home/git@2016-03-16 0 - 1.96G - zroot/usr/home/git@2016-03-16-2 0 - 1.96G - zroot/usr/home/git@2016-03-16-3 0 - 1.96G -
This will quickly become a problem without some culling. On both sides.
Also, why are only snapshots on the backup drive taking space?
The REFER
column is the amount of data in the snapshot. The USED
column is how much disk space the snapshot is actually consuming. There's usually a small amount of metadata for a snapshot, so you'll often see a snapshot taking up 8K. The only time a snapshot will use up more than that is if there were changes to the files.