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

5:00 PM
@JanDvorak it filters through the array and returns any array element that contains thin in the array element
 
@Connor And why ~ ?
 
Why does ~elem.indexOf("thin") work?
 
because benjamin wrote this code
 
well firstly you can help me out, how can i get that symbol on my keyboard, i can see it but its 1 of 3 on the button :S
 
@web2students.com implies nothig
@Connor try shift
 
5:02 PM
i have
 
@JanDvorak I think it implies the exact opposite :P
 
then use != instead ;-)
 
i got it
so does this ~ mean !== ?
 
@PravinMishra 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.
 
5:04 PM
@Connor look at the spec, and then try ~i for many i.
 
k
if it is *
 
Don't just guess. Search and try.
 
Basically the usage here is that it converts -1 to 0 and everything else to a non zero number.
But it flips all the bits that represent the number
 
@BenjaminGruenbaum so basically it converts numbers or whatever and returns anything that is not 0?
 
Not really, no :)
 
5:06 PM
so do you use ~ alot?
oh... ill read up more on it and let you know
 
33
Q: What are bitwise operators?

clickI'm someone who writes code just for fun and hasn't really delved into it in either an academic or professional setting, so stuff like this really escapes me. I was reading an article about JavaScript, which apparently supports bitwise operations. I keep seeing this mentioned in places and I've t...

This is why people hate backbone -_-
0
Q: Ajax request in Backbone View render function

Gorkem YurtsevenI want to pass an extra variable (the userid) with before rendering my backbone view. I am getting the the extra variable with a ajax request but because is asynchronous I think my page is being rendered before I get the variable. For simplicity lets say I have this in my backbone view : PostsA...

I don't care, Y U put state in view? Use view models, or controller, or whatever etc.
 
@BenjaminGruenbaum Wait, because of bitwise operators?
 
lol, no :)
 
Just kidding. :D
 
PostsApp.Views.Post = Backbone.View.extend({
    template: _.template($('#post-template').html()),

    render: function(){
        var newObject = this.model.toJSON();
        $.ajax({
            url:"/user",
            success:function(result){
                newObject.twittername = result.name; ;
            }
        });
        this.$el.html(this.template(newObject));
    }

});
Seriously... why would you have an AJAX request in your view
 
5:09 PM
That's easy, because you have no idea of views, models and controllers. :P
With you I obviously didn't mean you, but you know that, don't you (sooo many yous).
I'm confused.
 
@Loktar 4 kids + wife === extra hands for the firefight when the zombie apocalypse happens.
Mormons are just getting prepared
 
trollol
I was bored. :P
 
That is what you do when you are bored?
 
@OctavianDamiean make him spin
 
@copy Yea, I create infinite loops.
It's fun watching them.
 
5:21 PM
Oh, I thought you created that image
 
That too.
Wait, not that guy ... just the text.
 
@OctavianDamiean OMG call 911
 
@OctavianDamiean I must say that I think you draw text beautifully.
 
@MadaraUchiha I'm getting better at writing Ubuntu font.
 
user1596138
 
user1596138
5:24 PM
How the fuck is that possible ^^
 
user1596138
ls isn't valid? Stupid Windows-based server.
 
You get what you deserve for using Windoze
 
hello
 
Windows_NT, want me to draw a picture?
 
Could anyone tell how this custom scrollbar is created ? vojtajina.github.io/WebApp-CodeLab/FinalProject/index.html
I cant find any js libaries for that
and that example wont work with firefox v21
 
5:27 PM
When using a JS fucntion that uses Knockout.js observable linked to a mysql DB in JSON format, what i dont get is how often the observable is monitoring the DB for changes, is it like AJAX calls fired every X time? or how does it work? do i have to set the time? if not, what is the default time it checks for changes
 
@Jhawinsss ... windows isn't Linux. Thus ls isn't valid. Try using dir
 
@jurka Eh, which scrollbar?
Before we continue, how many beers did you already have today? :D
 
@rlemon lol
 
@OctavianDamiean On the sidebar...
 
mine is v21 and it's not working
 
5:30 PM
Hey guys, my company uses wordpress a lot and I hate it. I want to make a wordpress type CMS in node. Any tips on where or how to start?
 
Just for the record Im not a Mormon though in case anyone thinks that from the comment
 
@MadaraUchiha I have no scrollbar at all, that's why I'm asking if you had a few too many beers. :P
 
@OctavianDamiean If two tell you you're drunk... Go to bed.
 
I am a former Mormon
 
@powerc9000 I read that as I am a former moron, was quite confused.
2
 
5:32 PM
well.. if you hate wordpress I honestly dont think the correct solution is to try and roll your own cms in node
 
@OctavianDamiean Well I still am a moron.
 
@Loktar Why not, you could call it NodePress.
 
not for a production cms anyway, for a learning experience definitely
 
@Loktar totally not for production
 
@OctavianDamiean nodepress.in
 
lol
 
@powerc9000 I was friends with a two mormon kids in highschool. Nice, normal people. we didn't talk about their religion ever. They just didn't partake in some of the stuff we did, but never threw up a fuss over us doing it. Good people if you ask me. Bat crap crazy, but good people.
 
looks like theres a few github projects named that too
 
just that I want to satisfy my problems I have with wordpress especially the templateing
@rlemon yea they are insane
 
What's with all the flags?
 
5:35 PM
whats being flagged? (I need 10K)
:(
 
idk.. last one was in a test room
 
I invalidated it.. because it seems silly to flag something in a private room called testtttt lol
 
anyone knows how observable knockout.js works
 
@sebas Hi again.
What about them?
 
5:36 PM
@Loktar I have no idea, flags in a foreign language piss me off.
 
@BenjaminGruenbaum hi, when its observing a DB, how often its checking for changes
 
What do you mean by "observing a DB"?
 
I think you misunderstood the observable concept.
 
Observables are for the view model to observe changes in the view and vice versa.
 
when its monitoring a DB to execute a function
 
5:38 PM
Can you give me an example?
CenturyLink just bought AppFog by the way if anyone cares
 
It's flag day in America
 
for example the script you made, jsfiddle.net/cYhTF/2
 
@BenjaminGruenbaum I didn't know either of them.
 
that monitors a DB in JSON format
 
Nah, it doesn't work like that. You have to fetch changes from a database yourself.
 
5:40 PM
It doesn't monitor the DB, it performs a single fetch. That's not what observables are for.
If you want it to monitor the DB for changes, you need to poll it, like fetch every 20 seconds or something like that.
 
Then populate the observable data structure.
That will trigger a view update (if necessary).
 
like an ajax call
 
For instance.
 
and that would kill the server, to do that every 20 seconds in 15 screens at the time
right
 
5:42 PM
for a huge db
 
Depends on your query.
 
and a websocket would instantly solve this issue?
 
Don't database systems cache repeating queries?
 
No, websockets would not solve this problem. The bottleneck is the data base and not the server.
 
user1596138
@RyanKinal No, ls is still valid for FTP.
 
5:44 PM
I have no idea how conventional database systems work, I'm the CouchDB guy.
 
@OctavianDamiean also, the HTTP servers don't cache requests/responses and neither do clients :P
 
its the DB but with a websocket i wouldnt need to make multiple ajax calls?
 
user1596138
I've always used ls haha. FTP uses normal unix commands like rm, cd, and get.
 
@OctavianDamiean I think he wants 15 people to work on the data and watch it instantly update on other screens, right @sebas ?
 
@BenjaminGruenbaum I'm not talking about HTTP requests but DB queries.
 
5:44 PM
@Jhawinsss Ah. Yeah, I suppose it is.
 
I mean doesn't the DB build an index or something in cache that it reads from?
That's how CouchDB does it.
Ah!
Well, then.
 
hello everyone!
this is my first time ever i have been to StackOverflow.
and this gonna be my first question even which i am asking...
can anyone just explain me what exactly HTML is and what it offers?
is it just to enhance the readability...(directly or indirectly) or something more powerful than that??
 
It is a (or it is supposed to be) a semantic markup language.
 
@Suja HTML is what we call a markup language.
 
@BenjaminGruenbaum correct
 
5:47 PM
@Suja It's the way we represent pages on the internet. Just like when in here you put ** before and after a message it becomes bold.
 
@BenjaminGruenbaum 15 people on the same screen working on contacts, and new contacts come in in real time via web forms,
 
@Suja I suggest you read this: stackoverflow.com/tags/html/info
@sebas I'd probably do the whole thing in Meteor. That would require another layer from you though. I think if it's just 15 people polling every 20 seconds, that's 45 queries per minute, which is not too bad if your query is reasonably fast.
 
@sebas Not trying to do bikeshedding but I believe that CouchDB in combination with Knockout.js would be the easiest way to do that.
 
does anyone know of a large array of random words i can use like with 200 words? alphabet words? i can copy & paste from somewhere?
 
user1596138
I've done nothing in 2 hours.
 
5:48 PM
@Benjamin what exactly does it offers?
 
@Connor Oh! ALPHABET words.
 
user1596138
@Connor Grab a dictionary for brute force.
 
This won't fit his need. XmlHttpRequest DOES work for web service calls but his is cross-domain. If the browser or server doesn't support CORS it won't work. jQuery isn't only used for css style, it is also used for the AJAX call which takes care of CORS. JSONP, & XHR. — Justin 3 hours ago
 
@sebas CouchDB already takes care of the continuous synchronization for you.
 
@Connor cat /usr/share/dict/words|sort -R|head -n200
 
5:49 PM
@Jhawinsss Welcome to chat.SO.
 
hey guys, does anyone know how to trigger the datalist dropdown with JS?
 
@Suja It's how you build websites, when you see a web page, the way it's structured is built in HTML, and the way it looks is built in a complementary language called CSS.
@dylanmaxey The what now?
 
user1596138
@OctavianDamiean Well, it's because I don't have any access to my server.
 
@Darkyen Now I'm confused.
 
@BenjaminGruenbaum datalist, it's an html element
 
5:50 PM
@copy i don't know what that is, i haven't quite got into the command line fetch stuff yet :(
 
@Connor Do you have a *nix system?
 
@copy windows
 
@BenjaminGruenbaum then what is the need of HTML?
we can complete our whole stuff without HTML even??
 
@dylanmaxey Ah, you have to forgive me :) What about triggering a keydown ?
 
@Suja How would you do that?
 
5:52 PM
@Suja In your answers, when you use <div> , div is actually an HTML tag. I really suggest you read the wiki.
 
@Connor My condolence, here you go hastebin.com/cufibetuhi.hs
 
@BenjaminGruenbaum I've tried, but no luck. I don't get it
 
@Suja How would you create a website?
 
My fault i guess :P
 
@BenjaminGruenbaum the query is complex
 
5:53 PM
i showed her some dom manipulation before proper html :$
 
@dylanmaxey Have you tried to turn on event capturing in chrome development tools to see what actually fires and use that?
 
@Suja if you are thinking that you can create elements using javascript or any other language [for doing so]
there is a small flaw to that
 
@Darkyen who are you talking about? Suja?
 
HTML is also a standard :P
@OctavianDamiean yes :P
shes actually my sister well cousin :P
 
@Darkyen Oh you ...
 
5:54 PM
(x, sorry was writing the canvas snake she was watching
 
@Darkyen What now?
 
@Darkyen So we cannot mention the porn incident?
 
you guys can :D
 
Is she your sister or cousin or both?
 
doesnt matter :P
@OctavianDamiean are you trying to trick me in words or something ?
 
5:55 PM
@OctavianDamiean i am his SISTER!
 
@copy You are the subtlety in person. :)
 
@copy Thats cool, thanks for your help, i also found generatedata.com
 
This all seems very convenient
 
@BenjaminGruenbaum meteor looks amazing
 
@dylanmaxey It doesn't look like anything triggers. Go to jsfiddle.net/P4bDb , go to developer tools, select the result frame (at the bottom) and type monitorEvents(document.getElementById("datalist"))
 
5:57 PM
@Suja I see, not that it would matter in the context of this discussion though.
 
for example @Suja if you want to make a progress bar in html you can write <progress></progress> which will create a nice looking progress bar moreover it allows you to compact all the page data in sementic readable format, its also accepted by all the browsers in the same way so you can nearly garuntee that if you write something , will look similar in the browsers which support it.
 
Start with easier things, like paragraphs.
 
true!
jsfiddle time
 
It's a more natural transition.
 
@dylanmaxey looks like you're out of luck, no events fire - at least in Chrome 27
 
5:58 PM
but i guess thats why shes confused if its just to increase readability
 
Well, that's not wrong either.
 
@Darkyen @BenjaminGruenbaum can't we create our complete code just with CSS and JS?
 
@Suja No, there are clients that don't understand JS, nor CSS (partially).
 

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