« first day (1051 days earlier)      last day (3895 days later) » 

m59
7:00 AM
to avoid the word "object", a namespace is pretty necessary, yes?
 
you can emulate namespaces with naming conventions
 
m59
I'm obsessive. "can" and "best" are very different.
 
if you have never heard of a namespace, how would you do it?
or if you simply do not have the ability to have one
 
m59
var myNameSpace = myNameSpace || {};
 
no, that's still a namespace
think completely outside of javascript
 
m59
7:02 AM
oops that's not even the best actually.
 
@phenomnomnominal naming conventions
 
@JanDvorak let him work it out himself!
 
ok...
 
@m59 come up with a completely different asnwer?
 
m59
all I have is IIFE and return nothing
with is js
so I dunno.
global naming anything someone could use the same name and convention (though it'd like, never happen)
it CAN happen.
 
7:04 AM
yeah which is why you probably wouldn't do that in JS
which means it's lucky you can have a 'namespace'
 
m59
right...
 
but in other languages, no-one else can access your code, so conflicts aren't that big a deal
 
@d3rzKy 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.
 
m59
and a namespace is an object, and objects therefore are best for encapsulation in js.
 
facepalm
 
7:06 AM
not being able to return objects (or even arrays) would be hell, though.
 
and it happens in JS anyways, what about $ vs $
 
m59
lol
like mooTools vs jQuery?
 
sure
or anything else
 
m59
Oh yeah, like I said, that's what the ||
make the most of a worst case scenario
 
var $ = $ || {} isn't going to protect you
 
m59
7:08 AM
not really, no, but it is better than overwriting something altogether, though either way is going down in flames.
 
at the end of the day, what is the difference between $ajax and $.ajax?
or ajax = func (urlStr url, htmlMethod method, postData data)
 
m59
you lost me =D
 
it's all just conventions
 
m59
so, encapsulation = good or maybe?
 
sure it's good, but what if you simply can't use it?
 
m59
7:14 AM
lol then do whatever the next best thing is.
 
Exactly. I'm still not sure what your argument is?
 
m59
You can't expect me not to argue for the things you taught me :)
 
There's nothing to argue
 
m59
My argument is that encapsulation, separation of concerns and code reusability are important.
 
That's like saying, you told me how to use a screwdriver, I refuse to use an electric screwdriver
No one is saying they aren't?
 
m59
7:16 AM
Then all is well!
 
They're just not the only way
 
Heh. Looks like the arbitrary changes my annoying coworker put in weren't quite so arbitrary after all. Just broke quite a bit.
 
The argument I'm hearing is "Encapsulation is important", "OOP has encapsulation", therefore "OOP is the best way to program"
 
m59
in js, you kinda need an object...
at least one.
we just discussed that :(
 
Uh huh?
 
m59
7:18 AM
OOP
objects are nice.
lol
 
"Objects are nice", "javascript has objects", thefore "OOP is the best way to program"?
 
m59
sigh.
 
how about this for encapsulation:
function MyThing (help) {
    this.blah = 'blah';
    this.help = help;
}

MyThing.otherThing = 'hello';
first class functions bitches.
sure it's still an Object
 
m59
I would totally call that OOP.
probably inappropriately, but what else?
 
yeah it is
 
m59
7:20 AM
and that's a mega ton better off than what most people do.
heck, I use that =D
rarely, but it has some niceness.
doh, yeah you taught me to do that now that I think of it.
 
but what are you really encapsulating?
and why do you even care about it in JavaScript?
 
m59
to me that's more for the sake of clarity/separation
 
normally to prevent poluting the global scope
 
m59
I think of it way more in depth than that.
I think it's a way to show intent
like...
 
Snippets like that one make me think js is either the best language ever... or the worst.
It's really a love-hate relationship.
 
m59
7:27 AM
var stuffIDo = (function() {
  var stuffIDo = {
    breathe: function() {
      inhale();
      exhale();
    },
    eat: function() {
      getChips();
      putInMouth();
    }
  };
  function inhale() {

  }
  function exhale() {

  }
  //etc
  return stuffIDo;
}());
To me, that isn't as much about avoiding a clash as it is showing the code's intent.
 
yeah of course, but all of them just make side effects
consider something like this
 
m59
I intend to use this stuffIDo.breathe();
and I think it's immediately clear that inhale, exhale are just little pieces for breathe to use.
 
actually can't be fucked wriiting it out
 
m59
lol I gotta sleep.
 
yeah fair enough
 
m59
7:31 AM
I'll look at some stuff about this functional business.
I'm sure you're right. I just want to know why :)
 
Because "only sith deal in absolutes".
 
m59
stab
 
(Wow. Two movie references in an hour. I think I need sleep too)
 
m59
haha, lovely conversation, gents. Night!
 
7:52 AM
@OctavianDamiean What's "Mother's Office"? Can't find any reference to a show or movie of that sort.
 
@CanerÖncü 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.
 
Seems like you've put a lot of effort in it, +1 good sir.
 
@BadgerGirl You asked for some R stuff: blog.echen.me/2012/01/17/quick-introduction-to-ggplot2
 
user1125394
8:45 AM
how would you call a family of multiple similar sites like Stack Exchange platform?
 
user1125394
family sounds not right
 
Network?
 
user1125394
as 'social' network? hmm maybe
 
9:02 AM
No, as a network of websites.
 
user1125394
I see, network in its primaly sense, but also it's strongly connotated to the osi layer, 'group' can maybe fit also
 
@Zirak Thanks.
I'm so drunk
 
user1125394
o yu're right, it's ok, (it's for describing 3 financial sites, built a same company)
 
this is true?
Objects.prototype.CustomPositioning = function (strElementId) {
    throw new Error("Call to unimplemented Abstract method.");
};
var objects = new Objects(strElementId);
objects.CustomPositioning = function (strElementId) {
    // Some codes...
}
 
@cc The official way to call it is network, that's also how they call themselves.
What in the fuck? Sometimes I think I'm surrounded by complete imbeciles ...
Even though this question has been asked more recently
14
Q: Calling literal function JavaScript

brad civenI'm trying to call literal functions but i get a weird behavior. Consider this code: 23 === (23) above code returns true. when i write try this code: (23).toFixed(2) I get this expected result: "23.00" But when i try 23.toFixed(2) I get this error: SyntaxError: Unexpected token I...

than this one
11
Q: Usage of toString in JavaScript

Bob RalianI'm reading through Douglas Crockford's JavaScript: The Good Parts, and I'm at the point where he defines a fade function. Part of this code boils down to this: var level = 1; var hex = level.toString(16); So I run this in my browser's console to see what I get.... var level = 1; level.toStri...

The answers are by far better than on the one that's been marked as the original question for the dupe close.
 
user1125394
9:20 AM
haven't we told you twice Object has no s
 
I feel like the close queue thing has a negative effect on the quality of SO.
Anyway, people with enough reputation, please reopen this question, cheers.
14
Q: Calling literal function JavaScript

brad civenI'm trying to call literal functions but i get a weird behavior. Consider this code: 23 === (23) above code returns true. when i write try this code: (23).toFixed(2) I get this expected result: "23.00" But when i try 23.toFixed(2) I get this error: SyntaxError: Unexpected token I...

 
user1125394
23 hours ago, by Pinocchio
@MRS1367 It's Object not Objects?
 
ok @cc ;)
 
@BadgerGirl Then this is a good time to inform you that I've adopted @SomeGuy.
 
YOU PROMISED NOT TO TELL!
 
9:30 AM
Maybe I'm drunk too. Drunk on loooooove. To...marshmallows.
They should be called "marshmellows", because they make you mellow.
 
@Zirak wait what? I'm eating marshmallows right now!
 
heh, awesome, I'm the underdog in that question.
 
Yea, and you kicked Greg's ass.
 
A fun one :
@dystroy, some elements have many classes I'm trying to "get" only the ones starting with "small". Is it wrong way? — Rikard 10 mins ago
 
9:40 AM
That might be the first time I see in JavaScript the ^= operator. Just after its use in a jQuery selector, it's a little disturbing...
 
I love Amsterdam
 
@mariovass 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.
 
@BenjaminGruenbaum for the red district of for the Rechs Museum ?
 
hi guys having a little problem with jquery animate here my code please help :( codepen.io/mariovass/pen/ezLwf
 
@dystroy The Van Gogh actually
Wow that tool so... long to type
 
9:50 AM
@mariovass, try to drop ".navButton:active {..}"
 
Alright, and now the other way around, let's close this as a dupe of the reopened one.
11
Q: Usage of toString in JavaScript

Bob RalianI'm reading through Douglas Crockford's JavaScript: The Good Parts, and I'm at the point where he defines a fade function. Part of this code boils down to this: var level = 1; var hex = level.toString(16); So I run this in my browser's console to see what I get.... var level = 1; level.toStri...

Now, this makes sense.
 
@Ut
@utopik my js is crap could you help out and let me know where i should add that
 
@BobRalian Actually numbers are not objects - they're primitive value types - they're just readily boxed to Number objects — Benjamin Gruenbaum 1 min ago
 
The title and some especially this sentence needs some improvement.
> I'm wondering how JavaScript evaluates expressions that cannot understand this and why I get this error.
 
I should stop leaving these comments... it sounds like an asshole law
 
9:55 AM
I'm not really sure how to word that.
 
@BenjaminGruenbaum That's not a bad choice. But visit the other museum too, some flamish paintings are marvelous too.
 
@dystroy Dude ;)
 
@mariovass, I removed the css rule " .navButton:active {
position:relative;
top:1px;
} "
and it seems to work (gChrome)
 
@BenjaminGruenbaum Wait, yer in Amsterdam right now?
 
9:58 AM
@Utopik sweet man yeah thats it!
 
@Tot 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.
 
10:12 AM
Why did I remove mozilla-central...now I'll have to clone it again.
I just want the spidermonkey goodies
 
Oh god ... that's such a fucking pain.
 
10:24 AM
I want to add v8 and spidermonkey sources to the answer. Looks like waiting will be had.
 
close as too stupid ?
0
Q: Get Incremental Number from two loops

JohnnyJSi have two simple regular for loops. for (var i=0; i<3; i++){ for (var x=0; x<3; x++){ //return number from 0 to 9 imgNumber = i*x; addImage(imgNumber); } } Well it is not returning number from 0 to 9. instead it returning : 1 2 3 - 2 4 6 - 3 6 9 Assuming that i don't want ...

 
10:43 AM
@gtRfnkN 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.
 
-1
Q: Two dimensional arrays in Go lang

ArtyMathJava How to create and use two dimensional arrays in Go language? What are common functions to use them with? What connection do they have to slices? How to put two dimensional array to a slice and iterate over the slice? Are there more effective data-structures in Go than two dimensional arrays?

 
11:08 AM
Such beautiful rep count...
 
Jesus! Just look at the Greg's answer, it got 20 up-votes and the only reason is because he is a ultra high rep. user.
 
He also answered first. By the time I posted my answer, he had ~10
 
The fun thing is, he basically tells how Ruby would see this construct. That would have been cool if Ruby would have been mentioned in the question.
 
user1125394
go syntax isn't that beautiful ary := new([size][size]int)
 
So, you have a question how C++ does this, alright, here's a quick hurr-durr response on C++ and that's how Java would do it, because I just felt like telling you about Java.
I like how you picked 42 and 300 as example numbers. :D
> this IS JAVASCRIPT! ~ Leonidas the Brave - 480BC
 
11:18 AM
@Zirak What do you have against Steam?
Huh?
HUH?!
 
@SomeGuy It's alright, he'll install it because he doesn't want to get kicked in the nuts in Venice. :D
 
I have some thoughts on javascript, may i share ?
dont rant me :-)
// pasting gist in 20 mins [fuck this iPhone i cant paste / copy ]
 
Does it involve vaseline and goats?
 
@SomeGuy I meant to install and sign up later today, but if you don't want me to...
 
11:21 AM
You may proceed.
 
It involves sheer thoughts i acquired after spending 3 days with python guys and language agnostic people, talking to loads of people.
and in 5 years of development myself :P
so well lemme gist it... Over here it will be wall of text
 
!!learn Spanish or learn Portuguese
 
@OctavianDamiean Command spanish learned
 
Oh my ... I iz teh idiot.
 
@OctavianDamiean Yeah
 
11:29 AM
!!forget spanish
 
@OctavianDamiean Command spanish forgotten.
 
For the next 3 hours or so
 
@BenjaminGruenbaum Damn, that's pretty nice!
Enjoy!
 
!!Spanish or Portuguese
 
11:30 AM
@OctavianDamiean Spanish
 
I mean, they answer, but not the underlying confusion - ambiguous parentheses
 
Or maybe not?
I dunno.
 
Seem fine to me
The accepted answer is CW
edit it
 
11:36 AM
Yeah, you're right. I'm just stupid.
 
That's my answer you're speaking of...
 
somebody wanna give me some good js code of 5 lines ?
what was that batman code ?
 
Array(someNumber).join(NaN) + ' Batman'; //?
You can use the Y-Combinator, that's always pretty.
 
!!> Array(15).join('Hello' - 1) + ' Batman';
 
0
Q: Is there any way to detect on a website if the mouse has not been moved for awhile?

Karolis RamanauskasI want an element to appear in case the website has not been used for a while and make it disappear after it is being used again. Is there any way to detect on a website if the mouse has not been moved for awhile?

 
11:43 AM
@phenomnomnominal "NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman"
 
user1125394
how to lose a script: inifinite loop in a jsfiddle
 
Stop writing your code in a website...use your editor
You deserve it
 
user1125394
:)) I did an @Abhishek if I remind well
 
@ShaiAharoni 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.
 
11:49 AM
!!> Array(15).join( ('Hello'-1).substring(0,1) ) + 'Batman';
 
@AbhishekHingnikar "TypeError: (intermediate value).substring is not a function"
 
teehee I had no mistakes in the free Spanish exercise on Babbel.com. :D
 
NaN doesn't have a substring function
 
yeah i get it
i conver it to string now
 
Haha fuck...
!!> NaN.toExponential()
 
11:50 AM
@phenomnomnominal "NaN"
 
!!> (('Hello'-1) + '').substring(0,2)
 
Really? A string?
 
@AbhishekHingnikar "Na"
 
!!> NaN.constructor()
 
@phenomnomnominal 0
 
11:51 AM
!!> 300..toExponential()
 
@phenomnomnominal "3e+2"
 
Oh. Well that's okay then
 
Infinity = Infinity || (0 * chuckNorris);
Good One ?
 
Good one for what?
 
I am sharing wait :D
@OctavianDamiean slid.es/darkyen/deck
now once i am done yall can contribute :-)
(and re-use)
@OctavianDamiean i am not sure about the title yet though :P
i will also include something... magics in end of it
 
12:11 PM
Slide #4 from the left is a bit scary
And so are its descendent slides
 
I am working on it :-)
it will have lots of stuff from this room
including jQuery Rants!
and Margaine.com super cleanliness
Zirak Moments
 
of course is 2 words
 
LokaLemonGuy demo's
 
also, "Starring"
 
@Zirak Slide #4 Part 2 : youtu.be/Sr83UrbZb1Y?t=22s
I will make it open to all :P
to edit (well put it on github account shared by us )
 
user1125394
12:15 PM
guys, could you tell me which approach makes more sense please: jsfiddle.net/RPGAr/6
 
The second one but don't name your variables l, h, l_, h_
 
user1125394
thanks how then? I mean is it the underscore or the 1-length vars?
 
current_l, result_l for instance
 
user1125394
ok
 
current = { low : something, high : something };
@OctavianDamiean What? When?
 
user1125394
12:24 PM
if you want more context it's for tradingview.com/v/5iPBPWB2
 
@BadgerGirl , @copy :-)
 
user1125394
extracting major extrema
 
12:47 PM
Damn it. I need 60 more rep...and then I can freeze my account.
 
Freeze your accout ? How will you do that ? Like Darkyen ?
 
With Object.freeze, obviously.
 
@CapricaSix remind be to upvote a Zirak's answer when he reaches 7777 rep
 
The close-voters on this question should be slapped. If we ever meet, remind me to slap you all. — Octavian Damiean 3 hours ago
I didn't vote to close, but only because of Zirak : this is a duplicate and we probably all saw this question twice at least
 
fucking jquery
 
1:00 PM
yeah, i'm saying the same thing right about now
 
$(el).get() and $(el).eq() are so fucking poorly named
 
you'll get used
you can use [] as well
 
so basically, "we're not wrong and we're not gonna change anything"
 
I feel that we have failed as a community:
1
A: Hide/show and move Iframe

Suresh MichaelUse jquery>> At first you have to initialize jquery libs into your html document <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> More info >> http://jquery.com/ To hide the iframe use this code <sc...

 
@BenjaminGruenbaum wow, his comment is just the icing
 
1:02 PM
Yep
 
Learn more about javascript visit: w3schools.com/js/default.aspSuresh Michael 1 hour ago
 
Who is the smart ass who just starred that?
Downvoted + comment
First of all - who said anything about jQuery? There is no need to include thousands of lines of code to do something simple like this. Second of all w3schools is a horrible resource to learn JavaScript from - they offer lots of misinformation. — Benjamin Gruenbaum 30 secs ago
 
downvoted
 
can't downvote, so i downvoted it in my heart.
 
and your comment upvoted
 
1:04 PM
Got to love how he includes jQuery migrate
 
!!stat synth3tk extended
 
@JanDvorak User Elusio proved elusive.
 
Damn oysters are cheap in Amsterdam - this is so fun. They cost like 6 euro a piece in Israel
 
@JanDvorak what does that do?
 
!!stat 1691712
 
1:06 PM
You don't need the extended
 
@phenomnomnominal User Elusio proved elusive.
 
!!stat Zirak
 
@synth3tk Zirak has 7717 reputation, earned 145 rep today, asked 15 questions, gave 177 answers. avg. rep/post: 40.19. Badges: 2g 22s 49b
@phenomnomnominal synth3tk has 65 reputation, earned 0 rep today, asked 3 questions, gave 5 answers. avg. rep/post: 8.12. Badges: 0g 0s 11b
 
yeah, i'm not too active on SO, lol
 
Saddest thing is - jQuery will likely actually solve his issue :P
Pretty well too
 
1:09 PM
the question is closed with negative score, so expect the roomba to get it
 
Now that's the icing:
I dont know javascript. I was given this code to implement ads. I can get ad to show with that code in a iframe. But i dont know how to make it hide and show also how to move it. Can you write that code. I dont want this with jquery — user2737180 1 hour ago
 
Ah yes, the real purpose of SO
Free help, for people who don't want to try to learn
 
No, we can't write your code.
 
Third of all, OP did say in comments he did not want to use jQuery... — Jan Dvorak 15 secs ago
 
wow:
-4
Q: how to read "Introduction to Algorithms" book?

mohamed_aeI mean here what this books offers or what can I get from it? for example of an answer: (if you read chapters a,b, and c you will be good at designing algorithms or you will have a solid foundation of algorithms) and how to get the maximum benefit from it and how to read it (chapter sequence I ...

 
1:13 PM
@user2737180 We have a section in Stack Overflow to address your "Write that code" needs perfectly :) careers.stackoverflow.com . Good luck and happy coding! — Benjamin Gruenbaum 1 min ago
 
@phenomnomnominal Uhm......... are they asking us how to read?
 
@phenomnomnominal lol?
 
It appears so
 
@phenomnomnominal lol?
@JanDvorak Tell him "Only read the title and the chapter titles - then tell people you've read it at job interviews - that's the maximal profit/amount read ratio"
@phenomnomnominal lol?
 
1:15 PM
@BenjaminGruenbaum yes yes, it's very questionably funny
 
@BenjaminGruenbaum not my style to suggest lying
 
Blackmail and slow torture suit you better.
 
I was joking
I was joking
 
-10 votes in 5 minutes. It's a new lap record!
 
1:18 PM
@BenjaminGruenbaum Were you joking?
 
@Zirak uh, what?
 
@Zirak I am and you must.
 
grrr grunt watch only watches ~50% of the time...
 
@JanDvorak Well, if there's a dark frame you'll fit in, it's where I wake up in a dark basement, light barely filtering through windows covered in planks, my vision blurry, and my hands tied in chains to a stone wall behind me. And there's you, looming over me with a long, buttoned-up brown fur jacket with golden buttons, saying "now Zirak...do you understand our agreement?"
@BenjaminGruenbaum , Mr. Feynman
 
@Zirak Yeah... dark frame... hehe
 
1:25 PM
-1
Q: Which tool is better for use as an online print shop design tool?

ManivasaganI would like to design business card,letterhead etc in online. Which jquery tool will be suitable for my requirement. Is tinyMCE suitable for me?

 
@BenjaminGruenbaum wow. i fell for that one
 
@BenjaminGruenbaum nice try, but I have the userstyle
 
That should have been a party of lemons then :P
That should have been a party of lemons then :P
 
i hate you. also, you're posting twice.
 
1:30 PM
@BenjaminGruenbaum Having some comms issues from your end. You're repeating everything you say. Over. (Over.)
 
Stop releasing multiple pigeons with the same message. Over Over.
 
Well someone's gotta feed those pigeons
So it better be themselves
 
@DavidKron 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.
 
God no, im not staying here.
7
 
Fuck off then :)
 
1:33 PM
why?
 
Wise man.
 
Run while you still can.
 
We love @CapricaSix and all that, but she's not a god.
 
@DavidKron No, please come back @DavidKron we need you
We were going to be together man. I thought we were friends.
David?
They always leave me.
 
@DavidKron Can you help me with my jquarry code?
 
1:38 PM
@BenjaminGruenbaum Brushing your teeth might help.
 
@synth3tk YOU SHUT YOUR FACE
 
@phenomnomnominal BUT WHY? MY TEETH ARE BRUSHED.
 
Sure if its client side and you can call native code from it?
 
@DavidKron Is native code like a native American?
 
1:42 PM
yeah, the white man always kills native code
 
So I take it that when developing a WinJS app, the IndexedDB clears out every time you relaunch VS. I need to figure out how to install a dev app.
 
I would probably not use WinJS to begin with ^_^
 
@BenjaminGruenbaum Specific reasons? Not that I'm gonna change now, since it's just a personal project for learning. I had huge headaches trying to learn XAML.
 
XAML is actually pretty easy to be honest. It's like a really dumb HTML for the most part
You position almost everything with grids (tables) and the document interface is worse than the DOM API, on the upside you have built in data binding
 
Yeah, it seemed easy to me. I just feel slightly more at home with JS. Besides, the app isn't very complex, so it's not that big a deal.
 
1:48 PM
You have a page, it has grids inside it containing data and shapes and other built in components. Texts are styled with runs, you can give things name and access them with this.name in the corrosponding .cs file, you can also set DataContext to an object that implements INotifyPropertyChanged and use properties and they'll stay data bound so when they update so does the UI
 
I read that as "texts are styled with nuns". That could've been interesting.
 
If anyone cares I recommend "The Brothers Karamazov" I'm reading it and really enjoying it so far.
 
Oh neat. Read anything else by Dostoyevsky?
He's pretty good in general. Dry sometimes, but well, he's Russian.
 
Yeah, he's pretty good in general - but everything else I've read by him I've read several years ago, and sometimes I don't like authors I go back to as much.
 
Hola everyone.
 
1:59 PM
hello techie
 

« first day (1051 days earlier)      last day (3895 days later) »