« first day (710 days earlier)      last day (3605 days later) » 
00:00 - 17:0017:00 - 00:00

17:00
@Barmar it's certainly not a problem for this question to be here. I just wanted to make sure the OP was aware of all valid options. I would personally have asked this on Code Review. — ryanyuyu 1 min ago
@JeroenVannevel "I don't wish to answer" is a perfectly acceptable answer. I feel sure they prefer an honest answer than you just fumbling trying to make up something.
Meh, I answered all questions
Let's just hope the HR people are neonazis
If it wasn't for my brown hair and greenbrown eyes, I could totally be Aryan
0
Q: Finding minimum difference between consecutive numbers

Atul Shanbhag You have a number of stones with known weights w1, …, wn. Write a program that will rearrange the stones into two piles such that weight difference between the piles is minimal. Input contains the number of stones n (1 ≤ n ≤ 20) and weights of the stones w1, …, wn (integers, 1 ≤ wi ...

It seems to me that the presented code does not solve the given task at all. Or am I completely wrong?
0
Q: When to hard code a string instead of using a constant?

vikrantRecently during a peer review cycle, there was a discussion on which reviewer and myself was not agreeing. I need your views on the same, here are the details.. I was making some http request in my code and while building the url I have to use character like ":" & "/". I have defined constants f...

17:17
> Your program should output a number representing the minimal possible weight difference between stone piles.
@MartinR I think you are right.
17:34
Hi there, first time in this chat room, want to know thoughts on my questions
question with title " When to hard code a string instead of using a constant?"
@vikrant Hey there! Welcome to the 2nd Monitor!
Why don't you just create a constant for "http://"?
Then you wouldn't need to have as many constants.
thanks... @RubberDuck
@Hos
0
Q: Carpet Calculator Program Final Edit

MaryI asked a previous question of this same program. I would like more opinions before I submit this assignment since I edited the program after receiving feedback last time. public class Room_Dimension { //Data fields private double length; private double width; //Constructor ...

@Hosch250 slash may appear after that as well
17:38
OK.
So, you only have sections of a URL and not a full URL?
yeah
"SLASH" will never have a value other than "/", otherwise it won't be a slash anymore
2
Hmm. I don't know.
so there's no point in making it a separate variable
Aside from pentadupling your amount of characters, of course
Kind of like a magic constant, though.
But, I probably wouldn't in this case.
17:40
It's not a magic value
Hey there... bit slow.
so you prefer hard coding for such values
Everybody knows what a slash indicates in a URI
Unless you call it a SEPARATOR, but I don't see the benefit in this case.
On the other hand, as a path separator, it's not.
17:40
They have it all backwards
fixed that ^^^^
I saw that. =)
OPPRESSION
FREEDOM OF SPEECH
Me too.
I'M BEING CENSORED
17:41
@vikrant - I would support it as a constant if it was called something other than what it is.
@vikrant I'm interested in your point of view. What do you feel the benefit is?
well lets say if you are hardcoding "/" at 100 places in a file, and at one place you missed and make it \
You would most likely get an exception.
now compiler will not catch it
That will be instantly obvious through the thrown exception
17:42
That's a what-if that can be too broad though.
"\" wouldn't compile due to a missing quotation mark.
there's nothting stopping a person from using `\` even if you have the SLASH constant.
yeah I understand that... its a corner case
Hey there @GarethRees! Nice to actually meet ya.
@RubberDuck Hello
17:42
Hi.
I really enjoy reading your answers. So, yeah. Thanks for all of them.
3
@RubberDuck I enjoyed writing them, especially the hard ones
4
But my next argument is that if there are multiple people using it... then wont it will be tough to relying on common sense to handle such scenario
Unfortunately, we get the most rep for the easy ones.
I mean.. why not use 3.14 instead of defining a const int PI
17:44
@Hosch250 True: that's why it has to be its own reward
If you ask 20 people to write down an url, how many of them will write it as http:\\blaat.com?
HTTP is defined as Http://
most likely none
but no guarantee as well, right?
You can't fix a lack of knowledge like this by making your code so obsolete, people have trouble getting things wrong
@rolfl Did you mean top 18?
17:46
I did.
There's no guarantee for anything. What if they only use one SLASH instead of two?
You can't prevent programmer errors like this
For the record, I like the idea of a constant for Http:// and one for a PATHSEPARATOR
My biggest issue with SLASH is it defines what it is not what it does.
resolving the bug will take you 10 seconds on a bad day. Making things convoluted like this will have a much bigger impact on readability
https all the things
Const HUNDRED As Integer = 100
17:47
well my point is I can not cover 100% , but should we have something like this
tld + "/" + sd1 + "/" + sd3
or
tld +SLASH + sd1 + SLASH
Does Java have something similar to Path.Combine()?
Path.Combine(tld, sd1,sd3)
9
Q: How to "merge" two URIs in Java?

yegor256This is an absolute URI of the server: URI base = new URI("http://localhost/root?a=1"); This is a relative URI: URI rel = new URI("/child?b=5"); Now I'm trying to apply relative one to the absolute and receive: URI combined = base + rel; // somehow assert combined.equals(new URI("http://lo...

looks like you can chain URL class constructors
@RubberDuck With the Path class, yes
But that's paths on the hard-disk, not sure if you mean those?
Path p = new Path("a/b");
p = p.Resolve("c");
// a/b/c
Didn't test it though
You can just chain Resolves I think
somehow I dont like
tld + "/" + sd1 + "/" + sd3
17:50
I don't like either of your styles.
will have to explore PAth class if it fits in my req
:-)
@JeroenVannevel Java's Path is similar
@skiwi That is Java's Path
 String.join("/", tld, sd1, sd3);
@JeroenVannevel I saw Resolve in capital, so I assumed C#
17:51
@skiwi Sorry, habit of using SUPERIOR NAMING CONVENTIONS
@skiwi That's just because Jeroen typed it.
LIKE SCREAM CASE
SCREAM CASE IS AN OBVIOUSLY SUPERIOR NAMING CONVENTION
join method looks great... I think I should use this
Speaking of superior -- I'm heading out. My status as biggest playboy of Belgium requires duties from me
17:53
Don't forget your stockpile
The cream rises to the top @RubberDuck, not the SCREAM ...
Monking!
@rolfl Wups, good thing you reminded me. My wallet was empty
@vikrant Since: 1.8 <--- FYI
It's also in apache commons if you can't update to 1.8 -- I think
@vikrant I really think that having a PathSeparator constant would make a ton of sense if you're using String.join for building your URLs.
Or, maybe UrlPathSeparator
17:56
@JeroenVannevel They did not tell you to not put those in a wallet?
But call it something other than "SLASH".
@Mat'sMug Why..?
You'll need a bigger wallet?
You might be half of Belgium's father without knowing...
Yeah, I'm restricted to just two or it'll get too big
But that's typically enough for an evening
@Mat'sMug I'm 80% sure that isn't the case
17:57
@rolfl yeah 1.8
In which case, you should also be using the relative URL magic that can happen.
@JeroenVannevel Only 80%?
what is URL magic?
Time for you to reform, I guess, or you might get torn to pieces by angry girlfriends.
17:59
URI abc = new URL(tld).resolve(sd1).resolve(sd3);
^^^ or something)
0
Q: Java A* Algorithm Implementation Performance

CraigI've coded a working implementation of the A* Algorithm however it's not meeting my performance expectations - it explores way too many nodes and takes a lot longer to find a route than I expect. Here is my code: private Vertex dijkstra(Vertex startLocation, Vertex endLocation, int routetype) ...

oh looks interesting, I will read about it for sure
@Hosch250 That would be a bad day
sayonara!
thanks for pointers
Hmm, the URI resolve will still need a path.
18:04
@Barmar it is on-topic as a specific best practice (for extracting functions) at code review. — ryanyuyu 36 secs ago
settling on string join with a better name (not SLASH) for now.
18:17
0
Q: Is a NxN Sudoku valid?

CatgocatGiven a multi-dimensional array representing a board in Sudoku, the function should be able to return whether the sudoku is valid or not. Examples: var goodSudoku = new Sudoku([ [7,8,4, 1,5,9, 3,2,6], [5,3,9, 6,7,2, 8,4,1], [6,1,2, 4,3,8, 7,5,9], [9,2,8, 7,1,5, 4,6,3], [3,5,7, 8,4,6,...

Nvm, misread
18:46
His Answer isn't even a Code Review, it's a "Here's the value that crashes your code and everyone else's code, now go fix it" and he gets more votes than all the rest of the answers? I think we should ding him if he isn't going to review the code!
@Lyle'sMug it's because everyone knows who he is. It's certainly not good for his already over sized ego...
We are talking about EL, right?
@RubberDuck yes
I think we should ding him if he isn't going to play by the rules. it's not a code review, it should be downvoted
it's not the first time....
It is though. He found the bug.
everyone here knows me and they still give me downvotes when I don't play by the rules.
It's not a good answer, but it's not a bad one either.
The previous one was a bad answer, and was dealt with.
18:50
@RubberDuck all he did was find the bug, he didn't offer a solution, he just said, "hey code better"
1 min ago, by RubberDuck
It's not a good answer, but it's not a bad one either.
it is a bad answer, it is a good comment. "Hey look a bug in your code here ... "
Deep Breaths Lyle, Deep Breaths.
If it makes you feel better, I don't like him either.
I flagged a comment from a Fanboy earlier....
@Lyle'sMug And that's fine for a code review
18:55
you are really right about the answer though, otherwise I would have flagged it. I know that at the least 2 out of 3 moderators would put it the same way that you did. the 3rd probably wouldn't touch the problem or would agree with the others I haven't decided....lol
@rolfl don't we want answers that say "here's how you code better around int.Min and ..."
I gotta have at least one rant per day right? not always on CodeReview chat but one rant per day.
FWIW, I interpreted his answer and comments quite differently: comments as pointers for getting better
We want answers that help the asker to improve the code.
by pointing out unanticipated failure modes, and other perspectives that are not addressed, it is a positive contribution
how positive is up to your voting click to decide.
He has +13/-1.
Mine has +14/-0 + CM.
So, it isn't more votes than "all the other answers"
Yeah, Lyle likes to exaggerate a bit ;-)
So, in other news. Pivots in SQL really suck.
19:02
Well, for a start, they are mostly SQL Server only
rather, they are even more sucky in other RDBMS's
This is seriously far too manual and repetitive. Why we're not formatting this on the UI side is beyond me.
Oh.... right. They want this report output to Excel and the end users don't understand pivot tables..
See @Malachi? You're not the only one who rants at least once a day.
@RubberDuck you know that didn't ping me right?
Oh yeah...
I forgot.
How long are you stuck with the new name again? Another couple of weeks?
Code Review might like this question a bit more than SO. That said, things like ToString strike me as inefficient, also, the where variable is not clear what its supposed to do, but I'd bet that the firstiteration test could be removed with a few logic changes. — paqogomez 41 secs ago
@Hosch250 wasn't me......
19:08
Me neither.
@RubberDuck I might leave it....I haven't decided yet
@Hosch250 I was joking, it was me...
I am just irked that I didn't get more upvotes...
0
Q: Most Efficient way to strip time information in a DateTime object

AhemIs there any better way to strip the time information in a DateTime Object than creating a new DateTime Object? For example, if I just want today's date and not time, is the only way is to do the following? DateTime now = DateTime.Now; DateTime Today = new DateTime(now.Year, now.Month, now.Day);

It went HNQ.
I'm surprised you got so few, while I got so many.
Probably because I had the checkmark.
19:18
If anyone is bored, google has a fun game celebrating the pony express.
2
@RubberDuck Where?
@Hosch250 ummmmmm google.com
Found it.
I was picking up mail packages, and got stuck on a cactus!
@Hosch250 you answered first, Quickest Gun in CR
19:23
@Lyle'sMug By a few seconds.
yeah it was close. I started writing my post and then saw your answer pop up.
0
Q: Python text game

Xis88I've written a simple text game in Python to show you. I would be glad if you would spare a quick look and point out the style errors so I wouldn't pick up bad habits. """ A text game "Bob, the Cookie Cooker". """ import random COINS_FOR_WIN = 1000000 FINE_COOKIE_PRICE = 30 POOR...

0
Q: Palidrome checker in haskell

CaridorcI decided to avoid the trivial isPalindrome lst = lst == reverse lst and tried writing a method with pattern matching and recursion. allButFirstAndLast :: [a] -> [a] allButFirstAndLast = tail . init isPalidrome :: [a] -> Bool isPalidrome [] = True isPalindrome [a] = True isPalindrome [a,b] = a ...

I have over 700GB of recordings of videogames (via NVidia ShadowPlay) and I can't get myself to delete anything of it :| Nor will I ever watch it again.
It wasn't a problem until I ran out of disk space
19:43
So, do you have a YouTube channel or something?
I do have one... but it's not like I activately post montages on it
That was an idea of mine long ago, but never really bothered to do it
What does it take now-a-days to get a job in computer programming?
would an advanced diploma and a bachelor's in software development help?
50 secs ago, by CPlusPlusOrDie
What does it take now-a-days to get a job in computer programming?
That's a very open quesiton, but, from the cynical to the practical:
1. an interview
2. a network ;-)
thanks for the obvious
Yeah, but the second one is serious.
networking is often key... getting to know people.
19:51
@skiwi I never really understood watching other people play videogames.
i bet networking is all you really need, and that's pathetic
Wouldn't that be more appropriate for Code Review? — tux3 43 secs ago
I'm voting to close this question as off-topic because the user doesn't have a specific problem, they are asking for help with working code. This question would be more appropriate on codereview.stackexchange.comdurron597 13 secs ago
@RubberDuck It's interesting when they are better than you, but I don't often do it myself
20:07
My kid would rather sit and watch other people play minecraft all day than actually play it and I just don't get it.
Doing it all day is not something I'd do
Not saying you would. Just pondering on the appeal.
I can't find the appeal for that, playing it yourself should be more fun
But hey, some people probably think we're crazy for willingly wanting to program all day!
6
@RubberDuck When I play minecraft, I'm not good at building, be creative or anything else. All I'm good at is collecting resources... Watching someone make a complex building with automatic door, secret traps or anything else is fun. At least, I can try do reproduce it later.
@skiwi true
@Marc-Andre I wonder how I could convince her to at least try that stuff though.
20:16
@skiwi Have a star.
@RubberDuck Tell her to write her own Minecraft.
0
Q: C# Comparing values in 2 DataTables

Robin Van CleefI'm processing 2 DataTables: SSFE: Contains the values I want to find FFE: Is larger, smaller or equally large as SSFE, but does not necessarily contain every value of SSFE The values I need to match between these tables are integers, both tables are sorted from small to large. My idea was to...

@RubberDuck when my gf's 5yo plays MineCraft, he narrates as if he is making a YouTube video.
@CPlusPlusOrDie Is that Bill Gates?
20:32
0
Q: How to better log people in? [JAVA]

Charles StaalSo, I'm creating a chatroom with no 3rd party libraries and currently I'm logging people in like this [code] public void run() { try { this.running = true; ServerSocket ss = new ServerSocket(1000); while (this.running) { this.threadPool.execute(new InfoGra...

@CaptainObvious Oooooooo a [JAVA] question!
3
20:46
0
Q: Reduce Assignment Branch Condition Size

Antarr ByrdI have a method in my rails project that initializes a new user by copying some properties of another. The method should also retain entered parameters if saving the new user is rejected. Rubocop complains that Assignment Branch Condition Size for this method is 42.02/15. How can I improve this? ...

i think this is more proper address for your question: codereview.stackexchange.commotto 1 min ago
@Hosch250 no, you have a star
21:04
Hmm, so the "In Code Review" state of the Workflow automatically assigns the user to the ticket when they transition into it, so they're already temporarily assigned to the ticket and tracked there. Maybe the transition could increment a counter of the custom field with the current user? So I could track how many Code Reviews that user has successfully conducted? — Andrew Chen 1 min ago
21:30
Seems like CodeReview might be a better forum for this sort of question? BTW, not my vote to close. — Michael Dorgan 20 secs ago
@MichaelDorgan Thanks for suggesting Code Review; however, this would be off-topic on CR since the code returns incorrect results. Once the code works as intended, it could be a good fit there. — Phrancis 1 min ago
21:52
@sᴉɔuɐɹɥԀ remind him that Stack Exchange is not a network of forums.
I'm voting to close this question as off-topic because it is asking for a Code Review. — cimmanon 30 secs ago
@cimmanon This is not necessarily off-topic for Stack Overflow, but it would fare better on Code Review, indeed, since the code works fine. — Phrancis 1 min ago
22:12
(I've rolled back your question removal - we tend not to do that here. Code Review may be a better place for this, but I don't know what the rules are there. Good luck). — halfer 1 min ago
@RubberDuck Sounds like a question for Parenting.SE
22:33
@rolfl can I bug you once more about SEDE? If I want to check which questions are marked as duplicate, how can I possibly do that, what tables do I need? votes? posthistory?
Sure.
Ahh, interesting one... let me look.....
PostLinks perhaps? :D
In fact I' trying to find (hoping) the table in archive.org/details/stackexchange
130
Q: Database schema documentation for the public data dump and SEDE

Stu ThompsonStack Exchange releases "data dumps" of all its publicly available content roughly every three months via archive.org, and also makes that information queryable over the Internet at the Stack Exchange Data Explorer (SEDE). Over time, as new features and other bits of data are introduced to Stack ...

PostHistory table, if the postHiustoryTypeID is 10 (closed), then the Comment filed will contain the value "101" (or "1")
that makes it a duplicate.
and that happens after 6 people voted for close for duplicate, right? :)
thanks for the link again btw I totally forgot that it existed.
I'm pretty sure, yes. and you're welocme
22:44
0
Q: Strip carriage returns / line feeds from database records before they are written to csv

Tony NesavichI have the following code that reads lines from a database and writes the matching results to a csv file. The problem I am running into is there are occasionally carriage returns / line feeds in some of the fields in different rows which cause the csv file to be unusable because there are bogus r...

22:56
@whytheq probably not actually. Code Review requires that the code in question work as intended. It doesn't seem OP is quite there yet. — RubberDuck 2 mins ago
0
Q: Fun with CallerLineNumberAttribute: clever hack or terrible idea?

Dan BryantOne fun feature that was added (fairly) recently in .NET is the [CallerLineNumber] attribute, which, in conjunction with [CallerFilePath] and [CallerMemberName] can allow for some very nice logging methods. I was thinking today, though, that they might be used for another interesting purpose. C...

@Phrancis About 90% of questions that are suitable for CR are off-topic for SO. This is yet another vague "refactor my Sass for me" question that's not going to help anyone because they don't even know what to ask. There's no question here (eg. how do I write a loop? how do I use the parent selector? etc.). — cimmanon 53 mins ago
@rolfl I have problem finding out the SDK I got is compatible with C#. Any suggestions?
if it rings a bell I can give you more detials
Ummm.... C# and SDK compatibility with a Java context makes no sense.
What SDK are you thinking about?
I have this propitiatory SDK for this hardware with couple of MSC++ examples and no documentation
I am wondering if there is a way to find out if the SDK is .NET or Delphi and so and so compatible
it's quite a generic situation so I thought you might a input :)
@rolfl but you're right, you don't do Java# .NET :D
@mjolka is here too. he might know something about something
23:10
If you put one of the files from the SDK on to a linux machine, and type:
file somefile
it will tell you what sort of file it is.
for example, if it is an ELF, it's likely for linux, not windows :)
as I said it had some MSC++ examples so I guess Windows
but the examples are MFC rather than Unicode and it's a lot of work to convert them back to Unicode and run them
@rolfl Or just cygwin? I think the file command in in utils, not sure
I think it is a COBOL code-dump... that's my phone-a-friend answer ;-)
23:30
@Mehrad maybe the easiest thing to try is to create a new c# solution, try to add a reference to the dll(s)
@200_success Nature is calling for better docs & peer reviews. I can't tell whether the problem is people who happen to primarily be scientists, requiring to code, or coders needing to consider science. Either way, offering courses is a little far. Instructors need to put more focus on commenting code. If I write an experiment method, for example, standards dictate me to provide adequate instruction so the method can be followed again. I can't just provide a photo of the result and say go.
0
Q: Building the HTML body view

Albert FajaritoI created a library class in codeigniter that handles building the HTML body view. Did I implement the correct OOP standards? private $_CI, $_layout, $_header; private $_defaultContent = array(); private $_defaultJS = array(); private $_JS = array(); private $_conten...

0
Q: Why I have errors with these codes?

MecherI'm trying to get the values from a Query String and add them to an array inside of an array. The output Query String is something like: add_to_cart.php?product_id=4&product_name=Pizza&quantity=1&additional_id[]=1&additional_quantity[]=3&additional_id[]=4&additional_quantity[]=5 I need to get eac...

23:46
@mjolka that's the approach I took just then and received a big fat error trying to add the dll as a reference. cheers :)
@Mehrad ok cool :) well you can probably call into it using PInvoke
@rolfl I suggest moving the Pizza table question to SO
Never mind, he's gonna come back later and reword
0
Q: Need to optimize my minimum coins algorithm in Ruby

user2770919I am working on a puzzle to find the minimum number of coins needed to buy a product. I am given three coins 1 3 5 and also a number representing the price of a product. 11 The answer here would be three, since it takes at least three coins to reach this number. 5, 5, 1 I decided it w...

@Quill The user is unregiustered, and has no SO account. I tend not to migrate when that's the case.
It often means that they are trying to circumvent a ban on SO.
@rolfl Oh, I didn't even think like that, I suppose then again, that's why you have the diamond next to your name :P
23:59
RELOAD!
00:00 - 17:0017:00 - 00:00

« first day (710 days earlier)      last day (3605 days later) »