« first day (1121 days earlier)      last day (3846 days later) » 

user55340
1:33 AM
0
A: What is the big-O cpu time of Euclid's Algorithm of "Greatest common divisor of two numbers"

MichaelTThis answer draws from the answers within the SO question Algorithm complexity with input is fix-sized The first thing to do is to rewrite this as pseudo code with line numbers so that we can talk about specific loops. 1) def GCD(x, y): 2) while x != y: 3) if x < y: 4) x, y = ...

 
user55340
Enjoy. Three forms, one I go into detail with, one I gloss over and say go look at Math.SE if you want the explanation, and one that I reference TAOCP and say its got a bigger O, but its faster.
 
user55340
And chances are, the OP, when reading this, will either be completely enlightened, or throughly confused.
 
still?
 
user55340
As an aside, I stumbled across one of the earliest analysis of computational complexity in this. Lamé's Theorem published in 1844.
 
user55340
2
Q: Help understanding the proof of Lame's Theorem.

zerosofthezetaI think Lamé's Theorem is beautiful and really want to understand the proof. I am new to proofs, but after reading over the proof of Lamé's Theorem (and failing to understand it), I feel that I am capable of understanding it because it contained terms such as Fibonacci numbers, logarithms (base ...

 
1:40 AM
morning :)
 
user55340
> If implemented using remainders of Euclidean division rather than subtractions, Euclid's algorithm computes the GCD of large numbers efficiently: it never requires more division steps than five times the number of digits (in base 10) of the smaller integer. This was proved by Gabriel Lamé in 1844, and marks the beginning of computational complexity theory. Methods for improving the algorithm's efficiency were developed in the 20th century.
 
user55340
@MattD You gotta realize, you were talking this morning when I started work... its only a bit before 9pm here.
 
Sam
Hello guys. I just have a quick question
 
user55340
@Sam Ask away...
 
Sam
In regards to this question: programmers.stackexchange.com/questions/198085/… . I just wanted to know if it is considered bad practice if you actually specify the object type. E.g void FindDog(Dog d)
 
user55340
1:51 AM
72
Q: Is it poor programming practice to pass parameters as Objects?

RisserSo, we've got a guy who likes to write methods that take Objects as parameters, so they can be 'very flexible.' Then, internally, he either does direct casting, reflection or method overloading to handle the different types. I feel like this is a bad practice, but I can't explain exactly why, ex...

 
user55340
(just oneboxing it there... easier to get the context)
 
Sam
ahh
 
user55340
Nope - no problem at all if you pass a typed object to a parameter.
 
user55340
Its really impractical to pass some things as primitives or single things one at a time. And makes a mess for OO.
 
user55340
Consider, if I wanted to call d.bark() in your code, I'd have to reinstatiate the dog object.
 
user55340
1:53 AM
But maybe d.bark() also changes the state of the object, that can't be done if I'm passing around other things
 
Sam
Because I can definitely see the problem with void FindDog(Object d) as you really only want to accept dog
 
user55340
And I don't have access to any underlying subtypes. Because Chihuahua class defines String bark() { return "yip"; } and GreatDane defines String bark() { return "WOOF!"}
 
user55340
(fix the typo there... only the StBenard defines String bar() { return "rum"; }
 
Sam
Why would calling d.bark() reinstantiate the object if it has been passed in as a parameter?
 
user55340
I've got a method playWithDog(Dog d) { this.throwStick(d); d.bark(); }
 
user55340
1:57 AM
If you make it playWithDog(Object d) { ... }, I might accidently pass a Cat in. And then you'd have all sorts of casting exceptions thrown when you try to make the cat into a dog and make it bark.
 
Sam
ahh right
 
user55340
The idea behind "pass in Object" as a parameter (and you see a subtype of this as "no objects, HashMaps for everything") is you don't have any type safety on it at compile time.
 
user55340
All your errors will be found at runtime, and thats bad.
 
user55340
The code then also gets convoluted...
 
Sam
Makes sense
 
1:59 AM
0
Q: What if widely used software dependencies were all lost?

TruthOf42Are we ever in danger of being unable to fully debug a piece of software and all of the components that went in to making it? For instance let's say there is a compiler that has a bug in it (which is because of a bug in some "dependency's dependency"). That compiler was probably written in some ...

^^^ This actually made me laugh; but I am easily amused.
 
user55340
playWithPet(Object o) { if (o instanceof Dog) { ... } else if (o instanceof Cat) { ... } ... }
 
user55340
Why not make different methods that take different objects as parameters and then split out that casting?
 
user55340
Some people think this gives them more flexibility, but that just makes it MUCH harder to maintain.
 
Sam
Wouldn't an overload be more suitable?
 
user55340
(as an aside, I've seen the "creating objects is too tedious, we just create Hashes and pass those around" code... and then you have one typo in a key.. and boom)
 
user55340
2:02 AM
@Sam Absolutely. playWithPet(Cat c) { ... } playWithPet(Dog d) { ... }
 
Sam
Is there any circumstance where it would even be appropriate to pass a generic Object in? I can't think of any.
 
user55340
Very, very rare.
 
Sam
Thanks for the help :)
 
user55340
Occasionally, you'll be doing metaprogramming on it. Where you use java's reflection or something similar to find out information about the object - what fields it defines, what method it defines and then call those that way.
 
user55340
Also, in message passing runtimes rather than call runtimes, you can just be sending a message to something and not really care if it errors out or not.
 
user55340
2:06 AM
@Sam ObjectiveC is that way. One could have (pardon my unfamiliarity with it) Cat c = ...; [c bark:loud]; -- thats perfectly acceptable. Just the cat will ignore that message call (cats have few things defined and ignore most things).
 
Sam
oh right
 
user55340
There's some advantage to those approaches - it tends to be easier to implement some patterns that are often associated with GUIs.
 
Sam
Well, thanks for everything. I'm going to head off. Have a nice day :).
 
user55340
You define a heirarchy of objects. Here's an image in a pane in a button. And you click on the image. The image doesn't care about the message, so it sends it to the pane. The pane doesn't care about it, so it forwards it on to the button... which does care and handles it.
 
user55340
@Sam Have a good ${time of day}
 
4:54 AM
@GlenH7 yes, incredibly bad. Gem of a crappy answers. "Grades has turned many guz into lazy bones blah blah". Guess it was "inspired" by a bit less crappy answer that was sitting there for ages...
-1
A: Do companies care about university grades when hiring programmers?

brad clawsieour field has embraced specialization of labor. your grades need to be good enough to get you the interview...after that, technical mastery is probably all that matters. in the days when most coders were generalists, academic achievement over a broad area of subject matter was important. these da...

broken windows and such
that one is sort of "inspiring", too. No txtspk but... just crap
oh wait that one fits Not an answer, nice. Will flag
 
lol
is it normal to suffer irrational hatred of people who downvote answers because they dont agree with it on an opinion level?
some guy downvoted me for writing true and false. wtf.
anyway
 
 
4 hours later…
9:08 AM
74
Q: Feedback request: New top bar and MultiCollider redesign

Jeremy TunnellTL;DR: We’ve incorporated a ton of your requests for the top bar into a new version, and we’re going to ask you to test it here on Meta sometime in the next 2-3 weeks (double-time!). First, we wanted to share the current work in progress and get your input on anything glaring you think we shoul...

> There are two things that we haven’t addressed here that we are still working on: mod messages and hot network questions. We will figure those out over the next few days...
I think it's about time to put additional bounties into top questions about hotness-score related issues, to better prepare MSO audience to coming discussions. I just put a bounty to What formula should be used to determine “hot” questions? and am planning to put yet another to "sticky questions"...
29
A: Don't let questions stick to the top of the hot questions list forever

gnatOne problem with hot questions seems to be that there is no way for "hotness algorithm" to differentiate genuine popularity from fake one, that is from popularity introduced by the algorithm itself. The issue probably wasn't even noticeable when current algorithm was introduced in 2008, since S...

I have 3 active bounties on MSO now and will be able to offer next one on Monday. If you believe that this will be useful, feel free to invest 50 rep into it
 
 
4 hours later…
user41796
1:18 PM
@MattD we have all had those moments, yes. I tend to be a bit provocative with some of my answers, especially when the ways things are phrased it's not clear cut.
 
user41796
@gnat I'm not convinced that there isn't a bug in the way the hotness formula is calculated right now. Or more accurately, my understanding of the time decay function is incomplete and I don't see how it's supposed to work. It's not working the way I would expect it to work though.
 
1:48 PM
@GlenH7 interesting. I need to dig this a bit deeper. But it somehow decays (in non sticky questions), right? :)
 
user41796
2:37 PM
@gnat - My observations are based upon the listed collider score and what I calculated for the numerator from Jeff's formula. Somewhere around the 7 hour mark after having been opened, the denominator went from less than 1 to greater than 1. So in the first ~7 hours, the time decay is actually acting as an accelerator on the score. And it only starts to slow the growth after that 7 hour mark. The question was constantly active, so I don't think the "last active" portion was doing much ...
 
user41796
... doing much or doing what it was expected to do from my understanding of the formula. That's why I asked in chat eons ago about how it was supposed to operate. I believe Thomas pinged Anna & Shog with my question, but I haven't heard back on the matter. Keep in mind I wasn't promised an answer on that portion of the formula either, so I didn't expect to hear back.
 
user41796
So I think it's supposed to decay the collider score, and it appears to do so after those first 7 hours. But I couldn't divinate the correct behavior of the formula based upon the scores I saw and how the denominator in the formula was expressed.
 
2:56 PM
@GlenH7 a-ha. I think I am beginning to understand. It looks like sort of undocumented magic is going on first 7 hours. Given how it works (on questions that aren't hit by too many answers), it feels like intentional, sort of additional normalization / push for questions that are "too young" to compete with more mature ones. Hmmm I probably understand the motivation, but can not figure how it is supposed to be better than straight denominator, without these 7 hours of magic
 
3:24 PM
oh I got it I got it. 7-hours magic makes it easier for visitors to arrive while question is still fresh, has little or no answers and votes. Then they can watch its activity "live", how answers and votes appear. This adds suspense, fun, intrigue... and, the last but not the least, motivates them to stick around longer than just needed to read question and answers(s) - and, possibly, look at other questions at the site
now this makes good sense to me. The only thing I really dislike is, it's not documented
Glen and gnat Reverse Engineering, Inc. Bring us your hot crap and we'll tell you what it does
 
 
2 hours later…
5:00 PM
interesting how bug in formula damages this feature, just how it did to everything we looked at before. Questions with artificially high score push valid ones out of collider. As a result, instead of intriguing "live translations", collider visitors watch piling of boring, repetitive, zero score answers, on and on and on, over and over and over again
 
 
2 hours later…
6:33 PM
posted on September 28, 2013 by Stack Exchange

Selling software isn't like selling cars or real estate. Don't sell yourself short.

 
 
3 hours later…
user55340
9:31 PM
Sorry mod types about those flags (its a bunch of 'em)... but an xkcd image is not an answer. There are a bunch more that only mod types could do something about - they're in locked questions. data.stackexchange.com/programmers/query/edit/139689
 
@MichaelT keep dreaming ;)
I've been busy with the significant other all weekend. It was her birthday thursday
 
user55340
9:53 PM
@Ampt heh... (looking at things I commented on that have a negative rep)
 
user55340
I think designing a mobile device with a built in finger print reader and getting that out in the public is going to be your first step. Without the technology, this is an exercise in triviality. — Ampt Jul 1 at 14:33
 
Haha did I predict the future? Does this mean I can sue apple?
@MichaelT thanks for pointing that out.... I never even downvoted that question
User user. How was that not taken?
half tempted to follow him around SE commenting on all his posts with "I FIGHT FOR THE USER"
 

« first day (1121 days earlier)      last day (3846 days later) »