« first day (1512 days earlier)   

12:00 AM
@AshleyNunn The Meta questions?
@Ampt Yeah
or did you not want the actual answer ?
@AshleyNunn You design smaller systems that do the necessary parts, make the interfaces between them clean, and have larger systems delegate the things to the smaller ones.
And this is why you are all super awesome.
The issue is identifying what one smaller system does and how to present a clean interface... but thats a matter of practice.
12:01 AM
obviously I must just be doing OOP wrong, because no true scotsman would write any of that nonsense... :o
12:50 AM
@JimmyHoffa Ceremony.
OK, so I completed my first phone interview. He gave me three problems.
The first was "How do you get the third smallest number in a list of 10,000 random numbers?"
I told him "Put the numbers in a sorted list, and do a Linq Take(3)."
He said "but what if you wanted to do it faster?"
The second problem was "How would you get a list of every file in a file system?"
I'm not familiar with Linq. Is that largely the fastest option?
@Ampt yes
@RobertHarvey I hate this canned response -> People have this interview concept that no matter what people answer, they should press them for a better solution because no true scotsman fails to come up with improvements to their code. Sorry, some of us basically get simple things like that right the first time...
I think I accidentally had a screening interview tonight
@enderland you didn't bleed on them did you? No racial epithets? You're golden!
12:55 AM
@JimmyHoffa to be fair there wasn't a qualifier on how the numbers were sorted :P
@JimmyHoffa har har.
@JimmyHoffa "I would get the cars into the parking lot via dependency injection."
I think it'd be a similar gig to what @Ampt does, actually
I told him "Write a function that returns the list of files in a specified folder, and call it recursively for every folder in that folder, and so forth."
@enderland You sit around and do mandatory ethics training?
He said "How do you write it iteratively?"
I said "by simulating a stack."
12:56 AM
@Ampt no I'd skip that, I figure it'd be easiest to not go, that's the most ethical amirite
Or, you could try for tail recursion.
He said "What's that?"
lol. I'm getting the vibe Robert you hit a Hr phone screener type who basically wants to make sure you actually can program?
And was reading a script?
@Ampt the linq part isn't the fast portion-> the fact that they were in a sorted list kind of solves the problem for you... there's no way to get the smallest number from a list of numbers without sorting it, and using the standard sortedlist implementation in .NET is the right way to sort a list...
@enderland He seemed a bit... nervous.
12:58 AM
@RobertHarvey So he's been doing this for 6 months and is now interviewing you, an experienced programmer
You could make one pass through the list and keep track of the smallest 3 you've seen. Linear vs. NLogN, and probably actually faster (slightly) as well.
Q: Where can I ask a question regarding Private sector algorithms becoming available to the public?

T.WoodyWhere can I ask a Question regarding the following matter? What this question should ask is: 1. When are private sector algorithms going to be released to the public? 2. Are these algorithms just implementations of scholarly articles and other sources of Academia, implemented in the pr...

As an aside, if you have difficulty getting the meta question opened here, I would urge you to ask in the whiteboard chat room. Its associated with the Programmers.SE site where the topicality of the question would be more appropriate (though, as I mentioned, as asked this question would likely be closed). The chat room, however, doesn't have such restrictions about open or closed and the people there are familiar with the issues. The room is most active 9-5 M-F (work day second monitor). — MichaelT 11 mins ago
@psr I told him there was no way to do it without touching every number.
@psr depending on how you implement, you could do 3 comparisons per N, but that's still just 3N or N.
Making it an O(n) problem.
12:59 AM
True, but it's faster to touch each number once than sort it.
Yes, you only have to touch each number once.
@psr true enough. I still want to complain about people pressing for improvements just arbitrarily. :)
So the right answer depends on whether or not you're only doing it once. If you're adding numbers to the list and still want an answer, it's better to use a SortedList, even though it's more expensive to add the numbers initially.
Or for a large enough list you could do crazy math stuff to crack the random number generator, maybe. Well, I couldn't, but still.
The third problem was "Find the three points that are closest together in an x-y matrix."
1:02 AM
:18298309 dude, she's with The One, that'll never work.
I asked him how many. He said a 1000 x 1000 grid with, say, 10000 points in it.
You just gotta follow the white rabbit if you know what you mean
I gave him the naive algorithm.
@RobertHarvey relatively sparse then
Ah, I see where you're going with that.
It's been a long time since I've interviewed with anyone. I think this first one is a practice run.
1:04 AM
@JimmyHoffa Dogma reference, right?
@RobertHarvey so did your last contract appraisal not go so good? Sorry to hear, seems I'm hearing a lot of people losing space in the employed population lately; If I paid attention to economic indicators I might know this is a known thing? shrug
@RobertHarvey it's mostly to prove that you aren't stupid
@GlenH7 Matrix? Really?
@RobertHarvey Wouldn't sweat it.
@Ampt Dogma doesn't have a similar line? #shamed.
@RobertHarvey what is the naive algorithm in this case? :)
1:05 AM
@JimmyHoffa The new prime contractor under-bid the contract. A non-trivial number of people lost their positions.
@RobertHarvey Sounds like you passed the screen to me. It's usually to weed out the inept, though it's possible they think the naive algorithm for the matrix isn't good enough.
BTW: Google Play is giving away a free copy of Deadmau5 4x4=12
@enderland You mean with a sparse matrix? Different than the one I gave him. The one I gave him looks at all of the slots.
@RobertHarvey Well I'll still love you no matter what happens.
With a sparse matrix, you could probably get away with just looking at the points and the distances.
@Ampt Psssh.
1:06 AM
@RobertHarvey All of your answers after responding with Linq were perfunctory
Yes, probably.
But why bother putting it into a sorted list if you're going to run line against it?
@RobertHarvey i'm trying to think how I'd do this in an efficient way. I don't want to really look at each possible combination of 3 points.... 10,000x9999x9998 seems like a lot of calculations :P
I'm thinking that this could be put in a graph
Closest together using Euclidean distance?
1:08 AM
@Ampt this is where my lack of comp sci background hurts me :\
@enderland Sticks and stones make break my bones but graph theory crushes my soul.
@enderland It seems to me like a modified "traveling salesman" problem.
@enderland one of the reasons I bone up on this stuff as much as I do... no CS background-> I had no idea what a lot of things like that were for a long time, eventually it got to me enough to try studying it a bit.. (turned out studying it was as miserable as I thought it would be)
@Ampt - Are you thinking Euclidean distance of X,Y coordinates?
I think you can remove a lot of the combinations
by looking at the graph
1:11 AM
@JimmyHoffa Yeah. But.. does that mean if I get interested in every one of these conversations and try to figure things out and understand them that I turn into you after 10 years? ha
pick two points. every point further than that in either direction can be removed
@enderland no, you'd have to start out a lot dumber to reach my level of depravity...most people know better from the start and don't follow the rabbit hole until they're lost...
9 hours ago, by enderland
I will have rabbits doing my work for me clearly
Index on X, index on Y, go through nearest in X and use that to exclude Ys until you have no more to check?
1:13 AM
@enderland see, you've already figured out a far better solution
There's a solution for this and it's just outside of my memory and it's killing me
Yeah, mine is pretty meh
hat tip to @RobertHarvey on that link, actually. But it's a good, free download on graph theory.
@GlenH7 I hear that's what they use at FB for perfromance
@Ampt in soviet russia, your soul crushes graph theory!! No wonder those guys are so good at C++ and math...
1:16 AM
Ah, here's a possible candidate, Nested Triangles
@RobertHarvey my brain hurts and it's late and basically friday for me
@enderland do the sensible thing, pour a glass of scotch, and wash it down with Netflix.
@JimmyHoffa I was thinking the book I started last night
(or payday 2)
pew pew, there goes a few cops
Lisa Olsen

“I couldn’t help but think we were finally over the worst of our troubles. I was such an idiot.” The bad guy’s dead and gone, Jakob’s given Rob and Anja his blessing and left town, so everything should be smooth sailing, right? Right? Not so fast. Lodinn’s still wreaking havoc with their lives from beyond the grave as the search for Carys pulls Bishop and Jakob into the most unlikely of partnerships. As Anja settles into her hard won bliss, she finds that things aren’t necessarily happy ever after as Rob’s mounting secrets begin to take their toll. All around her violence against humans is spilling into the city streets, threatening to expose vampires to human eyes and bringing vampire hunter Carter back into the picture. His direct but effective methods lead her to ask – is it wrong to kill a killer? Is there anything she can do to bring the violence to a halt apart from compelling the entire vampire community to her will? When Bishop discovers Carys’ long lost diary, it holds the key to his past as well as Rob’s future. The burning question remains – is Carys really alive out there somewhere or was it merely a beautiful lie and Lodinn’s final revenge? And can Anja survive a betrayal so deep it shakes her to the very core?
@enderland ? yeah I know, my wife's pestering me to read it too...
1:18 AM
The nonfiction book The Last Stand of the Tin Can Sailors: The Extraordinary World War II Story of the U.S. Navy's Finest Hour is the first full narrative account of the Battle off Samar, which author James D. Hornfischer calls the greatest upset in the history of naval warfare. Published by Bantam Books in February 2004, the book won the Samuel Eliot Morison Award for Naval Literature in 2004 from the Naval Order of the United States. A Main Selection of the Book-of-the-Month Club and the Military Book Club, the book tells the story of the remarkable two-and-a-half-hour sea battle fought on October...
The optimal algorithm would exclude looking at points the distance of which is clearly going to be larger than your closest distance found so far.
@enderland mine sounds way more entertaining, and far less stressful.
Oh, sorry. Talking about books now.
No, I'm not
I wonder if you could look at the perimeter as some sort of indicator
Steven Brust
Tor Books

Years ago, Vlad Taltos came to make his way as a human amidst the impossibly tall, fantastically long-lived natives of the Dragaeran Empire. He joined the Jhereg, the Dragaeran House (of which there are seventeen) that handles the Empire's vices: gambling, rackets, organized crime. He became a professional assassin. He was good at it.But that was then, before Vlad and the Jhereg became mortal enemies.For years, Vlad has run from one end of the Empire to the other, avoiding the Jhereg assassins who pursue him. Now, finally, he's back in the imperial capital where his family and friends are. He means to stay there this time. Whatever happens. And whatever it takes.Hawk is the latest in Steven Brust's New York Times bestselling Vlad Taltos series. “Watch Steven Brust. He's good. He moves fast. He surprises you. Watching him untangle the diverse threads of intrigue, honor, character and mayhem from amid the gears of a world as intricately constructed as a Swiss watch is a rare pleasure.” —Roger ZelaznyAt the publisher's request, this title is being sold without Digital Rights Management software (DRM) applied.
1:20 AM
if two points are further than that you could automatically exclude them
@JimmyHoffa that sounds like all the ridiculous things in the past years put into one book
@RobertHarvey Any candidate who didn't know that off the top of their head would be an immediate no-hire, yes.
@Ampt I had initially thought to find the distance all points are from 0,0 and then order them by this, and do some sort of check on every 3 point combinations going up the list
@enderland yours sounds like a hellish time of wet, cold, death, and misery. I get enough of that at work.
@JimmyHoffa I am far too interested in world war two history
1:21 AM
@JimmyHoffa not installed on this commputer. trying to install payday 2
been downloading it for like 2 hours... my gfs internet blows
stupid ass comcast thottles her internet to piss
@MichaelT I keep thinking I should read these
@AshleyNunn they're good. Not too long, though on the flip side after reading one, you may find yourself re-reading all of the ones prior.
@Ampt this is why for the first time in years, I got off comcast when I moved last...couldn't have been a better decision. All that "DSL is slow" shit I remembered from the 90s; so not true anymore...
@MichaelT Ah, fair enough :)
my DSL is way better than the throttled-to-shit comcast I had last time I had to setup internet...
1:23 AM
Sometimes, the book requires a rereading just up front because of how its written.
I am reading a local author's book right now about a kid who gets sucked into a LoZ like video game world
yeah DSL can get you pretty good speeds
our internet is capped at 3mbp/s
@enderland have you tried turning it off and back on again?
@JimmyHoffa nah we're cheap
1:24 AM
He does wonderful things with chapter titles / flavor text. For example, one starts out with a prologue with a laundry list (blood spot on shirt). Then, each chapter, that bit of clothing that lead the chapter flavor text needs to get cleaned for the reason in the laundry list in the prologue.
In another book, it seems like's he's jumping back and forth between two timeframes. And he is. The chapter flavor text seems a bit odd... and then in the end you realize that it was a spell being cast taking place at the end of the first timeline and just before the second timeline.
I think I may have figured out an optimization.
The naive algorithm is O(N^2), but if you store the nearest neighbor with the point, you only have to take the hit once.
If you glance at en.wikipedia.org/wiki/Steven_Brust#The_Dragaeran_books you'll note the chronological order of novels has some jumps all over the place.
Yeah, I knew about that (friend of mine loves the books, and explained that to me)
1:27 AM
Ack. That's not going to work. You still have to recalculate each time.
Never mind. [slinks away]
For example, Tiassa takes place in the early bits, the late bits, and the very late bits... the last two bracket another book that was released just before... and so the additional insight into the setup in Tiassa makes Iorich make a bit more sense... so you go back and re-read it.
Oh, I see how they get you ;)
@enderland my ISP just doubled my internet from 30 to 60 for free
Though, I'll still suggest that you should always read the books in publish order (unless its re-reading a specific one).
@RobertHarvey But that's programming - you take an approach; see if it works; and re-evaluate from there. Claiming anything else is just lying.
1:29 AM
@MichaelT Thats how I generally approach new series
Dragon is another jump around... and Orca is one that makes you go back and read all the prior ones with some additional knowledge.
man we're all here all day every day, or at least United states time zones
@RobertHarvey the algorithm design manual is free online (just google it) and it opens immediately to a bunch of graph stuff and talks in pretty simple terms, worth poking at if you're concerned about getting more questions like that as you interview etc
If you happen to be a fan of the Three Musketeers...
The Khaavren Romances are a series of fantasy novels written by Steven Brust and set in the fictional world of Dragaera. The novels are swashbuckling adventure stories involving war, intrigue, and romance. They are heavily influenced by the d'Artagnan Romances written by Alexandre Dumas. == Books == The Phoenix Guards (1991) Five Hundred Years After (1994) The Viscount of Adrilankha, published in three volumes: The Paths of the Dead (2002) The Lord of Castle Black (2003) Sethra Lavode (2004) The title of each book roughly corresponds with its equivalent in the d'Artagnan Romances. The Phoenix...
Three musketeer novels: The Three Musketeers, Twenty Years After, The Vicomte of Bragelonne.
@Ampt we're giving out free (throttled) bandwidth! Everybody sign up with us, 50mbps? Done! 200mbps? Done! 1tbps? Done! As much as you want (throttled)!
I tend to take those numbers with a grain of salt anymore
1:31 AM
@JimmyHoffa nah, this isn't comcast/TWC
The Khaavren novels: The Phoenix Guards, Five Hundred Years After, The Viscount of Adrilankha.
it's a small local company
@RobertHarvey Did you look at that nested triangle problem?
you would do that and find the smallest one
@Ampt I kid, just funny how that stuff is advertised by the big companies; the numbers really don't mean shit when they just throttle you to whatever they feel like
@JimmyHoffa Oh I agree
it's some bullshit
we'll give you 20mbps, but if you try to use 20mbps we'll throttle it to 10...
1:34 AM
and if you use 10 we'll throttle it to 5
It's magical!
2:00 AM
@JimmyHoffa Thanks!
@ampt: ---^^
2:18 AM
well that's 2 pair
now you need another
the problem is that the closest pair may be a ways from the next closest, meaning the smallest area doesn't necessarily have the smallest pair
2:32 AM
@Ampt It's a recursive algorithm. I don't know quite how it works yet, but I'm going to study it when I get the chance.
Anyone here know a good OCR program for a one-time OCR job? (about 30 pages)
Is FreeOCR any good?
1 hour later…
3:41 AM
badge :D
Anyone know where the C# room is?
Links anything please?
@MichaelT Thank you ^.^
@7Blue_Beast7 (its part of the StackOverflow set of rooms - you can see all of them at chat.stackoverflow.com/rooms )
I did find the room but I saved the link you gave me just in case
Oh, thats nice. (sqllite browser for firefox... addons.mozilla.org/en-US/firefox/addon/sqlite-manager ) - don't want to have a full blown database and all its headaches (how many things can go wrong?) for the interview 'homework'.
4:20 AM
@MichaelT They gave you homework?
Two programs. One a web app, the other a system admin type script.
Its material for them to use that has a consistent interface that can allow part of the interview to be a code review.
Makes sense, I guess, it is just so far out of the realm of the relatively normal non-programmer stuff I experience :)
@MichaelT [takes test, writes employer's program for free]
Seriously, though; they're making you write an app?
@RobertHarvey The web app is a trivial one - crud with four fields. The sysadmin script is also a rather trivial one and would be the afternoon hack of any sysadmin.
@RobertHarvey Part of the job description is secure programming. There are far to many php types that when writing a crud app completely ignore sql injection... much less XSS possibilities.
Without some sense of what the person will write, you've got no idea of if they actually understand the issues that exist.
Cross-site scripting (XSS) is a type of computer security vulnerability typically found in Web applications. XSS enables attackers to inject client-side script into Web pages viewed by other users. A cross-site scripting vulnerability may be used by attackers to bypass access controls such as the same origin policy. Cross-site scripting carried out on websites accounted for roughly 84% of all security vulnerabilities documented by Symantec as of 2007. Their effect may range from a petty nuisance to a significant security risk, depending on the sensitivity of the data handled by the vulnerable site...
@MichaelT And nearly all of that is the ECMAscript's standards committee's fault. f***ing globals.
4:31 AM
Its not a big deal to fix it so its not an issue, but one should be aware of it and write secure code in the first place. As I'm using Dancer: search.cpan.org/~bigpresh/Dancer-Plugin-EscapeHTML-0.22/lib/…

« first day (1512 days earlier)