« first day (572 days earlier)      last day (3461 days later) » 
00:00 - 17:0017:00 - 00:00

12:00 AM
1
Q: How can I tell what model iDevice is plugged into my USB via Terminal?

nhgrifThis website has a useful list of the various iDevice models. And the "identifier" column is helpful for any iOS developers, as this is the string you can fetch in your application to determine what kind of device your program is running on. However, for reasons, I am interested in determining ...

 
@nhgrif I have a few Apple devices I can contribute, if that would help you. iPad 2, iPhone 4, I might still have my 3GS somewhere as well. Would I post in comments or answer?
 
12:32 AM
@Phrancis I would say answer. And let the mods there sort it out.
That's the only thing I've ever posted there.
I have an iPad2 and an iPhone4, but confirming you get identical numbers would be useful.
You may have slightly different models also.
Apple has managed the same number/version offset as Windows. Windows 7 official version is actually 6.1 or something. iPhone 6 and 6 Plus are version 7.x
And somehow... the iPhone 6+ is version 7,1 while the iPhone 6 is 7,2
(though I'm not sure what either reports via USB)
 
Confusing enough
 
You're on a Mac, right?
 
Yeah
 
So the terminal command in that question will work for you.
 
OK
 
12:36 AM
you can plug in as many devices as you want, run it once and it will print each device on its own line.
 
Will post shortly
 
en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions Vista = 6.0, Win7 = 6.1, Win8 = 6.2, Win8.1 = 6.3
 
Anyone remotely familiar with ternary expressions in SSIS? stackoverflow.com/q/27160777/1188513
 
I'd put parenthesis around the conditional parts and try it.
 
I'll try to get it to work tonight, will let you know :)
 
12:49 AM
@nhgrif Is this command line supposed to return anything, if no Apple device is plugged in?
Francis-Veilleux-Gabourys-MacBook:cardshifter.github.io francisveilleux-gaboury$ system_profiler SPUSBDataType | sed -n -e 's/  */ /g' -e '/iPad/,/Version/p' -e '/iPhone/,/Version/p' | grep 'iPad\|iPhone\|Version' | awk 'NR%2{printf $0;next;}1'
Francis-Veilleux-Gabourys-MacBook:cardshifter.github.io francisveilleux-gaboury$
I do have my cd set to a Git folder, not sure if that makes a difference or not
Nvm
Just plugged phone in a got an output
0
A: How can I tell what model iDevice is plugged into my USB via Terminal?

PhrancisFor all it's worth, I have ran the command line in Terminal with a few devices. iPhone 4: iPhone: Version: 3.20 iPad 2: iPad: Version: 2.10 I have a 3GS somewhere but I can't find right now. I'll edit my answer if/when I find it.

@nhgrif ^^ let me know if you need more clarification
 
@Mat'sMug parens are balanced ... what's the error message?
 
RELOAD
 
0
Q: Implementing JQuery style 'deferred' and 'promise' in C#

Andrew ShepherdI really like the pattern of the jQuery Deferred object. I like how you can call Resolve any number of times, but the listening objects will only be notified once. I also like how you can attach a listening object after the Resolve has already been called, and the listening object will still get...

0
Q: The Login user screen rejected from Apple

Ahmed AlkaabiI have submitted my first version of my app on Apple Store and everything's good. My problem is that I am trying to upgrade the app with new version which has been rejected by apple review. I did search everywhere to find the error in my code but I did find nothing. The response from Apple said:...

 
1:22 AM
@mjolka SSIS won't parse it
 
@Mat'sMug there's no specific error message?
 
@Mat'sMug what's f3?
It's not a string or variable. Is it a field?
 
1:52 AM
it's a field in the source table, containing the "season name", like "FALL 2015" or "SPRING '97" - the format isn't very consistent, but I can assume that "F%" will be Fall and "S%" will be Spring
...except "BASICS"
and "SPRING BASICS"
and "FALL BASICS"
@mjolka expression can't be parsed is pretty much all I have
the ternary expression would determine which EntityId to give to each record - they're 5 GUID's stored as SSIS variables
I'm going to be using them to lookup a description in a translation table
 
@Mat'sMug is "User" the same as "user"?
 
oh crap
it's not
 
is that the solution? if so, i'll post the answer :)
 
it is!
 
woohoo!
 
2:03 AM
I swear that error tooltip didn't mention anything about "user::BasicsEntityId" not being defined before I left the office... or I'm blind and just noticed now...
 
to be fair, they do look very similar
 
I'm blind
thanks anyway :)
 
"The expression was not valid, or there is an out-of-memory error." :| not the best error message...
 
I apparently completely overlooked the top part
and yeah, that "out-of-memory" part had me googling about whether it's at all possible to nest ternaries in SSIS expressions
 
SSIS messages are bad. SSIS expression messages are terrible.
 
2:11 AM
guess they're just covering all bases. "or the computer has caught fire"
2
 
lol
 
so much doubt in those messages. "The variable might not exist in the correct scope." "It might contain invalid elements or it might not be well-formed. There may also be an out-of-memory error."
 
Happy to see the problem solved, but you might want to consider a more maintainable solution.
 
0
Q: Implementing both poor-man's MVP and MVPVM framework

Will MarcouillerI'm actually building some kind of framework to promote code reuse without over-reusing it. Besides, sometimes as it occurs with generic types, one expects type parameters to be constrained for the purpose. In MVP, those constraints translate well enough. Presenter public abstract class Presenter

 
@RubberDuck why? business rules never change, do they? (cough)
> to promote code reuse without over-reusing it.
There's something I'm not getting
 
2:15 AM
Yeah, but I'm interested in that question.
 
I +1'd, it's a good one
 
I almost implemented an empty interface the other night. Decided I needed to study up on design patterns before I made a decision.
 
I would have almost refactored it ;)
 
Wait...
> //This is called the marker interface pattern.
Is that a legit thing??
 
don't even think about it
Singleton is also a pattern you know
and Service Locator
 
2:19 AM
Yeah. I know... Just not sure how else to go about what I want to do...
 
@RubberDuck missing [anti-] before "pattern"
 
that code doesn't compile for me
 
bbl
 
> Both the .NET framework and Java (as of Java 5 (1.5)) provide support for such metadata. In .NET, they are called "custom attributes",
Ahhh... Okay then.
 
2:24 AM
@Phrancis Working directory doesn't matter for the script. It'll only print anything if iPhone or iPad is plugged in. I have no idea whether or not it will return anything for iPods that run iOS.
 
@nhgrif I wouldn't know either. I have a very old iPod somewhere, but it's way older than what you seem to be aiming for... (i.e., it as a spin sensor to scroll, and B&W screen)
 
Yeah, I'm only concerned with devices that run iOS.
 
2:43 AM
@200_success I updated my code. To more real example — Phoenix 2 hours ago
Ironically, the added code makes it more hypothetical than before.
 
Time for "Code Review Academy"? ;-)
And I think "more real example" is an oxymoron in this case.
 
3:01 AM
> I updated my code. To more real example
 
0
Q: Refactor chain message

user77318I get the response object from other project library class which I cannot modified. How should I refactor this code so that I don't have to check for NullPointerException, ArrayOutOfBoundException or using many if checking to check object is null and array is not empty? Response resp; // thi...

 
@CaptainObvious That's not what refactoring means...
3
 
@Jamal I think it's on-topic. OP isn't asking to change behavior, he's aware that he's catching exceptions that he should be simply avoiding / guarding against, but he's not sure how to go about it. It's not what the code does that he wants to change, it's completely about how it does it.
 
3:17 AM
yellow
 
hey @JaDogg
 
1
Q: Asynchronous task and close sql connection

Ivan-Mark DebonoThe following code compiles correctly: public ContextStatus Commit(string userName) { var status = new ContextStatus(); var task = Task.Run(async () => { status = await CommitAsync(userName, new CancellationToken()); }); task.Wait(); return status; }...

 
never seen such an infraction of the law of demeter
 
^^ in this is 1/3 off topic but 2 is ok ?
 
@mjolka my exact thoughts :)
 
3:19 AM
@mjolka did you finish coursera algorithms I ?
 
@JaDogg finished the assignments, not the quizzes
 
ah
 
how'd you go?
@Mat'sMug re codereview.stackexchange.com/a/70971/44723 did you get the code to compile?
 
I didn't start it again. I downloaded the videos however, and I'll follow it again when it comes back
 
yeah it's hard to keep up with a course and full-time work :/
 
3:22 AM
@mjolka I didn't ..try
it doesn't?
 
:P
no, doesn't compile
maybe i'm doing something wrong though
 
missing references?
 
nope
can't copy the error messages from linqpad... i'll put it in VS
 
hmm.. I haven't mentioned the Java-style braces...
and
protected void RaisePropertyChangedFor(string propertyName) {
    if (propertyName == null) throw new ArgumentNullException("propertyName");
    if (PropertyChanged != null)
        PropertyChanged(this, new PropertyChangedEventArgs(propertyName);
}
isn't thread-safe
I just assumes it builds on OP's computer, there's plenty of things to say about this code I find...
 
@Mat'sMug missing ) before that last } in the code you pasted
well, before the ; anyway
'ConsoleApplication16.ViewModel<M>' does not implement interface member 'System.ComponentModel.INotifyPropertyChanged.PropertyChanged'
 
3:32 AM
@mjolka that's what Java braces do to C# code!
but yeah I see it now.
 
if only java had three syllables, we could sing it to the tune of blame canada
 
lol
 
Canada is innocent
 
hi @rolfl!
 
Hi @Mat'sMug
 
3:36 AM
omg james gosling is canadian
4
it all makes so much sense now
 
So is .... Celine ;-)
Canadian Breakfast FTW.
@mjolka Justin Bieber is Canada's most famous export though.... seems a shame that so many Canadian female artists move to the US.
 
java, celine dion, and justin bieber... you're not making a strong case, @rolfl
 
You missed the lol joke in there.... FWIW, Canada also exported Basketball, though the US does not like that.
 
@rolfl Do you carry that unicorn everywhere you go?
 
@Phrancis that's rolfl
 
3:48 AM
Also, he said Celine and I almost puked
 
The Roaming Unicorn is a 1-week thing. I mailed her off to the US today.
I got her last week, and took her around with me...
 
I could've requested her, but I figured she would get bored in little San Marcos, TX.
 
0
Q: Python game problem [need to update]

Some guyI have been working on a python game (hangman). There's one part I can't get to work. I want to update the guessed formula so far using a function. For example, if the formula is 123456 and the user guesses 1, the function should add the 1 and print 1------ (lines for the remaining places that ...

 
No boredom here.
 
@CaptainObvious BURN IT
 
3:51 AM
 
@rolfl I could've asked if she enjoys programming homework. Oh well.
 
She tried to help me repair my home-theater receiver.... but she was not lucky....
 
The receiver failed (no sound), and I read that replacing the caps on the HDMI board helps.... so I did, but it was still not making sound...
 
lol reminds me of that ad where there was a garden gnome in every picture some guy was taking, around the world. and in every picture, a garden gnome unicorn.
 
3:55 AM
And I still haven't received my swag. If it has already been sent, then I won't get it at my apartment until next year.
 
After I did the 'repair', I learned that the company has extended it's warrantee on this particular problem.... but by desoldering and replacing the capacitors, I have voided my warrantee.
 
aw
 
There is not a unicorn in every one....:
 
If you modify something, take it for a fact that it voids the warranty
 
 
3:57 AM
That is CUTE
 
 
Is she using that glass as a toilet?
 
gotta say
..wo
 
WTF Photoshop
 
> You're missing a ) on the event method call line, just before the ;. Visual Studio has it squiggly-red underlined, and refuses to build your project. Pretend I didn't see it.
 
3:59 AM
 
I actually hadn't seen it when I first wrote my answer
 
@Phrancis I velcro-strapped her to a 5-foot fiber-glasss rod.... so I could hold it out in front of the camera when taking the shots.
You can see it in things like:
 
lol
 
You don't realize how big the turbines are though..... the shed here is about 30m away.... the 'close' turbine is about 1km away, the far one about 1.5
 
Holy monkey cow.
 
4:05 AM
To the left of the left-most turbine, there's a power transformer the size of a van.
 
At first I thought "Don't hurt the unicorn" but now it's more like "Don't hurt yourself"...
 
There's no way I can describe the scale... when you're at the bottom, well, they're huge.
The base is far larger than my car.
I think each blade on the turbine is about 30m long (radius).
It rotates about once every 3 seconds.... so, the tip speed is about 250kph
 
0
Q: Rounding and formatting hours, minutes, seconds as HH:MM AM/PM PART 2

̩̩̩̩̩̩̩̩̩̩̩̩This is my issue: http://imgur.com/ZCxOEuV I have no clue how to solve it. I tried using substrings. This question is a followup to this one private void button1_Click(object sender, EventArgs e) { int hours, minutes = 0, seconds = 0; var isValidInput = int.TryParse(HoursTex...

 
These are the turbines installed there:
GE Wind Energy is a branch of GE Energy, a subsidiary of General Electric. The company manufactures and sells wind turbines to the international market. In 2009, GE was the second largest wind turbine manufacturer in the world. == History == The entity was created as developer (not manufacturer) Zond in 1980 by James G.P. Dehlsen, who also formed Clipper Windpower in 2001. Enron acquired Zond and the German manufacturer Tacke in 1997. In 2002 GE acquired the wind power assets of Enron during its bankruptcy proceedings while gas turbine sales slumped. Enron Wind was the only surviving US m...
 
@rolfl Holy cow unicorn
 
4:20 AM
The actual ones installed are the 82.5m diameter blades, on 82m towers.
the top of the top of the arc of the blades is thus about 120m off the ground.
Also, my 3-second rotations makes the 40m diameter blades much faster at.....
933kph? Almost the speed of sound.
 
Wow, holy cow unicorn monkey
 
nahh, forgot to divide by 3... only 311kph.
 
Still about 3 times as fast as a car (that respects the speed limit somewhat)
So IRL, twice the speed of a car
 
$ gd --shortstat internal-release-1..HEAD
 691 files changed, 476568 insertions(+), 22355 deletions(-)
that's a pretty busy year
 
indeed!
 
4:34 AM
0
Q: Avoiding Duplicates in a Ruby on Rails Factory Girl Factory with Fake

dankohnI have a Factory Girl factory that needs to generate a unique name using Faker. Unfortunately, Factory Girl generates duplicates relatively frequently, which causes intermittent test errors. I previously added a random integer after the Faker name, but I am now checking the database to make sure ...

 
TTGTB here, good night CR!
 
Night!
 
5:28 AM
0
Q: Batch: The syntax of command is incorrect?

userEvery time I run my .bat file the response always says "The syntax of command is incorrect". What's keeping my .bat file run like this? What's wrong with the script? @echo off setlocal EnableDelayedExpansion rem Modify following variables set "in_path=D:\projected" set "out_path=D:\merged" set ...

 
5:43 AM
0
Q: Node.JS and Mongo: Better way to handle the error from mongo?

TimI have this huge chunk of code, I want to know if there is any better to write this code? Or am I too paranoid that I check every MongoDB query for error?? The logic is here: Bookcollection = collection of books Book = book info Query book collection of the user, if found find the book info f...

 
Monking @all
 
monking @Heslacher
 
6:12 AM
monking @all
 
Monking @chillworld
 
6:26 AM
the end is near of the new project
when first release is there, I'll have more time again for here
 
 
2 hours later…
8:15 AM
Anyone alive here?
 
8:31 AM
0
Q: Hanging semicolons in multiline statements in PHP

AmadeusDrZaiusI'm writing code to do line printing to a template -- counting characters to box A, then to box B, etc. -- and as such, it's not very modular. There are a lot of (long) variable names and each statement, which adds to the string to be printed, is pretty long. So I've been breaking up the stateme...

 
 
1 hour later…
9:57 AM
hey
Perhaps this question is meta-worthy... but
Should we ever think about the pros/cons of splitting up CR into a place where people new to programming (language) can get help; and where experienced programmers can get a peer review?
I think both types of questions would attract a distinct audience
 
IMHO No, because getting help is already done on SO.
 
^^ that.
additionally the audience here on CR is already doing both things..
splitting the site now wouldn't help much, since we don't have the volume to sustain two sites of this kind..
 
10:14 AM
@Vogel612 Agreed with that
But don't you agree with that we do have a group of users/questions that are getting considerately more "help" than others? As in, we need to teach them a lot of the basics
 
0
Q: If I want to pass an object to the template stack then will the print() function works?

vijayaIf I want to use the same class for any data type, then I might have used templates. And then if I have a class class A { int x; public: void setx(int a) { x=a; } }; Then in main() function, A a; a.setx(10); StackusingList<A> *s2= new StackusingList<A>(2); s2->push(a); cout<<"new\n"; s2->pri...

 
Yeah. There is that, but I think that's fine so long as they bring functional code.
 
I do think we are losing out on experts joining this site, as they have no way to filter out the real advanced questions, however it doesn't harm CR as a whole imho
 
Maybe. I don't know. What I do know is that I really like explaining the basics to people.
2
 
@skiwi now that's a different problem here..
Splitting the site is not a viable solution to this, though..
But I think it warrants a meta-question along the lines of: "How can we make it easier for people to review what they like reviewing?"
 
10:29 AM
That "template" question is way off topic btw @CaptainObvious.
 
That sounds like a good meta.
 
@RubberDuck I fail to see the problem in that way, though..
that's why I can't possibly start this..
reminds me of that.. "Viewing the code" meta-question
I simply didn't understand what his problem was..
 
Problem in what way @Vogel612?
 
12
Q: Viewing the source code

maaartinusWhen doing a CR, it's important to be able to quickly find methods/classes/whatever in the source. Currently, it's just terrible as you get a couple of small scrolling views and the search takes way more time than anything else. That's specific to CR, as other sites rarely need that much code. T...

@RubberDuck my point exactly..
 
10:36 AM
@RubberDuck I'll just be honest and say that I don't share that feeling for "random users", I would have no problem however explaining the basics to people I really know
 
Then don't @skiwi.
It's that simple. And if you want to filter the noise out, ignore and
That's the great thing about SÉ. We have the tools already. Just have to put them to use.
 
@RubberDuck Which is what I"m doing already ;) It's not a pet peeve of mine, just was wondering if anyone was sharing that view
 
well.. you need to know about them...
 
Yeah, there is that ^.
@skiwi I'm sure there are people who do feel that way. I'm just not one of them. ;)
 
but hey, there's people around who know about stuff. ask chatters...
all the cool stuff..
did you guys know there's a tag-predictor around?
 
10:42 AM
tag predictor?
 
What does it do? Predict tags?
 
kinda
 
Wait, that's a real on-site feature?
I thought you were talking about a 3rd party thing
 
on-site hidden feature ;)
you can only see your own though..
 
10:45 AM
I don't have enough questions/answers on CR imo for it to figure out what I'm really into
 
me 2..
look I got 100% android.
and another 100% data-structures..
and java comes with 50%..
 
What a surprise, on both SO and CR I like
 
Where is that??
 
{siteURL}/users/tag-future/{your userid}
It did find out what I don't like relatively well though..
 
Yeah. Look at that. At least two of those I really do actively avoid.
 
10:50 AM
Same for SO...
Maybe I should switch to the new feature one day:
^ Is what I'm still using
 
@RubberDuck didn't you want to put in an answer to the fizzbuzz?
 
user image
3
And monking by the way :D
 
@Morwenn that's only funny if you understand french though..
 
@Vogel612 That's kind of hardcore if you only understand Engish.
 
@Morwenn lol
No clue what it really means, but lol
 
11:06 AM
@skiwi "pain" means "bread".
It's pronounced pɛ̃ though. It's far from the English word.
 
No @Vogel612, but thanks for asking. I've been busy with other things lately.
 
0
Q: I'm new to Python, any suggestions?

ipsissimusI'm new to Python, I just wrote my first program with OOP, is the code clear, maybe any advices? Program works just fine and gives me what I want, my question is can you review the style, or maybe any advices? Open to anything. Thanks import numpy as np import time, os, sys import datetime as dt...

 
But I did find an evolve installer and the source code!
I need to get that posted on the web somewhere!
(After reading the EULA to make sure I can)
 
11:28 AM
0
Q: REST routes for API with multiple entry points

thomasbtvI am writing a REST API for a pretty complex legacy system, with multiple applications and systems accessing it. The problem is that the different systems all know different things about the data. For instance, for the orders, the website looks for the ID (which is not the DB line's ID), and th...

 
> # GERMANY STARTS HERE-----------------
 
@rolfl ... do I have to understand this?? Is there anything more to this than the python question?
 
Thought you may pick up on that.... in the code in: codereview.stackexchange.com/questions/70989/…
No,nothing more than funny side-effect of the non-native english usage
 
did they change revision looks??
 
12:08 PM
This makes me very happy. Like I'm some kind of preservationist or something.
 
12:22 PM
@RubberDuck Genare definately...
 
@Vogel612 huh?
 
Oh. Yeah. I didn't write that, but I'll fix it. Thanks.
 
Heya
 
Hey back
 
12:32 PM
0
Q: Counting Fermat witnesses and liars

kleinfreundWe were asked to implement a program that calculates the number of Fermat witnesses and liars for odd numbers greater 1. This involves Fermat’s little theorem. # coding=utf-8 """Basic usage: $ python fermat.py 7 (0, 0) $ python fermat.py 9 (6, 2) """ import argparse def main(): """Prints...

0
Q: Speeding up Parallel.ForEach iterating through datatable and rendering crystal report as byte stream

CoDeGiRlGood day, I am attempting to speed up the processing of 5000 rows received from the database, render as a crystal report, export to byte stream and then save that byte stream in a database table. Currently I am using parallel.ForEach on a datatable. This uses 40 parallel processes that then sequ...

 
12:42 PM
@kleinfreund It might be beneficial to include the problem description for that question..
I have no clue what fermat witnesses are..
 
They are like Jehova witnesses of mathematics.
5
 
These creepy people ringing my doorbell at 7 AM on Saturdays that you can't get to go away without getting the kitchen knife?
 
@Vogel612 I tried adding a brief description. However I find it difficult to describe it in English.
Or your gay husband. Works as well.
 
@kleinfreund hmm.. I am not old enough for marriage yet, IMO..
give me two years and it might look different. but...
 
@Morwenn Ah, right
 
12:55 PM
You can call your gay husband. You don't need to prove that you are married. :P
 
last time I checked, husband was "male partner in marriage"
 
In France, it has been simplified to "parent 1" and "parent 2".
That lets the law design field open for "parent 3" and "parent 4" when they feel like it x)
 
> When I was younger I had a sneaking suspicion that complex software was written in a way that unnecessarily hindered understanding and increased complexity, solely to give those who wrote it job security. Now that I'm older I know that's exactly what is going on.
The jokes on them, though. While that tactic does make it difficult to fire an employee, it also makes it impossible to promote them.
 
2:30 PM
0
Q: Usage of MVVM in iOS

IsuruI'm an iOS developer and I'm guilty of having Massive View Controllers in my projects so I've been searching for a better way to structure my projects and came across the MVVM (Model-View-ViewModel) architecture. I've been reading a lot of MVVM with iOS and I have a couple of questions. I'll expl...

0
Q: Twin Prime Algorithm Optimization

newhereI have wrote the following algorithm to print out the Nth twin prime numbers: def isprime(x): for i in range(2, (x + 2) / 2): if x % i == 0: return False return True inputIndex = int(raw_input()) tempIndex = 1 n=2 while True: if isprime(n) & isprime(n + 2...

0
Q: Appropriate design pattern for DB side-effect

thomasbtvI have a data access layer method to cancel an order. This operation should have an associated "operation history" entry. My first (naïve) implementation looks like this (pseudo-code): public void CancelOrder(int id, string reason) { var order = db.Orders.Where(c => c.id == id); if (or...

 
3:32 PM
0
Q: Ride that JavaScript structure using Knockout.js

IgaoI wonder if it is possible to transcribe this js framework for architecture in Knockout.js framework. Using methods like this: newMessage: function (message, userName) { *//Todo* }; See this: var chatR = window.chatR = { hub: null, user: null, init: function () { ...

0
Q: Ella-java-Chat bot...

AmbassadorI recently developed an interest in AI and thought I would develop this little chat bot, any recommendations/modifications ? import java.io.*; import java.util.*; import java.lang.*; public class Conversate{ private static String name; public Conversate(String name){ this.nam...

 
@SimonAndréForsberg ^^ That looks right up your alley!
 
3:48 PM
@Phrancis nope it doesn't... there's numbered variables..
and everything squashed into main,...
 
I mean, Simon is really good with AI (and tearing some ugly Java apart ;)
 
hmm true..
I'd not call that anything near AI though..
2
it's a predefined Question-Answer set..
 
0
Q: Using the Template Design Pattern to reduce code duplication between two algorithms

Dimitris KI have made a Skyline query solver which for now can solve the query with two different algorithms. The first is Block-nested loop (BNL) and the second is Sort filter skyline (SFS). The two are extremely similar. I will explain the basic things that are needed to review the part I am interested ...

 
@Vogel612 That's the nice thing about the A in AI .... it can mean so much, and be interpreted in so many ways
 
4:12 PM
0
Q: How to set a symbolic breakpoint on only some overrides?

nhgrifConsider the following code: class Parent { func breakMethod() { println("p break") } func breakMethod(#variable: Int) { println("p breakpoint " + String(variable)) } } class Child: Parent { override func breakMethod() { println("c break") } o...

 
Hey, @rolfl. Does this look good?
 
@Jamal Looks good, though the System.exit(0) is actually worse than not-needed, it's bad.
It short-cuts some 'normal' exit routines that should be run.
 
I see. I would've recommended return, though it was unneeded here. The only benefit may be to make it clearer that main() will terminate, given this convoluted logic.
C++ does have a similar function, exit(), and I believe one thing with it is that it doesn't call destructors.
 
The system.exit(...) method is one of those Java freak things...
It irritates me that there's not an int return code from main.
 
I was actually using it a bit in my Swing project, but eventually removed it. I ended up having my close button hide the window instead.
 
4:26 PM
also static code analysis tools usually mark System.exit() as problematic..
@Jamal closing the Application in swing is also one of these "wtf" things..
 
The entry and exit points of Java are the transition points from procedural to OO logic.
There's no 'good' way to do it.
Also, I am an old-school UNIX-style user, and the ugly way to do exit codes from Java is.... ugly.
 
@RubberDuck Nice one
 
I don't think we were taught about exit conditions in class. I believe all of my instructor's code follows normal flow with main() eventually going out of scope.
 
Just do something along the lines of Runtime.getRuntime().exec("shutdown"), it'll exit the application (eventually)
4
 
Haha. Yeah.
 
4:30 PM
@skiwi That is perhaps the meanest thing I have seen you do ... ;-)
 
@rolfl There's more harmful things if you're on Unix and running things with sudo rights!
 
how about Runtime.getRuntime().exec("echo exit > ~/.bashrc")
 
Not sure what that'll do ;)
 
meh...
rm -rf /
 
@skiwi try it ;-)
 
4:33 PM
don't.. you're not gonna start anymore
 
 
Well, don't (unless you have another way to get to root, and have a backup of your .bashrc.
 
Hmm I wonder if I have a Windows Service that on boot shuts down Windows, can I circumvent that via the safe mode?
 
I've shown my instructor my first set of unit tests, and he said they were good. :-) I am liking this better than some of our previous lessons. Now I'm just trying to figure out an ideal way of testing getters.
 
@Jamal my advice: don't
testing getters means your getters are doing something they shouldn't...
 
4:38 PM
0
Q: Edit configs script

setevoyWe have few configuration files, main from them looks like: # DEV main jdbc.main.url=jdbc:oracle:thin:@domain1.com:1845:SID1 jdbc.main.username=USER1 jdbc.main.password=ENC(blablabla) # dev rf jdbc.rf.url=jdbc:oracle:thin:@domain2.com:1845:SID2 jdbc.rf.username=USER2 jdbc.rf.password=ENC(blabla...

 
@Vogel612 Or you're going for code coverage... On the one hand it's obsessive to test them, on the other hand it should barely take any time
Answering Java 8 questions surely did pay off!
25
A: How to create an infinite stream with Java 8

skiwiYes, there is an easy way: IntStream.iterate(0, i -> i + 2); With as usecase: IntStream.iterate(0, i -> i + 2) .limit(100) .forEach(System.out::println); Which prints out 0 to 198 increasing in steps of 2. The generic method is: Stream.iterate(T seed, UnaryOperator<T> f); ...

Just got a notification for the silver badge ;-)
 
@Jamal My advice, do test getters. They are easy to test, and result in consistency and fewer regressions.
 
@Vogel612 We're told to test two specific classes, which have getters. I've already sent an email yesterday, and he may mention if it's needed or not.
Would I just test it by adding something and making sure I get the same thing back?
 
@Vogel612 everything that can go wrong should be tested. I once had a typo in the name of a getter, and never called that method anywhere else. Debugging that wasn't fun. After that, I wrote a few simple tests to assert the existence of my getter, and lived happily everafter.
 
@amon ... make your IDE generate getters... there is a functionality for that for this exact reason!
 
4:41 PM
@Jamal That's what I do, yes.
 
I'll try that, then. This class involves sending and receiving messages (between a customer and employee).
 
The value I see in testing getters is about using TDD, and easier regression handling.
The value of test cases is not only knowing where you have bugs, but also knowing how much impact small changes may have.
 
I may still get back to it after finishing the other tests. This isn't due until the 5th.
 
@Vogel612 it was something like getF0o instead of getFoo. Automating my typos doesn't fix them. Writing the same name in two different places does, because I'm unlikely to make the same typo twice.
 
Onto the topic of testing: Should integration tests be guided by something, or should it simply be one or a few traces through your application? (Assuming you actually do unit tests)
 
4:58 PM
If you have use cases or a requirements document, these can be a great starting point for integration test. Bug reports are another important source of test cases…
 
00:00 - 17:0017:00 - 00:00

« first day (572 days earlier)      last day (3461 days later) »