« first day (849 days earlier)      last day (3172 days later) » 

Zak
4:06 PM
@Donavon We encourage you to take a look around the site. You may find it especially useful to look around the Questions/Answers for your language of choice, there's almost certain to be some useful advice for you in there :)
 
SQL again..... anyone tell me what's wrong with this part of my WHERE statement?
(Code IN (SELECT CASE @Type
WHEN 0 THEN ('CRI', 'MAG', 'POA')
WHEN 1 THEN ('FPO', 'STA', 'DOM')
WHEN 2 THEN ('CRI', 'MAG', 'POA', 'FPO', 'STA', 'DOM')
END))
 
@Zak please read my edit summary and tell me what you think...
 
the case >= 80 doesn't seem to work. — Donavon 32 secs ago
@Zak Case Is >= 80 is such a VB construct ;-)
 
@Malachi you cannot return literal sets to an In like that...
When 0 Then (SELECT * FROM ('CRI', 'MAG', POA'))
 
If you need a code review, try at: codereview.stackexchange.comkenorb 26 secs ago
 
4:09 PM
So the case >= 80 won't work?
 
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.com — HighCore 33 secs ago
 
@Donavon Correct.
 
Zak
@Malachi right
 
@Malachi dat moment
 
@Malachi wait that worked???
 
4:10 PM
@Vogel612 no
 
alright thank ya
 
Zak
is there a way to do what I'm suggesting in c#?
 
Zak
okay, I'll go delete the answer
 
this should be downvoted, I mean other than mine. ▲▲▲
 
4:12 PM
0
Q: go code for segment tree with lazy propagation

Aerofoil KiteThis is the implementation of segment tree with lazy propagation. Could you please review this code so that I can improve my go language skill. package main import ( //"fmt" ) var array []int; // Array to store initial input like: [1,2,3,4,5,6,7,8,9,10] /* This is Node structure val ...

 
-1
Q: How to simplify and avoid DRy principle here

bane 975I am just wondering whether this code could be done in simpler way: if (conditon1) flightChangeInfoList.Add(new ChangeInfo() { IsChangeable = false, ReasonCode = ReasonCode.Departure }); if (conditon2) flightChangeInfoList.Add(new ChangeInfo() { IsChangeable = false, ReasonCode = Reason...

 
@StackOverflow avoid DRY principle??
 
Curious.
 
@Vogel612 I have such bad tunnel vision right now. I can't think of a way to do what I need to do without writing line after line of SQL
 
Feel free to ask on Code Review. However I would strongly recommend you include the whole context - boiled-down "what's the best practice about X?" questions are off-topic on CR, you need to include your actual working code, in its full contextual glory. — Mat's Mug 30 secs ago
 
4:15 PM
I have an idea
 
@Malachi did it hurt?
:p
 
almost like eating ice cream way too fast
it might be really ugly too.... (the code I mean)
 
@Malachi I don't get it. I bite my ice-creams
 
@IsmaelMiguel never had a brain freeze?
 
I can finish 1L of ice-cream in 20 minutes
 
4:18 PM
@IsmaelMiguel ▲▲ What @Mat'sMug said
 
@Mat'sMug Is it required to eat ice-cream to have one?
 
easier with slush
 
Then yes, I had
But I've never had due to ice-cream or eating things that are too cold
 
Zak
IT's rare for me to get brain freeze. I have to really work for it.
 
Have you ever heard of an ice-cream called Calippo?
 
4:20 PM
topicality???
 
It should be right back in 2-3 messages
 
Star all the Monitor!
 
@RubberDuck I'm since 4AM UTC
 
Zak
@IsmaelMiguel I think I went starless at 4:30 UTC :) I'll have to try harder tomorrow
 
At 2AM then?
 
Zak
4:23 PM
UTC is local time where I'm at
 
I know
You're from UK
 
@Donavon I'll try to spare some time to write up an answer later on. I think a strategy pattern would be nice there, but your post could use a bit more context - can you edit to add the declarations for the locals being used? ideally you'd have the actual method, with its signature. actually ideally you'd have the entire program in there (I'm sure it can fit the 60K character limit!)
 
@Vogel612 @Mat'sMug @rolfl Thoughts on this code?
 
What's wrong?
 
4:25 PM
AND (
		(@SearchType = 'criminal' AND Code IN ('CRI', 'MAG', 'POA'))
		OR (@SearchType = 'protection' AND Code IN ('FPO', 'STA', 'DOM'))
		OR (@SearchType = 'both' AND Code IN ('CRI', 'MAG', 'POA', 'FPO', 'STA', 'DOM'))
	)
 
Okay, so maybe just everything in the sidebar....
 
@IsmaelMiguel Some guy thinks that "suggesting include guards" is something that is downvote-worthy.
 
-1
Q: Is there any way to avoid DRY

bane 975I am just wondering whether this code could be done in simpler way: if (conditon1) flightChangeInfoList.Add(new ChangeInfo() { IsChangeable = false, ReasonCode = ReasonCode.Departure }); if (conditon2) flightChangeInfoList.Add(new ChangeInfo() { IsChangeable = false, ReasonCode = Reason...

 
@EthanBierlein ...Why?... WTH!?
 
yes @Mat'sMug i will add more detail
 
4:27 PM
great!
 
@IsmaelMiguel I have no idea. The answer is here if you want to suggest anything else.
 
!DRY == WET (We Enjoy Typing)
2
lol
 
@EthanBierlein I'm reading it
 
@EthanBierlein I didn't know that about system("PAUSE"), good to know. However, IIRC there isn't really a decided bracket style for C++, and it's still in controversy (however, I agree on your stance :P)
 
@Mat'sMug I have updated my post
 
4:32 PM
writing VBA answers on a C# question.....lol
 
Who did that?
 
Zak
`my bad
I like to dabble in other languages with basic observations
sometimes means that how I think basic stuff works and how it actually works aren't the same
 
I do that sometimes
I've answered questions about Java and C++
 
Zak
I'm used to select case being rather flexible in VBA
turns out, not so flexible in other languages :)
 
@Donavon I added some indentation, I figured you just forgot to indent when you added the method declaration?
 
4:35 PM
@Zak Why you say that?
 
@Donavon awesome!
 
Zak
As an example I can do:
Select case lng
case is >= 1
 
in C#, switch..case over anything other than an enum is often a code smell ;-)
 
Zak
I figured it was better than a chain of elseifs
 
Thank you @Malachi and @Mat'sMug
 
Zak
4:37 PM
but I can't do
switch(lng)
case >=1:
in c#
 
@Donavon You're welcome
 
ugh. which part of that comment wasn't clear?
Feel free to ask on Code Review. However I would strongly recommend you include the whole context - boiled-down "what's the best practice about X?" questions are off-topic on CR, you need to include your actual working code, in its full contextual glory. — Mat's Mug 25 mins ago
Welcome to CR! Please include more context, and the actual conditions - what is the purpose of the code? Why do you need these conditions for? What's a ChangeInfo and why does it need to be added into a flightChangeInfoList? What type is flightChangeInfoList? is it a private readonly field? a public mutable one? a function's return value? Feel free to edit your post to include the whole method, or the whole class. We can't review stub code / boiled-down logic. — Mat's Mug ♦ 4 mins ago
 
does it work? if no, what is the problem? If it does and you are asking for code review please post your queries and code at codereview.stackexchange.comSudhansu Choudhary 36 secs ago
 
@Mat'sMug You missed a comma after "However".
 
@Mat'sMug My thoughts exactly when I saw it.
 
4:41 PM
right... uninstalling Chrome ..
see you tomorrow, guys Ima go through my work PC with the flamethrower now
 
@Vogel612 Have fun with it!
 
Quick question. Does anyone where have some C++ experience?
 
Maybe Malachi
I know that Morwenn has
 
Morwenn, Jamal
 
Well, what I'm asking might apply in other languages as well
 
4:44 PM
Shoot it (not literally!)
 
well, you're asking if anyone has C++ experience, ...sounds pretty language-specific to me!
:p
 
C++ room?
 
Oh, right.
 
I mean, I know C++, but I wouldn't say I have experience
 
4:44 PM
I'll still ask here and see if any of you have opinion.s
 
Alright
 
Anyone know how to add a unit test project to an MVC solution after you already created the MVC project???
 
Suppose I have a function std::string foo(std::string bar)
 
@RubberDuck right-click the solution, add, new project, then select a test project template
 
In the function foo, I never modify the value of bar.
I only use it to create new values.
 
4:46 PM
Are you going to ask if you can use a pointer?
 
Then go on
 
Is it okay to pass it by const reference, like this?
std::string foo(const std::string& bar);
 
I'd pass it by whatever C++ has for a concept of "passing by value"
 
Seems about right
 
4:47 PM
@Mat'sMug got it. Was having issues because I was targeting the wrong version of the framework.
 
@IsmaelMiguel I was what?
 
@Malachi a C++ guru
 
lol, not me
 
@Malachi I was saying that you could have experience on c++
 
C# here. I should learn C though, so I can better program my Arduino and teach my kids (and myself) about robotics, get them hooked on programming as well
that sounds like fun
 
4:50 PM
@Malachi mine love playing with my XPlained board with me.
 
@Malachi I had robotics at school. Lets say that I've screwed 1000€ (including a 500€ CPU)
 
I have an Arduino Uno. I think I might try to create a car that follows a line on the floor. that would be cool, I just need to figure out what all I need, and then call it a school expense
 
@IsmaelMiguel CPU : IPizza
public interface IPizza
{
    void Burn();
}
 
You guys were wrong.
It should be passed by const reference if it's value is never modified.
 
public interface IPizza
{
    void Burn();

    bool isBurnt();
}
@EthanBierlein Mat said to pass by whatever is a constant
 
4:54 PM
7 mins ago, by Mat's Mug
I'd pass it by whatever C++ has for a concept of "passing by value"
 
well I said whatever "pass by value" is
 
@Mat'sMug It wasn't burnt. I soldered it improperly and the CPU wouldn't work. 1 robot to the trash.
 
a "const reference" sounds like the speed of passing a reference, with the benefit of not being re-assignable from within the implementation. right?
 
Yes
And no useless copies are made as well when it's passed.
 
Zak
Right, time to actually get some work done :)
If anybody sees me in here in the next hour, please kick me out
 
4:58 PM
@Zak You were kicked?
 
Zak
good point :)
 
@Zak You can always ask a mod to kick you for a certain time period if you can't focus. We had one user ask for that once.
 
I could ban you for an hour, but that wouldn't look good on your profile ;-)
 
Zak
@EthanBierlein I think I'll try self-control for a while first, see how that works out :)
 
@Mat'sMug You could just chat-ban him.
 
4:58 PM
I've been banned twice
Trust me, it sucks
 
Wait, can't moderators put a custom ban message?
 
a ban is still a ban
 
If that's the case, you could put something like. "This user has requested a temporary ban of their account."
 
It can be done as an annotation, yes.
 
questions about refactoring working code are often better asked on Code ReviewWill 32 secs ago
 
5:02 PM
I wouldn't ban someone on request. a real ban request is when you start calling people names and acting like a child in a daycare.
 
That ^^
 
@Mat'sMug You won't be seeing those words ever again. I'm a better human being now. (Not because of the ban, but because of what I let out)
 
good to hear read :)
 
There's only one thing
I don't remember calling names to anyone
But lets forget that
 
yeah lets
 
5:04 PM
@Zak Please. There's no better control than self-control. Asking moderators to ban you because you can't focus on things doesn't solve anything, really. We can't hold your hand and make sure that you don't waste time on other sites. In the end, it's all up to you.
 
Sometimes, self-control is broken and some drastic measures must be taken.
But yes, self-control rules
Best way to solve anything and everything.
Wow... I just made a slogan
 
related:
25
A: How can I keep from getting addicted to Stack Overflow?

Joe SchmoeYeah, it's an interesting effect these sites can have on you. On the one hand there is the boost to self-esteem and personal pride with high reputation and upvotes...but you don't always get the upvotes you feel you deserve. On the other hand, there is the fear of looking stupid in front of you...

 
52
A: How can I keep from getting addicted to Stack Overflow?

Adam Davis"How can I keep from getting addicted to SO?" asked Jul 9 at 17:39 by Jonathan Sampson ♦ Ahem: By the time you asked this question, it was already too late.

 
Nice finding!
 
5:13 PM
> Not all addictions are bad. I mean you could be hooked on leprechaun porn or something and that wouldn't do anybody (except maybe the leprechauns) any good.
 
hey guys
 
hey
 
@Mat'sMug Nice ..... erm .... quote .....
 
I like the one answer that says something like this:
 
Greetings
 
5:14 PM
> "Have a child."
 
LOL
 
25
A: How can I keep from getting addicted to Stack Overflow?

gnostradamusFrom personal experience... Have a child! That will force you away from SO for at least a short period of time, which may be just enough momentum to help you break free from its gravity. ;)

 
for the record, it doesn't work. not even twins.
 
You could ask for a cat
 
Or a 6-week old puppy
That would keep you occupied for hours on end
Cleaning up all the messes, and feeling bad when you don't pet it.
 
5:16 PM
@Hosch250 Is a counter-example
 
@Mat'sMug Were you still planning on making a post?
 
nah
oh you mean on your question?
yeah
 
yeah
 
later though
gotta go grab lunch, and then work a little
 
Now I'm hungry
 
5:17 PM
Lunch at 1:17?
 
It's a proper time
 
Well, I shouldn't be talking...
I've eaten lunch at 3:15 before...
And had dinner at 11:10 once
 
I usually eat my lunch at 1:30-2:00
 
Speaking of lunch...
I'll be back in a bit
 
Now I'm starving
 
5:22 PM
Do any of you have coding professions?
 
0
Q: AngularJS: MVC and Services

UltraSonjaI'm writing and app in AngularJS and am learning about writing RESTful services. I also want to make sure that I'm understanding the MVC pattern correctly. In my code, this is my take on how I'm implementing MVC. I have two services that get JSON data from the server. The JSONController then ...

 
@Donavon I do
And I think most of all do
I know that Zak works in I.T. and ends up writting VBA stuff
 
ah thats pretty awesome
 
It is
 
@Donavon Currently an intern, soon heading off to work on the second year of my CS degree. Plan to program my entire life.
 
5:35 PM
Code review requests belong on codereview.stackexchange.comglenn jackman 21 secs ago
 
Hey. my dog is about 4 years old now.
I didn't know about SO when I got her.
 
@Donavon No, not yet.
But I might in the future.
 
@Donavon Some of us, not me.
I'm in college for IT.
 
If I don't get into Physics or Engineering before I graduate from high school/college.
 
@Hosch250 Sorry. I though it was a puppy.
 
5:37 PM
Chances are I could most likely find a way to use programming in both of those fields. :-D
 
@Donavon a lot of us do actually. Lots of students in here too though.
 
I do BI stuff
 
Too much info :/
 
Business Intelligence
 
5:42 PM
... That ...
 
lots of T-SQL and SSIS for now, soon SSAS and SSRS
some C# scripting too
 
C# scripting?
Isn't C# compiled?
 
For the record, Job titles are normally a desired state of being....... not a current state of being.
 
@IsmaelMiguel Yes, it's not really a scripting language.
 
5:42 PM
So, a Programmer "wants to program", not "does program".
 
yes, but when it's embedded in a SSIS package script component, I call it scripting ;-)
 
Makes sense
 
programers spend a lot of time doing things other than programming, like meetings, bug fixing, etc.
The same is true for Business Intelligence.
 
, chatting in the 2nd monitor...
3
 
Businesses employ people in the hopes they will have intelligence.....
3
 
5:45 PM
/wits fail
:p
in CR Chronicles, 19 mins ago, by Simon André Forsberg
So, now Simon is around as well. Questions?
 
1
Q: Defining array contents using multiple statements on one line

ZakSo, I'm writing a sub. It's going to determine which type of business is being detailed on a particular line of data. It's going to use column positions to check if the data exists, and then output the corresponding string if it does. I've decided that the best way to organise a group of my argu...

 
Try codereview.stackexchange. — Takendarkk 5 secs ago
 
0
Q: Is this js oop approach is correct?

KadirI am developing mvc project and I am writing jQuery functions very much per page and it's getting complex while function counts incresing. Finally page header looks very dirty. I decided using java-script's oop, I wrote this code: var thisPage = function () { var page = this; page.showL...

0
Q: (Somewhat) Simple Number Theory Game - ideas for refactoring code?

ChrisI just started javascript about a week ago. For my first project, my goal was to use my knowledge of basic javascript to create somewhat of a "thinking computer brain," so to speak. I wasn't focused on the looks of it, as seen by my only using the basic prompts and alerts. I just wanted to get us...

 
6:04 PM
http://www.commitstrip.com/en/2015/08/31/fixing-a-bug-when-the-whole-world-seems-to-be-against-you/
CommitStrip - Blog relating the daily life of web agencies developers
Fixing a bug when the whole world seems to be against you
CommitStrip
1441044006
4
 
Zak
hello people :)
 
hello
 
Zak
Sorry, if my remarks came off too serious, I meant them in a relatively light-hearted way
 
Greetings
 
6:08 PM
how does "hello people" come off "too serious"... with a smiley? o.O
2
 
Zak
I meant before, about kicking me out if I came back
 
ah, right. see? had forgotten.
I think it's been over an hour anyway
 
I think someone else also mentioned this should be posted more often.....:
2
20
Q: How much idle chatter do we tolerate in The 2nd Monitor?

MastRelated but not a duplicate: How far off-topic can we get in 'the 2nd monitor'? Today was a complicated day in the history of The 2nd Monitor. On one side there appears to be consensus something went wrong which should be handled. On the other side there appears to be disagreement about how muc...

 
Zak
@Donavon I'm general "IT guy" for a small Finance Company. People have things they want done/automated/created (inevitably in Excel), I figure out how to make it happen.
@rolfl that was me :)
 
6:11 PM
@IsmaelMiguel need a hammer?
 
Don't know
I'm asking if I place my vote or not
 
@IsmaelMiguel The post has been closed, btw
 
good call, community :)
 
Yeah, I didn't notice
 
Zak
If anyone has an opinion on this, I'd love to hear it
2
Q: Defining array contents using multiple statements on one line

ZakI'm writing a sub which is going to determine which type of business is being detailed on a particular line of data. It's going to use column positions to check if the data exists, and then output the corresponding string if it does. I've decided that the best way to organise a group of my argum...

 
6:17 PM
0
Q: How do I prevent file_get_contents from my site, if called via localhost

SueI have an SSL configured on my site, but when I call file_get_content() on my own site, I can echo the whole site. I'm concerned as I believed this was impossible if an SSL is installed. I've tried various preventative measures to no avail eg: $foo = $_SERVER[SERVER_NAME]; if($foo === 'www.e...

 
@Mat'sMug @rolfl didn't agree.
 
Code where the asker believes it works is on topic, even if it does not work.
 
except if they're asking "will this work?", i.e. they don't know it does...
 
That's a statement that's as "certain" as "canyou check for edge-cases?"
 
and it was also a regex-only question, which has been deemed "hypothetical" I believe?
 
6:21 PM
Hmmm... I also answered it, which makes me biased.
 
@SimonAndréForsberg I think regex where fine, as long as you specifically specified the engine and showed what to match and what not to match.
 
some more history going on
in CR Chronicles, 2 mins ago, by 200_success
rolfl basically sacrificed himself to get us our first elections, in two ways.
 
And we appreciate what @rolfl's done. No doubt.
 
thats awesome guys. hopefully one day i get good in c#, and other programming languages
 
@Malachi Be careful with your wording, please. Calling for a downvote brigade (for any site) is not appropriate. There's a line between "this answer wasn't that helpful" and "hey everyone, help downvote this post!"
 
6:37 PM
@200_success I can't delete it now, but I see what you are saying. should I have commented on the answer itself that it doesn't work?
 
Yes, that would have been better.
 
could you delete that post?
 
@Donavon As long as you practice, you will be good
 
thank you @200_success
 
6:39 PM
Sure.
 
you deleted the post link but not my comment....lol looks funny....
I posted a comment on that answer as well
 
@IsmaelMiguel Yeah, honestly I've learned more about good in my 2-3 years interning then in my formal training (granted it's been only one year, but I don't foresee much better anytime soon)
 
The "time-weights" are different. But I get your point.
I had no idea that VB had classes
And I had VB for 1 year, at school
 
@Zak I've reviewed your latest VBA post. For the record, I didn't upvote the question, because I don't like A vs B questions, and I find it would be a much better question with more meat/context.
 
6:55 PM
1
Q: Override values for overlapping objects between two scala lists

Lost In CodeLet's say I have a bunch of Widget, where a Widget is class Widget (sku: Int, label: String, name: String, description: String) And I have 2 sources of Widgets: List[Widget] wInventory = getWidgetsInInventory() List[Widget] wCatalog = getWidgetsFromCatalog() I want to use the name & label...

 
Zak
@Mat'sMug I appreciate that, it was just a small style question.
but I felt it was borderline big-enough-to-be-a-potentially-useful-question
also, I just figured out why Duga goes Reload! upon reset,
 

« first day (849 days earlier)      last day (3172 days later) »