« first day (595 days earlier)      last day (3422 days later) » 

5:00 PM
Will think on it. By the way, do you understand the 'magic' in my answer?
do you understand why it is so much more efficient than the others?
 
Yes, there is much less addition.
 
do you understand why there's the bitmask against the val?
 
No.
Why couldn't this: ((val & mask) == mask) not be (val == mask)?
 
I'd say weekdays around 17:00 - 21:00 UTC probably have the highest activity!
 
Isn't & just bitwise AND?
 
5:03 PM
Think of a number, like.... 10.... in binary, it is: 01010
 
Yes.
 
now, that's 1 value of 8, and another of 2.
(8's and 2's column).
 
Yes.
I just removed that to see what would happen, and it only works for powers of 2: ideone.com/wNQ6J1
 
Now, 10 * 1 is 10, right?
 
It should be.
 
5:04 PM
and 10 * 8 is 80.
and 10 * 10 is 10 * 2 + 10 * 8
 
Yes.
 
or.....
10 * (2 + 8)
So, what we do in the solution I propose, is find the power-of-2 factors of 10...... and add the power-of-2 products of the value.
the power-of-2 products are simple additions..... just doubling things.
has the penny dropped yet?
 
@rolfl how would this work for something like 7^2, just curious.
 
SOrt of.
Reading the code again.
 
argh, curse you ipad that wont let me edit
2
 
5:07 PM
There are two 'marching' values in the loop. The first is the mask, the second is the factorSum.
the mask is a power-of-2 (1, 2, 4, 8, 16, ....)
 
I get that.
and factorSum is a power of val.
 
the factorSum is a power-of-2 multiple of the input value, for @Phrancis's example, it will be: 7, 14, 28, .....
 
This is the only part I don't get: ((val & mask) == mask).
 
THink back to the binary.......
if val is 10, it is 01010....
 
mask always == mask, so why doesn't val == mask work?
 
5:10 PM
the mask, for the 2nd power of 2 will be 00010.
the bitwise & happens before the ==
 
Oh, hold on, I think I get it.
0110 & 1001 evaluates as 0000?
 
the mask is never 1001.
there is only ever 1 'set' bit in the mask.
 
And 1100 & 0100 evaluates as 0100?
 
Lol. @rolfl I would have to raise over 350 flags in the next two weeks.
 
I'm thinking about the & operator, not mask, right now.
 
5:12 PM
@Hosch250 Yes, exactly.
the & operator is a bitwise AND.
 
OK, now I get it.
Thing number one for today.
Boy, I learn a lot here.
3
 
It's an interesting thing, sometimes, how binary numbers, by definition, are able to be useful in so many ways.
 
Just wait until computers leave the binary world.
 
Yeah, computing math will change radically.
 
Then the trinary or whatever will be really useful too.
 
5:15 PM
Note that the same logic can be applied to regular products, not just squares.
 
Yes.
 
Hey
 
I knew that comment of mine would be starred.
Hey.
 
Also, note that only one addition is needed, all the others can be done as bit-shifts...
to double a number, you left-shift it once.
 
So which operator is the bit-shift?
I thought those were all normal += operators?
 
5:18 PM
for example, instead of mask += mask you can have mask <<= 1
 
Why did I get Solstice hat today ? Shouldn't it be the 21th ?
 
it is the 21'st.... somewhere
 
@Heslacher It is UTC the 21'st.
 
no, it's not....
but it is in new-zealand local time...
 
So, is it still saturday ?
 
5:19 PM
So you didn't use the bit-shift operator here?
@Heslacher Yup.
 
@Hosch250 no, it is considered to be multiplication-by-two
 
It was Saturday on Friday night for me.
OK, I see.
 
25
Q: Why didn't (or did) I or some other user get a hat although the requirements were (or weren't) fulfilled?

balphaDuring Winter Bash, users can earn hats. But sometimes it seems that a hat was awarded even though its requirements weren't (yet) met, or vice versa. What could the reason for this be?

 
thanks @rolfl
 
Trying to decide if Gelt is worth 50 points.
I wouldn't think twice if I had 3050 rep.
For the site graduation.
I think I'll do it, and make it up with the questions I have planned.
Gone.
What? Since when does Community vote?
 
5:28 PM
And there's post #5
 
Or start bounties, or post with apps?
 
I do hope it's still Saturday in StackLand.
 
@Jamal It is.
5:30 more hours.
 
#3 posted
 
I was confused since we got Solstice, which is for Sunday.
 
5:29 PM
@Jamal you know how SE is with dates...
(6-8 weeks)
 
9
Q: Lock-free multiple-consumer multiple-producer queue

Javier BlazquezThe code below implements an intrusive lock-free queue that supports multiple concurrent producers and consumers. Some features: Producers and consumers work on separate ends of the queue most of the time. The fast path for producers and consumers has 4 atomic ops. Version numbers are used to ...

@Jamal Try that.
 
Monking :)
 
!Monking.
 
monking!
 
I've already done my five, so I'll take a break. :-)
 
5:31 PM
I broke myself
 
Physics.SE are lowly getting ahead of us.
 
@Morwenn Just took Gelt.
That should help.
 
hey @Morwenn
 
We should soon get a bunch of Solastice hats anyway :p
 
6 more hats for me, maybe 7.
If I post a bounty on Christmas too.
Maybe 8, if I can answer a bounty question and get a vote.
9, if I get the bounty too (almost 0 percent chance).
 
5:34 PM
new bounty on
5
Q: Timing out a method

Rob WhiteI have created this extension method that can be used to run a function with a timeout applied to it. Is this a sensible way of doing it? public static class FuncExtensions { public static T RunUntil<T>(this Func<T> predicate, TimeSpan timeout, string taskName) { var result = def...

 
@Hosch250 What do you mean if you get the bounty?
 
If I get the bounty and a vote, I get Major Award.
Oh, I guess not.
I see.
 
Nope, you just need a vote.
 
Yeah, I was confused.
 
Actually, I was confused too at first.
 
5:36 PM
@Heslacher that's one tough cookie zombie
 
@Mat'sMug If it would be easy, it would have an answer.
 
Hmm, is this a problem?
It is within class T, so doesn't it create an infinite recursion, ending in a stack overflow?
var result = default(T);
Wait, no, it doesn.t
That would be result = new T();
Or something.
 
null if T is a reference type
 
Why don't I get Bill ? I have answered 5 questions. Do they need to get an upvote ?
 
It doesn't say so.
 
5:38 PM
yup
 
yup for upvote
?
Selfi
9
A: Bill Lumbergh - all 5 questions in a single Saturday?

Martijn PietersYes, all 5 answers must be posted on the same Saturday (a Saturday, not Saturdays). There is an implicit quality requirement for all hats tied to posting: To prevent people from posting nonsense just to earn a hat, most hats that require creating content, especially questions and answers, ha...

 
How about now .... @Heslacher
 
If so, then my previous two still need an upvote.
 
What resource do I need to include to use TaskTimeoutException?
I can't get that code @Heslacher has a bounty on to compile.
 
Thanks, Santa!
And it looks like we're going back under 800 unanswered.
 
5:44 PM
Thanks @santa rolfl
> You earned Bill...
I tried to explain winterbash to my wife. Not very easy ;-)
5
 
@Heslacher I feel your pain
2
 
Yeah, people don't get it.
 
You should get a hat if your spouse understands Winterbash. :-P
3
 
@Jamal Thats a hard task
 
Don't have a spouse - it's my parents.
 
5:50 PM
@Hosch250 my parents wouldn't understand at all what I am doing on this site at all. They are just to old,
 
Remember what Mark Twain said?
 
no
 
I am way older ;-)
 
SE-wide top hat-chasers congrats @rolfl & @janos!
 
5:55 PM
Well, I need to answer one more, but if anybody thinks this is worthy of an upvote... codereview.stackexchange.com/a/74276/41243
 
@Mat'sMug You're right up there too.
 
thanks @Mat'sMug !
 
Time to eat, see you
 
I'm on page 6 at #104.
 
Maybe put another answer on it too...
I'm still one hat away from the front page.
Might have to go to another SÉ to get a few of these though.
 
6:02 PM
Yay! I recieved red baron!
 
Good job.
I think about ways to get a silver badge.
 
I got it this way:
5
A: Printing RPG Game Character Properties

Manny MengThe first thing you are destroying is the formatting. After formatting, it looks like this: class Human { protected String name; protected int health; protected int armorLevel; protected int magicLevel; protected int experience; protected int level; Human() { ...

 
The closest was an answer close to necromancer, but is not even a hour short for being eligible. Just 59 days, 23 hours something something. :D
 
I answered when it was -3
Now it is +8
Necromancer answer:
5
A: Finding divisors of a number

Manny MengThis code could do with some editing... First of all is the spacing. It is absolutely horrible (we will fix that after the edits). Also, the naming is horrible. Scanner x could be scanner and y could be num. As for z, it is completely unnecessary: for (i = 2; i < y; i++) { long z = y % i;...

 
@kleinfreund I got necromancer earlier today ....?
 
6:06 PM
@rolfl typo again?
 
I have an answer that was posted today on a question which was posted on Octover the 22nd.
 
"earleir"
 
yup
 
The question was posted around 6 pm and I answered earlier. :P
 
0
Q: Custom Google App Engine python user managment

user1492867I've written this script as a basic authentication system for use on Google App Engine. I would appreciate it if anyone would mind having a look and seeing if there are any obvious security vulnerabilities. This is my first post on code review so I apologise if I have misunderstood the format o...

 
6:08 PM
one-vote-short did not help much for you @kleinfreund
 
Yeah, I guess so. :P
 
@Hosch250 saw that, reviewed that
 
Reviewed what?
 
Oh, there's a thought, in our race with physics, we can scan the silver badges in here: data.stackexchange.com/codereview/query/169776/one-vote-short
award where deserving
 
I have a answer 3 votes short of Enlightened. Whatever. There are hats to acclaim.
 
6:11 PM
@Hosch250 Reviewed it as a first post
 
What? The post that got you Red Baron?
I reviewed that too.
 
@Hosch250 Custom Google App Engine python user management...
 
@rolfl We should have a view more soonish. ;)
 
not the post that got me reb baron
red*
 
typo?
 
6:13 PM
What does that have to do with anything?
 
nope, that was plain misspelling
 
yes, that was a typo.
my first one here
 
I think I just got Selfie for community wikifying my answer. :O
 
Monkernoon
 
Hey @Simon
 
6:28 PM
Monkerlunch!
 
@rolfl Sometimes I'm just brain afk... I've seen this message pinned for quite some days and am surprised it has 20 votes, only to realize just now that I still could make it 21!
 
7:27 PM
How are we supposed to get "Party in the back"?
 
You'll need to get downvoted.
2
 
Uuuhh, Jamal, hit me one more time. ;)
I know!
But that means writing something bad. :(
 
Simple: review a LOLCODE question. :P
(or ask one)
 
O RLY?
2
 
YA RLY
3
 
7:33 PM
OIC
 
And then ping @nhgrif to make sure he sees your LOLCODE. Insta-downvote. =;)-
Just joshing nhgrif. =)
 
8:13 PM
And OP is using ... gasp... Regions!
0
A: Console Application Customizer - GetBootstrap v2.0

RubberDuckA Bit About Regions Some people hate them. I'm not one of those people. I think that used correctly, they're a great thing. For example, I think this is a wonderful use of a Region. #region Method WriteLine... public static void WriteLine(string format, int min = 50, int max = 100, par...

 
0
Q: Square root in C#

GiladHere I have 2 implementations: this is the code I have created: public double SquareRoot2(double number) { double precision = 10e-8; double low = 0.0; double high = number / 2; double mid = (high + low) / 2; if (number < 0) ...

 
I DV and CVed a question that was deleted by the OP. Does that count towards Red Shirt?
 
It should. Yes.
> DV a question that is later closed or deleted.
Hey guys! Check it out! Back under 900 unanswered questions!
 
8:31 PM
@kleinfreund What indication do you have that this is ?
3
Q: Print character + the ASCII value, 10 pairs per line

NirMy exercise was: Write a program that reads input as a stream of characters until encountering EOF. Have the program print each input character and its ASCII decimal value. Note that characters preceding the space character in the ASCII sequence are nonprinting characters. Treat them sp...

 
He states that it was an exercise.
Okay, it may have been his own exercise.
It just sounded like some third-party gave it to him.
 
Could have been an exercise from a book.
 
Pretty sure I just found my Christmas bounty. Yikes! What a mess.....
 
2
Q: Conversion helper with support for enumerations and Nullable<T>

PatrickI recently wrote this code as a more versatile stand-in for Convert.ChangeType. I have a nagging feeling that there's something I might be overlooking, or that there might be a more efficient algorithm for this. /// <summary> /// Returns an object of type <typeparamref name="T"/> who...

 
physics past us again people
 
8:45 PM
If you have a good question worth a bounty of mine I will happily place one.
 
0
A: Custom JavaScript validation using the factory / module patterns

MalachiThis HTML has me wondering a little bit if you are using the right tags <div class="spacer"></div> <header data-bind="animator: IsValid() ? 'Valid' : 'Invalid'"> <div class="validation-summary"> <h4>Form Status:</h4><mark data-bind="text: IsValid() ? 'Valid' : 'Invalid'"></mark> </div> <...

 
I'm at +160, I think Santa missed a spot
 
the 5 answers on Saturday, do they need to be upvoted?
 
Yeah, I have no way getting a silver badge. Looking for other ways now.
I'm vote capped for today, sorry.
 
@Malachi yes, but they don't need to be upvoted today
2
 
8:46 PM
okay
I need to catch up to @rolfl for hats
lol
 
@Malachi We look very similar.
 
I am still beating @RubberDuck though...lol
 
I'm writing a binary search method for review.
 
I don't think I am going to wear this one very long, it's more of a mask than a hat
 
You're beating me because I helped you get a pizza......
 
8:48 PM
I'm surprised, how did you get Party in the back? Are you receiving downvotes regularily?
 
We helped each other on that.
 
Who? Me?
I tried to answer a TI-Basic question and botched it.
 
I deliberately botched an answer trying to help someone get a pizza, then removed it, gaining me two hats.
 
Howdy, y'all.
 
Heya @Edward
 
8:56 PM
Been working on a Bill Lumbergh hat
 
Looks like I have a surprise entry for Handegg today:
4
A: Custom JavaScript validation using the factory / module patterns

kleinfreund(The following is about the HTML only.) Identation The identation of your markup is all over the place. I suggest identing by atleast two spaces. I prefer four spaces, though. I’ll append a fixed version below. Space Use it. Separate distinct blocks of code with one or two newlines. Don’t cl...

@Edward Ah, I didn't know these things. Thank you.
 
I made 6 answers today, but I think they need at least one vote each to count.
 
I'm out of votes, sadly. :(
 
@Edward They don't have to get the votes today though. You should be good. You write great answers.
 
@RubberDuck Oh, that's good to know
 
9:02 PM
Is @Donald.McLean around?
 
-1
Q: I'm starting off as a programmer and want to expand my horizons, what languages should I try to learn?

AnawkinOk so I'm what you could call a total newbie at coding, I've only learning html and css (which some don't even count as real coding.) but none the less that's what I've done. I want to get more involved in complex languages and challenge myself, but I'm sure where to start. I'd like to focus on m...

 
@CaptainObvious If anyone is still hunting RedShirt......
 
@RubberDuck "Setting phaser to 'stun'"
4
 
9:21 PM
DV and CVed.
That will be number two.
I think.
One more CV.
 
am I correct in this assumption?
that's the same thing I have, only you have used a case statement instead of an if statement. — Malachi 32 secs ago
FIxed it
it's friggin Saturday, I don't want to have to Deal with SQL on Saturday!
 
@Malachi Try some NoSQL databases on Saturday!
 
How about no Database Saturdays?
LOL
 
@Malachi You work with databases, therefore you think in SQL rather than English!
And obviously you always use yellcase when talking to others ;)
 
9:37 PM
lol, my wife always says that I talk loudly...lol
 
lol
 
SIGH
@Phrancis
DECLARE @GenericVariableName VARCHAR(MAX)
SET @GenericVariableName = SELECT TOP (1) Data
                             FROM Configuration
                             WHERE Name = 'NameOfConfiguration'

IF (@@ROWCOUNT > 0)
BEGIN
    SELECT TOP (1) FROM @GenericVariableName
END
ELSE
BEGIN
    SELECT 'Default Value'
END
 
where is my syntax error? @Mat'sMug @RubberDuck
I really want to comment that he should quit being a F****** D*** and post a F****** Answer. in yellcase
3
 
@Malachi I feel that user was dragging a bear trap along
2
 
9:43 PM
I should just tell him to edit it into my answer
 
1
Q: Simple Linked Hash Map in JS (node/browser)

ssturI needed a simple data structure to cache the most recent few directory contents for this project I was working on. I thought a Linked Hash Map would be the right approach since we will cache only one item per path (the key) and keep only X recent items. We will store the timestamp and directory ...

0
Q: Java BlackJack Beginner

user3808597Here is my code for java blackjack, I am fairly new to this so if you could tell me wether this is a good way to write code or if I'm missing anything that would be greatly appreciated. import ehs.*; import java.util.Scanner; public class blackjack { public static void main(String[] args) { ...

 
Jerkoff, couldn't tell me I am missing a set of Parenthesis?
 
@Malachi Some folks are more interested in Being Right than in being human.
2
 
Agreed
FYI I did look to see if he was in here a couple of times, I also thought that it would make things worse if I did talk with him in chat. but I have been wrong before.
 
10:05 PM
@CaptainObvious This will really need some good reviews.
 
#4 posted.. and should get me a Java tag badge! :)
0
A: Beginning Blackjack program

Mat's MugMethod names should start with a verb: blackJack or money or even hiddenCheat aren't really descriptive names. Also as a C# dev it's harder for me to put myself in a Java mindset when the braces are all C#-style... on the other hand, it's nice that you're consistent with them. if(...) ... ...

 
Hm... maybe he'll actually get a pizza.
 
^^ this should get OP a pizza btw
@Jamal jinx!
 
I just don't know where to start.
lol
 
Reviewing code > 200 lines without OOP is horrible there ;)
 
10:07 PM
@Malachi Pointing out code errors on a code review site is hardly unreasonable.
Your code still won't execute. You can't select from a scalar variable.
 
@MartinSmith point at the world and saying you know how to fix that problem doesn't help anyone figure out what they are doing wrong or how to fix the problem
 
I've posted my answer. Three more on it to go.
 
@MartinSmith If you know there's an error in some code, then it would be more helpful to also indicate what the error is.
 
@MartinSmith and the code does execute , I tested it on my SQL SERVER Database
 
I gave you working code and advice about SQL Fiddle about 45 mins ago.
 
10:09 PM
I don't see a compiler yelling at me that I have an error, but then refusing to tell me where and what the error is.
That would inhumane for a compiler to do anyway
 
@Malachi Now finally it looks valid after your latest edit.
 
@MartinSmith agreed, I didn't remove the excess Select after I tested my code
 
@Mat'sMug That got accepted? Ha!
 
Oh, the question is already 26 minutes old. Time flies.
 
Woah! So that's how you get a zero-score accept! lol
 
10:12 PM
@Mat'sMug don't anyone vote on it
 
I expect an un-accept soon though ;)
 
Now I have the checkmark.
 
-1
A: Timing out a method

PhoenixHere is how I achieved something similar. static void Main(string[] args) { Console.BufferHeight = Int16.MaxValue-1; RunWithTaskApproach(); Console.WriteLine("Started calculating stuff!"); RunUntil(() => Calculatestuff(), TimeSpan.FromSeco...

i keep getting downvoted these days
and i have no idea why
 
@Jamal That got accepted? Ha!
 
Aw, it didn't stick long enough to earn me a Naruto :(
 
10:13 PM
@Phoenix The goal of Code Review isn't to provide an answer with a working replacement block of code, it is to review the code in question.
 
Let's see who will become the next Hokage!
 
90 seconds. Blackjack needs one more.
 
well the other answer was kinda a replacement but I see your point
 
If you understand that part, then you can understand why you get the downvotes, if you cannot, then we are happy to explain it
 
ok thanks for the info
 
10:15 PM
The trick is that other people often combine a review with a replacement answer
 
Wow.
I got two stars on my latest question.
 
I wonder if @Malachi's answer gave OP a pizza
 
Woah, that was a close one. Let's see if it was just in time for pizza.
 
Well it says 30 minutes or less
In theory 30 minutes should be ok
 
@Mat'sMug I don't know it was close
 
10:17 PM
Let's see how precise Stackland devs are...
I think we over whelmed OP though.
 
Surely the Blackjack question came from some kind of jokester.
 
Did you see the currently accepted answer?
Just reviewed it in the queue.
 
We hardly ever get to shotgun answers like that, but SO does it daily.
 
We've certainly learned how to manufacture a hot question.
 
Blast, the comment was removed.
 
10:22 PM
Nice solid count.
Not anymore. :-P
 
I pulled past SO earlier, then dropped below again, and now I'm past them again (my rep).
 
10:38 PM
#5 posted
@RubberDuck that's a pretty long answer to say regions deserve more lovin' than some mugs care to give 'em ;)
3
Q: Console Application Customizer - GetBootstrap v2.0

LeonelGetBootstrap-2.0 update from GetBootstrap-1.0.0.2 I just update my console application customizer and add some new features like disable minimize, maximize and close button, new color and simple popup box. Help me review my codes... Here is my sample preview of GetBootstrap-2.0: The preview ...

 
some mugs... tha pun though
 
Eh
 
someone want to check out this answer?
0
A: Cycles of pointers

MalachiWhen you have something like this if (AdjM[Pointers[1], Pointers[0]]) if (Pointers[1] == VertEnd) AddPath(2); you could just write it like this if (AdjM[Pointers[1], Pointers[0]] && Pointers[1] == VertEnd) { AddPath(2); } there is no reason that you couldn't merge the two if...

 
Phone posts tend to make shorter/faster answers
2
 
@SimonAndréForsberg has a very good answer over there as well
 
10:41 PM
I do?
Oh, there
 
Yeah @Mat'sMug I guess so. Was trying to kill a zombie and get a hat. It was damn good looking code.
 
I have 6 answers posted today. but one of them is downvoted. apparently I need to learn HTML/CSS again, the newer tags have me a little stumped
 
Except that swith block ;)
 
Mission accomplished by the way. Zombie down. Hat awarded.
Yeah... I saw that, but wasn't sure what to do about it. Perhaps some Inheritence could fix it up.
 
10:47 PM
Idk. I thinking having a BootstrapType is a smell. It would be better to have a base class and then each "type" would inherit from that class and be responsible for knowing what it needs to do.
I think I'll go back and update my answer later. Left my star on it.
 
Upvoted for humour:
1
A: Calculate square of a number without multiplication

RichardWith this CPU that supports addition and subtraction, but not bit-shifting, I would assume that there are only a handful of registers available on the chip, which could yield even simple algorithms to be too complicated. I'm not sure C# would be the optimal language for programming this chip. It ...

 
0
Q: Java AVL Implementation

DosherI am trying to write AVL tree insertion but I couldn't write it. Each time a new node added to tree, there is a balance(lastAdd); line after addition so last added node used in balance method. public int height(Node node) { int heightRight = 0, heightLeft = 0; tempRight = nod...

 
@RubberDuck inheritance seems overkill to me here
Thanks Santa! Got my Bill hat!
 
BREAKING NEWS!
Denmark claimed the north pole.
 
10:53 PM
?
 
No pizza? =( Damn. Well, it went hot so maybe OP will at least get some rep.
 
@Hosch250 Thanks, Santa Denmark!
 
Let's see them keep it.
We'll sit in Alaska and coolly take the oil right out with our side-drilling.
 
@Mat'sMug I still need an upvote for my bill hat I think
 
I'm out of ammo :(
 
10:58 PM
ugh. ... Anyone?
18 mins ago, by Malachi
0
A: Cycles of pointers

MalachiWhen you have something like this if (AdjM[Pointers[1], Pointers[0]]) if (Pointers[1] == VertEnd) AddPath(2); you could just write it like this if (AdjM[Pointers[1], Pointers[0]] && Pointers[1] == VertEnd) { AddPath(2); } there is no reason that you couldn't merge the two if...

 
Upvote doesn't have to come in today. Just the answer.
Out of ammo here too. I have several open browser tabs for later...
 

« first day (595 days earlier)      last day (3422 days later) »