« first day (306 days earlier)      last day (3704 days later) » 

12:00 AM
RELOAD!
 
Hmm, just saw some stats on the chat: @rolfl Makes up 16% of the content in this room, @Jamal 10%, myself 8%, @200_success @Corbin @konijn 1%
 
@syb0rg where do you see that?
 
@rolfl Hover over our avatars: chat.stackexchange.com
 
Ahh... interesting.
Need to get a life, I do.
2
@Mat'sMug is worse than me .... whew. I have nearly 9K messages here, he's more than 10K
 
4 more upvotes until "Established User":
Hello @JamesKhoury
 
12:08 AM
0
Q: PHP class to geocode an address

SteveWe have a geocoding samples github repository. The snippet below came through in an email and I am not very familiar with PHP. I'd like to add this as the PHP example in the samples repository but would like someone to review it first. The idea is that some other php dev can use this as a startin...

 
I just went over 8k on SO.
 
hello any idea how to do a webchat with cam, any reference or link will be great. is to make one to talk with my family in cuba, skype, hangout are bloked there
 
@nhgrif Santa may have seen that, and may have acted accordingly ;)
@EmilioGort Facebook has a video chat ability.
 
it work trought skype, and is blokecd in cuba the video part
 
Facetime?
 
12:18 AM
I wish this person would come back and improve his question so it could be reopened... codereview.stackexchange.com/questions/43056/…
 
the videocall in facebook
 
@EmilioGort Yeah, could you use Facetime though?
@nhgrif He's an active user on SO, strange...
 
we are trying in the facebook chat the video part
when the popup up it says facebook+skype and the call end up
remember the conection in cuba is trough dialup
56kb
what technlogie are using to make a webchat with video
I'm looking in google but no look
 
Video over 56kb is not going to b very satisfactory.
 
it's better than nothing
 
hangout it's bloked iin cuba
I want to make one for me and my family, in my hosting
what I lkie to know what is the way to do one
javascript, what, any reference
 
Well, you're somewhat screwed. ... create a VPN to a non-Cuba system, and proxy your data through there.
But, it is off-topic for 2nd-monitor..... but, when you have it all working we will be happy to consider a code-review ;-)
 
0
Q: Calculating the joint probability of n events from a sample sequence of occurrences

mhong19414I'm writing an algorithm to take in a sample list of sequences of events, calculate 1-step transitional probabilities from the sequences, forward or in reverse, then calculate the joint probability of n events occurring from those conditional probabilities. Eg. if the sample list of sequences is...

0
Q: How to recursively remove all adjacent duplicates

Warrior PrinceFor this problem, I came up with this ugly solution of appending the characters to the output and in case there is adjacent duplicate deleting from the output. Considering StringBuilder.deleteCharAt(i) is O(N), performance is : O(N) + O(N) = O(N) Please critic this, if this is a right way. publi...

 
12:51 AM
0
Q: Return the largest palindrome from th饿 string

LoveHere is the question, find the largest palindrome from a string. Ex: "ABCBAHELLOHOWRACECARAREYOUIAMAIDOINGGOOD" Result: ILOVEUEVOLI I am not sure the efficiency of the algorithm. static void Main(string[] args) { var str = "ABCBAHELLOHOWRACECARAREYOUILOVEUEVOLIIAMAIDOINGGOO...

 
1:07 AM
@syb0rg 1%, eh? I'm kind of surprised it's even that high for me.
 
 
1 hour later…
2:12 AM
Hello @user2745681
How is your program progress coming along?
 
wow SE wouldn't log me into chat... something weird just happened.
 
I still don't know how can I implement a Finite Automaton for my game.. :(
 
@user2745681 Just a basic DFA?
 
@user2745681 I said it was not finite... I wonder if it is....
It is certainly not a DFA.
 
NFA??
 
2:23 AM
can always convert an NFA to a DFA using subset construction
 
Maybe NFA.... maybe, but there is an infinite input stream...non-deterministic.
Crap, my CS is somewhat rusty.
 
sorry, I'm kind of butting in here...what's the problem/question? :)
 
3
Q: Finite Automaton for a Typing Game

user 2745681I'm creating a game that implements a finite automaton and I don't know if I'm doing it right. Any advice? Game class import java.awt.Canvas; import java.awt.event.KeyListener; import java.awt.Dimension; import java.awt.Graphics; import java.awt.event.KeyEvent; import java.awt.image.BufferStrat...

@user2745681 where would you describe the boundary of the FA? 'Where' is it in your code?
 
I can't really see anything resembling an automaton there...generally, a simple way to do it is to have a set of states (you can create a State type, or use whatever you want), and then just have a Map<<State, Transition>, State>
then there's some mucking around with setting a start state, and a set of final states
 
@rolfl I compare the first letter of the text to the input and when it matches it will set that enemy as the target and all the input will go to that enemy until its done.. Sorry for my bad English..
@Yu
 
2:38 AM
@user2745681 This won't run as I haven't given it a main, but if I had to write a DFA, I'd probably start with something like this: ideone.com/kVys9f
err, or fixed up with some less stupid stuff
 
@user2745681 I don't see anywhere in the code in the question where you are doing that.
 
(never mind the multiple public classes, I just can't split it up using an online compiler :)
 
@rolfl I'm sorry I will update my code in question..
@rolfl I updated it, it is the public void keyPressed(KeyEvent ek) {...}
 
For reference here:
public void keyPressed(KeyEvent ek)
{
    int key = ek.getKeyCode();
    char character = Character.toLowerCase(ek.getKeyChar());
    boolean result = isValid(key);

    if(result && !target)
    {
        for(int i = 0; i < e.size(); i++)
            if(e.get(i).getFirstLetter() == character && e.get(i).getOnScreen())
            {
                enemy = e.get(i);
                targetText = enemy.getText();
                enemy.addIndex(1);
                target = true;
                break;
@user2745681 By the way, modifying your code once it has been reviewed is discouraged.
 
is if(result && !target) in Java preferred to if(isValid(key) && !target)?
Or is result used again later?
 
2:51 AM
@nhgrif Yes..
 
result is reused
But it's a lousy name.....
 
What is e? And ek?
 
more badly named variables ;-) .... you have to look at things in the context of the full code.
 
e is the Linked of Enemy and the ek is the input character..
 
I wasn't asking.
You need to think about why me, or anyone else looking at your code might ask that.
Consider the situation where you're writing this as part of a group project. You've got a logic error in this section of your code and you're having trouble spotting it. You need someone to help you take a look at it. How much time are you willing to spend explaining what all these variables are and mean?
4
Meanwhile, your IDE probably autocompletes and there's no performance setback for verbose variable names... the variable names aren't even used by the code except to distinguish this variable from that. To the processor, they're all just memory locations.
 
3:03 AM
I'm sorry, I'm a beginner only..
 
@user2745681 We know. That is why we are critiquing you. We only mean to make you better.
 
Right. I wasn't trying to insult. Generally speaking, on CodeReview, if I ask a question like that, it means you need to think about improving readability.
On SO, I wouldn't ask the question, and decide whether or not I wanted to try figuring out what the variables were. But here, the questions are asked by people who want to improve their code, and one way to improve your code is by making it more readable.
Someone who knows more Java than I can focus on good-practice and performance stuff and what not, but pretty much anyone can comment on readability.
 
public void keyPressed(KeyEvent inputChar)
{
int key = inputChar.getKeyCode();
char character = Character.toLowerCase(inputChar.getKeyChar());
boolean isInputValid = isValid(key);

//@target is a boolean and a default value of false..
if(isInputValid && !target)
{
for(int i = 0; i < enemyList.size(); i++)
if(enemyList.get(i).getFirstLetter() == character && enemyList.get(i).getOnScreen())
{
enemy = enemyList.get(i);
targetText = enemy.getText();
enemy.addIndex(1);
target = true;
break;
}
}
else if(isInputValid && targetText.charAt(enemy.getIndex()) == character)
 
That's quite a bit better on the naming.
 
thanks, Santa
(that was really fast, by the way)
 
3:14 AM
Sorry for the indention I can't fix it in the chat box..
 
@user2745681 When you copy large amounts of text into the chat, another button should pop up that says "fixed font". Press that before you "send" next time.
 
What's the getText() method? I thought Java used toString()? Or is this somehow different from what a toString() method would be?
 
Okay @syb0rg :)
@nhgrif getText() returns the assign text in a enemy.
 
@user2745681 Also, if you plan on sticking around this chat room (which I hope you do), you should get a more "personal" avatar. Right now there is another user in this room (Garry) that has a similar avatar.
 
I think an actual username is more helpful than an avatar.
 
3:22 AM
That too ^
@user2745681 Keep in mind it will take a bit for the chat to update your name.
 
I think you can just leave and come back, right?
 
Yeah.
 
I thought a script had to run first
I remember we had trouble with this when lol.upvote changed his name to Mat's Mug.
 
Guess you're right syb0rg.
 
It didn't work.
 
3:26 AM
@user2745681 It will in a bit.
 
Haha :)
 
omg... I think ObjC actually has a way to properly order/sort numbers in strings quite simply
as in... a1.txt < a3.txt < a20.txt < a100.txt
A normal alphabetical search puts that as: a1.txt, a100.txt, a20.txt, a3.txt
 
You mean like the std::sort of C++?
 
Maybe, I don't know.
 
Haha
 
3:36 AM
@syb0rg ... you would have to write a comparator to get that functionality out of C++ std::sort
 
@nhgrif @syb0rg do you have an I idea now?? Sorry I'm in a rush now >.<
 
@rolfl It uses operator< by default, which is lexicographic ordering for strings
 
I presume 'quite simply' in ObjC is simpler than that.
 
Yeah.
 
actually, technically it uses std::less<T>, which generally just forwards to operator<
 
3:37 AM
@Yuushi exactly.... and he's not sorting lexocographically
He's sorting file100.txt after file2.txt
 
@rolfl ...that'll teach me to read the actual output :)
whoops
 
hehe it is late here too ;-)
 
it's 2pm here :P
 
9:40 here
 
it's bedtime here
 
3:38 AM
(I'm not wrong alll the time when C/C++ is involved ... it just seems like it)
 
[someString compare:otherString options:NSNumericSearch] returns nsordering constant for appropriate numeric order
Alphabetical first, but it will compare numbers in the way a human would compare them, 100 > 2
so you don't have to use leading zeros
 
@user2745681 What are you trying to accomplish?
 
oh...oohhh.
 
ah ah aaaaah
 
to implement a finite automaton in my game..
 
3:40 AM
At the moment 'changing avatars' and usernames.
 
Oh, sorry.
I thought we were making monkey noises.
4
 
me too
 
11:40am here..
 
topic: ....
 
How do I do tags in chat messages?
 
3:42 AM
@user2745681 Non-deterministic or deterministic?
@nhgrif [tag: stuff]
no space
 
okay, thanks.
 
@syb0rg ND..
 
@syb0rg I can't run it.. too many errors
 
@user2745681 Are the errors not fixable?
If not, look at how the code works, take the concept, and implement it into your own code.
You don't have to compile it, you just have to understand it.
 
3:55 AM
@user2745681 - you may find this whole thing more frustrating than it is worth.
I recommend getting someone local to you, are you a student?
Get someone to sit with you, and figure it out.
Code Review is not the right place for collaboratively building things.
 
Yeah I'm student, Thanks for the help.. :)
 
Building things as significant as yours in a chat window is error prone, and not very effective
 
What about Ideone?
 
4:31 AM
hrm, 20 lines of comments for 4 lines of code
that'd usually be a warning sign, but...argh...cannot...simplify
 
4:54 AM
@Yuushi There's somebody or other's law of preservation of code (or something like that) that says as you shorten the code, the comments lengthen to compensate, so the total length remains (approximately) constant.
 
@JerryCoffin Heh, haven't heard of that one before
 
comments execute fast and compile down pretty compact though
Δ LOC = -Δ LOC ( LOC = Lines of (Code|Comments) )
 
@rolfl How things have changed since the days of pure interpreters running on 1 MHz processors...
 
Turbo button, anyone?
Mind you, I have some real C experience on PIC Microcontrollers... and I was running one with serial port at 32768Hz
 
@rolfl Turbo buttons came much later...
 
5:07 AM
think our first computer had a CPU that was clocked at about 4MHz...so I'm not quite as old school :P
 
@Yuushi If it was an early PC, that would be 4.77 MHz...
 
it was a 286, and probably an early one at that...you're likely right
 
Though if you want to talk about old school, my tales can get a little uglier than just 1 MHz processors--like toggling the boot code into a PDP-8 on the front-panel switches.
 
I think I was born about 20 years too late for that :)
 
@Yuushi I don't remember any 286s slower than 5 MHz. 4.77 MHz was typical for 8088s.
@Yuushi Lucky you! Something that's definitely a lot more fun to remember decades later than to actually do.
 
5:11 AM
@JerryCoffin Yes, I can imagine actually doing it was not particularly pleasant
 
@Yuushi I guess I can't honestly complain about it much--I was doing it purely for fun at the time. At the time, it was one of the (very) few ways of producing graphical output though. The school did have a couple of Tektronix storage tube graphics terminals, but they were a pain to program. There was also an ancient pen plotter, but you needed special permission to use it.
 
@JerryCoffin I can see the "fun" part of it honestly...being much, much closer to the hardware, actually knowing it was almost possible to understand what the heck was actually going on, no frameworks and buzzwords...simpler times :)
 
@Yuushi Sort of, but (oddly) you couldn't get very close to the hardware. It didn't have a real OS. It just ran a rather strange, integer-only version of BASIC (no other choices available).
 
0
Q: comparing objects; optimize code short of using reflection

user38158I'm comparing two distinct instances and if they are not the same I save to the dB, so I've given snippet of code below of the way I am comparing these instances, I realize I could use reflection and generalize but short of using reflections is there any other way I could optimize the code or mak...

 
A lot of programming during the MS-DOS era was a lot closer to the hardware, including basically inventing and implementing your own graphics modes by writing values directly to the CRT controller in the graphics card.
 
5:22 AM
most systems wouldn't have had math coprocessors to do floating point ops anyway back then?
 
@Yuushi No, not most. Floating point hardware didn't become common until the 486, and by then Windows was starting to become a lot more common.
 
Wish I was able to get into more depth with this stuff back then...all I was shown was how to type properly (which, to be fair, is still really useful)
 
@Yuushi I can still remember a friend of mine laughing about my becoming a secretary when I took typing class in high school.
That was all on IBM Selectrics though...
 
ooh, typewriter...
 
5:54 AM
anyone here want to upvote my answer? I am going for the first reversal badge on the site
11
A: Stored Procedure logically or coding

Malachiyou have a lot of if statements in your SQL, this screams at me that you are doing something in your SQL that should be done in the application, and that this SQL should be separated into two distinct stored procedures. the benefits faster stored procedures use an actual coding language to d...

need 9 more votes
going to rep whore a little bit more with this one too.
7
A: Implementing a cancellable "infinite" loop

MalachiYour catch statement is catching any error (EVERY ERROR), which is not a good thing. I assume there are several errors that you are anticipating, but you shouldn't catch them all. You will run into bugs and won't know what is going on because the errors will be bulked into your cancellation. ...

I could get another badge for this one with more votes too I think
7
A: Most efficient way to validate multiple textboxes against a tolerance value

MalachiI would write it like this Dim m1 As TolerenceHelper Dim flag As Boolean = True m1 = New TolerenceHelper flag = m1.IsInTolerence(Integer.Parse(txtT1.Text), Integer.Parse(txtA1.Text), Integer.Parse(txtTolerance.Text)) If flag = False Then lblTest.Text = "Out of tolerance" Else lblTest....

Give @Mat'sMug some more rep on this one, maybe get some more reviews as well
5
Q: Revisited IsTypeSafe method implementation for "type-safe" List

Mat's MugFollowing up on List<T> implementation for VB6/VBA, I'd like some thoughts about the revisited IsTypeSafe function, below. The previous version pretty much implemented VB.net's Option Strict setting, by only allowing widening numeric type conversions, and preventing implicit conversion between n...

 
@Malachi I just can't quite bring myself to up-vote. I see "I wrote some code in VB", and want to stop right there and down-vote immediately. :-)
 
@JerryCoffin I don't care much for VB either
 
@Malachi but, giving credit where due, at least it's not PHP! :-)
 
6:10 AM
@JerryCoffin lol. PHP is free though. a lot cheaper to host than ASP.NET otherwise I would have many ASP.NET sites already
 
@Malachi PHP is not free. It's just expensive in ways that are less apparent.
2
 
@JerryCoffin when you don't have the money to spend on it those are the ways that are apparent, the other things could probably be compensated for by coding them in?
I agree with you, I have to relearn how to create "Master Page" functionality every time I go back to coding in PHP and it is never pretty.
my next thing is learning how to code more fluently in PHP so that I can create some good pages with it, and then learn more Javascript so that I can do more with websites.
 
@Malachi Point is, while PHP is free to download, using it is expensive (I.e., it takes a lot of time and effort to produce decent results with it). There are also quite a few alternatives that are equally free to download, but with (at worst) a lot less penalty in use.
 
6:31 AM
0
Q: Regex parser implementing dot, star and question mark

JavaDeveloper Regex parser which follows the following rule . (dot) means a any single character match (star) means 0 or more character match ? (question) means previous char is an option ie colou?r matches color and colour. A large feedback has been taken from here. Looking f...

 
@JerryCoffin I here what you are saying. I need to get some sleep though.. catch you tomorrow
 
@Malachi G'night.
 
7:05 AM
0
A: Possibility to add a feed of all recent answers to chat rooms

rgchrisFor the Rebol and Red chat room, I generated an Atom feed of answers to questions tagged rebol on StackOverflow. The operative code (Rebol, natch) is fairly basic and can be adjusted based on volume: do http://reb4.me/r/altxml ; xml library feed: load-xml/dom http://stackoverflow.com/feeds/tag/...

 
7:41 AM
hey
 
0
Q: Trying not to repeat myself

Matt FitzmauriceI'm trying to tidy the following fragment of code: if (this.Details.Recipients.Count > 0) this.Recipient = this.Details.Recipients[0]; else { this.Recipient = new Contact(); this.Details.Recipients.Add(this.Recipient); } ...

 
8:01 AM
installing ArgoUML is a hell, not going to work
 
8:57 AM
0
Q: How to use this program for edge detection?

VivianI download a program which it should be cool. But now I am a Matlab user. I forget C in some extent unfortunately. It seems that I should download two software: makefile and NETPBM. If I use this program, I just need to run libloglin.c. (The second argument is the name of the file. But what is t...

 
9:16 AM
0
Q: Do I need to trim this jQuery code?

user35295I had three multi-select boxes from this page. I want to customize each box so I simply repeat the code three times with different options: Check the fiddle $(".choose").multiselect({ header: "Choose only One item!", multiple: false, noneSelectedText: "Select an Option", selectedLis...

0
Q: Big project with bad code

Megamongowe have a huge-ass project with like 300,000 lines of absolute legacy-code. it uses php 5.3, mongodb, yii 1 and other really bad components. we have no idea whatsoever how we are ever gonna refactor that. we have about 3 weeks to re-do everything from scratch. we are actually a subsidary of a b...

 
^lol
So someone just came up to CR for guidance on how to refactor 300K lines of code in 3 weeks, and he did not even add code to the question!
 
9:32 AM
I've closed it. It mostly sounds like he's seeking hires, so he's obviously in the wrong place.
 
@Jamal can one be up?
 
What do you mean?
 
0
Q: Hierarchical State Machine in F#

user38198I appreciate any feedback on where I might alter or improve my code for this project. This is an old attempt at implementing a Hierarchical State Machine in F#. I'm from a C#/OO background mostly. module FSharp.HSM open Option open System.Collections.Generic exception NoTransition exception...

 
@Jamal To me it was looking like he was genuinely asking a question, though still very much offtopic, unless he intended on posting 300K lines
 
I'm not entirely sure if he's seeking devs here. But even if he posts that code, I don't think anyone will review it for free.
 
9:42 AM
I doubt that :)
erm
I mean I don't doubt that
I can't even quantify 300K lines of code
hmm I have some auto generated code in my programs, but I wrote the program to auto generate myself, would that count as lines of code...
Wat. On a project where I've been working one day per week for roughly a year I have 40K lines of code...
2
 
0
Q: Prime conjecture

user2949526I am trying to solve this SPOJ question. #include<iostream> #include<cstdio> #include<math.h> #define l long long using namespace std; l chk(l a) { for(int i=2;i<=sqrt(a);++i) { if(a%i==0) { return a/i; } } return 0; } main() { // freopen("...

 
10:04 AM
^^ isn't that some Stack Overflow-question?
 
@200_success @rolfl Apparently, upgrading the BIOS of the computer at worked helped. Sitting on a fresh system now
And with a fresh installation comes setting up the project in NetBeans again
java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z ¤"(/)!)#$£$@€€$@!!!!
 
hey @SimonAndréForsberg
 
gotta love workspace configuration....
 
always rebuild
:( why doesn't Java 8 provide an index in a stream, I mean it has to iterate over the contents anyway
this feels ugly:
AtomicInteger index = new AtomicInteger();
Map<Integer, VertexData> vdMapping = primitives.stream()
        .flatMap(primitive -> primitive.getVertexData().stream())
        .distinct()
        .collect(Collectors.toMap(k -> index.getAndIncrement(), v -> v));
vdMapping.forEach((k, v) -> System.out.println("k = " + k + " / v = " + v));
 
@Vogel612 gotta hate Hibernate configuration...
Hibernate is lovely once everything is set up correctly, but the process in setting things up... gaaaaaah...
@skiwi If only there was a place where you could post ugly code and ask for a review on it....
 
10:16 AM
are you not using stuff like maven/ant/ivy?
 
Maven: No.
Ant: For building with build.xml files, yes. Not for setting up the classpath I believe.
Ivy: Never heart of.
 
it's too few to ask for I review i guess @SimonAndréForsberg
on CR
 
I don't think it is too little code to review
 
I think the counterpart in Java 7 would be more ugly :p
 
12
Q: One-liners and other narrowed-down reviews

Mat's MugEvery once in a blue moon, a question gets posted (often as a new user's first post) where the OP is asking a quite specific question about very minimalistic code, for example: if (strstr($url, "?")) { $url = strstr($url, "?", true); } There is something to say about this code, of course....

 
10:19 AM
That sounds as... I'd want to comment on your code, but only if you put it on CR, such that we both gets more rep!
genious idea
I gotta finish an activity diagram first at work and ask someone a few things, then I'll consider putting it up
 
Unfortunately, I don't think I would be able to comment on your code :/ I don't have a better solution in mind at the moment.
 
:p ok
 
But perhaps someone else would, or someone else would research stuff to learn it, or you can post a selfie if you come up with a better solution yourself :)
 
A selfie with a real selfie embedded?
To be clear: A selfie of the code (on the screen) of course, not of me...
 
10:35 AM
Not sure what the embedded "real selfie" is but... yeah :P
Yay, Hibernate works. Cleaning projects FTW
 
always clean
didn't they teach you that?
 
Nope, no one has taught me that actually. I have taught myself that.
Or, well... I don't always clean, but... often.
 
:p
 
I also think making some build path changes in a required project helped.
Now let's see if I can restore the PostgreSQL database with pg_restore.exe...
so far it's been two minutes and nothing has happened yet...
 
Changing build files is tricky
Unrelated but
I once had a circular dependency in two of my projects, where I had a main project that got code generated into it, and the code generator had a dependency on that project. So I made an error in the code generator, which resulted in a syntax error in the main project, but I couldn't solve it because the dependency of the code generator was broken...
^slight rewrite
 
10:51 AM
Haha, it's like getting a critical error when you use a compiler to compile its own sources.
3
 
11:04 AM
@skiwi Good one. But I am suspicious... what did the code generator do? Would it have been possible to rewrite the code somehow which would cause the code generator to not be needed?
 
@SimonAndréForsberg Not trivially, I decided that learning Hibernate or something similar was too difficult, so I wrote my own simple system, that ended up more complicated
In contrary, the dependency on the main project was not neccessary and I could cut that one
249 edits... Thank you for reviewing 20 suggested edits today; come back in 12 hours to continue reviewing.
 
11:31 AM
busy, busy, break soon, then maybe CR question :p
 
while(busy()){
     doStuff();
}
CRQuestion();
4
 
You need an outer-loop

while(awake()) {
     ....
}
 
@rolfl implying this loop is already written ...
snippeting away implied parts..
but then i'd have to change:
while(busy()){
    if(hungry())
        eat(allAvailableFood);
    else if (thirsty())
        drink(Drinks.WATER);
    else if (tired())
        if(DAY.contains(currentTime()))
            drink(Drinks.COFFEE);
    else
        doStuff();
}
checkMail();
checkFacebook();
CRQuestion();
4
 
I've always wondered what the "source code of life" would look like... I think you're coming close... or not...
 
surely not..
i'm missing on exceptional situations, holiday, unavailableFood, Retirement, Schooltime [...]
but it would probably make a nice
but probably then
 
12:02 PM
morning/afternoon for @rolfl aswell
if (random.nextInt(1000) == 0) {
    someRandomEventHappens();
    if (true) {
        dealWithIt();
    }
}
no code block? :(
 
@skiwi Use the "fixed font" button
that appears
when you
write multiple lines
 
fixed it!
 
@skiwi Seriously, "if (true)"? – that's almost as great as an "if (foo == true) return true"
 
I was working on my nice activity diagram...
@amon It's to mimic the fact that you think that you have a choice, while in fact you always will need to deal with it.
 
ooh, I see
 
12:08 PM
wow, that random philosophic rambling really convinced someone :)
2
 
12:51 PM
0
Q: Make LinkedList in c++ more clean

user3282532I have been working on a linked list for some while now and started out with this: http://stackoverflow.com/questions/22141477/simple-linked-list-c I was then refered to this site, if I had any questions about my code, so here it comes! Is my code clean? Or is there some way to make it better a...

 
1:03 PM
hi!
 
hey @Mat'sMug
another LinkedList question...
<-- has no clue of / and thus doesn't have to consider looking...
 
<-- has no clue of / either :p
 
more linked lists?!
 
@skiwi: [c++] or [c] title:"linked list"
 
I know :)
 
1:09 PM
about 50 results..
 
Could it be that some CS programs are covering linked lists at this time?
 
hmm
algorithms/data structures at Q3 (of uni year) is quite common
 
I'm 15 points (/votes) away from a [silver-badge:c#]!
14! Thanks Santa! :)
 
13
yw
 
:)
@Vogel612 welcome to 500! :)
 
1:16 PM
Thanks Santa ;)))
 
@retailcoder "good enough" rarely satisfies me when it comes to code :) — Simon André Forsberg Nov 20 '13 at 13:27
@SimonAndréForsberg now I know! ^^
 
@Mat'sMug Speaking of...?
 
@SimonAndréForsberg speaking of that comment in November
 
You hadn't seen it before?
 
yes, but that was before :)
 
1:27 PM
0
Q: Should I refactor for DRY?

Gabriel WI'm fairly new to C# so I hope this isn't a ridiculous question. I'd like to get some input on whether or not to DRY up this code. And if so how to implement it correctly. How do I know when it's worth refactoring? Forgive me if my formatting is off here I'm still getting used to this site. ...

 
hmm I think I can get away by indexing the elements of a Map as an int instead of a long
or maybe not, as the JDK8 heavily uses Long, even though in practice you shouldn't get there
 
Could use an upvote:
0
Q: Should I refactor for DRY?

Gabriel WI'd like to get some input on whether or not to DRY up this code. And if so how to implement it correctly. How do I know when it's worth refactoring? public class Win32OperatingSystem { public Win32OperatingSystem() { } /// <summary> /// Number, in megabytes, of physical memory cur...

 
yea...
VA
 
anyone seen creepy java?
public class CustomCollectors {
    public static <T> Collector<T, ?, Map<Long, T>> indexing() {
        return Collector.of(
                HashMap::new,
                (map, t) -> map.put(Long.valueOf(map.size() + 1), t),
                (left, right) -> {
                    final long size = left.size();
                    right.forEach((k, v) -> left.put(k + size, v));
                    return left;
                },
                Collector.Characteristics.CONCURRENT
        );
    }
 
1:47 PM
interesting CR question is still on the way...
 
@skiwi yeah Java8 is creepy
 
the default Collectors they give are quite reasonable
but sometimes you just want custom things
 
@skiwi map.put(Long.valueOf(map.size() + 1), t), lol. nice way of indexing
 
@skiwi why the +1, and why not autobox?
> (map, t) -> map.put((long)map.size(), t)
 

« first day (306 days earlier)      last day (3704 days later) »