« first day (492 days earlier)      last day (3529 days later) » 
00:00 - 18:0018:00 - 00:00

12:00 AM
@SimonAndréForsberg speaking of, your comment here made me lol codereview.stackexchange.com/questions/61426/…
 
I think all of his other questions has been from that site, and lately he has given proper attribution, so I was kinda shocked that he didn't do so this time.
I really think JavaDeveloper would learn more from doing something totally unrelated to trees though, such as implementing Tic-Tac-Toe Ultimate, or making a Sudoku Solver.
 
oh, i thought your comment was tongue-in-cheek. as if he'd left out the standard boilerplate and you asked, "are you looking for code-review, optimizations and best practices?"
 
12:22 AM
Well, I do assume that the answer to my question is "yes", so I guess this was my way of telling him "Don't forget to give proper attribution to where the problem is from"
@mjolka I will definitely ask him that in case he forgets it some time!
Actually, I think there is already a couple of JDQs out there without that specific request.
0
Q: Add two numbers represented by linkedlist

JavaDeveloperGiven two numbers represented by two linked lists, write a function that returns sum list. The sum list is linked list representation of addition of two input numbers. It is not allowed to modify the lists. Also, not allowed to use explicit extra space. This question is attributed to GeeksForGeek...

I remember sometime he changed the order of what he was looking for. That really came as a shock to me.
 
lol
6
 
12:37 AM
i'd think that people would test their code more thoroughly before answering such a popular question codereview.stackexchange.com/a/62178/44723
 
12:47 AM
wtf is the purpose of 'segmentSize'?
 
1:04 AM
Meh, you guys left me at +190 yesterday ....
Go away for a weekend and.... I guess that's why I am short ;-)
 
1:19 AM
Fine, I'll handle all the mod work until then. ;-)
 
2:07 AM
@Mat did you know VB6 has fixed length string declarations? cpearson.com/excel/sizestring.htm
 
yup *3
 
I had no idea. Furthermore, I can't really think of a reason to use them...lol
 
that ^^ ...it's pretty much useless IMO
;)
 
Still, I learned something today. =)
 
0
Q: What is a more elegant way to write/combine these four functions?

DesiHere is my HTML: <section id="artists"> <div class="artists-home" style="display: block;"> content here </div> <div class="ken-gallery" style="display: none;"> <a class="gallery-home" href="#"><img src="img/rewind.png" alt="Back to main gallery...

 
2:44 AM
ok I answered this question but I have a feeling I am way off, because I don't know what all the stuff inside the for loops are doing, anyone want to check it out and tell me if I am right or not?
7
Q: Making loop in CSS Stylus more efficient

user43251I'm not sure if this could be more efficient because I don't think I should need 2 keyframe loops in addition to the for loop? for i in (1..19) .l:nth-child({i}) n = (20 - i) height 0 if i >= 10 margin-left ((n * n) * (1.25/n)) + 17 px box-shadow 0px 0px (n+4)px 0 rgba(40,70,200, 0.5),0px...

@rolfl I almost always go away on the weekends, trying to keep my sanity.... LOL yeah right...
 
 
3 hours later…
5:45 AM
0
Q: Static factory function and lifetime

Michael StumI'm trying to teach myself C++ at the moment, after years of C# and other managed languages. The class in question is a Level in a game, and the idea is to instantiate it from a static factory function. The questions that I have is: Should Level::LoadFromFile return a Level or a pointer to one...

 
6:36 AM
morning @all
 
morning @chillworld
 
6:54 AM
Monking
 
0
Q: Separation of concerns for security checks

omittonesI needed a nice typesafe way to implement security checks for various domain objects and actions that can be performed on them. I had an idea how to do it, so I implemented it as a simple proof of concept. public interface IActions<out T> { T Update(); T Delete(); } public class Actio...

 
 
3 hours later…
9:36 AM
0
Q: One-shot events in C#

lysergic-acidI have a class that performs some long-running operation. This class exposes a Completed event. I'd like clients that use this class to register to get notified ONLY ONCE when the class completes doing its operation. Would you consider this code appropriate to handle this case: public class Tu...

 
9:46 AM
1
Q: Better Object Oriented Structure in Java

ajkumar25I am learning java and i successfully wrote one small console application. I would love to get the experts review on my code and possible bug sources. Question A well renowned hotel has three branches in miami. Namely x,y and z(Actually they gave names).Each has two types of customers. Regular ...

 
10:00 AM
0
Q: List of lists of arrays, zipping, modifying in place

OxinaboxI came back to some old code today and freaked out. I was like "How does this even work, and if it works it can't do what I intended." I ran a few quick tests and confirmed it did actually do what was intended. I know the long term solution is to avoid this situation by having good unit tests -- ...

 
10:19 AM
1
Q: Extracting country data from HTML tables

user3083330I am trying to optimize/improve my coding skills in python The rationale behind this code is to extract some data from files and store them in a dictionary. I tried to comments lines to improve readability. I suppose i may use functions or (x for x in list) in place of [x for x in list] at some...

 
10:33 AM
0
Q: Detect sequence type

Trinh Hoang AnhMy task is to detect the sequence type, which is one of the following: List item Fixed step 1, 2, 3, 4, 5, ... (step = 1) 1, 5, 9, 13, ... (step = 4) Gradually changing step (step increases by a fixed amount after each number) 1, 2, 4, 7, 11, ... (step = 1, 2, 3, ...) 1, 3, 7, 13, 21, ... (step...

 
wth...
 
which one in particular?
 
the "shear amount" that came in without anyone else writing..
and the dumbness of the OP of that SO question I answered...
And that my Skype suddenly got the brilliant idea of not working anymore
 
0
Q: Custom class for a borrowed unique_ptr<T>?

MaxIn C++11, I tend to have master objects that maintain sole ownership of a collection of some children objects. Let's assume these children objects are non-copyable (for instance, boost::noncopyable). Other code needs to access these children objects to do some temporary processing, but not keep...

 
nice first answer btw:
1
A: Better Object Oriented Structure in Java

PlantfaceThere are a couple of issue with your code: HotelFactory is not a factory, it's a domain object. It should be called simply "Hotel" Never ever name your variables or methods x, y and z. Never ever name your parameters a, b and c. You should specifically never ever combine these two. There's a ...

 
10:51 AM
0
Q: Better method of a timer in python?

Richard Dennisi am currently using: class RepeatedTimer(object): def __init__(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function self.args = args self.kwargs = kwargs self.is_running = False ...

 
11:04 AM
0
Q: Is my implementation of insertion sort is correct ?

gues532I'm currently learning about different sorting algorithms and after reading on the concept of the insertion sort of how it's done I've tried to implement it by myself before seeing how it was implemented in the source from which I'm learning. This was my implementation: void insertionSort(int a...

 
11:18 AM
0
Q: Allow entities owned by a certain user to be referenced by other users' entities

TonEI am working on an Asp.NET MVC web application. I'm designing the entities and have become stuck in a thought rut with no other developers around to get me out of it... I have the following (simplified) entities: public class Course { public int Id { get; set; } public string Name { ge...

 
@RubberDuck Are VB6 strings mutable?
 
0
Q: Parsing dates from a webpage

StingervzI have two inputs(TextBox) on my front end. the following code parses them from their string representation to aDateTime object. if it fails it then sets default values. DateTime dateFrom; DateTime dateTo; if (!DateTime.TryParse(txtDateFrom.Text, out dateFrom)) { dateFrom = DateTime.Today.AddDa...

0
Q: Contact form doesn't show confirmation message

The RAHI downloaded a great website template and it is all working fine, except for the contact form. there is no more support for the template, so now I'm here. The form does send an email to me with all the data, but the messages aren't working properly. When the data is filled in wrong, you get a ...

 
11:36 AM
@nhgrif I'm honestly not sure.
 
Because if so, a fixed length string might make sense.
Consider that a string is basically just an array of characters, right?
If I know the max my string will ever be is 50 characters (and I am able to mutate those 50 characters at my will), I might declare my strings as fixed length of 50
So as to never have to realloc when they grow past their current size.
 
That's getting awful "close to the metal" for VB programming.
But I can see your point.
 
I believe Delphi also has fixed-length string declarations, and mutable strings.
 
I have no idea about VB6. But I know in many languages, when you instantiate a mutable array, you can specify a particular capacity.
I'm not sure about strings though.
Anyway, some food for thought. I'm headed to work.
 
-2
Q: Duplicate records in query result

tesicgHere's the query that works: SELECT T_ActionTicketLog.ActionTicketID, T_ActionTicketLog.BarCode, T_ActionTicketLog.UserID, T_TicketStatus.Name, T_OrderTicket.OrderID FROM T_ActionTicketLog INNER JOIN T_TicketStatus ON T_ActionTicketLog.StatusID = T_TicketStatus.ID LEFT OUTER J...

 
11:45 AM
@CaptainObvious Users with > 180 reputation shouldn't ask off-topic questions.
3
 
@SimonAndréForsberg stargreed
 
0
Q: stucks at getting the array value at JSP from js file

vigneshjs file: why does the size of dropdown1 is coming as 1? function savethechanges(){ for(var i=0;i<count;i++) { dropdown1[i]=document.getElementById("sel"+i).value; kot[i]=document.getElementById("kot"+i).value; item[i]=document.getElementById("itemcode"+i).value; if(dropdo...

0
Q: Almost identical methods need refactoring

Stefanos.IoannouI am fairly new with ruby and I was wondering how can I refactor these methods. I call the methods below through link_to: <%= link_to 'Clear Eqnuiries', notifications_clear_enquiries_path %> <%= link_to 'Clear Endorsements', notifications_clear_endorsements_path %> <%= link_to 'Clear Tickets', ...

 
12:16 PM
Monking
 
0
Q: Faster way to check for a string in a array of string

DrakaSANI have a array of object, I need to sort them by time (hours, days or months) and separate the number of new IP. result is a array of object with property time (javascript timestamp), user IP (string). This code does work, but for request resulting in over 10k element, it is slow as hell. I th...

 
Monking @skiwi
 
12:36 PM
@SimonAndréForsberg How nice would it be...
but today it seems to be quite some questions..
 
12:55 PM
2
Q: One-shot events in C#

lysergic-acidI have a class that performs some long-running operation. This class exposes a Completed event. I'd like clients that use this class to register to get notified ONLY ONCE when the class completes doing its operation. Would you consider this code appropriate to handle this case: public class Tu...

These answers
Especially Memleaks, I'd argue that's worse than his current solution
 
Okay @ducky..... struct or class? struct or class? A store doesn't really have any behavior, it just has data.... so a struct?
4
 
is this C++ or C#?
@RubberDUck
 
Let's pretend it's C#. It's actually VB6.
 
@RubberDuck It only starts to really matter once you start creating loads of instances of them
But as VB6 is so ancient, I don't know if it holds there
 
struct and class are totally different rather than 'just data' types
struct has all members exposed by default and is passed by value
class has all members private by default and is passed by reference
You have to consider which is more suitable for your needs
struct is great if you can nail down spatial locality
 
12:59 PM
Right and since I'm just passing data around, I want a struct.
 
@DanPantry That are reather complicated assumptions for a language like VB6 ;-)
 
@DanPantry What do you mean by that?
 
@RubberDuck @skiwi I remember reading that in the .NET reference
obviously not sure if that applies to vb6
but certainly in .Net it's the case
> √ CONSIDER defining a struct instead of a class if instances of the type are small and commonly short-lived or are commonly embedded in other objects.

X AVOID defining a struct unless the type has all of the following characteristics:

It logically represents a single value, similar to primitive types (int, double, etc.).

It has an instance size under 16 bytes.

It is immutable.

It will not have to be boxed frequently.
 
> It logically represents a single value, similar to primitive types (int, double, etc.).
 
Also there's some talk of struct being stack-allocated and class being heap allocated but I heard some hear-say about that being a general case so take it with a pinch of salt
 
1:01 PM
So, a store has a name, a number, and two dbkeys.
 
I didn't see your entire use case, just the comment about struct vs class :-)
 
Class then?
 
@DanPantry Yeah, I imagine its true for all recent languages, not too sure about C++ but I don't think so, definitely holds for C# and in future for Java
 
@RubberDUck unless it satisfies all of the constraints above AND you're tight for speed I would say stick with class
struct is only really useful for spatial locality
 
Yeah. A class, because then I don't end up with a "CustomTypes" module.
Thanks guys.
 
1:03 PM
Say you have a position (x, y) then you shouldn't even think about making it a class
 
Vectors are generally fine
generally speaking vectors should be immutable anyway
So using a struct for them does make sense
if your data is > 16 bytes then you're larger than the size of a reference = woops!
 
Yea... In one Java 3D library I made some months ago I have a really ugly version of mutable vector classes
 
YMMV
this is where i realize i know more c# than I thought I did
4
 
@DanPantry That's the case for non-GC languages though? For C# and Java (garbage collection involved) it also starts to come into play
 
@skiwi This is the .NET referenceand specifically makes a reference to the GC
so I assume it concerns C#/VB (not Java!)
 
1:05 PM
0
Q: Sorted vector (aka flat_set) for objects (pointers) with custom embedded key (functor used)

firdaI was asking for such structure on SO, but got only link to boost::multi_index as an answer. So, I decided to write it myself (and plan to include the final version there as self-answer, while probably rewriting/rewording the question as well - it definitely needs it). I wanted both fast and mem...

 
> The first difference between reference types and value types we will consider is that reference types are allocated on the heap and garbage-collected, whereas value types are allocated either on the stack or inline in containing types and deallocated when the stack unwinds or when their containing type gets deallocated.
(reference = class, value = struct)
I don't know about Java, as far as I know everything is boxed there near enough so woudln't surprise me if everything was on teh heap
 
Correct, but garbage collection (which is for reference types) takes time and may block your program in extreme cases
 
but I don't know for sure, someone please confirm
@skiwi Yes, true. But you're going to hit GC anyway.
 
@DanPantry int is unboxed regular value type struct primitive, Integer is the reference type version
 
You have to balance the (performance) cost of GC vs the performance cost of allocating many value types at once
the GC is fairly smart too - but the allocation of a value type is straight forward
either way this shouldn't be a consideration unless you're doing a lot of work
 
1:07 PM
I think allocation cost of both are similar, but deallocation reference types can be more costly
 
f.e I have a program in work that regularly processes millions of records from a database and it uses classes
@skiwi It depends how much a struct touches
 
Doing as many as possible calculations with matrices and vectors in Java in a certain timeframe without value types turned out to be a bad idea
 
If a struct touches a lot of functions
It gets replicated that many times
if it's passed in via parameters, of course
In that case struct becomes more expensive (because value types are copied)
if the lifecycle is short then go for struct
 
Well yes, you mean that all components of the struct need to be put on the stack (and passed into registers)?
 
@skiwi correct
but if the type touches many things then a reference becomes 'cheaper' in the long run
even counting in GC
 
1:09 PM
As far as I think, structs are really the same as individually typing out the components, but then having a nicer notation
 
define component here
 
struct Position { int x, int y }
There x and y would be the components
 
yes, I agree, a Vector (mathematical vector) is perfect for a struct.
 
You hit the chat limit? ;)
 
I should condense my sentences into one sentence I think
 
1:11 PM
Or the chat is just being picky
 
Perhaps its' telling me to write another blog article
 
Monking
 
> Unrelated to your main question, but for thread safety, it's recommended you take a local copy of the event, like so:

`var handler = Complete;
if(handler != null)
{
handler();
}`
 
@DanPantry: an event implementation is an implementation of the observer pattern. If anything, using IObservable can be considered more of a reinvent-the-wheel type of thing
 
@JeroenVannevel I know that. But IObservable allows you to use composition through Rx.
And also has a notion of OnComplete - which EventHandler does not.
OP wanted an implementation of something that would fire a one-shot event to notify that something had completed. The correct approach there is to use a Task and await, not an Event
but I mentioned IObservable in case he was doing other work to do with a data stream inside of that function
I have nothing against events, but I feel using an event in this situation makes the code harder to follow especially with TPL available
And for christ's sake his method is called DoLongOperation
that just screams Task + async/await
 
1:26 PM
Aha, I re-read your answer and I see what you mean with the Task<T>
 
I did mention that you rightly pointed out it is a nimplementation of event, though.
 
How does this work with multiple subscribers? The first example won't work or you'd have to know them all beforehand and put them in the ContinueWith block, right?
 
IObservable?
or Task?
 
Task, first code sample
 
I would assume that each invocation of DoLongOperation with the Task return would in turn create a new invocation of that method.
In other words each 'subscriber' wouldn't be aware there were other subscribers, and it would spin off their own calls
I mutilated that sentence but I hop ethat makes sense
 
1:31 PM
Yeah, that's what I figured as well. But I'm not sure that's something you want
with an event the process will be executed once and then sent to all subscribers
 
Monking!
 
with the Task, you execute the process for each subscriber
 
@Jeroen that's why you would cache the value
IObservable.Create does this implicitly iirc
What you should really do in the case of multiple subscribes
subscribers
is make the return value lazily evaluated
as in, make a Lazy<T> and return that
You make the Lazy<T> upon creation of the class (so there is only one instance of it)
That way multiple subscribers get the same cached value after the first performance hit
 
Yeah, that would be a good solution
 
Or you can use Observable.Create from Rx which will implicitly cache the values it generates from it's catamorphism
f.e Observable.Create(() => GetFromDatabase(1)) will return entity of ID 1 from the database
but it will cache that entity for each subsequent subscriber
 
1:35 PM
Never worked with Rx but yeah, that's a good one as well ofcourse
 
It's really, really useful, it's basically LINQ for events
but it is complex
This definitely seems like a blog psot lol
FWIW IObserver/IObservable<T> are both part of the standard .NET libraries as of 4.5 (4?)
 
2
Q: Is this algorithm efficient for the 01Knapsack?

CodeWriterThis code uses recursion to solve the 01Knapsack problem. It evaluates all the item permutations that can be added to the knapsack and checks if it gives the maximum profit. What else could have been used to get a faster solution? public void fillKnapsack() { int thisWorth = knapsack.calcul...

 
Thanks a bunch, hibernate...
I am sure I want about 7 nested exceptions if I violate a database constraint
that sounds like a good idea to produce meaningful error messages..
 
they're telling you about your exception-al good work in breaking it!
3
 
tempted to star, but won't.
3
 
1:48 PM
I got a BCR for my lip today and it is honestly the fiddliest thing I have ever seen
 
BCR?
 
ball-closure ring
it's basically a ring that is held together by tension with a ball in between it
 
As an aside: javax.ejb.EJBTransactionRolledbackException is not that informative...
2 mins ago, by Dan Pantry
user image
 
in order to put the ring on you have to release the tension on the ball, put it in, then pulll open the damn thing and put the ball back in..
and the ball is about 5mm diamater
and, yes? :3
@Vogel612 It's better than my exceptions in work. throw new Exception("FLY YOU FOOLS")
 
okay nevermind....
 
1:53 PM
in TCG Creation, 20 secs ago, by skiwi
So what's the most meaningful meaningless version number I could give the parent pom?
 
btw, If I fix dat constraint violation after I got the exception and resubmit I get a different exception. And that is called PersistentObjectException
 
Because, logic.
 
@skiwi 0.0.1-SNAPSHOT
 
@JeroenVannevel further to our discussion the other day on encrypting network streams I settled with the decorator pattern
 
my new favorite picture for posting on dumb pictures on facebook...
 
1:57 PM
1
Q: tydying up nested loops and if statements

HoulahanJust trying to tidy up a messy function but cant see anyway of doing so What i have is a outer loop which loops through a list of strings, followed by another loop which loops through a list of filters and if the current column is the current filter in the list of filters it then applies this fi...

 
> Semantically speaking, an event is a class yelling "DUDES, I JUST DID whatever"
2
 
@Vogel612 I hope that whatever is meant to be Event<Whatever> and not Event<ANYTHING>
The rest of what he said is right though
Even if his code isn't thread-safe
 
meh, who needs threadsafety in your everyday nothing application
 
DoLongOperation implies that he is using threading
If so, everyday nothign application or not, there is a high potential for race conditions or data errors
o/ @bazola
 
Does anyone of you know unity3d ?
 
2:01 PM
I know a little bit.
 
@DanPantry k, If I post a unity question I'll ping you
 
hey @DanPantry
 
> Achievement unlocked: Star all messages on the sidebar
6
 
Nice, something broke all our dealer web portals... looks like an infinite loop or some time out error
 
@Phrancis Those issues can happen on staging environments
 
2:10 PM
> There was a problem authenticating your account. Please do not bookmark this page. (Error 10)
4
 
1
Q: Sorted vector (aka flat_set) for objects (pointers) with custom embedded key (functor used)

firdaI was asking for such structure on SO, but got only link to boost::multi_index as an answer. So, I decided to write it myself (and plan to include the final version there as self-answer, while probably rewriting/rewording the question as well - it definitely needs it). I wanted both fast and mem...

^ Is this code badly structured or is it like how C++ is supposed to be?
So Jon Skeet is going first, right? — gunr2171 Sep 3 at 19:04
That topic is exactly why we cannot have the nice things, nobody is giving others room to experiment with things.
 
2:27 PM
@skiwi I'm not quite sure. It doesn't look too good to me, though.
 
looks like most open source C++ I've seen
 
@Jamal I just know that C++ at first glance (especially when templates are involved) can look very confusing... But this looks a little bit too confusing
 
Does C++ not use indentation?
2
 
The curly brace use in Vector of Pointers is a little weird.
 
Wait, I think it was my browser, now I see the indentation. Stupid IE8
 
2:35 PM
Why are you using IE8
3
 
@DanPantry guessing company policy.
 
I have Chrome, TOR and IE on this PC
 
^^ that
 
I've never heard of a company enforcing a browser
I guess I can understand though
 
You wouldn't believe what kind of stuff they push through here
 
2:36 PM
@DanPantry reminds me of my old school... They had FF 3.0 / IE 5 there as only available browsers....
in the year 2012 mind you.
 
Most of our websites have broken features if you use anything but IE8. I seriously need to get out of this place
4
 
@Phrancis Thats really impressive
 
@Phrancis Nahh, you can use it to your advantage
 
Many of them won't work at all without IE8
@rolfl how so?
 
@Vogel612 In my old school you were suppsoed to use IE because the IT guys had set up a proxy through the settings so you would have your results filtered
 
2:37 PM
@Phrancis That's not just you. They switched us to chrome a few years back. It's taken them that whole time to get half of our webapps switched over.
 
To the point where you could either disable the proxy through IE settings or just download a Firefox .EXE and get around the filters
 
@DanPantry dem proxy settings... You could disable them and browse feely..
 
If MSoft can convince them to lock in to an obsolete product, and not upgrade and move on for .... 5years.... then surely you can convince them to pay you more, and not have to come to work 3 days a week too.
6
 
@Vogel612 Administrators managed to work out that hey, letting users have access to proxy settings is dumb, but they never applied it on a network level so you would just install Firefox and circumvent it
I honestly expect more from IT techs
They could have set the hosts file at the very least, given that no users had access to the %WINDOWS% dir
 
^^^ not really, they probably did it intentionally so that they could browse too.
3
 
2:44 PM
I meant to say, Bounty on this PHP question
 
"answer this question or I'll write bad PHP as a torture mechanism"
3
 
@Phrancis I doubt that this question would need another answer...
@DanPantry three dashes...
 
@Vogel612 I was just testing you
 
@DanPantry I was about to challenge that.... is there such a thing as good PHP?
2
 
I am disappointed, I've prepared a question for review, but at the moment it's only... 19786 characters!? It's not like me to post such a question with less than 20K characters!
4
 
2:52 PM
The best kind of PHP is PHP that's not written, @rolfl
 
@rolfl I ran out of wit, so I can't even think of a joke.
 
0
Q: Sorting an int[] array using insertion sort algorithm

gues532I'm currently learning about different sorting algorithms and after reading on the concept of the insertion sort of how it's done I've tried to implement it by myself before seeing how it was implemented in the source from which I'm learning. This was my implementation: void insertionSort(int a...

 
@Dan witty leaks?
 
monking!
 
2:53 PM
@Mat's Mug |:
 
@Jamal there you go
 
Yay! Now to try to get 3K more before the end of February.
 
Monking @Mat'sMug !
 
Hi @Mat'sMug !
 
0
Q: What is the best way to decrease the runtime of this Project Euler solution?

Yann4Spoilers for Project Euler problem 23 I have written a solution to problem 23 of Project Euler, and after doing some testing and editing, I've managed to get the run time down from 1.7443 seconds to 1.56616 seconds. The problem is Find the sum of all the positive integers which cannot be wr...

0
Q: I am trying to make a mancala clone. I am getting an error. can you help me resolve the issue?

programmerit says "reassignment to val" at the line that I marked with a comment. How can I fix it? (I am using Scala) val spaceVect = Vector(new space, new space,new space,new space,new space,new space,new space,new space,new space,new space,new space,new space,new space,new space) val textVect ...

 
3:01 PM
Hey Mug, what do you think of this class StoreModel?
Public Name As String
Public Number As Integer
Public CurrentKey As Integer
Public HistoricKey As Integer
Better as a type you think?
 
@RubbetDuck VBA?
 
Yeah.
 
Types are a PITA, they're not really structs, you can't easily pass 'em around.. I'd go with a class.
 
I am trying to write a good question. I have not read the website guidelines. My code is broken can you please gimmeh-the-codez?
3
 
Okay. That's what I did. It just felt silly to have a class for four public properties.
@Phrancis I think you meant
> I am trying to write good question.
 
3:05 PM
@Phrancis ......try harder?
 
Right...
val spaceVect = Vector(new space, new space,new space,new space,new space,new space,new space,new space,new space,new space,new space,new space,new space,new space)
        var textField1 = new TextField();var textField2 = new TextField();var textField3 = new TextField();var textField4 = new TextField();var textField5 = new TextField();var textField6 = new TextField();var textField7 = new TextField();var textField8 = new TextField();var textField9 = new TextField();var textField10 = new TextField();var textField11 = new TextField();var textField12 = new TextField();var textField13 = new Tex
 
Trying for wit here too:
@gues532 - you are not wrong. Sort algorithms differ in small ways, and, in this instance, that small difference is significant in that it is what defines it as an insertion sort. Sort of like saying I have this 'blue' car, only it is a 'green' car. — rolfl ♦ 1 min ago
 
Untag me @dan
 
Or, use the Upload button and select From Web and paste there
 
3:09 PM
Instructions unclear. pressed backspace. went to previous page. woops
 
Is that guy saying "magic"?
 
Yes
OK, let's crack open the truly community-dividing questions
 
Nice, our IT people said this about our websites:
> We are going to add more memory to this server to speed up the site. This will be a week out do to us needing to take the server down to do this and we'll have to give the business notice.
 
in this day and age, given that I know Java, C#, Ruby, etc; is it worth learning C++
> do to us
 
Worth learning: yes.
 
3:16 PM
I categorize "worth learning" as, "will it get me a higher paid job"
 
If nothing else it will help you make more informed decisions later.
The way you approach your work, and dedicate your time to it, will have more of an impact on your salary than the language you use.
 
@rolfl that's true to an extent, but obviously a software shop that uses C++ would likely pay more than a.. oh, I don't know.. energy company that uses .NET ;-)
Not that language is a big factor in that but it's worth asking
 
PHP at the top?
I can understand Obj-C and Java due to mobile platforms but why is php so high
 
@DanPantry because about all "standard" web-dev server side is still mostly PHP...
 
3:23 PM
Hmm my progress bar just returned 102%.... I think there may be a bug.....
3
 
@Vogel612: I don't do that 'standard' stuff so I wouldn't know :p
 
Not sure I believe that one though, no C/C++ datapoint
 
Ruby on Rails at $100k?
Is 100k a lot in the US? I'm British and at £18k (entry-level wage).
$100k for rails to me sounds like a fair amount, just wondering what the benchmark here is
 
@RubberDuck Once, my brother managed to download 103% of an Antivirus software...
 
lol... At least I'm not the only one writing crap code then.
 
3:27 PM
anti virii software, now with 3% more fat
 
@RubberDuck that reminds me of...
user image
3
 
@Mat'sMug BRB new LinkedIn photo
 
Getting better everyday. I know this, because looking at this old bug ridden tangled mess irritates me. And I wrote it.
2
 
@RubberDuck I'm tempted to upload the full repository of the first piece of software I wrote commercially
 
Better knowing that there are bugs and refactoring than not knowing about the bugs, right?
 
3:31 PM
True @Phrancis.
Bugs be gone! Now if I could just find a way to get rid of this damn global variable.
 
highlight
delete
 
lol
 
red-text everywhere, but that's ok. the global variable is gone :^)
2
 
lol
2
I would like to keep the app functioning @DanPantry...
 
double lol-stars
great use of starring right there :p
LinkedIn: "where did you work before your current company" uhhhhhh
 
3:34 PM
15
A: What's a Zombie? And what are the many other memes of Code Review?

rolflMeme: LOL - AutoStar Originator: Mat's Mug / Jamal Cultural Height: The 2nd Monitor Background: "lol" somehow got targeted at this point here (the first starred lol): retailcoder: lol (darn, again) Followed shortly by: Jamal: lol (don't star that) And then the tradition was cement...

 
0
Q: Is this the correct use of oop in python?

the-sizixeI am comfortable with the procedural style, and learning the object oriented, so I have done a small rock paper scissors game in both styles. This script is in procedural style. and this one is in object oriented style. My question is simple, did I implement this little game correctly object ori...

 
> Score: 42
Created: Apr 28 at 2:03
Clicks per day: 6.97 (927 total)
^^ hadn't checked in a long while.. still doing great!
 
for line in code
  if line.smells
    improve(line)
Genius marketing ^
 
blame thank @codesparkle for that ;)
@rolfl has it been long enough now?
44
Q: Open Source Advertising - Sidebar - 2H 2014

Grace NoteIt is now June 2014 and thus a new edition of our Free Vote-Based Advertising for Open Source Projects. We are clearing the leaderboards for the second half of 2014. Here is your chance to create a Free Vote-Based Advertisement for an Open Source Project. Create a graphical ad for an open source...

What a run! More than 900 people clicked our ad on Stack Overflow during this round. Can't we participate again with a new ad? The instructions seem to indicate that the restriction is only per ad, not per project/site. Am I wrong? — codesparkle Jun 20 at 13:10
 
3:52 PM
// fixes detached entity passed to persist after
// transaction-rollback
currentLocation.setId(0);
locationService.add(currentLocation);
hmm... Is that a good comment or isn't it?
 
why would an entity need to be persisted after trx-rollback?
 
@Mat'sMug because users can correct the mistakes they did...
and the controller holding the entity is SessionScoped...
 
1
Q: Controller code using the koa framework

xpepermintI would like to gather ideas on how to refactor the JavaScript/NodeJS controller code below to be more aesthetic. The code is using the koa framework thus I use yield commands. I also use mongoose (I wait for 3.9.2 which will support promises). As a Ruby on Rails developer, I'm searching for a ...

 
@Mat'sMug thinking it through, and checking some background stuff.
 
I think our community ad on SO was somewhat misplaced - while successful and nicely scored, SO ads aren't for community ads, they're for open-sourced projects... but at the same time, SO is probably the best place to put up a community ad for CR...
...and it's still up on Programmers.SE, and 2nd highest-scored, too... but crappy clicks metrics.
 
4:15 PM
0
Q: signal handling using threading python

user3547134I am trying to check a counter status in a certain time duration using signal handler in python. I am trying to see if the counter value increases by 1 within 3 seconds and also if it increases by 3 or more in 0.5 seconds. Then I will print some data based on this. The problem is that the program...

0
Q: Bootstrap CSS Container Layout

bitoiuI've always been used to write my own CSS but I decided to give a go to twitter-bootstrap and I want to make sure I'm not using more HTML containers that I need to: This is my code for a single element of a list: <div class="row form-group"> <div class="col-md-4"> <input type="email" cla...

 
The bosses brought us pizza for lunch, yay :D
We were supposed to roll out a new program today... but they... ran into some... technical issues lol.
 
holy crap this must be possible in an easier way:
catch (EJBTransactionRolledbackException e) {
	Throwable root = e.getCause();
	while (root.getCause() != null) {
		root = root.getCause();
	}
	if (root instanceof java.sql.SQLException) {
		// duplicate location-name
		resources.produceFacesContext().addMessage(
				"code",
				new FacesMessage(FacesMessage.SEVERITY_WARN, "Fehler:",
						"Der Standortname muss einmalig sein!"));
	}
	success = false;
}
well it works but.... holy crap it's borken...
 
4:31 PM
@Vogel612 If you find a way, let me know. I'm pretty much doing the same thing somewhere...
 
@SimonAndréForsberg mind you, that's controller code...
 
Except for the part inside the handling of the SQLException
 
I think I should hide it in the service layer and throw a custom checked exception..
 
Wait a minute... are you catching SQLException in order to detect duplicates?
 
4:43 PM
You should only post an answer if you'd like to show the final solution, but without seeking another review. For further review, just post a new question and leave the code here intact. I understand that the system can be inconvenient, but we're trying to work with it as best as we can. — Jamal ♦ 2 hours ago
@Jamal Personally, I believe that our Q & A format is a benefit, not a handicap.
3
It makes most people think a bit harder before asking again, rather than making a simple change and asking "how about now?" "OK, now I think I've got it!" "How about now?"
4
 
@SimonAndréForsberg actually I am catching a org.h2.jdbc.JdbcSQLException, which is a subclass of java.sql.SQLException. I think there could be some false positives, but I doubt it's that much of a problem...
Sure I could handle the ConstraintViolationException that has the JdbcSQLException as root cause, but then I'd have to additionally complicate the while loop to get the "root cause"
 
5:02 PM
@200_success Fair enough. I am okay with the way things are now, more so than in the past. It is easier to deal with new questions rather than messy updates to the question. I'm glad I no longer support that policy.
2
 
@SimonAndréForsberg expect a SO question on the matter tomorrow...
TTQW (since an hour, but alas)
Toodles!
 
Which (sort of reminds me)... didn't Pops say that he would post some code here? I'm looking forward to downvoting upvoting it.
 
5:57 PM
Ugh.. why would the MySQL provider for Entity Framework throw a random exception saying "Provider failed on open"?? Would I get the same issue with SQL Server for a backend?
 
But if not, maybe try DBA SE site
 
00:00 - 18:0018:00 - 00:00

« first day (492 days earlier)      last day (3529 days later) »