« first day (445 days earlier)      last day (3576 days later) » 

1:00 PM
I actually have done that already for my service layer...
for locked records....
 
I still don't see why it should be wrapped in a BrokenCodeException in ModelConverterFactory.createConverterFor, if you leave them as regular RuntimeExceptions your program will die as well.
 
@skiwi point taken..
 
And in your case all you want, is your application to die.
 
I still think I should keep them separate though... not every RuntimeException requires code modification...
 
It's something that should be verified on compile-time, but that ain't easy to do and totally not in proportion with time spent on it.
 
1:03 PM
@skiwi actually no. I additionally want to be able to notify the user, that the problem will persist and also occur the next time he starts the application..
that's not implied when you have a RuntimeException.
 
ahh all those people being killed off on the right
what's happening
 
@Vogel612 Then you should handle all BrokenCodeExceptions at some outer point in your application... But I don't know how your application is exactly built and how that would work
 
@skiwi the problem is, that it's a web-application, that's running on an Application Server...
so I just deploy it into a container...
and the container handles the execution..
the code I can control is not central, but a collection of similarly working and interdependent classes, that have no main-method.
 
I see, on Tomcat for ex?
 
exactly.
on jBoss FWIW.
 
1:06 PM
I like what you did with that self answer @Jamal, it makes sense!
 
You should be able to modify how exceptions are handled, is my guts feeling
 
yeah there probably is a configuration buried in the JBoss where I can specify a Bean to handle exceptions..
but it might be good not to shut down the whole application server for one broken app...
 
I would really advice you to do that, except that it introduces a new problem
 
especially when there are multiple apps running on it..
not that it would be a problem in my specific case
 
Then everyone using the code would need to also have that custom error handling bean
 
1:08 PM
well I could package that bean into the application...
 
Hm okay then that point would be fine
 
but then everyone using the code would need to adjust his jBoss config....
 
@200_success Huh, nice
 
But these things always horrify me a bit:
} catch (IllegalArgumentException e) {
    Log.doLogError(e.toString());
    e.printStackTrace();
    throw new BrokenCodeException(
            "Could not instantiate ModelConverter, because the Arguments didn't match",
            e);
I don't see why you should log them there
I would just let them bubble up and let the container log them
 
@skiwi so you suggest I just wrap and throw instead??
 
1:10 PM
(Isn't that what tomcat/jboss does by default?)
 
actually it is, but afaik the application will not be shut down by jboss..
hi Monking @MadaraUchiha
 
Is there any harm in having the application alive when in this state?
 
o/ Monking
 
@skiwi it won't work either way...
at least concerning all other BCE's I have in my code..
 
I suspect you boot up the server after a change, then test all your pages, if no error -> everything is fine, if error -> fix and repeat?
 
1:12 PM
a little more complicated, but in essesnce, yes.
 
So the error is spotted anyhow
 
it's actually a development helper fwiw..
 
What is fwiw again? :p
 
for what it's worth
 
ah
 
1:13 PM
would never roll out with BCE's left...
because when we have conditions that signify development errors, we shouldn't roll out ;)
 
LOL
@DavidK Pretty soon we'll have created base-onomatopoeia (as opposed to that god awful base-10 used by mainstream mathematicians). — Pharap 2 hours ago
 
I've used functions like showDevelopmentErrorMessageBox(message:String) when publically beta testing
it was used for things that shouldn't happen
 
I think this whole discussion and BCE's are not needed if you have proper unit and integration tests everywhere
 
@skiwi correct....
 
Now having proper unit and integration tests in lots of companies is unfortunately mostly a myth :(
 
1:14 PM
we just recently (1 month or so ago) introduced unit-tests...
our integration tests are a total joke (read don't work)
 
been doing it for years .... ;-)
 
and the coverage is ~14%
 
not a myth
 
Fixed my statement, it was missing something!
Code coverage sucks
 
after I spent 2-3 months on getting some unit-tests written and creating a whole new layer in the broken architecture...
 
1:15 PM
I don't really like that metric anymore
Currently my program at work is also a bit 'broken', but well cannot just fix it
It has no unit or integration tests pretty much apart from trivial things
I test it with running 200 invoices through it, and see if there's exceptions, then change to a new batch
The key difference in my application is that it is normal to fail and fall back to manual mode
 
WOMM testing is best testing
 
@200_success I am trying to read that...lol
 
Suppose it's in production for a few months and it logged a bunch of errors, then I will investigate to fix them, ensure there's no regression, and run again
 
Because my program depends on so many external factors and libraries I'm goign a bit crazy
@Pimgd Unfortunately this comes quite close to it
 
1:18 PM
it's even endorsed by a (former) stackoverflow developer? That has to count for something
(/sarcasm)
 
But I don't know hwo to write my system in another way, the input is random, the intermediate steps are not determined and the output is undetermined
Input is some PDF/TIFF file, then goes into OCR, and then produces data, or not.
 
ahh...
Unit test for working images then
Get image that is correctly parsed, and if so, keep it
 
I can test the working things yea, it's something I will consider
But the OCR gets more tricky already, because output can change if the OCR gets updated
 
and keeping the broken things in there might be good too
maybe they'll suddenly succeed after an update
 
I don't have time in my planning atm, but I might add them
 
1:21 PM
@Mat'sMug I don't think that stuff got sent out when it was supposed to be sent out.
 
I was planning to do some kind of automated tests either way
But I think I can only go as far as verifying that an image leads to some expected output, and cannot really unit test it
So a failure is neither a blocker, just say a success rate
 
You could write 10-25-50 of those tests (don't have to be separate functions)
 
Even if say files got stuck in my system or files would get deleted, then there are even outside guards that prevent the file from being permanently lost.
 
and give a minimal % rate
it has to get right
and maybe move that up as the OCR algorithm gets better
 
Minimal rate would be something, but I don't think I can just package that into a test
Or maybe I could
Or instead of normal tests, I create a program that shows the success rate and can be ran once the tools have been installed
Say it hits 70% success rate on my machine, then once installed on the staging server it should also give 70%
Though odds are they will be different depending on the memory configuration ;-)
 
1:26 PM
well they most certainly shouldn't be lower
that'd be a sad result
 
Then they need to add more RAM perhaps :p
So they'll be tests, but I am not going to use them as regular tests (which you usually run after every change), because they could take easily an hour
 
okaaay
 
Like a few months ago on an older version, I would test 14 invoices manually after every significant change to test for regression, and that took like 30 - 60 minutes already and was awful :P
 
that's different from what I expected
are you reading entire pages at once or something
 
Yeah it's recognizing data on invoices (sender/receiver/prices)
 
1:30 PM
if only people just printed a QR code that contained the contents of the invoice on the invoice
 
Like 4 months ago I started to rewrite the proof of concept from scratch, and now progressing on that
Working like one day a week there, rest university, now in vacation 2 days a week
Don't forget the minute of silence on 4pm here :(
 
Oh yeah
 
What is the data density of a QR Code?
 
not good enough, considering it would also have to contain the QR code itself =D
 
And invoices are already scanned in horribly mostly :/
 
1:35 PM
yeah but QR code comes with a checksum
so you know it's scanned wrong
 
The digital approach would work better
 
There is already some open format for sending invoice data to applications
 
"Ah. Now back to bill presentment. Remember bill presentment?"
 
Had a funny situation yesterday
The data coming from the database didn't validate in my Organization class in my program
There's things like VAT and IBAN number validation
 
1:37 PM
Skiwi.
 
Turns out some data in the database (not mine) is not a valid IBAN number, ugh
 
Oh no, I heard someone call your name in a super serious tone
 
It will (need to be) fixed though before the system goes live.
I was more calling others out
I'm too new though to do any real calling out
 
@HassanAlthaf 'sup?
 
But if you know an IBAN consists of letters and numbers only, then why is there no freaking trigger in the database that raises an error if you try to insert spaces or colons or whatever
 
1:38 PM
Nm, you? @Vogel612
folk folk folk folk folk folk folk folk folk
 
vogel612 is confused, it cannot attack
 
LOL
Pokemon
 
NM????
 
@skiwi please fill about Database RFC forms 1109, 1135 and 1139 - DBA
 
Nm = Not much.
 
1:40 PM
confusion resolved, preparing answer:
response: NM either. should be copy pasting content to a joomla site.
 
@Pimgd I'm not familiar with that I'm afraid
 
wtf dude.
You're drivin' me crazy.
vogel612
system.out.println('Hello, world!');
Your language.
Console.Log "Hello, world!";
I mean
 
@HassanAlthaf you could @him...
 
@skiwi I've read too much daily wtf
 
@Vogel612 that system.out.println('Hello world!');
 
1:42 PM
Where people have trouble with over-protective DBAs where if you want to change something in the database, you better be prepared for some resistance
 
Is your language right/
 
(cause how dare you, a mere developer, to meddle in database affairs)
2
 
capitalize S, and then it is
 
Guys suggest me to code something in JavaScript
 
1:43 PM
I haven't coded anything in JavaScript since a while.
 
@HassanAlthaf suggesting you put up your calculator for a review instead..
 
Vogel, working on it. ;)
@Vogel612 www.HassanTech.org/downloads.php
My old C# Calculator.
 
@HassanAlthaf it's "downloads" and you are using overly many exclamation marks in your "about me"
 
Hi @kleinfreund
lol
Vogel, idk how to write content.
 
also I am not gonna download the source for your old WPF calculator ...
 
1:45 PM
I suck at it, lolz.
 
dito,...
 
It's perfectly fine dude.
Nah, this is completely different, dw.
My old calculator only allowed 1+1 or 1-1 or 1*1 or 1/1
My new calculator can allow 1+1-1*1/1
 
confusion ensues, getting a coffee and some more water.
 
lollllllll
Time to test what I have coded. :)
Almost done xD.
 
@Malachi See, ternaries can be easy to read.
I saw your answer before I saw the ping. =)
 
1:53 PM
so I bought a donut to eat as snack
but it's completely squashed =/
cause I put it in my bag wrong
now the donut is flat and stripped of glazing and the bag is a glazed mess
I feel cheated
 
@Pimgd this reminds me of my "Don't tinker with input" rant..
you can scroll over the most part, but hey: codereview.stackexchange.com/questions/56406/…
 
the part where I felt cheated reminds you? Or just donuts
There should be a minute of silence for my flattened donut
 
Atlast done coding.
 
the part with feeling cheated..
 
/reading
 
2:02 PM
Time to test.
I am so nervous Vogel
fkkk.
its not workin
 
if (!found) {
    continue;
}
//other code
why is that a code smell
reducing indentation level if you have a couple of those can actually be helpful
keeps everything readable without having to scroll horizontally
do {
    //stuff
} while (persistentIndex != startingPersistentIndex && !valueToUseNotFound)
double negative
 
Greetings, Programs.
 
Donald!
 
Guys, can anyone get post me a stackoverflow question?
 
Programs says hi
 
2:07 PM
I am blocked from asking questions on stackoverflow.
 
1
A: Refactor a code of selection a validator

Malachithe if statements look really messy to me, I would much rather put this into a Switch and use 2 ternary operator statements so that I am only performing if calculations when I absolutely need to. using the switch I was also able to get rid of the boolean variable and the assignments to that va...

 
Please?
 
err
I'm just gonna assume there is a pretty good reason you are blocked from asking questions there
2
It might have to do with very short, unclear questions
 
Hey Donald, just completed a complete reread of The T Saga.
 
or duplicates?
 
2:08 PM
for (var channelOrder = 0; channelOrder < channels.Channel.Channels.Count(); channelOrder++)
{
    channels.Channel.Channels[channelOrder].SortOrder = channelOrder;
}
Channels huh
 
... That loop would be much easier to understand if you stuck channels.Channel.Channels in a temporary variable
 
Channels channels = channels.Channel.Channels
hi
 
I can't redefine channels!
 
oh right
Channels CHANNELS = channels.Channel.Channels
 
And I already have currentChannel inside the loop (but you don't see it here)
Ah yes. Much better
;)
 
2:10 PM
lol
 
... channelChannel
more seriously, channelCollection/list/array/vector
 
@rolfl What a coincidence. So did I.
 
The problem is that it's like the 4th time or something.
Do I need counseling?
 
@rolfl depends, what's the T saga
 
Hey @Hassan, hey everyone else. :)
 
2:15 PM
what does it do
 
@Pimgd Vampires and werewolves... ;-)
 
what does it not do but you wish that it did
@rolfl yes you need counseling
 
@Pimgd Ah, I doubt that'll be the case here
 
57 messages moved to HassanSupport
4
 
205 new messages
not sure that was before or after the move though
(thanks for that btw, @rolfl)
 
2:26 PM
Yeah, sorry
Kinda went along with the flow
 
Damn, the ceremony was impressive.
 
Don't worry. You seem to be doing alright here, @Pimgd.
 
C# Coders
Get ready to give a massive review! :)
 
can I just blam the code with holes
 
Wow. Chat's been hot lately.
 
2:30 PM
yeah
 
No, that's just me getting back in my annoying habit of replying to everything
in half sentences
that are spread up like that because it feels natural to me
 
You'll get used to writing proper sentences soon enough :)
We don't want to enforce it or anything, but if you see 90% of the people writing differently, you'll get used to it
 
or...
 
I guess so. I've been hit a couple times already with "you can retry this action in 1 second"
 
not
 
2:33 PM
That's probably intentionally from the SE guys then ;) I know the message as well, even I get it sometimes :/
 
Hello, World!
 
World says hello back
 
@Phrancis Nice I see your image now! Hello!
 
Well hey there @Marc-Andre
 
2:37 PM
At this point we might as well create a new programming language dedicated to FizzBuzz problems and its brothers.
 
Something like HQFB9+
 
or FB+++
 
0
Q: C# WPF Calculator Code

Hassan AlthafI've coded a Calculator in C# with WPF as the UI. I wish to know mainly about this points: Ways of optimizing. Better techniques, tactics and ways of coding this. All flaws on the surface as well as deep. Simpler logic MainWindow.xaml.cs using System; using System.Collections.Generic; using ...

 
Not sure if you get the joke
 
Pimgd.
Where did ya learn C#
 
2:39 PM
I didn't!
 
@Pimgd I know of the old one for the bottles of beer it is, right?
 
Pimgd
Ikben
What does that mean
In Dutch.
 
@skiwi yah HQ9+ is for code golf, it prints hello world, 99 bottles of beer on the wall and it's own source code depending on the characters in the source file
 
Guys, how do you have multi pages in an app.
 
Hassan you might want to slow down your questioning
and kinda keep them on topic
 
2:41 PM
Like, if you press one button, it goes to one page, and if you press another button, it goes to another page?
Oh, sorry, Pimgd. I am just too curious.
I started refreshing my mind in C# today morning.
 
@HassanAlthaf Could you please ask less questions and start to read the official documentation for whatever programming language you are working in? It would be best for all of us.
 
Ok, sorry.
I'll work on something with JavaScript.
 
@Pimgd I get the joke, but we don't need the hello world beer and source! Just kidding, we need the beer.
 
@HassanAlthaf You have already been been told by one moderator — this is not a support forum.
 
@HassanAlthaf have you tried Stack Overflow?
 
2:42 PM
@200_success thank you for the review, lots of great comments there!
 
@HassanAlthaf go review some Javascript questions, you'll learn something =)
 
Or rather, have you tried learning yourself? :)
 
@Pimgd because it's around the bush and from behind... The intention of the code is not clear IMO... you should be able to formulate that clearer (read, not need a continue;)
 
@MadaraUchiha I am banned from asking questions in Stack Overflow.
 
@HassanAlthaf And why's that?
 
2:43 PM
@MadaraUchiha mostly my questions have only 0 or 1 reputation on Stack Overflow.
 
@HassanAlthaf And why's that?
 
@MadaraUchiha cos my questions are limited to my own code.
And are not general for everyone.
 
@HassanAlthaf Not necessarily.
 
@HassanAlthaf Yes, you are too curious. You are focusing on way too many things at once, and Code Review is not really the best place for any of them. I believe that what you primarily need is patience, and the ability to self-learn better
 
Yes @SimonAndréForsberg you are right.
 
2:44 PM
@HassanAlthaf SO people don't vote as much as we do here on CR.
 
I guess the word 'too' is also too 'less'
 
oh, they vote
 
Guys stop pinging me.
 
It's generally okay as long as it may be applicable to anyone:
2686
Q: Why is subtracting these two times (in 1927) giving a strange result?

FreewindIf I run the following program, which parses two date strings referencing times one second apart and compares them: public static void main(String[] args) throws ParseException { SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String str3 = "1927-12-31 23:54:07"; ...

See this question for example, there are small odds you will ever encounter it yourself.
 
0
Q: C# WPF Calculator Code

Hassan AlthafI've coded a Calculator in C# with WPF as the UI. I wish to know mainly about this points: Ways of optimizing. Better techniques, tactics and ways of coding this. All flaws on the surface as well as deep. Simpler logic MainWindow.xaml.cs using System; using System.Collections.Generic; using ...

 
2:45 PM
... actually that's the best way to get attention
find something unexplainable and unexpected
post it as an easy question on SO
 
Sorry Hassan, I was mostly just using the reply thing to give context.
 
Nah, its okay.
I just noticed the mute button.
 
(Most people have the ping sound turned off here)
If not all
 
hmm, 3 accepted answers with no votes, up or down
 
i know, dagg nabbit.
My questions are shit.
 
2:47 PM
Sound goes to headphones - which I am not wearing.
 
> answers
 
But after I came to CodeReview, my PHP has improved vastly.
My code was so shit before.
 
@HassanAlthaf - it may sound like a harsh thing to say, but, people who like dealing with broken code, or code with issues, answer things on Stack Overflow. People who like to make working code better, answer things on Code Review. If your code is not working, then the right people to bug are on the Stack Overlfow side of things. While the people here on Code Review probably can help you with problems, if they wanted to help you, they would be present on Stack Overflow as well.
5
 
I have my ipod plugged into the speakers, song 403 of 3352 of The Shuffle.
 
2:48 PM
If you have made yourself unwelcome there, then that does not make it OK to bring those types of questions here.
 
Ok, I'll make it limited to the language chatrooms.
I'm sorry.
 
SO is nice, but all the questions that are on my level get swept away by more experienced users, so I restrict myself to certain tags. Then I found code review and here it's okay if you take your time for an answer
Plus I put in a question today and got a nice answer back with results I didn't expect
5
 
I know right.
I'll start answering reviews, this may make me remember things better.
 
was doable on SO when it was in early access and also a few weeks after release, but then it got totally swamped with FGITWs, I had hit the repcap like five days consecutively though when Java 8 launched ;-)
 
@Pimgd You can add your well though answer even if it isn't the fastest.
 
2:50 PM
@HassanAlthaf When you start reviewing other people's code, you start looking at your own a bit harder too.
5
 
The idea of Stack Exchange in general is that there are multiple answers and the best are voted to the top
 
@ckuhn203 When you start reviewing a lot, you start to think more than to code :)
 
@skiwi No doubt. I definitely put a lot more thought into each new project than I used to.
I used to just start typing, now I sketch it out first.
 
One of the interesting things about Java 8 is that it has prompted the Scala community to get serious about upgrading. There's talk of moving off 6 finally and skipping straight to 8.
 
@MadaraUchiha it's the same for anything in programming i suppose?
 
2:51 PM
@MadaraUchiha by that time someone else had the same answer
AND worded better
 
While in the past I was usually writing more code than actually thinking.
 
@skiwi I found out the best way to learn code.
 
@Donald.McLean In what context is that? Is Scala still based on Java 6?
 
@Pimgd What I usually do is to write a concice and correct answer first, then edit it gradually with details one by one
 
@skiwi It's still compiled on 6.
 
2:53 PM
>You want this
1 + 2 == 3
 
Ouch, that's a major loss for Scala, they should definitely upgrade asap then!
 
>You want this:
1 + 2 == 3 //true

The == operator is the equals operator
 
Though it is another language,, so there are not missing out too much honestly.
 
... so what am I supposed to do if a question on CR can break and crash in ... 3 ways already?
 
Welcome to the fuzziness.
 
2:54 PM
But Scala lacks the new metaspace then for sure, what more?
 
> You want this:
if (1 + 2 == 3) {
//This will happen
}

The == operator is the equals operator
 
Madara, I guess you haave the highest reputation in Stack Exchange?
 
See how the answer evolved?
@HassanAlthaf Last I checked, I wasn't called Jon Skeet, so no.
 
@Pimgd if it is likely that the code would never have done anything right in even the best-case scenario then it is way off topic.
 
Wait why does it say your rep is 91.7k here and 9.1k in your profit
 
2:54 PM
@skiwi I'm guessing that there's better baked in support for monads and higher order functions? I don't actually know.
 
*profile
 
vote to close.
 
@HassanAlthaf Depends on which site you're looking at
 
Nah, it only breaks if you hit 1 out of the 15 buttons
 
91.7k is all of Stack Exchange sites combined.
9.1 is my Anime & Manga profile
 
2:55 PM
Anime and Manga! :)
 
@Pimgd if you want quick reputation, you point out the failing cases as bugs, in an answer.
 
Animeee.
I love anime
 
I've about 58k on so
 
@Donald.McLean I don't know how much to the JVM changed in all honesty, I think a lot of support for lambdas was already prepared in Java 6 (if unlucky in Java 7)
 
2:55 PM
@HassanAlthaf Feel free to join us on Anime & Manga then :)
 
Doraemon, Kiteretsu, Pokemon.
 
Yay quick rep
 
not really..
half assed answers don't get much votes there..
also I feel like the popular questions are snatched by people far more involved with A&M than me...
 
@skiwi Like I said, I don't really know what the driver is, but there is apparently something that it makes worth upgrading.
 
He means quick rep on CR for pointing out bugs ;-)
 
2:58 PM
@Donald.McLean invokedynamic got added on JVM 7 (JDK7), which I do not fully understand, but it is something they may want to use in Scala then for higher-order functions as it has something to do with dynamically typed language/code
 
1x Half-assed answer
0
A: C# WPF Calculator Code

PimgdDuplication if (totalled == true) { Display.Content = ""; totalled = false; } Display.Content += "1"; storageVariable += "1"; if (totalled == true) { Display.Content = ""; totalled = false; } Display.Content += "2"; storageVariable += "2"; All the way up to 0. (1-9 + 0) If you...

 
The only 'issue' I have with people answering a question really fast over here (while I am typing a thorough answer that gets more upvotes in the end), is that I cannot get the badge anymore then
 

« first day (445 days earlier)      last day (3576 days later) »