« first day (963 days earlier)      last day (3971 days later) » 

12:03 AM
0
Q: how to implent live counter for registred users?

fritidsany idea how to perform a live registred user count box like in those sites please : askimet badoo thankyou

 
12:18 AM
Gf refuses to listen to daybreak now. Lol victory!
 
!!/youtube Funk Hole - Destroid
 
user1596138
12:33 AM
So... Some dude just decided he was gonna shoot this guy who was driving. That makes 21 confirmed murders in this town this year.
 
@BenjaminGruenbaum Yeah. Since we're pulling the data from the server, I just elected to add this loop:
for(var i = 0;i < reviews.length;i++) {
  reviews[i].ratingWidth = reviews[i].rating * 20;
}
Which makes the KO easy.
 
user1596138
@SomeKittens Looks like a pretty easy solution. I take it it's some kind of counter?
 
@Jhawinsss See the discussion here
 
I don't like it
 
if (hack.works && deadline.soon()) { /* you know what goes here... */ }
2
 
12:47 AM
Why is hack.works a property and deadline.soon a method
 
@copy I think the code snippet accurately explains why.
 
I think therefore I am
 
1:08 AM
Isn't this supposed to provide all the events the element contains? jsbin.com/alukux/3/edit
no nvm
but how do you get all events that an element has?
 
@MauricioFidalgo 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:28 AM
@dylanmaxey You don't
@dylanmaxey you can't detect every single event on an element unless you subscribe them all yourself, or if theoretically you have access to the page first. In practice, just keep track of them
 
anyone think of a place to get a better deal on something with similar outputs to this (as well as 100-240V input): dx.com/p/…
 
Probably ebay
 
eh, for some reason I trust the random Singaporeans over random ebay people
been fucked a few times on ebay
however I open my packages in well ventilated rooms :/
 
What happened, if I may ask? Sounds like a good story
var form = $('<form method="post" action="/tours"></form>');
$('body').append(form);
form.submit();
I.... er.. WAT?
 
1:42 AM
@SomeKittens tl;dr two different occasions I got screwed by a seller. Once was because he tried to over charge me on shipping (agreed to send in a single package, charged me for two packages shipping) and then refused to send the item if I didn't pay the extra. the second time I got a DOA item and contacted the seller who refused to refund the item (guaranteed to work my ass)
long tl;dr
 
The above code seems to exist because so a POST call will trigger on our backend.
 
You guys too cool for AJAX?
 
I used sync ajax the other day, was awesome
 
user1125394
ebay's expensive
 
user1125394
@phenomnomnominal I don't do ajax anymore, websockets
 
user1125394
1:57 AM
eveything inside ws or xhrpolling for sucky browsers
 
That's silly
 
user1125394
realtime
 
yeah, but what if you just want to retrieve something from your server, like a picture or html or something?
 
user1125394
@phenomnomnominal picture, not doing that but w support binary
 
user1125394
2:00 AM
but html though ajax, I don't see the point
 
user1125394
for the rest I'm just transporting json
 
4000$ is a lot of money for a screen
 
user1125394
isn't that bad to use ajax returning html? for me it should return data (json, or a binary)
 
user1125394
and not interfere with view/presentation
 
2:05 AM
so loading dynamic html is a bad practice?
 
user1125394
for me yes, for @phenom, maybe no
 
Guys, what year was "glory days of web"?
 
@drch 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.
 
@xcx so how do you load dynamic html?
 
user1125394
you load data and bind it to the view (html page) with knockout.js for exampl, or jquery it if iyou're lazy
 
2:10 AM
 
@xcx so youre saying you want to downlaod all of the html for your whole site in templates, even if they aren't used?
rather than getting them via AJAX when you need them?
 
user1125394
nah the page is already generated (complete) at startup
 
the whole page, with all the content it will ever need?
 
user1125394
but I'm rly not an expert in that
 
user1125394
@phenomnomnominal good point
 
user1125394
2:12 AM
if necessary, you insert..
 
yeah and where do you get it from?
 
user1125394
with a little processing
 
from where?
 
user1125394
@phenomnomnominal from a json!
 
2:13 AM
so you're going to store your html in JSON, or just your content and render it into a view?
 
user1125394
1) page loaded by http, 2) realtime updates (json, binary, or whatever) with ws, or other polling way)
 
okay, so if your site is pretty big, like the one I work on with, with say 300kb of templates, you're going to load all of them first?
 
user1125394
the inital view is by http
 
user1125394
why would it be so slow?
 
@phenomnomnominal how to handle special characters in a post request such = and & ?
 
2:17 AM
@xcx you can't always know how good your users connection is
And maybe it's not 300kb, maybe its a few megabytes of templates
 
user1125394
you could take care of not loading a whole encyclopedia
 
many of which might not be used by that user, you want to waste their data and money?
 
user1125394
when you go to wikipedia do you load everything? silly example, but just making my point
 
no you don't
You load the pages when you go to them
But they don't use AJAX, so it's not relevant
 
user1125394
but ok, I see that loading the content gradually with ws/ajax is a good way
 
2:21 AM
using websockets is silly
 
user1125394
but still I think it would be beter to load pure jsons, and render it witj js
 
Why hold open a constant connection to the user to just send stuff that the HTTP protocol was invented for
You can't just load JSON, JSON is just data
At some point you have to have HTML to render it in
 
user1125394
@phenomnomnominal because personaly, and often you're working with more realtime events
 
guys
 
user1125394
you can use webhooks with your server, but nvm, in my case I'm pushing financial data
 
2:22 AM
loading a page isn't a real time event
 
user1125394
@phenomnomnominal futrure notifications, etc.. man
 
user1125394
don't keep thinking the web of 2000's
 
No one is thinking of the web in the 2000's
Notifications should absolutely be JSON, into a predefined notification template, that should be loaded with the page at first, if you use it enough.
 
user1125394
http is clean, but when you have a good server you can prefer to keep a connection opened
 
no way it is a preference
 
2:26 AM
were there any really large websites like facebook in 2000?
I cannot even remember those days, I mean I was so little
 
what if you have a million simultaneous connections?
 
user1125394
how many cases?
 
user1125394
there are just google, wikipedia..
 
user1125394
and some others
 
user1125394
if you're in it congrats
 
2:27 AM
Even 1000 simultaneous connections
 
user1125394
then no prob
 
Having a websocket open to every single user is not scalable
 
user1125394
@phenomnomnominal ninenines.eu
 
@xcx If you're talking about websites, you're doing everything wrong. Taxi driving is a cool job though, you get to meet many interesting people. If you're writing web applications (like gmail), you're probably doing it wrong, as phenonomnomnomnomnominal says
 
Everyone likes WebSockets, they're a very cool technology, but use the appropriate tool for the job
 
user1125394
2:31 AM
I think I said my case, that's not static pages..
 
user1125394
more something that get updated every second
 
Then yes, that's probably the right tool. But that doesn't make AJAX "Bad practice"
 
user1125394
Ajax with html I said
 
user1125394
> eveything inside ws or xhrpolling for sucky browsers
 
user1125394
xhrpolling is ajax
 
user1125394
2:33 AM
long term ajax
 
user1125394
oops I may be wrong there
 
AJAX with HTML isn't a bad practice either.
 
user1125394
hmm not sure ask @BenjaminGruenbaum
 
user1125394
isn't better to decouple data to view
 
2:34 AM
AJAX with HTML is a bad practice only if you're further manipulating the HTML
 
Exactly
 
@user1832483 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.
 
Yeah, but you can decouple data from view either in the client side, or the server side
 
@BenjaminGruenbaum, if you have to get a chunk of static text or a picture or something, would you use AJAX, or WebSockets.
 
If you have a document, you should do it on the server side, and if you have an application on the client side
 
2:35 AM
so im trying to figure out how this code can give false postive

if(x == -x)
System.out.println("It’s zero!!")

I dont know any number multiplied by -1 that equals itself
 
@phenomnomnominal WebSockets are for persistent connection, if I have to grab a picture I'd probably use an img tag, for text probably ajax.
 
user1125394
so if you have an existing list, and want to add more items, you'd do ajax+json or ajax+html
 
@xcx AJAX+JSON
 
No one is saying you shouldn't use JSON for that
 
user1125394
ok
 
2:37 AM
No one has ever said that
But that doesn't make AJAX + HTML a bad practice
 
user1125394
@phenomnomnominal just don't see your usecases
 
user1125394
give a concrete example
 
@user1832483 what language is that? (Hint, it's a rotten language)
 
user1125394
loading a sort of third party widget?
 
I'm actually to busy right now
 
2:38 AM
@xcx When you want to import a document and not data
 
But I've given plenty of examples.
 
@BenjaminGruenbaum its normal java
 
@user1832483 And why are you asking this here?
 
@BenjaminGruenbaum ugh clicked the wrong forum my apologies
 
How do you convert a bytes value to 8 bit binary values?
I have >> & << | operators available
so for example I have an unsigned byte value 129
then I want binary values in an array like 1000 0001
 
2:40 AM
@xcx let's say you have an app that generates reports on the server, it creates a nice HTML containing all the review data. You can load it on the client side, that might make more sense than loading the actual data and doing the lifting on the client side. It's just loaded once in this example. Using AJAX+HTML is a legitimate choice.
When writing applications it's not.
@O0oO0oOO0ooO .toString(2) , next time use google.
 
I cnanot figure it out on Google
 
@O0oO0oOO0ooO wat?
 
!!/google convert a byte to binary javascript
 
That's actually a bad way to ask this question
!!/google convert a number to binary string javascript
 
All relevant
night
 
user1125394
hmm ok but reports in html..., not highly used, or not needing much quality or css no?
 
user1596138
Why would you need a converter to convert a number to binary?
 
Is it valid to disable a style by keeping "x-" as prefix to a css property?
x-display: block;
My colleague said that it is better than commenting..
Any suggestions?
 
user1596138
@Mr_Green I think commenting is better for sure.
 
user1596138
2:55 AM
Wouldn't x- throw style errors? It sounds stupid IMHO.
 
ya even I think same
but I can't find any source describing it
Seems ok as per this link w3.org/TR/CSS21/syndata.html#comments
 
Seems like a bad idea to leave defunct code lying around, whether it's commented out or prefixed like you're talking about.
 
Ya as I said before, I think the same but w3c also specifies that the property which is not present will be ignored.
 
Right-o
 
3:27 AM
commented would be better. i'm not aware of anything saying that there won't be a browser out there that does something with x-my-old-css-property later on
 
4:10 AM
 
4:21 AM
isCrappyBrowser <- awesome variable names.
 
4:34 AM
@BenjaminGruenbaum Sorry, I guess I didn't Google it properly
 
@KendallFrey It does. You just need to provide a user id.
 
4:48 AM
this room is so active
there are no people in other rooms (web development)
 
@vincent It's because Java and Javascript are the most popular web development languages right now
 
@O0oO0oOO0ooO yeah.... :)
 
Talk about the blind leading the blind
 
5:14 AM
I saw this incident many times here in India
no one cares them
I don't know how a blind leads another blind to a bus stop? :/
 
Those people are metaphorically blind
 
hi , i want to load an entire page from a url. it will work like an iframe but i dont wnt to use the iframe tag because of the overflow problem. instead, i want to use a div. i thought of using ajax but how to make the scripts of that loaded page work?
 
If you don't use an iFrame, you'll have an issue with your CSS spilling into the page
also, with preserving the original page CSS
Not to mention that you'd need to prevent the page CSS from spilling onto yours.
Also, you can't load a cross-domain page without using a server proxy. You can open a cross-domain iFrame, however (but not talk to it)
If you're loading a cross-domain iFrame, you can't adapt to its size. Period. That would be a security risk.
If it's a same-domain iFrame, adapting to its size is probably much easier than reseting your CSS inside the content and mangling the content CSS to not affect your page. The latter can be done with scoped styles, and the former can probably be done with shadow DOM. The problem is, the shadow DOM spec is not done yet.
 
5:54 AM
@vincent if you have overflow problem then why not set the iframe with overflow:hidden?
 
6:24 AM
@O0oO0oOO0ooO i need to overflow: visible but iframe forces to have scroll
i have some dropdown on it so i need to show it over.
 
test
 
@vincent resize the iFrame based on its contens, set it an invisible border, and enclose in a container with overflow:visible
 
Why is that an iFrame? That's not what I imagine as "entire page"!
Why is loaded separately?
 
@JanDvorak i thought i could make use of the iframe but now i know its not gonna help. lol
 
6:38 AM
since you're already using jQuery, AJAX is easy
and so is DOM manipulation
If you want nothing else than load some div asynchronously (WHY???), it's as easy as $('#target-elem').load("path/to/the/content")
 
@JanDvorak so its gonna use the scripts on that other page right?
 
I think he is currently in a situation where he is extremely lazy like I was last time
so do not want to use javascript to remove divs and replace it with other divs, instead just load a new page in iframe
 
@O0oO0oOO0ooO not lazy. but i need to do it the fastest way. lol coz i need to do demo hahahaha
 
@vincent I see
 
6:43 AM
well, it's better not to load a page with scripts
 
@JanDvorak ok thanks guys
 
That's why I could not find any hotels when I tried to search them
 
@alexche8 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.
 
7:04 AM
Converting my square system to
hexgrid has became the hardest challenge of my life for me -_-
i am such a fail!
 
@Darkyen Have you given redblobgames.com/grids/hexagons a read yet?
 
just found it :D .. tried to do it myself and ended up confused :-(
PS @IvoWetzel damn man ... sorry i completely forgot you exist!
up for a side project mate ?
 
:D
Maybe, got plenty of time on my hands right now after Zynga went crazy with their layoffs
 
@IvoWetzel :(
 
You got a place where i can pm you the concept ?
 
7:10 AM
@Darkyen Do have Skype?
 
Yes!
"fanofcena" is the name
 
I'll add you in a moment :)
 
@Darkyen sorry to butt in, but as in John Cena? :)
 
cena meant Food in some random language i was told
the name stands since i was 13
it be old it be old
 
7:12 AM
balls, that link is great!
 
\o/
@mikedidthis besides, "Khana" which is similar to "Cena"(if u pronunce it wrong but that could be result of 100s of years of language changes) means food aswell
and means main meal in hindi :P
 
@Darkyen its only 8:14am, its too early to be hungry :(
 
7:25 AM
@Darkyen La cena :
I though everybody knew this painting and its name
 
@dystroy We got taught the translation instead, The last supper.
I thought everyone knew the story of the Trojan Horse until I had to explain it to my girlfriend. She couldn't understand why they fell for it. :(
 
@mikedidthis To be fair, the real sense of the Trojan Horse story is probably lost. I suppose this was a kind of metaphor, it's not possible to imagine soldiers being so dumb in this practical situation.
 
@dystroy I dunno. If some one made me a big ass wooden horse, I think I would take it in :)
 
A wooden horse with breathing holes and a door and which says "Ouch be careful" when you move it ? You'd let it just next to the conveniently easy to open doors of your city guarded by soldiers only facing outside and not noticing the door is opening ?
 
@dystroy when you put it like that ...
 
7:33 AM
It's just like... do you imagine people opening a PPT file sent by their father as attachment to a mail titled "Funny" ? Do you think people are so dumb ?
 
@dystroy I think dumb is a harsh term. Trustworthy / uneducated maybe a better term.
@dystroy But either way, yes. If people didn't fall for these exploits, then they wouldn't be created.
 
@dystroy The last supper ?
sorry i am not a christian and we are Brit english students
 
@mikedidthis the second comparison was just a joke. I don't think both cases are comparable in reality.
 
@dystroy ahh ok. But people fall for it sadly.
 
srsly... is there an exploit in PPT?
 
7:43 AM
what tells you it's a ppt?
 
10 mins ago, by dystroy
It's just like... do you imagine people opening a PPT file sent by their father as attachment to a mail titled "Funny" ? Do you think people are so dumb ?
 
I think PPT was just an example of an attachment.
 
@JanDvorak I've seen attachements called "funny.ppt .exe"
(the last part is hidden in some mail browsers)
 
@dystroy now that's bad. But then again, it's windows' fault for hiding extensions
 
In the old times, you could do very nasty things with the scripting languages you had in MS Office files
 
7:47 AM
Those scripts are blocked now by-def, aren't they?
 
They changed a lot. That was like 20 years ago, MS learnt a lot about security.
Am I the only one who doesn't receive updates on SO questions today ? Is the websocket server down ?
 
The websocket server seems healthy to me
 
Morning
 
@JanDvorak ok, thanks. I'm just damned so.
 
8:15 AM
@AAA 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.
 
AAA
Hi, how do I get a "permanent" access token for FB's Graph API? We used to be to able to get anything from a public Page but now it's changed so that you need an access token for anything. I have already used the Graph API Explorer but I think I need a way to refresh the token in JS (?) if I'm going to get JSON data.
 
Sorry if this is a silly question, but how do you normally generate HTML content for Ajax requests? Do you directly return HTML, or do you return JSON and generate the HTML in JS?
 
depends
 
@Cubic both are possible. Depends on who you want to be responsible for the view
 
but if you use json, use templates on the client side
 
8:19 AM
@FlorianMargaine Client side templates?
 
I'm using the play framework. I have templates, but those are essentially Scala classes. I'm assuming you're not talking about those
 
AAA
This is the only query I need for the Graph: /feed?fields=message,application,picture&access_token=
Now, how would I, in Javascript, refresh my token? It seems the token lasts an hour... also, seems a bit overkill to get a new token every hour.
 
@Cubic nope. I'm talking about templates hidden in the HTML that you use in your JS.
google "client side template", you'll get plenty of results
 
Hey guys, I'm wondering if there is a way to compare two objects in an array? Like index 0 and 1 for example?
 
8:28 AM
@SnakeEater as in, a[0] == a[1]?
 
In a loop, but I found this: api.jquery.com/jQuery.unique
google is my friend
:P
 
bonjour a tu le monde
 
@badbetonbreakbutbedbackbone salut
 
@JanDvorak merci ami
 
Le monde dit bonjour dos
 
8:31 AM
merci à tout le monde
@FlorianMargaine Aujourd'hui, nous allons parler en français seulement discussion
 
hopefully not, seeing how bad your french is
it feels like talking with retarded people
 
@FlorianMargaine Well that bodes well for my upcoming trip to France, since I don't even understand ^^ that
 
@FlorianMargaine lol ok
 
Today, we speak French <something> discussion?
 
Aujourd'hui, nous avons besoin d'apprendre le français
 
8:34 AM
@DaveRandom seulement = only
 
discussion would be "chat" :P
 
Ahh I knew I vaguely knew it
 
@DaveRandom "today we speak french only discussion" doesn't mean anything
 
today we will speak only french in chat ... but google translate is not so smart :P
 
Not really done any French since 3 yrs from 13-15
 
8:35 AM
oh.
"chat" is "chat" in french too
 
ok! :P
i love IT terms since they always the same in all the major languages
 
Except for chinese and hindi
 
who invented the e-mail term? do you know?
 
Yes, every language has blinkenlichtenflaschen.
 
the one invented email term is a genius and i guess he is the same inventing password term :D
true? :O
 
8:38 AM
@badbetonbreakbutbedbackbone I would guess Xerox, but I could be wrong. Can't find any references.
 
oh could be more believable i think than vashiva.com/inventing_email.asp :P
Xerox invented mouse right? wtf they rocked in the past
as i remember they invented also the first user experience interface afaik
the one apple stoled :P
 
Xerox invented most of what we know as the internet and personal computing today
but they were terrible at marketing
 
wow damn they just had to invest some $ in marketing i think :P
and they actually were the biggest company , lol
what a stupid fail :/
@DaveRandom Dave do you joined stackoverflow since it was a beta site ?
 
They were also just too far ahead of the time with it though, the world just wasn't ready
@badbetonbreakbutbedbackbone No I was pretty late to the game, 2k11 IIRC
 
yeah that for sure it was really hard to predict somenthing i guess
@DaveRandom oh ok , my couriosity, cause i would like to know if stack used web-marketing in early stages
do you even know?
i guess they never used any kind of promotion or web-marketing service right !?
 
8:52 AM
I have an odd problem on Firefox (no other browser). It returns an empty array for
Object.getOwnPropertyNames(window.location)
Why ?
getOwnPropertyNames is supposed to return even the non enumerable properties...
Is that because they're inherited ?
But I don't find the properties using proto
 
host object...
 
Well, it's normalized. The MDN says pathname is a property, why doesn't FF enumerate it ?
 

« first day (963 days earlier)      last day (3971 days later) »