« first day (479 days earlier)      last day (3521 days later) » 

8:00 PM
Ohhhhhh yeah...... ummmmmm.........
I work with this backassward proprietary langauge from 1980.
 
So... ;)
(Apart from that it sucks)
 
My life has no concept of a subroutine. It barely has the concept of a loop. Unit testing? That's funny.
_GN_tempLogon=GetUserInput("Enter your Database UserName", "Enter UserName")
_GN_If tempLogon = "" Then
_GN_     Go to {ScriptLabel="Endd"}
_GN_End If
 
@RubberDuck That is code you need to use...?
 
For now.
The software vendor is finally ditching it and moving to .Net
 
Not as good as Java, but better as that stuff.
 
8:14 PM
If I can create a function and a subroutine, I'm a happy camper.
 
Lol, I didn't realize my Q+A on SuperUser was that popular
2
A: 100% of RAM is used when the Task Manager shows a cumulative usage of - what should be - less than 12%

Jeroen VannevelIf you moved around (large) files across the network prior to this happening then you're at the right address. The first part of this post is an explanation on how to diagnose this problem and test it yourself but if you just want the solution then you can skip to the end and change the registr...

958 views but 0 upvotes on the question and only 2 on the answer
SU people..
 
I really need to figure out how to make Spring MVC show/log whenever an exception happened
 
@skiwi Chances are you don't want that
I know the .NET framework spews many, many exceptions in the background
I assume Spring has that as well
 
Well... I do want some exceptions then, but cannot figure how to turn them on
There's an exception in my JSON conversion via Jackson
 
You can't look in the container's logs?
or is it not in there?
 
8:20 PM
No, nothing logged there
 
ah, JSON conversions are the worst
Use unit tests for that
put the JSON in an xml file, read it in your test and parse it
you'll have your exceptions and it makes me feel safe
 
lol, you know which moderator handles your flags when you flag some comments as obsolete and then moments later the question is Jamalized
 
@200_success: it's not really about a game (I just wanted a model, could've been Animal as well) so I'm not sure if the tag applies
 
So it's example code?
 
8:27 PM
No, it's real code. I just wrote it entirely. It's just not related to a game
 
@RubberDuck You should try brainfu... oh wait... subroutines...
 
The game aspect is irrelevant
 
@SimonAndréForsberg Maybe I'll take a crack at it some day. It's basically a Turing Machine, right?
 
1
Q: Super sophisticated game information web application

Jeroen VannevelConsidering I've got an exam on Spring tomorrow, I figured you could review a small example application I whipped together as preparation. Its functionality is straightforward: you start with a list of 3 games and you can edit or view its details, both which will lead to a different page. The f...

 
@RubberDuck Yes, a completely deterministic turing machine. But without an infinite tape
And not the same sense of 'state'
 
8:30 PM
Which is pretty cool all in all.
 
So it's more basic than a turing machine
 
But still Turing complete?
 
@JeroenVannevel That could be a good idea indeed...
 
@RubberDuck Almost. Not quite. But close.
@JeroenVannevel What kind of game are you working on?
 
@SimonAndréForsberg It's not a game!
I should've just used Animal :(
 
8:32 PM
So, @SimonAndréForsberg, do you think it's a good idea to keep my publish script right in with the rest of the project? Or should I have a different repo with all that stuff?
 
@JeroenVannevel Why does the title say 'game information' ?
 
I just needed a model to use in my application to test out Spring
 
@RubberDuck .... Speaking of Brainfuck and turing completeness...?
 
@SimonAndréForsberg Well. Okay, because it is about a game. Titles on CR as just hard, they all come down to "look at this piece of code", everything that's needed is already in the tags
 
8:34 PM
@JeroenVannevel Alright, I get it.
 
google.nl/… Why is there no single useful post?!
 
@SimonAndréForsberg You suggested Git, so I'm asking you. =P
 
@JeroenVannevel Have you heard about our TCG Project ? (our = a few of the regulars on CR)
 
Am I stupid or are all the others stupid?
 
8:35 PM
@SimonAndréForsberg I've read about it here from time to time but it's in Java so I try to avoid it
Maybe I'll look into it after the exams when I've got some free time
Although I have a few projects of my own that are gathering cobwebs
 
@RubberDuck Can your publish script be used by everyone who is involved with the project? Does your publish script sensitive information?
@JeroenVannevel And you just posted a Java question....? :)
 
@SimonAndréForsberg School is a hard mistress
 
@JeroenVannevel I have a few projects of my own that are gathering cobwebs while I'm working on the TCG
 
@SimonAndréForsberg Yes. Everyone can use it. And I don't think there's sensitive information.
 
@SimonAndréForsberg and his top tag on CR is Java :)
 
8:37 PM
@RubberDuck Then it sounds reasonable to be inside the same repository.
 
There's like not a single person in the world who wants to log what his Jackson JSON converter is doing, and I can't believe they're all using unit tests....
 
Yeah. Okay. Thanks.
 
@janos he does have more C# answers though. But Java answers are better voted
@skiwi What information do you want to know about it?
 
On SO I have 1000 java upvotes and 500 C#
 
@SimonAndréForsberg I want to know what exception it throws, because I'm sure it throws one.
 
8:39 PM
Java is just much easier to answer because of all the beginners
3
And I used to do that sometimes. I admit
@skiwi wrap it explicitly in a try-catch and put a breakpoint in the catch
The container won't have the chance to eat the exception since you already got it
 
@JeroenVannevel It's all handled internally (as of now)
spring.io/blog/2013/11/01/exception-handling-in-spring-mvc Is it me or does the site use an awful font?
 
@JeroenVannevel I think you're gonna nail that Spring exam, your Spring code looks good.
 
Hmm
Ah branching is awesome I think
 
@Malachi I was having a really hard time following the logic of your query you tagged me on...
 
I made some edits and remember I want to do an update on older code
 
8:47 PM
@Phrancis which one are we talking about?
 
SELECT c.Name, c.Phone
	FROM Customers AS c
	WHERE c.City = @city AND
		(
		SELECT
			CASE @status
				WHEN 5 THEN 'c.Status = 5'
				WHEN 10 THEN 'c.Status = 10 AND c.SignUpDate NOT IN (EXEC ExpensiveQuery)'
			END
		)
 
@SimonAndréForsberg Let's hope so, I need as many 2nd year classes done as possible if I don't want to miss out on my internship
 
Seems like it needs broken down in a few smaller steps
 
I've got a skype interview (including technical test) with their team in the next few weeks. Getting close to signing that contract
4
 
@Phrancis I killed that one. I was trying to figure out a good answer for this question
1
Q: Similar statements need duplication removed

user30586How would you refactor this? ExpensiveQuery must only run when necessary. DECLARE @city VARCHAR(10) DECLARE @status INT IF @status = 5 BEGIN SELECT c.Name, c.Phone FROM Customers c WHERE c.City = @city AND c.Status = 5 END ELSE IF @status = 10 BEGIN SELECT c.Name, c.Phone ...

 
8:49 PM
But what I find really weird is EXEC ExpensiveQuery in middle of where clause :)
 
@JeroenVannevel Good luck
 
YES YES YES
it works!
> Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "locked" (class com.skiwi.githubhooksechatservice.github.events.Issue), not marked as ignorable (18 known properties: "number", "events_url", "user", "assignee", "state", "title", "id", "html_url", "body", "comments_url", "closed_at", "created_at", "url", "labels_url", "milestone", "comments", "updated_at" [truncated]])
 
@SimonAndréForsberg cheers :)
@skiwi How did you solve it?
 
Hang on
getting a good fix on it
 
@skiwi If you would have added that @JsonAnySetter annotation, this would not have happened, and you would have an easy place to look for what stuff is missing
@skiwi Funny btw that you say "it works!" and then show an exception...
 
8:53 PM
@Phrancis totally legit, but definitely a little strange.
 
@Malachi I think konijin's answer is as good as it's going to get. Seems odd though, maybe the ExpensiveQuery part is what the OP should really post for review
 
Yeah. That ^
 
0
Q: Django project structure and settings configuration

user3810188I'm new to Django but after some googling and reading blogs I found that I should follow this kind of structure (I compile 2-3 suggested structure and this is what I came with): eric@eric:~/proj/django_project_structure$ tree . |-- requirements | |-- common.txt | |-- development.txt | |--...

 
ttgh cya
 
	@ExceptionHandler(Exception.class)
	public void handleException(final Exception ex, final HttpServletRequest request) {
		LOGGER.log(Level.SEVERE, "exception", ex);
		throw new BadRequestException();
	}

	@ResponseStatus(HttpStatus.BAD_REQUEST)
	@SuppressWarnings("serial")
	public static class BadRequestException extends RuntimeException { }
@JeroenVannevel Up here ^
That needs to be in the @Controller handling the request
 
8:54 PM
Bye ducky
 
I'm so happy about being able to see the exception that I forget to be sad about the exception.
2
 
9:10 PM
31
A: .NET Framework: Random number generator produces repeating pattern

Scott ChamberlainWelcome to the world of non cryptographically strong RNGs. Apparently the built in .NET RNG has a tendency to make the 3rd number it outputs 84 if you limit it to 0 to 200 for its outputs. Take a look at the following version of the program, it shows more of what is going on in the output. class...

that's pretty silly
 
@JeroenVannevel That looks extremely silly.
@JeroenVannevel Wait a minute.... that's creating a Random object by using the seed of another Random object. That's not recommended.
No wonder it looks silly
 
wait what
I see. It's a very niche usecase
still, it's supposed to be random
I wonder where exactly it all comes together at that third value
 
It's probably related to the inner workings of Random
Sometimes I wonder how many people actually read my answers, considering the typos I can make: meta.codereview.stackexchange.com/posts/2383/revisions
> If you have topic that does not do what you want, you're off-topic.
 
9:34 PM
0
A: Off-wing jet-engine transportation

David RicherbyThey use one of these! Image source: jokeroo.com

 
@Malachi Photoshop in action?
 
This (slightly later?) photo suggests the attachments are not very secure. — RedGrittyBrick 5 hours ago
I hate Legacy Sites.... in VB EVEN!
@SimonAndréForsberg this one is real though
 
0
A: Model class for networking that uses notifications

nhgrif//Define notification names static NSString * const kRequestForPopularMediaSuccessful = @"RequestForPopularMediaSuccessful"; static NSString * const kRequestForPopularMediaUnsuccessful = @"RequestForPopularMediaUnsuccessful"; The scope of a notification name should never be limited to a single ...

 
9:51 PM
@Malachi Warnings are no things. You're all good
 
@JeroenVannevel especially with VB right?
some of them are telling me that stuff is obsolete and I should use something else.
more fun for tomorrow
TTQW
 
okay, maybe those are important
 
10:06 PM
0
Q: Refactoring Jquery/ TurnJS code

FedeHow can i write this code better? I'm doing an animated magazine, so I run and then clean the animation per page. magazine.turn({ width: MGZ_WIDTH, height: MGZ_HEIGHT, pages:MAGAZINE_PAGES, display:DISPLAY_PAGE, acc...

 
You shouldn't ignore warnings...
 
I didn't know about this until today. :/
 
I should submit the original version of the app I'm in the middle of rewriting.
 
0
Q: Object.extends in JS

Eric UldallI built an easy inheritance implementation for js that works similar to other oo languages and wanted some feedback on it. This works perfectly how I'd like it to, but I've read a lot of varying opinions about using proto and was wondering if there's a better way to do this. Thanks in advance! ...

 
10:22 PM
You laugh. But I kid you not...
uint8_t Temp_Uint8_1;
uint8_t Temp_Uint8_2;
uint8_t Temp_Uint8_3;
uint8_t Temp_Uint8_4;
uint16_t Temp_Uint16_1;
// etc ad naseum
Every single variable name took this form: Temp_VariableType_#
 
0
Q: Clicking child view and preventing parent view from running dblclick event

Sean AndersonI have a parent view which has a dblclick event handler bound to it. I also have a view which is a descendant of the parent. This child view has a click event handler bound to it. Currently, my code works as intended, but looks like this: var ParentView = Backbone.Marionette.ItemView.extend({ ...

 
That's... GG.
 
@SimonAndréForsberg It's the best example I've ever seen of poor code writing making a sort of complicated task look ridiculously impossible.
Here's the funny thing too... in part of this code, he was trying to split a 16bit int into two 8bit ints (left byte and right byte)
 
10:37 PM
@nhgrif And for that he used.... more than 5 ints?
 
No hang on..
He's using tons of ints for multiple things, this is just a small example
To split the 16bit int... he turned it into a hex string, split the string in half and turned each half back into an 8bit int... it's like a 30-40 line method.
You know what I did?
 
int bit16 = xxxxx; int bit8high = bit16 & 0xff00; int bit8low = bit16 & 0x00ff;
 
Well, I did: original / 256; then original % 256;
 
Same effect :)
 
I should probably change it to yours though because that's more explicitly clear what's going on
 
10:39 PM
I think... unless unsigned ints would cause an issue
 
Wait no...
Yours won't work
 
bit8high = bit16 & 0xff00; <--- = 0
 
Not if bit16 is 0x7483 for example
 
Yes.
 
10:41 PM
i.e. 29827 in base 10
 
bit8high is uint8_t, and bit16 is uint16_t
Actually, I don't know that it will be 0, but it will overflow either way.
 
ah, so bit16 & 0xff00 >> 16
 
Right.
 
Good catch
 
And when we go back from two 8 bits into a 16 bit, he used the same stupid method again.
Where I did:
 
10:42 PM
Oh dear...
 
bit16 = bit8high;
bit16 <<= 8;
bit16 |= bit8low;
 
Where does these crazy so-called programmers come from??
@nhgrif Thank you!!
(Although I probably would do it in a single line, but that's of less importance)
 
By the way, getting an iPad to talk to assembly line machines is complicated business.
 
@nhgrif Starring a message in chat when you've used all your stars also seem to be complicated business
2
 
0
Q: Simple JavaScript Backbone.Js tool to highlight multiple search terms

janosI wrote a simple JavaScript tool to highlight multiple keywords at the same time in some text. It uses different color for each keyword, and also shows the count of matches. I'm using Backbone.js with the following class structure: App.Model: the main model, keeping track of: the keywords th...

 
10:48 PM
@sim RSA from phone chat seems to be complicated business
 
@Mat'sMug I've discovered recently that a lot of things are complicated business from the StackExchange app
I tried checking out the CR Meta site through the app, I just couldn't get an overview of the recent meta questions...
 
There's a way.
On iOS?
0
A: Clustering markers on Google map on zoom

nhgrifNaming and Comments The postfix underscore is quite strange to me, and I don't understand it at all. It matches no convention I've ever seen or heard of, and it's just not obvious to me what's gained by sticking out there. What's it for? In your 93 lines of code, the only comments to be f...

 
@sim the only thing I use the SE app for is the notifications; when I get one I open up Chrome (which always has 2 tabs opened - CR & The 2nd Monitor)
 
@Mat'sMug Sounds like a good option
SE app stinks
@nhgrif Android
 
I'm not familiar with the Android app, and I have no idea how similar it is to the iOS app.
The iOS app works fine though.
 
10:57 PM
@Mat'sMug RSA ;)
 
(was meant for the post right above that ;)
 
0
Q: Updating the UI with a timer - code intended to help teach

Mike SI thought it would be helpful to put together an example of what I'm talking about in the second part of my answer to this stackoverflow question. The idea is that there's some data that is updated very quickly on a background thread that needs to be displayed in a UI (in this code, a counter in...

0
Q: Refactored networking class by moving definitions of notification names to header file

user3344977I was given some advice on how to better manage my notification names, and I have implemented the changes. I want to make sure that what I am doing is 100% correct. These notification names are being used in my class's implementation, and also other classes as well. If I am doing this correctly...

 
Wow
 
All yours!
 
...
Yes, this is the correct way to do it, however this question appears to be off-topic because it is asking for a code explanation. — nhgrif 37 secs ago
 
11:06 PM
I wonder... is it flag-whoring to flag a whole bunch of obsolete comments on a question instead of only flagging one of them? :)
 
Maybe. But sometimes I've flagged just the top one then seen only the one I flagged deleted
Not here, but on SO.
 
Flag-whoring or no, it's more correct to flag them all
 
I'd just flag one with a custom flag asking to power up the vacuum cleaner
 
@SimonAndréForsberg no, flagging them all is actually recommended by mods
because that way they all show up together in their tool
 
Oh well
 
11:07 PM
custom flags can take months to be viewed
 
Uh, not here bud ;)
 
lucky you must be, Luke's Mug
flaaag em all!
 
I'm torn as to whether or not this is example code... I certainly don't think it's very great teaching code, which he intends it to be... codereview.stackexchange.com/questions/61127/…
 
That's on CR?
 
11:10 PM
@Mat'sMug yup :)
 
I need to flag more.
Last flag Jul.18
 
I'm flagging obsolete comments whenever I see them :)
Now I'm looking back at some previous flags I've made, and oh the nostalgia... I remember this question:
-3
Q: I need help with integer division in PHP

TheRealWitblitzI had a bit of code in BASIC I needed to convert, but specifically this following line has me stumped atm: NRSLATHOR=INT(LSLATVER/PITCHVER-.8) In PHP I'm attempting to do an integer division but I get different results from similiar input values. For example one: $length = 1590; $pitch = 50;...

I still haven't figured out the logic behind it...
 
@Jeroen you mean custom flags on CR take a month to process? SO's custom flags look like they're handled by the same people that ship swag though...
 
@Mat'sMug Oh no, I barely flag on CR
Only SO
 
11:26 PM
Ah, right then.. 6-8 weeks ;)
 
CR flags gets handled quickly
whenever one of the moderators are active
 
We have the crème of mod teams :)
 
A monkey, a pink fish, and a guy who's created a keyboard shortcut for Edit post ;)
 
Alright, TTGTB. I haven't done anything constructive the past couple of hours anyway
(except flagging posts...)
(and helping @Phrancis get started with the first packaged version of the TCG...)
 
11:42 PM
lol.
 
0
A: Updating the UI with a timer - code intended to help teach

nhgrifI don't think this code is very good teaching code. First of all, I personally prefer using NSOperationQueue for this sort of stuff. My guess is that people completely uncomfortable with asynchronous code will be also. NSOperationQueue code looks just like all your other Objective-C/Swift st...

 
well this is interesting, a 1ms window for a bug blog.mischel.com/2009/07/18/…
 
@Phrancis Did you see what I was talking about with ints vs strings ?
 
11:59 PM
@mjolka wow
 

« first day (479 days earlier)      last day (3521 days later) »