« first day (976 days earlier)      last day (3974 days later) » 

11:11 AM
0
Q: Manipulating model elements in angular

Pierre GMAll, I barely have a week of angular behind me and I am still struggling with some of the concepts. Below is a piece of code I came up with. The idea is to let the user add/delete entries in a model (in practice, the model is read from a json and is more complex than what is presented). While thi...

 
11:24 AM
@Cod1ngFree 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.
 
Hi guys! Could you take a look at this question? stackoverflow.com/questions/17166619
 
^ I wish I could make mobile apps with JavaScript instead of XAML
 
user1125394
is there someone on a linux stuff that could do curl -i http://github.com for me :), plzz
 
Damn you, ruby, you've almost made me ask a question on SO
 
@cx
HTTP/1.1 301 Moved Permanently
Server: GitHub.com
Date: Tue, 18 Jun 2013 11:31:08 GMT
Content-Type: text/html
Content-Length: 178
Connection: close
Location: github.com
Vary: Accept-Encoding

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
 
11:31 AM
@JanDvorak If it's not a dupe ask it and answer it.
 
user1125394
@dystroy tx
 
user1125394
<center>nginx</center> blame nginx
 
it looked at time
 
@cx blame for what ? Doesn't this look OK to you ?
 
its 13:37
 
11:37 AM
 
its 13 here ^^
 
Without changing the order can i do something so that "B" alert will be first ?
$(".b").on('click',function (){

console.log('a');
});


$(".b").on('click',function (){

console.log('b');
});
 
user1125394
34
Q: Why is the <center> tag deprecated in HTML?

Andreas GrechI am just curious as to why the <center> tag in HTML was deprecated. The <center> was a simple way of quickly center-aligning blocks of text and images by encapsulating the container in a <center> tag, and I really cannot find any simpler way on how to do it now. Anyone know of any simple way o...

 
Please do not believe in the myth that Javascript is an object oriented programming language - as it is not. — Ed Heal 8 hours ago
MFW
 
lol
 
11:47 AM
!!urban mfw
 
@JanDvorak mfw Abbreviation for "my face when
 
well your code can be procedural or functional but the standard library and core stuff is object oriented.. does that make the language oop?
 
Still, subtyping a class in javascript is a bit... unintuitive. Unless you ducktype, OFC
 
but I mean the language itself
can you say, language is object oriented
what does that mean? only allows oop?
 
I do think that javascript supports OOP
but does not require as extreme OOP as Java requries
 
11:51 AM
well in java you can write procedural and functional too
do we consider standard library? or what's popular style in the language?
 
@Esailija no, the main function is a class
 
I mean in spirit, who cares about the actual keywords in your text file
 
and you can't have code outside of a class
 
if you don't consider arrays objects you never need to construct a single object
 
Java functional code looks pretty bad, thanks to that classes are first-class, but not functions, and thanks to the type system of bloated generics and no inference
Arrays.sort(arr,
  new Comparator<List<Integer>>{
    public int compare(List<Integer> a, List<Integer> b){
      ...
    }
  }()
);
 
11:55 AM
yes it's bad but it's functional in spirit
 
I hate Java's bloated types
 
and Java 8 will have easier on the eyes syntax for the same
 
In C++, you can at least typedef
 
user1125394
@Esailija what?, it's 10% functional
 
user1125394
no pattern matching
 
11:57 AM
Java also lacks regex literals
 
This example with a comparator doesn't look so bad. The problem is that you often have to create your own interfaces yourself.
 
user1125394
js has nothing to do with real functional family
 
@cx you can write heavily functional code in javascript
function x(a){a(val); return x}
Hey! A monad! :-)
 
something like Callable x( Callable a ) a.call( val?? ); return this;
 
@JanDvorak That gets solved in Java 8 like @Esailija said
 
11:59 AM
not sure if I can translate it :D
 
Arrays.sort(arr, (a,b) -> ...)
 
@BenjaminGruenbaum how will that work type-wise?
JS's functions are untyped
 
user1125394
@JanDvorak yep maybe >50% functional then, I should watch blip.tv/bay-area-functional-programmers/… later, btw val isn't defined there no?
 
@JanDvorak Java can do type inference in version 8, but you still can't use shorter syntax like in C# because that's 'confusing' -_-'
 
12:02 PM
^^
 
If type inference is confusing, I want to be confused
@Nile done
 
Java programmers are not people, they're kids. That's a core assumption in Java, never forget it.
 
I believe the word is consenting adult
from the legendary python post
 
Not in Java it's not :P
 
Java programmers are not consenting adults, they're kids <-- I mean
 
12:04 PM
Yeah :)
A conforming Java 8 compiler can figure out var a = "Hello World" but won't.
 
being extremely restricted is fundamental design of Java, not because of technical limitations
 
Also, converting types of streams in Java is really ugly, I have no idea why they need it.
Being unexpressive is a fundamental design choice in Java ^_^
 
exactly
 
less entropy per character = lower density of bugs
 
12:07 PM
I guess that's way too simplistic
 
They are not fewer, but they are more spread out
 
@EricBarrette 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.
 
user1125394
less code less chances of bug :) (codegolf excluded)
 
syntactic elements
 
!!/stat 892256 extended
 
12:08 PM
@cx golfscript, APL
 
@BenjaminGruenbaum Ed Heal has 15649 reputation, earned 8 rep today, asked 45 questions, gave 1443 answers.avg. rep/post: 10.51. Badges: 4g 16s 48b
 
!!/stat BenjaminGruenbaum extended
 
@BenjaminGruenbaum Benjamin Gruenbaum has 12176 reputation, earned -1 rep today, asked 27 questions, gave 367 answers.
 
oooh, a downvote
 
@BenjaminGruenbaum Benjamin Gruenbaum has 12176 reputation, earned -1 rep today, asked 27 questions, gave 367 answers.avg. rep/post: 30.9. Badges: 1g 21s 52b
 
12:09 PM
then again you can do something ridiculous like golfscript so even syntactic elements is not reliable measure
 
I'm amused that his answers are much older than mine yet he has ~ a third of my rep/post XD
 
@BenjaminGruenbaum you downvoted Jon Skeet once. Your voice shouldn't matter ;-)
 
user1125394
not spending life to it maybe
 
@JanDvorak omg no he didn't
you didn't
did you? you didn't.
 
Jun 15 at 8:27, by Benjamin Gruenbaum
I just downvoted Jon Skeet, if I die in the next 24 hours tell my wife I loved her very much
He pretty much said answering JavaScript questions with jQuery was fine :P
 
12:12 PM
ok meta doesn't count
I knew there was a catch
 
@BenjaminGruenbaum isn't it? As long as you give a good reason to include jQuery
and no, nicer syntax isn't a good reason
 
touching the dom
 
@JanDvorak Not unless you offer an alternative.
 
also people expect answers contain code that they can just copy paste and take home
 
12:13 PM
@BenjaminGruenbaum even if you don't, others will ;-)
 
7
A: How can Stack Overflow users be encouraged to use jQuery only when appropriate?

Benjamin GruenbaumWhile I am a strong proponent of JavaScript education myself, and learning how to get stuff done without relying on thousands of lines of external code... Let me play the devil's advocate. Let's say you're writing an application that has to only run on modern browsers (old IE support is a big ...

 
so if you even use .map or something someone will complain that it won't work
because it would take way too much effort to realize what the answer is doing at conceptual level... yeah... must be able to directly copypaste it and have it work everywhere
 
Add a link to a shim, and explain why shimming of language features is fine.
Honestly I think jQuery's selling point is strong documentation.
 
ok I didn't add explanation why it's fine but I always add a link
well the api is pretty neat too
 
hah, perfect timing. stackfield.com
 
12:16 PM
I love the jQuery API, sorry Raynos and Zirak :P
@OctavianDamiean wtf is that?
 
also the "proprietary" event extensions like namespaces
and what else.. optimized event delegation
 
@BenjaminGruenbaum It is supposed to be a very secure collaboration platform.
 
which I suppose can only matter for mousemove but still
 
Selecting elements in sets? Clever. Using on and off on the elements instead of addEventListener? Clever. Delegation built in? Clever. AJAX in promises? Clever.
 
12:18 PM
I love jQuery
 
implicit iterations everywhere wait not everywhere ? not clever.
 
but I love learning how to live without jQuery
 
I don't like jQuery, and I really almost never use it because I almost never need it.
 
also e.currentTarget works in delegation like you expect, in custom delegation you need your custom event object model to make it work
 
12:18 PM
Their jobs page is offensive.
 
and whoopey doo you have invented the entire jQuery event system to get these
 
@phenomnomnominal LOL
 
check the url
 
I don't really use jQuery that much, it's pretty useless with Angular, it's rare even with Knockout, but it's still a better API than the DOM api for a lot of things.
 
they clearly don't want international users
 
12:19 PM
@phenomnomnominal LOL, nerd.png
@EdHeal Please consider learning how JavaScript works, and how OOP works before making such statements. You're not only reducing the overall quality of the site, you're making a fool of yourself. I'd start with reading about strong behavioral subtyping, start with "Barbara Liskov, Jeannette Wing, A behavioral notion of subtyping, ACM Transactions on Programming Languages and Systems (TOPLAS), Volume 16, Issue 6 ". Second, I'd consider "Taylor, David A. (1992). Object-Oriented Information Systems - Planning and Implementation.". Your perception of OOP looks strongly misguided and misleading. — Benjamin Gruenbaum 41 mins ago
btw
 
@BenjaminGruenbaum yeah, some parts of jquery were nicely designed. But the others just suck
 
say if you have 1000 items, which have 6 observed properties
isn't that 6000 functions
 
@Zirak did you get my yelling about hashtags??
 
@Esailija Why would you have 1000 items data-bound to the DOM at once anyway?
If you use MVVM correctly in a big project you have models and view models and they're separate.
 
The DOM may suck, but it sucks the same way all around. It was designed to suck, its suckiness is consistent.
 
12:21 PM
well in a media player app with 16000 songs in the playlist
 
jQuery.inArray...yeah
 
that still works at blazing speed without knockout magic, but I suspect it won't be so when using knockout
 
consistency of suckiness LOL
 
room topic changed to JavaScript : New User? Read rules.javascriptroom.com | eval(drama); [consistency-of-suckiness] [ecmascript-5] [javascript]
 
It sounds like such an advanced scientific term.
 
12:22 PM
@Zirak lol
 
@Zirak How would you write jQuery.inArray if you were jQuery? (Assuming you can't override array's prototype, and .indexOfon arrays wasn't invented yet)
 
@phenomnomnominal Yes. And I think I handled it appropriately.
 
jQuery.indexOf
 
@BenjaminGruenbaum indexOf was invented everywhere. Strings already had it. All the other languages already had it
 
12:23 PM
@BenjaminGruenbaum ...how about having it return true/false, instead of an index?
 
if they wanted the name inArray, then returning true/false was indeed a better way to go indeed
 
It would have been simpler if arrays were 1-indexed as in Pascal...
0 : not in array
 
I think the naming of internal methods who were exposed just cause isn't that bad. You're not supposed to use these 'utility' methods that much anyway.
 
inArray is a public method
 
Just like you get map grep and filter but not reduce simply because they don't use reduce internally.
 
12:25 PM
but they shouldn't have made them public
that's what I think
 
Yeah, they built it for internal use so they said 'might as well expose it, some people might find it useful, they're all adults after all'
 
they don't use it because they don't know how to use it, that's it :P
 
I managed to set the document.title of my page to "137153375268205485905762761831" and I have NO idea how.
 
(reduce)
 
No, they don't use it because they don't need to use it. Reduce is awesome, but it's a coding style.
 
12:25 PM
the general population of jQuery users isn't going to be consenting adults :D but I guess they didn't know that when those methods were created
 
I use reduce often in my code, but I don't think code that doesn't isn't as good.
 
So if they use horrible names internally, it's cool?
 
!!>137153375268205485905762761831..toString(16)
 
@JanDvorak "SyntaxError: identifier starts immediately after numeric literal"
 
I don't think code that doesn't use reduce is bad, but code that uses reduce is awesome
 
12:26 PM
@Esailija That doesn't mean the developers of the library should cater kids.
 
@JanDvorak "1bb2a9ceb79b3f00000000000"
 
@FlorianMargaine Code that uses reduce is awesome iff it's cleaner/clearer than similar code that doesn't.
 
DAmn you firefox and your actually useful error messages :-)
 
@JanDvorak nice find
 
12:27 PM
even if it's uglier, reduce is awesome in itself
(reduce #'+ '(1 2 3)) ; who doesn't like that?!
:P
 
@FlorianMargaine +/1 2 3 (J)
 
what is #
 
document.title = "#{_current or 'HOME'}" <- only reference to document.title wut.
 
@FlorianMargaine Can you explain your code to a dumb young coder ?
 
#' is "get the reference of the function" instead of executing it
 
12:28 PM
@Zirak They use names that made sense when they started developing. They have an API they don't want to break. I agree that jQuery has horrible parts, but it's still less sucky than the DOM API. On the other hand the DOM API is really improving.
 
bedtime! Night chaps!
 
@dystroy yep. "ca reduit toutes les valeurs du tableau en une seule valeur a l'aide d'une fonction"
 
@FlorianMargaine anglais s'il te plait
 
"it reduces all the values of an array into a single value thanks to some function"
 
12:29 PM
Some portions of it are better than the DOM api, I completely agree. But some are so much worse, and I mean design issues worse, that I can't like it (selectors as a building block? yucky)
 
@FlorianMargaine thanks :-)
 
Oh yea guys! 24 Heures du Mans this weekend!
Also known as 24 hours of Le Mans.
 
@Zirak I can see you don't like selector-based programming ;-)
 
@Zirak If you're not building a web application and just want to make a page dynamic, it's not that bad. I agree that in an actual application the only thing you actually feed jQuery selectors are DOM elements anyway.
 
^ that
 
12:33 PM
@BenjaminGruenbaum ... at which point you don't really need jQuery
 
the "jQuery is only good for selectors" fallacy
 
Well, consistent event handler binding is nice :-)
OK... I retract
 
@JanDvorak I used to need jQuery in single page applications until AngularJS 1.2, now they added declarative animations into the core... that does make jQuery unneeded in Angular apps now. Then again Angular bundles a mini version of jQuery jqLite
 
12:46 PM
any LED freaks here?
looking for cool white (7500-10000k) 75-100lm/W leds for <$4/led
found cree xlamp xr-e's for 4.50 and hoping there is a better price around
 
Am I the only one to think the G+ team looks WTF sometimes ?
 
dx.com/p/3w-180lm-8000k-white-led-emitter-3-4-3-8v-44989 these are not bad... but I know little to nothing about led quality
 
So they used a stupidely looking hack to go around a bug and, year(s) later, they test it and found it, not surprisingly, to be slow... It looks like they don't read the pagespeed site of the same company.
 
1:22 PM
ive been looking at this stackoverflow.com/questions/2764619/how-does-jquery-data-work, I'm trying to find out how jQuery stores this data, the question didn't really help me? can anyone explain?
 
i had a thought
so like, i'm not the question answering type...i just don't like interacting that way with people, it's like email
i prefer instant talking with someone when i am helping them
but yet, you get absolutely nothing for helping someone in a chat
if you helped someone, it would be cool if they could +1 you so to speak (in google leet speak)
 
You get the satisfaction of knowing you helped.
 
@redline And what more do you get when you answer ? At most a green check and a few reputation points on SO...
 
well yea, a few rep points is what i am saying
 
what do reputation points get you?>
tbh if I didn't want to so badly see deleted content I wouldn't care about my rep
 
1:24 PM
@redline I checked my bakery doesn't want to exchange them for croissants :(
 
uh, ok
 
@rlemon Having 10k is great for usability of the site. Yes. That's one thing you get.
 
contribute on github. That is more productive towards your career
 
rep == reddit karma...
iz meaningless
 
1:26 PM
@redline You get job offers :P
 
@BenjaminGruenbaum pfft
 
@Will 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.
 
@redline Answering questions in SO is nice, the problem is there are so many bad questions..
 
@BenjaminGruenbaum it's not about the questions themselves but more about the preferred forum of answering them
 
Its funny to pretend the points on SO are meaningless.
 
1:29 PM
If you want to make something useful, I think AOP in JS might be an interesting idea.
 
user1125394
damn got banned of java irc
 
@BenjaminGruenbaum i'm just a hands-on kind of a person and i enjoy talking with people, not writing long paragraphs, i'm not a writer i'm a coder and i prefer to converse with people in realtime
 
morning everyone
 
If they were, then the site wouldn't exist, along with a bunch of other sites and systems that use pretend points.
 
@cx did you tell them their language is horrible and they should feel bad?
4 mins ago, by rlemon
contribute on github. That is more productive towards your career
Also, AOP in JS, pick it up.
 
user1125394
1:30 PM
@BenjaminGruenbaum not even:)) just pasting them a 4 lines code, they got pissed because paste limit is 2, repasted in one-liner
 
@Loktar they are only as meaningful as we make them. who doesn't like to show off that they are smart... ohh shit. 600 Q's and 0 A's also gets you 10k rep. :/
 
user1125394
and bim ban!
 
@rlemon its still a reward system that works and drives people to get more.
 
well sure
 
@BenjaminGruenbaum yea i don't see rlemon's posts and i'm not looking for job offers through github
@BenjaminGruenbaum and what is aop in js?
 
user1125394
1:30 PM
they did me a favor
 
Its just like achievements in gaming which are hugely popular.
 
@Loktar There's a hall of fame in all games, doesn't give more real worth to the points.
 
but the reward system is meaningless outside of the system it's built into
it's like saying online poker for pretend money is for anything but ego and fun
 
It's fun to get points but still... no croissants...
 
Lots of things in life can be considered pointless. But if you get enjoyment out of it, its not pointless.
 
1:31 PM
@redline AOP like in C#, only in JS
 
@Loktar SO Rep !== CHEEVOS so why would I care? It's not like SO Rep ever got me laid or got my badass breakdancing skills noticed.
 
Playing games can be considered pointless, but provides some sort of enjoyment.
 
@redline Let's start smaller, attributes in JS.
 
@rlemon if we all thought like that the world would lack a lot of things people consider fun.
 
Like in C#:
[HttpPost]
public ActionResult method(){

}
 
1:32 PM
Watching football doesnt get you laid either.
 
yea but attributes in JS don't exist, you'd have to embed them in the function definitions using .toString like I was talking about
for my modifiers
 
Yet its hugely popular :P
 
@Loktar I agree with you, they are only as meaningful as we make them. meaning, they are only valuable to the person who finds value in them... not anyone else.
 
does anyone know how jQuery.data(); works?
 
I find meaning in my SO rep :P
 
1:33 PM
@Connor yea it stores an ID attribute on the DOM element
 
so they are important to you
 
Not in the amt, just at the fact I have proof I helped some people
 
@Connor then keeps a data object internally with the ID#
jQuery_SOMELONGHASHHERE="3" is what you see on DOM elements that have data on them
 
and I like collecting things like many individuals. SO has a pretty good incentive system
 
most of my rep was from shit answers :?
 
1:34 PM
its the same with Steam and those stupid badges... totally meaningless
yet I want to collect them and raise my imaginary level
 
haha, I just noticed redline blocked me
 
@Connor it keeps the DOM from having circular references and memory leaks (mostly in IE)
 
haha - some people can't take the truth.
 
@redline i don't see any id
 
oh speaking of steam and imaginary stuff :P
 
@Connor do it in MSIE
 
I sold 2 hats, and made $160
 
nice
 
@rlemon How do you notice you're blocked ? Do you read me ? Can somebody read me ? Did everybody block me ?
 
@dystroy he told Benji he did above.
 
1:35 PM
@Connor and make sure you actually attached some data using .data()
 
@redline Yeah, that'd be interesting though, something like
function myRoute(req,resp){
    "HttpPost";

}
Could be useful.
 
@BenjaminGruenbaum what kind of attributes were you thinking?
 
I'm not sure, I just like the idea of having them.
 
@redline yeah i still don't see a id
 
@BenjaminGruenbaum so basically like a static library for simplifying the generation and access of these attributes in function bodies?
@Connor interesting, trying an older MSIE like 8 or 7
just change the version in your devtools
for both browser and document modes
 
1:38 PM
@redline why
 
because i think jQuery might use a different method in newer browsers
but you can at least see this functionality when it "falls back"
it is essentially doing the same thing though, why do you care though?
 
m90
hello there, anyone around here experienced using the google / typekit webfontloader: github.com/typekit/webfontloader ?
 
you set data, you get data, or you can get the entire data object, what more do you need?
 
@redline i wan't to know how it identifies elements
 
using unique IDs
managed internally by the library
 
1:40 PM
well it doesn't store id="jquery3489572385092" so i don't get how it know's what data this element has
 
designed in such a way that you can't mess with them, ON PURPOSE
no, you have that backwards
jQuery_23847324987 is the attribute
the ID# is the value
jQuery_23847324987="5"
then they probably have a domData somewhere and domData[5] is the same object reference you get when you do .data() to get the entire data object for the DOM element
 
so say when you add some data it stores
jQuery_23847324987="5" in cache yes
 
it stores that ON the DOM element
so the next time you call .data() it knows which data object to get
because jQuery itself is stateless
that's why you can throw the jQuery object away and use that DOM element again in a jQuery constructor
 
yeah thats cool but where does it store it on the DOM element?
 
lala work is boring
is anyone accepting work for branding/logo design? :D
 
1:44 PM
You need something designed?
 
@Connor i honestly have no idea, go look at the source code
 
I'm trying to get good at vector graphics.
 
posted on June 18, 2013

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} BAM! Almost to 1k supporters!

 
@Connor i only know that it does that in older browsers as a fallback
 
yes i do - for a new project of mine
 
1:45 PM
@redline i have, no help there
 
or hides it in newer ones in a really nice way
again, there is no reason to access it though
 
@redline i don't want to access it, i wan't to make it
 
oh ok
well doing the fallback way is a good start
but i mean, the answer is there in the source code
it's not like i'm going to go spend 10-20 minutes looking through it for you, so...
 
@KendallFrey interested? :)
 
Depends on the quality you need.
 
1:47 PM
just get the dev version
set some data
and inspect it using the dev tools
step through, it isn't that difficult to follow code when you have a debugger
 
I'm not a professional graphics designer, but I can make a picture/logo.
 
i will
 
I just need a nice logotype
 
What for?
 
@BenjaminGruenbaum i can see that C# chat worked out really well >_<
@BenjaminGruenbaum those guys are like talking to a wall
@BenjaminGruenbaum literally the attention span of a squirrel
 
user1125394
1:49 PM
they are cool
 
a project i'm starting for viewing twitch.tv streams in a more.. fun way
 
Send me a name and some ideas for the logo image.
 
@BenjaminGruenbaum anyway, i'm gonna get back to work and then ponder your attributes idea when i make some more coffee...peace
 
@redline i have just tested in ie7 and this is the result
jQuery191027128627324426663="1"
jQuery191027128627324426663="2"
i wonder why they are both the same name?
 
oh my god guys
I think I found the most ridiculous IE10 bug
 
1:56 PM
@KendallFrey Fluxil - and I don't have many ideas.. usually I just go to logopond and "get inspired" :P
 
I don't know what the logo is for, so it's hard to know what kind of icon you want.
 
@SimonSarris Why do you make us wait ? We want to see the most ridiculous IE10 bug
 
@redline They're just very polite :P
 
@KendallFrey it's for a responsive web app for viewing live gaming streams in a masonry grid - not sure if that helps at all
let me find some things i was going in the direction of
 

« first day (976 days earlier)      last day (3974 days later) »