« first day (1320 days earlier)      last day (3622 days later) » 

12:00 PM
third one
 
the first one
actually, both are good
 
@rlemon this
hm, depends
 
both readable, first is slightly better?
 
First one seems more common, though. So it would probably be more logical to most people
 
I use in when I need to know if the property exists, and 1st if I need to know if the property is undefined or something
 
12:01 PM
basically, use what makes more sense semantically
 
Are they functionally the same, though?
 
if( req.user ) {
  // ..
}
if( 'user' in req ) {
  // ..
}
if( req.hasOwnProperty('user') ) {
  // ..
}
I use 'user' in req
 
Hey Hey Hey guys
 
hi
 
but made me wonder what other people would do
 
12:02 PM
Well, my preference goes out to the third one.
 
Why there is no JS bytecode specification?
 
At least that one immediately makes clear to the reader what's going on.
 
cause js has no common vm ?
 
So? Lua has bytecode spec and VMs have to respect it.
 
@rlemon i use the same
 
12:05 PM
@BartekBanachewicz ES is a language standard, not an implementation's
 
@SamP 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 bytecode isn't directly related to the actual implementation
16
Q: Lua's bytecode specification

Wilfred SpringerCan anyone tell me where to find Lua's bytecode specification? I've been searching for 15 minutes, and I can't find anything.

 
@BartekBanachewicz I know, I'm just saying that ES is the language standard, and there's no implementation standard
most JS engines were interpreted until a few years back
 
some are still. ( iOS i see you! )
 
perhaps it would be worthwile to add official bytecode specification to next iterations
that way "compilation to js" would turn into "compilation to js bytecode"
which could be tremendously simpler in some cases, I suppose
but it would probably be rejected by W3C because it's not "open" and "free"
 
12:10 PM
@FlorianMargaine I would argue that they're still interpreted
 
@BartekBanachewicz no, that wouldn't be the issue
nobody listens to the w3c anymore anyway
the biggest issue would be "which one to choose", since google, mozilla, firefox and apple would get a standard
and no engine will want to change their engine to use the spec
 
I don't think either of their internal intermediate representations would do
 
Ahh, Browser Wars.
 
@BartekBanachewicz trying to write javascript but not javascript... are we ?
 
@AbhishekHingnikar never write javascript if you can avoid it vOv
 
12:13 PM
traitor!
 
write coffeescript then
 
coffeescript isn't much better, really
 
or microsoft (R) TypeScript (TM) (R) (C)
 
@AbhishekHingnikar TS is OpenSource.
 
@BartekBanachewicz I know, I was kidding
 
12:14 PM
am just trying to make a joke there -_-
 
either way, compiling to another language is always problematic
 
on the background of Microsoft... Microsoft (R) Internet Explorer (TM) (R)
 
compiling to its bytecode, though...
 
I would propose you fay :P github.com/faylang/fay/wiki
 
@BartekBanachewicz compiling to the same language is more problematic, and it's the only alternative
 
12:14 PM
that i agree upon @BartekBanachewicz :D
i'd really be happy if there was a python bytecode spec
 
until Fay gets typeclasses, it's just a toy for me
 
Almost all compilers compile to a different language
 
I compile to juice.
 
I COMPILE ENGLISH TO PYTHON (well a subset)
 
@KendallFrey there's a major difference between intermediate binary representation and a human readable programming language
 
12:16 PM
@BartekBanachewicz But not in theory
 
not in execution, but in ABIs and boundaries
 
Read the definition of compiler
 
IDG what's your point here.
 
@KendallFrey i have missed u.
@BartekBanachewicz i quite don't understand you at times.
 
> A compiler is a computer program that transforms source code written in a programming language into another computer language.
 
12:17 PM
all I'm saying is that interfacing different languages compiled to js (including js) is hard because of, lol, language barrier
 
iirc you were trying to avoid js to write something in js months ago.
 
so we should compile to something that actually allows sensible interoperability
 
still stuck there ?
 
@BartekBanachewicz doooooot neeeeeeet!!!!
;)
 
@AbhishekHingnikar dunno which one, I wrote quite a number of js projects recently
 
12:18 PM
@KendallFrey or jvm
 
@KendallFrey you mean MSIL?
 
@AbhishekHingnikar bleh, only one language
@BartekBanachewicz or CIL
 
@KendallFrey um?
 
the easiest would probably be to take jvm bytecode or msil, but I'm not sure they fit correctly with JS's paradigm (closures everywhere)
 
I don't think either of those would be really sensible
just like LLVM IR wouldn't
@FlorianMargaine hence why I even started this discussion
 
12:19 PM
JVM uses Java. .NET uses C#, VB, F#, C++, Python, etc.
 
Scala, Clojure, Jython...
numerous others, prolly more than on .NET
 
on JVM?
I doubt it
 
CLI Languages are computer programming languages that are used to produce libraries and programs that conform to the Common Language Infrastructure (CLI) specifications. With some notable exceptions, most CLI languages compile entirely to the Common Intermediate Language (CIL), an intermediate language that can be executed using an implementation of CLI such as the Common Language Runtime (CLR, a part of the Microsoft .NET Framework), Mono, or Portable.NET. Some of these languages also require the Dynamic Language Runtime (DLR). As the program is being executed, the CIL code is just-in-ti...
This list of JVM Languages comprises computer programming languages that are used to produce software that runs on the Java Virtual Machine (JVM). Some of these languages are interpreted by a Java program, and some are compiled to Java bytecode and JIT-compiled during execution as regular Java programs to improve performance. The JVM was initially designed to support only the Java programming language. However, as time passed, ever more languages were adapted or designed to run on the Java platform. High-profile languages Apart from the Java language itself, the most common or well-kno...
not more, I s'pose, but still comparable.
 
yeah
 
so yeah, JS might as well start its own, with closures and hookers
JSIL
 
12:22 PM
I'm working on writing a compiler, but I have to invent a language first
 
    var fileInput = document.getElementById('PhotoUploadInput') || document.getElementById('PhotoUploadInput2');
fileInput.addEventListener('change', function(e) { // }
would this work?
 
you should know your elements.
 
get that element or that other one maybe
 
in what case would you need PhotoUploadInput2
 
it is for uploading photos in a web app
 
12:24 PM
:facepalm: really?!
 
when you make an input allow multiple, on an phone you lose the ability to take a photo immedaitely
 
so again, in which case would you want to select input2 over input1?
 
so i want two inputs - one that allows multiple photos selected from the device and one that allows to take one eimmedaitely
in the case of multiple photos lol
 
and how do you check for that?
var fileInput = document.getElementById('PhotoUploadInput') || document.getElementById('PhotoUploadInput2');
 
well, thats part of my original question
 
12:25 PM
says, if input 1 doesn't exist, select input 2
 
mmk
 
var inputs = document.querySelectorAll('#foo, #bar');
[].forEach.call(inputs, function(input) {
  input.addEventListener('change', handler, false);
});
function handler(evt) {}
 
@Bubbas don't guess how APIs work. Read the docs and make educated decisions.
 
i see, thank you rlemon that gets me started
 
0
Q: NodeJS docs generator

Ionică BizăuI need a NodeJS based generator that takes as input a JavaScript file and generate markdown documentation. Example: /** * foo * foo description * * @name foo * @param {String} a Some description * @param {Object} b An object param * @return {Boolean} Some foo again */ function foo (a, b...

If you have any suggestion...
 
12:28 PM
@Bubbas I'd dare to say that if you listen to my suggestion, it will take you farther than @rlemon's piece of code.
 
^
 
lol
its not like i dont read docs, guys
or gals
 
no more gender-aware language :|
 
gotcha!
;)
 
besides, there are no girls on the internet :P
I like to understand that in that positive way, that our gender shouldn't determine how we are perceived
before anyone jumps at me for that.
 
12:31 PM
Hello,
I got this object
		var collections = {

			"PTR": 			collectionPTR,
			"Losacero": 	collectionLosacero,
			"Lámina": 		collectionLamina,
			"Polín": 		collectionPolin,
			"Malla": 		collectionMalla,
			"Leds": 		collectionLeds,
			"Varilla": 		collectionVarilla
		}
 
Object object
 
so
 
values are mongodb node collection instances
 
that code is utilizing prototyping of the array object i see
 
but when I try to do:

collection["PTR"]
 
12:33 PM
@BartekBanachewicz it makes things easier if you imagine everyone is a fat dude programming in his mothers basement.
 
orr
being PTR=="PTR"
 
collection !== collections
 
my typo here
collections
 
kk
 
that typo changes things rather radically.
 
12:34 PM
I know, it was here :P
 
!!> var collections = { foo: 'Bar' }; collections['foo'];
 
@rlemon "Bar"
 
so what is the issue?
 
2 mins ago, by diegoaguilar
values are mongodb node collection instances
 
ohh
never used Mongo
steps back
 
12:35 PM
But what's the issue?
 
I'm getting this:
TypeError: Cannot call method 'find' of undefined
    at Object.handle (/home/diegoaguilar/DigitalOcean/activos/acero/server.js:180:26)
    at next_layer (/home/diegoaguilar/DigitalOcean/activos/acero/node_modules/express/lib/router/route.js:103:13)
    at Route.dispatch (/home/diegoaguilar/DigitalOcean/activos/acero/node_modules/express/lib/router/route.js:107:5)
    at /home/diegoaguilar/DigitalOcean/activos/acero/node_modules/express/lib/router/index.js:213:24
    at param (/home/diegoaguilar/DigitalOcean/activos/acero/node_modules/express/lib/router/index.js:302:14)
 
what is line 180 on server.js?
 
@AmitSirohiya 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.
 
Probably collectionPTR is undefined. :-)
 
probably.
could be a typo or something as well
 
12:36 PM
collections[category].find({}, function (error, responseDB) {
180
 
okay
 
I'm showing my code .. wait a secs
 
the result of collections[category] is undefined
log 'category' and make sure it is what you expect
 
It is
:)
var collectionPTR = integraDB.collection("ptr")
var collectionLosacero = integraDB.collection("losacero")
var collectionLamina = integraDB.collection("lamina")
var collectionPolin = integraDB.collection("polin")
var collectionMalla = integraDB.collection("malla")
var collectionLeds = integraDB.collection("leds")
var collectionVarilla = integraDB.collection("varilla")
var products = integraDB.collection("products")
var members = integraDB.collection("members")

var collections = {

"PTR": collectionPTR,
		app.get('/:category', function (request,response) {

			var category = request.params.category
			console.log(category)
			collections[category].find({}, function (error, responseDB) {

				if (error) {

					console.log("Ay nanita")
					console.log(error)
				}

				else {

					console.log(responseDB)
					response.send(":+")
				}

			})
		})
If at browser I try:

localhost/PTR
 
then the resulting DB call returned 'undefined'
either way
the result of collections[category] is undefined
 
12:38 PM
Is the collections object inited when you run the request from browser?
 
Yes, it is
 
so you're either looking outside the array bounds or you are returning an undefined value.
 
I already tested
 
Do a console.log(collections, category) before find.
 
ok ...
I'm checking now @IonicãBizãu
 
12:40 PM
@RUJordan @RyanKinal o/
mornin gents
 
Hello
 
Jerry
 
@IonicãBizãu, I already did
so the log you suggested would print ...
all in collections, right?
 
Yes
What's the output?
 
I'm printing a bit ...
{ PTR:
   { db:
      { domain: null,
        _events: {},
        _maxListeners: 10,
        databaseName: 'integraDB',
        serverConfig: [Object],
        options: [Object],
        _applicationClosed: false,
        slaveOk: false,
        bufferMaxEntries: -1,
        native_parser: true,
        bsonLib: [Object],
        bson: [Object],
        bson_deserializer: [Object],
        bson_serializer: [Object],
        _state: 'connected',
        pkFactory: [Object],
        forceServerObjectId: false,
So, PTR is there ...
 
12:45 PM
@diegoaguilar Have you ever worked with nodejs debugger?
I think it's time to use it. :p
 
again, haven't used mongo.
but their docs show things slightly different than you have them
.find is a method of db.collection
 
I used Mongo, and it should work, but every day we learn the art of debugging. :-)
 
postgres ftw!
 
@diegoaguilar So, before find type debugger instead of console.log. Then start the process using node debug server.js
 
12:47 PM
:P
 
How exactly @IonicãBizãu .. :/
 
var category = request.params.category
debugger
collections[category].find({}, function (error, responseDB) {
Like this
Then
 
node debug index.js
 
btw, Why do I have such "object"
or Dictionary of collections
 
12:48 PM
What do you mean?
 
I'm explaining
well, I have different collections for categories ( my design picked that way)
so when I want to find all in category A
I do localhost/A
or
localhost/PTR
I couldn't find a better way
*I'm debugging now
 
@Kenneth 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.
 
@diegoaguilar Do you know how to debug?
 
I was going to ask that
honestly
 
Why don't you ask? :D
 
12:51 PM
I was about :P
 
Did you start the process?
 
yes
node I'm getting the debug promt
prompt
 
Write:
c
Then press enter
(c = continue)
 
did
:)
 
Now, go to browser: localhost:port/PTR
What do you see?
I suppose a loading page
 
12:52 PM
yes
and at debug
 
Go back to terminal
 
 179 			debugger
 180 			collections.category.find({}, function (error, responseDB) {
 181
 
Write: repl, enter
Exactly
collections.category?!
collections[category]
That's your problem. :p
 
I just changed it, I had it with brackets
Or wait ...
app.get('/:category', function (request,response) {

			var category = request.params.category
that's how I'm catching :/category
 
http://chat.stackoverflow.com/transcript/message/16774783#16774783

This is wrong
 
12:59 PM
Hi @IonicãBizãu
 
@copy Hi! :-)
 
@Brian 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.
 
@SzymonDzumak 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, I have a form where user can change system hour, How can I make a button which copy local computer into form?
 
1:03 PM
Could you rephrase that, please?
 
@user3563994 You want to copy local computer? also UPS plugged to it?
 
uh sorry, I want so that when the user click on the button "copy local time" the computer time paste in form
 
yourInput.value = new Date()
 
@user3563994 you already got your answer in the HTML room
like, that exact answer
why are you asking again in here?
 
I asked in bot chat at the same time then went afk,
 
1:15 PM
don't do that
seriously.
there is a lot of overlap in the rooms. makes you look like a help vampire
 
I have another question:
 
A help vampire... I can't picture it.
 
new Date() = Wed May 28 2014 15:15:00 GMT+0200 (CEST)
But I would like "transform" this only in HH:MM and then put it in value// :/
 
that isn't how you use the Date object
 
!!tell user356994 google javascript date transform string
 
!!tell user3563994 mdn Date
 
see you after some reading ;)
 
@n370 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.
@jml 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:29 PM
Isn't the answer correct?
 
@copy I think the answer could be written better
 
@rlemon wtf... why are there three "primarily opinion based" close-votes?
And why did the answer get downvoted?
 
@RyanKinal I was wondering the same thing
misguided witch hunt imo
 
@RyanKinal Because everythign is just speculation as to what's going on.
 
I could see, maybe, if there was a duplicate... but this is actually decent information to have
 
1:36 PM
@Kippie nah its not speculation at all.
 
For all we know, gmail was built by a bunch of Indians, and these are merely phonetic descriptions of Hindi characters.
 
It's at the very least an educated guess
@Kippie But we have evidence that Google uses minification techniques, such as improper HTML on the search page.
It seems reasonable to extrapolate that the unreadable class names are for the same reasons.
 
@copy I don't think so. I'm pretty sure they just codified the class names here.
 
@rlemon What did the comment say?
 
in HTML / CSS / WebDesign, 2 mins ago, by rlemon
something along the lines of "why the fuck was this downvoted. something something so is full of fucking somethings"
I can't remember exactly now. but it was one of those rage fits where "everyone here is a tool" comment is thrown out
 
1:43 PM
I flagged this pure speculative answer. It should have been a comment.
 
glad a mod noticed the question and got rid of the noise
 
@dystroy I (obviously) disagree. I think educated guesses are valid where there is no better way of knowing.
But @rlemon might be correct in that it could be more at home on a different site (like Programmers)
 
Look at the code again. It's obviously not minified. Any tool would do better. It's speculation, it's false, it's abusive.
 
If it's an educated guess, then the question is obviously opinion-based and should be flagged as such
 
the only people who could answer it without it being an educated (or not) guess are the google team or ex employees
 
1:47 PM
Also, I don't actually agree with carrie's edit of the original question. It's asking questions which the OP did not ask himself
 
Oh, sunuvabitch... the MDN localStorage shim doesn't pass JSHint -_-
 
@Kippie I agree with you. It makes the question stupid
 
user1596138
@Kippie That shit is already lost.
 
@RyanKinal Is that a problem ?
 
user1596138
@Shmiddty whats new dude
 
1:49 PM
It is when that means my grunt build fails
:fixes shim:
 
@dystroy Meh, could be a smart minifier. I doubt that google's policies allow names like that. Anyway, the flag was probably right
 
^ made with irish cofffee last night
also similar thing on replies
any 2 elements can be linked that way
 
nice
 
@dystroy Ooooohhhh that's fancy
How do you get the curved line to the left? SVG?
 
:)
not yet commited but deployed
 
1:55 PM
@dystroy We took a decision to use your tool miaou for internal communication in my company and also I am going to suggest it to my friend's company (200+ employees will use it)
 
that actually is not a bad idea
 
Good. Let me know if there are problems.
 
It's unrelated comment here, but though of informing you.
Sure, is it open source and also we can contribute right?
 
@redV Informing me is a very good idea. It's not be tested a lot in enterprise and there might be some tuning to do, so you'd better keep me informed.
 
user1596138
@Zirak ping me sometime. I want to pass flags in commands and simply add them to the args object. I think modifying parseCommandArgs and adding a new handler at the end for flags. Is this a good time to extract the flags? It seems ideal to me. Also, this parser is pretty damn cool actually. Took me a minute to put together but I get it.
 
1:58 PM
You know what would be awesome? Negative border-radii.
 
@redV yes, but I don't accept any pull request. If you're departing too much from my philosophy, you'll either have to fork or suggest me changes
@RyanKinal where ?
 
Just in general
:saying random things:
 
@dystroy Yes, I will keep you informed and if you want I can ask my teammates to create project in JIRA and file bugs there (if I find any)..
 
Unfortunately, negative numbers in border-radius are invalid.
 
@user1454517 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.
 
user1596138
1:59 PM
I don't believe a string usually starts with - as in -g flag, so during tokenization it would work out fine. Although with your parser I can easily not count strings starting with - if they are in a single or double quoted string. Could cause problems... I'll play more with my current solution when I have time
 

« first day (1320 days earlier)      last day (3622 days later) »