|
If the project is fairly significant in size with multiple .c and .h files with many functions, I will often turn doxygen (with graphviz) loose on it. Even though the code may not have any doxygen tags or doxygen-compatible comment blocks to generate function and API documentation, it can still give you an idea of "what calls what" in a graphical context.
|
|
|
|
|
My understanding of ranked voting is that a voter puts down his choices as an ordered set, and for the first round, the #1 votes are tallied; if no one has 50%+1, then the lowest vote-getter gets discarded, and everyone who had him as #1 simply have everyone else move up a place, and the process repeats.
As long as there aren't too many candidates - and indeed, there is hardly ever more than 6 candidates who get more than 2% of the vote - than a complete list pertaining to the permutations of the candidates could be released, and done so as they are counted, like a canonical election. I use the number 6 because 6! - 720 is still a digestible number. In fact, the law could be written so only that the first round eliminates everyone outside of the top-6.
For example, using this 6 number, the state's Secretary of State could release the vote total of every permutation of the 6, and election-nerds like the gang at 538.com or the NY Times' (infamous) needle could crank the numbers as they see fit trying to put out the probabilities for the 6 at that instance.
|
|
|
|
|
how is it possible to discuss political elections without getting political?
|
|
|
|
|
There are different ways of implementing Ranked Voting.
Ranked voting - Wikipedia
"Time flies like an arrow. Fruit flies like a banana."
|
|
|
|
|
Ranking all (or all-minus-one) options would be tedious if there were many.
I imagine that "ranking your top three" would simplify things considerably when there are a lot of options from which to choose.
Maybe something like "top three or the SQRT of the number of options" would suffice?
|
|
|
|
|
If we use bit groupings for the ranks of each candidate, that would look something like:
Bits per candidate: floor(log_2(candidateCount)) + 1
Bits per vote: candidateCount * bitsPerCandidate
Total space for election: voters * bitsPerVote
So given 300,000,000 voters with 12 candidates:
space = 300,000,000 * 12 * (floor(log_2(12)) + 1)
space = 14,400,000,000 bits or 1.8 GB
Given the same amount of voters with 24 candidates:
space = 300,000,000 * 24 * (floor(log_2(24)) + 1)
space = 36,000,000,000 bits or 4.5 GB
Space definitely isn't the issue. What about the algorithm?
1) Bin every vote by first-pick candidate.
2) If no bin is >50% of the votes, re-bin the lowest bin and repeat #2.
3) The >50% bin is your winner.
I honestly don't see why this would be an issue. Worst case scenario something like v+(c-2)*(v/2) run-time where v is the vote count and c is the number of candidates. v/2 is just a napkin-math average since the redistributed bins would start out small and grow as the candidate list got shorter.
Again, just a bunch of napkin math so I probably missed something but I never bought the "it's too hard to compute" excuse either And I'm sure there are clever tricks to reduce the time required.
EDIT: For reference, if processing a vote takes:
1 microsecond: 30 minutes to determine a winner @ 300M votes, 12 candidates
1 millisecond: 20 days, 20 hours to determine a winner @ 300M votes, 12 candidates
And this is a single-threaded, un-optimized, brute-force approach.
modified 6-Jul-21 21:48pm.
|
|
|
|
|
|
Dan Neely wrote: You called out the problem here without realizing it. They're binning sheets of paper in stacks and counting the stacks.
I'll never understand how in the US we've been successfully testing millions of kids every year via paper "ballots" (scantron sheets) that are tallied electronically, but when it comes to our literal democracy we suddenly have the IQ of broccoli
|
|
|
|
|
And what exactly do you have against broccoli?
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
|
|
|
|
|
I mean... it's tasty but I'd rather not let it make decisions for me
|
|
|
|
|
Given some of my coworkers, broccoli voting just might be an improvement over the current state of affairs.
|
|
|
|
|
If Bruce Willis was found dead beside a bottle of Viagra, did he Die Hard?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
If he did, they might have problems closing the lid on the casket...
|
|
|
|
|
I don't know if I Cialis happening any time soon.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Some people may McClane that, but I don't think so.
|
|
|
|
|
All that stiff competition in Hollywood finally got to him.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Two stiff puns for the price of one!
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
Well that wasn't hard difficult!
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
He might get have just choked on the pills while trying to swallow them.
Did he complain of a stiff neck?
If you can't laugh at yourself - ask me and I will do it for you.
|
|
|
|
|
The Kid didn't Survive the Night in Sin City? He was within Striking Distance of being The Last Man Standing and winning The Whole Nine Yards.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Any one been subjected to breath analysis before they can code?
"Rock journalism is people who can't write interviewing people who can't talk for people who can't read." Frank Zappa 1980
|
|
|
|
|
Only when you pair program. One must have good oral hygiene when working so close.
|
|
|
|
|
Tic Tacs or mints should assist with your concern.
"Rock journalism is people who can't write interviewing people who can't talk for people who can't read." Frank Zappa 1980
|
|
|
|
|
More should, after looking at some code it appears what they been smoking ain't entirely legal.
The less you need, the more you have.
Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?
JaxCoder.com
|
|
|
|
|
I was specifically asking about alcohol breath analysis as opposed to drug testing.
However your comment is a valid point.
I have never smoked spaghetti and I didn't know that it was illegal to do so.
Your answer has given me new ideas though, for naming some of my classes, sub routines, functions and modules that I am not really happy about, but time restraints force me to include.
Some of these names are;
Tagliatelle, Ramen and Vermicelli.
It is the Vermicelli that is the most embarrassing.
For me drinking a little Alcohol impedes my ability to play sport, code, remember what I did, etc.
I am certainly not against it, but I am with regards to work.
I recently listened to a Professor who was working on testing people affected by different substances and how this affected their ability to drive.
It was quite interesting.
He was saying that people who had smoked the spaghetti, especially those who were used to it, actually drove far better than usual and better than others who were normal. They concentrated on the task of driving better than when they hadn't smoked it as well.
The interesting thing that he found was that whilst they were able to fully focus on the task, it was when things went wrong that they completely failed. As soon as there was multiple extra sensory input coming in they failed to cope as well as when they were un-spaghettied.
So I feel that the code that you reference in your post, is probably going to always be there regardless.
Still like you I have often said, "What have you been smoking?"
I can't recall ever saying "What have you been drinking".
"Rock journalism is people who can't write interviewing people who can't talk for people who can't read." Frank Zappa 1980
|
|
|
|