« first day (1333 days earlier)      last day (3608 days later) » 

12:13 AM
user image
2
^^ Toothless ^^
 
12:35 AM
@doctordoder 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.
@tehfailsafe 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.
 
has to be trolling
 
Fits most programmers
 
!!s/p/b/
 
@Mosho Fits most brogrammers (source)
 
12:47 AM
@Mosho Haven't seen you in a while and you start with a joke like that? Disappointing …
 
> I told them I knew C because I am good with email and word.
facepalm
 
@Junaid 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.
 
> I know welding because I work in a building
 
That reminds me of a pet peeve of mine
 
Going to this tonight, should be fun
 
12:49 AM
People ask me to do mental arithmetic for them, because I'm a math nerd
News flash: I was near the bottom of my class in terms of mental arithmetic speed
Just because I'm a computer programmer doesn't make me any more proficient at printing a document than you are.
 
@copy <-- must be trolling
@SomeKittensUx2666 I've rigged it so you end up with a guy that says he knows C (because he does the Google and the Word)
 
@copy I apologize if I ever did anything to make you think I'm funny
I was probably high
 
@monners oh goodie. I can punch him
 
@catquas 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.
 
@Mosho @copy 's just jealous he wasn't accepted into the brogrammer club in highschool :P
 
12:53 AM
punch him and call him Wheatly
 
@KendallFrey SPAAAAACE
 
Guess what? SPACE GUN! BAM!
 
We're in space.
lol, I actually played through that again this weekend
So funny.
 
1:15 AM
btw
1
Q: Is editing in resource links on an existing answer appropriate?

Benjamin GruenbaumSo, I've visited one of my answers here and noticed something strange in the revision history: It's something like this. Initial edit by me Spot on technical clarification by Quentin. Additional edit by me. Grammar improvement by Dgrin91 Additional info by me. Edit suggested by Aswin Anand who...

feedback-please
 
@monners That'll be the week after the company collapses
 
new THREE.TextGeometry("Hello, World!", { size: 0.1, height: 0.01 });
throws
Uncaught TypeError: Cannot read property 'normal' of undefined
am I missing something?
 
Yes, stackoverflow
 
what?
 
1:30 AM
You're missing a search query on stackoverflow.com
 
@KendallFrey have you imported a font?
 
0
A: How to make parameters Optional in node JS rest API

SomeKittens Ux2666Using URL parameters like this is not RESTful. Instead, use GET parameters, e.g. a call to http://server:port/v1/api/test-api?userId=123&userName=SomeKittens&userEmail=kittens%40example.com You can then define your routes like: app.get('v1/api/test-api', function(req, res){ var userName =...

Am I right in insisting his URL scheme isn't RESTful?
 
@phenomnomnominal No, I'm working on it now
it works!
@copy Thanks for reminding me
 
Some people recommend placing 2D text on top of the Three renderer rather than actually rendering it in the scene. Is this a good idea? I don't really like it.
 
1:39 AM
@KendallFrey depends on how you're gonna do it
 
That doesn't sound right, but I don't know much about this topic
 
Just an ortho camera pointing at the text
 
If you're going to be able to move about in the scene, then you need to render the text too
 
The text is going to be on the HUD
 
I do both here
 
1:41 AM
twitter and GH links are DOM?
 
and the "blog" (that i will probably never ever use haha)
 
How are they positioned?
 
getting shit to line up is a cunt hard
 
1:42 AM
I imagine
Why do you do that, though? performance?
 
basically a grid
for one, you can't select rendered text
 
@SomeKittensUx2666 what is the resource?
 
also, it means you still have valid markup for when webgl isn't enabled
 
@BenjaminGruenbaum Not sure, from his question.
 
My game uses all sorts of fancy stuff
 
1:43 AM
/me edits
 
WebGL enabled is the least of my worries
 
@KendallFrey yeah, I'd not be worrying about it for a game
 
pointer lock FTW
 
In fact, if you find a good tool for rendering 2d text to the image plane, I'd be keen to know
 
You mean besides overdrawing it with an ortho camera?
 
1:45 AM
yeah, two render passes seems less than ideal
 
@SomeKittensUx2666 I guess the API is users
 
@phenomnomnominal one seems impossible
 
@OwenVersteeg 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.
 
I always used two or more cameras for games with HUDs
 
@SomeKittensUx2666 I'd do /users.json?first=a&second=b&third.c or something like that
 
1:47 AM
I think at one point I had a scene camera, a HUD camera, and a map camera
 
@KendallFrey is your HUD 3d too?
 
This one won't be
 
maybe you could render with Pixi to the same canvas?
My gut says that a dedicated 2d renderer should be quicker. Might be wrong though
 
quite probably
since it doesn't need to triangulate the font
 
Exactly
Although that probably only happens once
 
1:49 AM
@phenomnomnominal In my case, I'll be generting new text every frame
I'm not going for performance at this point, since I'm still relatively new to game programming
 
@KendallFrey wouldn't it just do the whole font on load?
 
First I''l focus on getting something that runs
 
@KendallFrey fair enough
 
@phenomnomnominal maybe, idk
Side question: Do you know of a JSFiddle style site that can display a site directly (i.e. without the iframe)?
I wanna show off my prototype, but I don't have time to set up a properly hosted site
 
0>a.opts.offline_redirect.length&&"offline"==a.data.mode
I know it might sound a bit dumb, but what is the a.opts. ?
I see the offline_redirect but not those..
What does the . do exactly?
or the name of what that is so I can look it up
 
1:54 AM
property accessor?
 
@phenomnomnominal the a.opts is what I am confused about...
 
2:07 AM
@MichaelRusch 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.
 
@BrandonGelfand the . looks up the property 'opts' on the object a?
 
2:24 AM
@KyleLacy 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.
 
@KendallFrey what's wrong with an iframe?
 
3:25 AM
arg
so I'm at a pair programming hacking event
and you choose if you want to be a dev or idea person, I chose dev
and my "idea person" doesn't have an idea
 
lol
LOL man..
> I'm an idea person!
 
@phenomnomnominal Yeah, I realized that eventually, sometimes the code becomes a tad overwhelming..
 
just something I imagine someone saying after they've been asked.. "What do you do around here?"
 
@SomeKittensUx2666 What are you supposed to do? Is there like a theme or something along those lines?
 
@BrandonGelfand No, just a bunch of people come together and spend two hours pair programming
 
3:28 AM
Ah
 
and this guy basically can jQuery.
 
@SomeKittensUx2666 Hey, thats all I can do! and a little more... I sort of learn as I go, lol. Reading is to boring for me.
 
Why do I always attract the weirdos...
 
tip: don't touch jquery until you get really sick of writing out a bunch of javascript
 
@Meredith I got sick of it on the first day, lol
 
3:30 AM
not sick enough
 
oh criminy.
> Uber for strippers
 
@Meredith I feel its more productive to use jQuery, it tends to be a lot faster to write.
 
It is faster to write
Newspeak is also a lot faster than English
 
@SomeKittensUx2666 Well I had an idea for a note taking thing... like Summly but with class notes that pull notes from the best people, sort of rating them.
 
"Sort of rating them?"
 
3:33 AM
@SomeKittensUx2666 As time goes on it would basically keep track of who contributes the most, who has the best notes, who's notes are more reliable, giving them a rating type score
The higher the score the more reliable the notes.
 
So, a wiki?
 
@SomeKittensUx2666 No, a collective of notes taken in a class room.
Compressed into one
 
Think like stackoverflow, except instead of questions, people post notes
 
^ ^ Yep
With the addition of pulling apart the best of the notes, who's most detailed, hence where the score comes in
Who's notes are most reliable, etc
Say 5 people got a note, 3 didn't, obviously the note is needed for the other 3. But if one of the 3 has a higher rating, maybe the other 5 are wrong.
 
3:48 AM
I think it's sweet
like asking someone out on valentine's
"can I be your idea person?"
 
4:00 AM
@SomeKittensUx2666 What are you guys using as your idea?
 
4:25 AM
@SomeKittensUx2666 Oh yeah, how'd the pairing go?
 
4:41 AM
@robomc 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:27 AM
Easiest way to cheat the github contribution graph: Stay up past midnight writing code.
 
5:56 AM
Can someone please point me in the direction of a decent breakpoint guide?
As in devtools break points
 
@DETJOHNKIMBLE 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.
 
anyone here...??
 
0
Q: AngularJS | Conditional based on the results returned by $resource promise

Monty MonroI am calling my api through angularjs and returning a list of 'reports' to angular through the $resource promise. Based on whether any results were returned I want to either show a modal with the report information or successfully save the sale. I have spent some time pulling my hair out over th...

 
var test = 12.56789;
alert(test.toFixed(3)); //gives 12.568
but I need
12.567
can anyone pls help me
 
@NevDull 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.
 
6:11 AM
multiply by 1000, use Math.floor(), divide by 1000, and toFixed(3) it?
 
@OkazakiYuta 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.
 
Illaya: function truncate_thousandths(myNum) { return (Math.floor(myNum * 1000) / 1000).toFixed(3); }
 
@Illaya it rounds as a floating point numbers
!!>0.035.toFixed(2)
 
@Mosho "0.04"
 
!!>0.045.toFixed(2)
 
6:23 AM
@Mosho "0.04"
 
make your own function as suggested
 
@Mosho yes. is anyother method to do this?
 
your own function
 
@Mosho oh! ok. thanks for your reply
 
Morning people :P
Or afternoon/evening/night
 
6:25 AM
@Illaya also, getting answers for this kind of question is much faster on google than it is here
 
ok
 
thanks this will also produce as same as what i want
Math.floor(test * 100) / 100
@Meredith
 
7:06 AM
can anyone help?
1
Q: Default date format of Javascript/Jquery

DhwaniI have a kendo date picker which is set to format date as "MM/dd/yyyy". I want to check using jquery/javascript that if kendo date picker date must not be future date and date must be greater than '01/01/1900'. The issue I am facing is when I take new date in script, it is like Date {Tue Jun 10...

 
@Dhwani You already got 3 answers.
 
@atif93 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.
 
@SecondRikudo bt it still giving error in modal
 
@Dhwani answer already given that should work check ur console please
 
@Felix 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:42 AM
@jhurliman 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.
 
I just met you, and this is crazy. But here's my code base. So halp, I'm lazy!
 
How to close this one ?
0
Q: Return a javascript Function after execution of another nested Jquery call completes

SreerajI am trying to bring out a transition effect with JqueryUI on page exit. This is my code var done = false; function () { var r = animate(); $.when($(".mainmenucont").effect("drop", null, 1000)).then(function () { done = true;console.log(done); }) console.log(done); ...

 
@dystroy I dunno.. can't close it for being a wall of text
not like it isn't explained well, but it could really use a jsfiddle or something
 
I voted to close
 
If he's using sleep, someone needs to correct him in an answer
i don't think it's worth closing if he's trying to achieve something using a misguided concept
It's just one of those things where the OP needs to see the forest from the trees
 
7:50 AM
It's also a duplicate of so many questions, for example the well known stackoverflow.com/questions/14220321/…
 
Meh, he doesn't even realize that he's dealing with an asynchronous issue imho
Though it should be said that most questions are duplicates of others
 
@Pait 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.
 
@Neil But could it be said that most questions are duplicates of others?
 
If you're not that experienced with Javascript, it's quite something, wrapping your head around the idea of asynchronicity, I also still sometimes find myself making that sort of mistake occasionally
 
@Magikaas True, and I'm sure at a certain point in my career as a programmer I wondered whether or not "sleep" would fix such a problem, and then 5 minutes later I realized it wouldn't and an hour later I realized why
Maybe he's still in those 5 minutes?
 
7:54 AM
@Neil Hahaha :P Yeah
Well, the question is 5 minutes old. E: Nvm, 13 now, gotta love refreshing =_=
 
@monners I think you could find a question that answers the very same of any other question, albeit circumstances may be slightly different.
 
@Bibhuti 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.
 
@FlorianMargaine Good comment. I was a little worried about this guy's obsession with generators...
 
I don't mean to sound arrogant, but some ideas we get when we're learning how to program can be easily shown to be false if you reason through the concept
 
thanks
 
7:57 AM
@dystroy yeah, same
 
morning all
 
@Neil Yeah, you have to think through different 'channels' to realise certain things just don't work the way you are trying to do them. Perfect example being asynchronicity in javascript through either animation-finishes or AJAX requests
I had that sort of issue just a few days ago, where I got an AJAX result and then had to put it into local cache, but I was also trying to access the data that would be requested, while the XHR was still running, if my local server was derping for whatever reason. Which gave me some strange behaviour
Depending on how important the requested data is, you sometimes have to completely halt your application through an artificial 'loading' overlay, while the XHR is running, or stop everything that normally happens on a click, everywhere in your app
I've been thinking of putting in a function that checks to see if an XHR is running and which one, so I can disable certain parts of the UI when an XHR is running that influences functionality of parts of the UI
Wonder, before I start on it, if it would be doable and if anyone else here has done this and what I might want to look out for. Because I'd have to map UI parts to XHRs and check if any of the XHRs mapped to the part of the UI that is receiving input is running and if so, tell it to stop whatever it is doing and possibly show a message of some sort.
Dat Wall of Text O_o

TL;DR: Is it doable and/or the way to go to map async events to UI parts that depend on them, to avoid strange behaviour? :P
 
Why would you save ajax results?
 
Not that it's wrong, but, if it were static, it would be on the page itself, so at some point you'd probably want to update it
 
8:08 AM
My example is a Manga Reader I'm making as I'm practicing javascript
I fetch a chapter list and later a page list
These rarely (if ever) change
While reading
So I save the page list locally
Maybe, not the chapter list, but I can give that a timer to invalidate local data after a minute or so, so it will be refreshed next time it is requested by the user
 
@bjb568 what's the point of those "morning" and stars ?
 
@dystroy Why's the point of any fun?
Kill the children.
Burn the candy.
Vaporize the toys.
 
@Neil I want to keep 'load' and bandwidth to a minimum, if I want to do this from my own computer or a cheap php hosting service, thus I locally cache these sorts of things
 
@Magikaas You need to implement some sort of expiration system then
Save also the date, and check if it is too old, otherwise all your clients will never download from the server again after the first time
 
Yeah, I intend to, once I have the code for fetching the chapters/pages down
 
8:13 AM
You may think you'll never need to, but you will :P
 
@seabeast 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.
 
If I don't anyone that never refreshes, never gets updates, so I intend to 'invalidate' local data after 1 minute, so it will be updated from the server upon next request from the user
Or after 30 minutes if the user is still active on the page, but I'm not sure about that one
Though I think that could work, since anyone going afk would not update, but an active user might see a new chapter being added
Which, in my opinion, sounds pretty cool
 
@Magikaas I think it's smart, but the periodic invalidation has to work first
 
@Neil Yeah, but before that, I have to be able to fetch the data :P That's my first prio right now, hehe
 
@Magikaas You can modularize that aspect of your code
In the sense that it doesn't matter what data you're saving so you can generalize if you wanted to use it elsewhere too
 
8:19 AM
@Neil Right now I have different classes for different bits of data, which I all save into a global LocalObjectStorage object, which has functions for fetching different types of data that I need in the application, I'm probably overcomplicating things :P
 
@Magikaas Sounds like you're writing a library :P
 
@Neil Yeah, I have a feeling it's getting a bit out of hand, these sorts of things tend to happen when I start to write code, I unintentionally make things too 'reusable', when they don't need to be
the LocalStorageObject has an extend function for adding new data types with their appropriate functions, not something you'd need for this, but I guess I can rip that part out and make it a separate include later, so I can use it on other projects, if I can write it well enough to be reusable
Since I do want to learn to write code I can be sort of proud of and might want to use either at work on on personal projects, not just nasty code that works the way I want it but no other
 
@SoumilDeshpande 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.
 
But it's getting along nicely so far :P Slowly but steadily I'm learing OOP javascript and learning to deal with asynchronicity in javascript
 
@ClementMandragora 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.
 
8:25 AM
TL;DR: It's fun :D
 
sex is fun
JS is ok
 
To each their own hobbies and preferences
 
my way or the highway buddy
!!ban Magikaas
 
@Mosho Magikaas added to mindjail.
 
.__.
 
8:28 AM
:>
!!unban Magikaas
 
@Mosho Magikaas freed from mindjail!
 
<3
 
@Magikaas That's a noble goal. That said, you're not going to be able to finish it :P
 
@Neil That is my fear too, I have not set a deadline on this project, so I have a feeling it will be ongoing indefinitely... >_>
 
@Magikaas Self-motivation is a big problem for me too
 
8:30 AM
it's a myth for me
 
You want to have something to be proud of, but you feel you have to write everything required from scratch.. and it never gets done
You eventually decide you've ventured too far to get back to where you were before, and you're no longer interested in finishing what you're working on
The trick is to be minimalist and only do what has to be done
 
@Neil Get out of my head!
 
Elaborate after it works :)
 
There are also some good anti-Akrasia tactic on Less Wrong: wiki.lesswrong.com/wiki/Akrasia
 
@Magikaas Anyway, I like the sound of what you're doing with the local storage, but it also sounds like you're entering that trap :P
Be careful
 
8:34 AM
Haha, yeah... I can save and fetch data right now in that local storage, I'm keeping it at that for now, so I can finish actually GETTING the data I want to save in it... Not much use of a storage without something to store in it
 
Sometimes I feel like I'm measuring a coastline, and I switch from using a yard stick to using a ruler
I just can't seem to shake this idea that even though I think it will just take a minute, it will end up taking the next few days, and that's assuming something else doesn't come up in the meanwhile
 
I get that it is annoying that "this" does not stay bound to the scope when calling setTimeout. But that made me think of something else: If Functions are Objects, shouldn't "this" inside a function refer to the functions own local scope?
 
define own local scope
 
@Neil When I feel like that about something I'm doing, I ideally want to divide it into bite-size chunks and just do small things at a time, but that's hard when dealing with software, as parts depend on eachother, so you have to do this to do that, and so on, ending up with big chunks of small chunks that are linked together xD
 
@jAndy if I have a global function and all it does is console.log(this). If Functions are Objects shoulndt "this" be the function and not the window? (I mean it would make functions pretty shitty, but still..)
 
8:40 AM
this will always refere to the object of invocation or the context object bound to a function
if there is no object of invocation it'll always be global. Thats how its specced and that's how it should be.
Amen !
:P
(unless of course we are in blasphemy strict mode, then this will be undefined)
room topic changed to JavaScript: There Is No Undefined: DO read this link: rules.javascriptroom.com. Before asking inform yourself on the XY problem goo.gl/taIqf [ecmascript] [javascript] [undefined]
 
So you don't think it is stupid that a setTimeout sets the "this" to global ? :p
 
actually no :P because its not the setTimeout's fault.
 
@Schoening why would setTimeout be different than all others functions?
 
its because you're passing in a function expression with no scope set or invocational object
ITS ALL ABOUT FUNCTION
HE's COMiNG
what was the bots command for those noisy UTF8 characters which fuck up the lines :P ?
 
zalgo
but I think it was removed
 
8:46 AM
@FlorianMargaine I think what I am trying to say is when I define a function in a scope I want it to refer to the scope. A timeout doesnt do that tho. I "think" I understand why. But it can still be a little confusing I think
jesus christ I am tired.. look at that awful repetition
 
@Schoening anytime you have a new function, this changes
that's it
hence the common var that = this;, btw.
 
Yeah I am using that.
 
@Magikaas Well, ideally that's how you're supposed to want to write a program
 
@DMA 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.
 
8:48 AM
:(
 
If you can modularize, it means you don't have to worry about other aspects of the program, and the less you have to keep in your head at any given moment while you program, the better your program will ultimately be
But sometimes you can't really do things that way
 
I like the poll they did at the php room
 
They seem uncertain
 
!!/google HHVM
 
@Neil That does sound like the way to go, I guess I'll need a bit more experience with either programming in general or javascript, to be able to effectively modularize what I'm trying to make.
 
Well the local storage thing is a good example. You shouldn't care about what gets saved. Only that if it is expired or has never retrieved it, it will fetch it from the server
 
Because I tend to slip in dependencies
Without realising it until it's too late
 
You should be able to give it everything it needs to know in order to do this without it having to know about the rest of your program
It makes it reuseable
 
Ah, I see, that makes sense.
So you can 'plug' it into another project and use it, without too much hassle
 
@FlorianMargaine "anytime you have a new function, this changes
that's it". Could you clarify what you mean by "changes". What I mean: http://jsfiddle.net/LcT6N/2/
 
8:56 AM
@Schoening anytime you write function() {, this is going to change
it might change to be the same object, but it still changes
 
Alright. That's what I thought you meant. Semantics.. change / updates
Oh. I see what I didn't think of! setTimeout( ... ); is a function call.. I thought of it as "writing" a function.
 

« first day (1333 days earlier)      last day (3608 days later) »