« first day (577 days earlier)      last day (3440 days later) » 

5:00 PM
Make sense?
 
absolutely :)
 
@Mat'sMug That word... '~'
 
Ok, that gives a week to code, and a few days before that to choose an idea. Get cracking, people.!
 
0
A: Prebash Challenge - 2014

Mat's MugImplement a simple calculator Where the definition of "simple" is whatever you make it - only supports basic arithmetic operators? Fine. It supports scientific notation, exponents and trigonometry? Fine! Takes input from the console? Fine! Toggle between binary, hex, octal and decimal notations?...

 
I made it community wiki, should I undo that?
 
5:05 PM
why?
 
really does not matter, does it.
 
not unless I can score a meta-guru badge during Winter Bash with that answer...
 
2
Q: Prebash Challenge - 2014

rolflWinterBash will be starting in 2 weeks. Let's put up a code-challenge to complete before that. Like previous challenges, this meta post is here to poll for a good challenge idea. Here's how this round will work: Post an answer to this question with your challenge Vote for those answers which in...

 
thanks @StackExchange :)
 
Previous challenges were not wiki, so I undid wiki.
 
5:08 PM
ok
 
Pre-WinterBash Code Challenge -> Check out meta
11
 
@Vogel612 No, C# is not my forte. I wrote the comment because the question looked deficient when it came up in First Posts.
 
hello
[c++] what is the name of << operator (not shift left, there is a another name) ?
 
operator<<
Or "left shift operator". Depends on what you mean by "name".
 
does it have a different name when it is used with std::cout ?
I know it's shift left, is there another name ?
 
5:22 PM
Nope.
Stream operator?
 
k Thanks. :D
ah that's the one
 
@Mat'sMug You don't think we've had enough calculators around here?
 
@SimonAndréForsberg Exactly what I thought.
 
@Mat'sMug so that is why you suggested calculator...
 
hehe
feel free to submit any idea (just not please)
5
 
5:35 PM
@Mat'sMug agreed.
 
*Stargreed
2
 
Anyone here know MatLab? stackoverflow.com/q/27255647/1937270
 
I used it for school. That does not mean I know it though.
2
 
@syb0rg used it a bit a long time ago. Does axis labels even work / make sense for Pie charts at all?
 
No, but what I'm moving toward is having one large xlabel for the whole plot, and one large ylabel
 
5:44 PM
@Morwenn Do you ever know anything you do in school?
 
And I think pie charts still have axis in Matlab... though don't quote me on that cause I really don't know
 
@SimonAndréForsberg I remember having posted an answer here on CR about genetic algorithms. I only ever studied them at school :p
 
@syb0rg perhaps it's something worth investigating. I didn't even know matlab had sub-plots.
 
Matplotlib has subplots.
 
I need to make use of them, since otherwise I will be printing out a lot of individual graphs == lots of money for using school printers
 
5:46 PM
@Morwenn true that. I have a little idea for an AI-related Java library I'd like to investigate, but.... I gotta decide if/when/how to pursue that idea... feels like I already have a lot of stuff to do.
 
So, I'm condensing data
For a project of mine due in 3 and a half hours...
 
Good luck with that.
Leave this chat. Right now.
 
The project is done
 
Is there any such place as IdeaReview.stackexchange.com? Where you could think of some ideas and approaches and have people tell you if it sounds like a good idea or not. And if it perhaps has been approached already...
perhaps even @RubberDuck.stackexchange.com...
2
 
@syb0rg Oh. My bad.
 
5:47 PM
It's just a matter of getting all that data on as few pieces of paper as possible
Otherwise I will have 50+ sheets
Although that could be a good prank on my professor...
 
Just curious, @syb0rg, what is the context for your SO question? What wins and board sizes is it about?
 
I basically had to create an AI, and measure it's performance against an opponent AI
 
I just realised... Why is there no such thing as http://java.codereview.stackexchange.com?
 
The first top two lines are just random moves for my AI against a RandomOpponent and a SmartOpponent
 
Essentially using the tags in front of the site name
 
5:50 PM
@syb0rg what game?
 
The bottom two lines are my SmartOpponent against a RandomOpponent and a SmartOpponent
In which I win 100% of the time
 
@SimonAndréForsberg Genius!
 
I'm not really sure what it's called, let me copy and paste an excerpt from my professors website
> To keep this process simple, we are going to consider a very simple game: a player, starting in the upper-left corner of the game board; and an opponent starting in the lower-right corner.
> The game board consists of a grid of locations surrounded by a wall with a small wall in the center acting as an obstacle. The player wins if they reach the lower-right corner of the game board without being touched by the opponent.
> The opponent wins if they touch the player. The game will end with neither player or opponent winning after a fixed number of steps (to take care of situations where both the player and opponent are simply making random choices and a game could go on for a very long time).
 
@syb0rg A game of tag?
 
Somewhat, yeah
 
5:52 PM
There are so many games to implement in this world :)
 
@SimonAndréForsberg Called "The 2nd Monitor" .... ;-)
4
 
2
Q: Interdependent color swatch widgets

200_successWhile writing this code review, I found it necessary to include a live demonstration to illustrate the problems I found, which I implemented using a Stack Snippet with Angular.js. The demonstration takes a color input and a scalar parameter, and produces two read-only color outputs. However, th...

 
It's really say-funny-stuff day, uh?
Also out-of-stars-after-participating-1-hour-day
 
@skiwi "Game of Tags" - with an opening cut scene that traverses all top tags on the site, showing where they are.
Winter is coming!
2
 
@Mat'sMug What the actual
 
5:55 PM
@Mat'sMug Anndddddd out of stars.
 
Game of Thrones is an American fantasy drama television series created for HBO by David Benioff and D. B. Weiss as showrunners and main writers. It is an adaptation of A Song of Ice and Fire, George R. R. Martin's series of fantasy novels, the first of which is titled A Game of Thrones. Filmed in a Belfast studio and on location elsewhere in Northern Ireland, Malta, Scotland, Croatia, Iceland, the United States, Spain and Morocco, it premiered on HBO in the United States on April 17, 2011. Two days after the fourth season premiered in April 2014, HBO renewed Game of Thrones for a fifth and sixth...
 
Tag battlebots?
 
@RubberDuck RSA
 
@Phrancis to the rescue again.
 
5:57 PM
I'm doing my best to break our server here. Exported 12 million rows and counting to a flat file.....
13.2.....
 
@RubberDuck
 
IT wants it, but they're unwilling to just log into the server and query it.....
So, we're going to duplicate it. =)
16.9 and counting
 
Um. Ok. Great solution :)
 
I know. ;)
 
@200_success I've been wanting to put up a server for Ultimate TTT to have some friendly competitions here as well.
 
6:08 PM
Ugh... Blue screens
 
0
A: Prebash Challenge - 2014

RubberDuckSimon Says Let's play a game of Simon Says! The older folks around here probably remember a game called Simon. The Challenge Create a UI with four colored buttons light up in a random pattern. After displaying the pattern, the player must repeat the pattern by clicking the buttons in p...

 
Somehow I can't do anything else than up-vote this. — Simon André Forsberg 19 secs ago
and I wonder how that challenge could be SimonAndréForsberg'd ;)
(+1'd anyway)
 
HAHAHHA
I actually thought about calling it @SimonAndréForsberg Says.
3
 
So I've theoretically cut my paper usage by a factor of 10!
Now if only I could get these global labels to work properly
 
@RubberDuck I like that.
@Mat'sMug unfortunately, I'm not so sure it can.
 
6:21 PM
Oh, an answer to my SO question!
Hello @nhgrif
 
Why are you using global labels?
 
Who, me?
 
Yes?
 
> Simon's a computer, Simon has a brain, you either do what Simon says or else go down the drain
This should become my motto.
 
@nhgrif I'm not really sure, it's just what I thought would work best to represent the data
 
6:27 PM
I never think a global ui element is a good idea
 
I don't either, but the text is already getting squashed on that subplot
 
0
Q: Counting words in a Strong

ZacSo I am new to java and I'm trying to write a program that lets the user input a string then it counts the words in the string and the letters in the words and returns the value example: string: how are you doing 3 three letter words 1 four letter words 4 words in total example 2: string: how is...

 
@CaptainObvious Burn it down!
 
6:43 PM
@Yakk Code Review is also scheduled to graduate. — syb0rg 13 secs ago
 
2
Q: Representation of the formula P(n) = (n!)(6^n) in C

thelastpandaI'm trying to represent the following mathematical expression in C: $$P(n)=(n!)(6^n)$$ The first program should compute the answer to expression when n = 20. I have attempted to create the program in C and it produces the correct answer (when compared with wolfram alpha's answer). The answer is...

0
Q: Custom SkipList Implementation java

Ishan SoniSo , I recently studied SkipList and thought i would create one on my own. This implementation uses a 2 layer Skip list where the size of the support list is roughly squareroot of the size of the original list. package skiplists.skiplist; public class SkipList<T extends Comparable<T>> { privat...

 
@RubberDuck My standard for applying the tag is: would an amateur or professional mathematician take an interest in the question?
For the Python version of that question, I would say, certainly not. It's a simple expression and there's not much to be discussed, since Python does fixed-point arithmetic automatically.
For the C version, the way that it's written to double, I doubt that there is much to be discussed mathematically either.
 
Have we tried this?
16
Q: 'Canonical' questions to help address common issues

CorbinShort Version I believe it would be valuable to create a 'canonical' question/answer of sorts for each language, and I am hoping to get others' thoughts on this. These questions and answers would serve as a central explanation of certain common issues. All answers would still be expected to be ...

@200_success You may want to update the tag wiki then.
> For code that aims to solve problems in all branches of mathematics.
That's pretty broad.
 
7:00 PM
@RubberDuck We should have a canonical PHP/MySQL connector!
 
I do math--does that make me a mathematician?
 
@nhgrif Do you do it for fun?
;)
 
When it's part of something else I'm doing for fun.
 
You could call yourself an amateur mathematician. What do you think — does that question pique your interest?
 
as a programmer
I don't know where the line between a math and non-math tag question is.
 
7:04 PM
I'd consider it uninteresting mathematically, and closer to the usual arithmetic that all computer programs do.
 
Would an implementation of a fraction number class warrant math? Or complex number?
 
Now, if you wanted to find the result modulo 93, that might be interesting.
 
I would say it does if you're aiming to be mathematically correct.
 
Then apply the tag.
That deals with floating-point accuracy.
 
The more I look at that answer the more I think I disagree with you @200_success. That question is specifically looking to calculate a mathematically interesting thing. Of course, interesting is subjective.
 
7:07 PM
@CaptainObvious @200_success there is a glitchy spot....
 
Factorial * (constant to the power of something)
 
Do you think that there is a math trick to get a faster/better answer?
 
when you raise the blue it changes the output dramatically.
I assume it has something to do with the amount of difference. I haven't read the entire question yet....
 
@200_success I don't know, but maybe there is. Maybe there isn't.
 
7:08 PM
@Malachi The middle widget?
 
@200_success yeah the middle color jumps when you raise the blue level of the first one from that number
 
My point is that it is completely based around doing math. It's not an "incidental use" as the wiki puts it.
 
I am using Chrome
 
@Malachi That's the point of the demo: to point out that discontinuity in the original algorithm in the linked question.
 
I see.... I went right for the shiny object and started playing with it.
3
I didn't read the original question or all of your question before I started playing ... lol
 
7:38 PM
0
Q: Evaluate multiple booleans in a loop per iteration

MeetTitanI have 2 booleans: host.isReachableOnLan, and host.isReachableOnWan I have a listener doing work on network on button event int tmp = -1; if (!host.isReachableOnLan && !host.isReachableOnWan) { new WakeOnLan(host, host.wolBroadcast).start(); new WakeOnLan(host, host.wanHostName).start(...

0
Q: Refactor this Ruby on Rails validation for less repetition

Cássio GodinhoI got a Reservation model that has reservation_start and reservation_end. Then I have the usual date validations (end date cannot be lesser than start date and so on). The problem is with these two guys: def reservation_start_available reservations = Reservation.where(["transport_id =?", tr...

0
Q: Unit of work Repository pattern DBcontext EF-Entities and ninject

medeveloperI am totally confused while implementing Repository pattern with unit of work and Entity framework because i have seen tons of examples. Please suggest me weather i am on right tack or not. public interface IUnitOfWork: IDisposable { void Commit(); void Dispose(bool disposing); } Here ...

 
7:59 PM
Heya folks
 
@kleinfreund Ho there.
 
@200 Hey! How did you notice the new user you linked me to? He told me today that he found my code via Google. Everything's fine, I think.
Anyways, I probably should put the homework code up for review only after the deadlines are over
 
Just scanning through deleted questions.
Yeah, good idea, considering that your classmate chose "Tut nichts ursache" as a username.
 
Ah, did he post a question? Didn't know that.
Yeah.
 
With a name like that? No, he didn't post a question.
 
8:02 PM
This one is quickly gathering poor answers.
3
Q: Representation of the formula P(n) = (n!)(6^n) in C

thelastpandaI'm trying to represent the following mathematical expression in C: $$P(n)=(n!)(6^n)$$ The first program should compute the answer to expression when n = 20. I have attempted to create the program in C and it produces the correct answer (when compared with wolfram alpha's answer). The answer is...

 
He's fine. He does some things with PHP and SQL I believe, he is able to do these things on his own.
Still, he was not the only one finding the question, though. Heard from a couple others that they've found it.
 
@RubberDuck should it be protected?
 
idk.... What's the rule of thumb for that @Mat'sMug?
 
I'd wait for the next answer to show up
Usually it's when a question goes hot that we need to protect it
 
Well. It has very responsive answerers. One has already been updated and I got a constructive comment from the other.
> answerers
awkward word ^
 
8:11 PM
That's reviewers ;)
 
Note that protecting that question would not have prevented either of those answers.
 
^^
 
True.
 
That is why I felt more like waiting a bit
That and wasn't hot
 
Thanks, santa, and, hopefully that scores me a bronze badge ;-)
next up, C++ ;-)
TTGH
 
8:26 PM
Think we can turn this one around since I edited the code in another language out?
Or is it poor practice to undelete a question OP deleted?
 
never mind, it's poor form for a mod to do it.
 
Yeah. I guess that's poor etiquette.....
 
dum dum dum.
 
@RubberDuck undelete vote applied
 
Thank you @SimonAndréForsberg. If anybody else casts one, please ping me so I can reverse my downvote.
 
8:30 PM
@RubberDuck ping me too so I can give an upvote
 
Surprised a 20K+ SO user gave an answer like this: codereview.stackexchange.com/a/71438/27623
Why 6? Why not 7 or 8, or 100 for that matter? Explain your reasoning more. — syb0rg 4 mins ago
 
@syb0rg Haha, my first guess was... Probably some C user that doesn't use constructs found in high-level languages
Then I checked his SO profile
 
@skiwi Yeah, I'm kinda confused why he gave an answer like that
 
@SimonAndréForsberg it's undleted.
 
8:43 PM
@syb0rg The catch is that he actually uses really a load of C!
 
np. Thank you.
 
@skiwi I don't want to say he is wrong for that reason... but I have a hunch that "optimization" of his doesn't do much
 
8:56 PM
The maximum value a double can store is 1.8 x 10^308... is this user saying that it can only store up to 10^18? codereview.stackexchange.com/a/71436/27623
 
You might want to add "without losing precision" to your "store a number up to 10^18" — Simon André Forsberg 9 secs ago
I assume he meant without losing precision
 
@SimonAndréForsberg 1.8 x 10^308 is without losing precision though: stackoverflow.com/a/1848762/1937270
 
> Go on, ask me what the biggest integer is, such that it and all smaller integers can be stored in IEEE 64 bit doubles without losing precision. An IEEE 64 bit double has 52 bits of mantissa, so I think it's 2^53
2^53 = 9.007199254740992 × 10^15
 
I'm compuzzled
Where is that 1.8 x 10^308 coming from then
 
It is the biggest that can be stored without losing precision. But not all lower values can be stored without losing precision.
You can store 1.8 * 10^308 but you can't store that value -1 or -2.
Perhaps Lachesis, the Greek equivalent.
 
9:39 PM
0
Q: Clean up if...else statement in Ruby

MsencenbI have the following (made up) function. The intention is to return a single object rather than the whole hash of objects. It works fine but it doesn't feel very 'ruby-like'. Is there a more concise way to write this? def get_single_object_for_url(url) # This function returns a hash of obj...

 
^^ made up === hypothetical?
 
Welcome to Code Review! Unfortunately, it's a bit hard to review code like this because the code you are showing is example code rather than code that you're actually using in a real project, which means that a lot of context has been stripped away. Unlike Stack Overflow, we prefer to look at real code instead of example code. Please see the meta question: Why is hypothetical example code off-topic for Code Review?RubberDuck 23 secs ago
 
SO should want the real code as well.
if they only knew what was good for them
2
 
@RubberDuck Where have I seen that comment before?
 
0
Q: Why is the main method from this class unsuccessfull in changing the font in Windows 8 Console?

Robert CalceanuWhy is the main method from this class unsuccessful in changing the font in Windows 8? It seems to work in Windows 7. Also... do I have to compile it for Platform Target x86 if it's using rundll32? using System; using System.Linq; using System.Runtime.InteropServices; namespace ConsoleExtende...

0
Q: Outputting the names of cars, without repetitions, with the number of occurrences in order of decreasing repetitions in Python

CaridorcAfter reading the following question: Outputting the names of cars, without repetitions, with the number of occurrences in order of decreasing repetitions It jumped to me that many said that the solution to the problem is over-engineered / overkill. Here I solve the same problem in Python i...

 
10:07 PM
0
Q: Let's play some Swift Poker

nhgrifBefore you can do any sort of card game, you must first write some code to define your deck of cards. One thing I've noticed in looking at some of Apple's Swift interfaces is that they very much so like to use extensions. This is probably good. In the big picture long term, it's a really good ...

 
@nhgrif ?
 
It's roughly equivalent to "interface" in Java, I think.
 
I removed it, the text does not appear in any other place in the question... it's up for debate, though.
 
Yeah, but if I tagged "operator"... operator doesn't necessarily appear in a question's text even if I'm writing custom operators.
> Conforming to the ForwardIndexType protocol
I left it out first time
 
@nhgrif 3.repeat({deck.shuffle()}) does this shuffle the deck three times? What's the purpose of that?
 
10:14 PM
It does. There's no particular point necessarily.
We know that it won't get any more random as a computer program after the first shuffle.
 
4
Q: Let's play some Swift Poker

nhgrifBefore you can do any sort of card game, you must first write some code to define your deck of cards. One thing I've noticed in looking at some of Apple's Swift interfaces is that they very much so like to use extensions. This is probably good. In the big picture long term, it's a really good ...

1
Q: My unit testing code is much longer, more cumbersome, and harder to debug than my module. Am I doing something wrong?

jayhendrenI'm a sysadmin writing a tool to perform administrative tasks on our upcoming new account management system that runs over LDAP. I want the tool to be highly flexible, configurable, and reliable, so I'm using automated test-driven development. I've started writing a module to perform LDAP connec...

 
But I figured that the int extension might be useful for other stuff related to this deck of cards soon
 
@nhgrif Shuffling once should be enough. With a proper random generator, it won't make any difference.
I am suspicious of your shuffle method though.
To shuffle an array a of n elements (indices 0..n-1):
  for i from n − 1 downto 1 do
       j ← random integer with 0 ≤ j ≤ i
       exchange a[j] and a[i]
 
It may need improvement, and you're welcome to offer an improvement.
 
I don't think your shuffle method is evenly distributing the elements
I think you are making Shuffing Mistake #1.
 
10:20 PM
I copy&pasta'd this shuffle method.
I was mainly focusing on the enums... so if you have an improvement, feel free to post it.
for index in stride(from: (count - 1), to: 0, by: -1) <-- will get you to iterate from n-1 down to 1
 
or I might be wrong. It might be correct after all.
 
I think I'm just doing it backwards.
 
for i in 0..<(count - 1)
is that the same as this?
for (int i = 0; i < count; i++)
or i < count - 1 ?
 
for (int i = 0; i < count; i++) except faster.
if it were i < count - 1, then the last card (after shuffling) would always be King of Spades, right?
 
not sure what the last card would be, but I think it would always be the same card, yes.
 
10:25 PM
Well if I print before shuffle it's always King of Spades. But when I print after shuffle, it's random.
Four of Diamonds
Queen of Hearts
Three of Clubs
Four of Hearts
Seven of Spades
Queen of Diamonds
King of Hearts
Seven of Hearts
Six of Hearts
Two of Spades
Nine of Spades
Three of Spades
Queen of Spades
Ten of Clubs
Three of Diamonds
Jack of Diamonds
Seven of Diamonds
Four of Clubs
King of Diamonds
Jack of Hearts
Five of Clubs
Two of Diamonds
Two of Hearts
King of Clubs
Two of Clubs
Five of Hearts
Queen of Clubs
Ten of Spades
Six of Diamonds
Ten of Hearts
Eight of Spades
Nine of Clubs
Ace of Hearts
 
0
Q: Trying to create the simple 24 game in java, I have some code but I need to reverse it

jonI am trying to create the 24 game in java and I found some code that does what the game is supposed to do. This code give the user 4 numbers and the user then has to put them into an equation to equal 24. so if the game gives you [11 4 3 3] the correct answer is 11+4+(3*3). Now I was wondering h...

 
Welcome to Code Review! Looks like your code definitely works. Is this code that you own or maintain? The way your question is worded makes it sound a bit like you copied it from another source and pasted it in here. — Phrancis 10 secs ago
 
morning all
 
morning @Mehrad
 
Monking
 
10:37 PM
0
Q: Definition of [ Protocols ] tag

rolflProtocols are a well defined theoretical concept in computing, and in other fields too. Protocols are an established system for communicating between two entities. HTTP, TCP, and UDP are well-know protocols that even have Protocol as part of the name. The concept has a well populated tag on Stack...

 
0
Q: Definition of [ Protocols ] tag

rolflProtocols are a well defined theoretical concept in computing, and in other fields too. Protocols are an established system for communicating between two entities. HTTP, TCP, and UDP are well-know protocols that even have Protocol as part of the name. The concept has a well populated tag on Stack...

 
11:01 PM
@nhgrif Actually, I'm starting to lean towards just to refer to both Java interfaces and ObjC/Swift protocols.
 
0
Q: argparse accepts strings but returns string OR list

todd_dsmlooking for a sanity check. I'm using argparse for the first time and for optional arguments, argparse accepts strings by default (no problem there). After argparse processing, in my case it returns: A String: if nothing is entered for -p/--prefs it give me a string back as the assigned "defau...

 
seems a little odd, but I'd be perfectly fine with a single tag to get the gist of it all
It just can't really be because that means something a bit different in Objective-C/Swift.
I actually kind of thought I had already created the protocol tag before I started posting this question--I remembered discussing it in chat before.
There's also "interface" in terms of how a library interfaces with source code that uses the library.
So it's not just "protocol" that has other meanings.
 
0
Q: Creating list ViewModels in the correct way

AetherixI'm using Caliburn Micro to create a WPF application. So what I want to do here is a typical Master/Detail situation. I'm displaying a list of Users and you can can add/edit a User and save the changes back to the database. Everything works, but I'm just not sure if I'm creating the UserViewMo...

 
11:49 PM
@SimonAndréForsberg yes! that would be awesome, perhaps with slightly more anonymity...
 
11:59 PM
I'm pretty sure that was directly stolen borrowed from you @SimonAndréForsberg
 

« first day (577 days earlier)      last day (3440 days later) »