« first day (430 days earlier)      last day (3573 days later) » 

3:07 PM
@skiwi Yeah, I'm leaning towards Java and Spring-MVC, as I have some previous experience with that. But they're not ready to start just yet either way so we'll see.
 
@SimonAndréForsberg WHAAAAAA
 
@Vogel612 I'm reading the question and your answer now
 
which one??
the GMAIL or the thing with the nested maps and for loops?
 
@Vogel612 the mail thing. I haven't seen the nested thing yet.
@Vogel612 Thread.sleep() with values other than 0 or 1 I'm not sure those 0 and 1 values apply the same in Java.
I like your answer overall, ScheduledExecutorService is a long word and good suggestion.
Unfortunately I don't have any experience with the mail-specific things
 
me neither...
 
3:27 PM
@CaptainObvious Yes. Create the query in whatever language is connecting to the database. Good gracious that's ugly.
 
Two zombies down already and much cleanup to do. Busy day on CR today.
 
Hrm. That would seem to be OT for the site "Please evaluate for errors"...
 
0
Q: Custom module of common functions

undergroundmonorailI got sick and tired of writing certain functions over and over again, so I made a module that has those functions whenever I need them. I don't use it for code I plan on sharing, so I don't need to worry about portability. I do code in Python 2 and Python 3, so I used a bit of hackery to make it...

 
@Jamal I've received 85 rep today without doing anything.
 
And I've received just 10 by doing something. :-P
3
 
3:46 PM
anyone use Android Studio on Windows?
 
@Jamal Doing nothing pays off.
@Malachi Yes
 
@Donald.McLean I am working on a small answer for that question
@SimonAndréForsberg does it work well, or are there still tons of bugs that make it not so fun to use?
I don't really want to use Eclipse because it seems Bogged on Windows (Last Time I tried to use it)
 
@Malachi It's working quite fine if you know how to use it.
@Malachi I love Eclipse. But I do use Android Studio for Android development these days. Although I don't do much Android these days.
 
I don't, it's been a while since I did Android Development, and I didn't do much either, small app about 3 years ago
I want to get into Android Development, there is money to be made!!
 
@SimonAndréForsberg I see. I'll take a break, then.
 
3:51 PM
@Malachi I've tried Eclipse several times and found that, for me, the UI is completely maddening.
 
Eclipse works much better on Ubuntu than it does on Windows 7. it's quicker and more responsive.
 
Anyone know javascript?
 
@ckuhn203 What do you want to know?
 
@ckuhn203 depends..
 
Can an object reference one of it's properties to set another one of it's properties?
Like
function MyObj()
  this.Cycle = sheet.getRange(cycleRow,currentCol).getvalue();
  this.Title = this.Cycle + " - " + sheet.getRange(currentCol,taskCol).getValue();
};
Obviously simplified^^ Google's IDE sucks.
I can't tell if this is legit.
 
3:56 PM
use this. syntax
@ckuhn203 that looks right to me.
 
Thanks!
 
have you tested it @ckuhn203
 
I was hoping I was on the right track.
Getting ready to @Malachi.
 
@ckuhn203 what does sheet.getRange return? If it returns an object with a getValue method I think you're on the right track
this.Title = this.Cycle ... is perfectly OK
 
@ckuhn203 try to ping @konijn he is our resident JavaScript Expert
 
3:58 PM
@Malachi Everything's quicker and more responsive on Ubuntu than on Windows 7. Especially if your Windows is f**ked up.
 
Yes. It returns a Range Object. It's not javascript proper. It's google apps.
 
@SimonAndréForsberg When is Windows not?
I can run more stuff on an ubuntu computer that has less power than on a windows machine with more processing power and more Memory and more everything....
meeting....bbl
 
@Malachi Yes
It works quite decent, though integrating it with a VCS can be a challenge at times
 
@skiwi what on ubuntu??
naah sudo apt-get git and you're done ;9
 
Well folder-based it's always easy obviously :D
 
4:22 PM
0
Q: Longest Common Substring solution for a string and a list

OleksiyRecently I have discovered one thing, which makes me feel frustrated. The Perl is lack of syntax sugar for strings, to do the same things, those are applicable to lists. The implementation I posted here would require to be rewritten to work for lists. Thus, I had to re-write the code to Python t...

 
@skiwi VCS?
 
@Malachi version control system
2
 
0
Q: Should I declare all of the outer functions inside the object literal?

Rahul DesaiI am working on an HTML5/jQuery todo list app and here is my code so far: http://jsfiddle.net/rdesai/csTS7/19/ As you might notice, there are some functions called at the beginning of the JS code. These functions work perfectly right now. My question is - Is it OK if I declare these functions in...

 
4:38 PM
@skiwi Gotcha
@skiwi I thought it was something like that after @Vogel612 made that comment
 
5:09 PM
smart :)
 
5:23 PM
Hey all
 
5:50 PM
0
Q: Revised Job Queue for Strategy Game

bazolaAfter posting my previous question about this Job Queue, I decided I wasn't actually very happy with it. I am embarrassed to admit that upon further testing it did not function properly in all situations. I received some awesome feedback about it, and I have made extensive changes to the classe...

 
6:07 PM
cool - it looks like VS 2014 CTP2 came out today
 
2
Q: Merge two linked list

JavaDeveloperGiven two linkedlist, merge them. Looking for code review, optimizations and best practices. The code is influenced by feedback here. public class MergeLinkedList { private Node first; private Node last; private int size; MergeLinkedList(List<Integer> items) { for (Integ...

 
Anyone have a second for a C# question?
 
@JohnP I can't promise I can answer it but sure
@CaptainObvious We should consider a rename to JDQ Overflow
 
I always just throw OutOfMemoryExceptions with those :/
but try us
 
It's a weird thing with a comparison. We are processing appointment files, and we want to remove duplicates that are later in the day.
We are using the SELECT command available through datatable.select()
the one in question has appointments at 5:30p and 6:30p.
Here's the select criteria for the dupe removal:
7/8/2014 11:07:06 AM: Search Expression: phone = '0000000000' AND txtname='SOMENAME' AND time > '17:30:00' AND deleted=false AND dr <> 'X'
7/8/2014 11:07:06 AM: Search Expression: phone = '0000000000' AND txtname='SOMENAME' AND time > '18:30:00' AND deleted=false AND dr <> 'X'
Neither one of those returns any rows. However, if you change the first criteria to be less than, rather than greater than, it finds and deletes earlier appts leaving you with the latest one.
 if ((bool)currentRow["deleted"] == false && currentRow["dr"].ToString() != "X")
                {
                    string expression;
                    expression = "phone = '" + currentRow["phone"].ToString() + "' AND txtname='" + currentRow["txtname"].ToString() + "' AND time > '" + currentRow["Time"].ToString() + "' AND deleted=false AND dr <> 'X'";
                    LogOut("Search Expression: " + expression);
                    DataRow[] drsearch = dsPassInfo.Tables["RawAppts"].Select(expression);
In that form, it never returns a match. Flip the > to < and it works.
 
6:18 PM
System.Data.DataTable, I presume?
 
ah, dataset I believe.
 
n/m just saw the DataRow stuff after I expanded the text :)
 
oh, thought you were talking about the original.
Also, a 10:15 vs 11:15 will fail, but a 5:00 vs 6:00 will pass.
 
@JohnP What datatype is the time column?
 
string as well.
 
6:31 PM
/shrug I threw together a quick console app, and the above queries seem to work as expected with rows containing 17:31:00, 17:29:00, and 18:31:00
 
0
Q: Faster way to get all primes between 0 - n

WiiMaxxIs there a faster way to get all primes between 0 - n using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Numerics; namespace myPrime { public class simplePrimer { public List<BigInteger> primeList; public void findVersion(...

 
though in the advent of Linq to DataSet, I would switch to Linq queries rather than row filters
but that's more a preference thing
 
0
Q: Comparing pivot choosing methods in quicksort.

CeleritasI have seen various tweaks for quicksort and to establish their usefulness, I designed a program that randomly generates arrays and times how long quicksort takes to sort them. Right now I'm focusing on how the pivot is chosen. I'm comparing choosing the first element as the pivot versus choosing...

 
Hey, @JavaDeveloper
 
6:39 PM
Hrm. If the later appt is first, it works. If the later appt is later, no workee.
hah. workee {rawwwwrrrr}
 
@SimonAndréForsberg hey
 
@JavaDeveloper Hey there, nice to see you in chat
 
heya JD, welcome.
 
@SimonAndréForsberg thanks - hope the reasons make sense ? I just updated your latest concerns.
@JohnP Hey, I hope adding attributions to geeksforgeeks solves your concern
 
@JavaDeveloper I haven't read them yet, I will check
 
6:42 PM
@SimonAndréForsberg sure. Thanks for concerned feedback
 
Not really a concern, just an...oddity. Review is legit, no worries.
 
Let me explain my thinking - each code is an independent piece as mentioned, becuase in interview ( not in real life ) i have to write linkedlist or tree only once on white-board so I guess code duplication concern can be discarded. — JavaDeveloper 8 mins ago
I understand what you mean here, but if you would do this in an interview it would be a bad idea to have one class only. I think your code would be better if you could separate the data structure from some methods operating on them.
Of course your BinaryTree could have methods such as remove and add and stuff, but I would not expect to see a findNodesWithoutASibling method inside the BinaryTree. It's way too specific for that.
Regarding your concern for hiding internal details, yes that is a good thing, but your could still provide methods to modify the BinaryTree. Such as getChildsFor(int nodeValue) and addChildTo(int nodeValue)
 
@SimonAndréForsberg How do u suggest each node be an instance of 'BinaryTree' ?
 
Writing code as fast as possible is dangerous here...
 
Monking all the CRitters.
 
6:49 PM
hi
 
@JavaDeveloper Your node class can be hidden inside your BinaryTree class, just like you do now. You do need to, however, provide proper methods to do work on your BinaryTree.
 
Monking @rolfl
 
@JavaDeveloper Just out of curiousity by the way, where are you from?
 
@SimonAndréForsberg Seattle, how about you ?
 
@JavaDeveloper I'm from Sweden.
 
6:50 PM
As opposed to the Sweden in Africa ? ;-)
 
@rolfl No, the one in Minnesota.
 
@rolfl happy now? :)
 
Better.... Hey, I'm home early, life's good.
JavaDeveloper, you've been the subject of some discussion recently ;-)
You are our one and only Socratic user
 
@JavaDeveloper The java.util.LinkedList class does a good job in hiding the internal details (the Node), but it still provides sufficient methods to modify the List.
 
::pulls up geeksforgeeks and starts typing::
Hrm. I have a 14 y/o unopened Bawls soda on my desk. I wonder what it would do to me if I drank it.
 
6:54 PM
@rolfl @JohnP Haha, I really never knew pulling questions from geeksforgeeks would be a concern, well each question belonge to somewhere, none of the questions Ive asked were invented by me.
 
lol
 
The Swedish Gold Coast () was a Swedish colony founded in 1650 by Hendrik Carloff on the petroleum and natural gas rich Gulf of Guinea in present-day Ghana in Africa. It lasted until April 1663 when the whole Swedish Gold Coast was seized by Denmark, and integrated in the Danish Gold Coast. Geography The colony consisted of only a few forts and trading posts scattered around Cabo Corso (present-day Cape Coast) along the coast on the petroleum and natural gas rich Gulf of Guinea in what later would become the British Gold Coast then Ghana. The colony consisted of fortifications and trad...
@JavaDeveloper It's perfectly fine to pull questions from geeksforgeeks or other sites, most of us (or at least I) just had no idea from where you were pulling your assignments. It is good that we know now.
 
I broke my own code
 
There is the issue of attribution though, you have to site your sources when you copy things (if the source permits copying)
 
@skiwi Congratulations(?)
 
6:57 PM
Ok, this is getting weird. If we manually add a 3 and 4p appointment for two people, later appt removal works for one but not the other.
 
@rolfl point noted, I wasnt aware about anything like attribution. Thanks for getting it to my attention
 
Has Java ever actively used short? By thinking about it, I literally cannot recall ever using it
@SimonAndréForsberg It was not my intention :(
It was working, but then I started refactoring a bit
 
Anyway, @JavaDeveloper - you will find, that there is this whole chat side to Code Review, also, you are one of the site's most value-generating people. As the site's most prolific asker, you come up quite a lot in various places including some public newsletters and such
 
@JavaDeveloper May I ask if you've been at any interviews recently?
 
Your questions are widely distributed, and we need to make sure things are all above board.
@JavaDeveloper - you may be interested in this query: data.stackexchange.com/codereview/query/206619/…
If you sort the data by VaueAdd (click the column twice)
 
7:02 PM
@SimonAndréForsberg I'm with stupid:
 
@rolfl Nice way of telling him to vote more :)
 
BlockingQueue<Message> messages = new LinkedBlockingQueue<>();
new Thread(() -> Converter.socketToMessages(socket, messages)).start();
while (!messages.isEmpty()) {
 
... you will see that you have generated about 1.1K upvotes.
 
I really need to write more Code Review questions...
 
I still need to start JAVA...
 
7:04 PM
@skiwi My guess is that that while-loop is never entered...
@Jamal No, learn Java instead.
 
That translates to about 11K worth of reputation on the site. or about 1% of all Code Review reputation.
 
@SimonAndréForsberg Correct... So my code was working, but my test wasn't
 
@SimonAndréForsberg Ugh, fine. :-/
 
Time to do other things and then decide if my current class is CR-worthy and if I have time to put it up before the Brazil vs Germany starts
 
Sucks about neymar. That was a hack game on both sides, he just got a really unlucky shot.
 
7:06 PM
@rolfl haha thanks dint know about it.
 
Yeah, you knew that not everyone could survive that match
 
So, whether you want to be, or not, you are a high profile user on Code Review....
 
@Jamal No, Scala. It's a better version of Java.
 
@SimonAndréForsberg not appeared for any interviews since Ive started using code-review
 
@JavaDeveloper Well, I hope all the experience you receive from Code Review pays off.
 
7:08 PM
Is that because you already have a job, or still a student?
 
@Donald.McLean I'm learning Java because that's what my OO class will use.
 
@rolfl have a job, but very frankly my interview success-ration is near negligible. It takes ( hopefully took ) scores of interviews to land a job. Thus I realized I need to keep practicing them routinely.
I do feel selfish to never contribute back to community, but I hope questions I ask and feedback are useful to other people.
 
@JavaDeveloper Well you have achieved some very notable popular questions. But I think you would get even more experience from reading and working with other people's code.
 
Frankly, I am more hopeful that they are helpful to you, but I worry that yoour code is not changing very much over time.
 
0
Q: sorted list with add, delete and find

chaosflawsThis python code feels fairly long for python code. How can I improve it? class List: def __init__(self, list): self.first = list def __repr__(self): element = self.first elementsList = '' while (element != None): elementsList += str(element) ...

 
7:12 PM
I know that I've learned a lot from reviewing other people's code.
 
@rolfl they have been a huge help. Noted your feedback.
 
0
Q: Using a class inside another class

DalekI want to cythonize a code in python to speed up the code. In the following you can see my attempt to make it understandable for cython: import numpy as np cimport numpy as np ctypedef np.double_t DTYPE_T cpdef double std_G,v_c std_G=4.3e-9 # Newton's const in Mpc (km/s)^2 M_sol^{-1} v_c = 299...

0
Q: Conditional Branching Using Filter

Kn1ghtmanI'm using multiple jQuery filter functions to affect the background color of select objects based on the selected option and it works, but it seems bulky/redundant. Does anyone know how these filter statements could be simplified/combined? I have a JSFiddle here. Thanks. <!-- Load minimum ...

0
Q: Multiple dispatch decorator in Python

JoschuaI've written a decorator for easily creating multiple dispatch functions: from functools import wraps def multi_dispatch(for_function): """ Returns a multiple dispatch version of the function. The returned function doesn't allow keyword arguments. >>> @multi_dispatch ... d...

 
@SimonAndréForsberg programcreek.com/2012/12/…
@SimonAndréForsberg does this implementation sound right ? Its exposing internal structure of Node. There is not method to even construct a linkedlist ?
 
@JavaDeveloper If you expose the Node structure, then you don't need to construct the tree from a LinkedList.
 
@SimonAndréForsberg I understand but that would need to another set of feedback - why are u exposing stuff that should be internal. Most of the answers on the net as similar to what you suggested, but they somehow seem to come with their own issues.
@SimonAndréForsberg what I am strugging to understand here is how can I have a Linkedlist class datastructure that can be passed to another static class to do operation on it ?
@SimonAndréForsberg what should ll.getNext() return ? how does ll.getNext() follwing it keep track what where was the last pointer ? ( NOTE: I am not trying to refute you, its just that I am not getting clear idea of how other way really works, I want to hide internal structure as well as use a Static utility class they way you suggested )
 
7:29 PM
@JavaDeveloper That's a good question..... and, the answer is ..... you don't
 
@JavaDeveloper In that code they don't have a BinaryTree class, they only have the TreeNode, which doesn't make the TreeNode internal anymore. But I would not write it like they have done there.
@rolfl The answer to what question?
 
JavaDeveloper, when you write (java) code, you are either 'using' a class, or you are writing a class.
The question: how can I have a Linkedlist class datastructure that can be passed to another static class to do operation on it
The answer is: you don't
 
@JavaDeveloper LinkedList has an iterator, remove, add, and a whole bunch of other methods. You use the things you can. The java.util.LinkedList class is made in such a way that you don't need to access it's internal Node structure.
 
I'll just pass here to say Hi to @JavaDeveloper and you've come a long way (in term of tests) it's nice to see!
 
0
Q: Python script that gets information from tab-delimited text file

eric_lagergrenI'm much more fluent in JS, but I needed to sort a lot of dates, ages, genders, etc. from a tab-delimited text file so I wrote this. Could I get some tips on how to make this more efficient and more Pythonic? The more Python I write the more I like it, but I definitely need some help. One thing ...

 
7:33 PM
@Marc-Andre haha, thanks and Hi to you too
@SimonAndréForsberg but for so many of my interview questions, I need to access them. I need to swap pointers, reverse, merge bla bla bla
@SimonAndréForsberg I am trying to fuse your suggestion without disadvatanges of exposing internal structure, pretty sure, you understand my dilemma here.
 
You are right, if you are writing a class tha timplements a linked list, your linked list class needs to be able to manipulate the node pointers.
But, does the user of your linked list need to DIRECTLY manipulate the node pointers?
 
I hope I'll see an answer of you @JavaDeveloper!
 
@Mat'sMug interesting picture.... totally thought you would have looked differently for some reason
 
Lets say its a simple code - reverse a linked list, 2 ways to go about it.
1. new LInkedlist().reverse();
which @SimonAndréForsberg dislikes
 
@JavaDeveloper One way would be to make the internal systems accessible with package-private access.
 
7:36 PM
2 UtilClass.reverse(linkedlist)
@SimonAndréForsberg would that be recommended , might raise other questions, ? Anyways I am open to suggestions.
 
There's the third option of creating a new LinkedList with reversed content....
 
linkdIn sucks. $30 a month, that is crazy!
 
@rolfl not sure what you mean. How would that answer in interview "given a linkedlist reverse it ? "
 
I would call: Collections.reverse(List) ..... ;-) : docs.oracle.com/javase/8/docs/api/java/util/…
 
@rolfl i agree it solves specific case, but not the intricacies or merge, sort, swap etc etc
To solve many of these questions, I need access to internal data structure and play with pointers, such as node.next = first.next.next etc
 
7:42 PM
We are getting hypothetical. Maybe it is just me, and it won't work for everyone, but, in an interview, if someone asks me to reverse a list, I would ask why i can't use the standard tools.
 
@JavaDeveloper For merge: Call the public add method (possibly the add of the listIterator for better speed), for sort: Depends on what sort you are doing. Call add and remove, set, or whatever you'd like. For swap: Call set.
 
reverse list is but just one example
 
That's true, but, if they give me 'template' code that has bad practices in it, I would challenge them and say, 'don't make Node public'.
if they say "implement a reverse method on a linked list, I would ask why it has to be on the list.
If they say, "well, assume it has to", then I would 'extend' LinkedList, and add a reverse method.
 
They'd need a reason about why you need to 'waste' time to implement something that already exists. In interview questions there are many legit reasons for that.
 
If they insist that I have to implement the list from scratch, then I would say, Hmmm.... that's odd, and contrived, are you sure the use case requires it?
 
7:45 PM
@SimonAndréForsberg @rolfl let me make my question generic, lets ignore reverse for a second, many of linkedlist questions need me to play with pointers of internal data-structure, and only two ways around it are 1. make Node public rather than private and use a Util class 2. keep Node private and implement methods within data structure
 
Always do 2
If you need a method that does something 'special', then that's OK, it's something the data structure needs to do.
 
ok, i think i do agree
 
@JavaDeveloper Yes, if you absolutely need to play with pointers and internal data-structures, go with the second option.
 
noted
 
Let's think of a use case..... real one.....
 
7:47 PM
There is however the concept of package-private.
 
^^^ useful for testing more than anything else.
though I use it a fair amount in JDOM
2
 
@rolfl I use it a fair amount in my Card-game classes. I might also have used it in my Minesweeper code. And I can't remember having received bad reviews from that.
 
It's not 'bad', just often unnecessary....
a static nested class accomplishes the same thing, mostly
 
@rolfl Example? I don't exactly see how there...
 
What was the markdown to specify that a code block has no language?
 
7:54 PM
 <!-- language: lang-none -->
 
thanks
 
@JavaDeveloper When separating things into separate classes, you have to think about what methods are publicly available on those classes. As @rolfl mentioned in a recent answer to one of your questions, you might completely miss adding a get method and other important methods.
 
Meh, markdown doesn't want to recognize an empty code-formatted line
0
Q: HTTP request reader

skiwiI'm working on a proxy service that will run on top of a Java application in order to manipulate some headers. I've just completed the first step and that is intercepting the request message and storing them. This code features only the storage part, and not the edit and send part. Some informa...

Does anyone know how to change (an empty line !important) into a real empty line?
@Jamal must know how to do that. :)
 
@skiwi Not sure I know what you're after. Do you want the top two code blocks to be separated?
 
@Edward check the http request example
 
8:00 PM
@skiwi I'm not quite sure what that is, but I was already aware of the syntax-highlighting thing.
 
:( -20 rep on SO because of user removed
The problem is that it is the last line of the code block
 
@rolfl I might understand just now what you meant by package-private vs. private static inner class. Were you thinking about BinaryTree & TreeNode? Because I was more thinking about CardGame & CardZone (which really should be two separate classes)
 
@SimonAndréForsberg totally agree, and in my latest code i did improvise on it. but, my mindset is a bit interview obsessed, and in interview they are only going to care about the single function that does its job 'merge / reverse" etc followed by some edge cases. Thus I happened to skip it
 
@JavaDeveloper I don't think that they are "only going to care" about anything. I think they are going to look at the overall impression they get from you.
 
@SimonAndréForsberg agree,
 
8:07 PM
1
Q: HTTP request reader

skiwiI'm working on a proxy service that will run on top of a Java application in order to manipulate some headers. I've just completed the first step and that is intercepting the request message and storing them. This code features only the storage part, and not the edit and send part. Some informa...

 
logging off
 
@JavaDeveloper I hope to see you back in chat more
 
@skiwi Got it. Just manually put in <pre><code> ... </code></pre> tags instead of indenting.
 
@Edward Ah thanks, I'll remember that one for sure
 
I already edited that post.
Just to try it out. :)
 
8:10 PM
Hey cr
 
Weird. Someone voted for one of my SO questions, putting me within striking distance of a curious badge.
 
People upvote on SO? /snark
 
@Jamal Seriously.
 
Sweet
 
David Harkness and I posted almost the same answers at almost the same times: codereview.stackexchange.com/q/56481/31503
Hmmm.... it's a lot to delete..
 
8:19 PM
does this count as a linked list?
 
@Malachi Now it's linked.
 
how about this?
List<Int64> primes = new List<Int64>();
for (Int64 i = 2; i < upperLimit; i++)
{
primes.Add(i);
}
List<Int64> numbers = primes;
 
Assuming that's Java, then no, it's just an ordered collection. You don't really know what's under the hood.
 
@Malachi Assuming that's C#, then no. List is an ArrayList, I believe.
 
And if it's C++, it's whatever the author of the List<> class decided to make it, just as with Java.
 
8:23 PM
@Edward There is no constructor for List in Java, List is an interface. Unless another import would have been used (which I doubt)
 
@SimonAndréForsberg Right. I don't use Java much and forget which things are interfaces and which things are real classes. C++ doesn't make that distinction in that way.
 
@CaptainObvious @skiwi where do you read the HTTP method? Can't find it in your code
 
Monking all
 
@CodeX Howdy
 
can't find anything that looks like it's reading/storing the http method, resource path, http version
 
8:32 PM
@SimonAndréForsberg well because I made 2 lists that are exactly the same.....
 
@AlexL Do you work much with MySQLi?
 
Used too, switched over to PDO though. Why?
 
Ive made an AutoBind for bind_param
Only problem is you cant pass an int directly?
 
Why not?
 
@Malachi Well, if this is the line you are talking about: List<Int64> numbers = primes; then numbers and primes are the same list.
 
8:35 PM
@CaptainObvious Why is this being voted for close? Anyone know?
 
Reference error :/
 
@SimonAndréForsberg so then they are not linked lists! awesome
 
@Malachi What does it matter if your list is linked or not?
 
@SimonAndréForsberg I was just curious....I don't know
 
@CodeX I'd be interested in taking a look
 
8:37 PM
Sure, pastebin?
 
Sure
 
@AlexL Do you have a pastebin?
 
@AlexL guess someone thought it was "too broad." Haven't seen that used here before...
 
@DaggNabbit We're allowed to ask questions without a specific thing to review, aren't we?
@CodeX No I don't
@CodeX But now I do
 
monking
 
8:40 PM
@AlexL I hope so, that's kind of the point of a code review isn't it?
 
Yeah haha
 
@DaggNabbit I voted to keep it open. Seems pretty obvious that it's looking for review, and specifically about performance.
 
@AlexL pastebin.com/i1t30g8v Can you see that?
 
@CodeX Mmm nope. I'm logged in but it says I need to be logged in O_o
 
Haha
maybe login?
 
8:45 PM
Did, it logged me in while already logged in. And then complained I needed to log in...
 
:/
 
@CodeX Can you just make it unlisted for now?
 
Sure
@AlexL Done
 
Wow @ Brazil - Germany
@DaggNabbit What do you mean exactly?
 
@skiwi Yeah, I heard from my brother. I guess Brazil's not happy at the moment
 
8:48 PM
How on earth is my question too broad >.<
@DaggNabbit Data enters the code via a Socket, might not've been fully clear
TTGTB
 
@skiwi I meant the very first line that gets sent with a request... didn't see that getting read anywhere
GET http://something.com/somewhere/ HTTP/1.1
^ that kind of thing
@Edward you can counter-vote close votes? Didn't know that
 
0
Q: Code for simplifying the creation of Dimension Objects

jth41I have a class that I use to represent a distance called Dimension. Here is its four constructors: /// <summary> /// Accepts any valid architectural string value for input. /// </summary> public Dimension(string passedArchitecturalString) { storeArchitecturalStringA...

 
@DaggNabbit When reviewing, upper right corner has , and if I remember correctly.
 
ah, ok
i thought everything but [close] was basically a no-op
 
"Skip" is a no-op, but "leave open" is essentially the opposite of "close" in this context.
 
9:12 PM
0
Q: Malachi's first try at Sieve of Eratosthenes

MalachiI would like a complete Threshing of this code so that I can see what I did wrong and what I am using incorrectly. I did this super simple, trying to learn a little bit about List<T> while I was doing this. I have never actually tried to do this before, so I thought it would be a good learning ...

 
0
Q: Updating XML config files

aaronmallenI have been unable to find any other way to update a user config file than the following method. public class SettingServices : ISettingServices { public UserSetting GetUserSetting() { XmlSerializer reader = new XmlSerializer(typeof(UserSetting)); StreamReader file = new...

0
Q: Malachi's first try at Sieve of Eratosthenes

MalachiI would like a complete Threshing of this code so that I can see what I did wrong and what I am using incorrectly. I did this super simple, trying to learn a little bit about List<T> while I was doing this. I have never actually tried to do this before, so I thought it would be a good learning ...

 
can anyone point me to some literature(links) that would show me how to create unit tests and stuff of the like in Visual Studios 2013?
can't believe I just admitted I didn't know how to do that stuff
 
9:28 PM
@skiwi - case sensitivity!
 
should I be doing the unit testing before I write the code?
@rolfl you like my use of vocabulary?
 
@Malachi Depending on who you ask, "yes", it's called "Test Driven Development" and it is a hot topic in the industry.
Threshing is cool, yes. I prefer it to Malachi-ing the Sieve.
2
 
@rolfl I need to learn it badly then!! LOL
 
Mark the date anybody, I'm actually going to watch the football game.
 
Don't tell me the score.....
 
9:39 PM
what do you think of the code itself?
 
C# <----
 
0
Q: error: '{' expected public class

user3693592I need assistance as I am having the following error and cannot understand what I am doing wrong. The error is: error: '{' expected public class PanelTop() These are my first weeks of java therefore your feedback is much appreciated import java.awt.BorderLayout; import java.awt.Color; import jav...

 
@Malachi - You introduce your own inefficiency. When you build the initial list, you can automatically discard any even number, that way you don't have to test it.
Other than that, it's a good solution.
 
@JohnP I guess I could have dumped it out when I made the initial list of numbers huh?
if you don't make it an answer I will in about 15 minutes @JohnP
 
@Malachi - Was typing.
 
10:01 PM
@Malachi - Although, it seems that the code as edited runs in about the same timeframe, and takes up 3 megs more of memory than your original. At least according to .netfiddle.
Mine: Last Run: 	3:00:40 pm
    Compile: 	0.078s
Execute: 	0.062s
Memory: 	10.41Mb
CPU: 	0.078s
Yours:
Last Run: 	3:03:00 pm
Compile: 	0.106s
Execute: 	0.078s
Memory: 	6.78Mb
CPU: 	0.109s
 
10:14 PM
Is there anyone in here that has not seen the game today?
 
@JohnP thank you for that info, that is interesting to see
 
@johnP here. I know the resilt though..
What you write here is plain incorrect. Actually each line of code, except for about 8 in that 80LoC method has their full reason for existence. after I spent two hours dissecting the code and having a rename-orgy I know! Actually I am sure your code will not produce the same output for a few test cases I have come up with. I will post an answer tomorrow to prove — Vogel612 5 mins ago
 
@JohnP I believe @rolfl haven't seen it. Or at least he told me earlier to don't tell him the score. I'm not sure if he's aware of the result or not though.
 
aight.
w00t. Another 10 rep and I gain a privilege. I feel so blessed.
 
@JohnP Which privilege?
 
10:29 PM
View close votes. 250 needed. I'm not prolific
 
0
Q: Pub/Sub Implementation for cross-$scope communication in Angular

SirTophamHattCertain interactions within a $scope of my application require side-effects that happen in other $scopes. For example, a registration event should trigger changes in the top navigation and content but I want to keep the navigation and content entities safely decoupled from the registration code. ...

 
Oh, has anyone heard of security flaws in the google GCM demo application?
 
Well TTGTB and better write up an answer againt toto2 tomorrow. Just need to rmember to take the code to school..
 
10:50 PM
@rolfl how do you feel about BDD? Is it worth writing tests in this style, or is it just semantics and hype?
on one hand I think the results seem a little more clear than plain old unit tests but on the other I'm not really sure it's that much more useful
...where's that monkey
2
 
@JohnP Nope. Are there any?
@DaggNabbit What's BDD? Bed-Driven-Development?
 
lol
 
I could go for some bed-driven-development right now
 
Behavior-driven
scenario("I can wear pants"):
    Pants pants = new Pants();
    given("I have pants"):
        assert(pants.legs == 2);
        when("pants are too small"):
            pants.size = 32;
            then("the pants don't fit")
                assert(pants.isToTight() == true);
...etc
 
11:08 PM
@DaggNabbit Reminds me of mocking.
 
it's basically just a specific style of writing tests for TDD
i guess it encourages you to do things in a sensible way... it's probably a good thing
@SimonAndréForsberg check out this link, the first example is a "normal" test and the next one is BDD-stlye: github.com/philsquared/Catch/blob/master/docs/…
 
@skiwi I think this one is for you: javafxports.org/page/home
 
0
Q: Get user level based on his total post

RFRichardI'm not sure if that title is correct as English isn't my first language. Let's get straight to it: So let say a user has a 575 post and i want to give access base on post level. In order to be user Level 1, that user have to have more than 200 post, level 2 = 300 post more (500 in total). I n...

 
@CaptainObvious too slow
 
@DaggNabbit are there any BDD advantages except for improving the readability of it?
 
11:23 PM
@SimonAndréForsberg mainly that it forces you to think about your tests in a certain way i think
i guess the idea is if the test doesn't fit in with the notion of BDD you shouldn't be writing it, or should be writing it differently
 
0
Q: Why are these functions slower than BigInteger's included methods?

Brian J. FinkI tried writing alternative functions to Java's BigInteger.add(BigInteger.ONE), BigInteger.add(BigInteger), and BigInteger.subtract(BigInteger): public static BigInteger increment(BigInteger x) { int i=0; while(x.testBit(i)) x=x.clearBit(i++); x=x.setBit(i); return x; } public st...

 
@DaggNabbit That sounds reasonable.
 
I thought BDD was about testing behaviors like asserting that foo.Bar("baz") is called rather than testing state like foo.Bar == "baz". The given/when/then naming style came along for the ride, but it's an orthogonal concept you can still apply to state-driven tests.
 
TTDBDS. Time To Do Bed-Driven Sleeping.
 
@Jamal codereview.stackexchange.com/questions/56511/… definitely doesn't not work. See my comment.
 
11:34 PM
You could vote-to-close, then.
 
0
Q: Memory-efficient string collection

mjolkaMy goal is to create a memory-efficient (immutable) collection of strings. The imagined use-case is checking for valid words in a Scrabble-like game. The approach is based on the paper Incremental construction of minimal acyclic finite-state automata. namespace Mjolka.Collections { using Sys...

 
M$ just dropped over 100 new free ebooks. blogs.msdn.com/b/mssmallbiz/archive/2014/07/07/…
 
@DanLyons hmm, could be... although in a stateful application, isn't testing state a good way to make sure that it's behaving the way it's supposed to?
iow if you want to test that foo.setBar("baz") behaves correctly, shouldn't you call it and then check the state of foo.bar?
i mean, just testing that foo.Bar("baz") is called isn't good enough, is it, you need to make sure it actually did the right thing don't you?
maybe I'm confused about how it's supposed to work
 
11:54 PM
The cases where testing the method call works best is where there is no state, or it isn't easily accessible.
 
@Malachi that picture is older than my sons!
 
For example. if you have a view with a Save button that ultimately persists data to a file, there may not be anything in your presenter(MVP)/viewmodel(MVVM) you can look at during testing.
 
Damn I really need to update my LinkedIn.
 
Instead, you can just test that your injected IFooSaver.Save method is called with the expected data.
 

« first day (430 days earlier)      last day (3573 days later) »