« first day (971 days earlier)      last day (3344 days later) » 
00:00 - 16:0016:00 - 00:00

16:00
Yay, Happy New Year Perth, Beijin and Ulaanbaatar
Also, TTLW
So good weekend everyone
And Happy New Year
@MathiasEttinger you too!
16:12
HATS !!!
4
@janos STARS !!!
2
16:26
I got a question about this answer:
524
A: How to check if a String is numeric in Java

CraigTPThis is generally done with a simple user-defined function (i.e. Roll-your-own "isNumeric" function). Something like: public static boolean isNumeric(String str) { try { double d = Double.parseDouble(str); } catch(NumberFormatException nfe) { return false; ...

It suggest 3 different ways of doing what appears to be the same thing... is any of those preferable over the other?
Fire away
The first option is bad if you are donig it a lot and you are expecting lots of failures, because throwing/catching exceptions is slow
Makes sense
For regex... you can fix the expression to catch Arabic digits as well by using unicode, you compile it once (expensive), and checking should be relatively cheap
The latter one is expensive too I think, at least that part of the library is really written badly and I dislike it a lot, I don't have high hopes for it
(At least the API of that library is written badly imo)
I thought the 3rd one looked hack-ish
Then again, almost all programming looks hack-ish to me :)
@skiwi So regex looks to be the best option?
it depends
16:33
Doesn't it always depend :)
For basic usecases exceptions might just be fine
Ah, so the regex one would be faster I guess if you expected to use it a lot?
Yep
/**
 * Determine if a CharSequence can be parsed as an Integer.
 *
 * @param self a CharSequence
 * @return true if the CharSequence can be parsed
 * @see #isInteger(String)
 * @since 1.8.2
 */
public static boolean isInteger(CharSequence self) {
    try {
        Integer.valueOf(self.toString().trim());
        return true;
    } catch (NumberFormatException nfe) {
        return false;
    }
}
Groovy uses this appereantly
Now isInteger and isNumeric is not quite the same thing
How does one usually choose which back-end to use?
16:43
@Mast For what?
I may or may not have a project coming up where I basically need to knit some client-side JS to a server-side database.
@Mast PHP? ;)
@Phrancis Most definitely not PHP.
0
Q: Replacing elements from a list and its sublists - part II

morbidCodeThis is sort of a follow-up to Replacing elements from a list and its sublists but now there are arbitrary numbers of words that would be replaced stored in a list. Now write substitute2 that takes a list, a list of old words, and a list of new words; the last two lists should be the same leng...

But it doesn't have to do much I think. Just allow the JS access to the database. No writing, just reading.
16:47
I think you can do that in pure JS
Although, probably shouldn't lol
407
A: How to connect to SQL Server database from JavaScript in the browser?

fbinderYou shouldn´t use client javascript to access databases for several reasons (bad practice, security issues, etc) but if you really want to do this, here is an example: var connection = new ActiveXObject("ADODB.Connection") ; var connectionstring="Data Source=<server>;Initial Catalog=<catalog>;U...

@Phrancis Yup.
Java probably work fine
So I know I should use something to put them together, but I have no idea how people usually decide what back-end to use for their application.
Java, Grails, PHP, Node.JS, it will all work fine.
One a bit better than the other.
But they'll all get the job done.
JDBC is easy enough
ODBC is pretty easy too, if you prefer Microsoft tech
@Phrancis Tried that once with C++ I think.
16:52
@Mast I usually choose whatever one supports the infrastructure the best.
If they don't want to pay for an OS, I choose JSP or Python.
If they want to use Windows, then ASP.NET (or just C#/VB.NET) is the way to go.
Hey guys, can we go to the Nth and have a star fest?
I want to get the 2016 hat.
No, we can't.
Well, if we are going to have it here...
0
Q: C++ 11 operator overload with return type deduction

DavideI have a template class that depends on one type (for example template <typename T> class Vector). Now, I want to overload the arithmetic operators such that: I can use them with Vectors instantiated with two different types; The result is deduced in the same way of the template instance types;...

0
Q: My Javascript DateTime library, looking for improvements

kaleewayTo keep it succinct, I created a simple way to input dates and times into an input box without worrying about formatting. As an alternative to date time pickers, dropdowns and all the other various datetime libraries. You can find the code repo here: https://github.com/bat26/loosetime.js Thin...

@Hosch250 You must be new here
16:54
Now the Captain gets a hat too.
There is no need for context on the starwall.
@CaptainObvious can't get hats.
@Phrancis No, I thought we were going to stay on topic now.
The horrors of being a feed.
Topic? What's that?
16:55
@Hosch250 We can stay on-topic and still have a starfest.
4
@Hosch250 No hats were created with the intention of being gamed. However, it shouldn't be hard at all to get a message starred in this chat room.
2
@EBrown Probably Ubuntu, runs everything.
2
Starfest 2016™
6
I gave @Duga a star in VBA Rubberducking.
@200_success It's easier to get a message starred in this room than it is to butter bread.
16:56
@200_success I think the primary challenge today will be to get a message in before everyone is out of stars
I'm going to remove it once she gets the hat though, because that room tries to stay a bit more ontopic.
@Phrancis It goes for 2 days.
Well, it covers two days, it goes for 24 hours.
If everyone who gets a star also gives a star, that shouldn't be a problem.Tis the season for giving.
I'm waiting until people run out of starts to start using mine.
I'm saving mine now that everyone has a star.
I don't know how many stars I have left
Then again, I probably won't run out of them until I may go home
I am bored at work. So I guess I am going to review more code and tell them everything is broken.
17:00
Hat delivered.
I don't have mine yet.
@Mast You take all backends you know, multiply how much they are suited for the task by your experience and then still pick the 2nd option
@skiwi I order in ascending order and pick option 1.
Which is usually the worst option. (By definition.)
> multiply how much they are suited for the task by your experience
You know that's a problem when there is no experience, right?
Or do we accept NULL values?
@Mast I have twice the experience of you.
17:02
@Mast Comes down to pick at random then? :P
@Mast Use Python. You know that one well enough.
What I have found out though is that you need to embrace the framework you pick and not try to fight against it
@skiwi Make a list. Shuffle. Pick the 4th.
Django would probably do the job, but then again Grails is quite similar to that
@Mast Make a list; shuffle; remove the third; shuffle; remove the fourth; order by skill needed ascending; remove the fifth; shuffle; pick the first.
That should mix it up well enough.
17:03
@EBrown Are you asking for an index-out-of-error-exception?
@EBrown Just make the first shuffle really, really good.
@Hosch250 In the case the index is out of bounds, pick the last.
@EBrown Now you do.
I'll probably go for the severely overpowered Grails.
@Hosch250 Ah nice!
@Mast Why not RoR?
17:06
@EBrown Because I don't want my server to look like a one-liner.
@Mast Also depends on how much difficult tasks you need to do in the backend, I like Java libraries for that, if it's all dumb, Python might work
@Mast I was joking, I hate .
@skiwi Just read a database and do some formatting. Formatting will probably be done client-side anyway, so literally next to nothing is necessary.
I guess they can both work
17:08
@Phrancis Tl;dr.
If you want it to work and be maintainable for years, pick the most boring, most common, least "cutting-edge" tech
@Phrancis COBOL?
No, Java ;p
(joking, don't stone me)
If you want surprises, pick Grails
17:11
@Phrancis commences stoning
I still have no clue where the /info page comes from
@skiwi Magic?
@Mast or
0
Q: Can this be used to accomplish the Post Redirect Get pattern

GooseI am trying to implement proper a Post Redirect Get on a PHP site (although the question I believe is language agnostic in nature). I thought about it, and realized that running this code on every request seems to give me the behavior I'm seeking. if (! empty($_POST)) { header("Location: htt...

Well, right, it's not that Django is very pretty either: gist.github.com/skiwi2/b7b11c9b48193b3fde09
17:13
@skiwi My eyes!
lol
# TODO implement this method?
Hi
I fixed my submission, can someone remove it from on hold please?
-1
Q: JavaScript DateTime library

kaleewayTo keep it succinct, I created a simple way to input dates and times into an input box without worrying about formatting. As an alternative to date time pickers, dropdowns and all the other various datetime libraries. You can find the code repo here: https://github.com/bat26/loosetime.js Demo...

> 14054 rows returned in 00:00:00
I love SQL sometimes.
That's really fast
@EBrown All empty?
17:19
@Mast Nope, no empties. :)
@Phrancis Yeah it is.
Thanks
2
@kaleeway You're welcome
Do Agile teams invest time in fixing "weird" non-critical bugs?
Yes.. that's a very general question, anyone how personal experience with it?
I need stll one vote for question and answer on meta.codereview.stackexchange.com/questions/6370/… for getting Amaizing Grace hat.
@skiwi Sounds like a question for Programmers
17:26
Thanks santa
Four stages in life:
You believe in Santa;
You don't believe in Santa;
You are Santa;
You look like Santa.
2
Somehow I look like Santa having grey hair ;-)
2
I have brown hair at the moment, but my family tends to gray early.
Brown hair were gone shortly after marriage ;-)
@EBrown I think I skipped the first stage.
17:33
Monking
@EthanBierlein That should get you a hat.
Yay! Hats!
17:53
@skiwi Scrum answer: Yes, if the Product Owner puts it on the backlog
I imagine the Agile answer is a lot like that.
Welcome @BDD
BDD
BDD
Thanks @Mast
@BDD Have a Hat :-)
BDD
BDD
Don't mind if I do :)
Should this question considered be considered OT for being primarily opinion based? codereview.stackexchange.com/q/115519/31292
how do you actually paste questions in chat so they show up nicely?
Just paste the URL.
17:59
1
Q: C++ 11 operator overload with return type deduction

DavideI have a template class that depends on one type (for example template <typename T> class Vector). Now, I want to overload the arithmetic operators such that: I can use them with Vectors instantiated with two different types; The result is deduced in the same way of the template instance types;...

ah, I'm too used to going through share
@Barry The share URL works too.
@Hosch250 Didn't the first time
I voted to leave it open because with three options, at least one is bound to be more expensive, harder to read, or whatever that someone who knows C++ could comment on.
@Barry It has to be in a message of its own.
Ahhhh, that's what I missed
All three options are exactly equivalent functionally
I could write two methods that are equivalent functionally with one just awful and the other correct.
For example, I could use a list of a custom class, or I could use three (hopefully) synced lists of primitives.
18:02
@Barry Yes.
He's asking for the 'best' way without stating what 'best' is for him.
Speed, readable, etc.
@Hosch250 Sorry, when I mean functionally equivalent I really mean identical - like will produce exactly the same machine code on a conforming compiler
Oh, OK.
Then I'll VTC too.
I am looking at codereview.stackexchange.com/questions/115470/… , and while I am not really familiar with that syntax it looks like an aweful lot of code to just output a list like [1, null, 48, 49, 50, 51, 52, null, 100].
@Sumurai8 Not a valid close reason.
That was not my intention. Just curious if someone here that is familiar with the ES/JS class syntax finds it overkill too.
18:11
@Sumurai8 You could say that for a lot of the Euler problems too. It's a lot of code to just output some number
@Sumurai8 @DanPantry You awake?
@DanPantry Post something, and get a hat in the process.
@Barry Except that for the Euler problems you have to tackle the problem in an intelligent way, and this problem is I think just two comparisons and four or so additions/subtractions, and some pushing numbers into a list.
18:26
0
Q: What is the preferred approach for generating dual .xlsx files and .htm pages of the same data?

B. Clay ShannonHere is my requirement: generate Excel reports for users, attaching them to emails; additionally, insert hyperlinks into those emails where the user can view the same report on a web page. I have a Windows forms util that I use to generate the Excel spreadsheets and email them. I have a Web API...

adds Project Euler to his mental todo list
Maybe I'll even post the code as a question
18:39
@Sumurai8 Christ alive
3
@Sumurai8 In Euler you can do them intelligent, you can also just do them.
Intelligent isn't a prerequisite.
@Mast Well. If I look at some of these challenges, I think it will take a year to compute the results if you do it in the most naive way possible.
I said, "Once you get your code working...". Think of it as a two-step process. You first need to know what you've done wrong and how to fix it. That's what SO is for. Once you understand the problem and have working code it still may not use the power of Ruby effectively. To see how you could improve your (working) code, post it on Code Review. Members of CR are eager to help, especially to help those new to Ruby. — Cary Swoveland 17 secs ago
@Duga The R in CR actually stands for Ruby.
@Sumurai8 There's a whole lot of grey area between 'most naive way' and 'intelligent way'
18:44
I guess
Anyway, I am off for the day. Enjoy your 2015 while you can, and have a monkingful day, night or lifecycle.
@Sumurai8 and the C can stand for a number of things, depending on whether you like or dislike Ruby :)
0
Q: Approach to a "modular" sidebar

LansanaI wanted to make a sidebar for my app. The sidebar should reside inside of a state that has child states, and it should act as the navigation for those child states. The problem is that I would have to have long and repetitive HTML for each time I needed the sidebar, so I came up with a solution...

You should ask this on codereview.stackexchange.com | but no, it's not secure. It's not even a login script (you never check the password) — JimL 23 secs ago
@CaptainObvious Bootstrap navbar?
Angular, yuck.
CodeReview is the site you might be looking for. — Script47 44 secs ago
18:56
user image
2
lmao
Another C approach to formatted printing without any coded type dependent specifiers Formatted print without the need to specify type matching specifiers using _Genericchux 45 secs ago
19:24
0
Q: Bob the (Graph) Builder

TopinFrassiI'm starting a project in which I'll generate random graphs and use algorithms to solve them. The first necessary step is obviously to build a graph. My graph has the following characteristics : It can be directional or not, implying that the Edge between NodeA and NodeB can be traversed fro...

0
Q: SICP - exercise 2.5 - representing pairs of nonnegative integers

morbidCode Exercise 2.5: Show that we can represent pairs of nonnegative integers using only numbers and arithmetic operations if we represent the pair a and b as the integer that is the product 2^x*3^y. Give the corresponding definitions of the procedures cons, car, and cdr. Please review my code. (de...

0
Q: Implementation of the ls command with several options - follow-up 2

JamalI've made more improvements from previous iterations and my own, including: Added the -n flag (print owner and group IDs instead of names) Eliminated some bools by allowing certain flags to turn on others Added a Date struct for keeping the current date in one place Added an Entry struct to eas...

19:39
The Euler problem conversation led me to try to do one I hadn't done yet
0
Q: Project Euler 21: Sum of Amicable Numbers

BarryProblem 21: Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable pair and each of a and b are called amicable numbers. For example, the proper divisors of 220 are 1, ...

1
Q: Project Euler 21: Sum of Amicable Numbers

BarryProblem 21: Let \$d(n)\$ be defined as the sum of proper divisors of \$n\$ (numbers less than \$n\$ which divide evenly into \$n\$). If \$d(a) = b\$ and \$d(b) = a\$, where \$a ≠ b\$, then \$a\$ and \$b\$ are an amicable pair and each of \$a\$ and \$b\$ are called amicable numbers. For...

20:00
I only just realized the badges switch to the format used by the current site.
I want hat
2
@WinterBashTime lol
So much for hats not being intended to be gamed.
Users will game them anyway ^^
Ah, it's @happytime in disguise
Might be better on a code review site. At first glance, I'd say there's far too much repetition and poor decomposition. — duffymo 51 secs ago
edited to make it more ideal for the site and also asked a separate question on code review — JoeBeastlyGerbil 59 secs ago
@Mast you mean in dishat
20:17
0
Q: 'Mastermind' game,

JoeBeastlyGerbilI am sure many of you know the game 'Mastermind', the board game version, not the TV show. I have written a program for the game, but it seems very messy, coding and output. How can I tidy it up a bit? Here is my game: import random colours=["Red", "Blue", "Green", "Yellow", "Black", "White"] p...

0
Q: Skew logistic distribution

TheLionKingI am trying to program a skew logistic distribution function to return the PDF, the CDF, and (later) the inverse CDF. Although there are several forms of skew logistic, this is for perhaps the most widely known, a variation of the skew normal distribution introduced by Azzalini and covered by Sa...

20:32
Hey.
hey @Morwenn
What's up around here?
Hats.
Well yeah, I guess that a starfest happened. Did I miss it?
2
The starfest is still to come ^^
20:40
OMG, someone wrote a debug mode built into a SQL stored procedure... genius!
-1
Q: Geocode locations on map centered by city hall address pulled from oracle server

user93627Ok, here it goes, I am by no means a web programmer, so try not to laugh, but with google and the internet and some java, i have been able to build a site that has worked for the last few years just fine on a 2003 IIS server, this site pulls city hall account data from an oracle server and based ...

0
Q: Algorithm for simple string compression

Jonathan SmitI attempted a problem from the "Cracking the Coding Interview" book. The following input: aabcccaaa should give the following output: a2b1c3a3 Here is my code. Any advice is much appreciated! Thank you so much!! #include <stdio.h> #include <stdlib.h> #include <string.h> char* compress(char*); ...

http://www.commitstrip.com/en/2015/12/31/happy-new-year-2016/
CommitStrip
Happy New Year 2016!
CommitStrip
1451594620
Interesting timing. I can check whether or not my ls program will break tomorrow (but I know I didn't hardcode "2015" anywhere). :-)
21:01
Naruto answer; accepted non-selfie answer with 0 score: Basic prime summation
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Convert XML files to JSON and move them
0
Q: Algorithm for simple string compression

Jonathan SmitI attempted a problem from the "Cracking the Coding Interview" book. The following input: aabcccaaa should give the following output: a2b1c3a3 Here is my code. Any advice is much appreciated! Thank you so much!! #include <stdio.h> #include <stdlib.h> #include <string.h> char* compress(char*); ...

0
Q: Calculation - keeping a running total

user93630I am a bit confused over this. I have a function. Inside that function it asks a number of questions, one is the following based on the number of gardens they have - so if they say they have 2 gardens it will ask this question twice and should add the 100 twice to the calculation: gardens = int...

And in a few hours I'll have to write 2016 in the license everytime I change one of my files.
I'm having trouble staying awake now already...
std::vector<typename std::list<Iterator>::iterator>
Now that's reasonable.
It's expecting a vector of iterator of a list of iterators?
List<Iterator<List<Iterator>>> in Java?
21:15
possible answer invalidation by Jonathan Smit on question by Jonathan Smit: codereview.stackexchange.com/posts/115538/revisions
It's a vector of list iterators. But the list is itself a list of iterators.
21:30
possible answer invalidation by Jonathan Smit on question by Jonathan Smit: codereview.stackexchange.com/posts/115538/revisions
0
Q: Properly updating multiple MongoDB documents with Angular

Jon RobyIn the app I'm creating, when a user upvotes a post, the post should be upvoted, as well as the user that wrote the post. But this updates two MongoDB documents. This presents a number of issues. I'll first provide an overview of the code and then list the issues. A user clicks on an upvote butt...

0
Q: Boids Simulation

user93631I am working on a boids simulation and just about everything is working except one thing, the boids all go and stay in the lower right corner. I have tried everything but cannot fix this, please help! Code here: #!/usr/bin/env python import sys import pygame import random import math # Initial...

21:47
:o
So much for making a link joke. :-/
@TopinFrassi and @Zak are the only ones who haven't received their gift yet. Let's hope theirs will arrive shortly.
So far it has been a success.
22:03
0
Q: Simple Snake Game

MORTALi was working on this game for while and I have made it for education purpose by using SFML. The game works fine but I would like to know how can I improve it. #include <SFML/Graphics.hpp> #include <vector> #include <utility> #include <array> #include <random> #include <iostream> #include <algo...

I need to propose a new SE site - Resume Review.
@Hosch250 Resume Review, Database Review, UX Review, there's a lot of reviewing that could use a site.
And then we'll have to go meta and create a Review Review.
2
Naturally.
As a meta meta site for all those review sites.
@Mast Spam Review!
22:14
@Jamal AKA Flag Queue
22:40
> Did I miss a (removed) fest?
I don't know what happened.
0
Q: The x'mas tree implementation

Bruno CostaWith the festive season mood and the new year comming I thought I would make my first question this year (well, not quite yet, at least in gmt +1...), and it turns out to be a tree implementation. Blame me because it doesn't have anything about christmas :p. public interface ITreeITem { obje...

I think I just understood how a Java enum works...
23:02
Happy New Year Europe!
4
Happy new year all!
5
Happy new year!
4
Happy New Year to all!
4
0
Q: Off-topic because... There are strange radio buttons

Joe WallisI was going through the review queue and came across a question that I thought may be off-topic. I was deciding which topic it would be off-topic for, if any. And noticed that the radio buttons are too high. This was strange as the "why should this question be closed?" was fine. (Horrible red und...

note that codereview.stackexchange.com is a thing — DTSCode 53 secs ago
23:12
@StackExchange Looks like a nice try for Amazing Grace.
It will be tough to get that hat next year, if they offer it again.
public class Sonar {
    public enum Medium {
        // Values are approximate.
        AIR_SEA_LEVEL_15C (340.0),
        AIR_JET_ALTITUDE_N57C (295.0),
        FRESH_WATER_25C (1497.0),
        SEA_WATER (1500.0);

        private final double meterPerSec;

        Medium(double meterPerSec) {
            this.meterPerSec = meterPerSec;
        }
    }
I had no idea there was such a huge difference in the speed of sound in water and air
Also travels faster in hot water than cold water
Temperature does a thing or two to density.
Density matters.
Ah right, density
Sound "travel" has a pretty complicated set of equations and graphs apparently
Question: Once you instantiate an object with a certain value for the enum, you probably can't change that on the same object afterwards right?
23:28
Within one medium with one temperature it's quite linear.
@Phrancis If they're private: only with setters. Otherwise: why not?
@Phrancis You don't want to
If the values are private or the enum is private?
Wait I think I got it, in my case I couldn't because private final double meterPerSec; right?
23:53
7 minutes...
New Year already?
3
Hmm I just read that as "Meter/Parsec" and thought "*What?!"
lol
Where is everyone?
Celebrating?
2
Oh, right.
I'm just waiting for my wife to get off work. Figured I'd pop by for a min.
23:59
@RubberDuck Programming?
Your wife works until after 7pm on Near Year's Eve!?
She works at a Veterinary hospital. =)
00:00 - 16:0016:00 - 00:00

« first day (971 days earlier)      last day (3344 days later) »