WTF Bites
-
inode is the file table entry itself.
I agree that the inode is the entry itself. However, there are still no system calls that would return it, because it is a private kernel object describing everything about the filesystem object including methods to access it and links to other related kernel objects. The most any system call "returns" is a suitably normalized subset of the attributes. So the Google guy was not right either.
Or we can talk about on-disk inode, but that is specific to filesystem. E.g. vfat does not have anything like that. So stat again only "returns" normalized set of attributes, not the inode.
-
My hair has been various shades of purple since April. My DBA just said to me today:
Oh, you changed your hair color again?
He did mention it when I first bleached it (but that was pretty shocking).
-
Oh, you changed your hair color again?
He did mention it when I first bleached it (but that was pretty shocking).
A man noticed you changed hair color, he must have a thing for you ;)
-
I just noticed my
tasks.json
file has a syntax error...
...but VS Code is still using the data from it! The tasks still run! I even tried making a change with the error still in place, and it used the new value!
What black magic is this?
-
@TimeBandit said in WTF Bites:
Oh, you changed your hair color again?
He did mention it when I first bleached it (but that was pretty shocking).
A man noticed you changed hair color, he must have a thing for you ;)
LOL
This time it took several months but yeah mostly women have commented on the various colors.
Women are funny too...I know when it was first bleached it was awful but no one says anything bad (even when I say I know it is bad) but when the purple was good and flattering to my coloring they said oh this is way better.
One other guy complimented the blond when I had toned down the brassiness so it wasn't awful but didn't flatter my coloring. Plus he is someone I have very little interaction with, so I think he might have had a thing for me.
The lesbian didn't mention it (is it weird that I want her to have a thing for me) but she always says "Hi Karla" when passing me which usually catches me off guard (as an introvert I almost never initiate greetings in passing, and we've never worked together).
-
So @royal_poet just installed Win10 AU. Spare us the idiot comments, we know, it's AU.
And Cortana re-established herself, the condescending intrusive cow that she is.
I got to observe @royal_poet yelling a little at Cortana, with the final line of 'Cortana, fuck off', which not removed Cortana from the taskbar but also opened an Edge window, to Bing for the search phase, and I quote,
Cortana, f*** o**
.Not sure if good idea, bad idea, quixotic idea or simply WTF, but it seemed like a small bit of that we can all enjoy, especially as values of will vary.
-
@Arantor
Ah, voice recognition technology has come such a long way. This was in 2002:https://www.youtube.com/watch?v=YUfLGIEjr3o&feature=youtu.be&t=175
Filed under: oneboxes only come when least wanted to and are nowhere to see when intended
-
So @royal_poet just installed Win10 AU. Spare us the idiot comments, we know, it's AU.
You're an idiot if you think I'm not going to call you an idiot.
Idiot.
-
C++
numeric_limits<T>::max()
is what you would expect:returns the largest finite value of the given type
Now you may rationally assume
numeric_limits<T>::min()
would be the counterpart:Returns the minimum finite value representable by the numeric type T.
BUTT there is a gotcha:
For floating-point types with denormalization, min returns the minimum positive normalized value. Note that this behavior may be unexpected, especially when compared to the behavior of min for integral types. To find the value that has no values less than it, use numeric_limits::lowest.
Yup, the opposite of
max
islowest
which is BTW added in C++11. Luddites sticking to pre-C++11, please die, stop bundling boost because you want to support that crap, do please die.
-
@cartman82 said in WTF Bites:
Google interview experience
9. There's an array of 10,000 16-bit values, how do you count the bits most efficiently?
Me: you shift the bits right on all the 64-bit words, the Kernighan way.
Recruiter: no.
Me: there are faster methods processing 64-bit words with masks but I can't explain it over the phone, I must write code.
Recruiter: the correct answer is to use a lookup table and then sum the results.
Me: on which kind of CPU? Why not let me compare my code to yours in a benchmark?
Recruiter: that's not the point of this test.
Me: what's the point of this test?
Recruiter: I have to check that you know the right answers.I'm lost. Apparently the answer is not
10000 * 16
, so what is this question even asking?
-
@Dreikin I think it's asking to count how many bits are set
-
@LB_ I think so too. I also think the lookup table solution may have been efficient on some historic (probably 16-bit) hardware, but on modern hardware with the CPU much faster than memory you want to do it the math way on 64bit words. Probably trying for an algorithm you can vectorize.
There's probably more suitable places in the larger program to be squeezing out cycles at too. Like whatever is generating that array.
-
@ben_lubar http://www.businessinsider.com/why-an-older-google-contract-programmer-left-google-2016-10
-
@PleegWat I'd either try one of the
__popcnt*()
intrinsics (that compile to a singlePOPCNT
) instruction, or go for some unrolled/interleaved version of sideways addition. That is probably vectorizable, so as you say, it could perform quite well in this case. (The lookup table is fairly easy to implement, so it might be worth measuring just to be sure, though.)
-
Last night, Boss did a bad
UPDATE
on our main table, and paved over a nice chunk of very important data.He didn't do a backup first.
He also didn't know there are other tables that are tracking the same data, so now they were out of sync.
So I had to write some more queries and smooth over all data to match Boss's screwup.
Except, Boss didn't think the new data looked "realistic" enough, so then I had to go back and manually fuzz some numbers, so that dashboard looks the same as screenshots he had from before.
Of course, this once again puts tables out of sync. Will reports look consistent? Will calculations work? Who knows!?
So how was your evening?
-
it might be worth measuring just to be sure
This. Let's stop making an ASS out of U and ME and get some data. ;)
-
@dkf Ok, then. 10000 iterations with 10000 16 bit values each:
- LUT: 46673µs
- as 16-bit integers with POPCNT: 43270µs
- as 64-bit integers with POPCNT: 10786µs
- with the generalized popcount here: 15063µs
- with the generalized popcount on 64 bit integers: 16093µs
CBA to do a manual SSE version. Notes: uses
_mm_popcnt*()
forPOPCNT
, of which there is no 16-bit version. Therefore the 16-bit version uses_mm_popcnt32()
already, albeit on each 16-bit integer separately. Despite this, it already wins over the LUT [on my CPU]. The 64-bit version additionally peels the head/tail to ensure proper alignment etc.
-
-
So @royal_poet just installed Win10 AU. Spare us the idiot comments, we know, it's AU.
And Cortana re-established herself, the condescending intrusive cow that she is.
I got to observe @royal_poet yelling a little at Cortana, with the final line of 'Cortana, fuck off', which not removed Cortana from the taskbar but also opened an Edge window, to Bing for the search phase, and I quote,
Cortana, f*** o**
.Not sure if good idea, bad idea, quixotic idea or simply WTF, but it seemed like a small bit of that we can all enjoy, especially as values of will vary.
I scrolled a bit through the twitter feed of the https://twitter.com/internetofshit and I found these ones hilarious:
-
22GB seems like an appropriate size for a Resharper solution cache.
(I don't know how big it would have gotten, I killed the process when I saw it was writing 6Mbps to disk continually.)
-
22GB seems like an appropriate size for a Resharper solution cache.
(I don't know how big it would have gotten, I killed the process when I saw it was writing 6Mbps to disk continually.)
SpaceMonger!
-
22GB seems like an appropriate size for a Resharper solution cache.
(I don't know how big it would have gotten, I killed the process when I saw it was writing 6Mbps to disk continually.)
TL;DR: ReSharper was downloading Guild Wars 2.
-
(I don't know how big it would have gotten, I killed the process when I saw it was writing 6Mbps to disk continually.)
Building a large full-text-search index of all the cases it could use for its suggestions?
-
Still doing react native development for an outsourcing partner. Vance is the guy who is responsible for most of the abortion-quality code I've been fixing.
Me: Vance, why are you saving cached images in document storage instead of cache storage?
Vance: No idea, I just copied it from some example.This is typical of the sort of crap he produces. It works, but not really, and someone has to go behind him and fix it up.
Oh, and lets not forget that this whole caching mechanism is being coordinated directly from components, instead of some service class. So as components go in and out of the screen, you're getting half-completed downloads, leftovers, duplicates, etc. And all of that permanently stuck inside app's document storage bucket.
-
@cartman82 said in WTF Bites:
It works, but not really, and someone has to go behind him and fix it up.
Really sounds like it would be more efficient to fire Vance...
-
PROBLEM: Our legacy api is messy and difficult to fix.
SOLUTION: Create an importer that periodically dumps everything from the old API into elastic search, then make a new API that will serve data from elastic search.
PROBLEM: Our new api is messy and difficult to fix.
SOLUTION: ... sigh.
-
@cartman82 Is the problem:
- our problem domain is complex,
- we don't really understand it,
- our requirements specification is a mess, or
- all of the above?
-
@Bulb As far as I understand, the problem with old API is that it's a crusty legacy beast that a lot of legacy customers depend on, so no one is brave enough to touch it.
The problem with new API is that it was written by Vance (see above). So it was written hastily, just to push the turd out the door as quickly as possible. And now that who knows how many devices depend on it, it's too late to refactor properly.
-
22GB seems like an appropriate size for a Resharper solution cache.
(I don't know how big it would have gotten, I killed the process when I saw it was writing 6Mbps to disk continually.)
Stop lying and admit you're keeping your porn there.
-
Had to do a triple take on the registration number whilst my brain was screaming before things settled down
UK SWAT - You saw it here first
-
Vetting Halloween costumes isn’t a matter of telling people what to wear. It’s a matter of paying respect to the stories and experiences of marginalized groups who are depicted in these costumes: their culture, history and lives should never be desecrated, but understood and celebrated.
Other prohibited costumes include (but are not limited too): ...(suicide, rape-related)...Costumes that represent a cultures’ traditional dress.
-
Vetting Halloween costumes isn’t a matter of telling people what to wear. It’s a matter of paying respect to the stories and experiences of marginalized groups who are depicted in these costumes: their culture, history and lives should never be desecrated, but understood and celebrated.
Other prohibited costumes include (but are not limited too): ...(suicide, rape-related)...Costumes that represent a cultures’ traditional dress.
It makes no exceptions for people from that culture/ethnicity (Except for the flow chart, which seems to be a separate check). Good job on diversity!
They're also oddly specific about Caitlyn Jenner. So I guess a costume mocking transgender people is okay, but a woman happening to wear the same dress as Caitlyn Jenner once did isn't.
-
It makes no exceptions for people from that culture/ethnicity
Why would it? If I put on blackface, it's no less offensive for my being black. Something's either an offensive stereotype or it's not.
-
@loose Also note the side of the vehicle that the driver sits on (as indicated by the steering wheel). It seems that Chevrolet does do some small trucks in the UK, though they're not a huge seller.
-
-
@ben_lubar said in WTF Bites:
@Yamikuronue said in WTF Bites:
If I put on blackface
What if you're dressed as a coal miner?
Or what if you undressed altogether?
-
@Yamikuronue said in WTF Bites:
It makes no exceptions for people from that culture/ethnicity
Why would it? If I put on blackface, it's no less offensive for my being black. Something's either an offensive stereotype or it's not.
I'll grant that one, but if a Japanese woman wants to wear an authentic(-ish) Geisha costume, why shouldn't she be able to? Or a Native American wear traditional Native American dress?
Or what if a muslim woman doesn't dress up and wears a hijab?
The top section doesn't make any allowances for that. It just flat-out states they're prohibited.
-
@Dreikin It's probably just simpler to ban it all than it is to try and police the nuances. Let's be honest, nobody's going to that much trouble for keggers on campus, you know?
-
Judging from that flowchart, they also banned St. Patrick's Day.
-
-
they also banned St. Patrick's Day.
There is always a
silver liningpot o' gold at the end of the rainbowLTFY
-
On the way to work today, I drove alongside a pickup truck for a local auto repair shop that had a lot of broken body parts. The rear fenders in particular were quite smashed up, and obviously "repaired" with little dabs of the gray body repair stuff (I forget what it's called) in rows so that it looks like it was stitched back together.
(It did not appear to be trying to go for a "Frankenstein's Monster" look.)
(I should have taken a picture, but didn't think of that until too late. And I was driving.)
-
@djls45 that would actually be interesting self promotion. "we keep this piece of shit running"
-
@djls45 that would actually be interesting self promotion. "we keep this piece of shit running"
But it was a new(-ish) truck!
-
@loose it has a UK number plate from 2002 on it.
-
-
@Zecc YMBNH.
-
@Arantor I meant how it was an underhanded context switch.
To the naked eye, those comments could be read in sequence and still make sense, but they are talking about different things.
-
@Arantor Hmmm, no marker...
...
...
OK , buttumeHere's how it works: I click a UK news item expecting a UK news item. I get confronted with an image that would not be out of place in any US cop show. Brain freaks out and provides me with the only possible explanation (as it does because it is incredibly lazy and will hand out the first answer in the hope it is accepted - this is true!) and tells me that this is "OK" because there is a Northolt in America - probably New England. You haven't read it right; you clicked the wrong link; they probably screwed the link up; etc.
Meanwhile: I'm desperately trying to find confirmation; re-reading the headline; considering going "back" to check / try again; etc. Finally I notice the UK number plate and try to wedge it into my brain with a crowbar and sledgehammer (Yeah, I know. A contradiction but we are dealing with a very stubborn "thing").
Eventually things settle down and, after deciding to share this with you guys, move on with my life.
@dfk You have to look really hard to see the steering wheel :)
-
@dfk You have to look really hard to see the steering wheel
I saw it straight away. I'm guessing I
look foram differentthings.