« first day (964 days earlier)      last day (3977 days later) » 

12:00 AM
@FabrícioMatté I shall use this instead? jsfiddle.net/uvckc/8
@BenjaminGruenbaum no I would execute it a number of times
 
@BenjaminGruenbaum parseRow? That would be executed for every row
 
No i meant
this.model
 
nvm sry wrong thing
 
is a method
 
@FabrícioMatté what?
Then what could I use?
 
function anonymous(columns, parser) {
    return {
        "asd": parser.readColumnValue(),
        "dasd": parser.readColumnValue(),
        "daa": parser.readColumnValue(),
    };
}
lols
 
@FabrícioMatté is it necessary for a set?
 
there is useless argument
 
@Esailija You get as many readColumnValue , don't you? I don't get why it's optimizing
 
cause... its more elegant with 1 fn
 
12:01 AM
@lawm not "necessary", but you can't have the method and property with the same name. In practice, you have car.model() for setting car.model to a string
 
@BenjaminGruenbaum let's say you have 10000 rows
 
so that's overwriting the function
 
@Esailija a million!
 
you create this function to parse those rows on the fly
 
@FabrícioMatté so I cant do it multiple times?
 
12:02 AM
instead of using a generic one that needs to do everything dynamically
 
I dont get it
 
exactly :)
lol sec
 
that's why new Function is awesome.. it's both generic and specialized at the same time :D
 
@Esailija I get what the function does, I don't understand why it's faster, you make exactly as many calls to readColumnValues. The only thing you might be saving here is the memory access, in the cost of a function overhead (in the forEach)
 
i hate node -.-
 
12:03 AM
@Esailija Wait, nvm, I think I get it, if you have a lot of rows it makes sense. I was mixing the rows and columns. That is clever.
 
@FabrícioMatté yeah so.. err...jsfiddle.net/uvckc/11
 
the function is compiled once for 10000 rows
 
@lawm here's the commented version jsfiddle.net/uvckc/12
 
and V8 loves it because it's so static
 
planned on going to bed a little earlier today, started to play around with node some time ago, and now it's 2am
 
12:04 AM
V8 sees no difference between that function and a hard-coded function you wrote by hand
 
who feels like being a master googler?
 
@Esailija Yeah, I get it. V8 does amazing things to these sort of functions, the object would be extracted to a type in no-time, and stored in sequential memory if possible
 
find out what in the fuck I have here. imgur.com/a/R4KhE
 
@FabrícioMatté So I HAVE to use typeof?
 
I think it is a rock crab.. but even then.. there are a lot of them
 
12:05 AM
I'm so confused
as usual
 
@rlemon /r/whatisthisthing or /r/whatisthisbug
 
@lawm no dude, it was just a check to show you the difference lol
 
@FabrícioMatté oh..
 
@Esailija I just didn't notice the rows and columns, I thought the function runs once. Thanks :)
 
well..'
 
12:05 AM
the comments at the side of typeof shows what it outputs
 
what is your solution?
 
@GNi33 already submitted on /r/ReefTank/ and /r/Aquariums/
 
call Unidan on it :D
 
found him about two weeks ago, finally caught him today.
 
lol
 
12:06 AM
you just have to rename either of the this.model
 
@FabrícioMatté so I have to do a modelSet() ?
 
@rlemon ask on aquarium.stackexchange
 
is it live yet?
 
@lawm Yeah, prefixing setters with set is common practice, such as setModel()
 
12:07 AM
@FabrícioMatté ehhhhhhhhh
poooo
then howcome jquerys methods work as a getter and setter?
 
Everyone vote on questions in this proposal please: area51.stackexchange.com/proposals/43531/… - Please up-vote good, constructive questions and down-vote bad ones; we need a proposal that'll represent a healthy site! Toss in your own questions too, if the ones there don't suit you.
3
 
because prototype?
 
@lawm jQuery is MAGIC
 
@lawm Nah, that's akin to method overloading
 
@BenjaminGruenbaum I knew it
@FabrícioMatté ?
 
12:08 AM
@lawm I can draw an example lol
 
if you all do i'll be nice for like two weeks I promise!
 
@BenjaminGruenbaum he says "big switch statements = bad"
 
@FabrícioMatté So, it's pretty much impossible to do one function that gets and sets?
 
the exact number is actually 128 labels
 
@lawm Actually it is easy, the problem is with you overwriting it with another thing
sec
 
12:08 AM
if there is more than that, v8 bailouts
 
@FabrícioMatté ok... so I could make this work somehow?
 
@lawm yeah, if you're ok with calling model() to get the model it is easy
 
@Esailija Switch is a stupid construct imho. It should't be a part of the language to begin with.
 
why not
 
@FabrícioMatté how?
Prototype?
 
@lawm gimme a minute while I comment this code
 
@FabrícioMatté kk
 
come on people!
 
@rlemon lol
 
identify!
 
12:12 AM
a proper switch statement will be faster than array, let alone a hash table
 
@rlemon Ive seen those before
 
need latin names only please.
 
@Esailija It's not very expressive at all. Fallthrough is a bad idea and more
 
so it has some good use
 
12:12 AM
if you answer with "crab" you are wrong
which type
what will it grow into!
 
@Esailija Just because some engine optimizes some construct doesn't mean it's a good part of the language.
 
atm it's about the size of a penny legs out
 
MR CRAB?
 
@FabrícioMatté first question: can I do ferrari.model as a getter w/out parenthesis?
 
many things are not so useful for general purpose application development
such as bitwise operators
 
12:13 AM
@lawm technically yes, but that'd be rather cumbersome
 
@FabrícioMatté egh
 
but these are very useful for low level library dev
 
@Esailija Bitwise operators have their use cases, I have yet to see one I agree with for switch...case .
 
Do you think if I did this in CoffeeScript everything would work out the way i wanted?
 
@lawm Learn the language, don't bitch about it just because you don't understand it!
 
12:14 AM
@BenjaminGruenbaum js or cs?
 
CoffeScript compiles to JS so yeah, you won't get any extra features lol
 
@FabrícioMatté oh..
waah
 
you just type a little less with CS
 
because it's very fast
 
@Esailija "being very fast at the moment" is a bad argument for a feature. with statements were very fast at a point. In IE it's still twice as fast for creating scope than an IIFE .
That's a bad argument for using with on some IE based solution imho.
 
12:16 AM
with statement can only be fast if you are otherwise extremely slow
 
1 message moved to Trash can
 
@FabrícioMatté what about this thing? jsfiddle.net/uvckc/14
 
@lawm Open up the console, you get Uncaught TypeError: Property 'model' of object #<car> is not a function
 
@FabrícioMatté oh man!
 
12:17 AM
@Zirak ha I was busy.. but that is awesome
 
@BenjaminGruenbaum yeah, IE is very slow there
 
@Zirak lacks images
 
I commented on it a couple revisions back, you're overwriting the model method with a string so you can't call it a second time :D
 
@FabrícioMatté yeah, ik but I thought prototype would fix everything
 
@koramaiku 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.
 
12:18 AM
@Loktar but i'm still confused why colours have anything to do with the force / press
 
@Esailija The point was that you shouldn't build programs based on what features V8 optimizes. You shouldn't use stuff like delete in JavaScript not because it kills a useful optimization, but because it makes no sense to delete in a garbage collected environment.
 
            var press = force + force_b * neighbor.m;
            if (this.type != neighbor.type) press *= 0.35;

            var dx = neighbor.dfx * press * 0.5;
            var dy = neighbor.dfy * press * 0.5;

            neighbor.x += dx;
            neighbor.y += dy;
            this.x -= dx;
            this.y -= dy;
 
@lawm prototype isn't magic enough for that :P
 
is this to just group colours together @Loktar ^
 
12:19 AM
@FabrícioMatté so, what you said before... * technically yes, but that'd be rather cumbersome*
 
Hey guys, is there an equivalent to \n for setting strings to bold?
 
don't think so
no
 
@BenjaminGruenbaum it's not that with is optimized in IE10, it's that creating a function is very slow
 
@lawm I was referring to Object.defineProperty, I'll mess with it a bit to check if it's possible
 
@FabrícioMatté ok, thanks so much for your help btw!
 
12:20 AM
@Esailija It creates with over 10 times faster than FF, and more than twice as fast as Chrome
 
because chrome's optimizing compiler does not even look at functions that have with
 
@lawm cheers for that
 
IE10 has some strange optimizations :/
 
in fact a common trick to disable optimizations is just type with inside your function
 
@koramaiku ?
 
12:21 AM
FF is like "ohh you want setAttribute? we'll make that the fastest thing we do!"
 
@JasonBayldon 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.
 
!!code or game or fish
 
@rlemon Command code does not exist.
 
@rlemon code
 
12:22 AM
ok :(
 
@FabrícioMatté If you can't get it to work, I'll just use the setModel() :D
 
I was looking forward to gaming though
 
@lawm Yeah, anything else is fighting aspects of the language :P
 
@FabrícioMatté ok
Damn
 
@Esailija That was not the point I was trying to make at all -_-. The point is I don't think that the fact switch... case is fast at the moment makes it a good language feature to have. I would much rather see a smarter switch/case like in Ruby, or even the feature taken out altogether and have the same optimizations applied to an anonymous object used as a dict.
 
12:24 AM
Is there a jQuery for Javascript as X is for C++/Lower level langs?
 
@lawm you've got to be trolling now -_-
 
lol @BenjaminGruenbaum :P
 
@BenjaminGruenbaum I DUNNO! I wanna see if there's an easy lib for C++ so i can switch to C++! :D
 
@lawm JavaScript is an awesome language, a lot more fun than C++ to code in imho.
 
OK or maybe I'll just invent my own programming language with all the features I want, including making properties work as getters AND setters
 
12:27 AM
switch to Java :P
or PHP
 
@lawm JavaScript has getters and setters for properties... You know that right?
 
I just tried to explain @CapricaSix to my GF and how she was a bot and what the function was... she didn't seem to care one bit. :/
 
@BenjaminGruenbaum were you just ignoring the last hour of this conversation between me and poor @FabrícioMatté over there??
 
@rlemon @copy feeling lucky :P?
 
@BenjaminGruenbaum yeah, but he wants to set as a function and retrieve as a property
 
12:29 AM
@FabrícioMatté Still possible
 
@lawm I was having a discussion with Esailija . Didn't read yours, sorry
 
I'm a lemon. I'm never feeling lucky.
 
@phenomnomnominal HOW!?!?!!?!?!?!?!?!?
 
@phenomnomnominal I'm messing it with no luck
 
@lawm go google Object.defineProperty
I'm pretty sure I said that yesterday.
 
12:29 AM
Of course its possible... get would return the value, get would return a function
 
!!/tell lawm mdn Object.defineProperty
 
Feel free to try your luck jsfiddle.net/uvckc/16
 
Want a fiddle?
 
12:30 AM
@BenjaminGruenbaum yes please
 
@BenjaminGruenbaum I've tried get returning a function.
 
quick query: why does okok seem to think i'm the only one who hates him
 
@FabrícioMatté Sounds whimsical.
 
did I miss the day when every one was nice and I was a bitch to him?
 
Yes, this simply doesn't belong in the language imho
 
12:32 AM
@rlemon whats the user url? I cant find him
 
ahh, if you don't know who i'm talking about then don't worry about it
 
@rlemon You're mean to him :P
@rlemon we all actually really like him, a lot, he's like a god to us
 
how is he newb if he's got 4500 rep?
 
@lawm spam copy-pasta ask/answer
 
12:33 AM
did I not give him a honest chance?
 
@BenjaminGruenbaum oh
wow
 
seriously. I wanna make sure i'm not just being a little SOB here
he never learns.
imo
 
Well now that I have 66 pts I can do DOWNVOTES!
 
@rlemon I'm very surprised @Gordon or @ThiefMaster haven't perma-banned him to be honest.
 
ok good.
so i'm not just a prick.
 
12:34 AM
@lawm I thought it was 125 rep to downvote
 
If he comes back again, I'll call his parents
 
hey i remember a page on SO that told me how many pts I needed to unlock certain privileges, anyone know where that is?
 
Either that, or take it to meta
 
@FabrícioMatté let me test
haha
 
they don't ip ban afaik.
 
so another account is likely.
 
@FabrícioMatté you're write
oh!
ok
 
@rlemon No, but an account suspend with 4K can be painful, and an account delete even more so
 
yea I suppose so.
 
@lawm Can you tell me what syntax you want to use?
@lawm I'm not sure I understand
 
12:36 AM
@BenjaminGruenbaum what u talkin bout bro?
 
@lawm Just write something you'd like to work, and currently doesn't
 
@BenjaminGruenbaum kk
@BenjaminGruenbaum jsfiddle.net/uvckc/17
 
@BenjaminGruenbaum good luck :rolls evil eyes:
 
@FabrícioMatté lo
l
 
Fuck. That's twice now I've accidentally starred something with the iPad. Apologies folks.
 
12:38 AM
Hey guys i might leave soon. If you got a solution, respond and itll show up in my messages.
Im still here now though
ok bye
 
@BenjaminGruenbaum cheater >_> I don't know, toString is being forced by alert
 
I'm struggling to understand why the setter needs to be a function
 
@FabrícioMatté if the property is a string, I don't see why it wouldn't work :)
 
12:40 AM
but yeah, it falls under "it works"
 
ferrari.model = "red"
 
that'd be way easier
 
@phenomnomnominal Yeah, I just wanted to do his syntax, I know it's silly.
 
i mean i guess if you wanted to automatically call a function every time it was assigned, but that's what set: function () {... is for
People are stupid.
 
12:42 AM
Trying to think of a scenario where that fails, well
typeof will return the wrong value and if you pass it to something that simulates method overloading such as jQuery then
let's hope that doesn't happen
 
@FabrícioMatté Oh, of course the correct thing would not to have a function Car() to begin with
The correct thing would be var ferrari = {model:"Red"} and change it with the normal assignment operator.
 
that'd straighten things up yeah
guess lawm was just exercising the constructors
 
A language that forces me to type stuff is bad. :)
I guess lawm just doesn't know JS
@FabrícioMatté inb4, OP, making it hard to guess where you lurk are you :P?
 
lol :P
OP vanished but he will be back to read the messages later, I believe
 
Dear diary, today OP was a faggot and didn't deliver
 
12:46 AM
rofl
next thing is asking for interfaces and classical inheritance in JS
 
I actually really like interfaces
 
or maybe that is too mainstream
 
I'd love to have them
 
oh I was supposed to study a bit of them for my java exam
 
ES6 has classes, but I think that's just stupid, we're more expressive without them
 
12:48 AM
Though, if I don't know enough already, the study material won't be of help anyway
 
ES6 has them, doesn't say you have to use them :P
 
Interfaces are a nice way to represent a contract, you write the interface, you write some tests and you start coding.
 
@BenjaminGruenbaum I agree
afk for a bit
 
god i hate backbone
 
@phenomnomnominal :) Why?
 
12:53 AM
same
 
and i hate people who refuse to write modules
 
Backbone is awesome, it lets you write more code, and writing code is fun right? Why write 90 lines of JavaScript when you can write 300?
 
It just makes for such ugly code
 
I should get to learn a bit of backbone sometime though
 
Doesn't help that the person who wrote this was a bit silly.
 
12:54 AM
@BenjaminGruenbaum I just changed my mind
 
eg:
window.TradeMeCollections.ListingCardCollection = Backbone.Collection.extend({
    url: function () {
        // implement
    },
    adapter: null, // provide
    hasFilters: false,
    filter: "All",
    title: "Listings",
    totalItems: null,
    fullCount: 0,
    pageNumber: 1,
    rows: Constants.SiteConstants.pageSize,
    initialFetchPrevented: false,
    initialize: function (models, options) {
        var self = this;
        this.initialFetchPrevented = false;
        if (!options.preventFetchOnInit) {
 
@phenomnomnominal I mean, it makes developing more MVC, that helps, right?
 
I can't even.
var self = this;
this.bind("reset", self.resetCounters, self);
wat.
 
@phenomnomnominal lol, you know what's the most horrible part? That's actually OK backbone :P
 
12:55 AM
it's fucking awful
 
@phenomnomnominal that actually looks like how you're supposed to write backbone, that's the horrible part.
 
I might start rewriting with knockout on my own time.
 
How big is the app?
 
2 years of 2 devs work
 
If you start rewriting, go with Angular, I love Knockout and it's simpler, but if you're writing something big Angular is probably the better alternative, being a suite rather than just a library. Knockout only takes care of data-binding, it does a great job at that imo but that's all it does.
 
12:57 AM
we have a maintenance sprint in a couple of weeks, which will hopefully let me tidy it up some.
I mean we have files like this around the place:
 
Angular is a framework, it ships with a smaller bloat-free jQuery ( jqLite ), has notion of controllers and routing built in and such.
 
var TradeMeViews = {



};
Oh yeah? Sweet, I'll look into Angular
 
With Knockout, you take care of routing, state, syncing and such yourself. With Angualar there are idiomatic ways to do that. It's not a big problem (I just implement .fetch and .update on objects) but you take care of it yourself.
The Egghead tutorials are pretty nice
 
Don't get me wrong, I just did a project and chose Knockout over Angular, Knockout is very light, very simple and fun to work with if you have strong opinions on object structure, but if it's 2 years 2 devs big, I'd probably go with Angular.
Angular is built to allow easy testing. It utilizes DI by design which is very useful. I do it in Knockout myself all the time but it's something I have to take care of.
 
1:01 AM
It's probably not practical to think about a rewrite unfortunately. It's just dreams at this stage
I can just feel the technical debt creeping up
 
Also, to be honest testing Knockout was a bit painful to figure out, Angular ships with a bundled debugger and testing tools.
@phenomnomnominal Yeah, I know what you mean, I'm working against a horrible code base myself at the moment on one project, not fun at all. All jQuery and selectors and non-readable stuff.
 
I'm slowly chipping away at getting the existing code tested so that I can actually make changes and feel comfortable with them.
 
The problem is a lot of my work at this stage is prototyping. I do a lot of PoC stuff where proper testing isn't really an option
Of course I still do TDD, but I have a lot less tests than I normally would
 
that's all well and good, until the prototype becomes the foundation for the real product haha
which is the case for what I'm working on
 
@phenomnomnominal This is why I'm still doing TDD :) I know this is a possible scenario.
 
1:04 AM
yeah very good call
 
Thanks :) I need to hear that
 
even if it only happens 1 in 10 times, it's better than dealing with 2 years of untested code haha
Starting with tests builds a culture of testing. We don't have that
 
Last time I did a 'prototype' it took me 2 days, the developer who came after me used the same architecture for the full blown rewrite (Despite me urging him not to) and that's how I got that code base I spoke of to begin with.
 
gross.
Bah, I got to head up to uni for a not fun meeting
I'll catch ya later.
 
1:09 AM
uhm... I've just seen that partial() was removed in express 3.x
what's the replacement for that?
 
Any security experts here? stackoverflow.com/questions/16952025/…
Well, encryption experts* :p
 
@JoelMurphy just use https to communicate between them...
 
oh, i see... jade blocks, let's try this
 
https isn't really an option for the project I'm working on (yet) :( And I'm not trying to create my own encryption algorithm. I'm simply trying to make use of the aes-256-cbc encryption
 
1:21 AM
But protocol
 
is there a way, using jade blocks, to permanently display something (like a header-element) that is in another file?
 
1:53 AM
as it turns out it was a gorilla crab
not cool
into the refugium he went
 
why? what's so bad about them?
okay, damn you node... it's 4 am and I'm still playing around. one last smoke
 
@rlemon That's what you get for picking up random shit. You're lucky he didn't fuck your corals up.
 
"Murder, She wrote" is already on TV. That's a certain sign that it's too late.
 
nahh he's small.
@BenjaminGruenbaum when I told my gf and the lfs guy what I saw they both accused me of seeing things
i'm glad I spotted him again tonight and got him
 
or can anyone tell me real quick how to use app.locals properly without locking up the server on a request... meh
 
1:58 AM
@rlemon lfs?
 
live fish store
sorry
live/local whatever
 
@GNi33 jade is slow, like, really slow :P
app.locals shouldn't be your problem :P
 
yeah, i just don't get why it locks up now totally
 
also, what do you mean using it properly? It's just shared state among templates, like ViewBag in asp.net
 

« first day (964 days earlier)      last day (3977 days later) »