« first day (1353 days earlier)      last day (3820 days later) » 

10:00
Lazy evaluation FTW
Lazy reading from files = super-awesome
@JanDvorak I'm lazy, so win-win
@JanDvorak you mean basically - what most languages do :D?
I mean, most modern languages read lazily from files, and have a notion of lazy streams of data.
That's just an iterator
In haskell, you can treat a lazy stream as an ordinary string. Split it by spaces, reverse the pieces, discard every other...
Yeah, just like in Python, or C#
also, infinite lists are nice. Can you map over a generator in most languages?
10:04
Of course, it's very fundamental
IENumerable<int> CoolNums(){
    for(var i = 0; true; i+=1337) yield i;
}
CoolNums.Select(x => x / 1337).Take(1000); // lazy sequence over first 1000 nums
List comprehensions over infinite lists?
In python, that's generator comprehensions over infinite lists , in .NET that's LINQ
nice.
can you fold infinite lists in python?
how does it look like?
10:09
You (generally) call fold reduce in Python, and Aggregate in C#, although since both come with most of the common ones they're rarely used.
I will definitely look more into python, then. Thanks.
C#'s is much more powerful than Python's though, and is more similar to Haskell's
(Not surprising given the people involved in both languages)
I don't want to pay for a compiler
Why would you pay for a compiler?
@BenjaminGruenbaum it'll only be in September anyway
10:12
ok, cool
@JanDvorak you do realize that since Microsoft changed CEOs everything they do (like asp.net and the new C# compiler, and most of their libraries) are open source right?
Python has libraries that let you handle arrays and matrices lazily (numpy I think it's called)
But they aren't built-in
@BenjaminGruenbaum TIL. Sorry.
@Neil I can do with hashes with callbacks
A monad is not a callback :D
@BenjaminGruenbaum Because "money bags" Microsoft wasn't getting any success tieing everything with Microsoft products and then requiring you buy their development studio on top of that? Weird.
@BenjaminGruenbaum I meant in imperative languages
10:15
@Neil What's wrong with it?
@JanDvorak Numpy is decent though. Does quite a few nice things for you
I'm trying to understand setTimeout & ran into trouble, I think it is because of using a 'this' reference
@PrateekUdenia Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
They had a business model that worked spectacularly for quite a while, it now starts failing due to reasons, so they change it.
Hash.new {|h,x| h[x] = compute x} -- Ruby
10:16
this is the code for it codetidy.com/4617
That's exactly what I would expect from them.
I'm not sure why people (especially programmers) expect everything to be free.
@Neil actually, they were very successful, but they realized that they missed the mobile leap - so they're focusing their efforts on devices and cloud now where you don't pay for software but for devices and services.
what am I doing wrong here, using this with setTimout?
@PrateekUdenia use Function#bind
So, now you get C# for free, but they offer the best hosting for C# web apps and cloud services and you pay them for that.
10:17
when you move a function somewhere, the original this no longer applies
@PrateekUdenia option #2: define every function in the constructor, and do var self = this
@jan-dvorak Thanks, I'll try that. jS function/varianle scope is something I'm trying to understand. Just began!
@SecondRikudo I don't have anything against Microsoft, though they've done an awful PR job
Google hides it a lot better
option #3 if blossom doesn't change: setTimeout(function(){blossom.meow()})
It is kind of difficult for Microsoft to put on a "We care" face when they're very rigid about making their software work with only Microsoft products
10:32
@Neil In many senses, Google is much more evil than M$
Google takes your data, tracks you better than the NSA could have dreamed of, shows you ads
@SecondRikudo Yep. I suppose people like Google more because Google is "free"
Microsoft is still approaching the software world like IBM. You want software that works? You pay for it.
Google is the new trend
@Neil Yeah, You want software that works? Gimme all your most juicy life details
Facebook takes the best of both worlds. You divulge your entire life story and you dump your cash at them.
iz someone comparing websites?
well, lets put SO in the battle then
@SecondRikudo I don't think the trend will be going anywhere anytime soon
10:41
0
Q: How can I express the initial processes by Bacon.js in place of Promise?

JapboyI alway do something like this for initial processes: $.when(dom(), webrtc(), websocket('wss://example.com/'), sleep(3000)).then(load, fail); dom, webrtc, websocket, and sleep are Promise objects. This expression is useful to load some parallel processes for initiation. Now I am wondering how...

btw, can you tell me how long would it take me to learn node after I am done with client side js?
@AwalGarg Not that long
Oh dear.. there's a not equals in Haskell 5 /= 5
It's a bit of a different way of thinking, but I got it up and running after about a week
@SecondRikudo that?
@SecondRikudo how much js did you knew prior to starting with node?
10:42
@Neil yeah... bangs only came into popularity much later
for most applications, there is nothing to node other than copypasting some express
express.js you mean? its a framework, isn't it?
@AwalGarg yes it is and the best advice I would give regarding express is not copy-pasting blog codes nor blindly importing modules : they're almost all lame and obsolete. Don't copy paste code you don't really understand
@AwalGarg Enough to not need jQuery at all on any project.
@dystroy hi there... ok sure. I will take care of that
10:48
@dystroy in a perfect world :P
@SecondRikudo hmm, I am too not learning jQuery or any other framework. just native js. would that do?
ok, I did not practice js code this weekend. having a very subtle issue trying to remember things. is that normal? never happened with php/c++, thats why I am asking.
@AwalGarg What's the point in 'learning' if you aren't remembering it?
I don't remember half of what I learn :D
not that I can't do js code now, but I have to spend a minute to retrieve names of some functions every now and then from my memory..
@BenjaminGruenbaum me2, sometimes.
JS doesn't have a big human memory footprint, I think
10:55
haha, lol
maybe its just because I am new to js. but, I think I would now avoid skipping codecademy for more than a day.
Just checking : are you at least writing your own programs when learning ?
H
hello
@dystroy I wrote a parking lot charges calculator the other day... previous ones were just random win/lose generators...
Anybody here
Today Learning Jquery is Best for me
!!welcome cyberoot
10:57
@cyberoot Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
@cyberoot some js scientists and me
Yes
Thanks my friend
@Cap
@CapricaSix @AwalGarg how are you
Ok. now i am reading the rules :D
you should leave the hope that beautiful Caprica would reply...
Yes. bro .
@rlemon if you're here right now, maybe you can be of help ^
10:59
@cyberoot so how's living in a dictatorship? (At least that's what Wikipedia says Myanmar is)
haha, I can't stop laughing man
hee hee I from myanmar
I know, I can tell from your profile
If I don't close my browser now, I will die of laughing
bye
Yes. :D is not nice country?
ya ya my friend bye @AwalGarg
another setTimeout issue, it's being more of a mystery now
this code does not wait for the milliseconds clearly passed to it!

code: http://codetidy.com/4619/
@cyberoot I'm asking you
cycle "LOL "
@PrateekUdenia are you sure? 100 ms isn't that much.
@PrateekUdenia works for me
11:07
0
Q: Using a string as an object member name in Javascript

Samik SenguptaSay I have an object structure like this- function Nature(_xid, _name){ this.xID = _xid; this.name = _name; } I create an instance of it... var nat = new Nature(0, "Nature A"); I am trying to use a string to substitute the object member of any Nature object, like this- var str = "...

^^
0
Q: Rewrite code using promises

Sachin KainthI have the following code that causes the two call to Webtrends to be cancelled (ie these two calls did not give a http 200 but a cancelled message in the network tab of the browser) when I call it mercury.Tracking.logUsage("export", GetSelectedExportType(form)); mercury....

Shouldn't this be on code review? stackoverflow.com/questions/24488720/…
@IanClark for me it's ok because OP doesn't want his code to be reviewed but wants to know the proper promise based solution (and I'm too lazy to answer)
@IanClark it could fit there
fizzBuzz n = [if x `mod` 5 == 0 and x `mod` 3 == 0 then "FizzBuzz" else "x" | x <- n]
What's wrong with this? :(
11:13
@Neil you're never returning "Fizz" or "Buzz", and you also probably meant show x instead of "x"
Your useless answer prevents the removal of the question. Can you please delete it ? — dystroy 7 secs ago
@Neil also, using the first element of an array in order to generate the first element of that array won't work.
@JanDvorak I tried it with 1000 milliseconds interval also, the time-interval between consecutive outputs dosen't increase, it stays constant
@Ja
@PrateekUdenia can't reproduce; fiddle?
@JanDvorak I don't understand.. the example they provided was boomBangs xs = [ if x < 10 then "BOOM!" else "BANG!" | x <- xs, odd x]
11:14
@JanDvorak Sure, Gimme a moment
I figured I couldn't add x, a number, to a list of strings, so I said "x", at least for now
@Neil link? This leads to infinite recursion
Ah, doesn't work with that example either
x <- [1..]
xs is the parameter to the function
11:16
oh. That should work.
In my case it is n
misread as xs = ...
This has to be simple but I cant seem to fix it. Why is this code unable to find the function myFunc() ?? jsfiddle.net/rdesai/fsWG5
Well neither work in the latest ghc compiler
@Neil x <- sth expects sth to be a list
11:17
!!afk lunch
fizzBuzz [1..100]
What am I doing wrong here?
@JAnDvorak Here's the fiddle with 1 second timeout! jsfiddle.net/ZcLMU
@PrateekUdenia increments the document in one-second intervals for me
@JanDvorak that's the thing, shouldn't the "i" value that is passed as time-interval increase like 1,2,3,4.. seconds
11:26
it does
do you want increasing gaps?
setTimeout starts at the time it is issued, not at when the previous one resolves
@RahulDesai inline onclick is bad
but the problem, is that the script is loaded after the html
so your button is parsed before your function is defined
document.querySelector('#update').addEventListener('click', myFunc);
@Mosho I got it fixed, I used onclick in JS jsfiddle.net/rdesai/fsWG5/2
same crap
yepp
@Mosho I am having an issue with the same fiddle (jsfiddle.net/rdesai/fsWG5/2) if you click update at the bottom of the chart, the graph updates but the interactive big circle onmouseover is not there, its there onload
Anyone with Jquery UI Drag Drop experience?
11:37
@JanDvorak Yeah, I want increasing gaps. So isn't a separate setTimeout issued each time with plus 1000 miliseconds right now?
While I am dropping a draggable it attains a style and moves it absolutely positions
@PrateekUdenia they all start at the same time
issue one from another
0
Q: Grace period for answering after closing & obvious duplicates

dystroyThis question is a duplicate that any JS coder saw at least a few times. I saw it and I closed it as duplicate. But another user later, due to the grace period, could write and submit an answer. I find this situation sad. Why would we vote to close as duplicate if some users can come later and ...

Please have a look at that
    d3.select('#' + container + ' svg')
    .text('')
    .datum(data)
    .transition().duration(500).call(chart);
11:48
guess rewriting it without clearing the svg element confuses it somehow
@Mosho yayy
hello guys I am trying to select an Id from external plaugin of AddThis.com can you help me out please
http://stackoverflow.com/questions/24488748/how-to-catch-an-id-of-external-plugin-from-addthis-com-in-jquery-mobile-website
@Mosho so, I see .text('') is clearing the SVG, right?
yeah
Who's this RUJordan who wants to stop all the fun we have in this fantastic JavaScript Room ?
11:54
an ironic man
Oh, ok. make sens now
comic sens
12:08
@JanDvorak Ok, but I'm not running the function, just defining it
Can I not define fizzBuzz and then pass in [1..100]?
!!afk
@Neil you can
Then I fail to see what's wrong still
@Mosho Doges > Dogs > Cats
Why does boomBangs xs = [ if x < 10 then "BOOM!" else "BANG!" | x <- xs, odd x] fail, for starters
parse error on input '='
^ Because it's not valid JS :-P
12:20
@RoelvanUden Cheers, thank you. Brilliant. ;)
12:31
@AbhishekHingnikar it is on my codepen
last time someone wrote something in the Haskell room was 7 days ago
I gotta leave work in like.. *checks watch* 4 hours from now.. doesn't sound statistically probable, huh?
%chance of someone responding in Haskell room with 4 hours * %chance of comment referring to my question * %chance of comment not being a troll = % almost zero
I'm looking at these examples and thinking.. they discover fire and think they're onto something here
13:02
!!nudge 110
@towc Nudge #1 registered.
morning
@towc What does nudge do again?
@SecondRikudo timer
Timer for what? It would ping you when time is up? (Also, 110 what, minutes?)
13:09
!!help nudge
@towc nudge: Register a nudge after an interval. /nudge intervalInMinutes message, /nudge remove id to remove, or the listener, nudge|remind|poke me? in? intervalInMinutes message
yes, it pings you with the message after n minutes, I've left the message blank
!!nudge 2 Ping
@SecondRikudo Nudge #2 registered.
@SecondRikudo nudge Ping
13:13
neato
Morning
13:31
plz help
... to use chrome.runtime.sendMessage and chrome.runtime.onMessage instead which is what I meant with in favor ofdevnull69 18 mins ago
is @benjamin around?
> Unit tests are incredible and great, but you’re always at the mercy of the level of discipline of every engineer at every moment. It’s easy to tell your teammates to write tests for everything, but this basically boils down to asking everyone to be at their very best every day. People make mistakes and things slip through the cracks.

When using Haskell, we actually remove an entire class of defects that we have to write tests for. Thus, the number of tests we have to write is smaller, and thus there are fewer cases we can forget to write tests for.
I'll just leave that here. RFC.
lol wth
apparently I got banned yesterday
@BartekBanachewicz unit testing is not asking your engineers to write tests for everything. It's asking your engineers to write the API before they write the code.
no, that's TDD
Unit Testing and TDD are different things.
oh, I thought that's what you meant
like everybody...
13:40
I never use those terms interchangeably because they mean two completely different things.
what a game!
I got to 1024 once...
@NickDugger lol
@towc now write an algorithm that does that
13:44
@BartekBanachewicz ok, that's a real challenge
user1596138
@Loktar lol wut for
the gregory name
like.... 4 days ago lol
@BartekBanachewicz I have a pretty good AI for you
woops
for some reason when I load angular it stops another global from being run
put this in the console:
13:45
(function supposedToAutoRun(){})()
its crazy someone would go that far back in time but I guess some people are dedicated
window.location.href='http://jhawins.github.io/2048/#0-2=1024,3-2=1024'
//jhawins (c)
anyone heard about Menucool image slider???
user1596138
@RUJordan
user1596138
@Loktar The anal one? lmao
user1596138
13:52
@towc Oh lol. Best cheat code evar
@Jhawins the algorithm for bartek
just happens to fit in a few characters
user1596138
Works from any page
yeah, you can hack 2048 even if there is no 2048 there
user1596138
Course I just edited gameState in localstorage
user1596138
on hashchange
user1596138
13:54
And I typed out the grid's array of nullby hand so it doesn't work to change the grid size lol
A new one...
user1596138
cells = [ // These are the cells, may as well blank them all out. I wanted to use a loop for cleverness but Benjamin complained that that's dumb
			[null, null, null, null],
			[null, null, null, null],
			[null, null, null, null],
			[null, null, null, null]
		];
This question appears to be off-topic because it is about fashion — dystroy 35 secs ago
2
user1596138
You'd be surprised how many times I mention regulars from this room in my code...
user1596138
// @rlemon would stab me for this
user1596138
13:57
$(ele).prop("id"); // Haha @RUJordan style
user1596138
^ Real code
@BartekBanachewicz I'm like... really busy - anything urgent?
@BenjaminGruenbaum nope. The citation below the plink
@BartekBanachewicz hahaha
ha
@Jhawins I guess that whenever you write code that doesn't work you comment:

//surprisingly this code wasn't written by @towc
13:58
That logic is so broken lmao, who wrote this?
@BenjaminGruenbaum I guess you don't agree with that
Seriously, that's not where Haskell is strong at all
@BenjaminGruenbaum irrelevant. I wonder why do you think it's broken.

« first day (1353 days earlier)      last day (3820 days later) »