« first day (779 days earlier)      last day (3230 days later) » 

4:00 PM
New post: Developing User Interfaces http://importblogkit.com/2015/06/developing-ui/ #ios #apple
 
@Vogel612 done
 
4:21 PM
@200_success Good question, been thinking about that last time I hit the airport
 
4:34 PM
I bumped when "how to ask it" is too subtle, it's approaching 2,500 views (and heck, 25 votes).. and it can't hurt to have that one on the front page, right :)
> off-topic - Questions containing broken code or asking for advice about code not yet written are off-topic, as the code is not ready for review. After the question has been edited to contain working code, we will consider reopening it.

> closed 6 / 60.00 % of closed questions 0 edited 0 reopened 0 edited+reopened
@QPaysTaxes if it's grudgingly, expect 100 at the end of the bounty period ;-)
 
@QPaysTaxes Who does.
 
@QPaysTaxes I am hoping you'll get 100 rep. Your answer is the better answer, and thus has my check-mark.
 
if it's not manually awarded, you get half.... I think. If the answer was posted during the bounty period... I think.... ....lol you might actually end up with 0.
 
the bounty was for the answer that was targeting performance issues, I hoped, and your answer, while good, did not do that to my satisfaction for the full bounty.
The system should automatically award half-the-bounty to your answe.r
 
0
Q: Is there a more succinct way to write this ActiveRecord query?

Jason SwettI think the inherent relations in this query should be self-evident: ShipmentStatus.joins(shipment: :shipment_users) .where("shipment_users.user_id = ?", user.id) I have a feeling there's maybe a shorter way to express this. Can it be reduced?

 
4:42 PM
@QPaysTaxes I looked at that quite carefully, and, while you are right, I also figured there's not enough evidence in your answer to convince me that changing it is not a premature optimization.
 
Premature optimization reminds me of this:
user image
3
 
@QPaysTaxes - while we are discussing that answer, can I challenge some of your points?
The three specific things are the insistence on the <p>...</p> for javadoc, the capital @.... annotations in javadoc, and modcount.
It is... ;-) <p> does not need a closing tag, and </p> use in JavaDoc is not common
official javadoc fails if you have @Param and not @param, and all other real annotations are case sensitive.
the javadoc @... things are not actually annotations.
Ahh, but, the variable-name in the @param should match the one in the parameter list....
Add an example... ;-)
Also, finaly, modcount is a standard variable and concept in Java collections, and it is also private. I felt no need to document it because it is the same as other uses of it, and I expected people to follow that logic. Your system for calculating it is not the same functionality as is needed for usage.
 
Are we arguing about the capitalization of an A today?
2
 
@SimonAndréForsberg No, we are arguing about the capitalization of an a
 
ModCount is used extensively with handling ConcurrentModificationException in Collections.
CME is thrown when the "size" of the collection is modified part-way through iteration.
You need to be able to handle someone adding, and removing content between next() and next().
even if the size after the add and remove is the same, the CME must still be thrown.
 
5:05 PM
0
Q: Python Socket Receiver

kg_rootHello can someone help me with these code. I put it together and having some doubts to the number of connections I can make and also if I can brute force the server to serve up connections and then hang. Please take a look and tell me what I can do better, suggestions etc. Thanks! ''' Simp...

0
Q: Singly Linked List with Generics and Comparable Data

Jaspinde VirdeeI am currently reading about the Thread safe implementation of Linked List. Although I implemented this Linked-list while keeping in mind the Issues from the First code review (Binary Tree). I would like some one to point out some mistakes that will create issue if I try to make it Thread safe in...

 
@200_success edited. mucho kudos!
 
My first dentist appointment in 6 years
It's a good thing I have "very strong teeth and tooth enamel"
Could've been a lot worse
Mine said I'll probably walk out with more pain than I came in with, so she gave me some Ibuprofen -- otherwise I'd come to her even less than I already am
 
0
Q: How to implement this test case in python?

overexchange Q. Suppose that our banking system requires the ability to make joint accounts. Define a function make_joint that takes three arguments. A password-protected withdraw function, The password with which that withdraw function was defined, and A new password that can also access ...

 
> Levennav Neorej answered
My Russian name
 
in VBA Rubberducking, 2 days ago, by Mat's Mug
@RubberDuck that's Jeroen Vannevel dos Sànchez di Castello du Aragon de Pompidou
 
5:19 PM
and you better know it
 
in VBA Rubberducking, Jun 9 at 17:37, by Mat's Mug
He carries his driver's license in a binder
 
lol, I'm not going to bother with that
Whenever I come across a site like that, I notify SE and they'll put it on their legal backlog
 
@JeroenVannevel That even sounds semi-legit!
 
Everything about me is legit, baby
 
0
Q: C++ Optimizing performance when writing a large file

DavlogBasically, I want to write a huge file of numbers. Each line in that file should contain one number. This program below is extremely slow (obviously) but it works. It writes one line after line and always one number until the limit of an unsigned long has been reached. #include <iostream> #include

 
5:29 PM
I'm just gonna lurk & star today. Don't mind me.
4
lol. My Ruby-fu is soooo weak though.
 
@SimonAndréForsberg YEEEEESSSSSSSSSS!!!!
4
 
@Mat'sMug I see 35439 and 35439 ..... both.... no mugs on the wall.... (@Simon 2)
2
 
0
Q: Is the list sorted?

CaridorcIs the trade-off between simplicity and performance worth it? def is_sorted(list_): """ Is the list sorted? The simpler `list_ == list(sorted(list_))` has time complexity O(N log N), this O(n). >>> is_sorted([1, 2, 3]) True >>> is_sorted([1, 2, 7, 3]) False ...

 
@rolfl eh, I don't expect to stay ahead of @simon very long.. but I have a screenshot with me in the #5 spot! :)
2
+190 so far today... with a bounty and a checkmark.
 
I'm gonna be really disappointed if I hit 20k before we graduate.
 
@rolfl Congrats on your Legendary!
A bit late, but hey, I crashed with my bike!
 
6:07 PM
@skiwi Thanks - much appreciated..... I had been distracted for a while and I figured my July/August time was going to be crazy, so I put a push through a little while back to make it happen. I have been on-again and off-again driving for that badge for a long time now, and it's good to have it.
 
0
Q: Sql procedure with cursor to check if values in table 1 are also in table 2

JacobTime of executing below procedure takes 1 minute and 30 secounds - I'm searching for any ideas which will make executing shorter. The problem is that I'm checking if result from cursor exists in CDN.ZamNag table for every iteration. Is there any better way to check if values in table 1 are also ...

 
@rolfl Never give up :)
 
@CaptainObvious Never heard of a join?
 
@rolfl yeah, and then he smoked it and wrote a cursor
 
6:23 PM
and became a curser.
 
I'm voting to close this question as off-topic because it better belongs on Code Review, which is for questions to "Improve code that you wrote or maintain, through peer review." Please note that the submission guidelines on Code Review are a bit different, so double check them before just copy-and-pasting your question. — Shepmaster 17 secs ago
 
@rolfl uncursed
 
@Mat'sMug Working on answer too... ;-)
 
mine isn't very specific.. I couldn't be bothered to wrap my head around these column names
well done @rolfl
 
6:40 PM
ta ;-)
 
0
Q: A tiny library for textual serialization of lists in Java - follow-up 2

coderoddeSee the previous iteration. I emphasized the fact that serialization routine may not return a string with new line character by using more or less explicit identifier. Moved the actual de/serialization routines to a factory class. That's what I have: LineStringSerializationFactory.java: packag...

 
@CaptainObvious JavaDoc! JavaDoc EVERYWHERE!!
Epic: 44/50 (or 43 if it already recalc'd)
 
@CaptainObvious I see you're making extensive use of JavaDoc. You should totally drop that and use jQuery instead.
 
@Mast is that the Eclipse version of Clippy?
 
I'm sorry, but we are not code reviewers.. You should narrow it down by analyzing your own code, and identifying a possible issue, instead of just posting te entire code for us to parse it. — LcSalazar 10 secs ago
 
6:44 PM
/**
 * janos, yes we can serialize a list of lists.
 */
4
That comments in his code.
@Mat'sMug Clippy must die.
 
aaaaand
vote-capping always feels awesome
3
 
@Mat'sMug Napalm'd a couple good question/answer combo's this afternoon, but still got ammo left.
 
After reload, I will have my 1000/1000 close vote reviews.
on SO, that is.
and I'm just 40 flags away from Marshal.
 
@nhgrif That's easy on SO, flags.
Plenty of crap to fire on.
 
oh wow, just noticed I'm #4 YTD, with 900-some mugs on the wall - take that, @SimonAndréForsberg!
(or rather, you can keep your YTD #5 spot!)
 
6:54 PM
Why is the following question not closed yet? (Stub code)
-2
Q: Fetching shipment statuses for a user

Jason SwettI think the inherent relations in this query should be self-evident: ShipmentStatus.joins(shipment: :shipment_users) .where("shipment_users.user_id = ?", user.id) I have a feeling there's maybe a shorter way to express this. Can it be reduced?

 
@Mast aw, can't downvote.
but it looks like a legit one-liner review
 
@Mat'sMug YTD?
 
year-to-date
 
year to date, but he's wrong.
 
how?
 
6:56 PM
@Mat'sMug Wuuut!?
 
@Mat'sMug Uhm... eat's crow... he's right, but, I read it as 900 for the year, not 900 difference...hmmm
 
it is 900 for the year
 
in TCG Creation, 19 hours ago, by Duga
Simon André Forsberg vs. Mat's Mug: 125 diff. Year: -816. Quarter: -1566. Month: -220. Week: +60. Day: +60.
How have you gained so much on me today, @Mat'sMug?
 
@SimonAndréForsberg except today I'm just a few points short of capping
+50 bounty
...and bored at work
 
7:03 PM
ah, +50 bounty, explains it
 
Your code cuts up logs into something useful. Why didn't you call it LumberMill? #missedopportunity — corsiKa Nov 4 '14 at 20:28
 
lol
 
OoA
the Netherlands is the only country with cookie-walls, right?
 
Unless my dad cooked them.... then they're firewalls.
2
 
LOLOLOL
6
don't know why I wanted to say that
 
7:14 PM
@rolfl You must have no idea what I'm talking about.
 
@RubberDuck ok, so here I am
 
 
I didn't know about that
 
@RobertSnyder Hey.
 
@RubberDuck howdy
 
7:15 PM
hi!
 
So, anyway. I support the group of people who draw the merchandising plans.
 
@RubberDuck You want to sell rubberducks?
 
ahh.. ok, so that makes sense then your point of view
 
@Mast not into slavery.
That's just messed up man.
 
@RubberDuck Owwww.
I can always use a spare.
 
7:16 PM
Yeah. But you're right. If it hits the cashier without a price, something went wrong.
 
OMG running queries against dates take FOREVERRRRR
almost makes me think of having a 3rd service
 
Yell at your DBA. They like when people yell at them.
 
2 hours ago, by RubberDuck
I'm just gonna lurk & star today. Don't mind me.
 
It motivates them.
 
What happened to that plan?
4
 
7:17 PM
like if you had a Inventory
you'd use inventory to set prices
and then you'd have another for discounts and such
 
@200_success I was being a good citizen and not having a conversation in the comments. =)
@RobertSnyder not following.
 
i'm thinking in database right now
cause I'm running queries
9 minutes later...
 
Okay, so if I was going to keep building this thing out.
 
in my mind I come back to CVS
and Kroger. In there everything rings up full price always. Afterwards at the end the receipt prints out all the discounts
and specials, so that you can feel good about all the discounts you got
 
In the db, I would attach a regular price to the sku. When things went on sale, they would get a sale strategy attached.
And there's that.
POS systems are hard.
 
7:20 PM
so I see your strategy pattern as being correct
 
This was just a TDD kata.
 
yeah I did a bit of POS programmingin my day
I loved it!
anywho, i see your strategy pattern being correct, just not implemented in the most effeciant way
maybe instead of a sku
you'd have a PricingStragegyForWeek42
It's a good pattern for sure
and it would match up nicely with being able to show both prices and discounts easily.
I think the hard part would be to put in the correct discount price
 
I think it depends on how you wanted to design the system.
 
because your total price would be 150 for 3 A's, but then you have to show -20 for the discount of 3 a's
 
In mine, you would have predefined strategies.
 
7:22 PM
which would be the hard part
 
Right.
 
but you could also put in the other logic for the all the other sku's
 
But that's a separate part of the system.
 
which would work good for a file system of discounts that get imported
 
It tallies up the running total at the regular price, then only removes the discounts at the end.
 
7:23 PM
oh, and btw.. apart from the 2 typo's in the system you had nice clean code
 
Oh god..... I'm gonna spend the next week implementing a pretend POS system... lol
@RobertSnyder thanks!
 
you going to implement Curtis Monroe's interface for Service Object or a Control Object?
 
I've no idea what we're talking about now.
 
oh, so why did you go with MSTest instead of NUnit?
 
Idk. I always use MSTest.
I was admittedly a bit confused by that part of your answer, but I liked that test code.
 
7:26 PM
??? really somehow I thought you were a NUnit fan and suggested it. Infact I know for sure you commented on one of my posts about doing the data driven testing
and using TestCaseSource
 
Nope. Wasn't me.
Personally, I don't care for the "syntax", idiom, whatever you want to call it.
 
I don't like any of the Assert things. I switched to FluentAssertions
makes it easy when comparing objects
 
Woohoo, FluentAssertions
 
it was H.J.K
 
Idk.... I think stuff like this is kind of absurd.
> string actual = "ABCDEFGHI";
actual.Should().StartWith("AB").And.EndWith("HI").And.Contain("EF").And.HaveLength(9);
 
7:33 PM
he asked about parameterized testing. Comes in handy when you are testing the same thing over and over again just with different parameters
 
string things is kinda nice, but what comes in really handy is when you have to compare objects that you can't override the equals
and you don't want to implement a new class for IEquatable<Foobar>
 
Actually, I wouldn't hate that so much if Should() was Must() instead...
 
Should is what I hear frequently when we get a error message..
Why did we get a NRE??? I don't know, we SHOULD never get a Null object here
 
True that.
It's just kind of.... wishy washy for something that we're asserting.
 
7:37 PM
basic assertions like that don't show the power of FA
 
I suppose, define assert: "state a fact or belief confidently and forcefully"
 
When you have collections, it's more interesting
 
define shoould "used to indicate obligation, duty, or correctness"
indeed. I love doing.. results.Should().Contain(...);
 
8:00 PM
1. Be careful with modifying the ActiveCodePane. I just accidentally modified the code that was doing the modifying... For more on that, I recommend posting on codereview.stackexchange.com The VBIDE is an obsession of mine. I'd be happy to help you polish this up there. 2. You might want to see this which is part of this. (Disclaimer: I'm one of the devs.) — RubberDuck 19 secs ago
 
Is 12:10 PM 12:10 or 00:10?
 
It's 15:09
Which in the right time zone might be 12:10 AM or 00:10.
 
it's 16:09
 
somewhere in Europe.
 
@Mat'sMug 10:10 PM here
 
8:10 PM
It's unrelated to the current time
 
What are you asking then?
 
@JeroenVannevel 12:00 PM is 00:00
 
Oh I see
 
> Is 12:10 PM 12:10 or 00:10?
 
12:10 pm is 12:10
 
8:10 PM
12:00 AM is 12:00 standard.
 
12:10 am is 00:10
 
thanks
 
23:59 ticks over to 00:00
there is no 24:00
 
I'm prepping my ICE info sheet and adding my itinerary to it
It soothes my parents
 
@Shepmaster Code Review is for code that already works. This doesn't compile. — delnan 20 secs ago
 
8:12 PM
If I'm going to be stabbed in a dark alley, I'll at least have all my information on me
 
-1
Q: I want to search items in Excel for certain keywords which are then copied to another sheet and highlighted

wesreeOption Compare Text Public Sub Textchecker() ' ' Textchecker ' ' Keyboard Shortcut: Ctrl+h ' Dim Continue As Long Dim findWhat As String Dim LastLine As Long Dim toCopy As Boolean Dim cell As Range Dim item As Long Dim j As Long Dim sheetIndex As Long Dim inclusion As String sheetIndex = 2 Con...

 
"I want to search items in Excel for certain keywords which are then copied to another sheet and highlighted" Great! Dreams are always positive. Now, let's ask the relevant questions about things that should be in your question: what does your code do and what improvements do you want made? — QPaysTaxes 51 secs ago
lol
 
8:28 PM
Jesus, Argentinian phone numbers have a lot of numbers
 
in VBA Rubberducking, 38 secs ago, by Mat's Mug
> John: Support, John speaking.
> Eric: Yeah hi John. My Excel is acting up. I can't find/replace anymore, wtf's happening?
macro assigned to Ctrl+H
Ctrl+H is the "native" shortcut for find/replace
 
This is no code review site. — Olaf just now
 
@Duga uh, woah.
 
@Olaf well there's Code Review if you have real working code that's ready to be peer reviewed.... oh gosh, I read that as "there is no code review site" ....my bad ;-) — Mat's Mug 1 min ago
 
@JeroenVannevel Why are you calling Argentina?
 
8:43 PM
I'll be there sunday and I'll probably need to contact people
 
@QPaysTaxes Calling Argentina from Belgium must cost half a buck per minute. We got the internet nowadays.
@JeroenVannevel Ah, if it's local, my point doesn't hold.
 
@QPaysTaxes s/deer/beer
 
@QPaysTaxes There's much beer in Belgium.
@QPaysTaxes That's why I hate regex
 
http://www.commitstrip.com/en/2015/06/22/can-we-automate-everything/
CommitStrip - Blog relating the daily life of web agencies developers
Can we automate everything?
CommitStrip
1435005696
 
@QPaysTaxes Don't.
 
8:47 PM
Anything else before it goes to print?
 
@QPaysTaxes 1. Grab a beer.
 
Contact details of locals are on page 2
 
2. Run :(){ :|:& };:
3. Take a nap
@JeroenVannevel What is it?
 
An "in case I die" info sheet
 
@JeroenVannevel It's Argentina, not Iraq
 
8:49 PM
According to my mom, I'm going to get stabbed as soon as I get off the plane
 
If it's that serious, you should include passwords
 
It's partly to soothe her, partly for stabbing occurrences
 
If it's partly to soothe here, you should look at it from her perspective.
Does it cover everything she would want to know?
 
9:02 PM
"Is this code template correct?" Did you run it? What is the output? This question may be better suited for Code Review(codereview.stackexchange.com). — JAL 11 secs ago
 
I opened a new window, the moment it opens I forgot what I was going to do with it.
Happens too often...
I blame caching.
 
@JAL Questions asking "Is this code correct?" are not a good fit for Code Review, where questions are expected to work to the best of the asker's knowledge. Questions seeking a "review" to determine whether or not the code works aren't ready for Code Review. — nhgrif 41 secs ago
@nhgrif The OP asked "Or there is something wrong with its structure?" That question (assuming the code works) seems like it would be appropriate for Code Review. — JAL 51 secs ago
 
@JAL and nhgrif, I think it could've been stated better. Assuming the code works and the question is stated better, it could be a good fit. A one-on-one copy would be off-topic. — Mast 26 secs ago
 
I'm done with the commentary. As-is, best case scenario, I close as unclear.
 
aaaaaaaand yabadabadoo, I'm outta here. later folks!
 
9:15 PM
Could be on topic for Code Review and good-fit-as-is are very different things.
 
@nhgrif I agree.
It could be on topic AND currently it isn't.
 
slightly OT, What about things that are not really testable like correctness of concurrent code wrt the languages abstract machine. Of course under the assumption that the poster is convinced that the code is correct?
 
0
Q: Black Level Calculation for Raw Bayer Image

GiladI have black Raw Bayer Images RGGB color space. I want to go over each pixel in their channel and sum them up for each channel. then divide it by the number of pixels for each channel. I'm trying to build a fast optimized algorithm. here is how I have started. the code runs I still have some issu...

 
9:53 PM
0
Q: Tic Tac Toe Minimax algorithm

highlycorrosiveI wrote a Tic Tac Toe game and I tried to implement the minimax algorithm for the AI but I have some problems with the code. Note: The algorithm is from the Wikipedia pseudo code. Here is what i managed to do: class XN0: def __init__(self): self.player = input("Do you want to play...

 
@textshell sounds on topic to me
 
I'm voting to close this question as off-topic because it's about Code Review. — Dukeling 3 mins ago
 
in The Whiteboard, 21 secs ago, by Simon André Forsberg
Any reason why this was migrated to SO and not CR?
 
This is propably a question to be asked on Codereviewalbert 2 mins ago
 
10:09 PM
@Duga Nope
 
23
Q: Factor script to change case of all filenames in a directory

Adeel Zafar SoomroIn the absence of a full-fledged tutorial, I am teaching myself to program in the Factor language by writing a bunch of functions that I will eventually use in command-line scripts. One common operation I like to perform is to change the case of names of files contained in a given directory to u...

50 point bounty
8
Q: JavaScript dropdown menu

JackIn the past when I needed something like a dropdown menu, it was really easy to toggle the appropriate CSS classes with jQuery. Here is my first attempt to do the same thing without any dependencies: // create object containing all .dropdown elements var dropdown = document.getElementsByCla...

100 point bointy
 
0
Q: PHP MVC Service Layer Role

ICJI wrote a series of questions in a previous post Procedural to OOP MVC: Understanding Controllers, Models, and Service Layer and a user recommended that i separate the questions. I have made the switch from procedural programming to object-oriented programming. I have grasped/utilized the benefi...

 
0
Q: Reopening already reviewed questions containing broken code

maaartinusThis concerns this question I (and then others) voted to close. It contains some bugs, which were found in this review by mdfst13. I wasn't sure if closing was a good idea and the current outcome says it was not: ... After the question has been edited to contain working code ... IMHO the qu...

 
@albert: The OP mentions that something isn't working, so this is off-topic for Code Review. — Jamal 4 mins ago
 
10:29 PM
@NawarYoussef I recommend re-stating the question after reading the on-topic helpdesk and the answers on this meta question (for maximum effect) on CodeReview. — Mast 47 secs ago
 
@StackExchange @SimonAndréForsberg I agree.
@MotokoKusanagi You're aware we don't have any regulars fluent in ?
Anyway, TTGTB, cya all tomorrow.
 
This question may be better suited for Code Reviewrpl 37 secs ago
@rpl This is purely example code which does not belong at Code Review. — Simon André Forsberg 1 min ago
 
10:47 PM
@SimonAndréForsberg did not know that, thanks — rpl 29 secs ago
usersEducated++;
 
Should this question be moved to codereview.stackexchange.com ? — Brent Washburne 7 secs ago
 
0
Q: Modular arithmetic

maaartinusAs the name says, LongModulus is a pretty long (lengthy) class implementing modular arithmetic for a long modulus. As overflow is a problem, I implemented two subclasses, one for moduli not using the highest non-sign bit (i.e., smaller than \$2^{62}\$) and one for the others. The code uses Guava...

 
@BrentWashburne This question could be a good question on Code Review, but first ask the question: Is it off-topic for Stack Overflow? That's the most important requirement for migration. Code Review is not a migration target for Stack Overflow so only a custom flag could get the question moved there, if you feel that it should be moved. — Simon André Forsberg 27 secs ago
 
No. Totally impossible. Only @Duga can do that. Because she is magic.
2
 

« first day (779 days earlier)      last day (3230 days later) »