« first day (1264 days earlier)      last day (2745 days later) » 
00:00 - 19:0019:00 - 00:00

7:07 PM
> This is implimentation of Datepicker by our outsource colleagues.
Any thoughts on this?^
 
Kaz
@Phrancis As currently worded, Off-Topic.
To make it On-Topic, it would have to be "I've made this code as good as I think I can, what else can I do to improve it?"
 
[...] by our outsource colleagues - Is this code that you own or otherwise maintain? Picking on someone else's code isn't exactly professional, and off-topic on this site. — Mat's Mug ♦ 24 secs ago
if outsource colleagues wrote it and OP is now "stuck with it" and needs to maintain and fix it, then I don't see a problem.
if it's to build a case against that provider, we have a problem.
 
> Please help me find other problems. I believe that this code is not ready for production, and it can lead to unpredictable behavior. Am I biased?
I don't like the premise of the question
 
vote as appropriate
 
Already did ;)
 
Kaz
7:12 PM
To add to @Mat'sMug point: If you want to make this question On-Topic, you need to be able to (honestly) say: "I have this code. I have tried to make it as good as I can. What else can I do to improve it?". — Kaz 1 min ago
 
mug needs caffeine. bbl.
 
Kaz
OP needs to "make" it their own code before they put it on CR. How they use the feedback they then receive, and how it might reflect on their adjustments and the original code are their concern.
 
@Mat'sMug bring me some, too. :P
 
0
Q: get and set cookie

Rayn DI use this code which is working, and before I use it in prod I would like to get your feedback if there is better way to write this code(especially the for loop and the function global variables...) function getCookie() { var cookieName = "cookie-send="; var ca = document.cookie.split(...

0
Q: plz tell me a code of this programm

ramshaCreate a class called shape. Use this class to store two int type values that could be used to compute the area of figures i-e of a rectangle and triangle. Define members function as Setvalues…used to set the values of variables Getvalues…used to get the values of variables area_r…used to dete...

 
@Mat'sMug This sounds like "inherited code" too, I've run into this in my workplace (though it was by someone no longer on the team, rather than 'outsourced' development)
@CaptainObvious Wow, really? people just asking for code...
 
7:20 PM
Not happening.
 
@Mat'sMug the coffee you're going to share with me, or the post? :P
(I just saw it was flung into the Void)
 
Mugged, it seems
 
@Mat'sMug I must maintain this code in the future. For that reason I seeking for review of code. I need an independent view. — 4ell 31 secs ago
@ThomasWard yup
 
7:50 PM
From this point of view you hardly find a question on Stack Overflow which doesn't fit to "opinion-based" category :) We are not Code Review for perform suboptimizations, so it is sufficient to choose only generic approach. — Tsyvarev 23 secs ago
 
To everyone closing the question: code being maintained by the OP is on-topic. Take a look at the help center. — Mast 44 secs ago
You must have written it, own it or maintain it.
So what's up with this comment?
 
And have permission to post it, if it's workplace-proprietary and they own the rights rather than you personally. (we don't like copyright takedowns)
 
Y no onebox...
@ThomasWard Of-course.
 
@Mast because comment is roomba'd
 
it's why i have one set of code I haven't posted for code review - not permitted :P
 
7:53 PM
@ThomasWard Got loads of those.
The list isn't growing though, I no longer write software for my job.
 
@Phrancis I agree with you.
 
heh
@Mast my job isn't development, but this was dropped in my lap so meh
 
@DanLyons Halo is one letter short of HAL
 
Kaz
@Mast That they also need to understand it. And by definition, once they understand it, they can fix any problems they're aware of. And then once they've fixed any problems they can think of, it becomes a good On-Topic CR question.
 
0
Q: Shell Script Merge Error

AbhiI am working on automerge of two branches in SVN using shell scripting. But after doing checkout and then doing cd to working copy and running this merge command I am getting below error: Checked out revision 117230. wait cd R1abc svn update At revision 117230. + svn merge --dry-run svn://scm....

 
7:58 PM
still, there's a difference between a "poor CR question" and an "off-topic CR question"
@CaptainObvious here, that is an off-topic CR question
 
someone else want to take a look at this answer and tell me if I am incorrect?
a single meeting will have a beginning and an end, by definition the beginning will be before the end. the goal of the code is to find meetings that overlap each other. a single meeting will not overlap itself. — Malachi 5 mins ago
 
@Kaz While I somewhat agree with this sentiment, "once they've fixed any problems they can think of", there's plenty of questions not adhering to that.
 
it's nice to have and it makes a great CR post. but it's not what makes an on-topic question
 
Kaz
@Mast Sure, but "somebody else's code that I can see problems with and want people to point out even more problems with", at some point, crossed over to the other side of the gray zone. At least for me.
 
8:07 PM
eh, that's why it's community votes driving the show
sometimes I'm happy my votes are binding :)
 
@Kaz if it were phrased something like "how can I make this code better?" I would say it is on topic, but the OP uses the word "problem" so I agree
 
@Malachi he's got a point:
@Malachi Nothing in the existing code would prevent a meeting with with and start time after the end time. For the second time that would break the algorithm. Not going to discuss this with you further. Good day. — Paparazzi 7 mins ago
 
if it has an end datetime before a beginning datetime, then it isn't really a meeting is it?
 
the point is that there's nothing to prevent that from happening, regardless of how much sense it would make
 
8:10 PM
that should break the application and cause an exception, shouldn't it? I would assume that this is part of a larger application that already has meetings in it
but OP gives the Meeting class
 
public class Meeting
{
    public DateTime Start { get; private set; }
    public DateTime End { get; private set; }

    public Meeting(DateTime start, DateTime end)
    {
        this.Start = start;
        this.End = end;
    }
}
yes, and nothing prevents making an instance with End < Start
 
This question is probably more suited to codereview.se. — ArchbishopOfBanterbury 1 min ago
 
0
Q: Check repository for a nested entity

JamesI have a Product entity and a ProductCategory entity. Given the Product entity, my application checks the database via a repository to see if the ProductCategory already exists. If the category is not found in the database, then the application should persist it. Currently, I have this code in t...

0
Q: injectOptions jQuery plugin

ConduitOver the past year I've found myself moving from back-end development to something more akin to full-stack development. I've created the following jQuery plugin as a test of my hopefully-not-so-fledgling JavaScript/jQuery skills. The plugin is used to inject <option> tags into the element(s) spec...

 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Find items in a table that match a set of conditions in another table
 
possible answer invalidation by Kris Swat on question by Kris Swat: codereview.stackexchange.com/posts/144587/revisions
@AdelKhatem , this is a codereview question :/ — amanuel2 48 secs ago
 
8:24 PM
hi @Atomic_alarm!
 
CodeReview: link. — wOxxOm just now
 
in C# if I want to throw an exception from a property set, would you look down on me with disdain @Mat'sMug?
 
from a setter or an indexer, no. from a getter, ....wear a helmet ;-)
 
-1
Q: Java programming

user120695this is an assignment for my cs class and i have no idea how to start it. any help is greatly appreciated. Data File for Grades Write a program that processes the file Grades.dat and produces a report with the following headings: Grades for CIS1100 Last Name First Name ID Aver...

 
@Mat'sMug yeah from a getter wouldn't make much sense, would it?
 
8:29 PM
@Malachi tell that to Microsoft's VBIDE API
but yeah, see MSDN / best practices regarding throwing exceptions from properties
 
8:40 PM
I posted a review....tell me what you think?
oh hey it is almost 5
traffic is going to suck
 
    private set
    {
        End = value < Start ? Start.AddMinutes(15) : value
    }
IMO that is a very bad idea
where's the 15 coming from?
just throw instead
also... wouldn't compile
 
I mentioned that I didn't like that. and I think I need private properties in order to do this
because the shortcut actually creates the private properties, right?
I think I still need to have a default value for the properties as well...
I have edited it
 
9:00 PM
if (start > end)
{
    throw new ArgumentException("Cannot create a meeting that ends before it starts.");
}
^^ IMO that's the only sensible thing to do. in the constructor.
that 15-minute arbitrary thing is just adding failure points and unspecified behavior
and your return x.End > y.Start; is wrong
that only tells you if meeting A ends after meeting B started
if meeting A starts after B ended, your condition is true but the meetings don't overlap
 
@Mat'sMug that should be covered by the OrderBy(m.Start) shouldn't it?
I am running some things in LinqPad but I am getting something weird, let me put the other condition back in
still getting a weird match
 
IMO that kind of condition shouldn't be assuming anything - I'd go with return x.Start >= y.Start && x.End <= y.End; or something like that
(busy ATM, didn't think that one through, don't take it for cash)
 
that actually works
 
lol, oh well :)
 
not perfect though
I tried to add new Meeting(DateTime.Parse("1/1/2015 23:20", format), DateTime.Parse("1/2/2015 00:00", format)) and it didn't register that it overlapped new Meeting(DateTime.Parse("1/1/2015 23:20", format), DateTime.Parse("1/1/2015 23:50", format)),
 
9:26 PM
0
Q: Encrypting and decrypting strings using Caesar cipher

Mahmud Muhammad NaguibI was inspired by a solution in Think Python: How to Think Like a Computer Scientist. I structured mine according to it, and used the technique used in rotate_letter. It's here if you're interested. How can I make this better in all aspects (documentation, algorithm, variable names, and etc.)? I...

 
so it doesn't work then
 
they are backwards because of the way that the Overlappings Method is written....I just found it, let me make a few tweaks
	public static IEnumerable<Meeting[]> Overlappings(this IEnumerable<Meeting> meetings)
	{
	    var first = (Meeting)null;
	    foreach (var meeting in meetings.OrderBy(m => m.Start))
	    {
	        if (first != null && meeting.OverlapsWith(first))
	        {
	            yield return new [] { first, meeting };
	        }
	        first = meeting;
	    }
	}

	public static bool OverlapsWith(this Meeting second, Meeting first)
	{
		first.End.Dump();
		second.Start.Dump();
		return first.End > second.Start;
the current iteration is the second meeting, not the first meeting, we were looking at it backwards and not even knowing it.
 
actually, why can't there be a bool Overlaps(Meeting other) instance method on the Meeting type itself?
I'd remove the OverlapsWith extension method and put it in Meeting - there's no need to extend a type you already own
 
it should be in the meeting class
it doesn't feel right for some reason.....
 
9:43 PM
why wouldn't it?
 
This user could use an account merge.
 
requested 2 hours ago ;-)
TTQW
 
:-)
 
okay, now I have the right code
for when you get home
 
10:04 PM
0
Q: Dictionary Parser Class

Allan MI'm working on a parser library for substituting strings in dictionaries, with things like globals etc. Wanting to get opinions on the direction I'm taking and where I can improve the script. This currently works class DictParser(object): def __init__(self, dictionary): self.working_...

0
Q: Is this function ready for production?

SoEzPz We have a function declaration as stated below... function itemIncludesTotal(item){ var includeItem = false; if (item.lineItem.hasOwnProperty("details") && item.lineItem.details.hasOwnProperty("total") && item.lineItem.details["total"] && !item.lineItemRestriction ...

 
@CaptainObvious Can anyone tell if this is actually real or just hypothetical? Sometimes the OP doesn't best know how to determine that.
 
0
Q: Plotting the Koch Snowflake

VermillionThe Koch snowflake is a well known fractal. Beginning with an equilateral triangle, a smaller equilateral triangle is placed halfway along each edge of the shape. This process then repeats on each edge of the new shape. Here is my attempt to plot this in MATLAB. clc, clearvars, close all; leng...

0
Q: Scala Play ReactiveMongo web app

user120712This is my first project that I've written using Scala and the Play framework. It's a simple application that allows the user to store pictures and see them (no edit/delete functionality, just to keep the code review simple). I have included a couple of questions as TODOs in the source code (onl...

 
10:23 PM
it's a good question for codereview.stackexchange.com, though i didn't downvote — tinySandy 14 secs ago
 
10:36 PM
@Jamal Doesn't look reviewable to me.
@Duga Possibly incoming.
 
Probably not, but I don't quite have enough expertise to provide any specific reasons, so I sent it to chat.
 
Broken. I don't know who blindly upvoted it, but it's broken.
Don't upvote broken code.
Not if it's failing half the tests anyway.
 
-1
Q: What is wrong with my Python code and tests?

VaderI've been asked to implement the following task before an interview: Give the following specification: "Account" is a simple command line accounting tool that takes a text file as input. The input file consists of one or more lines, each of which is in the following format: 1) mm-dd-yyyy ...

 
Please update your answer with what you expect it to do, what it's actually doing and any errors you're getting. This is a QA site, not a code review forum so you have to provide a clear question. — Soviut 57 secs ago
 
10:55 PM
0
Q: How to simplify repeated build job syntax?

kenorbI've the following Groovy script: node { stage('Testing') { build job: 'Test', parameters: [string(name: 'Name', value: 'Foo'), string(name: 'Param1', value: Param1), string(name: 'Param2', value: Param2), string(name: 'Param3', value: Param3), string(name: 'Param4', value: Param4), ...

0
Q: Monte Carlo PI code error

jer65I wrote a sample code in python for the calculation of PI with Monte Carlo simulation. But the output of the result is never 3.14. It is just some random fraction of 3. from __future__ import print_function import random import math class Point(): def __int__(self): self....

 
@CaptainObvious This is probably hypothetical as well.
 
Docker is pretty cool
 
11:33 PM
0
Q: Find indices of first pair of numbers that sums to zero

Matthew FarabaughHere is the task from a beginner's course: "Write a method that takes an array of numbers. If a pair of numbers in the array sums to zero, return the positions of those two numbers. If no pair of numbers sums to zero, return nil." Below is the model solution. It does not use idiomatic Ruby, ...

 
00:00 - 19:0019:00 - 00:00

« first day (1264 days earlier)      last day (2745 days later) »