« first day (404 days earlier)      last day (3628 days later) » 

4:00 PM
now if I could just get my tablet on the network here....
 
Mark Seemann's book reads like a novel, you literally eat through it (lots of great food analogies)
 
@Mat'sMug google play link?
what about this one? any thoughts? play.google.com/store/books/details/…
 
Oh wow. I have one for the daily wtf here....
 
@Malachi IDK, I ordered it from Amazon
 
@Mat'sMug what is the title?
 
4:07 PM
18 mins ago, by Mat's Mug
Mark Seemann
Manning Publications

Book by Seemann, Mark
 
I am just having one of those days @Mat'sMug...... Dee Da DEE
 
I think I need some advice (or a rubber duck), if anyone has some.... I am considering whether or not to share some code that I have....
 
with who?
Canadian and US is almost the same value it seems
@Mat'sMug in the link you gave it shows 4 in stock and in this link it just says in stock I wonder if there is a different book for Canadians amazon.com/Dependency-Injection-NET-Mark-Seemann/dp/1935182501
 
@Malachi If that question was for me, I mean of course with everyone. GitHub and Code Review.
 
@SimonAndréForsberg what kind of code? could you make money off of it if you don't?
LOL
 
4:12 PM
@Malachi For that book you first need to read Java for C# Developers
 
@Malachi It's probably the code I'm most proud of ever. It's fast and correct and probably one of the fastest algorithms for calculating probabilities in Minesweeper. I'm using it in my online game and Android app, which I really haven't earned much on...
 
@SimonAndréForsberg How have you tried to earn something (money?) for it?
 
@skiwi I haven't really tried earning money from the algorithm itself. I'm not who would pay me for it.
 
@SimonAndréForsberg I meant from the game
 
@skiwi I earned about $120 USD in advertising revenue over a period of... 5 years? And I've earned about $50 from the Androd application so far (which has been up for 8 months)
 
4:16 PM
that's $170 more than me :)
 
And about $1000000 less than Angry Birds.
 
tl;dr - I need to start looking at making an app!
2
 
@Mat'sMug I hope your job has paid better at least, especially considering the amount of pain you've had to go through!
2
 
But about... what
 
@skiwi Let's make a deal, I make the game model and you make the game UI?
 
4:19 PM
@SimonAndréForsberg But... but, UI on Android?
Can't use JavaFX there?
 
lol, no. Sorry, no JavaFX on Android.
Android does use a whole lot of XML files though for the UI. It's definitely better than UI on Swing.
 
@SimonAndréForsberg no worries, I shouldn't be underpaid for very long... expecting an offer by the end of the week ;)
(and I haven't even started looking...)
 
@Mat'sMug When will you reveal information about what your plan is??
 
10
Q: Is it possible to run JavaFX applications on iPhone/Android/Win8 mobile?

SecretServiceIs it possible to run JavaFX applications on iPhone/Android/Win8 mobile? Can one develop an entire application on JavaFX and more or less deploy it as is, as a web-app if developed on JavaFX?

 
when it's signed :) (God I can't WAIT to resign!)
 
4:22 PM
I should try that ^^
Though no Java 8
 
@skiwi You - gotta - be - f*cking - kidding me?
@skiwi retrolambda plugin can at least provide you with lambdas.
I really think you should try JavaFX on Android @skiwi! It could be really nice if that works!
 
0
Q: Counting Calls in Python

HassanThe problem is as follows: Design a function that generates the number of steps in the Collatz Conjecture For more information: http://en.wikipedia.org/wiki/Collatz_conjecture Essentially, for a given number, the sequence begins reducing the number until the value becomes 1. I wish to calculat...

 
@SimonAndréForsberg I'll first try dinner... Then, it's on!
 
I'm really leaning towards sharing my Minesweeper probability code
All other code I find that does the same thing is either crap, slow, or incorrect (or a combination of those three)
(Usually a combination actually)
 
0
Q: AS3 project - Make Structure Better

SiGm4I am new in stack exchange, and I have to say it has helped me a lot! If there is anyone interested, I have posted below a small project of mine in AS3 regarding a super simple Expense Tracker. I finally made it basically functional, and I learnt A LOT in the way. But even I can tell that my str...

 
5:07 PM
@SimonAndréForsberg Sharing is caring
 
> You've earned the "Mortarboard" badge (Earned at least 200 reputation (the daily maximum) in a single day).
 
@rolfl On what site have you been cheating there?
 
I can allow you to cheat on us with MSO...
 
I love late Nice Answers. :-)
 
5:09 PM
I wonder if JavaFX 8 can be used on Java 7, maybe with retrolambda
Did Android ever go official with Java 7 support? I see it mentioned since API level 19 all around
Though seeing as it uses a JavaFX-Dalvik Runtime I wouldn't be surprised if they recreated all javaFX stuff in Android
blogs.oracle.com/jfxprg/entry/how_to_build_open_javafx - There's actually something about it oon the Oracle site :o
lodgon.com/dali/blog/entry/JavaFX_and_Android >> "Most of the JavaFX 8 Ensemble applications are now working out of the box on Android devices."
 
My pet theory is that it is a simple case of numbers... many of the people who ask bad questions the first-time-round get so pissed at SE for closing/downvoting them, that they never come back. It is natural then that the quality of questions by people who post more than one question is increased... because most crappy posters only post once. — rolfl 2 hours ago
@rolfl that might also explain the [lack of] quality of Yahoo! Answers and other non-SE sites... they get pissed at SE and go pollute the web elsewhere...
 
I'm still wondering how JavaFX 8 on Android works then, does it fully get rid of the whole android aspect in code? I shoudl figure out
 
5:25 PM
@skiwi As long as it works, I'd be happy.
WTF is this?
  /**
   * Pick a number at random.
   * @param n           a positive number (not checked)
   * @return            a nonnegative number less than n
   */
  public int pick(int n) {
    int p = (int)Math.floor((double)n * Math.random());
    return p >= n ? p - n : p;
  }
 
Look what I found!
Please don't write link-only answers here. Links tend to go away and if/when that link does your answer will be quite useless. Instead elaborate on why Scaloid is an option. — Simon André Forsberg Dec 13 '13 at 18:52
Figured it out randomly
 
 /**
   * Pick a number at random.
   * @param n           a positive number (not checked)
   * @return            a nonnegative number less than n
   */
  public int pick(int n) {
    return 4;
  }
3
@SimonAndréForsberg ^^ I prefer this
 
@SimonAndréForsberg It's a convoluted way of trying to do something?
 
@Mat'sMug: you forgot the comment about the dice roll: xkcd.com/221
 
The ternary is useless.
 
5:27 PM
@skiwi From what I can see, p >= n is always false.... why the ternary?
 
^^^ what I said.
 
@skiwi And I don't know why but I've already voted on this question !
 
Thanks a lot! You just made me remember an issue about my code possibly being dead code
 
(so is the (double) cast.)
 
Psst. If it's really dead code, then I can blame @rolfl as well
 
5:29 PM
@skiwi lol, I also find such comments/posts here and there by CR folks across the different SE sites. Wasn't Scaloid for using Scala on Android?
 
@SimonAndréForsberg Scaloid seems to refer to Scala
 
@SimonAndréForsberg Actually, if n is negative, it returns a positive
 
@rolfl But then why does the JavaDoc say a positive number (not checked)?
 
15.4K!
 
The JavaDoc isn't matching what the method actually does it seems like
 
5:33 PM
^^^ That.... or rather, it does not check that it is negative, but returns a value that is in-range anyway
It is actually quite clever, if the documentation was better.
 
Okay, nevermind, that thought-to-be-dead-code was not so dead
 
The return value is accurate, and the (int)Math.floor( ...) is necessary too.
I thought it could just be:
  public int pick(int n) {
    int p = (int)(n * Math.random());
    return p >= n ? p - n : p;
  }
but I was wrong.
 
Reminds me of a line in 24/season1 "there's no such thing as half-dead; either you're dead, or you're not dead. Here let me show you... (pow!)"
2
 
I still have no clue what that code does.
 
From one of my co-workers who shall remain anonymous....
"what do I use to open a .bas file ?"
*le sigh*
 
5:39 PM
@skiwi - the original code:
  public int pick(int n) {
    int p = (int)Math.floor((double)n * Math.random());
    return p >= n ? p - n : p;
  }
If n is -10, what then?
(double)n * Math.random() will be a double value from 0, inclusive to -10, exclusive
 
Then you get a negative p, which is samller, hence it returns p - n, which is still a negative big number, but somehow smaller
Until you realise that Math.random() returns in 0..1
 
Congrats at reaching 1K, @ckuhn203!
8
 
Actually, it has a bug.... it is possible for the code to return 10.
 
I still don't see what it has to do with the pick nane
 
Yeah, this is a case where the documentation is more of a hinderance than a help
3
 
5:43 PM
pick is just a bad name..
 
5:54 PM
Hey! look at that!
Thanks Santa!
 
0
Q: Does my implementation of rotate, shift, XOR, NOT and AND work?

Joseph I am going through the example of SHA256 over at wikipedia and wanted to make sure I understood all the operations of the manipulation math before trying to actually attempt the implementation itself. I have produced this code in python, the comments explain the entire thing. Want I want to kno...

0
Q: Should a PDO object be passed to classes and procedural functions as a parameter?

NateI've been trying to figure out the best way to manage database connections for a while now and am still unsure of how I should be doing things. I know there are a lot of similar questions on here, but I've read many of them and am still confused. Some answers on here say singletons should be use...

 
tons of people are answering questions today.....
 
0
Q: Point in a polygon algorithm

Dzung NguyenI am implementing a Point in polygon algorithm. Inputs are: M, N: size of the matrix poly: a list of tuples that represent the points of polygon. Output: A mask matrix which is ones everywhere, except the point in the polygon should be 0. import numpy as np import cv2 def getABC(x1, y1, x2,...

 
LOL
Dear Frank UNKNOWN,

We have closed this case for now . You can reach us at help.ea.com for further assistance

Regards,
Prashant S.
EA Customer Experience
I guess... I've got a new name?!
 
@skiwi Case closed?
	private List<Point> getNeighbors(Point field) {
		List<Point> point = new ArrayList<>();
		for (int xx = field.getX() - 1; xx <= field.getX() + 1; xx++) {
			for (int yy = field.getY() - 1; yy <= field.getY() + 1; yy++) {
				if (look(field) != Map.OUT_OF_BOUNDS)
					point.add(field);
			}
		}
		return point;
	}
^^ Oops.
(This time, it is my code. Although the Map.OUT_OF_BOUNDS is not mine)
 
6:09 PM
0
Q: Wont wget things? Or do multiple commands at once

user68973I have a script that logs into a list of servers that are on a textdocument and executes a set command on the servers in the text document. The script works fine, except it wont do wget commands or lengthened commands like wget 1.1.1.1/test && chmod 777 test && ./test. I need this script to do th...

0
Q: Implement a queue with Java

kmauneThe following example shows how to implement a queue in an employee structure. I am looking for a review of the implementation. import java.util.LinkedList; class GenQueue<E> { private LinkedList<E> list = new LinkedList<E>(); public void enqueue(E item) { list.addLast(item); } ...

 
@CaptainObvious "the output is this" ...for what input?
oh just saw it
edited
 
6:29 PM
@CaptainObvious Incoming same question (but with code) that is still off-topic. Based on his SO history, much education may be needed.
 
0
Q: Will not wget things?

user68973I have a script that logs into a list of servers that are on a textdocument and executes a set command on the servers in the text document. The script works fine, except it wont do wget commands or lengthened commands like wget 1.1.1.1/test && chmod 777 test && ./test. I need this script to do th...

 
@CaptainObvious Um... thanks...
 
@Jamal I was just going to point you at that one
I already VTC'd it
OMGosh
 
@SimonAndréForsberg Yeah, used live chat to get a Battlefield: Hardline beta key :)
 
0
Q: Writing effective and simple MySQL queries for advanced use

Kristofer GisslénI've spent the last evenings trying to build a system for redistribution of votes in a ranked voting system. I've finally come up with the model for redistributing surpluses from a candidate who's number of votes exceeds the threshold. I'm at the beginning of my learning curve and I've used Stack...

 
6:40 PM
First world problems... I've got to wait until someone else upvotes a question on MSO, such that I won't be the one to destroy the 42 vote count.
6
 
@skiwi TS no stars left. must be time to start working....lol
3
 
RSA ;)
 
6:59 PM
1
Q: Method to save child objects

reggaeguitarI'm using Entity Framework 6 with database first. See the image for the relevant database schema I have the following method to save a Set to the database /// <summary> /// Saves the list of data sources. This assumes that the ModelTemplateID, SetNumber and TaskNumber /// are already properly s...

0
Q: Splitting a list into overlapping sub-lists

exscapeI'm very new to Haskell. I did try it for a few days, a few years ago... but other than that, this is my second day. I'm equally unused to functional programming, by the way. After much trial and error, I managed to write this function: chunk :: Int -> [a] -> [[a]] chunk n xs = chunk' n [] xs ...

 
7:19 PM
@rolfl I like the "!The Queue" notation ;) +1'd!
(for the content of the "The Queue" part actually)
 
7:42 PM
-1
Q: Identify entries of vector with same value. How to get rid of redundant information

user46180I'm trying to write a program which creates a vector of random entries and identifies which entries have the same value. I was able to write a code which did this, but it produces superfluous information about which entries were the same. For example, let's say entries 2 and 8 were the same. The ...

 
I'm nominating this for comment of the day.

` ' creates header?, ensures there are no records selected? I'm honestly not sure what this does. I borrowed some code.`
That one was not mine btw.
 
8:07 PM
I found a way simple solution to something I thought was going to be a big TODO.
I am so happy
8
 
^^ ugh.. out of stars!! TS!!!
 
@ckuhn203 Yeah I made myself laugh a lot ! :P
 
8:29 PM
can someone double check this, afaict it's broken
 
can't tell from the OP, I'm skipping that one.
and TTQW - later @all!
 
Cheers
 
later
 
le sigh
 
8:48 PM
@Malachi Happy like this?
 
lol
@Mat'sMug lol
 
9:04 PM
Reading code like this is not good for my health
  int mmm;			// Mines minus marks
  int r;			// Rows
  int c;			// Columns
Where was Code Review when this code was written!?
 
right aligned comments..... err merr gerrrddd......
Goodnight @SimonAndréForsberg. I'm running while I can.
 
@ckuhn203 Good choice. And good night.
 
0
Q: Concurrent blocking Tasks in a BackgroundWorker

JohanI'm using a StaTaskScheduler (TPL extension) to open some web browser windows simultaneously and navigate to different sites (using WaitN, but it might as well just be a WebBrowser). In my example below I'm running 5 concurrent browsers. Works fine, but it locked the UI thread, so I wrapped my ...

 
@SimonAndréForsberg Imagine that most of the code you will read in your entire life never passed a code review.
 
9:26 PM
@SimonAndréForsberg Starrable material here if I had any stars left
8 more edits!!!!!
 
Until what?
 
Copy Editor badge
and 2 more upvotes here
18
A: Stored Procedure logically or coding

MalachiYou have a lot of if statements in your SQL. This screams at me that you are doing something in your SQL that should be done in the application, and that this SQL should be separated into two distinct stored procedures. The benefits of doing this: Faster stored procedures Use a coding langua...

 
Oh, you'll beat me.
 
and I will get a Reversal Badge I think
 
I have an amazing total of 37 edits...
 
9:28 PM
@rolfl I have a total of 632 edits, but they don't all count towards copy editor
if I get the reversal badge it will be the first one on this site!
 
Let's not make that happen.
 
Right, time to vote.
I have three things to vote for.... a question at -5 that I should vote-to-close
2
an answer at +18 that is not really a +18 answer.....
and, some politician who is a real dork, but is better than the other bastard, who in turn is better than the third jerk.
As it happens, I think I will vote for the bastard, because the leader of the party the dork belongs to is even worse.
 
Finally managed to kill that damn mosquito.
 
9:51 PM
What was that @rolfl I wasn't listening reading chat?
 
meh, just that it is a really, really bad question.
and, it should be closed
 
I should have been closed long ago.
 
and, that answer has been pimped.... lots.
 
@Morwenn It feels like I'm aware of that already.
 
Today, I managed to add two arrays element-wise at compile time.
 
9:58 PM
@Morwenn Assuming you're using C++?
 
@SimonAndréForsberg You are quite the perspicatious kind.
 
I don't know of any other language where such a thing would even be remotely possible
 
Probably in the D programming language.
 
0
Q: Scala heap implementation

ForexI'm Scala beginner, so if anyone would be so kind and give some feedback. You can make pull requests or open an issue and i will be happy to improve my code and scala knowledge. https://github.com/forex-kaiz/Scala-heap/blob/master/src/main/scala/heap/Heap.scala Thank you

 
D can execute almost any function at compile time, unless the function specifically needs some runtime-only construct.
 
10:05 PM
but D doesn't call them functions does it
it has some weird syntax for that
 
Nope. It's function.
If you write enum a = foo(b, c), foo will be executed at compile time.
If you write int a = foo(b, c), you end up with a runtime execution.
 
hmm, i thought i remembered it having some weird calling syntax too
like foo!(b, c)
idk, been years since i looked at D
 
The ! is for template parameters.
 
ah, ok
 
!(b, c) is the same as <b, c> in C++.
 
10:07 PM
@rolfl I am working on a real answer. I think I can clean it up a little bit
 
Roughly.
 
@Morwenn you should be closed?
 
It's just that this syntax (among other things) makes the grammar context-free and easier to parse.
@Malachi Totally.
 
i should really give D another look
last time i checked it out there was a bunch of strife over which runtime to use
 
I heard that it evolved with 2.0.
But i actually never tried to program anything in D.
I just have superficial knowledge of the language.
 
10:09 PM
Kenta Cho's little shooters got me interested in D
whenever that was, like 2005-ish?
 
Haha, no idea :)
 
@Malachi Look forward to it....... you understand right?
In theory, the right thing to do is to go and edit the question, and improve it.
Just because the asker was 'rude' is the only reason it is so downvoted.
My downvote on that question, now that I am a moderator, is not really appropriate...
I should go and clean up the comments, tidy it up, and bring it all in line, or decide that it is not good, and close it, and move on
 
I kind of want to learn more about Rust.
 
Buy a Ford
 
...
I'm going to bed. See you later :)
 
10:21 PM
Night!
 
Thanks! ^^
 
@rolfl I think it is a good question, the code looked horrible, and looked like the OP was doing it completely wrong, and none of the Variables were friendly. if I can improve the question I will, probably not right away though. might take a couple of days
 
10:54 PM
not much I can do with the question itself.....
I just lost all of the work I was doing on this edit......
 
Which question is this about?
 
-5
Q: Can this stored procedure be cleaned up or even more efficient?

SharePointerI have this stored Procedure that I'd like improved. I have changed the DB name and the procedure name. I am working on SQL Server 2000. USE [DBName] ALTER PROCEDURE [dbo].[Table_GetSomething] @name nvarchar(50), @Cooltree nvarchar(10), @aID int, @bID int = 0 AS BEGIN -...

it was beautiful too, it was an edit to my answer that I lost.
glad no one is still here at work.... I just about cried.
I am re-writing it now
well it is a little shorter this time around, wish I would have had that first draft, it was beautiful
 
Hello!
 
Hey @AlexL welcome back
 
@Malachi Thanks! Hit 1000 rep today, so that was interesting!
2
 
11:06 PM
alright if you haven't voted for this answer yet, this may take your breath away and make you want to vote for it now...
@AlexL Awesome!!!!!
I would star the message but I am out of stars
18
A: Can this stored procedure be cleaned up or made even more efficient?

MalachiYou have a lot of if statements in your SQL. This screams at me that you are doing something in your SQL that should be done in the application, and that this SQL should be separated into two distinct stored procedures. The benefits of doing this: Faster stored procedures Use a coding langua...

 
I'm starting to become tempted in down-voting that answer just because of the constant pimping of it...
 
it's a new answer @SimonAndréForsberg
don't downvote. please
 
More looks like the same answer, but edited.
Well, it does look good. So I won't remove my down-vote
 
I have a suspicion 18 upvotes has exhausted the majority of the voting community on CR.... lol
 
@SimonAndréForsberg it is, but I added a real code review to it
@Corbin lol maybe....
I need to go home....I am still at work...
 
11:12 PM
go home then? :)
 
@Corbin I did manage to get a previous answer of mine up to 23 votes thanks to some pimping, although I think I benefited from the popularity of that question.
(I only wanted to pimp it to 23 for the populist-badge, I have no clue how it ended up at 29...)
 
Hrmm, maybe it drew the SO crowd a bit too. Or maybe there's just more voters than I think.
 
It all depends on the question. The for-loop mess was probably hot a while ago
 
I am going. I am going
I was pumped up, I actually got to do some coding today instead of that crap I got stuck with for the last like 7 months
ugh
TTGH
 
Improved answer
 
11:22 PM
@rolfl do you like? is it good?
 
It's improved ... and has my +1
 
@rolfl Awesome. I like the answer a lot better, wish I would have done that in the first place
 
People were pissed off at the asker for being rude.
 
I almost flagged that comment too
anyway, I am surprised my lovely Wife hasn't called me yet.
6:30 here
catch you all later
 
NOw it has been JJamalized, and your and Jamal's edits have brought it to the top, you risk the question being upvoted ;p
 
11:24 PM
@rolfl lol
 
@rolfl I believe you know quite a lot about combinatorics, right? Do you also know a bit about calculating probabilities in Minesweeper?
 
@rolfl Actually, with all the downvotes, it's no longer on the front page.
 
2
Q: Scalability of running commands from user input

syb0rgHere is some code I have that has been extracted and shrunk down from a project of mine. #include <stdio.h> #include <stdint.h> #include <time.h> #include <string.h> #define streq(x, y) (strcmp((x), (y)) == 0) #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) typedef struct { const char *cmd;...

 
Y'all should go upvote that ^ :P
 
@syb0rg I would if it had a bit more explanation about what it does. From the title I understand that it's about running commands from user input, but that seems to be all the explanation there is?
@syb0rg Although I just read a bit of the code and it was quite easy to understand what it does. +1.
 
11:42 PM
@SimonAndréForsberg Added some helpful information anyways.
 
@SimonAndréForsberg Congratulations on 15k.
 
@200_success Thanks. Now I just have 400 rep to the Mug... and only 5K left to 20K.
 
@SimonAndréForsberg- I missed your note from earlier.
and, congrats.
... note about the probabilities for minesweeper
 
@rolfl Seems like you've read it now at least
 
I have.
I have also voted .... on that rascally politician
Voting in Canada is so different to voting in South Africa.....
 
11:53 PM
I am now tied with @William Morris for reputation. codereview.stackexchange.com/…
 
Here, I walk to my kid's school, say hi to Amy, she says, "Oh, Hi Rolf. I don't need to see your ID". Here's your ballot, there's the box. Took maybe.... 3 minutes.
In South Africa, it took ... 14 hours?
 
@rolfl Ironically, that can be compared to different minesweeper algorithms (yes, I've investigated some recently...) but still, 14 hours to vote?
 
Well, yeah. First, you wait for 4 hours for the ballots to arrive.
Then, you discover that the voter's roll for the wrong station arrived.
Then, 1 in 5 is not registered to vote.... and go through the process manually.
Then, because there are so many more people than the system expected, they have to get more ballots.....
which takes a number of hours...
 
Toronto mayoral election isn't until October? Four more months of antics.
 
Well, it's encouraging to hear that people wait that long
 
11:58 PM
It's a party.
Well, that one was, anyway
 

« first day (404 days earlier)      last day (3628 days later) »