« first day (14 days earlier)      last day (20 days later) » 
00:00 - 21:0021:00 - 00:00

12:04 AM
Yeah I get the same result now as you posted earlier, @rolfl
 
hehe ... simple things only go so far ... ;-)
 
12:15 AM
Yeah, but that feels quite far though
I'm really considering using brute force for the rest
you using X-wing and Swordfish and stuff, @rolfl?
 
Not yet... I am taking the same approach as you.... kill the easy stuff, brute the rest.
I know X-Wing, and stuff, but too lazy to program them in just yet.
 
Also, bizarrely, I look at the sudoku where we are, and I can't see a next-step... makes me feel dumb.... ;-)
 
At first I actually thought about stopping where I am now, and not completing the assignment entirely (possibly making a complete Java version), but I have come so far now so I just gotta finish it
same here. I'm looking for subsets and stuff but I can't really apply that rule anywhere
 
yeah, but, to brute-force it, I am finding I have to duplicate a lot of sructure in a different way (no validation, etc).
 
12:19 AM
Doesn't sound optimal
Time to refactor?
 
No, not refactor, it's because of other reasons... this is 'the right way'.
 
I amy only submit a small part of the overall process though.
 
if you say so ^^
That's how far both I and my program have solved it
 
1:15 AM
I have an approach planned for how to brute-force, but way too tired for now so I will continue tomorrow
 
1:30 AM
Sleep well.
 
 
2 hours later…
3:04 AM
@rolfl wow that's beyond anything I'd hope to come up with in a weekend... I think I'm scoring an F this week...
 
@retailcoder yeah... I looked, and frowned....
That's why I am a 'server' guy .... GUI stuff is new to me.
@retailcoder for what it's worth, I am finding this challenge harder than I expected.
 
I mean I barely have things defined, I think I'm stumped and it's not the language, I'd be just as stumped in C# :/
Yeah we should have gone for sink-a-ship ;)
 
My first 'naive' brite-force attempt, on the same puzzle as Simon has pictured there (with the same amount of 'solution', is huge..... too long to run on one CPU in an hour.
 
I'm still at an xmas party, I think I'll end up posting what I have, along with a tag :)
@sim you're already better at C# than me! ;)
 
 
1 hour later…
4:38 AM
@retailcoder - you alive?
 
5:20 AM
Code is a crazy mess.... but, it works (the brute-force of the puzzle works, anyway).
 
 
7 hours later…
12:31 PM
@retailcoder @rolfl Ding! Time to get back to C#
 
 
2 hours later…
2:37 PM
0
Q: Sudoku using exact cover solver

Gareth Rees1. Introduction This is a solution to Weekend Challenge #3: a Sudoku solver in Python. It works by translating a Sudoku puzzle into an exact cover problem, and then solving the exact cover problem using Donald Knuth's "Algorithm X". The code should be self-explanatory (assuming you've read and u...

 
SOLVED!
632845179
471369285
895721463
748153692
163492758
259678341
524916837
986237514
317584926
 
2:54 PM
Now it's time for the Simon Certified Extensions (TM)
 
3:25 PM
It's nice to see someone new (Gareth) trying out the challenge. :-)
 
Indeed
And it seems like his solution is quite good. Haven't looked at the code yet though (And even if I would, Python is not my second language)
 
I still don't think I'm up for this challenge, and I was just hit with some allergies anyway. Perhaps I'll consider the next challenge.
 
Both of these latest challenges has taken more time than I thought they would
What happened to "The project must be a small (tiny!) project that can be completed within a couple of hours"?
 
I guess that depends on the algorithm and the person. :-) Someone else may be able to complete this solver in that time, but it could take me longer.
By the way, have you seen this answer of mine (and the question itself)? I'm only one away from my first Necromancer. I'd say only a smaller portion of the answer is specific to C++.
4
A: Rounding decimals

JamalI agree with the comments implying that floating-point shouldn't be used with money due to issues with precision. Nonetheless, I'll point out some general flaws I've found in your code. There should be a std:: in front of pow(10.0, pos) since you're not using using namespace std. This is not ...

 
Nope I missed that one
Congratulations on your first Necromancer :)
 
3:39 PM
Thanks. It felt great getting that zombie. I've had my eye on it for a while, but never quite know how to answer it.
 
4:36 PM
I <3 LINQ
2
 
Then why don't you marry it?!?
 
I <3 GIRLS
4
Seems like @rolfl has posted his version now
 
He did ... ;
 
0
Q: Sudoku Week-End Challenge - Brute-Force Recursive solver

rolflThis is part of my attempt at the Week-End Challenge #3. The overall problem is larger than will fit in one question. This is a well-contained subset of my larger program. The goal of this part is to brute-force all possible (if any) solutions to a puzzle. The input to this algorithm is a 2-dime...

 
I have a version to post in C, but it is 1500 lines :P
 
4:50 PM
But it is just the core brute-force algorithm, and some supporting code.
 
I <3 being hidden
 
I'm just gonna test how powerful my solution is, then I will start to actually write my question
Although I wonder if people will understand my code or if I must comment it :P
 
@SimonAndréForsberg - one <3 I want to flag as offensive, the other I want to star.
 
haha
Honestly, I'm very impressed with LINQ
I don't know if it has any performance drawbacks, but coding it is so simple. Just a few lines for something that would take two interfaces and five classes in Java (OK, that was an exaggeration...)
 
lol
 
4:52 PM
@SimonAndréForsberg - have you needed LINQ for the sudoku?
 
Perhaps not needed, but I've certainly used it
 
Sol LINQ is more than just database access? Huh...
 
perhaps overused (if that's possible)
oh yes indeed
you can use it for all IEnumerable types
That is: Collections! :D
 
Someone starred the "lol"? retailcoder must be lurking here. :-)
 
_tiles.Where(tile => tile.HasValue) <--- returns an IEnumerable for the _tiles collection to only include those where tile.HasValue equals true
 
5:00 PM
@Jamal - I Spite-starred it! --- you deserve your 'lols' starred too!
 
5:24 PM
@sim now you understand my pain in leaving LINQ behind!!
 
@retailcoder Indeed, but at least you got to work in Eclipse!!
 
Yeah but I'm not sure all those R#-like bells & whistles make up for no-LINQ!!
 
user image
3
 
Much better.
 
5:29 PM
Don't worry, @rolfl, before you know it I will be a Java guy again.
 
Hmmm ... I think my 'Question' has some interest, but I would not like to be the one who decides to 'review' it .... good luck to them... ;-)(
 
I'll take a look at it when I've finished mine
 
@SimonAndréForsberg that's just LINQ-to-Objects - there's LINQ-to-XML, LINQ-to-SQL, LINQ-to-Entities...
 
I feel sorry for the one who has to review my code... I really hope they'll be able to follow my thought process in all this LINQing
 
@SimonAndréForsberg Don't worry about who will review your C# code :)
With LINQ-to-SQL (and -Entities), you work against an IQueryable, so as long as you don't hit the database until you materialize (i.e. actually iterate) your query. Best thing since sliced bread, I'm telling you!
 
5:36 PM
I believe my solution will be complete opposite @rolfl's. He uses low-level primitive values, I use high-level LINQ.
 
@SimonAndréForsberg - yeah, one of my 'trademarks' is that I avoid any heap-space objects in recursion or tight loops. 'My' algorithm has none (other than when it actually finds a solution).
 
I guess one of my 'trademarks' is to make stuff as flexible as possible, even when it's not really necessary
 
Okay, my C Sudoku Solver striped of most of it's features is roughly 85 lines :)
I think it's ready to review
 
From 1500 lines down to 85?!? What on earth did you do to it?
3
 
^^ Ctrl+A, Delete
3
 
5:41 PM
@SimonAndréForsberg Most of it was command line argument features.
I stripped all of that out.
 
@syb0rg looks like most of it is an euphemism..
Ok finally got a void Main. Run.. and... ugh (facepalm of despair)
 
lol
Exception?
 
@retailcoder Haha
 
all of my SudokuDigit instances are null
FML
I think I'll submit my project as "Hello Java World: Parsing a Sudoku Puzzle"
 
loop through the 2d-array and create instances perhaps?
remember that when looping through the 2d-array, you must loop through the indexes and set the value in the array.
 
5:47 PM
All right, my SudokuGrid gets populated now
 
Here it is:
0
Q: C Sudoku Solver

syb0rgThis is my first attempt at a weekend-challenge. I would prefer if reviews contained suggestions on how to improve the algorithm, but all suggestions are acceptable. Here is the code: #include <stdio.h> int isAvailable(int sudoku[][9], int row, int col, int num) { int rowStart = (row/3) *...

 
I'm getting a NullPointerException when trying to output the grid to console. The stack trace sucks.
I mean the same stack trace in C# would mean that Console is null... doesn't make sense, right?
 
The stack trace in C# also leaves some things to be desired IMO
what does your line look like?
 
public static void main(String[] args){
SudokuGrid grid = new SudokuGrid(puzzle);
String result = grid.toString();
System.console().writer().write(result);
System.console().readLine();
}
NPE at System.console().writer().write(result);
 
0
Q: C Sudoku Solver

syb0rgThis is my first attempt at a weekend-challenge. I would prefer if reviews contained suggestions on how to improve the algorithm, but all suggestions are acceptable. Here is the code: #include <stdio.h> int isAvailable(int sudoku[][9], int row, int col, int num) { int rowStart = (row/3) *...

 
5:49 PM
I normally use System.out.print or System.out.println
 
C# me was looking for a Console :)
 
and for reading, use Scanner scanner = new Scanner(System.in); scanner.nextLine();
 
So what's console for then?
 
Never used it TBH
didn't even know System.console() existed until now
 
OMG I've found something in Java that Simon didn't know about!!
3
(doesn't mean I can use it though)
 
5:51 PM
But you haven't figured out how it works yet :)
Damnit, my refactoring have caused my program to not work anymore
 
@SimonAndréForsberg @retailcoder - Console is null for all occasions you run in eclipse, and it is a Java low-level interace to an actual console (think unix TTY, or PTY) (or DOS/Windows 'CON'). When running in eclipse, you may have a STDIN and STDOUT/ERR, but you are not in an actual console.
 
@rolfl I thought it returned null due to a bug.
 
No, FWIW, I have never had occasion to use a console, but you can do things like intercept control characters, it's unbufferred, etc.... if you need it. But, for most things people do, it will be null (because your JVM is not directly attached to the Console).
OK, I am out-of-here... back in a few hours.
 
@retailcoder I just discovered I'm not in this post :(
6
A: Call of Duty - We're on a mission

retailcoderSome "memes"... A few expressions have come up recently, thought I'd share them here (feel free to add, this is CW!) Running out of ammo: when you have exhausted all 40 votes for the day. Head shot: when you're out of ammo and post a target in chat, and then someone puts in a vote for you. Wak...

 
@syb0rg What do you want to be known for?
(I wasn't in it either until I added myself)
 
6:00 PM
@SimonAndréForsberg I didn't know I could add myself...
What do you guys know me for?
 
In fact, I added all the personalities that are there
For being involved in the Raspberry Pi SE site
And from now on, for being able to reduce 1500 lines to 85
A good place to start looking is to see which messages you have posted that has been starred:
http://chat.stackexchange.com/rooms/info/11760/cr-weekend-challenge?tab=stars&filter=mymessages
http://chat.stackexchange.com/rooms/info/8595/the-2nd-monitor?tab=stars&filter=mymessages
 
1301 edits so far. That's roughly 12% of the total question count...
 
@syb0rg being half-robot, half... no one's sure what the other half is :p
2
 
@SimonAndréForsberg @retailcoder Being a phone-chatting, half-human & half-deficient-robot, refactoring king?
 
@syb0rg Sounds about right :)
 
6:11 PM
It's CW, anybody can edit ;)
 
Anyone with at least 100 rep, specifically.
 
true
 
Surprisingly though, @Jamal still hasn't done so
 
I already have an entry up there, and I have nothing else in mind to add.
 
Thanks @rolfl, just saw your console explanation.
 
6:21 PM
I think it's good that Sudoku is what gets me to try C#, so that I can use all this LINQ stuff
@retailcoder Is it possible to get a random element from a List somehow, in an easy way? (with LINQ?)
 
@SimonAndréForsberg lol. This is where abusing LINQ gets its meaning from.
Just go .ToList() and myList[someRandomIndex]
Or write your own List<T> extension method that returns a random item?
public static T GetRandom(this List<T> list) { ... }
@SimonAndréForsberg why does every object have an ID in the debugger?
/ where's this ID coming from?
 
@retailcoder What do you mean by ID?
 
Name: this | Value: SudokuGrid (id=17)
 
@retailcoder How to get that someRandomIndex? Anything similar to Java's Random class?
No ID(ea) where that ID comes from.
It's just there. It's a nice way though to see whether or not two objects that look similar are actually the same reference
 
There's a Random class in C# too; var rng = new Random(); var rnd = rng.Next();
 
6:32 PM
ok
 
You can do .Next(min, max); too
But IntelliSense already told you that ;)
@SimonAndréForsberg is there anything like extension methods in Java?
 
not sure what extension methods are, @retailcoder
 
lol
 
heh ... answered a C question ;-)
 
You've been using them like crazy!
 
6:35 PM
@rolfl I see that. You did a very good job too.
 
public static IEnumerable<T> Where(this IEnumerable<T> enumerable, Func<T, bool> predicate) is one
 
... why, thank you ... ;-)
 
@retailcoder
public class MyExtensions {
public static int method(String str) {
}
}

I suppose you could use:
import static MyExtensions.*;

And then simply call
method("str");
 
needs this in the signature
more like using MyExtensions;
hold on
 
In Java, you can't use this in a method signature like that
 
6:39 PM
C# is so much more powerful in so many ways that I can now fully appreciate :)
 
@retailcoder http://stackoverflow.com/questions/4359979/java-equivalent-to-c-sharp-extension-methods
Java does not support extension methods.
Instead, you can make a regular static method, or write your own class.
Normally in Java, I use public static methods for what you want
Eclipse is so much more powerful in so many ways that I can now fully appreciate :)
 
With extension methods you can extend (add methods to) any type you want, including stuff in the core libraries, or in 3rd-party code you don't even have sources for.
Kudos for Eclipse though, it's a very nice IDE. Too bad it doesn't do C#
 
Kudos to both of you for jumping your comfort zones for this one!
3
 
Oh you're shitting me!!
3
 
6:43 PM
I have no idea how good it is though, but it's probably worth a try or two :)
 
meh.. I'd rather keep Eclipse for Java, and VS+R# for C#.
 
your choice :)
 
I'm such a noob. I was doing result.contat("|"); and somehow (don't ask!) expecting the method call to affect result
 
Strings are mutable in C#?
 
no!!
 
6:47 PM
lol
 
that's why I said don't ask!!
eeeh... my grid is all crooked.
at least I got an output
-------------------
| | | |8|4| | | |9|
-------------------
| | |1| | | | | |5|
-------------------
|8| | | |2|1|4|6| |
-------------------
|7| |8| | | | |9| |
-------------------
| | | | | | | | | |
-------------------
| |5| | | | |3| |1|
-------------------
| |2|4|9|1| | | |7|
-------------------
|9| | | | | |5| | |
-------------------
|3| | | |8|4| | | |
-------------------
 
looks better inside <pre> :)
 
^^ obviously didn't spend as much time as @rolfl on fancy cherry-picked ASCII characters
 
Unicode characters!
 
oh sorry
lol
 
6:51 PM
Well, the challenge isn't to make a nice output ^^
 
For every Unicode character I use, I resurrect a baby Unicorn!
2
 
(removed)
 
lol!!
 
╔═══╤═══╤═══╦═══╤═══╤═══╦═══╤═══╤═══╗
║ 6 │ 3 │ 2 ║ 8 │ 4 │ 5 ║ 1 │ 7 │ 9 ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║ 4 │ 7 │ 1 ║ 3 │ 6 │ 9 ║ 2 │ 8 │ 5 ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║ 8 │ 9 │ 5 ║ 7 │ 2 │ 1 ║ 4 │ 6 │ 3 ║
╠═══╪═══╪═══╬═══╪═══╪═══╬═══╪═══╪═══╣
║ 7 │ 4 │ 8 ║ 1 │ 5 │ 3 ║ 6 │ 9 │ 2 ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║ 1 │ 6 │ 3 ║ 4 │ 9 │ 2 ║ 7 │ 5 │ 8 ║
╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
║ 2 │ 5 │ 9 ║ 6 │ 7 │ 8 ║ 3 │ 4 │ 1 ║
╠═══╪═══╪═══╬═══╪═══╪═══╬═══╪═══╪═══╣
║ 5 │ 2 │ 4 ║ 9 │ 1 │ 6 ║ 8 │ 3 │ 7 ║
 
6:51 PM
Then you gotta use a lot of unicode to make up for all the ones we've killed
 
@rolfl: Looks like syb0rg has just invalidated your answers.
 
I'll just revert ... ;-)
 
Alright. Then please comment about that.
 
@Jamal I posted an edit to rectify it.
(on his answer, all he has to do is accept)
Other than some variable names being changed, his answer is still valid.
 
-------------------------------------
|   |   |   | 8 | 4 |   |   |   | 9 |
-------------------------------------
|   |   | 1 |   |   |   |   |   | 5 |
-------------------------------------
| 8 |   |   |   | 2 | 1 | 4 | 6 |   |
=====================================
| 7 |   | 8 |   |   |   |   | 9 |   |
-------------------------------------
|   |   |   |   |   |   |   |   |   |
-------------------------------------
|   | 5 |   |   |   |   | 3 |   | 1 |
=====================================
|   | 2 | 4 | 9 | 1 |   |   |   | 7 |
 
6:56 PM
@syb0rg: The first thing that set off my suspicions is that you've removed j from your function.
 
I only output a Sudoku grid like this:
040800015
152697834
038451290
019706543
075300080
063508100
320985400
580063900
690000308
 
@Jamal I forgot about that, and edited it back in real quick.
It's there now.
 
Okay. Make sure everything else checks out.
I'll let rolfl decide on the edit.
 
@Jamal Looking at the side-by-side markdown, everything checks out.
 
Hehe ... I'll let it all go through...;-)
2
 
6:58 PM
lol
 
I think this is as good as I'll get it to look:

-------------------------------------
|   |   |   | 8 | 4 |   |   |   | 9 |
-------------------------------------
|   |   | 1 |   |   |   |   |   | 5 |
-------------------------------------
| 8 |   |   |   | 2 | 1 | 4 | 6 |   |
+===========+===========+===========+
| 7 |   | 8 |   |   |   |   | 9 |   |
-------------------------------------
|   |   |   |   |   |   |   |   |   |
-------------------------------------
|   | 5 |   |   |   |   | 3 |   | 1 |
@SimonAndréForsberg just override .ToString() on your Grid class :)
 
@retailcoder That's what I do, but I haven't bothered to add all the fancy ASCII (or unicode) output
 
If only this week's challenge was to parse a string into a Sudoku grid!
 
Or actually, I haven't overridden ToString there, but in all my other classes I have
Instead I use a Output method at the moment
 
@SimonAndréForsberg overriding ToString() on your grid would allow you to output it just like Console.Write(myGrid);
(the .ToString() call is implicit)
 
7:04 PM
@retailcoder same in Java
In C#, can you do this?
Console.WriteLine("The value is: " + 42);
I tried that, but it didn't seem to work, I had to call .ToString for my int
 
Try Console.WriteLine("The value is: {0}", 42);
Then .ToString() will be implicitly called
Otherwise yeah, C# is type-fussy
 
OK, yeah I have found that it's possible to do it that way but I find it much easier to use + operator for such small things
 
Or type-safe as ppl call it
not after you get used to string.Format()
 
Java is also type-safe, but the + operator is overloaded for Strings, so that a StringBuilder object is automatically created to concatenate strings
 
I think in C# it calls string.Contat() under the hood (the + operator is overridden too)
BTW string is a language alias for String - they're the same
except String makes it more obvious that you're dealing with a reference type / class
C# also has a language alias for Object / object
int is a language alias for System.Int32
 
7:16 PM
Sometimes I wish there were type aliases in Java too, and that it was possible to make your own
I wonder how many methods I have right now that does not use LINQ
 
I'll tell you when I review your code :)
 
var methodsWithoutLINQ = from method in all_my_methods where method.IsUsingLINQ;
return methodsWithoutLINQ.Count();
 
lol
you could just do return all_my_methods.Count(method => method.IsUsingLINQ);
^^ Count() has an overload that takes a predicate :)
 
ah, yes, that's also an option of course
I think I'm mixing the two ways quite often
not exactly sure when to use which one :P
 
from myPreferences where IfeelLikeIt select appropriateSyntax is just the same as myPreferences.Where(o => o.IfeelLikeIt)
rigorously identical
 
7:22 PM
Sweet, my question is the 9th hottest question on the SE network:
5
Q: Sudoku Solver in C

syb0rgThis is my first attempt at a weekend-challenge. I would prefer if reviews contained suggestions on how to improve the algorithm, but all suggestions are acceptable. #include <stdio.h> int isAvailable(int puzzle[][9], int row, int col, int num) { int rowStart = (row/3) * 3; int colStar...

 
I prefer the extension methods over the query syntax though
 
I encourage the carpet-bombing of both answers.
 
Napalm Strike!!
2
(ka-boom)
 
Whoo hoo ... scored my first 'Nice Question'....
 
Now has risen to #4 on the SE network!
 
7:28 PM
You remember what we have said, @rolfl. The more horrible the code is, the more upvotes the question gets.
3
 
It looks like you have to click on Hot Network Questions to see the question on there. The front view doesn't have this question.
 
@syb0rg Don't want to disappoint you, but I'm not so sure everyone sees the same questions there. I don't see your question at all in that list
Ah, oh, there it is
Thanks @Jamal
 
It takes an extra click to see this question. T_T Thanks, Obama SE!
 
@SimonAndréForsberg I'm looking at the hottest questions from the old hotbar from chat. Maybe they are using a newer algorithm for the hottest questions now.
 
No strikethrough?!?
 
7:32 PM
@Jamal Nope
3
 
There we go.
 
@Jamal Three - on both sides of text.
 
Already looked at your message to find out. ;-)
(because of the "nope")
 
0
Q: Hello Java World ~> Parsing a Sudoku Grid

retailcoderThis is my first, very-very first attempt at java. I haven't started tackling the actual resolution of the sudoku puzzle (not even sure where to start, haven't looked at other weekend-challenge entries yet). I don't have much to go over here, but I'm sure it's filled with beginner mistakes alread...

@SimonAndréForsberg ^^
@rolfl ^^^
 
@retailcoder I'm on it
 
7:43 PM
All right, I have to go. Cya guys later.
 
@syb0rg later!
 
Later!
 
3
Q: Hello Java World ~> Parsing a Sudoku Grid

retailcoderThis is my first, very-very first attempt at java. I haven't started tackling the actual resolution of the sudoku puzzle (not even sure where to start, haven't looked at other weekend-challenge entries yet). I don't have much to go over here, but I'm sure it's filled with beginner mistakes alread...

 
@StackExchange duh
2
 
@retailcoder
0
A: Hello Java World ~> Parsing a Sudoku Grid

Simon André Forsberg Instead of your String puzzle you could use an String[] like this: (Not saying you have to, but you should know that the alternative exists) You are currently converting it to a String array later anyway, so why not have it as a String array right from the start? private final static String[] p...

15 minutes, HA! Take that, average answering time!
2
 
7:59 PM
@SimonAndréForsberg thanks for the last paragraph :)
@SimonAndréForsberg oddly, I wrote the string[] constructor before the string one... I just wanted to play with string.split()
 
When I eventually post my first Java program, I suspect it'll really show my C++-side. :-)
 
ooh @SimonAndréForsberg's answer has been @Jamalized!
 
@retailcoder Added some suggestions about Javadoc
 
My C# side doesn't really shine in a language that doesn't have language-integrated query ...
 
Of course it's been @Jamal'ized, I would be surprised if it wouldn't be
 
8:05 PM
@SimonAndréForsberg in C# you just put /// at the top of a type or method (or property) and poof you've got XML-comments :)
 
@retailcoder In Java you just execute javadoc.exe with some parameters and poof, you've got HTML documentation.
 
You can set an option in the build settings to build a .xml file with all of your xml-comments; I use SandCastle to make a MSDN-style HTML help out of it.
(poof lol)
SandCastle would be equivalent to your javadoc.exe (I believe there's even a command-line to build the HTML)
 
So I've got pretty much solid grounds to get started on solving the puzzle right?
 
8:14 PM
funny you caught i and j in parseStringContent(String[] contents) - I called them row and col everywhere else!
 
@retailcoder Added info about using Character.digit to my answer
 
what's a radix?
 
hexadecimal = 16
decimal = 10
octal = 8
binary = 2
 
oh
radix => "base"
 
8:19 PM
wtf Java
@SimonAndréForsberg is there a Java equivalent to List<T> or I have to stick with arrays?
 
you just said it
 
I'd like to add a List<int> possibleValues;
 
List<T> it is
You'll have to use List<Integer> for ints
 
oh
I miss C# already
 
primary types can't be used for generics
 
8:22 PM
^^ redundant
In C# the T of List<T> can be any object
 
List<Integer> possibleValues = new ArrayList<Integer>();
yes, same in Java. However, int is not an Object in Java
 
wait I can't instantiate a new List<Integer>()
 
List is the interface
ArrayList is the most common implementation
 
in C# (no, in .NET) everything derives from System.Object
in C# List<T> is List<T> : IList<T>
 
No primitives? Ugh.
How would @rolfl survive?
 
8:24 PM
there's System.ValueType
and System.ReferenceType
String is a special reference type, in that it "behaves" like a value type
^^^ immutable
value types are stored on the stack, ref types on the heap. Boxing value types is bad practice and should be avoided.
(same in Java I guess)
@SimonAndréForsberg everything being an object means var words = "hello, world".Split(','); is valid C# :)
 
in Java, that would be String[] words = "hello, world".split(",");
 
ok, try 123.ToString(); :p
 
Not much need to call toString for an int in Java
but yes, I noticed it's possible in C#
 
That was just an example - means you could write an extension method that extends System.Int32, and call it with any instance of the type :)
like, public static bool IsPrime(this int number)
and then do if (4321.IsPrime()) { ... }
 
aha
I use wolframalpha for that:
http://www.wolframalpha.com/input/?i=4321&t=mfftb01
`return false;`
:)
 
8:36 PM
lol
is that a webservice?
 
yup
or well...
I don't know if there's any API for it
 
WolframAlpha is awesome.
 
but you can do it manually :)
 
pfft. extension methods are even better.
:)
 
I like to use it when I'm too lazy to differentiate/integrate something. :-)
 
8:40 PM
private boolean validateDigitValue(Integer value) {
return value == null || (value >= LOWEST_VALID_VALUE && value <= HIGHEST_VALID_VALUE);
}
^^ bye-bye magic numbers :)
 
That's more like it!
when I wrote that review for your code, I realized i got plenty of magic numbers myself
How much documentation should I add to the code??
 
as much as you want to!
 
as little as I want to also?
 
I don't write lots of comments, I like my code self-explanatory :)
^^^ that's what I meant
 
What's the naming conventions for constants in C#?
private const int DEFAULT_SIZE = 9; that works?
 
8:44 PM
C# isn't too fond of ALL_CAPS, the convention is that of a static field, so DefaultSize would do.
 
 
^^ hmm not quite the clean-code spirit :)
// increments i by 1
i++;
2
 
That, shamefully, half-describes me. I hardly write comments, but I also don't like to make them useless.
 
wow
Nobel prize
 
8:48 PM
By the way, I don't recommend posting that image on 's wiki. ;-)
> takes three attempts to star something
> assumes all stars have been used up
 
@SimonAndréForsberg why does public static final int HIGHEST_VALID_VALUE = SudokuGrid.REGION_SIZE*SudokuGrid.REGION_SIZE; work, but not public static final int HIGHEST_VALID_VALUE = SudokuGrid.REGION_SIZE^2;?
 
@retailcoder Because ^2 is a XOR operation?
 
ugh.. what's the operator for "power"
 
00:00 - 21:0021:00 - 00:00

« first day (14 days earlier)      last day (20 days later) »