« first day (672 days earlier)      last day (3644 days later) » 
00:00 - 18:0018:00 - 00:00

18:00
When starting with a high-level language like Java you really shouldn't need to worry about whatever your IDE does as long as you know what the code you write yourself does
And people use JUnit via the IDE because there's no advantage to not using it with the IDE
Well, don't you think those people should be able to though?
"those people"?
the people who use JUnit with and IDE because doing so is superior, wouldn't you say they should at least have the know how to run it without?
No, because there is absolutely no gain in knowing how to run it without
Have you ever fixed a problem by running the compiler and executing the code via command-line as opposed to via the IDE? I haven't. Have you ever saved time by doing it? I haven't
I haven't used any IDE much at all, for reasons stated above. I did find that it was faster than running the program through Eclipse or IntelliJ. The gain is seconds though. I don't know if there's any advantage to one over the other, but I like the idea of being able to do both.
18:08
@Legato - the value of the IDE is significant, but most benefits come in to play when you have multiple classes, and you can take advantage of things like;
1. refactoring
2. autocompletion
3. dependency management
4. .... integration with other tools like version control, etc
for small projects, one-or-two files, the IDE is not that useful, but even then, typing main-Ctrl-space has benefits.
My favorite reason to use an IDE is because I can type "Class.", and it pulls the options up.
What does main-ctrl-space do :p ?
Refactoring is nice too, but I still check with a search or manually reviewing the files.
I would assume autocomplete
Well, intellisense
Also, don't get me wrong I'm in no way arguing that an IDE is useful. This just happens to be the way I taught myself. I figure do it without, learn to do well, so when I do start using IDE it'll be like a rocket-ship.
18:13
I can write without an IDE just fine. However, an IDE makes it faster.
main-ctrl-space:
public static void main(String[] args) {

}
Ah, with sublime text I just type ma and press enter
Though that's the only thing that has a shortcut haha.
Also, I don't know how to compile my code without an IDE (except for Java, which I can do through the command line, which is a pain and takes at least 10 times as long as using an IDE, of not 100 times as long).
@Hosch250 - in a project with multiple projects, the one I like is f3 ....
Which IDE?
18:15
@JoachimPileborg pity to close this, it's a lovely question imo. Too broad, heck yeah, so what. There are far too many narrow and narrowminded questions on SO. Only issue one could have: it may be better suited over in codereview. — Peter Schneider 1 min ago
put the cursor on a word, hit f3, and you go to it's declaratin, or to the class if it's a class you have selected
Also, those tools you mention: autocompletion, and refactoring. I can see myself using them now, but I definitely think if I'd know/understand less if I used one from the beginning.
But I could be totally wrong and biased.
@Legato - don't get me wrong, it's important to know your way around it on a file level, but the value, in larger projects, of an IDE is significant
I didn't use refactoring until I started widely renaming methods and classes used across many files.
It is just faster that way.
Oh, I see.
Code review is off-topic for Stack Overflow, you should try codereview.stackexchange.com. — Preston Guillot 1 min ago
18:17
@rolfl I know everything in my project, so I haven't had to use that.
@Legato - this is the value of refactor: github.com/hunterhacker/jdom/commit/…
Rename/relocate a class with a single key combination: Ctrl-shift-r for rename.
(including fixes in the JavaDoc)
Even working with an IDE that doesn't do much stuff for me (autocomplete, etc.) is annoying as hell
I use Ctrl+H to rename things haha, but yeah that's definitely better.
Several files at once.
Also, Follower++
@Legato that must be nice with the same names in different contexts
Ctrl + H is just a basic text editor tool, it would only affect the file in question.
18:23
doesn't change it
you can have multiple contexts in one file
But why would I?
Maybe I'm confused by what you even mean.
hold on, after this game
@JeroenVannevel What are you playing? ;)
Haven't played that since season 1. Besides trying out Dominion when it first came out.
18:29
0
Q: Filename interpreter for tv shows in php

Ortix92I have small class which interprets tv show filenames to extract the show title and episode number. Due to the nature of the filenames, I have chosen for a cleaning approach: I clean the filename first as much as possible and then extract the necessary data (instead of matching the data right awa...

0
Q: C++ File I/O and Parsing Line Input

cahuizarThe project that I am currently working on has me opening a file and reading the information in it and storing it all on the heap. The information from the file will be: first name, last name, born date. Here is my code: data2.dat Florence,Forrest,10/12/1992 main.cpp #include <iostream> #i...

Also, I'm not really saying writing from the command line is better. That was never my argument. I've been self-teaching this other way. I plan to start using an IDE when my projects get larger. Right now, this is my second biggest "project": codereview.stackexchange.com/questions/62677/… I'm catching up to you guys, I see an IDE as a car when you want to get somewhere, but also the training wheels I want to avoid when learning to ride a bike.
private int a;

public static void main(String[] args) {
	int a = 5;
}

public void a(){
	boolean a = true;

	if(a) {
		this.a = 99;
	}
}
I see.
But why?
Here we admonish that behavior.
If you now use find-replace to rename an a in any context, you will guaranteed also change ones that you don't want to change
@JeroenVannevel Ah, I don't play it anymore
18:32
I see your meaning, it just isn't a problem I've had. There are plenty of posts on giving things more meaningful names than just "a". Cool to know that an IDE would overcome that limitation though.
@skiwi But you play Hearthstone, eh?
@Legato Yep
We should play sometime!
Game is crazy/silly/random, occasionally infuriating, but certainly fun.
What do you play?
Usually Mage in ranked... but I'm playing arena way more
I've actually been trying to pick between playing mage, priest, warrior, or rogue lately.
My favorite is paladin, but I reached golden a little while ago.
That's quite some games then
So since the new adventure was announced a few days ago, I decided it's time to finish my Naxxramas adventure... I purchased it months ago, but have barely played it
(I only unlocked the first wing so far LOL)
18:40
Yeah, I tried to save up gold to buy all the wings.
I don't think buying them with gold was worth it though.
Now you know why I'm so interested/excited about your project. I'm working bit by bit to get to the point where I can make something similar.
I figured with doing this adventure I could test HearthMonitor and see if it doesn't break down now :D
Haha, I still love that name.
Hope you get what you're looking for.
0
Q: Should I copy paste engine's code in Spree (Rails) if I'm going to modify a lot?

JaydenI'm starting a new app with Spree and I'm going to heavily modify it. It seems impractical to go to source every time I need to change something. Should I just copy paste contents of spree/front_end engine to my app or something else?

@skiwi What's your battletag?
@Legato Let me look it up
skiwi#2872
18:58
Friend Request Sent.
I don't see it yet, will accept once it shows up
@skiwi Sent again.
If it's easier, I'm Legato#1322
@Legato Sent, maybe that works better then
Weird, I don't get anything either. Hm...which region are you in?
EU
19:08
Ah, maybe that's it, I'm in the US.
Lame.
19:36
allo
Hiya.
0
Q: Basic C++ tone generator

WCharginI'm trying to learn C++ (with experience in C and Java, inter alia). I wrote a program to output a waveform of multiple (superimposed) tones, each varying in pitch. To execute: Compilation: g++ -W -Wall -pedantic -std=c++11 main.cpp Tone.cpp Running: ./a.out Playing: aplay out -r 44100 -f S16_...

0
Q: Finding the first non repeated character

LegatoChallenge: Write a program which finds the first non-repeated character in a string. Specifications: The first argument is a path to a file. The file contains strings, one per line. Print out the first non-repeated character of each string. Solution: import java.io.File; import j...

19:59
Congrats on 10k, @mjolka!
5
0
Q: Simple Java MIDI player followup

Calculus5000This is my second iteration of a simple Java MIDI player. I've made several amendments and would like to see if the code is now correctly implemented and readable. This follows on from the first review. With regards to the GUI class, is it a good idea to have musicInfo = midi.musicInfo in the GU...

0
Q: Correcting a quiz, coffee

Kevin FermI wrote this code that's supposed to correct quizzes on a webpage, but it feels bloated and I'm sure there's tons of ways to improve it. Any thoughts? $ -> #When submit_quiz div is clicked, do the following $(document).on "click", "#submit_quiz", (e) -> #Gets the quiz id for later use ...

20:17
solving a problem i would not have been able to solve about 6 months ago
all because i learned wtf encapsulation was in javascript
=.="
20:30
gah, I hate binary math
bitwise math,, w/e it is
Tell you what though, I'm glad i'm doing this in coffeescript, I can't imagine how wordy it would get with JS
binary = require 'binary'

header = (chunk) ->
  binary.parse chunk
    .tap varint32('opcode')

# parse a variadic length integer from the header
# the integer can be a maximum of 32 bits
varint32 = (name) ->
  return ->
    # read bytes until we find a byte that does not have msb set
    this.into 'varint-cache', ->
      byteNumber = 0
      this.loop (end, vars) ->
        currentByteName = 'byte-'+byteNumber
        byteNumber += 1
        this.word8 currentByteName
          .tap (vars) ->
1
Q: Unit Tests for a Fraction Class

Raphael_As my first Java homework, I wrote a class to handle fractions. This Fraction class implements basic operations for the fractions (addition, subtraction, multiplication and division) and follows this interface: interface Fraction { public int getNumerator(); public int getDenominator(); ...

@CaptainObvious soon:
20:49
I don't like being lied to:
Fraction is an interface, not a class, yet you have new Fraction(....) calls throughout your tests. Additionally, the Fraction interface has methods getNumerator and getDenominator, but your tests call getNumerador and getDenominador. Your question is poorly put together and is misleading. — rolfl ♦ 1 min ago
> Even though it works, I wasn't very pleased with the final result.
0
Q: Calculating solutions for the game "24"

MixxiphoidI was bored this evening and decided to create a program which calculates all the solutions for a given scenario of the game "24". The goal of this game is that you try to be the first one to find the answer to a certain card. On the card are four numbers ranging from 1 to 9. The player is allow...

This one, though, is a goodie:
First of all, thank you very much that really helped. Also sorry for the typo I will just change it right now, I meant to say "it is NOT doing the job perfectly". — newmudhar yesterday
21:15
Legendary.
thanks @Jamal :)
Congrats @mjolka :)
thanks @Legato :)
Anyone interested in a really neat talk about numbers and mathematics: TED Radio Hour: Solve For X
(also, monkernoon!)
21:49
There are a lot of things that are fun
binary = require 'binary'
_ = require 'lodash'

unwrap = (buffer) ->
  binary.parse buffer
    .tap header
    .vars

# Parse a header.
header = (buffer) ->
  this.into 'header', (vars) ->
    this.tap varint32('length', buffer)
      .tap varint32('opcode', buffer)
      .tap (vars) ->
        # flatten the resulting structure by turning
        # { length: { value: A, size: B }, opcode: { value: C, size: D }}
        # into { length: A, value: C, size: B+D }
        # there is definitely a better way to do this using _.
this was not one of them
22:01
0
Q: Guess the number game - improving the game ending on running out of available guesses

BlücherConsider this function for a handler of user input in the "guess the number" game. def input_guess(guess): global guess_counter global secret_number guess = int(guess) if guess_counter > 0: print "Guess was:", guess if guess > secret_number: print "L...

22:11
I see JavaDeveloper has been pointed to the chatroom.
Does he even know about the JDQ meme?
22:21
I don't think I know what you're talking about.
JDQ stands for Java Developer Question.
It is based on the fact that JavaDeveloper is the only one to have the Socratic badge.
I don't even know what it means myself.
12
A: What's a Zombie? And what are the many other memes of Code Review?

Simon André ForsbergMeme: JDQ Originator: rolfl Cultural Height: The 2nd Monitor Background: JavaDeveloper is the user who has posted the most questions on Code Review. A JDQ is of course, a JavaDeveloper Question. JavaDeveloper is the first one, and currently the only one, who have received the newly invented So...

Here I was thinking I post a lot of questions.
I really like this too!
I'm actually stuck, on the one hand I want to study it, on the other I want to try solving it myself, hehe.
Favorited.
Maybe I should try some more Project Euler stuff.
I'm surprised codereview.stackexchange.com/questions/83477/once-more-with-fx got so little attention. Cumulative result of a lot of learning mostly beget from using CR.
Still only three votes, one way or the other:
3
A: Should comparisons of code snippets be closed as "not seeking a code review"?

nhgrifWhile I don't think we should completely remove comparative-review, I do think it might be a good idea to considerably narrow the scope on what's allowed under this tag. Comparative reviews should be written in the same language. While it's not impossible to be sitting on the fence about whic...

@Legato This was only posted 10 hours ago and it's a bit of code.
Socratic method , also known as method of elenchus, elenctic method, or Socratic debate, is named after the classical Greek philosopher Socrates. It is a form of inquiry and discussion between individuals, based on asking and answering questions to stimulate critical thinking and to illuminate ideas. It is a dialectical method, often involving a discussion in which the defense of one point of view is questioned; one participant may lead another to contradict themself in some way, thus strengthening the inquirer's own point. The Socratic method is a method of hypothesis elimination, in that better...
@nhgrif Yeah, I'm studying philosophy now.
Upvoted.
22:31
I mean, I don't know what the JDQ meme really means.
He was regularly posting a ton of questions.
It just means it's one of his questions...I don't see what's confusing.
It's funny because I wanted to do just that
I actually was about to ask you @nhgrif if you really think it would be appropriate to post two different questions for some 'comparative' situations.
Depends, but sometimes yes, I think that'd be the best course of action.
[addicted-to-cr] fits so much for me.
I remember falling in love with Programming as a vocation. I felt a juvenile version of the same when I found CR.
I want to celebrate the fact this site is a thing.
So, out of curiosity, what are you guys up to?
Just got back for a walk, throwing a spike out of networking code while trying to work out how 'I'm going to do it
22:42
Insert coffee into Dan.
Reminds me of this:
I want that shirt
Me too.
Unfortunately, this is the closest I find on Amazon.
http://www.amazon.com/Coffee-T-shirt-Programmer-Shirt-Medium/dp/B00KJO1U7E/ref=sr_1_7?ie=UTF8&qid=1425768234&sr=8-7&keywords=programmer+shirt
private void sad();
22:47
I somewhat like the code is poetry one, I get that feeling a lot. The rest, meh.
http://www.redbubble.com/people/buso/works/11472026-compiling?grid_pos=99&p=t-shirt&ref=shop_grid

idk i like this one
(even as a JS developer)
I like that as a comic, wouldn't wear as a shirt.
a lot of these things I would not wear as a shirt
but I'm single and I don't see that changing, so fuck it, might as well wear lame puns on a shirt
http://www.redbubble.com/people/theshirtyurt/works/12602574-hip-hip-hooray-programming-array?grid_pos=334&p=t-shirt&ref=shop_grid

wow.
that one took me a few seconds.
lol.
0
Q: Ruby webserver improvements

JoelLI am building a web app in ruby but without rails. So far i just have a very basic web server. What improvements can i make to it? require 'socket' require 'uri' # Files will be served from this directory WEB_ROOT = './public' # Map extensions to their content type CONTENT_TYPE_MAPPING = { '...

22:53
I'd wear that as an arm band.
@Legato Method names should be verbs or verb-phrases. They should describe an action... generally speaking...
this.setMood(sad); <--- better
Legato.setMood(Feeling.SAD) Happy :p ?
yup
4
A: Should comparisons of code snippets be closed as "not seeking a code review"?

nhgrifWhile I don't think we should completely remove comparative-review, I do think it might be a good idea to considerably narrow the scope on what's allowed under this tag. Comparative reviews should be written in the same language. While it's not impossible to be sitting on the fence about whic...

I significantly expanded my answer.
Also, thanks for that. I'll actually bear it in mind.
unless you're in javascript where method names are commonly anything
:^)
23:00
It's not strictly applicable to every language.
it will be soon, es6 allows us to have properties
For example, in Objective-C, setters are:
setProperty:
while getters are just:
property
in JS right now we can have
property = ... and property as setter/getter
but it's not a nice thing to set up :(
But... as of iOS 8, everything that was setter-getter like that got converted to a true property with dot notation.
The other exception is factory methods.
For example...
[NSString stringWithFormat:@"Hello, %@", userName];
that looks... interesting
23:02
But that's the only exception really.
It's Objective-C.
That's what Objective-C looks like.
I know WHAT language it i
is
In C#, we just do var x { get; set; }
It's just an interesting way of laying things out.
no, we don't, because you can't implicitly type a variable @Hosch250 ;-)
We might need to specify the type, instead of var when we do it this way.
@nhgrif Am I to assume that stringWithFormat is being sent @"Hello, %s" and userName?
23:04
I just specify the type to prevent errors and to help me learn how the things are made up.
uhm, yes...
It works just like printf() in any C-based language.
@nhgrif hm, it's a bit like ruby/coffeescript then, but with : and []
Java: System.out.printf("Hello, %s", userName);
I odn't understand the decision behind the square brackets, though.
as in, why are they used
(I dont know Obj-C so I'm asking from a completely noob standpoint here)
I will show you... hang on...
- (void)takeArg1:(NSString *)s1 arg2:(NSString *)s2 arg3:(NSString *)s3 {
    NSLog(@"\nArg1: %@\nArg2: %@\nArg3: %@\n\n", s1, s2, s3);
}
Method definition
calling method:
[self takeArg1:@"ABC" arg2:@"123" arg3:@"XYZ"];
23:08
that seems awfully convoluted
I think Swift attempts to make it less so.
But I'm not too familiar with either.
Sort of. Swift still has named arguments though.
Obj-C syntax is just mashing on buttons and enclosing it in brackets
Technically, the "arg2" and "arg3" parts are optional. You could just write:
- (void)takeArgs:(NSString *)s1 :(NSString *)s2 :(NSString *)s3 { //...
And call it like:
[self takeArgs:stringVar1 :stringVar2 :stringVar3];
But you'd never pass any code review I wrote. That's terrible.
23:12
But the named arguments actually makes the code significantly more readable.
There is no method overloading in Objective-C.
In Swift, the same method declaration would look like this:
func takeArgs(arg1 s1: String, arg2 s2: String, arg3 s3: String) { //...
and would be called as such:
self.takeArgs(arg1:someVar1, arg2:someVar2, arg3:someVar3)
I'm wondering why my post is getting votes, but no responses. Is BrainF*** really that esoteric?
VS tip - Select a section of code and dragging it to another spot while holding the CTRL key down duplicates it.
> Is BrainF*** really that esoteric?
absolutely.
3
Great for duplicating text that can't be DRY.
My tip to Microsoft for Visual Studio (and maybe some of the newer versions have this): symbolic breakpoints.
23:18
I don't know, what are those anyway?
I'm running the latest "solid" release.
Where it says "Symbol", I can type a method name.
Well, a class and method name.
And the debugger will break on any instance of that method being called.
On any object of that class or any of its subclasses.
Check this:
CTRL-B for me.
That doesn't work the same.
They aren't the same
I've tried that.
23:20
Your version only works at a certain line and character in one function
OK, I just stick a break point on the first brace.
@nhgrifs works on the invocation of any function and in any subclasses
Any time the method gets call, the break point is hit, so...
Right.
Read what Dan just wrote.
That only works if you have no children
if your class has descendants and you don't call super() when you override the method, the benefit is lost
23:21
Consider that the base class for any form is the Form class, right?
Oh, so abstracted classes won't work like that?
Also @nhgrif can set conditions.
And the form has a Load event or whatever
I don't know, I don't use WinForms.
Whilst there are conditional breakpoints in VS it isn't quite as powerful :P
23:22
In .NET, you can't set a break point on the form's Load event.
OK, I'm all for new features, as long as they work.
Because you don't have the base class's code actually.
^
That's another thing I didn't think of
To do a breakpoint in VS you need the source code
Yeah, I see. Cool.
They just released a beta version, why don't you install it and leave feedback?
They might implement it.
And while I don't have UIViewController's source code, I can set a breakpoint on -[UIViewController viewDidLoad], and any time any of my UIViewController subclasses call viewDidLoad, whether they implement it and don't call super, implement it and do call super, or don't implement it at all, I get a break.
23:23
Cool.
Something tells me that @nhgrif is on a mac and can't run vs
(or maybe not?)
I'm on a Mac at home.
He develops for .NET at work.
I don't really have time at work to play around with beta versions.
23:24
isn't WINE a thing on Mac?
But, you can dual-boot Windows with Bootcamp or something.
I'm not doing that.
It's a lot of work to go through just to test out a piece of software I'll admit
Do Macs have virtualization?
Anyway, I wanted to debug something at work.... but it involved finding everywhere that set the cursor or something....
So we were stuck with Ctrl+F.
Xcode? Symbolic breakpoint.
I can also add "OpenGL ES Error" breakpoints, and "Test Failure" breakpoints, whatever those are
plus of course, a generic any exception breakpoint, but VS does this too
23:27
i wonder if it's actually even possible to do that in C++... it would require quite a bit of information that's just not available in C++ at runtime
But beyond just conditional breakpoints, I can also action breakpoints...
i suppose enough meta information could always be added to debug builds... it's an interesting thought
So maybe I don't want the code to stop executing, but instead I just want to print to console every time a particular breakpoint is triggered? I set up a breakpoint, add an action to it, and checkmark "automatically continue after evaluating actions"
I have a question about posting a question. Is it ok to post a link to my GitHub repo and just ask for a general review of my entire game code?
No.
23:28
ok thanks
You can link to your github, but this is done for context.
Any code you want reviewed must be embedded in the post.
Links rot, githubs change, etc.
good point
Do you know where I could post a link to get a review of my entire code?
Thanks for the review
Just post all the parts of your game.
If you post all the parts of your game, the reviews probably won't be that great.
23:30
So just make a bunch of posts at the same time? Isn't that a bit like spamming?
Depends on how big said game is.
Large chunks of code posted in questions tend to get big picture, broadstrokes, unfocused reviews.
I think that's a relative restriction.
Post sections at a time first to get focused reviews.
You can make several posts concerning the optimization of specific things.
They're just easier to review.
23:31
Then, post a lot of code at once to get reviews on how you put it all together.
@Twiggy Post the section you have the most concerns about and get some feedback. Implement the feedback and perhaps also apply it to sections you didn't post.
That is what I've found works.
Then post another section of code.
But I think it can be helpful to post it all, if it's interesting people will be likely to review, but again that's still dependent on the size of your project. My presumption is that it isn't that large since you're asking this question.
IDK big edits like that tend to get rolled back
23:32
Who said anything about editing?
New question.
It's sizeable.
> Post sections at a time first to get focused reviews.
> Then, post a lot of code at once to get reviews on how you put it all together.
@Twiggy How many files?
23:33
Also, this gets you more rep (if you are into rep).
Actually, just post your github here.
By the way, in case you guys weren't completely sold on Xcode's debugging power...
23:34
<-- ignorant of Xcode.
I see, yeah, I wouldn't post it all in that case.
ooh pretty
I get live feedback on CPU usage, memory usage, Disk IO, Network IO straight through Xcode... that doesn't even mention all the power of the Instruments app
Try to pick specific parts then. Start with things you feel could be improved.
Then what is 'smelly'
23:35
Cool.
You can post 2-4 files if they're closely related.
I don't use 1/10 of the power of VS.
I basically type my code out and compile it.
ok i'll pick out a few parts and post them. Thanks for the help guys and gals!
It's been my pleasure.
@Corbin You can write C++ in Xcode. I don't know it well enough to truly test a symbolic breakpoint in C++. I know that symbolic breakpoints in Swift don't work out as well as they do in Objective-C (but they still work).
23:37
@nhgrif I'd be pretty surprised if they work in C++. It's certainly possible, but the overhead of packing all of that information into a debug build and then acting on it would be quite high. I'd imagine it's quite a bit easier in ObjC when reflection/introspection capabilities are already there.
Actually... I pretty sure you can do symbolic C++ breakpoints, because I'm pretty sure I set some symbolic C breakpoints while I was developing my SQL code... and if it works for C, I imagine it should for C++ as well.
And it works for regular functions in ObjC, not just methods.
0
Q: How to sort movie with title and year ? (algorithm)

DuffydakeI want to sort "movie search results" to get most probable movie that match "search". Input example : CARS.2.2011.720P.AC3.mkv I have a "NameMatcher" class which extract "title" and "year" from file name. Search string : cars 2 Search year : 2011 Results come from many websites like tmdb, ...

One thing I hate about VS is that it locks up when I add folders to my solution through the Solution Explorer.
interesting. i guess that makes sense since the function names are already in debug builds anyway. i wonder if it works with polymorhism.
@CaptainObvious his code works, but what he's asking for is OT.
23:53
He is asking for an improvement on his existing sort.
AFAIS.
He doesn't care if it is algorithmic suggestions or other suggestions.
Well, that title could stand to be better.
Yes.
00:00 - 18:0018:00 - 00:00

« first day (672 days earlier)      last day (3644 days later) »