« first day (1441 days earlier)      last day (3563 days later) » 
00:00 - 19:0019:00 - 00:00

user55340
7:00 PM
if(👨.👖 == false && ❄️ == false) { return 😳 | 😱; }
 
user41796
because my meta info is inconsistent from table to table, and the tables are just too dang wide to even consider hard-coding stuff
 
user41796
@MichaelT I'm glad chat is text based.
 
@GlenH7 ah fun. Writing some very generalized data-manipulation code eh? Expressions are pretty cool for that.
though you might just think about going with dynamic instead
 
user41796
@JimmyHoffa oh? tell me more, please.
 
user41796
Or a link so I can go read about it.
 
user55340
7:05 PM
@GlenH7 True story... director at Employer^^^ was in a video chat meeting (common occurrence when trying to get people from multiple buildings in one room for something purely informational (aka boring)). He noticed another tab of 'other participants' and clicked on it... it showed the active web cams of other people in the chat... another director was picking her nose at the time he did that... she was unaware that the video conference was two way (that green light didn't clue her in).
 
user41796
I can already see some inefficiencies in how I'm tapping the DB, so I'm open to alternatives.
 
user41796
@MichaelT "Whoops!"
 
user55340
He sent her a private message along the lines of 'when the green light is on next to the camera in your lap top, the camera is on and other people can see what you are doing.' to which she became very flushed and put some tape over it.
 
user41796
Very nice
 
can outperform expressions in a variety of cases though not all, but generally will be cleaner code to deal with, though dynamics and expressions serve different purposes: Expressions allow you to actually treat the code as data, manipulating it to alter the code that will be executed. Dynamics allow you to treat types dynamically so regardless of what type something is, if you try to use a method on it, it will attempt to find and execute that method at runtime regardless of whether it should
they serve different purposes but they can often be used in place of eachother, just depends on your specific goal for a piece of code which makes more sense
@GlenH7 just do dynamic myVariable = BLAAAA!!!!! and then you can do anything you want with myVariable as if it's a JavaScript object (security accessors still applied though, so you can't set a property with a private setter). Eventually you'll have to do a cast to something to get a concrete type back out if you want anything concrete from it. A dynamic can only return dynamics, you must explicitly demand a type of something to break it out of the dynamic
 
user41796
7:09 PM
@JimmyHoffa Hmmm, I'm mulling over how I could use that in this case
 
@JimmyHoffa: On your Stack Overflow question... I haven't studied the internals in depth, but yield return is just a state machine. When you yield return, it returns the value and yields control. When you call IEnumerable.GetNext() again, it just continues execution following the instruction after the yield return (more or less).
All of the previous state in the Enumerator is preserved.
-1
Q: Is it possible to implement an infinite IEnumerable without using yield with only C# code?

sinelawMotivation The main idea is to explore and understand the limits of how far one can go with the basic LINQ primitives (Select, SelectMany, Concat, etc.). These primitives can all be considered functional operations on a theoretical sequence type. Taking examples from Haskell: Select 'lifts' a ...

Yeah, sometimes it takes me awhile to catch up.
 
7:25 PM
@GlenH7 expressions may very well be the answer. Worth looking at both though.
@RobertHarvey I understand yield return well enough. Ask yourself -> what does a lazy iterator function return ? What is the calling function getting for calling it?
 
user41796
@JimmyHoffa I'm struggling with finding alternative solutions because I'm looking at it in a procedural way. There may be some elegant approach that folds the data all over itself, but my feeble brain doesn't see it.
 
@JimmyHoffa Another sequence, presumably. Did you see the post I linked above?
 
@GlenH7 ? I'm not talking about elegance. Both approaches you mention would be procedural, it's just a question of whether you're building meta-code with an expression that you later compile, or using the dynamic to dictate what the DLR should JIT into real code later allowing you to delay type-checking until run-time.
@RobertHarvey Nope
@RobertHarvey It returns a computation
 
Well, another IEnumerable, right?
 
7:28 PM
A first-class function?
Or maybe you're even talking about some uber form of continuation-passing.
 
not a list, or values from a list or anything like that, it returns a definition of how to get an IEnumerable. That's how the functions are re-entrant, it's just a definition of something to execute that you can step into and out of and still have the definition (though each iteration through that definition changes the definition of the computation you're looking at)
 
So GetEnumerator() then?
 
@RobertHarvey a first-class function is a good way to think about it, though the implementation of a first-class function in C# is distinctly different under the covers a first-class function is a pointer to a normal function compiled into the assembly by C#'s sugar expander, where a lazy iterator function creates a new computation on the heap for each call rather than just having a single fixed function it's pointing at like first-class functions
 
The computation changes with each call to GetNext? Well, I guess it would, if it was recursive.
Servy's right. I don't see how you reasonably get TCO with that.
 
@RobertHarvey it does because it's changing the computation to point at a new place in the enumerable it's iterating and yield returning
 
user41796
7:37 PM
@RobertHarvey Apparently, Servy is supposed to read a book on Linq though.
 
@GlenH7 ?
 
Eh, you can read books on Linq without understanding what it does under the covers.
 
user41796
@Servy You might want to read a book on LINQ. — ta.speot.is Nov 7 '13 at 22:16
 
Jon Skeet once wrote a re-implementation of Linq in C#. That's what you want to study, if you want to understand Linq deeply.
@GlenH7 It's been almost a year. Maybe he read his Linq book already.
 
@RobertHarvey that's easy, it's one of the first things people do learning Haskell
Linq is very little code
 
7:40 PM
Learn You A Haskell says "reimplement linq" in Chapter 1?
 
@RobertHarvey one of the earliest things you learn in Haskell is how to implement Select, Where, etc. Like I said, they're very small and simple
public static IEnumerable<U> Select<T, U>(this IEnumerable<T> target, Func<T, U> f) { foreach(var item in target) yield return f(item); }
 
That doesn't look like Haskell. :)
 
public static IEnumerable<U> SelectMany<T, U>(this IEnumerable<T> target, Func<T, IEnumerable<U>> f) { foreach(var item in target) foreach(var nestedItem in f(item)) yield return nestedItem; }
@RobertHarvey The haskell is simpler, but semantically identical.
 
0
Q: Is it just me or are there very few ASP.NET freelancers? Is there a industry/market based reason?

public staticFrom my online research I don't see many freelance ASP.NET/C# developers out there. First off, is my assertion correct or am I just looking in the wrong places? I want to get into freelancing myself, but wherever I look I only see positions for php/ruby/python/java and little or no gigs for A...

can we get a 5th?
 
psr
8:03 PM
@JimmyHoffa I've even written them in MUMPS. Though without closures they suck.
 
@psr no doubt..
 
psr
@JimmyHoffa You can manually stuff the variables into the expression, but it still sucks.
@JimmyHoffa Someone apparently recently wrote a module to allow node.js to call the Cache storage engine directly (or call MUMPS code). So you can access persistent, journaled, transactional storage of, basically, Dictionary<List<String,String>,<String>> from JavaScript. Hopefully some MUMPS projects use this to switch to JavaScript.
Not really List<String,String>, more a tuple of any number of strings. .NET type system doesn't have that though.
 
@psr hah awesome!
 
psr
8:19 PM
@JimmyHoffa Not sure if this is available elsewhere - sounds Mongo-ish (I'm ignorant of Mongo). LINQ would work very well with this and not have to be transformed into SQL, but I'm not sure .NET is supported as Node.js is.
 
@psr List<List<string>>
Dictionary<List<String,String>,<String>> doesn't make much sense.
 
psr
@RobertHarvey Really tuples. Dictionary<Tuple<String>*,<String>, if that were a thing.
* meaning 0 or more
 
But why would the key be an object (of any kind)?
Or did you just get those reversed?
Then it's Dictionary<string, list<string>>
 
@psr there's actually been a lot of movement to try and interop these two in both directions...
 
psr
@RobertHarvey It isn't really the .NET type system. So you could have MyDictionaryishThing("Cat","Dog","Frog")="Bat" and MyDictionaryishThing("Llama")="Squid"
 
8:21 PM
apparently MS is buying into Node.JS as something to try and tool developers for. I heard newer Visual Studio even supports it directly...
 
8:42 PM
@JimmyHoffa that settles it then: Node is terrible.
2
 
9:25 PM
@JimmyHoffa: Question for you.
Actually, I think I'll ask it on Stack Overflow.
 
I really am surprised at hearing you guys dislike JavaScript, here I thought most people had changed their tune outside of the enterprise patterns folks. Perhaps I've overestimated people's ability to overlook a community for the language
or just how much that community is influencing things
@RobertHarvey shoot
 
Well when all the references you try and use are a rats nest of code and html it leaves a sour taste in your mouth
 
In Paul Graham's article "Revenge of the Nerds, he writes "As an illustration of what I mean about the relative power of programming languages, consider the following problem. We want to write a function that generates accumulators-- a function that takes a number n, and returns a function that takes another number i and returns n incremented by i."
 
@Ampt perhaps you guys just haven't written enough of it to see it can be written nicely even though much of the community doesn't know how
 
In Common Lisp this would be

(defun foo (n)
  (lambda (i) (incf n i)))
In Javascript, it would be
function foo(n) {
  return function (i) {
           return n += i } }
What would it look like in C#?
 
9:29 PM
@JimmyHoffa I know it can be written nicely, but I also highly value leveraging external libraries to help me. When every single one of those libraries has a god-awful structure, it makes me not want to use it.
 
@RobertHarvey Func<int, int> Foo(int n) { return i => n += 1; }
 
It's like Matlab code. I know it's really cool and powerful, and that it's actually useful, but if that was the only programming language I could use, I'd buy a tractor and start a farm because everyone who uses it makes an absolute mess of it
 
That's not too bad. I think I was making it too complicated.
 
@Ampt a large amount but not everybody, jQuery isn't a mess, moment.js has almost become a defactor standard around JS like JodaTime is in Java, underscore is awesome...
 
I think it's just the fact that a ton of non-technical users picked it up and became JS gurus, so now the average quality of code over the language is somewhere between a steaming pile of... and a cold one.
 
9:32 PM
@RobertHarvey that's off the top of my head, it may need a type hint to make the return know i is an int, the return type can hint it's coercion but C# doesn't use a lot of the type hints it has like that
 
I think you increment by i, yes?
 
@RobertHarvey oh right
1, i, they look almost the same...
 
Func<int, int> Foo(int n) { return i => n += i; }
 
...and in haskell it would be foo n = \i -> n + i
 
@JimmyHoffa asked no-one, ever.
;)
 
9:34 PM
@Ampt I know, what a useless function...
 
Doesn't look right. Where is i parameterized?
 
@RobertHarvey ? parameterized?
 
Shouldn't it be something like
 
@RobertHarvey Describe the resulting value of this statement: i => n += i
 
Func<int, int> Foo(int n, int i) { return i => n += i; }
 
9:35 PM
...stupid 1... I did it again...
 
a function i such that n + i is returned.
Oh, wait. i is a parameter.
 
@RobertHarvey :)
 
I don't write nearly enough lambda expressions to grok this well.
So i => n+= i is equivalent to function (i) { return n += i } in Javascript.
 
@RobertHarvey I'll tell you the same thing I've been trying to drill into one of my colleagues head for a while: everytime you see a => read it as (list of parameters to function) => {body of function}
@RobertHarvey yes
 
OK.
This is cool.
 
9:38 PM
just think of the operator as function params on the left, function body on the right
 
That's easy enough to remember.
And i => n += i is of type Func<int, int>, yes?
 
@RobertHarvey not explicitly
 
But you can return that to a Func<int, int>?
 
the compiler can use the return type of the function above it to infer what type it should be, without that type hint available you would have to manually declare it as new Func<int, int>(i => n += i)
 
Ah, OK.
So is a function that returns an accumulator function useful at all? Or is it just a contrivance for illustration purposes?
 
user20683
9:45 PM
@RobertHarvey counter IIRC
 
i like when a question asker asks a question
accepts an answer virtually immediately
then a different answer with the opposite response has significantly more upvotes
 
@RobertHarvey common illustration, totally useless
 
user20683
@whatsisname common symptom of a help vampire
 
psr
9:50 PM
@JimmyHoffa I recall that the first time you tried underscore you harrumphed that it didn't really do anything worth bothering about so you might as well roll your own as needed. Then I noticed your sample code had an underscore in it. Now this.
 
@psr backbone
Backbone doesn't seem to do shit
(when I used backbone, I did use Underscore templates with it as that's what it suggests to use for integrating templates with it)
Underscore is attempting to be LINQ for JavaScript or the Haskell Prelude rather
 
psr
@JimmyHoffa You trashed backbone after you trashed underscore.
 
It's a quality FP library
 
user20683
most JS frameworks seem to be ways of introducing and managing JS for people from other programming languages that can't wrap their head around what JS actually does/is
 
@psr maybe I was complaining about underscore's templates? They weren't preferable... but underscore used as just a linq replacement because I can never remember which linq functions are supported in JavaScript or not...
 
9:53 PM
@WorldEngineer Most users of JS frameworks seem to use them as a crutch for avoiding writing Javascript. jQuery might be achievable in raw Javascript, but the facilities that it provides are pretty nice.
 
underscore gives me map, filter, fold, bind, tail, head, init - normal haskell stuff. Other than that it's kind of silly.
 
Is there more to Underscore than just the FP functions?
 
I mean how they fit a template library together with a library that just exists to give some FP primitives doesn't make sense
 
underscore < lowdash
also, its used for templating HTML code
 
@Ampt yeah, the whole underscore vs lodash and jquery vs zepto stuff is for webmasters
 
9:55 PM
@JimmyHoffa nah, lodash is literally a fork of underscore that is better
 
I ignore all that... it's probably relevant but it seems like it's just about what heuristics various browsers support
 
user20683
jQuery vs Dojo as well to some degree
 
@Ampt I thought it was just underscore with a few different implementations for different browsers, but identical API
but I haven't looked closely...
 
@JimmyHoffa API is identical, but yeah implementation of a lot of bugfixs and safety problems
at one point they were the same but I guess they didn't get along on the dev team
 
@Ampt yeah, I think Zepto is supposed to be the same but I understand jQuery is supported by more browsers than Zepto, and similarly Underscore has better support than lodash
 
9:58 PM
lodash has better support. it's actually got a drop-n-go version to replace underscore
 
maybe?
@Ampt ah cool
will remember that if I ever go reaching for underscore in any JavaScript
 
or if you want a slightly extended API you can get the regular version, but I think you may have to make some slight changes going from underscore->lodash
yeah, I did a lot of digging
 
<This comment has been closed as off-topic>
 
@Ampt I'm not familiar with "train seat"... is that another JS library?
 
10:00 PM
@MattGiltaji yes. Allows you to park your ass-ets and then use them an hour later when they've reached their main server
 
user20683
@Ampt I hear it has some serialization problems that can cause browsers to freeze
 
user20683
For that, I recommend getOnUp.js
 
@WorldEngineer yeah, they can also experience throttling due to larger packets in network
@WorldEngineer yeah, I'm just waiting for my Stop.html to load then I'll go ahead and implement getOnUp.js
also, I'm attempting to serve up a backbone app from django, am I nuts?
 
user20683
@Ampt I've seen people go Angular with django, so probably not?
 
@WorldEngineer k good.
just wanted to check
I figured "How could I possibly make learning backbone harder?", and I said why not implement it in django!
 
user20683
10:05 PM
@Ampt a project I contemplated: apl.js
 
user20683
call it "Apple JAX" and use it to eat vectors for breakfast
 
@Ampt I would encourage as your first getting around a JavaScript library to just edit some local static HTML/JS files and don't mix a server-side in until you've got a solid concept around what you're going to put together
 
@JimmyHoffa but I want it all!
 
user20683
@Ampt then go use PHP
 
that's how I approach JS stuff anyway - start client-only and add the server when I'm certain how I'm doing it all
 
10:07 PM
@JimmyHoffa I did actually start with just JS, then I got to persistance of data and needed a back end
 
@Ampt because divide and conquer is nothing compare to just conquer!
 
@Ampt cmon, just use html5 client storage
 
@Ampt stub your back-end and use localStorage in the browser
 
@JimmyHoffa It's Come, See, Conquer. No dividing needed.
 
you'll be glad - later on you'll use the stub for testing easily
plus browser local storage is stupid easy to use
@Ampt you actually working on a real project 'n shit? and it's a front-end JavaScripty thing?
 
10:09 PM
@JimmyHoffa no, not real project lol
well
I'm not necessarily getting paid to get it done
I am getting paid to do it
 
Nice
 
user20683
@Ampt so you're a consultant now?
 
@JimmyHoffa good old bench-time training
 
10:31 PM
 
psr
@RobertHarvey Religious banking competition leader-board?
 
kiva.org - Micro loans
 
psr
@RobertHarvey To be fair the challenge is basically moving pasta around the world. That's going to play to a Flying Spaghetti Monster's strengths.
2
 
At least something good comes out of it.
 
10:58 PM
Wait is that amount loaned from who/what?
Oh Kiva
Is that flying spaghetti thing a real thing?
 
It's a thing, if that's what you mean.
It's a satire on religion. Demonstrating absurdity by being absurd.
 
80
Pastafarianism

Proposed Q&A site for anyone with questions about the Flying Spaghetti Monster or the religion based around him.

Currently in definition.

> Is eating pasta equivalent to transubstantiation?
> Good question. Ever since converting to Pastafarianism, I've felt a bit uneasy about eating pasta. – Zephyrus
lol
 
Mmm... Yeah. Their only redeeming quality is that spaghetti tastes good.
Well, with a good sauce anyway. I think they mix a whole lot of bullshit into their sauce.
 
I ate spaghetti today
but it tasted terrible because I just put tomato sauce from a can
lol, I'm going to use it in the future
> I used jQuery diet plugin and lost 10kg in a week - jfatty
 
Next time try the pre-seasoned italian-style tomato sauce in a can. It's not as good as regular spaghetti sauce, but there's far less WTF. Add a bit of salt and pepper.
 
11:08 PM
I used to buy Italian-style tomato sauce but it kept molding (? had grey spots)
 
You have to keep it in the refrigerator. :)
 
I did
 
Even then, it only lasts a few weeks.
 
Maybe my fridge isn't cold enough
 
I think the bottled spaghetti sauces have a little bit of preservative.
 
11:10 PM
Oh that might be it then^
 
Fridge should be kept just above freezing.
 
it was bottled
 
user20683
@RobertHarvey ascorbic acid or some such typically
 
Vitamin C?
 
psr
Hey, take the discussion to the Pastafarianism chat.
 
user20683
11:10 PM
@RobertHarvey yep
 
lol
 
if you add some herbs and sauteed garlic, you can make canned sauce taste pretty nice
 
I set my fridge so that it started freezing stuff, and then backed off a little.
 
Too much work^^
It's the Pastafarianism effect... Got productive programmers to talk about spaghetti
 
user15026
11:14 PM
Now I kinda want pasta for dinner but I don't even have canned spaghetti sauce :P
 
@AshleyNunn i'm super hungry right now... :(
 
Blah, I ate today at 3
 
lol vodka
 
Don't laugh, it's good.
 
11:16 PM
half a cup of butter and 1 cup of cream... that will make anything taste good, lol
 
user20683
@MattGiltaji Chinese food?
 
user15026
@MattGiltaji I am hungry in that "I need to eat as I am a human and thus obligated" but not in the "I desire food because it will be tasty" way
 
user15026
@RobertHarvey mmmmmmmmmmmm
 
Don't own vodka or cream
so no sauce for me
 
Oh, ffs.
281
Q: Round to at most 2 decimal places in JavaScript

stinkycheesemanI'd like to round up to 2 decimal places, but only if necessary. Input: 10 1.7777777 9.1 Output: 10 1.78 9.1 How can I do this in JavaScript?

350
A: Round to at most 2 decimal places in JavaScript

ustasbUse Math.round(num * 100) / 100

 
11:18 PM
lol so many upvotes
 
Needs more jQuery.
 
user55340
Because its a good site: Cooking For Engineers
 
I like how all the old questions in SO
all have a gazillion upvotes
lol we both removed it
 
@MichaelT Is that a good site because it requires the precision of an Engineer, or because Engineers don't have a lot of time, or ...?
 
@RobertHarvey here is a choice morsel
> Roasting the asparagus until it just changes color from a medium green to a dark green will result in tender but still somewhat crisp texture. Continuing to roast until some light browning appears will provide a mushy and somewhat limp texture with a heightened flavor. Continuing to roast will dehydrate the asparagus and result in a fibrous mass in the shape of blackened asparagus.
 
user55340
11:21 PM
@RobertHarvey layout and thought process.
 
user15026
@MichaelT Well, except for them putting egg yolks in a buttercream....
 
user15026
(I suspect they are going for swiss/italian style or something but like aaaaaa)
 
user55340
 
user15026
I was expecting an American buttercream (butter, cream, enough icing sugar to rot your face)
 
Honestly that's the best way to present it
 
user55340
11:22 PM
There is also a step by step 'this is what it looks like' in the page above that can be useful for people who aren't exactly aware of what it should look like
 
Cooking with a Gantt chart.
 
Yeah that's pretty cool actually
 
this site is awesome
 
user55340
The sauce is critical path! It must be done first! Reassign people and adjust priorities to make sure the sauce is done on time!
 
If it works anything like software development, we're doomed.
 
user55340
11:25 PM
@RobertHarvey fortunately, most things work better than software development... cooking has had a few millennia to get done right.
 
user55340
Ha!
 
user55340
 
I do like the block diagram.
 
user55340
@RobertHarvey did you notice the last ingredient in that one?
 
11:29 PM
:)
Not critical path. Or maybe yes.
 
user55340
If you read it... it is used to deglaze the pan and add that flavor back to the sauce itself.
 
user55340
> Note the brown bottom on the stainless steel pan when you are finished cooking the meat and vegetables. This is pure flavor!

The beer will be used to deglaze the pan, and add this concentrated flavor to the chili.
 
Yeah, deglazing is a neat trick. I normally just use it to clean the pan.
Cooking is one of those hobbies that I'd be better at if I had more time.
 
user55340
I used to do much more cooking when I was in Cali... had the whole 'american flavored stir fry' fairly well done... I'd do it more here (and especially now) though I'm trying to keep my expenses well under control. Food is rarely portioned for one person.
 
user55340
Buying meat for example... ok, this is two meals for a family of 4... or two weeks worth for me if I eat it every night.
 
user15026
11:33 PM
@MichaelT I know that feel. I cooked a whole chicken this week and I have eaten it ever since and i will still have a bunch to freeze
 
user15026
Man, I want a milkshake but it is approaching too late to theoretically get one....
 
user55340
So you then get to either very small portions ($$), or lots of reformulating leftovers.
 
user55340
Go to grocery store, get one onion, one pepper, etc...
 
user55340
Grocery store in Cali was aware that a significant portion of their clientele was single person households... so they had things like "here is 1/4 lb of stir fry cut beef" or "4x 1/8 lb cut of chicken strips" as fresh meat which worked well.
 
user15026
@MichaelT I find that is usually way more expensive than bulk buying though
 
user55340
11:40 PM
@AshleyNunn the prices for meat was per pound... so if you got 4 lbs of beef or 1/2, it was the same per price rate.
 
user15026
@MichaelT oooooh okay...most places here charge a premium for stuff like that, and then there is reguilar price meat, and then there is cheaper bulk meat
 
user55340
Hmm...
 
user55340
146
Stack Overflow Academy

Proposed Q&A site for programmers who want to learn how to ask good questions on Stack Overflow

Closed before being launched.

 
... But Pastafarianism made the grade (so far).
No conversation about cooking would be complete without...
 
user55340
@RobertHarvey its not a dup of... MSO apparently.
 
user15026
11:50 PM
@RobertHarvey Oh dear god
 
user15026
What did I just.
 
wow Epic Meal time is still a thing huh
 
00:00 - 19:0019:00 - 00:00

« first day (1441 days earlier)      last day (3563 days later) »