« first day (434 days earlier)      last day (1951 days later) » 

12:00 AM
In your main method, type Arr and then Ctrl-space.
 
@DanLyons What other options can there be?
 
Down with tabs.
Spaces only is better.
 
OK, Jamal, your FizBuzz project in Eclipse was probably imported wrong, or you did a copy/paste wrong.
I recommend deleting it, and starting over.... ;-) It's easiest at this point.
 
It does work for Junk, just not the original attempt.
 
Right now, your code is in the directory src/FizzBuzz/FizzBuzz.java
or something.... but, the src and bin folders are messed up.
 
12:03 AM
I've seen several calls for contextual indentation, including one page that had a semi-working prototype example. I'll see if I can dig it up. It was cool in concept if poor in execution.
 
there are probably .settings folders that aremessed up as well.
Fixing these things can be harder than restarting them.
When you understand that packages are just directories under src/*, then you can drop/move code in to that folder, and things just work.
 
I have wiped out everything else, started out fresh, and it's running again.
 
Good, that's what I would expect.
Something funny happened, and it got messed up somehow.
now it's clean.
 
@Jamal Don't forget to also wipe out all your existing C++ projects I shouldn't push it, should I?
 
lol
 
12:07 AM
It was probably just bad beginner's luck... you did something wrong, and were not aware of the consequences.
So, there are some things that you will find useful......
 
0
Q: Where should the code for insertion sort used by quicksort go?

CeleritasQuicksort is good for large arrays but when the array to be sorted is small (i.e. length 10 or less) then another sorting algorithm, such as insertion sort, should be used. I'm putting together a class for Quicksort. Right now I have a method called insertionSort() that does insertion sort. How s...

 
I just didn't know there would be that much to it. Again, I'm comparing it to setting up a C++ project.
 
And setting up a C++ project is easier?
with make, conf, etc.?
It is just a familiarity thing, that's all.
 
Through an IDE, I mean.
 
@Jamal I bet that I would encounter at least as many problems as you did if I were to setup a C++ project (which I am willing to try some day)
 
12:10 AM
Anyway, if you go to your fizzbuzz code.
the main method has String[] args
 
Meanwhile, I guess I'm eating my words:
1 hour ago, by Simon André Forsberg
@Jamal If you can show a screenshot I bet I would find the problem instantly.
 
if you click on String.... and press f3 .... what do you get?
 
String.class
 
@Jamal Do you see the source or do you see gibberish?
 
The source ?
 
12:11 AM
"Source not found"
 
OK, let's fix that.
 
^^ Gibberish
 
you downloaded and installed the Java 8 JDK?
 
Yes
 
Right, Window -> Preferences.
Java -> Intalled JRE's
 
12:13 AM
Again.
 
Do you have an entry that points to the Java you installed?
 
Yes, jre8 (default)
 
OK, jre is not so nice, you want jdk.
 
Programs don't run how we'd like them to. Programs run how we tell them to. — nhgrif 6 secs ago
 
Awesomesauce^
 
12:14 AM
Every Java JDK (Java development kit) ships with the JRE (Java runtime environment) as a subdirectory of the JDK install.
We want to add a new installation..... so, add a new one.
 
Unfortunately, we frequently have to make several attempts at telling the program how to run before we tell it correctly.
 
It's a 'Standard VM'.
in the next tab, browse to the jdk you installed..... (not a jre subdirectory).
 
Okay
 
Call it Java8 or something.
click 'finish'.
Back at the 'installed JRE's tab, select the chckbox next to Java8 as the 'default' runtime.
 
It's greyed out. What about JRE home?
 
12:17 AM
JRE home should be pointing to the directory with the JDK.
 
TTGTB here. I'll leave you in monkey hands, @Jamal. Code safe :)
 
:-)
 
 
@rolfl jdk1.8.0_05?
 
Sounds good.
Click on the jdk-1.8.0_05 (not the jre folder).
 
12:19 AM
Okay
 
Call that Java8.
 
I really wish that didReceiveMemoryWarning would stop having a default method stub in UIViewController subclasses. :/ Hardly anyone uses it... and if you need to use it, you're probably not a moron that can't figure out that the method exists...
 
@rolfl Okay, I have checked the box next to Java8 (default)
 
Set Java8 to be the default.
good.
Hit apply, and it should ask you if you are sure, and recompile your programs.
 
It still runs
 
12:21 AM
it should, but, what if you press f3 on top of String now?
 
"Source not found"
 
OK, so there's one more step.
In your project view, there's an entry "JRE System Library"
It has something other than "Java8" in parenthesis after it.
right?
31 mins ago, by rolfl
user image
I'm talking about that.... ^^^^
 
No
 
Holy mother of God... I was about to start fiddling around with Swift... but I can't. I just can't do it. They still don't have access modifiers....
 
No, it says "Java8" or No, it does not say "Java8".
 
12:26 AM
It doesn't show the JSE System Library.
 
Are you in the package-view or the navigator view?
 
Oops...
Okay, now I see it.
 
Java8 ?
 
Hey any Java guys in the house?
 
Nope.
 
12:28 AM
JavaSE-1.8
 
Jamal's here ;-)
 
Oh it looks like javas the topic rn!
 
sucks thumb
 
Did you call the link you made Java8 ?
 
Anyone have any idea how to pad a byte[] with zeros?
 
12:29 AM
Installed JREs? Yes
 
OK, right-click the JRE System library, go to Build Path-> Configure Build path
it should be highlighting the JRE System Library.
 
Okay
 
Click 'edit' on the right.
Choose the "workspace default" radio button.
(which should be Java8)
 
Yes
 
Finish, and go back to your code.
 
12:31 AM
I get something for String
 
Now what do you have behind f3 for String... ;-)
OK.
Now, right-click the word 'for' in your main method.
I lie, don't do that....
put the cursor on the for-line.
you on it? and press Ctrl-shift-B
A little blue icon shoul dhave appeared in the left margin.
 
Yes
 
OK, right-click the main method, and chose "Debug as ...."
Java Application
It should ask you if you want to change to the Debug Perspective.
 
Yes
 
Say yes... ;-)
 
12:35 AM
yes... ;-)
 
You will notice at the top-right of eclipse there's a debug perspective 'tab' and a Java tab.
you can switch between modes by using those tabs.
 
Okay
 
Your 'for' loop line should be highlighted.
you can step in with f5, step over with f6, step out with f7, and continue to next breakpoint with f8
 
It runs the method in the debugger or else it gets the hose again.
 
Okay
 
12:38 AM
Alright, in the debug mode you can inspect all variables all the way up the call stack.
It is very useful.
you can also step in to any of the system code as well, and walk though how Java does string, integer, whatever manipulation.
to add a break point, see where that blue-icon is in the left-margin?
 
Yes
 
you double-click on that margin, on your line of code.
that will toggle the break point.
The inegrated debugger is at least half the value of any IDE... now you know where to find it.
If you want to run an application you have run before, you find the green 'play' button on the tool bar, and drop it down to select it, or, play the last applciation run.
The same is true for the 'debug' button.
In Java/Eclipse, you can change the code in a running debug session.
 
In many IDEs (I'm sure in Eclipse also) you can also set the breakpoints to only trigger under certain conditions
 
So, you can edit a line you don't like, and the debugger will reverse out of that scope, and then re-enter it with the new code.
 
I see. How do I stop Eclipse from highlighting the for line?
 
12:42 AM
this is a great feature, but sometimes the variables/state of the system is wrong because the pre-change code did something.
Well, you are currently running the program, you need to stop it.
There's a red square in the debug perspective.
or on the console view.
 
Got it
 
Your eclipse should now be set up for you for a while.
ny new projects will have the right Java by default.
you can breakpoint in any code, and the source is available.
 
From this point, I can follow along in the book. It continues with intro to OO.
 
with the source available, you also get the nice-name variables for some things, and the hover-over on your code will pull up better documentation
Now, you are 'up and running', agreed.
you should create projects for things that are unique... create a new one for each exercise if it makes sense.
you can open, and close projects.... close ones that you are not using, and it saves some eclipse processing time
Eclipse does incremental builds for Java, compiling only things that it thinks need to be compiled.
 
Okay. Would the package be given a name related to the exercise?
 
12:48 AM
Typically a package is based on a domain name, and a library name....
something like org.apache.httpserver.*
or org.jdom.*
if you are ibm, you would have things like:
com.ibm.db2.jdbc.....
packages solve the same problems that namespaces solve in C++
 
Ah
But without the using namespace std crap? :P
 
essentially, but, everyone on Code Review uses the default namespace... ;-)
(no package).
We just don't bitch about it ;-)
 
So I didn't even need one? I just called it "fizzbuzz"
 
you called it 'FizzBuzz' the class .... there was no package
if it was in the package com.gmail.jamal.learning ...
(many individuals use their e-mail address if they need a package).
(you are not jamal@gmail.com, are you?)/
 
It's a different address.
 
12:52 AM
I have my tuis.net domain ... ;-) (and jdom.org).
 
So, should I try another Junk, but without a package?
 
package and project are different
in your junk project, you have the 'default package' folder with FizzBuzz.java in it... right?
right-click, and choose "new package"
call it "se.cr"
(for codereview.stackexchange)
 
I have already removed Junk.
 
then, drag the FizzBuzz.java file to the new se.cr package.
Well, wherever you are ;-)
After dragging the .java file to the package, edit it in the new location, and you will see the first line of the file is now package se.cr;
the official name of the class is now se.cr.FizzBuzz
 
I have fizzbuzz -> src -> se.cr -> FizzBuzz.java
 
12:56 AM
Look at the FizzBuzz source now....
what's the first line....?
 
package se.cr;
 
your eclipse project is called fizzbuzz, your code is in the src folder, you have a package called se.cr (which is identified in a directory called fizzbuzz/src/se/cr/ )
and the Java class name is FizzBuzz and is in the file fizzbuzz/src/se/cr/FizzBuzz.java
 
Yup
 
Good, it's all good.
 
I KNOW JAVA
 
1:00 AM
better than most ^^^
 
Hopefully that'll put me at an advantage this fall.
 
If you want to pull someone's code from Code Review, the best way I know of, is to go to your default package, and create a new class with the same name as the CR class.
then, ctrl-A, del, and Ctrl-v the CR code.
Java requires that the class name of the (public) class in the file matches the name of the file, and that the package name in the file matches the relative folder of the file.
(it's a compatibility thing).
 
So now I can finally test the code that I review. :-P
I need to have public types defined in their own files?
 
0
Q: Is this FizzBuzz Swift-y?

nhgriffor (var i = 1; i <= 100; ++i) { var fizzBuzz = "" if i % 3 == 0 { fizzBuzz += "Fizz" } if i % 5 == 0 { fizzBuzz += "Buzz" } if fizzBuzz == "" { fizzBuzz += "\(i)" } println(fizzBuzz) } I don't really like comparing strings with ==, bu...

This is cool, by the way:
See the stuff in the right hand margin?
 
@Jamal Java typically has only one class in each file. It requires only one publiv class per file.
You can have nested classes (quite common) which is a class inside another class.
 
1:12 AM
Ah
I'm just testing some code I found from the front page.
 
For example, a linked list may have a Node inner class.
The linked list may be called 'net.tuis.LinkedList
the node would be net.tuis.LinkedList.Node.
 
0
Q: Is this FizzBuzz Swift-y?

nhgriffor (var i = 1; i <= 100; ++i) { var fizzBuzz = "" if i % 3 == 0 { fizzBuzz += "Fizz" } if i % 5 == 0 { fizzBuzz += "Buzz" } if fizzBuzz == "" { fizzBuzz += "\(i)" } println(fizzBuzz) } I don't really like comparing strings with ==, bu...

 
The Java would look like:
public class LinkedList {
    private class Node {
        ....
    }
}
It is possible, but very frowned on, to have:
class Node {
    ....
}
public class LinkedList {
}
in a single file.
 
The former is how I would do it anyway.
 
The latter would have two classes net.tuis.Node and net.tuis.LinkedList.
People expect to find net.tuis.Node in the file net/tuis/Node.java
but, it would be in net/tuis/LinkedList.java
 
1:16 AM
I'll have plenty of JDQ code to test. :-)
 
So, don't do it.
That neither ;-)
 
I'll look through some JDQs and see what I can implement myself. I'll spare you all another crappy linked list. :P
 
A not-crappy linked list would be welcome!
 
Nah, I'll try something else first, maybe from the book. I can't even make a good one in C++...
 
1:33 AM
@Corbin: By the way, can I get full C++11 support with Eclipse, or am I still out of luck?
 
1:48 AM
Tomorrow ......
tomorrow, I overflow:
> 255 days, 255 consecutive
 
@SimonAndréForsberg it's not hump day....I missed that one again this week....ugh
@rolfl Very nice!!!
 
2:07 AM
First Swift answer:
2
A: Is this FizzBuzz Swift-y?

syb0rg Is this FizzBuzz Swift-y? Kinda, but it could be a lot better. Here's what I would do to fix it: Extrapolate this code into a method, then call the method from the for loop. func fizzbuzz(i: Int) -> String { // ... } There is a handy Swift feature called "Tuples". Tuples are grouping...

@nhgrif You downloaded it as well?! Awesome!
 
+1'd already, but still looking for swift switch syntax documentation
 
@rolfl Most of what I said in the comment came directly from the Apple documentation. The last sentence was speculation however. The code does run correctly when I have it like that.
 
> Although the actual execution order of pattern-matching operations, and in particular the evaluation order of patterns in cases, is unspecified, pattern matching in a switch statement behaves as if the evaluation is performed in source order—that is, the order in which they appear in source code.
> As a result, if multiple cases contain patterns that evaluate to the same value, and thus can match the value of the control expression, the program executes only the code within the first matching case in source order.
as I read it, the code should never produce FizzBuzz output because all FizzBuzz's also match just Fizz.
 
Hmm, I'll modify my answer until I can find direct documentation as to why it works.
This is the console output with the case right before the default:
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
Fizz
16
17
Fizz
19
Buzz
Fizz
22
23
Fizz
Buzz
26
Fizz
28
29
Fizz
31
32
Fizz
34
Buzz
Fizz
37
38
Fizz
Buzz
41
Fizz
43
44
Fizz
46
47
Fizz
49
Buzz
Fizz
52
53
Fizz
Buzz
56
Fizz
58
59
Fizz
61
62
Fizz
64
Buzz
Fizz
67
68
Fizz
Buzz
71
Fizz
73
74
Fizz
76
77
Fizz
79
Buzz
Fizz
82
83
Fizz
Buzz
86
Fizz
88
89
Fizz
91
92
Fizz
94
Buzz
Fizz
97
98
Fizz
Buzz
No differences when I move the case either... odd.
 
@syb0rg And that's broken results....!!!!
ther'e no FizzBuzz at 15.
just Fizz
> Unlike C, Swift allows multiple switch cases to consider the same value or values. In fact, the point (0, 0) could match all four of the cases in this example. However, if multiple matches are possible, the first matching case is always used.
 
2:17 AM
@rolfl Ohhh, that problem is fixed with your modification...
 
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
Fizz
22
23
Fizz
Buzz
26
Fizz
28
29
FizzBuzz
31
32
Fizz
34
Buzz
Fizz
37
38
Fizz
Buzz
41
Fizz
43
44
FizzBuzz
46
47
Fizz
49
Buzz
Fizz
52
53
Fizz
Buzz
56
Fizz
58
59
FizzBuzz
61
62
Fizz
64
Buzz
Fizz
67
68
Fizz
Buzz
71
Fizz
73
74
FizzBuzz
76
77
Fizz
79
Buzz
Fizz
82
83
Fizz
Buzz
86
Fizz
88
89
FizzBuzz
91
92
Fizz
94
Buzz
Fizz
97
98
Fizz
Buzz
 
Good, my instincts are still good... ;-) Never programmed swift before, but I can still spot logic errors.
 
@rolfl I'm veeeeery new to it as well. As in learning some fancy Swift tricks before answering that question new.
Such as the underscore trick with Tuples
 
2:52 AM
std::string::front() requires C++11? I had no idea.
 
3:05 AM
Congrats on the goldie, @SimonAndréForsberg!!!
5
 
I like that Swift makes the braces mandatory and the parentheses optional for if, while, etc.
 
One little apple bug, and everyone pays ... ;-)
 
Your tone implies that you disagree with my opinion?
 
Acually, I agree with you, (well, about the mandatory braces anyway).
But, I was trying to imply the reasons were because of Apples' recent embarassing bug
instead of following code-style practices to fix the bug, they create a whole new language that makes a lot of other bugs possible, but closes that particular loophole
 
3:24 AM
@Jamal One detail about the inner class that rolfl didn't mention: a static inner class would generally be preferable.
 
3:35 AM
@nhgrif Does that screenshot violate some kind of NDA?
 
@200_success Would that apply to all inner classes, or are there some exceptions?
 
Situational.
If you don't need the inner class to be associated with an instance of the containing class, though, make the inner class static.
For clarity.
 
@Jamal probably. I typically use Netbeans, and I'm not very familiar with the current state of Eclipse. Netbeans has had C++11 support for quite a while now though, so I'm sure Eclipse likely does too.
 
@Corbin I may try harder to switch to a fully-compatible C++11 compiler once I get more into that. I'm slowly trying to slip into Java...
 
If you're on Windows, you're probably going to have some problems, unfortunately. clang currently has the best C++11 support, though GCC is quickly gaining and VS is actually doing pretty well keeping up. GCC is finicky on Windows though, clang has just recently become supported and depends on GCC, and VS is missing a few vital parts :/. You can't really fully win. (Although the last time I did C++11 on Windows was about 3 months ago -- might have improved since then)
 
3:44 AM
>.<
 
Slowly slip into Java? Is a class the motivation for that, or are you a masochist? :p
 
It's a class. :-/ Anything to reduce the chances of bombing it.
 
Ah :)
 
I'm finally going to have a double-helping of programming next semester, but it's gonna be tough. I'll be new to (real) OO, as well as parallelism.
 
At least both are very interesting :)
 
3:51 AM
0
Q: URL Conditional Javascript

The MentalistI'd appreciate any help just refining this working code. It has a bit of a weird context, but basically it's for a gallery style site that has hundreds of pages, but needs new navigation buttons. Unfortunately there's no way to add these buttons without adding them for over 300+ pages manually, o...

0
Q: how do I refactor this producer consumer class to minimize what is exposed?

ThufirI don't like the service class below, specifically, the way it exposes the internals of the producer. While it would be possible to combine all three classes into one producer-consumer, I would rather that they stay separated. service: package net.bounceme.dur.client; import java.io.IOExcepti...

 
I'll be taking the latter with a professor I've had before (for computer architecture), and he's kinda tough.
 
Ah... Concurrency and parallelism are hard to begin with, so that might be quite unpleasant :/. At least it's in a relatively high level language though with support for basically all the required tools out of the box (not that actually using the tools isn't the hard part though... lol).
 
The syllabus doesn't even state what language will be used. At least it won't be assembly.
Can't be harder than Operator Systems.
 
4:09 AM
I actually didn't mind assembler too much, but we were lucky enough to go the RISC route. x86 makes my head hurt.
 
I like x86. :-) But I probably only say that because it was covered in my assembly class. Computer architecture class involved MIPS, but it wasn't actually taught (it wasn't an assembly class).
 
Ah yeah. We're probably both just biased to what we learned haha. x86 is certainly the more practical one to learn.
 
After receiving some brutal assembly reviews here, I probably should hold back from programming in it. Even when it doesn't seem quite that hard, it's still different than programming in a high-level language.
 
4:34 AM
Hah. I think it's just a weird mental shift. I would never dare to post any of my assembly here. I don't even want to know how bad it is.
 
5:01 AM
Hey all
 
 
2 hours later…
6:59 AM
0
Q: How to generate valid number of combinations of datacenter and its host id?

WebbyI have a list of datacenters, which are dc1, dc2 and dc3. And each datacenter has six ids as of now (can be 11 in each datacenter as well or uneven number for each datacenter). dc1 - h1, h2, h3, h4, h5, h6 dc2 - h1, h2, h3, h4, h5, h6 dc3 - h1, h2, h3, h4, h5, h6 Now I am trying to generate ...

 
7:16 AM
Some dude azngunit81 just chewed my ass because he was only looking for review, even though he also tagged .
Go back to SO man, seriously.
 
8:02 AM
^ looks like an XY problem
"my SQL looks too much like SQL, how can I fix it?"
 
8:14 AM
Right. Let me just rely on a heavily modified version of PHP instead to do all my SQL work.
Calling it "Eloquent" is adding insult to injury. Oh well, I tried.
 
8:32 AM
i never understood that approach myself... trying to write a bunch of functions to emulate SQL, when underneath it's generating SQL anyway. Abstract the SQL away where it's appropriate, and just let people write SQL where it's not. Don't try for some weird halfway thing. Just another thing for people to remeber.
If he had something specific in mind that "eloquent" would do for him, that's another story. But as it is, it has the same feel as those "how can I convert my JavaScript to jQuery" questions.
...which are about on par with those "what are some awesome features of X" questions that used to be popular on SO...
 
9:01 AM
0
Q: Getting TLE for spoj NGON (many polygons)

NamanI am trying to solve NGON problem. I am using bottom up dynamic programming here. Recurrence function is: f(a,b) = f(a-1,b) + f(a-1,b-1)*ai +f(a-1,b-2)*ai*(ai-1)/2, a>0,b>0 f(a,0) = 1, f(0,b) = 0, ai being the points on ath side. I have used a O(n^2) algorithm. I can't think anything other a...

0
Q: Forcing SSL and WWW using .htaccess

user2406937I would like to know if this code in .htaccess for forcing SSL and WWW in URL is correct, because with another codes I usually get redirect loop, e.g. RewriteCond %{HTTPS} !=on and now it works like a charm (suspiciously). Also, is possible to write it better/simplier? # Force to SSL RewriteCond...

 
9:33 AM
0
Q: Improvements to nsiZipReader and nsIScriptableInputStream

NoitidartDisclaimer: I'm trying to tag this with: firefox-addon, xpcom but I can't create tags yet. I wrote this code to list contents of an XPI file and then read the contents in it. I was thinking areas of improvment: I put the zr.open in the try because if the file does not exist it will throw exce...

0
Q: Promise.jsm demo of Promise.all and Promise.defer

NoitidartDisclaimer: Needs firefox-addon tag I created this demo example for MDN documentation to show how to use Promise.all and Promise.defer in user created promise. I used lets because I thought if I didn't it would mess it up. People are recommending I avoid let because the standard is not there ye...

 
10:05 AM
Monking
 
Monking
 
Waken up early by the kids? ;-)
 
Actually, alarm. About to do an 8 hour drive
 
:o What are you up to then?
1
Q: How to generate valid number of combinations of datacenter and its host id?

WebbyI have a list of datacenters, which are dc1, dc2 and dc3. And each datacenter has six ids as of now (can be 11 in each datacenter as well or uneven number for each datacenter). dc1 - h1, h2, h3, h4, h5, h6 dc2 - h1, h2, h3, h4, h5, h6 dc3 - h1, h2, h3, h4, h5, h6 Now I am trying to generate ...

Does this title need improvement?
First thought on that question I had was: Do I need to close it?
(Without reading, just by title)
 
10:31 AM
16
Q: Should I return a Collection or a Stream?

FredOverflowSuppose I have a method that returns a read-only view into a member list: class Team { private List<Player> players = new ArrayList<>(); // ... public List<Player> getPlayers() { return Collections.unmodifiableList(players); } } Further suppose that all the client...

The Java 8 team at full force ^
@Donald.McLean We've got a new candidate besides pythonic! It's called Swift-y.
8
Q: Is this FizzBuzz Swift-y?

nhgriffor (var i = 1; i <= 100; ++i) { var fizzBuzz = "" if i % 3 == 0 { fizzBuzz += "Fizz" } if i % 5 == 0 { fizzBuzz += "Buzz" } if fizzBuzz == "" { fizzBuzz += "\(i)" } println(fizzBuzz) } I don't really like comparing strings with ==, bu...

Iew, Swift looks ugly.
Switching over tuples is interesting though.
But then they make a weird design decision to not have switch statements fall through, like they always have been.
Perhaps I should take the challenge to write FizzBuzz in both the shortest and most readable (so no dirty unreadable hacks) in Java 8.
 
11:35 AM
0
Q: The FizzBuzz challenge in Java 8 written in a short, readable and interesting way

skiwiI decided to take on the FizzBuzz challenge with as twist that I would use Java 8 concepts to make it a bit modular, yet still let it be a short, readable and understandable program. This in contrary to some gem I found on the net: FizzBuzzEnterpriseEdition The problem description: Write a ...

 
Ugh, 3 views in 10 minutes, this was a bad time to post a question.
 
12:06 PM
I don't know why they made the Java 8 streams so.. awkward
Without knowing anything about it, how am I supposed to know what IntStream.rangeClosed(min, max).mapToObj(FizzBuzz::fizzBuzzify) could possibly mean
Such a contrast compared to LINQ
 
@skiwi You can make them fallthrough.
I think any time you come across a "weird design decision" like that in Swift, it'll probably turn out to be something that's a common developer mistake.
@200_success Probably... I didn't realize there was still an NDA since I'm an idiot and it basically only requires a Mac to get access to it. Can you delete the message?
 
@JeroenVannevel I don't think it's too hard, but I may be biased
 
@rolfl What sort of new other bugs do you feel have been made possible? I think a lot of thought went into improving on what they already had in a way that made silly mistakes less likely--like the fact that switch statements only fallthrough with the fallthrough keyword.
 
IntStream.rangeClosed = a closed range of ints as a stream, map to obj = map the integers to an object
Very good catch on the resi;t/;emgtj ? 0, I like it! No need for the (stupid) variable anymore. — skiwi 10 secs ago
 
@syb0rg Answering my Swift questions (which I shall be posting many of over the coming days as I teach myself the language) is definitely a good way to learn the language yourself. What you also might consider doing is implementing anything I do in Swift yourself in Objective-C and posting that as a question as a way of learning Objective-C.
 
12:20 PM
I'm probably biased from LINQ as well but something like IntStream.range(min, max).execute(FizzBuzz::fizzBuzzify(value)); would make more sense
 
Erm, I might have messed something up in that comment
@JeroenVannevel But I don't execute it, it has nothing to do with it here imho.
I start of by a IntStream, and I map them to a Stream<String>
Also a fair point there @ckhun203
I still have a new version coming up possibly today, but it requires me to write a little library for my needs
 
@SimonAndréForsberg If you are still interested in learning Objective-C... I'm intending to post several Swift questions as I teach myself Swift. Might be good to follow along posting the same question but for Objective-C. In many cases the difference will primarily be syntax... and both languages strongest features will be the Foundation library they're built upon.
 
@skiwi Fair enough, that's why in LINQ it's called .Select() but I didn't want to just copy a LINQ statement ;)
 
Monking @all
@DaggNabbit Okay, then I misunderstood it. On the basic types there is no difference because it is easily optimizable and on user defined types (in C++) the compiler must use the one you chose because it cannot reason about the sideeffects
 
Monking @Nobody
 
12:38 PM
0
Q: Optimize parsing more and more… in C#

SOF UserI have below C# code for parsing ... Do you think this is most optimize or I should use generic method or optimization required in these function itself? public static bool GetDBBool(object value) { var result = false; if (value != null && string.IsNullOrEmpty(value.ToString()) == false...

 
@JeroenVannevel One can immediately spot you are used to streams :) Like in your unit test you added
Oh
that was janos I think
 
Wrong J-man
 
All the inline edits and answers without reloading the page confused me a bit :P
 
12:58 PM
Welp, Swift doesn't have try-catch blocks. I'm not sure how I feel about that.
 

« first day (434 days earlier)      last day (1951 days later) »