« first day (277 days earlier)      last day (3587 days later) » 
00:00 - 17:0017:00 - 00:00

5:02 PM
Ohh, a question containing CSS to review! :>
 
@Marc-Andre this person does have a point that in Written English it is more professional to write as much as you can without contractions
no back to VB
 
Not in all cases of written English, I assume?
 
*now
 
I thought this is only necessary for official stuff, business letters, more formal situations and so on?
 
I think "I'm" and "I am" are mostly interchangeable informally, whereas "I am" is best for formality. On SE, I think the former would apply. Now, if this change was pretty much the only thing in that edit, I probably would've rejected as too minor.
Also, in case some of you haven't seen this:
2
Q: Eliminate [design], [software-design], and [architecture] tags

200_successThere are currently 61 questions tagged software-design, 214 questions tagged design, and 47 questions tagged architecture. Some questions are tagged with a combination of those tags. I'm not sure what benefit these tags have. The software-design wiki mentions design concepts, design considera...

 
5:06 PM
interesting
 
What do you think of , in particular?
 
I agree with @ChrisW's comment, but I find it easy to misuse.
 
@Jamal I guess you missed it before. But what do you think about the tag ?
 
Even if we update the wiki, it may not help. No one reads the wikis. For now, it can at least be used to hunt for further off-topic questions.
 
No one reads the wikis... damn, why do I even bother? ;p
 
5:10 PM
@kleinfreund: It does seem like not much of a tag. It does seem a little too specific, too. Are my uses of null correct here?
 
As we speak of it: should definitely have a wiki, since the questions get quite some attention.
 
I thought I had copied the wiki from ...
 
@lol.upvote: This is especially apparent on SO. When a wiki states to NOT use a certain tag... guess what? Dumb**** still use the tag.
 
emphasis on thought
 
indeed. thought I did.
 
5:12 PM
@Jamal I asked since I'm not a programmer. The four questions in the tag don't really make it a helpful tag.
 
@lol.upvote: In all honestly, I'm so glad no one has yet misused this tag to, say, post a Codegolf SE type question.
 
This has almost 600 views? o0
14
Q: View for Ultimate Tic-Tac-Toe board

kleinfreundI've put together a board for Ultimate Tic-Tac-Toe (What's that?). This is part of the current code-challenge: Code a Ultimate Tic-Tac-Toe Resources: Live demo of my view – For you to see what I did there Simon's working implementation – To illustrate that this is going to be a functional game...

 
@kleinfreund want 4pts for an easy edit? (you'd have to fix the "weekly" thing)
 
@kleinfreund: You're encouraged to post a on Meta.
 
lol. The meta-post has:

Asked
6 Days Ago
Viewed
328 Times
Active
6 Days Ago
 
5:14 PM
@lol Sure. You don't have the wiki from the weekend-challenge tag, right?^^
 
Ah! Now I get it. The synonymization must have wiped the wikis.
 
Salut @lol.upvote !
 
:p
You've tried to map code-challenge > weekend-challenge first, which wouldn't have touched the wiki.. But the other way round, it has, huh?
 
I guess it's gone now.. even the history got wiped out?!
 
Gah
4
Please can you help me do it? I tried but can't figure out how to exactly do it. I am not really expert in JavaScript and had to get lot of help to get the above working – Loai 1 min ago
 
5:17 PM
@konijn That's Québécois for "Look at this!" ("Gah ça, man!")
 
ah..
I lived a few years in Montreal ( Hochelaga ) btw
 
so you must've heard it :)
@konijn if you pasted the permalink we could have navigated to that post to read more...
 
1
A: Simplifying this form validation script

konijnThis is already quite tight, I like it. There is one big thing that jumps out: validator = this; var currentmsg =this; You are using this, and validator and currentmsg all really pointing to this, that is making it harder than needed. Furthermore you escape scope by not using var for validator!

 
Please can you help me do it? I tried but can't figure out how to exactly do it. I am not really expert in JavaScript and had to get lot of help to get the above working — Loai 5 mins ago
 
^^ that :)
Help Vampire Alert?
 
5:22 PM
0
Q: Burninate [null]

kleinfreundIn my opinion, the null tag is not helpful for anyone. Even if this tag matches the content of the question, it might be a bit too specific. I'm not a programmer. What are your opinions on burninating the tag? The null tag has four tagged questions: Reducing cyclomatic complexity in a simpl...

 
set = null?
 
^ better title.
(but with a question mark)
@lol.upvote: Yeah, kinda sounds like help vampirism. As this is a Q&A site, we're not obligated to explain many things on request, especially if there's a minimal understanding issue.
2
I do miss that close reason. :-(
 
Hmmmm, plus, I wonder now, how much is this his code?
 
@konijn: If you're willing to explain all this to him (not saying you have to), it would be best to take it to chat.
 
@Jamal pondering..
 
5:28 PM
Hey, @Pops. Still spying on us? ;-)
 
0
Q: set [null] = null?

kleinfreundIn my opinion, the null tag is not helpful for anyone. Even if this tag matches the content of the question, it might be a bit too specific. I'm not a programmer. What are your opinions on burninating the tag? The null tag has four tagged questions: Reducing cyclomatic complexity in a simpl...

 
Alright, chat history read. Damn you people can talk a lot in just one and a half hour :) (but that's good!)
Now, it's time for... @Donald.McLean : YOU ARE BEING WATCHED!
(That's Person of Interest for those of you who don't know it) See you in 45 minutes :)
 
feels relieved that Simon missed the part where I revealed his credit card number
whistles
 
5:47 PM
@Jamal Sure, if you want. (Was that the right answer?)
 
I think Simon's pinned message does indeed apply here. Muahahahaha!
 
5:59 PM
0
Q: Good ways to clean this up?

James WilsonI just wrote this and don't like how bulky it is, also given the fact I will have to add at least another if statement. I was going to switch it to a case statement but wanted to check if there were even better ways to reduce the clutter? string emailLetterPath = Server.MapPath("~/emails/re...

 
@Jamal did you need something, or were you just curious, or was I supposed to read the scrollback instead of waiting for you?
 
@Pops: No, I didn't need anything. I just noticed that you were still in here. Sorry for the confusion.
 
@SimonAndréForsberg can you update some of the CR Answers feed? I'm going on strike, this needs to be automated.
 
0
Q: Making adding to a dictionary more efficient?

SmooreI have the following code below and it's taking quite some time to run due to high volume of answers there are. Is there anyway I could speed it up? var controlStrings = answerControlStrings.Where(a => a.ControlN.Substring(a.ControlN.IndexOf('_') + 1, a.ControlN.Length - a.ControlN.IndexOf('_')...

 
6:17 PM
.@MightAndDelight's Pid is free! http://giveaways.bundlestars.com/?pid There are still 200 000 Steam keys so go and grab one!
not sure if anyone is interested but it is an interesting platformer
 
0
Q: Merge Sort Algorithm in Python

Rodya_Implementing basic sorting algorithms to learn them, and coding, better. Criticisms/ critiques welcome. Also possible optimizations. import unittest import random def merge_sort(seq): """Accepts a mutable sequence. Utilizes merge_sort to sort in place, return a sorted sequence""" if...

0
Q: Storing unique emails into an array

MunkeyIt all works exactly as it should. It finds data from today, finds unique emails and puts them in an array. I then check the data again from today, against the emails to total up different values. Then output those values to a sheet. I'm sure there might be better methods to do what I wish. Su...

 
Is the following C# or Javascript?
0
Q: Making adding to a dictionary more efficient?

SmooreI have the following code below and it's taking quite some time to run and I'm getting an Out of Memory Exception due to the high volume of answers there are. Is there any way I could speed it up? var controlStrings = answerControlStrings.Where(a => a.ControlN.Substring(a.ControlN.IndexOf('_') ...

Welcome home, @SimonAndréForsberg
 
@Jamal ummm....what?
 
@SimonAndréForsberg: Nothing.
 
@rolfl it's bad C#
 
6:27 PM
var keyword was introduced in C# 4.0 right?
 
carpet != tank
 
Dynamic Typing and such.
 
@rolfl: Friend of yours?
0
Q: Storing unique emails into an array

MunkeyIt all works exactly as it should. It finds data from today, finds unique emails and puts them in an array. I then check the data again from today, against the emails to total up different values. Then output those values to a sheet. I'm sure there might be better methods to do what I wish. Su...

 
So, remove jquery tag (jquery is javascript, not C#) ... ?
Ohhhh looks a little young for me.... :(
 
@Grey var is not dynamic typing, it just infers the type!
 
6:28 PM
@Grey var is implicit typing, I think was introduced in C# 3.0.
dynamic is something else
 
is implicit the same as statically typed?
 
what's statically typed?
 
@Malachi, this was a good one:
Don't add legs to a Dog, it will walk funny and people will laugh at it and call it names. — Malachi 4 hours ago
3
 
Define "high volume"? What's exactly constitues an answer - we have nothing to review here, and it's not clear whether you're asking for a peer review or for us to find where your OutOfMemoryException comes from. Former is fine but needs more context, latter is off-topic on this site and needs more context. — lol.upvote 45 secs ago
^^ DVA
 
@Grey Yes, at least in this case. When we do var foo = "abc" the compiler looks at that and sees that foo will be a string. So it's the same as string foo = "abc", just less verbose. It's still statically typed and everything
 
6:33 PM
@SimonAndréForsberg Thank you, I am glad she didn't want to take away legs from that Dog either!
 
@lol.upvote Statically typed is when you know the type at compile time (I think). C# and Java and stuff are statically typed languages, you have to declare the variable's type along with it. JavaScript and PHP for example are dynamically typed languages, you have no idea at compile time whether a variable is an object, which class it is (if any), if it's an array, or int, or string, or double, and so on...
(Can you tell that I don't really like dynamically typed languages?)
 
@Grey if you do var foo = DynamicFactory.Create(); where Create() returns a dynamic type, then the type of foo is dynamic.
@SimonAndréForsberg yeah I get it - in other words, it's declarative typing (IDK if that even exists)
 
@lol.upvote but that's because in C#, "dynamic" is a kind of statically applied placeholder type
 
@lol.upvote What's a dynamic type in C#? Would that be generics or stuff? (I think @amon is right here, that it's still statically in a way)
 
6:36 PM
@SimonAndréForsberg nope. Generics are just another type of... types
dynamic in C# is a keyword.
 
generics are best described as “type variables”, I think
 
Like IEnumerable<T>, where T is yet another type.
 
@lol.upvote Oh... good... for a moment I thought you were using it to describe the language ... ;)
 
yeah, type variables is a good name for it
 
I think the T in IEnumerable<T> is actually a type parameter
 
6:39 PM
the proper computer-sciency term for “generics” is of course “parametric polymorphism”, and “dynamic” would be called a “bottom type”
 
"bottom type"? Synonym of "@$$ type"?
 
Lol
5
 
@Grey you just said an auto-starred word.
 
:(
 
@lol.upvote: If you reveal that secret, everyone will barge into this room to earn Talkative...
 
6:42 PM
oops
 
locks all the doors
 
108 unanswered javascript answers left, soonish I will run out of new Revival badges ;)
6
 
"A type, in type theory, which has the property that it is the subtype of all other types in the universe. As it is impossible for an instance to be a member of all types (there is no instance which is a record, AND a boolean, AND a function, for instance); this type is empty or "uninhabited"; no instances of this type exist."
 
@Grey Next time though write, use a lowercase starting letter, that's the norm around here
 
^ hypocrite
 
6:45 PM
Jan 28 at 20:33, by lol.upvote
lol
 
is that for "lol's" only :p
Upper case "N" @SimonAndréForsberg
 
@Grey @lol just happens to be our most frequent lol'er... or... whatever we should call it.
 
xD
 
This has delete votes? I haven't seen those on a question in quite a while.
-4
Q: How to create transactive (rollbackable) methods in java?

janeclass Dog { int legsCount; public void addLegs(int x ) { this.legsCount += x; } } Imagine: I have called the method addLegs on an instance and updated the legsCount, and I now want to rollback the method call so that the legCount remain unaltered. Is there any ways to achieve this using an...

 
Geez, we have 2577 starred messages? That's 128 @Malachi days!
5
 
6:48 PM
2578
 
@Jamal deleted by 200_success, lol.upvote, Simon André Forsberg 11 secs ago
erhm, that sounds like we deleted @Jamal...
 
We deleted @Jamal??? What are we going to do!!
 
Well, there was an algebra problem that was asked yesterday. I'm still not sure how that even got here...
@konijn: If CR had a Medal of Honor badge to award, you'd probably earn it. Hardly anyone would be likely to answer so many zombies, with just rep and bronze badges as payment.
 
So a programming language with a unified type system, like C#, for primitive types, is considered a programming language that has a bottom-type?
 
@Grey No. The “bottom type” concept is just a formalization of dynamic typing – if the expression foo is of the bottom type, it can be used where any other type is expected, be it an int or a string or any other object. Not all languages with an unified type system have a bottom type.
Java has an unified type system for objects, but no bottom type. Instead, you'd use the top type (Object) and downcast wherever needed: Object foo = ...; String bar = (String) foo.
 
7:01 PM
@lol.upvote I tried a C# question, can you tell me how I did?
0
A: Non static class with static fields

Simon André Forsberg Not only is it bad practice, I'd say it's horrible practice. Save yourself, or others which will be dealing with your code, some future headache and use as few static variables as possible, preferably none! I'd say that not using the default constructor is perfectly fine, if all your Reporter ob...

 
100% agree.
 
@lol.upvote You actually had ammo for once?
I just need 7 more up-votes and I'll be rep-capped for today... I think I need a good Java-Zombie
 
0
Q: How to add background image in array of Jbuttons?

user1444692How can I add different background image in different JButtons which is in array. import java.awt.*; import javax.swing.*; public class Snake_Ladder { public static void main(String[] args) { new Snake_Ladder(); } public Snake_Ladder(){ int i; JFrame frame = new JFrame(); JPanel pane = ne...

 
7:17 PM
Is it just me, or are tags in questions no longer being displayed on the right-hand side of the screen?
 
Were they on the right-hand side?
It's always been on the left for me.
 
@Jamal it's just you. And @kleinfreund borked the site's CSS to achieve this.
 
It's always me... sigh
 
@Jamal You're right, I did find something to add to this question:
0
A: Basic Java dice game

Simon André ForsbergIn addition to what others already have mentioned, I just have a few things to add: Magic numbers. Why 7? Where does that come from? Why 6? (There are 20-sided dice as well). Declare these numbers as constants, usually any number that's not 0 or 1 (and even those too sometimes, for when you don...

tags, right side, are you kidding with us?
 
@SimonAndréForsberg HOLY CARP
 
7:27 PM
@StackExchange I think we should review the code that he has there, and simply ignoring his question about how to do something...
 
@SimonAndréForsberg: +1. :-) Now I wait as my answer hopefully reaches 10.
 
What's wrong with the right-side tags?
 
Today is apparently dice week:
0
Q: Javascript dice notation roller

HydrothermalI have the following function, intended to take standard dice notation (XdY+Z) and return a (sort of) random number based on the input. Are there any bugs/bad ideas/optimizable sections I am missing? function dieRoll(dice) { if (/^[\d+]?d\d+[\+|\-]?\d*$/.test(dice) == false) { //Regex valida...

 
Oh, you mean these. Hardly ever notice them. They're there for me as well.
I hate being late to the answer party. :/
 
You need a faster gun. ;-)
 
7:34 PM
A better time-zone, I'd say.
1
A: Verifying password strength using JavaScript

kleinfreundYou're repeating a lot of CSS. Let's fix that by using your #strength ID. <style type="text/css"> #strength { width: 200px; text-align: center; font-weight: bold; } .strength0 { background-color: #B20E37; } .strength1 { background-color: #D32847; } .strength2 { backgro...

 
3 more up-votes needed.
Now I just need to figure out what that poor guy should do with all his panels...
 
0
Q: Dice notation roller in JavaScript

HydrothermalI have the following function, intended to take standard dice notation (XdY+Z) and return a (sort of) random number based on the input. Are there any bugs/bad ideas/optimizable sections I am missing? function dieRoll(dice) { if (/^[\d+]?d\d+[\+|\-]?\d*$/.test(dice) == false) { //Regex valida...

 
@ChrisW ... I updated my shortest-path answer ;-)
 
7:51 PM
@lol.upvote It's not that "we have nothing to review here"; it's "we don't have much to review here".
 
@ChrisW true... but too late ;)
 
13 more reputation to 5k!
 
@SimonAndréForsberg - really?
 
@SimonAndréForsberg really?
 
Yeah. Although I noticed that you've earned that much rep just this year...
@rolfl @lol.upvote oh, I see what you did now!
Thanks, Santa!
 
7:56 PM
You're at rep-max.... and 2 short ;-)
 
Can Santa please give me two more? Damn it...
 
You need an accept there somewhere.
 
I gotta ask a question that I can accept...
 
nope... does not work.
 
@SimonAndréForsberg my vote went into the gutter - you're capped!!
 
7:57 PM
you need someone to accept an answer you gave.
 
Yeah, that would be good too.
@lol.upvote Then save it for tomorrow for once! :)
 
I can't do that. ok
 
Although it still would be uneven numbers... 4998 or 5013... bah!
I need an accept!
 
Downvote 3 victims
 
There are too many good answers around here!
 
7:59 PM
@lol.upvote: In case you ever need another one: codereview.stackexchange.com/a/2662/22222
 
@rolfl I already upvoted previously.
 
@ChrisW not actually rep-mongering there... I thought you would want to see how I compared my result to yours (and the critique I make of yours).
Although, if I were repmongering.... it irritates me that there's 2 downvotes on that answer..... ;-)
 
Ladies and gentlemen. Good night.
 
8:20 PM
Ugh, I am not very proud of this for-loop and all these variables, there's gotta be an easier way to calculate those numbers.... BUT, I made it work.
3
A: How to add background image in array of Jbuttons?

Simon André ForsbergUnfortunately your question about "How to..." is off-topic for this site but I feel that your code really needs to be reviewed as there are some things that can be improved. Don't import .* Only use the imports that you need. If you need to import JButton, import JButton, don't import all other...

 
8:30 PM
@Jamal I don't know if we should edit some off-topics like that, but I just had to. It did improve the question and it did make it more on-topic.
 
@SimonAndréForsberg: Would you prefer to ask about this on Meta?
On another note, I'm proceeding with killing . As for this question, there is no language tag (that might also explain the low views in nearly a year).
1
Q: Null Object pattern with simple class hierarchy

David HarknessI have a simple two-class hierarchy to represent U.S. ZIP (12345) and ZIP+4 (12345-1234) codes. To allow clients to allow both types for a field/parameter or restrict it to one type or the other, the specific types inherit from a common generic ZipCode interface. Update: A ZIP code is five digit...

 
@Jamal I might ask it on meta. Not tonight though.
Aaaaaaaaand, it's bedtime. Night
 
Okay.
See you later today. ;-)
 
At least I got rep-maxxed, almost catching up with monkey... almost...
Haha, yeah, although it's technically tomorrow even for you, but I'll tell you to go to bed tomorrow morning, same procedure as last day :)
 
8:47 PM
You're so considerate. :-) Goodnight!
 
By the way, just had to add: The private beta for AI.StackExchange has finally opened!
Night again!
 
@Jamal re:Zombies, thanks!
 
9:03 PM
@rolfl I don't think my loop and yours are very different. My loop is equivalent to the more verbose int i; for (i=0;n>1;++i) {...} return i;which is the same as yours.
But I appreciated the heads-up that you had edited. I appreciate your revisiting it, to leave no bad answer behind.
 
@ChrisW - I really went back for myself.... I have two down-votes on that answer, and it irritates me when I mess things up. Essentially, that QA is a mess, and I figured it needed a bit of history (I also rolled-back an edit on the main question which I found invalidated a lot of things).
At least I am now satisfied I got it right.... and I think the OP has it wrong by accepting the answer he has....
 
9:18 PM
0
Q: Making adding to a dictionary more efficient?

SmooreI have the following code and it's taking quite some time to run. I'm getting an Out of Memory Exception due to the high volume of answers there are. Is there any way I could speed it up? var controlStrings = answerControlStrings.Where(a => a.ControlN.Substring(a.ControlN.IndexOf('_') + 1, a.Co...

^ I don't see why this is on hold as unclear. IMO there's code there, the complaint is "inefficiency", and/so the code can be reviewed.
 
@megawac got bled, upvote the man : codereview.stackexchange.com/a/41001/14625
 
@ChrisW - the real answer is:

int[][] data = new int[1 << 30][1 << 30]

Now there's a more efficient way to run out of memory
3
 
@rolfl @200's answer is the most entertaining. :-) It illustrates there's more than one path to the solution.
 
^^^^ yes, and, just to be sure, he explores them all
 
@rolfl It's for sure not the fastest; but fwiw it's the one I chose to test mine against.
@rolfl Are you kidding? You don't really believe he's asking for the most efficient way to run out of memory. He's saying, "I build a dictionary as follows but this implementation is slow and may run out of memory".
 
9:27 PM
@ChrisW: I'm getting an Out of Memory Exception due to the high volume of answers there are <--- the only answers to that are: get more memory, don't do what you're doing.
There is no way to store what he's storing, so therefore it needs a redesign
Your answer makes it just a neater way to run out of memory, you're storing all the same data, in all the same structures, but your out-of-memory is more readable ;-)
and the asker does not show what sort of loop structure or other call mechanism is used to call the code.
 
@ChrisW Close vote retracted.
 
I assumed that "Where" is the only 'loop'. If he has enough memory to store answerControlStrings then I'd guess he has more-or-less enough memory for newAnswer too.
 
@rolfl Downvote retracted. It was unfair, considering that the question was poor to begin with.
 
I mean, it's not very clear. If he'd posted more he might have got a better answer. But I thought there was enough code to review, little though that was.
 
Voted to reopen, per apparent consensus here.
 
9:36 PM
@ChrisW ... would it make sense to remove the items from the controlStrings list as it is iterated, so that you don't keep both the controlStrings values as well as the substrings of them?
Baaaaaaa
 
0
Q: Organising code for a genetic algorithm in Python

mr axilusAfter programming in Haskell for a while, I've gotten attached to a functional style. This is clearly evident in the code for my genetic algorithm. Could you provide me with some hints as to how I can make this code more pythonic? By that, I mean provide some method of organisation rather tha...

0
Q: js moving all array elements in circular fashion

salivanI had a situation when I needed to move all array elements in circular fashion. When I say this, I mean: 0 1 2 3 1 2 3 0 2 3 0 1 3 0 1 2 So the array: var players = ["hash1","hash2","hash3","hash4"]; Players is the array that contains user hashes and their place on the table. Table is round...

0
Q: Encrypting a payload for transmission over the internet. AES256 with PBKDF2

ndscI've done some reading about implementing AES256 and deriving a key from a password. If I understand correctly: I want to generate a new salt (for the key) and a new IV (for the encrypted message) for every new message. It should also not be a problem sending the salt and the IV together with ...

 
@rolfl Assuming that controlStrings is a list, altering the list while you're iterating it probably throws. My usual workaround if I need to, has been to make a copy of the list, so that I can iterate one while mutating the other (which wouldn't help here).
 
I think there is something else fundamentally wrong that he's operating so close to memory boundaries.
 
I've never seen (never heard of) an "out of memory" exception in C#, for what that's worth.
 
10:11 PM
0
Q: C dynamic array and pointers

RaptorDotCppI've written an implementation of a dynamic array in C, but I'm not sure if my implementation is correct... This is what I'm worried about: if I add an element, will it remain in the collection? This problem has arisen from my (apparently) limited knowledge on void pointers. I haven't found any a...

0
Q: .Net Cache warpper - Generics vs Dynamic

evilertoasterI've implemented a common wrapper pattern I've seen for the .Net cache class using generics as follows: private static T CacheGet<T>(Func<T> refreashFunction, [CallerMemberName]string keyName = null) { if (HttpRuntime.Cache[keyName] == null) HttpRuntime.Cache.Insert(keyName, refreash...

 
11:06 PM
Hey
 
@Jivings Welcome to Code Review.
or it might be more appropriate to say, welcome back to Code Review.
 
@ChrisW You should come to my work.
@Jivings Hello
 
@200_success :) Thanks
 
@JamesKhoury Trying to answer this question. I think I can see why it's slow, but not especially why it runs out of memory.
 
11:22 PM
@ChrisW Simplest/dirtiest way to fix that? go 64 bit.
 
1
Q: Please review how I structured this testimonial section with HTML tags

JGallardoI created this testimonial on CodePen I am a bit skeptical about a few things in my HTML structure. For example, I typically see testimonials enclosed in <div>s with custom classes. In my case I used a <blockquote> but had to overwrite a lot of rules. Also wondering if enclosing the author in <

 
@ChrisW Also that first section var controlStrings = ... you can replace the substring & equals with an endswith(
 string qVar = "_" + newAnser.QVar;
 var controlStrings = answerControlStrings.Where(a.ControlN.EndsWith(qVar))
 
@JamesKhoury I'm suspicious of temporaries created inside Linq's Where, and a local variable bound to each Where, and the fact that he iterates the resulting enumerale 4 or 5 times; but I don't see/understand why temporaries aren't created/destroyed on demand (if they aren't being, and their not being is what's causing 'out of memory').
 
@ChrisW I'd say it just hasn't hit the garbage collection yet. I'd be more worried that substring is creating a new string each comparison.
 
@JamesKhoury Does it not try to garbage collect before throwing 'out of memory'?
 
11:32 PM
@ChrisW Good question. I don't know. The OP needs to give us some numbers of the amount of times this s being run and the number of questions. otherwise it would be too hard to tell.
Also a micro-optimisation might be to switch out the lists for arrays
 
@JamesKhoury I suggested one foreach loop instead
 
After looking at it. I think there first .where( is kept around until the controlStrings variable is out of scope. Which means any memory created in the lambda is staying around till controlStrings leaves scope.
 
@JamesKhoury That's what I feared but stackoverflow.com/a/3160721/49942 implies otherwise. Still you may be right.
I'm guessing that GC runs on another thread when it thinks it's needed, and without blocking the user thread. So if the user's thread generates too much too quickly then it will throw.
 
11:48 PM
@ChrisW ... grats on a good RMax today!
 
@ChrisW I think in this case Linq is not the best choice. I think the for loop idea is good. With the minimum number of comparisons for speed and the minimum number of created objects to clean up.
 
0
Q: Java Calculator (Beginner - Messy)

TheWombatGuruI tried to make a calculator in Java, I added some stuff. As can be seen in the title I'm a beginner, I only learned yesterday how to make buttons ;). Here's my code: import java.awt.Dimension; import javax.swing.*; import java.awt.Toolkit; import java.awt.event.*; public class JavaCalculatorCo...

 
@Jamal - brat!
Lost my edits....
 
Sorry. :-/ I guess we do need a feature request in which a "Jamal is editing; stand clear" message is displayed at the top.
5
 
@Jamal - still, I managed to sneak in S&W today ... ;-)
Does S&W Open up new features in SE?
 
11:56 PM
Nah, it's just a badge.
 
27
Q: Strunk & White and Review Stats

Adam RackisHaving gotten the Strunk & White badge, I can now see my review stats. The trouble is, I see nothing but zeroes both for today, and all. In the past I've clicked through plenty of questions both in the "First Questions" and "First Answers" tabs on StackOverflow.com/review and voted/edited man...

^^^ did it used to do something?
 
00:00 - 17:0017:00 - 00:00

« first day (277 days earlier)      last day (3587 days later) »