« first day (557 days earlier)      last day (3454 days later) » 

2:00 PM
0
Q: How to detach logic from listener implementation in "Smart UI" approach to follow a proper pattern?

ZhuindenI took this code segment from existing source on Android, but it applies to anything from ASP.NET Forms to anything else where the UI has an event callback, and the logic is implemented directly in that callback. That's basically "Smart UI", aka it is the GUI itself that knows how to execute the ...

 
@CaptainObvious Been a while since I coded PHP
 
2:14 PM
@xDaevax lucky you
 
Holy carp that was a moment of fear
 
@Vogel612 worry about what?
 
I accidentally commited login information to a public repository...
 
undo!
git push --force
 
too late... it's in a few commits deep already..
and of course that's not the only thing I changed in that commit..
 
2:22 PM
technically, I think it's still possible to fix though
but it might require some magic
 
light and migty magic..
 
There are much more deserving answers than my quip about poor naming.
3
Q: Triggering editing mode for a form

John4I think that my code isn't perfect and I need a help to understand how to optimize it. In my application I have a main form and several forms for data editing. The user can: Add a new item Edit the selected item Delete the selected item Duplicate an item with a new name You can see an exa...

 
I could cherry-pick it all to some other branch and in the process kill it...
and then force-commit it..
 
Black Magic or Heavy Wizardry. Your pick.
 
eehh that's kinda... both..
 
2:24 PM
@Vogel612 the fastest and easiest solution might be to change your password...
 
Black Magic: the guy you stole it from is good. Heavy Wizardry: you're good and you uderstand what you're doing.
 
heavy wizardry in that case
 
Some bit tricks I use are black magic to me.
 
@SimonAndréForsberg wasn't me
 
@SimonAndréForsberg which is what I already did...
 
2:29 PM
@Vogel612 good idea. because it is possible that during the time it takes for you to fix it, someone had already cloned your repository...
whistling
 
huh...
how come this does work in visual studio, but not in g++...?
(*env)->GetStringUTFChars(env, email, 0);
what does (*var)-> even do
pointer dereference and then what
then it calls function pointers.
 
0
Q: .NET REST API JSON Filtering

conorMy question REST API and lazy loading objects did't receive any or answer (or many views) so here is my attempt at the solution. Problem overview: My mobile app requests a list of objects through a HTTP REST API but only required a small subset of each item to display items in a list. Other larg...

 
ah, even although I gave it a .c file, g++ was compiling it as c++
 
Of course, g++ is a C++ compiler.
 
0
Q: High - Low Game

MichaelI'm learning how to code in java and i decided to re-write a program made in c++ into java. All feedback is welcome. Here is the original prompt: This program generates a pseudo-random number between 1 and 100, inclusive. The user will then be presented with opportunities to guess that number. A...

 
2:43 PM
yeah well I'm stupid and way over my head but I have to do these things anyway
I wish jobs would be about the things listed in the job description
That way a back-end Java programmer programs in Java
(not C)
grumble grumble grumble
 
0
Q: How can we write this code more efficiently?

mastercodeI have a problem : build a tree relationship parent/child like this one: Parent Child A | B B | D A | C B | E \0 | A Can you review this piece of code please since I am convinced it could be improved? Thanks and Regards. MasterCode. struct item { char value; std::list<item*> ...

 
Greetings, Programs.
 
Hello, User. Sorry for the Lag in my Response, all my threads were occupied.
 
@Donald.McLean We are being watched!
 
http://codereview.stackexchange.com/questions/69602/net-rest-api-json-filtering#comment127127_69602

Maybe I'm paranoid, but this solution seems insecure. I am always leery about reflecting direct from user input. Someone with domain knowledge or someone who is of nefarious intent could cause properties which they may or may not be allowed to access to be filled with data. While flexible, this is potentially problematic. Can you give an example of some of the URLs / QueryString parameters?<-- Am I paranoid?
 
3:01 PM
Heya, folks.
Is retailcoder still the Mug? Or has he changed his mind again?
 
I cannot re-vote to reopen, please help this question survive!
3
Q: Android layout with equal spacing between elements

YarhI am trying to make a nice set of items, which are equally spaced from each other. On example below, I set buttons between empty textview. Every button and text view has height = 0dip and weight=1. And it looks pretty nice. However, is there a way to clean up the layout file? <LinearLayout ...

@kleinfreund he is only Mug here on CR on SO he is retailcoder
 
@CaptainObvious couldn't you spot the error
 
why does a library need a main
 
0
Q: How can someone decide when a method should do more or less? What exactly is ONE thing?

BartBased on lots of read books, sometimes I get quite confused when things get bigger than the simple examples. Martin Fowler's clean code is good but not enough :D I want some feedback on how to improve my current coding workflow, specially regarding to methods doing one thing or what is exactly o...

 
^^^ Sounds like a design question?
 
3:05 PM
@Malachi it actually lives anyways now...
it's positively scored and has positively scored and accepted answers..
not gonna be deleted anytime soon...
 
but it gives the wrong impression to others that this kind of question will be closed. when they shouldn't be
 
0
Q: High - Low Game

MichaelI'm learning how to code in java and i decided to re-write a program made in c++ into java. All feedback is welcome. Here is the original prompt: This program generates a pseudo-random number between 1 and 100, inclusive. The user will then be presented with opportunities to guess that number. A...

VTC please ^^^^
 
@Heslacher does it not work??
 
wish I could think of a better title for this codereview.stackexchange.com/q/69602/18427
 
@Vogel612
double percentage = (gamesWon / gamesPlayed) * 100;
double percentage = (0/ 0) * 100;
java.lang.ArithmeticException
 
3:09 PM
@Heslacher kk, just to make sure ;)
 
@Malachi Me too. Just got a hit on my time share exchange ongoing search.
 
@Malachi Does the OP of that post even care? I know we do, but the author hasn't given any feedback on the question whatsoever (other than the accept). Additional clarification in the question would help to resolve the ambiguity that got it closed in the first place. This will also help future users to identify WHY the question is (or is not) on topic.
 
@SimonAndréForsberg Last night's episode was great.
 
@xDaevax I edited the question as well. please see my edits, the user has not since complained about the edits either
 
@Malachi thanks for the edit
 
3:11 PM
@Heslacher you're welcome
which mod is online right now?
 
Jamal
 
???
I had my flag declined saying that I should vote to reopen, but I can't because I already voted and it expired, I can't even see a vote count either.
I need something to search all documents in an Outlook folder for usernames and create an Excel spreadsheet.... time to google
 
Searching for help with searching. How meta.
3
 
I have like 1k+ error emails and want only the usernames from them, but I want them in a spreadsheet so I can manipulate it better
 
It wooooorks
 
3:17 PM
now I see a reopen count
 
Hurray! Hurray! Hurray!
Now to quickly slog the used commandos in some .txt file and hope I never have to do that again
 
@Donald.McLean Why does it feel like you've said that before?
 
@SimonAndréForsberg Because EVERY episode has been great.
 
hi
 
I'd like to have some more reviews on my question. First Python thingy!
2
Q: Binary to decimal number converter

kleinfreundHere I am doing some exercises for my studies with Python. This is a binary to decimal number converter (currently restricted to that). These are the very first steps, so there is no error handling. You can even input non-binary numbers and get a result. However it works for converting binary nu...

 
3:21 PM
I don't actually want to search, I want to parse out the usernames from 1k+ emails
 
@Bart Good morning.
 
@Bart Hi. Interesting question. Not quickly answered though.
 
thank you @xDaevax
 
No Python for me. My wife is deadly afraid of snakes.
 
@Donald.McLean good morning ? lol, it's 13:22 here
good morning to you
 
3:22 PM
10:22 here
 
@xDaevax I'm not so sure it will get answered ...
 
@Donald.McLean thought so :)
 
I'm working on one. I'm sure others are as well.
Good answers can take a bit more time here than on SO because they're not a quick Google search away. ;)
 
@Jamal do it really be better to have a 'Login and Register' title than what the purpose of the question ?
 
@Bart I'm not even sure what time zone that is. Eastern (US) Standard Time here in Baltimore.
 
3:25 PM
every project these days: "I'd like to thank Google and the rest of the internet for their help..."
3
 
@xDaevax I'm not in a rush. I would love high quality feedback
 
I dunno how many examples I abused today
 
@Donald.McLean Uruguay (South America) GMT -3
looks like the question title is not good :( but I can't think of a 'good' one)
btw, first time on chat. I like it!
 
@Pimgd I remember thanking StackOverflow in an internship report for solving most of my problems i no time.
 
Monking!
 
3:27 PM
@Bart be careful to not mess with the other bart..
 
@Bart Question titles should reflect something more specific. As written your title could apply to many questions. You may want to consider something more like: "Registration and Login: Best way to separate responsibilities"
 
that said, your question smells design-ish to me....
 
@Bart Ahh. So far Florida is the southernmost place I've been.
 
like: "I'd like to completely rewrite that code"
 
@Vogel612 true. @Bart is that the "actual" code or example code? We require actual code you maintain. In several places you mention: "{code section} is something like:"
 
3:30 PM
@Pimgd "I'd like to thank myself for knowing how to Google and for being able to understand how to apply the search results to my circumstances"
2
 
@xDevax it's actual code (but since I'm refactoring it already changed)
@Vogel612 something like I'd like to refactor code would do ?
@xDaevax other Bart? lol
 
just going to look for patterns the old fashioned way. by going through the E-mails and letting the pattern emerge in my mind!
 
0
Q: Checking two arrays for matches

TomIs there a better way to do this? var duplicate = false; for (var i = 0; i < acceptedFiles.length; i++) { for (var j = 0; j < attachments.attachments.length; j++) { if (attachments.attachments[j].name === acceptedFiles[i].name) { duplicate = true; ...

 
I realized that I also need to be looking at the Exceptions in the emails as well.
 
3:40 PM
@Bart Even "Login and Register" would've been much better, even than this latest title.
 
I dunno, it's pretty bad and confusing
or maybe my brain is just fucked for today
likely the latter
 
Learn meditation. It has benefits and no drawbacks.
Or at least it's what I read a while ago.
 
12
Q: How can I meditate while sitting at my desk in the office without looking sleepy?

TheIndependentAquariusMindfulness Meditation requires us to close our eyes and focus on our breath. If I close my eyes while sitting in my office seat, I’ll appear to be sleeping. There isn’t any special retiring room in our office. What is a practical way to meditate while sitting at your desk in an office without ...

you can't really do that at work.
 
Haha, there are really questions about everything on SE xD
 
@Jamal ok... I don't get it why, but I will try to read and understand.
@Pimgd unless you work as a meditate guide
 
3:59 PM
8
Q: Comparing generic struct types

nhgrifHow do I determine whether two instances of a generic struct are of the same type? For example, given the following struct: struct FooBar<T> { let variable: T init(arg: T) { variable = arg } } And the following snippet: let foo = FooBar(1) let bar = FooBar(1.0) let baz = ...

 
@Pimgd The first part of this comment: Where does this guy work, and why don't I work there.

Also, the nerf ricochets off your head might militate somewhat against the meditation. The important point is that some random dude on the internet can't tell you what your workplace accepts along these lines, there's too much variation
 
The sun is already setting here. That's rather depressing.
 
> You are allocating memory with new but never freeing it with delete thus you are leaking memory like it's 1995.
3
 
4:14 PM
@Bart We mainly don't want a bunch of titles like "How can I improve my code"? Essentially, every (on-topic) question can be asking that, but it doesn't mean we have to accept titles like that now. Specific titles can also give the post more attractiveness. If the choice was between "Human genome analysis" and "How can this be refactored?", chances are people will look at the former.
3
 
@Jamal fair enough
 
Now I want to somehow ask a question here about the human genome...
2
 
6 hours ago, by skiwi
How about... people drop Visual Studio
How about dropping C and moving to C++?
 
@xDaevax they don't get 'THAT' attention codereview.stackexchange.com/questions/14357/…
 
@Bart Yeah, that could also use a better title. ;-)
 
4:29 PM
@hosch250 sorry man, but sometimes things have to work on embedded devices
 
Oh, I see.
That makes sense.
And there is always backwards-compatibility issues...
 
The real pain is when all platforms but one support language feature X
and then you have to hax it out somehow
 
Can't C++ run on an embedded device, or no?
What about Java, Python, and C#?
 
@Pimgd I hear Java runs on over 3 Billion devices.
2
 
@psaxton so do viruses ;)
@Bart sorry, this review will be longer than expected.
 
lol
Nice article
 
It sure causes problems in my computer.
I run it because I need it for college - can't find another site to do your homework on!
Nothing serious - just annoying glitches and problems.
Embedded C++ (EC++) is a dialect of the C++ programming language for embedded systems. It was defined by an industry group led by major Japanese central processing unit (CPU) manufacturers, including NEC, Hitachi, Fujitsu, and Toshiba, to address the shortcomings of C++ for embedded applications. The goal of the effort is to preserve the most useful object-oriented features of the C++ language yet minimize code size while maximizing execution efficiency and making compiler construction simpler. The official website states the goal as "to provide embedded systems programmers with a subset of C+...
 
The C++ standard committee may be about to create a new "embedded" study group to analyze what could be improved in the core language and the library so that it is even more fitted to run on embedded devices.
 
That's nice.
I really like C++, but sometimes I prefer C# - it isn't so complicated at times.
 
@xDaevax wow! are you doing it? Really appreciate it.
 
4:52 PM
I know that they have already submitted a report to show what would be needed in std::vector to work on embedded devices without exceptions.
 
Interesting, I should look this up sometime when I have time to read it, or isn't it public?
 
@hosch250 I managed to found the mailing list :)
And there is this paper. It has already been submitted this week in Urbana, but I don't know what was the outcome.
 
Have y'all seen this yet?
36
Q: Rolling question rate limits are now network-wide

Tim PostWhen you think of Q&A sites, you think of a place where you come to get answers to your questions. But, where do those answers come from? What doesn't immediately stand out for many folks is that it's not our software that's giving them answers, it's other people that are taking the time to share...

 
Interesting, maybe make it void like C# and Java?
 
@Morwenn What would be the most important differences?
 
4:59 PM
@hosch250 It was probably part of a proposal too (and a widely-supported compiler extension).
@skiwi More functions that cause undefined behaviour when they fail instead of throwing exceptions.
 
But why in the world would we want undefined behavior?
 
It's worth noting that the problem with exceptions is not that they are slow but that the program has to allocate a big buffer somewhere.
 
Shouldn't the programmer know to use try{} catch{} blocks?
Oh, I see.
 
@hosch250 Take push_back for example.
 
@Morwenn So when working embedded you rather have undefined behavior than exceptions?
 
5:01 PM
People often asked for an unsafe_push_back to add an element without checking whether there is space beforehand.
Since you can use vector::reserve to allocate a block of memory, you sometimes know that the memory is here before adding elements in your vector, so the checks in push_back are redundant and slow down the program.
So people actually want an unsafe_push_back which may cause undefined behaviour but which could be a great tool in good hands.
 
I see. So they would actually have both push_backs still, and the unsafe_push_back would be just a special use case?
 
Undefined behaviour is related to narrow contracts: there is an implicit contract that you are feeding correct parameters to your functions. If you do, you may gain speed.
 
@Morwenn I hope that such methods then are only enabled when you specify that you want to have embedded extensions... Before random programmers start to use that.
 
I can see how that is good.
 
@skiwi I think that even a random programmer would be careful with unsafe in the name.
 
5:05 PM
I do too.
 
And you can't always prevent the users from doing bad things. You can hint to them that they are doing something wrong, but prevention has a cost.
 
0
Q: Neural Network code in Julia

Josh GreenhalghI am currently trying to implement a Neural Net in julia with the goal of eventually implementing a stacked autoencoder. My code seems to work but I would appreciate any constructive criticism...if there exists a style guide for julia I am not concerned with that, however any other comments would...

0
Q: Correct usage of delegate for acquire lock?

Alexander.ItI need to acquire the lock of a global variable with monitor from an instance class method, is the use of delegate in this way correct? is there a well knows pattern for do this? namespace X{ public delegate bool CanLockClipboard(); public delegate void UnlockClip(); public class My...

 
Who in the world is Captain Obvious, and why does he only post questions?
He doesn't have a profile, he isn't even in the room, apparently.
 
It's the @StackExchange bot.
We just changed the name.
 
OK, I thought it might be.
 
5:14 PM
monking!
@hosch250 he's sort of a meme, too ;)
 
-1
Q: Run time error for program that finds prime factors

Mark Jeffersonusing System; public class Test { public static void Main() { int a = Convert.ToInt32(Console.ReadLine()); factor(a); } public static bool isPrime(int x, int y) { bool value = true; if (x % y == 0) { value = true; } else if (x % y != 0) { value =...

 
@hosch250 Here is the paper which talked using exception-free containers in an embedded context. It's rather interesting.
 
@Bart Whew, there you go. Looks like I wasn't first though. :(
 
@xDaevax here we go!
reading now
@xDaevax interesting... have to read it a couple more times now, but wanted to answer a question : UserRegistration is an Interface. (yes, I do use interface without the prefix I)
and thank you for all the compliments
 
5:59 PM
0
Q: Is it safe to assume C++11 by now even if the question is not tagged as such?

glampertI frequently come across questions from new users that are tagged just with c++, whereas it is very likely that by now (end of 2014) their compilers are C++11 compliant. In such cases, should we refrain from suggesting the use of new features, even if those would improve the quality of the code...

 
6:28 PM
What's exactly the purpose of accepting and answer on code review? Currently I have a question where all answers looks like valid and useful, what's a correct one ?
correct / accepted
 
it's perhaps less useful for code review, since any number of reviews can have equal usefulness/validity
most SE sites have reasonably clear correct/most correct answers, so accepting answers is an artifact of the shared website source
 
0
Q: Wrap function pointers in template classes

Nathan WehrI'm working on a C++ library for Arduino and other embedded systems. https://bitbucket.org/nwehr/kick I'm currently working on wrapping up function pointers and member-function pointers into two C++ template classes (function and mem_fn). Does the following code abide by good programming prac...

 
0
A: Comparing generic struct types

nhgrifTaking some inspiration from Sebastian's answer, I came up with this solution: func sameType<L,R>(left: L, right: R) -> Bool { if let cast = left as? R { return true } else { return false } } This works even if nested within a function accepting generics: func compare

 
@DanLyons yes, I found this question on meta with some interesting answers. I will accept the one that is better explained and comment that others are usefull too.
when someone writes a Q or A is automagically posted here ?
 
the captain posts new questions
answers are generally links that others have put up to call out something which needs votes or other attention
 
6:50 PM
SQLMembership Provider is a PITA!
 
lol. It can be
I usually roll out my own.
 
I just need to play with the CreateUserWizard and get it to validate some information before allowing creation of the user..
 
WebForms I see.
@Malachi Ever see this series? 4guysfromrolla.com/articles/101106-1.aspx
 
@xDaevax not that page. thank you, I have their site open on one tab but haven't read it yet.......*SIGH*
 
heya fellas
 
6:57 PM
hi @janos
 
hi @Bart
 
Greetings
 
@xDaevax how do you manage to have the time to answer questions like the one you just did, be active here and actually work (i suppose) ?
 
Yes, I am working. ATM I am doing some menial work though. I'm setting up a base Enterprise library that will be our software platform for some years to come (and converting some existing stuff from VB to C#).
Answering questions is work though, as it adds value to what I'm doing by causing me to think things out thoroughly and question my assumptions.
My company sees it that way too (as long as I don't do it too much), which is helpful.
2
 
@xDaevax very nice!
 
7:08 PM
1
Q: PyMel / Python script for setting animation keys

NilsI'm currently preparing some basic code samples for a trainee position. I've formatted some of my older tools that I had previously written, but feel confident about. I would very much appreciate a pair of experienced eyes to look over the code and its formatting. It's written originally in Pyth...

0
Q: Python script for CryEngine 3 assets

NilsI'm currently preparing some basic code samples for a trainee position. I've formatted some of my older tools that I had previously written, but feel confident about. I would very much appreciate a pair of experienced eyes to look over the code and its formatting. It's originally written in Pyth...

 
7:27 PM
Fresh off the press: hanselman.com/blog/…
2
 
I already knew that :)
Someone asked a question on SO about using .NET on Android, and someone had commented that just today MS had made it open source.
Open source is good, but I don't really trust it as much because there isn't a set group of people whose only job is to review it for problems.
 
@xDaevax WOW
@hosch250 this is a microsoft product though
 
Here's the thing that blows my mind: How do you have a GOOD cross-platform GC?
Crazy!
 
open source doesn't mean they will let anyone change the core of it.
 
Yes, so I would trust their flavor, but not any other flavors.
 
7:29 PM
@hosch250 Is it raining by you? ;)
 
@xDaevax base it on a lower lever.
 
That is how it used to be - anyone could read it, nobody could change it.
@xDaevax No, it snowed recently, why?
 
Because you're raining on my parade. :)
2
 
Oh, should I start snowing instead?
2
 
lol
 
7:31 PM
eeehh Open Source != Free for all
 
So much of that is seriously a game-changer for the web. Running sanctioned .NET on a custom web-server built for MAC
"ASP.NET 5 will include a web server for Mac and Linux called kestrel built on libuv. It's similar to the one that comes with node, and you could front it with Nginx for production, for example."
 
Seriously though, this is great, as long as not just anybody can change it.
Without review, that is.
Now my apps will be able to work across all the platforms at once, with only minimal change (if any at all).
 
True, just like anything on git. You can submit a pull-request, but that doesn't mean it gets merged into trunk.
3
 
Microsoft has open sourced a lot of there products over the last few years, such as ASP.NET MVC. I was skeptical at first, but it seems they have finally GOTTEN the free software philosophy.
 
They realized the error of their ways.
Now, more people will want to buy VS.
 
7:34 PM
If all software was free, how are developers going to make money?
 
@hosch250 Anybody can change it. Only Microsoft has the keys to including it in their branch however.
 
I see.
Seriously, this is great for WP users.
 
@hosch250 Food is free -- Anybody can grow and gather it. For some reason, people do prefer to pay for it.
@hosch250 What does wikipedia have to do with it?
 
So, I'm seriously thinking about hosting a legit nerd-party based on this news. Complete with all night LAN party and pizza.
 
Not Wiki, Windows Phone.
 
7:36 PM
@hosch250 That makes more sense. My second thought was WordPress
 
Developers will use .NET so they only need to have one version of their apps for all platforms, and all platforms will be able to use the apps.
And, WP is being merged with Windows too...
I wonder what will happen when SE runs out of server room for all these comments/questions/answers/...
I suppose the logical thing to do is delete all chat messages older than one week.
And any antiquated questions.
 
-1
Q: C++ never-ending recursion

Tomislav ToplakThe task is to convert a given state to the final state least possible steps. For example if you input a string like this: 213456 The state looks like this (it's always 6 characters): 2 1 3 4 5 6 The state you need to convert it to is always the same: 1 2 3 4 5 6 You need to switch the ...

 
@hosch250 I believe closed/deleted questions get removed from the SE servers after a certain time, I would say chat records as well, probably after a year or so. I'm sure SE would not have that much difficulty coming up with the money to buy more servers too ;p
 
Yeah, makes sense.
How much does a server cost?
I want to start another social media site I designed, but I don't have a server, or any place to keep it.
 
@hosch250 Depends on what you want it to do. I've worked in shops purchasing servers form $400 to $275,000
 
7:44 PM
@Vogel612 are you around?
 
@hosch250 you could rent a server also, that's what I do for my website
 
@Webby kinda..
 
I could. I was only half serious about the social media though.
 
@hosch250 All you need is technically a computer with a 24/7 internet connection. You have that, you can make a server out of it.
 
7:46 PM
It was essentially a Twitter/Pinterest/FB cross. I was going to call it Cork.
I do have a website on WordPress.
 
@Phrancis they don't delete chat.
I bet you could find chat messages from the start of chat.
 
I see. I guess mostly text is not very heavy to store then
 
@Vogel612 do you have some time to do a quick CR on one of my question ?
0
Q: Efficiently serialize big JSON using GSON without loading everything in memory?

WebbyBelow is my JSON in which I have only three reportRecords just for demonstration purpose but in general sometimes we are getting pretty huge json, then it doesn't have three reportRecords only, it has large number of reportRecords. { "parentRecords":{ "reportRecords":[ { ...

 
Approximately 1 byte per character.
 
the pictures aren't even stored, they are on a 3rd party site @Phrancis
 
7:48 PM
I do have one feedback, apart from that I am seeing any other suggestion if you guys have?
 
@Webby out of my area of expertise..
 
Imgur.
 
I think you could leverage streams, but ...
Wouldn't know how
 
@hosch250 lol
 
I am using streams only that's what I am trying to review
 
7:49 PM
Seriously. Create a .txt file, and store some text in it. Then use the File Explorer to get the size of the file.
 
I never posted so many 0-upvoted answers than these times x)
 
@Webby Read the comments:
I am downvoting this because it is apparent to me that either the above is not your code, exactly your code and nothing but your code. Or you did not get the below code working fine. Please avoid confusion and a) Copy your exact code. b) Make sure that it compiles and works. — Simon André Forsberg 2 days ago
 
Actually, I only have three answers with 0 upvotes. All posted this week.
 
Got to go, see you later.
 
Bye @hosch250
 
7:53 PM
Does anyone here happen to be an expert on Genetic Programming?
 
Nope. I took a class, but I only have some really sparse knowledge.
 
That'll do
When you're asked to describe the theoretical background it probably refers to the biological aspect of mimicking evolution?
right?
 
You will learn more by reading the Wikipedia article.
Well, yes.
 
I read the dutch and english versions of Genetic algorithms/genetic programming last week
 
It describes how the best solutions are kept and how mutations are applied to the solution.
 
7:57 PM
It's still a little blurry on how it would exactly work in practice but I think I've got the theory
 
It is working as expected but somehow wanted to make sure whether we can improve anything. I never used streams before so not sure what other mistake I have made.
 
It just seems like a pretty big leap to go from [0, 1, 1, 1, 0] to <bunch of algorithms that perform work>
God. My teammates wanted to work with google docs
I have it open and see 2 cursors appear right above where I was writing
now I feel like I'm working for an audience
 
0
Q: Random Interval Generator For Game

PatrickSharbaughI have been working on a few games which all have a need to create "events" randomly over time. The intervals need to get shorter as time goes on if the event is negative or they need to get longer as time goes on if the event is positive in order to make the game harder the longer you play. ...

 
@JeroenVannevel It can be worse... 5 other cursors jumping around where you are typing
 
@Webby aside from the nested while (reader.hasNext()) if you want to stream the hell out of this all?
 
8:06 PM
Is this Kerbal Space Program Extreme?
 
I am always impressed by the compex gravity manoeuvres that they manage to pull out.
India used the same trick for their Mars program: the rock did some circles around the Earth before finally going to Mars.
The funniest thing is that India's space agency is the first to successfully reach Mars without a problem on its first attempt.
 
@Morwenn There was some pioneering work done by others of course before that.
 
@xDaevax Of course, but that's still impressive.
 
true
 
8:22 PM
0
Q: Work out value of property based on available properties on Obj

JimmyBobWould really appreciate some help on cleaning the below up. The goal is to add a new displayValue property to each object depending on what it has available out of Firstname, Lastname, Nickname and Name. var data = [ { Id: 132, Name: null, Firstname: "Sam", ...

1
Q: Java craps game with a single method

damanBelow is a long messy one method code for a craps game, the user can play the game multiply times and has the option to quit when ever he wants. How could you break this code down into different types of methods. How many methods do you think the code can be broken down to. And what types of meth...

 
There has to be a better way to query dates.......
SELECT *
FROM [Table]
WHERE CONVERT(DATE,DATE_RUN) < CONVERT(DATE,DATEADD(DAY,-28,GETDATE()))
 
Should be no need for the converts......
 
There, a page on genetic algorithms just flew out of my hand
No biggie
doing this all day
 
@rolfl The converts strip the time part of the date.
 
So, you only need the convert on the second part.... no need for two.
 
8:31 PM
Good point.
It just seems like it's one of the most common things I do, and it's never as easy as it should be.
I suppose using a week interval would be better too.
CONVERT(DATE,DATEADD(WEEK,-4,GETDATE())
Hello 2nd Monitor btw. =)
 
Personally I like to do the converts on the inside... no particular reason though:
 
Hello @ducky
 
DATEADD( WEEK, -4, CONVERT( DATE, GETDATE()))
 
0
Q: Could this QuickSort be made more consise and "nicer"?

Overly ExcessiveAfter seeing this example of a "primitive" QS implementation in F# by Scott W let rec quicksort2 = function | [] -> [] | first::rest -> let smaller,larger = List.partition ((>=) first) rest List.concat [quicksort2 smaller; [first]; quicksort2 larg...

 
And spaces help too.
2
 
8:36 PM
Wow. That does make a big difference.
Hey @Phrancis! How've ya been?
 
Good, for the most part. Been doing some website design with Bootstrap, fun stuff!
 
Ohhhhhhhhh
runs off to google it
 
It's an awesome CSS/JS library @RubberDuck I'll post a question with my code soon too
 
Yeah. It looks cool.
 
0
Q: Convert Object Keys according to Table/Map object

MLMI have implemented a recursive function that converts an objects keys according to another lookup table/map. You are able to convert back and forth using the 3rd swap_conversion_table_key_value boolean argument. My use case is to convert object keys to single characters to slim down the amount o...

0
Q: How to handle events in multithreaded environment

sventevitI need some kind of a controller class with the following functionality: Class controller contains two fields (injected in the constructor): object1 of type Object1, which can fire Event1 in own thread at any time, object2 of type Object2, which can fire Event2 in own thread, but only when it ...

 
9:10 PM
0
A: .NET REST API JSON Filtering

Jeroen VannevelConsider this a thoughtreview instead of a codereview. A lot of this will depend on your scenario; both of them are viable options. How extensive are your Book objects? Do you have a few but with many fields or do you have many but there are only a few fields? Have you considered pagination? Th...

Acceptable on CR or better on SO?
 
9:26 PM
I accidentally flagged an answer on SO thinking I was on CR.
Naturally, it would have been an awful answer on CR, but a fine answer on SO, so it was declined.
I only have 3 declined flags and 55 accepted, bit still annoying.
 
I just got the ability to review first posts, so I am seeing more bad posts/spam now.
 
@JeroenVannevel that reminds me of my most popular review on Steam
> 48 of 49 people (98%) found this review helpful
I hate that guy
3
 
lol
 
lol
 
0
Q: Bash Based MySQL inventory scanner. Suggestions?

jmunschI am trying to create a bash based inventory scanner, and was wondering if there is anything 'glaringly' incorrect about my syntax or usage. I was hoping I could get some feedback on: bash programming best practice in regards to syntax, modularity, variable passing Maybe some book suggestions? ...

 
Pimping here: http://codereview.stackexchange.com/questions/67458/custom-javascript-validation-using-the-factory-module-patterns

Janos gave a wonderful review, but I was hoping to get a wider array of reviews related to code structure and efficiency.
 
@CaptainObvious How about for a suggestion.
 
Who handles the Captain Obvious pings? Does the system just eat them?
 
9:52 PM
@hosch250 Why don't you ping him and ask? Maybe he will respond.
 
Oh, I just remembered - he isn't in the chatroom, so he doesn't get pinged.
@CaptainObvious How can you post when you aren't here?
I should change my name and logo to Captain Obvious.
Then I can get the pings.
 

« first day (557 days earlier)      last day (3454 days later) »