« first day (592 days earlier)      last day (3442 days later) » 

10:01 AM
@CaptainObvious That seems to be a load of questions in a question
 
10:12 AM
0
Q: Display multiple subtype objects in one page

greatmorroI have a base class with 3 sub ones: Item <-- Book, MusicCD, Software abstract class Item { protected $id; protected $title; protected $price; function getTitle() { return $this->title; } function getPrice() { return $this->price; } } class Book extends Item { private $au...

 
Always fun trying to make sense of your own code..
4
try (Stream<Path> files = Files.list(directory)
        .filter(uniquePathsSubmitted::add)) {
    files.forEach(path -> executor.execute(() -> handleException(() -> baseConsumer.accept(path))));
}
It's time to rewrite things!
 
10:27 AM
Wow man... I am happy I didn't read this before going to bed. :D — Phoenix 5 hours ago
answer to this
Feel free to wander around and browse and vote on whatever interesting C# questions (cough) you might find out there while you're waiting - if you find anything you'd like to say about someone's code, you can even write an answer and get imaginary Internet points! :) Welcome to Code Review! — Mat's Mug 17 hours ago
 
10:40 AM
@skiwi Lambdas in lambdas in lambdas tend to make things rather hard to read, whichever programming laguage you are using.
 
@Morwenn That might make sense...
It's slightly better now...
try (Stream<Path> files = Files.list(directory)) {
    files.forEach(path -> {
        if (uniquePathsSubmitted.contains(path)) {
            baseLogger().warn("There has been an attempt to add \"" + path + "\" after it has already been added.");
            return;
        }
        uniquePathsSubmitted.add(path);
        executor.execute(() -> handleException(() -> baseConsumer.accept(path)));
    });
}
I at least understand it again.
 
There is a work-in-progress C++ library which uses generic lambdas in generic lambdas in generic lambdas to run. Everytime my brain fails to understand how the basics work.
First piece of code here sums it up.
It's quite terse with lambdas, bu if you try to write the full template code that it implicitly generates...
 
@Morwenn Wait... what?
 
Reading it again, that wasn't right.
With the library, you can write int a = length(list(1, "5", '8'));
Where list is a lambda which takes arbitrary arguments and returns a lambda which, if given a lmabda, forwards the parameters of list to it.
 
You meant this beast?
auto concat = [](auto l1, auto l2) {
    auto access1 = [=](auto... p) {
      auto access2 = [=](auto... q) {
        return list(p..., q...);
      };
      return l2(access2);
    };
    return l1(access1);
};
 
10:50 AM
Well, I don't even want to think about it...
That's plain insane. But easy to use once written.
 
So...
Let others write insane code, use it simply?
Profit for everyone?
 
That's how C++ works.
There are library writers and application writers.
 
I feel evil now
> It is no longer allowed to submit the same file or directory twice to the checker, if this occurs it will be logged and the copy will be destroyed.
 
"Here, « undefined behaviour » means that it may delete random files if given an incorrect input."
 
@Morwenn lol
Today is the the day where stuff needs to get working on staging.... It consists mainly of trying a version, debugging, patching, building new version, repeat
Heh..I thought to check Meta for the rules but not look if in the wild any examples... thank you, I will suitabilize the code and make a post — aarosil yesterday
suitabilize sounds like a cool word, yeah
 
11:07 AM
0
Q: Making Multiple Copies of a Pattern

Dan AllenHere's a function for making multiple copies of a block of memory in another block of memory. It handles the case when the size of the target is smaller than or not a perfect multiple of the source pattern. #include <string.h> //This is where memcpy() hangs out. I know! I know! ///Fills a block...

 
^ Square of ASCII characters incoming.
 
CompletableFuture in Java 8 is awesome!
 
What does it add to a regular Future?
 
@Morwenn It makes it completable
You can also conditionally link them based on the status of another one
It's sort of async programming
 
Completable... Well, I woud have guessed I think.
 
11:16 AM
Still got to play with it later, and I'm actually needing it
I have a controller that dispatches an event and the controller wants to be notified when the event is done, and then do some other action
 
@skiwi This code:
    if (uniquePathsSubmitted.contains(path)) {
        baseLogger().warn("There has been an attempt to add \"" + path + "\" after it has already been added.");
        return;
    }
    uniquePathsSubmitted.add(path);
should be:
    if (!uniquePathsSubmitted.add(path)) {
        baseLogger().warn("There has been an attempt to add \"" + path + "\" after it has already been added.");
        return;
    }
 
@rolfl And that is exactly what is confusing me everytime I read it...
 
The boolean return value from add() is something yu should learn/know.
It is used all the time with COncurrent* classes
 
I "know" it, but it doesn't pop up at first glance
 
perhaps, but make it.
 
11:25 AM
Common "did it work return" idiom.
 
In part, yes.
But it is more a concept of an 'atomic' style operation too (which, for the Concurrent* classes, is exactly what it is).
Using the boolean return vaklue is twice as fast as the contains/add check as well.
 
If a function which does not have is, has or can in its name returns a boolean, it generally means "did it work?" anyway :p
Well, it's true that concurrency-related classes have these needs too.
I have to go.
 
Well, yeah, but the Map.put() method returns the previous value, and that's a useful option too.
 
See you later! :)
 
Bye
 
11:31 AM
Wow. 'Tis a bountiful season.
 
If you haven't seen it. There is a alignment bug on the Winter Bash site. If you have the rep on Meta, please vote for reopening the question.
10
Q: Winter Bash 2013/2014: Misalignment of the hat boxes due to incomplete CSS rule set

kleinfreundUpdate (2014): The Winter Bash 2014 site has the same problem as the site last year. Screenshot: What’s the problem? This CSS rule declaration targets only the 5th element in there: .box:nth-child(5) { margin-right: 0; } Instead, the margin of every 5th box should be removed: .box:n...

 
-1
Q: Write a program to de identify in java

user3776611How can I write a program to de-identify some data in java programming language?

 
@rolfl @Donald.McLean We are being watched!!
 
Hey Simon!
 
Ssssh monkey! POI time!
I'll be back in about 45 min ;)
 
11:40 AM
1
Q: Best action for reviewing a code-only answer

AbbasA bit of a situation for a review of this answer where I didn't know what the best action was. The answer has good intentions but could be improved by elaborating what the changes mean and why they are an improvement of the code. This way the OP can understand why this is an improvement. Thus, I...

 
12:04 PM
0
Q: Running Code Just Once

Kaveh ShahbazianI want a code run just once (say in Dispose). WriteOnceBlock<T> from TPL Data Flow could be used here; but again if we need to check if it is done (in a 'not data flow' friendly manner), we have to call Receive and timeout and things. I wrote this and it works, but I am not sure about when compa...

 
@rolfl Got a new version here :)
private void checkDirectory() {
    try {
        try (Stream<Path> files = Files.list(directory)) {
            files.forEach(path -> {
                if (!uniquePathsSubmitted.add(path) && !pendingSubmittedPaths.contains(path)) {
                    baseLogger().warn("There has been an attempt to add \"{}\" after it has already been added.", path);
                    FileUtils.delete(path);
                    return;
                }
                pendingSubmittedPaths.add(path);
                CompletableFuture.runAsync(() -> handleException(() -> baseConsumer.accept(path)), execu
Notice the CompletableFuture awesomeness
Can any C# guy comment on how much Java's CompletableFuture.runAsync approaches C#'s await keyword?
 
2
Q: WCF Duplex service authentication

PhoenixI have been thinking about a way to implement this and I am not sure that what I have done is correct, because it surely sounds kinda dirty to me. Basically what I have is a WCF duplex service which multiple clients subscribe to. My problem is the authentication. What I have done is I pass the u...

I'd really appreciate some help :)
 
@Phoenix Looks like an interesting question. C# is not my thing though
Note that Code Review tends to produce more in-depth answers than other SE stacks, as a consequence you need a bit more patience.... ;-)
 
Thank you for the input. I surely didn't know that. I am gonna give it a few days then :) If anyone with more C# experience here could also take a look, that would be great :)
 
12:24 PM
Hey, C# folk, check this out: WCF Duplex service authentication
4
 
Can I obtain the name of my class as a string so I can output a helpful error message like "Try java Class args instead."?
 
this.getClass().getName()
 
Doesn't work in static context, though.
 
Use the static field then:
Myclass.class.getName();
 
12:26 PM
I thought I understood CompletableFuture / CompletionStage, I was wrong
 
Shhh... download just complete. will wait for tonight to watch
 
Hey @Simon
@rolfl But than again I can hardcode the class name anyway.
 
@rolfl haha, alright. I'll say nothing :)
 
Code, y u no work?!
 
Maybe this is a different thing: Can I obtain the information what was entered to the command line infront of the arguments? In python the argument with the index 0 is script.py
 
12:28 PM
Yes.... gimme a sec...
 
@kleinfreund I am not sure, but this might be helpful for obtaining the name of the class ... stackoverflow.com/questions/936684/…
 
I read through it and it didn't really satisfy my needs.
All it does is either hardcoding the value anyway or using it in non-static context.
 
Ok :)
 
@kleinfreund use Thread.currentThread().getStackTrace()[1].getClassName()
4
A: Is it possible to get the class name from a static method?

banjollityYou can do it by creating (not throwing) a new Exception and inspecting its stack trace. Your class will be the zeroth element as it is the origin of the Exception. It kinda feels wrong, but it will work. System.out.println( new Exception().getStackTrace()[0].getClassName() ); You can do the ...

 
Oh... I'm starting a deamon thread and then I terminate the main, that might explain why the program doesn't work as expected?
 
12:31 PM
Holy macarel, that feels like a dirty hack to me.
 
I like it dirty ;-)
2
 
@kleinfreund Here's a hack for the moment:
    public static final String getMainMethodClass() {
        String mainclass = null;
        for (StackTraceElement ste : Thread.currentThread().getStackTrace()) {
            if ("main".equals(ste.getMethodName())) {
                mainclass = ste.getClassName();
            }
        }
        return mainclass;
    }
Only works if run from the main thread.
 
Alright, good to know.
I guess that would be overkill for a small thing that just checks if the arguments are palindromes. :D
 
Alright, I'm going to write a competing answer to Jon Skeet, wish me luck.
 
0
Q: Easy application in delphi to check - triangle condition

pitcairn1987I got one simply buggy project to check. I've never had nothing with delphi before, but I think it's pretty easy to analyze. Application check from given sides if the triangle is scalene, equilateral or isoscolese. It uses from triangle condtion: http://www.basic-mathematics.com/triangle-inequali...

 
12:34 PM
Wait a minute, what is the actual problem here, @kleinfreund? What are you going to use this for?
 
Ah, that wasn't even the palindrome thing, sorry.
 
Presume having a gheneral 'Usage' message that does not know which Java class main method it is running from
 
It's a program that outputs the value at a certain position of a Pascal's triangle.
But if one enters the column number higher than the row number, there won't be a value. I'd like to throw a error message stating that and suggesting doing it vice versa.
so instead of java Pascal 3 4 I want to suggest java Pascal 4 3.
 
@kleinfreund So you're using the args parameter of main(String[] args), right?
 
Can you add some client related code, like connecting and disconnecting ? — Heslacher 19 mins ago
Looks like @Heslacher is going to beat me to that one too... =;)-
 
12:38 PM
xD I just updated the question :)
 
@kleinfreund You want to retreive that "java Pascal" part, that's your problem, right?
 
Yeah, that's it.
 
feels like what @Phoenix and @rolfl are talking about is completely unrelated to what you are asking for
 
And yes, I use args.
 
for example, if you run the program with "java Pascal" or "java directory/Pascal", you want to output that, right?
 
12:39 PM
11 mins ago, by kleinfreund
Maybe this is a different thing: Can I obtain the information what was entered to the command line infront of the arguments? In python the argument with the index 0 is script.py
 
@Phoenix Hey there! Welcome to CR and the 2nd Monitor!
 
@RubberDuck Thanks a lot :)
 
@Simon Yeah, that'd be bulletproof.
Now I'm just guessing that it was java Classname args.
 
ok, so we're talking about two different things at once here...
 
@SimonAndréForsberg directory/Pascal? Smoking docs again?
directory.Pascal FTW
 
12:41 PM
@kleinfreund This might be related to it:
7
Q: How do I get the commandline that started the process

aksamitFrom Java, is it possible to get the complete commandline with all arguments that started the application? System.getEnv() and System.getProperties() do not appear to contain the values.

 
That does not get the class name, but gets the -Xmx and -D style arguments, and so on.
 
Yeah I asked the wrong question in the first place.
 
@rolfl not smoking anything at the moment. just eating pills (for my temporary illness, not anything else!)
 
@Phoenix - I purged the comments from your question, they were all just.... "chatty"
 
Yea you are right. That's ok.
 
12:43 PM
+60 on MSE, +10 on CR .... ;-) ;-(
I am somewhat disappointed in you all.... noone has commented on my new avatar.... ;-)
 
@rolfl Is that you in the picture?:D
 
@rolfl I just saw! Couldn't see it last night on mobile chrome.
 
It's the mod monkey!
 
Grats! Well done.
 
xD
 
12:45 PM
Mandatory pimping:
0
A: Java Equivalent of C# async/await?

skiwiThis is actually possible since Java 8, with the following code, there are two different variants possible, however they do not rely on language features, instead they rely on the CompletionStage<T> and CompletableFuture<T> classes that got added in Java 8. You can do it by using the following c...

 
@skiwi Wow can't believe they have actually added a way to do that. It was one of the things that put me off when I was deciding on studying Java.
 
@Phoenix I hadn't really realized it either yet until today, when I actually needed such functionality
I can't even believe that I missed it, as I'm quite a big Java 8 fan!
 
Well, in my experience you never realize a feature exists till you need it :)
 
I may even have code around that emulates it in dirty ways
 
Been there done that xD
 
12:53 PM
@Phoenix In my experience, you only realize it exists after you have spent hours implementing the functionality yourself, and then some brat says: Hey, why didn't you just use FeatureABC?
 
@rolfl This has happened so many times to me before that I now first search and then turn coding monkey mode on
:D
 
It's really easy now to build asynchronous execution trees
Not that I need it, but still
 
@skiwi Are you sure that gives the same functionalities as C#'s async/await?
 
@SimonAndréForsberg Pretty sure
 
I'm not entirely convinced... yet...
 
12:55 PM
@rolfl Still though, sometimes I have a lot of fun implementing something cool, even after learning that it has already been included in the language.
 
I'm reading C#'s tutorial on async/await now
@SimonAndréForsberg I see what you mean, I'm wondering about it too now
You want to be able to start the request in the background, then execute your code and after that wait for the result and process it
 
Why are younger, smarter programmers automatically brats</sarcasm>
 
Depends how young you are talking about :D
 
@Phoenix Is your SHA1Generator returning the same hash for each call for the same input ?
 
@SimonAndréForsberg This does work:
public static void main(String[] args) throws InterruptedException {
    CompletableFuture.allOf(
        accessTheWebAsync().toCompletableFuture().thenAccept(System.out::println),
        CompletableFuture.runAsync(() -> System.out.println("test"))
    ).join();
}
 
1:05 PM
@Heslacher Yes. I believe it is. It is basically a function that I found on stackoverflow, edited a little(nothing breaking I believe) and added in a service class. I can post the code of it if you want me to.
 
It simultaneously executes the async task and a local task, and then returns when both have completed
 
@SimonAndréForsberg Amazing episode.
Greetings, Programs.
 
@Phoenix You can post it if you want
 
Ok. I will update the question :)
 
0
Q: Parallel for loop in Java 8

coderoddeThis is my first attempt to provide some syntactic sugar for doing mutually independent loop iterations in parallel. Thanks to Java 8 lambdas, I can write the parallel loops in pretty elegant fashion compared to pre-lambda Java's. Also, I have declared the actual forp as synchronized, which lea...

 
1:07 PM
Does anyone know a good (and still simple) usecase for async execution?
 
I've been programming professionally for a year, but I've the confidence of a 12-year-old know-it-all.
 
@Donald.McLean You have been watched, programmer
 
@skiwi You mean in C#?
 
@Phoenix In Java, but it's actually language independent
 
1:09 PM
MSDN really should start SEOing their URLs
 
Does brat mean Being Right All the Time?
 
@nhgrif I don't know. You tell me.
 
@SimonAndréForsberg Yes
I think my answer is mostly correct, except execution differs in C# vs Java
 
@skiwi the example of fetching a webpage seems good and simple enough to me
 
@SimonAndréForsberg I need something more interesting for a CR question!
 
1:10 PM
@skiwi Oh, I see. Well I can give you an example of when I needed it. I was making a youtube video downloader. And so as not to block the UI, I ran the download using an async call. The downloader also had a progress event which led me report progress and it turned out quite awesome. Wouldn't be able to do it otherwise without manually handling threads.
 
I like the way Objective-C handles this sort of stuff.
 
Well it wasn't just a downloader. It also merged the downloaded videos into one(think about having lyric videos of a full album) and let's say compression didn't turn out so well and all of the videos(even the shortest ones with low quality) were like 50 GB at the end of the process :D
 
@nhgrif Because we think we're Gods when we make the computer dance.
 
But it worked :D
 
@Phoenix still sounds cool
 
1:13 PM
It was a fun little 12 hour project :)
 
0
Q: Sum up all my web requests and make them static

testingI want to summarize all my web requests on one place to prevent duplicate code. Then I would have a central instance with which I can make my web requests. Therefore I thought I use a Request class with static methods. For the web requests I need some data. Currently I have stored these data in a...

 
@Phoenix As in, one day?
 
Thanks @Santa, I have no idea what happened, but I now have 2k rep :D
 
Poof, there goes 100 of my reputation!
 
Well yes :D It wasn't that difficult. I used a third party library for the downloading and another for the conversion so most of the work was already done for me and I was left with the fun part - practicing MVVM and linking everything together.
 
1:16 PM
11
Q: Memory with a twist

Simon André ForsbergDescription This is the good old game Memory with a twist: Every time you pick a wrong pair, the two tiles you chose will switch their location. So sometimes you might think that a tile is at one location when in fact... it has moved. And it might feel like you have no idea where it is anymore. ...

 
I'm thinking... Maybe it is possible to have parallel fibonacci computation without memoization? (Not efficient)
 
@skiwi And you said downloading a webpage was not interesting?
 
@skiwi Well I believe people are already doing this on multiple cores. I don't know about memorization though
 
I'd be very interested in making my Minesweeper analyze code multi-threaded, but that codebase might be a bit complex and difficult for you to work with @skiwi so I won't ask you to use that :)
 
@SimonAndréForsberg But you just implicitly asked by not asking
 
1:19 PM
You are welcome to try if you want to, but it's definitely not a "simple" use-case for it
 
The fibonacci example actually is kind of recursive, but not quite
 
The Minesweeper thing is also more of a multi-threading issue than a direct async/await one
 
I'm tempted to get my hands on it asap, but I should produce some working code at work as well
Now I think about it, there's so many ways to implement Fibonacci calculations
 
0
Q: Why does malloc fail to allocate more than once?

Nass SI coded a simple source. It contains a queue and some of the function a queue needs but for some reason malloc() only works once. #include <stdio.h> #include <stdlib.h> #include <string.h> #define QUEUE sizeof(Queue) typedef struct node { char * value; struct node * next; } Node;...

 
1:31 PM
@SimonAndréForsberg What's CH?
 
change hat
 
Ahhh
I finally have discovered a pattern with my bug... It only happens to the large files
 
TTGTW
 
What is TTCH and TTGTW?:D
 
2
Q: How could this string parsing/stripping code be improved

arcomberI am mostly interested in how the parse_string function could be improved. But any comments on my test strategy also welcome. The input is a string which can be either all digits in which case the result should be the digits string OR there can be string formatting outside angle brackets which ...

 
1:43 PM
I'm actually not sure if the Fibonacci sequence is a good example... Because it has a tree that is constructed from top to bottom, I kind of want something that can be constructed from bottom to top
 
Gonna be heading out. TTL
 
@skiwi lol, we're doing some tasks around the Fibonacci sequence right now. I just gave the chat a quick look look and the first thing I see …
 
@kleinfreund haha
 
good morning
 
Ah, with work I'm back to my old problem...
I cannot access a file yet if it's been created, but still is being written to
 
1:48 PM
@Phoenix TTCH = time to change hat, TTGTW = time to go to work
 
I'm writing inventory auditing code this week...
 
-1
Q: Java Improving code efficiently

mirakve used the following function in one of my programs. I have tried to make sure that my code is efficient however I cannot find any help online to tell me how to recognize where I could improve... Is there any one that can help identify if there are any parts of this where I could improve (make...

0
Q: refactor for each loops

user34377211 down vote favorite I have 2 objects and I am comparing them to see which fields are equal and which are different. But I am not sure my loop is 100% correct. Does this look ok? If so, what other ways could this be coded to make it 'neater'. e.g. using LINQ I want to: loop through each Docum...

 
2:20 PM
Is this actually safe?
while (FileUtils.isLocked(path)) {
    try {
        Thread.sleep(checkLockTimeout);
    } catch (InterruptedException ex) {
        Thread.currentThread().interrupt();
        break;
    }
}
 
0
Q: Mailinator automatic checker for new e-mails

confused00I'm doing a little script to run on the background and notify me when I received a new email in a mailinator inbox. I want to eventually daemonise it, but for now it just runs like a regular script. Could you give me some pointers about the code itself, the code structure and so on? I'm not sure...

 
@Phoenix Homework ;-) : Code Review Memes
 
Great...
I have a solution, I'm now looking for a problem
 
Sounds like JD
 
@skiwi That sounds like a problem in and of itself.
 
2:33 PM
As an aside...
> Result of integer multiplication cast to long
How is that even a bug? ^ (FindBugs)
Do I look like I want integer overflow to occur?
 
Cast one of th integers to a long before the multiplication, don't cast the integer result after the multiplication
 
Oh, that's sneaky
 
   (long)(intA * intB) ... not the same as (long)intA * intB
I really like findbugs....
Can you imagine trying to debug that 'for real'?
 
@rolfl I can imagine it not being fun
 
I've heard making threads sleep is not good practice.
 
2:49 PM
We're under a "code freeze" for 30 days, is this common practice to have a code freeze in a company? Just curious.
 
@Phrancis Yeah. Common practice for IM to go into a freeze this time of year.
We're pulling teeth right now to get some critical work done.
I am curious though, why do IM groups go into a freeze this time of year? Anyone know?
 
Perhaps having to do with budgeting?
 
Because the fallout of a bug being introduced when many people are on holiday is worse than the delayed release of the code.
3
 
Ah, that makes sense
 
Yeah. That does make sense.
So, it's more of a "release freeze" than a code freeze.
 
2:52 PM
Well, I have seen 'freezes' of various sorts. Feature freezes, release freezes, commit freezes, etc.
Code Freeze has happened before to me, but it's a signal that there should be better revision control and branching used.
but, branch-management on a corporate scale is not as simple as the git tutorials make it out to be ;-)
2
 
Merge Conflict hell.
 
@RubberDuck What does IM stand for?
 
Information Management
 
That ^
 
Ah okay
 
2:55 PM
how do I search for questions with more than 10k views?
 
But I'm pretty sure they recently decided that they're Information Technology again.
 
@Malachi Carefully ;-) ?
 
@rolfl your profile pic looks funny without the hat.....lol
 
You see my meta post?
 
not yet
 
2:55 PM
You know, I still can absolutely not believe that not a single course on the university (in Computer Science study) teaches us anything (useful) about version control
 
just sat down
 
user image
3
 
@skiwi CS degrees aren't meant to teach you how to be a functioning programmer.
 
Looks good to me.
 
2:57 PM
In fact, I'm not convinced that any college degree will actually make you a useful, productive citizen.
 
@Heslacher Thank you
 
no problem, used it myself
 
7
A: Winter Bash 2014 Secret Hats

rolfl Fascinating, Ma'am Awarded for up-voting a question where: score 25 or more (based on other's experience... must be more than 15, 25 works for me). Accepted answer Score seems relevant, but as low as 15 works too. May be a lower threshold - accepted answer not needed. At least 10,000 views (...

 
@rolfl oh yeah I saw that. is why I am looking for those questions....lol
 
@RubberDuck We do have projects, etc. to teach that... Except version control
 
2:59 PM
@RubberDuck they're not?
 
Then you're going to a particulary good program.
2 mins ago, by RubberDuck
In fact, I'm not convinced that any college degree will actually make you a useful, productive citizen.
 
We have a final project at the end of the Bachelor where you need to make a product for a customer in 8 weeks
 
@RubberDuck I am trying
 
Which includes an User Requirements Document, Software Requirements Document, Architectural Design Document and more
 
Maybe they're finally catching on that it's nice to know all the theory and know how the machine works on a very low level, but it's more useful to know how to actually write a program.
I just know that I know a few CS majors that can't code their way out of a paper bag, but think they know it all because they're a CS major....
 
3:01 PM
It's not bad per se, but still too much theory if you ask me, I would most likely not start again on university
@RubberDuck Oh, tell me... Hell, you know why they survive?
 
yes I got it!
 
Most coding projects are group work or it is very easy... And in group work they can write the "boring" documentation
 
@skiwi No clue personally. Corporate worship of pieces of worthless paper?
hahahha....
 
Oh, as for actually surviving in industry... Not a chance
 
I don't have a CS degree though. I have an AS for Programming and Application Development. I don't think that I learned enough from it
 
3:03 PM
Just to be clear, I'm not generalizing all CS majors here. Just the ones I personally know.
 
(At least not as programmer)
From working a day a week I have learned that it is actually very very very useful to create an architecture before you start programming
2
 
any Slitherin snakes see this wonderful Python Answer (Zombie Killer)?
3
A: Python package for handwriting recognition

feradaOverall I think this is good quality, if a little dense code, by which I mean that since there is lots of functionality there, it's not the easiest code to follow. One suggestion I have for that is more grouping according to topics. So e.g. the utilities could just have a couple of sections for...

 
It's the same in other areas of business though. Kids come out of 16 years of school thinking they're ready to take on the world and still don't know jack about how to do a job. Our schools don't do a very good job of preparing people for work.
@skiwi Switching to TDD taught me that.
It's hard to force yourself to do, but it's worth the results.
 
@RubberDuck Nobody taught me that... On university you only get it in your last year and here at work the focus is more on working code
Things get worse when you start piling features
As an example I currently have an application that queues documents and has N threads to work with
Today I found some spontaneous exceptions that had to do with the file being in use by another process, so I decided that it would wait until it was not in use anymore
(It is not bad per se to have a file waiting forever, there are other applications that make sure that someone is notified when a document is "stuck")
But every document that is "stuck", does take up a thread in my architecture :(
 
Lame.... speaking of architecture though. Have you seen this?
 
3:09 PM
And I don't see an "easy" way to fix that
Nope... can't check right now though
 
It's long (about an hour), but well worth it. Uncle Bob talking about clean architecture.
 
3:20 PM
what is the Java Standard for bracing around else statements?
 
if (condition) {
    ...
} else {
    ...
}
 
@skiwi I hate that aspect of the real world.
 
@RubberDuck Enforcing TDD is harder though when you are working with "untestable" things
 
@rolfl okay that is how I wrote it. I couldn't remember if it was that else got a new line or not. Thank you
 
@Malachi The working code part?
 
3:23 PM
@skiwi That's the whole point of the lecture. He talks about how to design your system so there aren't as many untestable things.
 
@skiwi yeah focus on the code working rather than if it is Maintainable or Clean or ....
 
Sad fact.
 
true that.
 
0
A: Memory with a twist

MalachiI would make some changes to this code private void clicked(FieldView view) { if (view == previousClicked) { return; } if (timerRunning) { return; } if (previousClicked != null) { boolean same = previousClicked.getValue() == view.getValue(); v...

there I go answering another Java Question.....
we are within 20 hats of Physics! how do we get more users involved.
how do we trick them into getting hats?
 
@Malachi Give them spare time and motivation
2
 
3:29 PM
I keep forgetting to use my Tablet at home.....
 
Wow @Morwenn, that document you linked really has some black magic in it...
auto fromto = [](auto start, auto finish) {
  return [=]() mutable {
    if(start < finish)
      return start++;
    else
      throw std::runtime_error(“Complete");
  };
};
auto range = fromto(0, 10);
range(); // 0
range(); // 1
Also the wording used is interesting...
> Write a function twice that takes a binary function and returns a unary function that passes its argument to the binary function twice.
 
and a Selfie on a Question with good answers all around. codereview.stackexchange.com/a/73953/18427
 
0
Q: Can anyone further optimize this SQL query to run faster?

Jamie DeakinThe end result I am trying to achieve is an array containing the total ordered qty for each product. I have been successful but the query takes about 20 minutes to run and I'm wondering if there is anyone who may know of some way of improving this? The details and current query are as follows: A...

0
Q: Compose nested EventEmitters elegantly

Brandon HorstI am developing a server-side JavaScript tool, and trying to do so in a modular way. I have a Parser class that is an EventEmitter - you call parse and it will eventually emit data and end events. It is generally invoked like so: var parser = new Parser(options); parser .on('data', handleDat...

 

« first day (592 days earlier)      last day (3442 days later) »