« first day (503 days earlier)      last day (3507 days later) » 

12:01 PM
so...I have a class structuring and a naming problem. I have a class Canvas<Frontend, Display> that should draw on a Display directly, or on an intermediate Buffer<Frontend,Display>. There should be Canvas::display() which returns a reference to the display object and Canvas::outputDevice() which returns a reference to the device (Buffer or Display) which it actually draws on. How can I achieve that?
 
@skiwi
the generics would just be Class<?>
 
@Christoph looks like a class with multiple responsibilities to me...
 
@SimonAndréForsberg It's a tutorial about involving generics! The generics in there should be correct.
 
@skiwi everyone makes mistakes :)
 
You know that using Java library methods you can even do more fun stuff, like lambda meta factories
 
12:03 PM
@Vogel612 I can create a class that does the dispatching to Buffer or Display, but it would then become part of the Canvas composition
 
@skiwi Typically not. Generics in Reflection are normally dealt with by @SuppressWarnings("raw types");
 
@Christoph why should it not?
 
Nothing in a reflecton API can be generically typed right.
 
@rolfl Wouldn't it be nicer to just specify Class<?>?
 
No, often not.
 
12:04 PM
If you want to dispatch even more decoupled I'd recommend using Events instead..
 
It is better to say: Generics here just don't make sense, so this whole thing is going to internally use raw types.
Then, on the methods, where it makes sense, you manually cast return values to a specified type.
Hate to be all lofty, but, you sort of have to do it to understand how messed upp it is trying to make a generics-safe reflection method.
2
 
@Vogel612 well it can, I guess. This is the most complex thing I've ever done with templates, and things just don't seem clear and simple. Usually when I have something that works well it also looks clean and simple. That's why I used the term "structuring problem"
 
@Christoph well things aren't clear and simple right now... Because the Canvas does too much.
How you resolve that is completely up to you though ;)
 
so would be more correct to say Canvas<Frontend, Device> and use the Buffer<Frontend, Display> as a Device the canvas draws on? In that case, the canvas has no "direct access" to the display (I'm not yet sure if that would be necessary, though)
 
XKCD surprises me every time: xkcd.com/no
No.
 
why are those things there
 
0
Q: Deserialize an email header into key-value pairs

Bjørn-Roger KringsjåSo I've created a function that will deserialize an email header into a list of key-value pairs. I've run numerous tests using MS Outlook office 2010 and MS Outlook 14.0 Object Library, all which were successful. However, I'd still like to know if this function could be optimized/improved. ...

0
Q: Is there any reason for this construct?

nablexThis is not my code but I was trying to evaluate code quality of an opensource project and one of the first things I encountered is this: public class WriterOutputStream extends OutputStream { ... @Override public void write( byte[] b, int off, int len ) throws IOException { ...

 
> This is not my code but...
 
Hey @Mat'sMug! 4 bottles of beer on the wall.
 
@skiwi Open source project, if he contribute ... (If feel like this rule is weird a bit (I know the meta post))
 
12:15 PM
1
Q: Traversing and printing complex Dictionary types (Scripting.Dictionary) - Dictionary inside of a Dictionary

vba4allBased on this SO post - also reposted on vba4all.com with a few more details and explanations. Please notice there currently is no error handling whatsoever as I didn't analyse and consider any traps yet. Although feel free to supply details/code based on your assumptions. For Example - the code...

 
@Marc-Andre Oh, I didn't read further than the first few words :p
 
ahahah ! Hey everyone by the way! I'm on holiday and what I do ? CODE :D
3
 
^^ That's the spirit
I'm proud of you @Marc-Andre
 
@Vogel612 do you think sorting this out would be a good question for programmers.se?
 
That's what I do on holiday too @marc-andre.
 
12:18 PM
wat
 
Normally, I would be playing a game :P ! So it's quite a "rare" thing! But I'm preparing my next question for here!
 
why is that a thing
Well, I understand why (you need to send a query to retrieve the amount of flags the user has left), but how did it come to be a limit
 
Internet, you always need a limit. People can't limit themselves.
 
Greetings, Programs.
 
@Pimgd Everything is limited.
Hey Donald.
 
12:21 PM
Hey @Donald.McLean!
 
109
Q: The Complete Rate-Limiting Guide

Lance RobertsI noticed that I can only perform certain actions such as commenting a finite number of times in a given period of time. Obviously, rate limiting is in place to prevent accidental misuse or intentional abuse of certain features. Where else is rate limiting applied on Stack Exchange sites, and wh...

 
@rolfl Flag dialog is not on that list
 
It is ... ;-)
 
LOL.
^ That was the first buyer in Australia
 
Gravity is strong there.... has to hold the people up against the ground....
 
12:24 PM
@rolfl please compare
it's for the actual dialog itself
 
Well, sure, the message is changed, and the limit is 3, not 5. But, perhaps you should post a comment?
 
Do you speak any other languages?
Cause I'm not getting the difference through in English.
Try pseudocode:
flag() != flagDialog.open()
 
It seems like you are in a bad mood today...
 
Hmmm I think I'll just wait to get a 6 until the 7 comes out. It's cheaper that way.
Or maybe the 7 will actually be phone sized and I'll get that instead.
 
@skiwi I'm not in a bad mood, it's just that after three attempts I'm not gonna try again via the same method
 
12:30 PM
@Pimgd Let me just say that I think that you are not being nice to people today
 
=/
 
I'll buy my new phone today and I can assure you all that it will not be an iPhone! Too much hype at the moment!
3
 
I'm always leery of buying new products on the first day. I'll wait until early November probably.
2
 
I seriously think my next phone will be a plain old phone.
One with real buttons for numbers.
 
time between pressing "phone" and actually seeing the number input: 7 seconds. what more could we ask for?
 
12:40 PM
@RubberDuck a plain old phone for me is a phone with a flip-flop with a qwerty keyboard. Weird!
 
@Christoph I have no idea, try asking the guys in the whiteboard
 
0
Q: DRY my rake import from external database tasks

bnusseyThe application I'm working on runs import tasks each night to get information from an external database and processes and writes it to the local PostgreSQL database. This is so it can be viewed in our application. We do the following: Create a connection to the external database Perform some ...

0
Q: Pass mora than one value in event parameter on jQuery On method

Diego MacarioI´m doing a code to make in Primefaces have a hint. I did it $(document).on('mouseover', function() { $('span.ui-icon-pencil').prop('title', 'Editar'); $('span.ui-icon-close').prop('title', 'Cancelar'); $('span.ui-icon-check').prop('title', 'Confirmar'); }); $(document).on('click...

 
Would this question work on SO?
0
Q: Is there any reason for this construct?

nablexThis is not my code but I was trying to evaluate code quality of an opensource project and one of the first things I encountered is this: public class WriterOutputStream extends OutputStream { ... @Override public void write( byte[] b, int off, int len ) throws IOException { ...

 
@Pimgd I was actually thinking the same thing
 
@Pimgd - I find the meta post about dialogs to be very clear ... not sure what your problem is with reading the very clear English:
 
12:53 PM
@rolfl =D You edited it, many thanks
 
;-)
 
 
Can we migrate that question?
after cleaning it from the update
 
> UPDATE

After I saw the link Why is only my own written code on-topic? I understand partly why it is currently on hold but if copyright of posted code is the only concern, can I just link to their github page and formulate the question as such?
 
more dangerously:
in Discussion between Pimgd and nablex, 12 mins ago, by nablex
so basically...next time i should phrase it as..."i wrote this code but i have the following considerations..."?
 
1:08 PM
0
Q: Cron expression validator for Apache Quartz

Marc-AndreNot too long ago, I had to create a cron expression for a route in Apache Camel. I had a bit of a struggle to find the right expression. So I made a small program to output the n next valid dates returned by the expression. I planned to add more feature like instead of making a blind Sysout, you ...

 
Monking
Less than 100 rep to Pass Jerry Coffin!
 
Guess you're right. Went ahead and modified it, makes less braces, not easy to miss. I'm still in an unfortunate mindset of 'less code is better'... I always try to condense into the least amount of lines as possible. Been trying to remedy this habit as I know readability tends to suffer. — Volearix 36 secs ago
 
@SimonAndréForsberg do you have a good picture for the flag on that minesweeper? I have an idea to be able to flag the mines....
 
Well since my question does not generate a lot of interest, I'll go make some shopping! Have a nice FRIDAY ( ;) )all!
 
1:23 PM
I will see what I can find
@Marc-Andre SHHHHSHSHHH
Before anyone realizes I am here
 
0
Q: Writing the result of a Javascript for-loop into a HTML 5 table

AddioioiI am playing about with Javascript, and I've made a fictional hotel website that shows you hotel details when you click on a button. http://jsfiddle.net/addiosamigo/4ev43b5m/8/ var hotel = {Name: "Park Hotel", Price: "£120.00", Rooms: 50} var hotel2 = {name: "West End", price: "£240.00", rooms:...

 
@Malachi Not really, no
 
@SimonAndréForsberg I will see if I can find one, or make a blue CR flag!
streaking in the park, skinny dipping in the dark
 
@Malachi Because it's you, I think you should make a star instead
 
@SimonAndréForsberg that would be perfect
I need to look at the code. see if we can make it kind of like the original only with different looking mines and stuff..
 
1:29 PM
Monking! IT'S FRIDAY!!!
 
should watch the Rebecca black one first and then the Katy Perry one.
 
Monking! HIBERNATE (EXPLETIVE)!!!
 
[PROFANITY]?
 
-2
Q: C++ Quiz: are you a code guru?

Andrey CppThe authors of the PVS-Studio analyzer invite you to test your attentiveness. Code analyzers never get tired and can find errors a human's eye cannot easily notice. We have picked a few code fragments with errors revealed by PVS-Studio, all the fragments taken from well-known open-source project...

0
Q: ajax call to make an http request (node.js)

WillFiddling around in node.js with express. There is a button that the user can click, and doing so calls this method on the server: app.get('/getTime', function(req, res) { var url = 'http://www.ctabustracker.com/bustime/api/v1/gettime'; http.get(url + '?key=' + apikey, function(resp) { ...

 
Just in time for... Guess what day it is....
 
1:35 PM
meh.
 
@Phrancis You're too late. Scroll up.
 
Oh, I saw it @Pimgd
 
But you're still alive?
 
someone of you guys by any chance knows when Hibernate instantiates and uses ConstaintValidator for class-level annotations??
or rather when JPA spec defines they should??
 
I need to figure out if I want to change the text to a picture....
 
1:38 PM
Oh, snap. SNAP crashed...
2
 
@Pimgd Just in case you were wondering if there is still anonymity in the world..... ;), I am talking to Matt now, and he's looking in to that code.
 
Hahahaha brilliant
 
1:56 PM
in Discussion between Pimgd and nablex, 48 secs ago, by rolfl
09:37:38 < rolfl> Thought you would like to see this (I am a mod on Code Rview now...)
09:38:19 < rolfl> http://codereview.stackexchange.com/q/63358/31503
09:38:45 < rolfl> Matt ... I believe that is your code....
09:39:17 < rolfl> (on Code Review we do not review other people's code.... so it is closed).
09:40:37 < pentaho_mcasters> rolfl: I'm sure there's some question in there somewhere :-)
09:42:11 < rolfl> I figure that the base use case for the code will never call the indexed-version, so it won't matter, but, taken in isolation, there is a performance fix available ;-)
 
2:12 PM
@rolfl I am missing a bunch of this conversation. how does this Matt person fit into the mix? short story please?
 
He's the original developer of the mentioned code
 
And he's now filed the issue, and assigned it.
will be resolved,
 
Nice!
I need to finish putting token fields into this PDF though. should have taken me like 2 hours. but I don't know where the tokens are supposed to go because I didn't create.....TLDR not my job....
get this done and then play with some JavaScript (MineSweeper)
 
@Malachi sounds like you need to put an SEP field onto it.
 
SEP?
 
2:16 PM
Somebody Else's Problem (also known as Someone Else's Problem or SEP) is a psychological effect where individuals/populations of individuals choose to dissociate themselves from an issue that may be in critical need of recognition. Such issues may be of large concern to the population as a whole but can easily be a choice of ignorance by an individual. Author Douglas Adams' description of the condition, which he ascribes to a physical "SEP field", has helped make it a generally recognized phenomenon. Somebody Else's Problem used to capture public attention on matters that may have been overlooked...
 
yeah I have been working on this all week. but I find Writing code way more fun....
 
0
Q: Java returning only unique values from an array

jasoni have this code that is returning the count of unique values but instead of count i want it to return only the first(one) instance of actual values. We can assume the list is sorted. so from 1, 22, 22, 22, 33, 45 the answer should be 1, 22, 33, 45 public static int dups(double[] list) { ...

 
That's what broken means in codeland — Pimgd 48 secs ago
 
=D
I couldn't come up with a better thing than "codeland" though =/
 
@Pimgd this is an example of trying to tell someone they are wrong, in a nice way...
Welcome to Code Review! Unfortunately, this is not the best place to go to help you fix known bugs in your code. This question is better suited for Stack Overflow. — Phrancis 1 min ago
 
2:28 PM
Hey @Jamal
 
hi
 
hi
 
Did you pick up yet on the discussion here: chat.stackexchange.com/rooms/17288/…
It has relevance for the meta question about reviewing someone else's code.
 
No I haven't. I'll read through it later.
 
K, go JAVA then ... ;)
2
 
2:32 PM
lol
2
On another note, do we need ? I suppose it can't quite be lumped in with .
 
No need for , and it should be instead.
 
Okay
 
@Phrancis Excellent!
alright, thanks for nothing...mod please delete. I will go find another more useful site. — jason 12 mins ago
I think someone is underestimating the importance of maintainability, readability and all other '-ility'.
 
Do I have to be a nice reviewer for those users too?
 
I like to kill them with kindness, that way they are the ones that look bad
 
2:44 PM
13
A: What's a Zombie? And what are the many other memes of Code Review?

MorwennMeme: Exploding bear traps Originator: Grace Note Cultural Height: The 2nd Monitor, Website Graduation Background: During the endless talk about Code Review graduation, some were wondering whether Code Review could even graduate some day or was doomed and would close. The answer was as follows...

 
Nice!
 
how many active users do we have now anyway?
259 active in the last 5 days
let me read my query.......
259 active answerers in the last 5 days.
 
What is your definition of "active"?
Or does that mean, 259 users answered a question in the last 5 days?
 
@Phrancis Yeah, he's dead alright (self-deletion).
 
whoa I got upvoted on some age old SO answer
I feel like I helped a poor sod somehow
 
2:56 PM
how do we tag SEDE queries?
can we synonymize with I almost created a new tag...
 
@rolfl lol I found a @Mat'sMug question and copied him....LOL codereview.stackexchange.com/q/39602/18427
0
Q: Top Active Answerers on StackExchange site

MalachiI created this query back in January to find the top active answerers on CodeReview and thought that it might be a good idea to get other opinions on my SQL coding using a database that we can all access. This will probably be the first of several queries that I post for review, Enjoy. --@DaysS...

 
0
Q: Top Active Answerers on StackExchange site

MalachiI created this query back in January to find the top active answerers on CodeReview and thought that it might be a good idea to get other opinions on my SQL coding using a database that we can all access. This will probably be the first of several queries that I post for review, Enjoy. --@DaysS...

 
@Malachi Why not link to the actual SEDE query on SEDE?
 
@rolfl dang it, that was my plan.....BRB
linked it!
these are kind of hard queries when the db is only updated weekly....
 
3:24 PM
0
Q: Tic-tac-toe in Python

AvneriumI have written a Tic-tac-toe game in python, that contains, among others, a player that uses the Minimax Algorithm. I am not exactly a beginner at Python, but I'm not very experienced with it - so I want to know if my code follows bad practices and style. Any feedback about it is welcome. # Play...

 
@rolfl did you really answer 642 questions in the last 7 days?
 
Busy busy .... ;-)
and no.
I was active then, though, and also, see the bug.
 
I thought something was wrong too when I saw that
DECLARE @DaysSinceActivity INT = ##DaysSinceActivity##
Yeah that variable is not used in the query @Malachi
 
You did see my answer, right?
And +1'd it.... ? Huh?
Nope, not yet!
hehehehe
 
refreshes page Sure did!
 
3:41 PM
that query counts all of your answers.
not just the ones in the last ## days
 
Something I've just been thinking about... is there even a point of having a question tagged as and ?
 
> Compiled Java class files (bytecode) and Mach-O binaries start with hex CAFEBABE. When compressed with Pack200 the bytes are changed to CAFED00D.
Reading about magic numbers on Wikipedia and thought that was funny!
 
And back! with a new phone!
2
 
Nice! What did you get?
 
A LG G3
 
3:53 PM
Sweet, nice big screen on that! (looks at itsy bitsy iPhone 3GS)
 
@Marc-Andre - Your cron code does not understand:
  52 3    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
Nice phone, BTW
 
@rolfl It does not look like a cron expression for Quartz for Apache Camel
I'll update my question to specify that
 
OK, provide some examples, please... ;-)
 
Will do
And this is what I'm talking about Camel -> camel.apache.org/quartz2.html
Will go update my question
Updated with some information and an example of input and output
@rolfl Do you need more ? Am I clear enough ?
 
4:11 PM
Looking
 
4:33 PM
Thanks for the tagging @200!
 
4:46 PM
0
Q: OpenGL text rendering library for Lua built on freetype-gl

DaggFTGL wasn't making me happy, so I decided to try something else. This isn't completely finished; I plan to work more on layouts and alignment, and add a few other things. It should be far enough along to review, though. ./gltext.h (716 bytes in 42 lines) #ifndef __GLTEXT_H__ #define __GLTEXT_H...

 
@Marc-Andre Edited my answer with a loop-swap ;-)
 
Accidentally stumbled onto a conspiracy theory website, looking for images on Google... UFOs... chemtrails... free energy... Freemasons... Secret Martial Law... Who has time for all this crap?
Oh, vaccines too.
 
@rolfl Did you copy paste the same block code two times ? I don't see the size constructor changes.
 
I did... hang on....
 
Thanks for the answer! I guess that CronDateCreator was created a bit too soon. Will check later when I'll add some new functionnality
 
4:54 PM
I have been distracted, is it showing in my answer there?
 
Now it looks fine. I just don't understand what you mean by : Then, your loop logic is off
 
You were doing work for dates that were not used.... you were calculating an extra date.
 
ohhh now I see...
 
I still don't see the point of using dynamic proxies in Java when mocking... Can't you just create an anonymous implementation of the interface and forward the methods there?
 
Oh, the dynamic proxies are/were very useful for computing metrics on call usage on methods.
 
5:01 PM
But then it's on a higher scale, like... checking a whole program (with AOP-stuff), and not for a per-case basis?
 
the proxy process is not intended for regular use cases... it's a hack tool.
2
 
Okay... I thought it would be for regular things, but by applying logic it didn't make sense
 
5:22 PM
my average Answer Score is low..... data.stackexchange.com/codereview/query/160064/…
3
 
5:40 PM
Learning about Rank a little bit, I don't think that I have ever used it. I know there is some SQL that I don't know.
 
@RubberDuck (not here?) it's not 96, it's 95 - one of them is on hold. So 5 VBA bottles on the wall ;)
 
If Visual Studio was a person, he'd be dead at the moment. I've been pulling my hairs for two days now trying to fix references problems. Anyone has a tip on this general problem?
 
how many projects in your solution?
 
15
But 6 of them are irrevelant atm
 
"references problems".... you don't have circular references do you?
 
5:51 PM
Nope, to get into more details, I have conflicts between different versions of the same assembly
And trying to find the exact reference in the 8000 lines of the compiling log is killing me slowly
If I could have a beer at work, that'd help :p
 
hmm.. good luck!
side note..
> Nothing is not the same as c# null. Nothing is the default value. Dim startIndex As Integer = Nothing is totally legal. In this case, 0.
^^ why I don't do VB.NET
totally legal, and totally confusing
@TopinFrassi you don't deploy to GAC do you?
 
is it legacy code @TopinFrassi?
I assume that you didn't write it the first time...
 
bbl
 
We don't deploy to GAC and it isn't legacy code
 
sometimes on one website that I work on, I have to remove the project from the solution and then re-add it to the solution and add the reference to the startup project
 
5:56 PM
Finally, someone else is going to take care of it. I'll go buy him flowers and chocolate ahah
 
lol
@TopinFrassi that sounds weird.....
 
@Mat'sMug that VB thing is nasty, I didn't know about it
@Malachi the flowers and chocolate or the references?
 
@TopinFrassi the flowers and chocolates.....
 
@Malachi well, you wouldn't say no to chocolate right? Flowers are weird though..
I tried your solution to remove/re-add the project but no success
 
did you add the reference back to the Startup project?
 
6:01 PM
<?php
// I might regret this
echo 'Hello, World!';
?>
 
lol
 
@Phrancis You're doing php, you sure are going to regret it
9
 
@TopinFrassi check your project build order and project dependencies to make sure everything is in the right order.
 
I think it's related to a NuGet package that has a dependency on a DLL that another NuGet package depends on, but on a different version
Downside of Azure and their non-stop changing SDK
Anyway, it's friday. This bug will wait 'till monday I think, otherwise I'll set fire to something
2
 
6:23 PM
1
Q: Binary HeapSort and Ternary HeapSort implementation

xgeorgekxThis is my take on binary and ternary heapsort implementation for a university assignment. The code works but i wonder if there are any mistakes or things to improve. class HeapSorter { static int[] array; static int heapSize; //=============================BINARY HEAPSORT========...

 
Hmm. Missing something fundamental here. Parser won't take this.
<?php
$myName = 'Phrancis'

echo "$myName"
?>
 
;
2
 
Thanks @fishy!
 
LOL
4
 
You would think a SQL guy would remember to end statements with ; right?
 
6:26 PM
0
Q: Follow up to Top Active Answerers on Stack Exchange site

MalachiThis is a follow up to Top Active Answerers on a Stack Exchange site Actual SEDE Query --> Top Active Answerers on site Do I have a good understanding of the RANK function? It seems pretty simple. Should I separate this into 2 queries or is having 2 rank columns an acceptable thing? If it ...

 
@Phrancis I only use them in SQL when SSMS tells me too
I should be getting the inquisitive badge sometime today!
 
Nice!
 
2
Q: Follow up to Top Active Answerers on Stack Exchange site

MalachiThis is a follow up to Top Active Answerers on a Stack Exchange site Actual SEDE Query --> Top Active Answerers on site Do I have a good understanding of the RANK function? It seems pretty simple. Should I separate this into 2 queries or is having 2 rank columns an acceptable thing? If it ...

 
hello
 
6:36 PM
hello
 
hello
 
<?php
// Here, have a semicolon.
$myName = 'Phrancis';
echo "Hello, World!<br>";

echo "My name is $myName";
?>
 
6:52 PM
not sure if I need another day or not.... we will see. to get the inquisitive badge I mean
 
@Mat, I would not be heartbroken if they stopped supporting VB. It was only intended to move people easily away from VB6 anyway. I about lost it when I saw an integer set to "nothing"
 

« first day (503 days earlier)      last day (3507 days later) »