« first day (590 days earlier)      last day (3429 days later) » 

12:00 AM
whew ... welcome to winterbash!
 
I GOT HATS
2
 
Jon Ericson on December 14, 2014

There is no better antidote, at least for the worst hours and eclipses of the soul, than to conjure up … serious frivolity.—Friedrich Nietzsche

No, it’s not a new flavor of Unix shell. Rather, Winter Bash is an ancient tradition of Stack Exchange. (2011 is ancient according to Internet time.) Here’s how it works:

Starting right now, when you complete one of 30-odd challenges while logged on a participating site, you will be awarded the associated hat. To notify you, an icon will light up on the top bar. In addition, admire your hat collection on the Winter Bash 2014 site …

LOL
 
Hey guys. any of you develop with Visual Studio for the company you work for?
 
Not at work, but I use it.
 
I use it a bit at work, can't say I'm an expert though...
 
12:09 AM
I am trying to convince my manager to go with new MSDN subscription rather than the traditional once off license like for 2010
 
@Mehrad Not regularly, but I have it....
I occasionally have to work on CUDA and for that need C/C++ for windows.
 
He asked me some reasons and it's quite hard to explain for an electrical engineer why the new .Net or C# version would be a way to go
just want to know if any of you guys did it and if so how?
The new subscrptions aren't cheap and the worst thing they are for A YEAR for A PERSON
He also wants to know if we don't hop on the treadmill for the yearly subscription with Microsoft do we have any other options?
 
I HAVE A NEW HAT!
YAY HATS!
 
0
Q: First four Project Euler in Scala

MichaelTI was working on teaching myself some Scala and decided to tackle some Project Euler problems. The first four of these turned out to be one liners. object Problem1 extends App { println((1 to 999).filter((i: Int) => i % 3 == 0 || i % 5 == 0).sum) } object Problem2 extends App { def f...

 
Congrats. it is a beany @RubberDuck?
 
12:15 AM
Why am I the only hat-wearer?
 
@rolfl afaik you develop with some non Microsoft based options. Would you recommend anything other than C# which makes it possible to develop applications for a company which is mainly working on Windows?
 
@Mehrad - I'm not the right person to talk to about these things...
I work in an R&D style group inside IBM... for so many reasons our rules are different.
 
@rolfl thanks.
we don't have a development team in this company so I am pretty much on my own
the only option is to reach out and see what others do.
 
Makes sense. My nature is to recommend Java, but the primary reasons for Java are when you use somethingother than just Windows....
 
@Mehrad do you work at a startup?
 
12:20 AM
THe yearly subscriptions for Java are much, much more affordable too.
 
@mjolka sorry. I don't know what you mean by "at a startup"
@rolfl I didn't even know they have subscriptions like VS do
 
@Mehrad They don't ;-)
makes it affordable, right?
 
Oh yeah.
Cheap it good, free is amazeballs
however, I appreciate the input. maybe it worth considering. unfortunately our client side is heavily dependent on Windows.
 
@Mehrad if you want to stick with .NET, microsoft provides software and other things for free for startups -- which they define as companies which have been in business < 5 years and bring in less than US$1 million in annual revenue
for three years
 
Depending on the size of your company and number of developers, you might qualify for a free VS license.
 
12:24 AM
Oh... that's right... I studied that but we unfortunately don't fit in
We are mainly including me an electrical engineering company
 
@mjolka the community license is a bit different than that I think.
 
but all we need as development fits with me dedicating half of my hours for developing the software we need. So very little
 
@RubberDuck yep, community license is another thing
 
That's why I have a hard time convincing my manager. The cost of subscription per outcome we get from it so hight.
since our revenue isn't generated from software development. Make it hard and share holders whinge and grunt about development related expenses
 
@Mehrad VS professional at ~2k/year is considered too expensive?
 
12:28 AM
0
Q: printing out the difference of terms in a 2D array

Sean Chen #include <iostream> using namespace std; int main (int argc, char ** argv) { int c; int distance=0; int largestdistance=0; int sum=0; cin >> c; int point[c][2]; for (int i=0; i<c; i++){ for (int j=0; j<2; j++){ cin >> point[i][j];...

 
@mjolka I just filled a request for a pressure calibrator which I will need for the project I am working on which worth 40K and my manager already approved it. Cuz we are going to make money out of it. But when it comes to software development they are ....ers ...
I assume that's the Australian price you are talking about. right?
 
@Mehrad if they want you to spend half your time writing software, surely they expect more than $2k /year value from the software you produce?
yeah, $1,912AU
also you can always use the express edition for free
 
@mjolka if I could make a serum out of that sentence you said and put it in their coffee that they could understand I would be a happy man ...
That's correct...
Thanks again one more time for letting me know what you guys think. Now that I know it's not much of a deal for the others then I probably insist more and get it done ...
@mjolka Thanks. :)
 
@Mehrad good luck!
2
 
@Mehrad, what's the nature of the software you are making?
Is it windows only? Does it have a GUI? Only used in house?
 
12:39 AM
@shuttle87 per say this year I was working on two and the latest one is a Bluetooth tester
We get out circuit boards developed in china
and I needed to write an app then they could run and upon execution it could connect to devices under test and test the bluetooth module on it
 
So in-house testing applications?
 
The other is an in house one called Price generator which connects to our ERP and updates our price list using the new prices our affiliates send us in an excel format
@shuttle87 in the sense that some other company in China runs it no but in general there is only 3 users for it and they are with us, so kinda in house. depends how you look at it
and yes they only use Windows :)
since it's "Free" in china
So yes to Windows, yes to GUI and also in-house
 
@Mehrad Community is practically Pro. I would see if you qualify for it. Sounds like you might.
 
@RubberDuck i am starting to think I might. Just looking into it
I remember I looked into it once and it was only available in Europe but no Australia
 
12:54 AM
> The C# compiler’s string optimizer automatically rewrites nested string concatenations into the left-parenthesized form no matter how you parenthesize them. Except when it doesn’t
 
codereview.stackexchange.com/posts/73648/revisions looks like this new user is editing the question to include the suggestions in the answers, I take it that's not the idea with this site?
@Mehrad Ok. Yeah this is a bit tricky then. I make some in-house stuff at my work and it's a bit difficult to convince anyone to spend extra money on it in general.
 
@shuttle87 You've got it. Maybe you should tip him a comment.
 
@shuttle87 sure. Just wanted to hear the ideas :)
Maybe I should make my code Open Source then I can use community edition.
 
I like using some of the open source tools to make things, however I know when I'm developing only for windows I can throw together a c# based GUI for something simple quicker than many of the alternatives.
 
My code wont' be of any use for any other ... (damn, that's sad)
 
1:02 AM
Is your employer ok with open sourcing?
 
I don't think why they wouldn't
Maybe that's the angle I should discuss with the R&D manager...
couple of really good ideas came out of this discussion for me. quite happy
 
For things that don't contain any of the companies intellectual property it can be cheaper to go open source because the company won't foot all the costs for maintenance and improvements. Framing things in the right way is the key to these conversations, especially so when dealing with non-technical managers.
Your workplace culture could of course be different but there's places I've worked where there was a bit of a fear of the unknown when it came to open sourcing things.
 
That was my exact question. How to convince and electrical engineer that why he should pay for C# :D
 
Crucial question, why do you think it's worth it?
 
You mean in my own opinion?
 
1:07 AM
Yes
 
cuz if that's what you mean I just simply couldn't find any other tool as convenient as VS to develop applications for Windows users
 
OK, why is it convenient?
 
@shuttle87 Yep! Since the OP didn't rollback the post within the grace period, I will do so myself now.
 
@jamal, is rolling it back the correct course of action with these things?
 
Since it has everything in one place. Documentation, guides, side tools like Intelligent and continues support.
you're not worried somebody gonna stop working on it on his backyard and then it's gonna be deserted.
 
1:11 AM
would that make you more productive?
would that decrease the risk to the company having a stable product for a framework?
 
@shuttle87 Yes, but editing privileges is required to do them, unless you're the OP. If the OP won't do so after receiving your comment, you can try a manual edit to restore the original code.
 
ok
 
depends ... I know if I say yes it's mostly mean it's easier for me than me being productive
I was using a variation of Octave UI instead of Matlab in linux and when they stopped developing and fixing bugs I got under so much pressure hitting the deadlines until Octave released it's own couple of months ago
but as I said I am not worried about getting out of the comfort zone. I prefer vim to any other windows editor and like learning... as long as there is an option :)
If you make the software open source should you get it approved?
cuz Microsoft is keep using this term "(OSI)-approved" in his T&Cs for VS community edition
 
@Mehrad OSI approves licenses, not projects
If you distribute using an OSI-approved license, it is all that counts
 
Well it depends on where you work, some places would not look at all favorably on people open sourcing things they do at work other places don't care and some places encourage you to do it. It varies a lot.
 
1:20 AM
very good
thanks rolfl
 
very interesting.
it sounds like cheating when you make your software open source when there isn't of any use for it other than your own company
 
Also possibly of interest to you: choosealicense.com
Why does it "sound like cheating"?
 
@Mehrad Not at all.
 
it's like somebody making his cholesterol pills communal for his mates on the lunch table :D
 
1:23 AM
No, it's like NASA open-sourcing the shuttle's code.
Just because you don't have a shuttle, does not mean the code is not useful
 
I'd read it ;)
 
hahaaha... I really like that example
well I was going to upload my latest project on Git then parts of it get reviewed in CR. I don't think it can be more open source than that :D
@rolfl this is one hell of a web site. very straight forward. Cheers
 
I definitely code differently for open source projects. I know some of the stuff at work I'd find somewhat embarrassing committing to an open source project. That's not to say that it's bad code, it does exactly what it needs to but not a lot more. It's just code with the express purpose of generating good ROI for the company so it's not as extensible as it could be amongst a few other things. Often open source projects are often coming at it from a different perspective.
That said I much prefer working on open source projects. Just something to think about before you decide to go either way with your in-house applications.
 
surely there is some decision making involved. And when it's related to a company, I am not the only one who decides.
Never had this conversation with my manager. gonna give it a go and see what he thinks ...
 
1:40 AM
@Mehrad does your work provide you with a computer?
 
@mjolka yes. a laptop
 
which probably cost ~1-2k?
 
Yes
 
which is about the price of a year of VS
 
:) Yes...
 
1:43 AM
not really sure where i'm going with this. just that it costs a lot to employ someone -- superannuation, setting them up with a desk and a laptop, etc. the cost of a year's subscription doesn't really add up to much
 
I am with you in that. However I don't know why some costs just stand out so much
 
Anything that's not seen as necessary (even if it really is) will be treated differently.
 
and I can understand part of it. From the circuit our company have designed in R&D we made over a million revenue but on the other hand the software I developed saved 4 people 4 weeks of headaches however it doesn't come to attention that much
 
@Mehrad it doesn't have to be open source to use community. Just a non-enterprise company with 5 or less devs using it. Can't remember what makes a company "non-enterprise" though.
 
I checked @RubberDuck we are definitely are
 
1:47 AM
Ahhh. Gotchya.
Just making sure you knew.
 
it's either more than 250 pcs that we don't have OR over 1mil revenue (we made 7 :( )
Yes. as soon as you mentioned it I went and read almost the whole T&Cs ... :)
however I found out if it's open source it's a green light... and rolfl showed me some website to see if my project's fit in that category
 
> You earned "Fascinating" on Code Review!
no idea what that means! ...but I haz a seekrit hat!!
 
Me, too! Let's try to be one of the top sites again.
 
sure!
"30 minutes or less" is going to be HARD!
 
@Mat'sMug I am not sure what's that hand sign mean but if it was on the right side, it would look like it's grabbing the mug... :)
 
1:57 AM
true... but it's actually a finger pointed at YOU
"We need YOUR VOTES"
 
@Mat'sMug But easy on Code Golf. ;-)
 
Oh...
I wish I had one of those hats :)
 
MURICA
 
There's a "Selfie" hat for answering your own question! Our lingo made it to WB!!
hunt 'em down!
 
:) Niceee
question. Why my profile has 1.4K written under it when I only have 500ish in SO
is this the sum of all?
 
2:01 AM
SE chat is showing your SE-wide rep score :)
 
I got excited at first that maybe one of question got popular over night :D
cuz the last one got down voted -2 : )))
and it was a perfect question in MY eye :)
 
@Mat'sMug I'm working on one right now!
 
working on another hat... but there's not enough people in chat right now :(
@Mehrad did you delete it? 'cause I only see your last one as +2!
 
-2
Q: How to implement INotifyPropertyChanged with nameof rather than magic strings?

MehradI was reading about the new nameof keyword in C# 6. I want to know how can I implement INotifyPropertyChanged using this keyword, what are the prerequisites (of course other than C# 6) and how it will effect the performance of my MVVM application?

sorry it was SO no CR
 
*CR
 
2:07 AM
hahaha... now my horse is wearing an android hat :D love it
 
You don't need nameof nor magic strings
Awesomesoft took care of this for you some time ago already
 
I was just curious. but they just bashed me up :)
 
and ReSharper
 
just use [CallerMemberName] and OnPropertyChanged()
2
 
^^
 
2:09 AM
0
Q: Refactoring a FTPHelper Class

ElvisLikeBearI've written a FTPHelper class to help teach me more about code strucutre. I don't know what I don't know so I would really value feedback on how I can be laying out and thinking about my programming better! public class FtpHelper : BaseHelper { public FtpHelper(string ftpHostname, string ft...

 
Which ironically is more code than the other mechanism that uses CallerMemberName, and unfortunately is not as comical as infoof. — Adam Houldsworth 2 days ago
 
I guess the exact same thing which happened to a curious cat happened to me as well
 
huh?
 
You died as well?
 
as I said. I was curious to know how it works and people didn't like the question and I died
I only have 500 something rep and two downvotes is all it takes to kill me :)
 
2:12 AM
It's a meager 4 rep
1 upvote on 1 answer earns you 250% of that
2
 
I'd wager it's because there are TONS of already-documented ways to go type-safe about INotifyPropertyChanged
 
@JeroenVannevel can't agree more. :)
 
@Mat'sMug how should I know how many votes I have ?
 
if you haven't seen a pop-up saying "5 votes left" then you haven't voted enough! :)
 
2:17 AM
I never seen that... btw... somebody revived me... :)
 
In the question you suggested I see you as the editor. us upvoting the question would benefit you @Mat'sMug ?
that encourages me to go upvote all the things that I have no idea about
 
nope. but OP proceeded to include the base class when I asked him, that alone is worth a welcoming +1 (but I'm out of votes)
 
Is vote allowance daily ?
 
40/day
 
2:19 AM
I got 39 then :)
 
yay!
 
I think I hit the vote limit once on SO. 5/35 upvote/downvote ratio or something similar
It was a particularly bad day
2
 
@JeroenVannevel if there's a "Grinch" secret hat, you're earning it on SO then!
 
were you using the close review queue?
I find I can end up voting down a lot in that.
 
Nope, just regular browsing
 
2:22 AM
Selfie posted!
 
ah was that why you were answering that "ancient" question?
3
 
0
Q: Sane ranges for DB queries

MercI have a function that has, as input, a ranges object which may define from, to and limit. Note that it might have one, two or all three of them. I want the output to be a saneRanges object, where if partial values are provided, the other ones are inferred. For example if only limit is provided...

 
Yeah. I think all of my non-Java questions are pretty ancient now.
 
@CaptainObvious (feels like editing title to "Not-so-insane ranges for DB queries")
2
 
And I did have some bad titles back then...
3
 
2:26 AM
and two more hats!
 
I wrote something really similar to that question a while ago in a project I was working on
 
does a response throw an exception when it's a 503 or 404 response?
 
Oh... the Selfie hat is only for new questions. :-/
 
well!
lol
 
¯_(ツ)_/¯
2
That's weird. His arm is missing.
 
2:46 AM
"On the road | ask using the app" is going to be tricky too
 
I guess one can "cheat" by posting without code, then editing in code from a PC.
 
I wonder how one gets "chameleon"
 
0
Q: Returning an object using list comprehension

skj3ggI'm using a list comprehension to return an object for its property. I know the object exists in both lists and no other item in the lists are shared but I don't know what it is so I can't just reference it from the list. The current way I have it is: [item for item in obj.list if item in other...

 
well that was an easy one!
Great - thank-you. I will look into it! — ElvisLikeBear 32 secs ago
 
3:02 AM
0
Q: New Moon (not Twilight) Calculator

rolflPhotography is one of my hobbies, and, living in Canada, I have the possibility of seeing, and photographing, the Aurora Borealis (Northern Lights). Now, these happen when there's ionization in the ionosphere typically resulting from strong solar winds which create a 'tear', resulting in the pla...

 
oooh that's so going hot!
 
3:18 AM
Moar hatz people, moar hatz! - we're about to beat EE.SE
 
If anyone is approaching Necromancer and/or Enlightened, go ahead and pimp. There is a hat for earning a silver badge.
14
TARDIS hat!!!
 
what's that?
"Time Lord"
 
My guess is that it has to do with activity on an older post. I did delete some past comments and reopen an older question.
I'll pimp this one (two away).
 
Already voted
And now I have Warm Welcome. I think the name makes it too obvious.
 
3:33 AM
kinda
I'll hunt review queue hats tomorrow ;)
 
I upvoted this answer from a new user.
(also a zombie kill)
We're beating EE!
3
 
And UX, and RPG, and Travel, and The Workplace, and every single SE beta site too ;)
 
0
Q: Implementing `Applicative Cons`

Kevin MeredithGiven the following definition: data Cons a = Cons a (Cons a) | Empty deriving Show I implemented the following attempt at its Applicative instance: instance Applicative Cons where pure x = Cons x Empty Empty <*> _ = Empty ...

 
Yes! 97 hats! 5 more and we catch up with Information Security!
 
Incoming FizzBuzz!
 
3:46 AM
no way!
 
0
Q: FizzBuzz example in Python for game manual

tepplesI'm developing an implementation of the FizzBuzz game as part of an edutainment game for a retro video game platform. In its manual, I want to mention the history of writing a bot for the FizzBuzz game as a programmer screening test since Jeff Atwood's blog post, including sample answers in a few...

 
Woah woah. There's a TARDIS HAT!?
 
@RubberDuck you know you can reposition and rotate your hat to make it fit your duck?
 
1
Q: Winter Bash 2014 Secret Hats

KevinSo far, I've unlocked one of the secret hats. I'm wondering what secret hats we know of and our best guesses at how to earn them are.

 
ah, so I can't earn Chameleon on CR then :(
 
3:53 AM
@Mat'sMug but his duck already has a hat !!!
 
Yeah. I've gotta get on my laptop though. Did the best I could from my phone.
But now I have a Winterbash hat @Mehrad.
 
I preyed on people to start their chat to the Sumo :D
Now it doesn't even fit
 
Actually - looks like legacy code before inheritance of a base class was introduced. It hadn't caused a problem because FTPEventArgs was inheriting BaseExceptionEventArgs as well. I've now fixed this and removed the now redundant FTPEventArgs - thank-you! — ElvisLikeBear 51 secs ago
=)
 
a snake just bit me - did I stick a foot in my mouth?
 
4:05 AM
Haha! That's a great hat Mug.
 
it is! :)
 
If it gets 7+ upvotes, then that's another hat.
 
this comment scares me:
I like it! At a glance I can't see anything I'd change. — shuttle87 14 mins ago
@shuttle87 feel free to DV me if I messed up
 
@Mat'sMug my python is not great, but how are they iterating divs twice?
 
ndivs = ''.join(name for (divisor, name) in divs
                if n % divisor == 0)
 
4:12 AM
Well the thing about this is that it's the FizzBuzz question, so I'm assuming the idea is to quickly write something that works.
 
where
divs = [
    (3, "fizz"),
    (5, "buzz"),
]
@shuttle87 efficiency doesn't matter then?
 
Are you familiar with the FizzBuzz interview question?
 
54
Q: Down with FizzBuzz... LOL

Mat's MugThis post is the result of reading through and following the LOLCODE Specification 1.2, and writing and executing my code on compileonline.com. My "hello world" was going to be a fizzbuzz. I like it because it nicely illustrates the basics of a language - variables, operators, looping, condition...

 
lol I'll take that as a yes :D
 
I did find an older non-answer of mine to delete. That's another hat.
 
4:14 AM
I guess I'm just jaded, was just involved in some hiring and no joke some people we interviewed wouldn't have been able to do it.
 
that's scary
 
It's utterly terrifying
The talent pool around here isn't good though
 
@Mat'sMug i think it's equivalent to this
var divs = new Tuple<int, string>[]
{
    new Tuple<int, string>(3, "fizz"),
    new Tuple<int, string>(5, "buzz")
};
for (var i = 1; i <= 100; i++)
{
    var ndivs = string.Join("", divs.Where(div => i % div.Item1 == 0).Select(div => div.Item2));
    Console.WriteLine(ndivs.Length == 0 ? i.ToString() : ndivs);
}
 
^^ nested loops
 
upvoted the LOLcode FizzBuzz question
completely amazing
 
4:16 AM
@Mat'sMug i think i getcha now
i should have kept reading your answer "A more common approach is to first verify if n is divisible by both"
 
not sure if it's more common, but certainly involves less processing
 
0
Q: Trying to condense my jQuery multi-level image slider code

XeuceHere is my code I'm working with. $('#slider_1').click( function change_slider(){ $('#slider_1').addClass('current_tab').siblings('.current_tab').removeClass('current_tab') $('#cart_slider_1').show().siblings().hide(); $('#cart_slider_1').addClass('current').siblings('.current').remo...

 
I've just remembered: we can give Community a hat!
 
do it!
 
 
4:27 AM
You mean the n%15, n%3, n%5 structure, right? The n%15 produces 6 passes and 94 fails, the n%3 produces 33-6=27 passes and 67 fails, and the n%5 produces 20-6=14 passes and 47 fails, for a total of 100+94+67=261 modulos as I understand it. A flat n%3, n%5 does only 200 modulos. — tepples 3 mins ago
@mjolka I can't wrap my head around nested loops being more efficient than the simple branching everybody does.
 
@Mat'sMug in terms of modulo operations performed, OP's analysis is right. but there's the cost of string concatenation, tuple deconstruction, etc to consider. in the end though it's only 100 items and it's going to be incredibly hard to make it inefficient
the C# version above takes ~1ms, or ~0.2ms if you put the strings into an array instead of printing them
 
try 1-100000
meh
I don't have the brain juice right now, but that sounds totally right. I just can't wrap my head around nesting loops and concatenating strings being more efficient than simple branching. — Mat's Mug 17 secs ago
and @Jamal takes the lead!
 
4:45 AM
You could help me further by upvoting my 9-score answer. ;-)
 
I will... when votes reload (and when I'm #1 again mwahahahaha)
 
I've edited the question anyway (my previous title was bad and I forgot to add another tag).
 

« first day (590 days earlier)      last day (3429 days later) »