« first day (811 days earlier)      last day (4138 days later) » 

5:00 PM
Im usually lucky enough to be at my computer when a ping happens
 
I have the chat open as my Chrome homepage on my mobile.
 
I should do that as well
 
so yea.. smoke breaks, bathroom breaks, etc.. on the chat.
 
wish it acted like steam mobile
 
i talk to you all whilst I poop.
 
5:01 PM
I just started using that, pretty slick
 
I'd pin my chat tab, but then it wouldn't tell me when there was new messages
 
@rlemon I do too
 
I'm pooping right now
 
@SomeKittens I know!
 
And I'm not even near a toilet
 
5:01 PM
@Zirak but.... desktop
aww ninja'd
 
@Loktar Yeah? I didn't really like the app
 
it is a battery hog
 
its just cool because its like a text
 
posted on January 04, 2013 by Robert Lemon

If you know me at all you will know that I don't often suggest or use third party libraries for Javascript. Not because I think i'm too good for them or anything, I just enjoy understanding my own code and being able to debug with some degree of certainty. With this said; I created a very simple plugin that provides the 'Return to Top' buttons you see on so many pages. Introducing: mcToppy.jq

 
so when im out to the store my friends can be like "YO ITS TIME TO PLAY CHIVALRY!"
 
5:02 PM
WOOOO!!!!!!!!!!!!!!!!!
 
or something like that
 
man these icons are so awesome @SimonSarris
 
Anyone know the JS of SO Chat enough to figure out what triggers the title update?
 
I got you all on twitter, here, steam, etc. If I need your attention and you are by an electronic device I'm pretty sure I can get it.
 
5:03 PM
you guys ever see this? squidi.net/three/index.php
^ those icons mixed with that site are brewing ideas in my mind
 
oh my
what a wonderful resource
 
yeah some of the ideas are really great
 
function sa() {
    var a = document.title.replace(/^\(\d*\*?\) /, "");
    if (0 < R || y.len())
        a = "(" + (0 < R ? R : "") + (y.len() ? "*" : "") + ") " + a;
    window.setTimeout(function() {
        $(document).attr("title", a)
    }, TITLE_UPDATE_DELAY)
}
 
To be honest, I've never gotten into game dev, for my own hipsterish reasons.
 
@SomeKittens master-chat.js line 2973 once expanded in the inspector.
 
5:04 PM
@SomeKittens yeah everyone seems to be doing it now
but I love it too much :P
 
so yea ... looks like the title update is just a dumb timed loop
 
@Loktar Too many would-be CS students saying "I wanna make games!"
 
brb lunch
 
I can be hipster and say I have games on my c64 from when I was 8! lol so I dont mind being a part of the whole game dev craze currently
 
@rlemon puuuuuuuuuuuuuke
 
5:05 PM
@Loktar Saw that 2 weeks back. It's pretty awesome
 
@SomeKittens yeah, I dont want to get into the game industry, but making my own game that does well is a goal
the industry itself sounds pretty terrible
 
@SomeKittens there will never be too many of anyone saying "I wanna make X"
making things and being inspired to make things is the most important thing
 
ctrl + shift + J = JS console
ctrl + alt + T = Terminal
^I will always mix those up
 
@SimonSarris "I wanna make a social network"
 
yeah for sure, although I worry about game saturation
 
5:06 PM
"I wanna introduce a new standard!"
 
@AmaanCheval POINT TAKEN.
 
its gotten pretty crazy in the last few years
 
"I wanna code"
 
I wanna make a new (MVC) framework!
 
Well, in fact, I really do wanna code
 
5:06 PM
okay half of these are not bad
 
lol
 
they'll fail and they'll learn and they'll go back to rails
and the balance of the universe will be restored
 
It's the "I like video games, so making them is a great career move*" people that get on my nerves.
*They all dropped out once they realized that it was difficult
 
that's true of a ton of disciplines :/
 
gné?
"I love Facebook, I wanna code websites"
Same.
 
5:07 PM
I've also had people assume I was going into game design since I was a CS major sigh
 
my dad assumed I wouldn't have a job
JOKES ON HIM/EVERYONE ELSE I GREW UP WITH BASICALLY
 
And the bar to entry as a "Web Consultant" is too freaking low
 
lol
 
@SomeKittens thats the fault of people that desire web consultants, not the people in consulting
 
Today is the day we rebuild the world?
Simon where do you stay already?
I will travel in your area soon I think
 
5:11 PM
Nashua, New Hampshire?
My porch is being rebuilt so my house looks like a crime scene
 
does sizes attribute work with apple-touch-startup-image ?
 
also they destroyed my bed of ferns :(
 
@Zirak, Hey, I changed the method which we were discusing last time, Now can you help me with this,
var ubtn = "<a href='' onclick='like_decrease("+id+","+liker+"); return false;'>Unlike</a> this";
The liker and id are showing in source-code as Example: like_decrease(1,user1); how to make it like_decrease("1","user1"); without breaking the main string ?
Sorry, I solved my prob*
It should be like_decrease("+"\""+id+"\""+","+"\""+liker+"\""+")
Sorry for disturbing
 
uh, what?
 
is there a way to do something like foo=function(input){}||{setBar:function(){}}? I'm probably just doing it wrong
 
5:26 PM
Question for ya'll... I'm trying to select a table row... call it ($this) row and update part of a form with the data that the row contains... almost there but stuck on a few things.. mostly the javascript part.
 
@Event_Horizon The goal being...?
 
allow foo to handle foo(input).setBar()
 
I am learning Node.js and I have also started to look at MongoDB. You have the concept of documents. However when you retrieve this documents in code, wouldn't you also want to have methods on it that works on the data?
Let say you have a collection of Cars
 
$.on('click', 'tr', function() {

        //Get the ID from the row clicked
        var id = $(this).data('recordId');

        //short-hand
        $('#section2').load('data_entry_form.php?id='+id);

});
 
Wouldn't you want a method "changeGear" etc. that acts on the object?
 
5:28 PM
@Event_Horizon So you want a method on the object returned from calling foo
 
github.com/wikimedia/jquery.i18n <- for those who make big apps and want i80n [ this powers wikipedia so meh this is highly capable of a lot of things ]
 
would it be simpler to do foo=function(input){}; foo.setBar()=function(){}
@Zirak yeah
 
If foo returns itself, then sure.
 
@Event_Horizon Maybe
foo = (function (input) {
    return false;
})() || {
    setBar: function () {}
}
 
@Andy ...and?
 
5:28 PM
Do you pass the document trough a constructor function?
I mean, how do you get methods on it, making it act like a model in the app
 
Me? No. If that's how you would design it, then maybe yes.
 
@Shaz wtf ?
 
I don't know how you design things. And I don't quite see the question.
 
@Zirak I will try to reformulate my question.
 
@Abhishek lol he was just trying to correct my badly coded example, don't blame him
 
5:30 PM
@Event_Horizon ever met your friend the conditional operator ?
? :
var a = /* Your condition */ ? /* If true */ : /* If false */
 
@Event_Horizon Would that not work as wanted? ?_?
 
yeah thats not what I'm trying to do, @Zirak understood, its all good
 
That's not what he wants. Read the rest of the conversation.
 
dealing with audio data is always a huge PITA when it comes to debugging stuff...
 
@ThiefMaster what are you messing with ?
 
5:33 PM
@Zirak Let say you are building a web service. Exposing a list of cars. I am using MongoDB for storage. When I retrieve a set of cars from the database I get documents. Now object oriented design and MVC have thought me that models should contain business logic. However the documents does not have any methods. Am I wrong if I think like that when using Node.js and MongoDB?
 
// I just use sine-waves an dgraph plots for de-bugging [ never let it to speakers ]
 
just trying to add some buffering to jscast.. but for some reason the few seconds from the buffer are always garbled as soon as i start replacing old mp3 frames
 
Where should such logic be?
 
how do you add variables with numbers together?
completeprice=ramcost+cpucost; does not seem to work
 
@ThiefMaster garbled up as in you hear noise ?
 
5:34 PM
yeah, they sound like crap
 
@Andy I don't quite get you. MongoDB is a Database, it contains data. How you model and do stuff with it is completely irrelevant to the data itself.
 
i don't see how anything could go wrong there
 
@RyanConway Pleeeaaasseee tell me that's a nice joke
 
and when i look at the data the frame headers look fine, too
 
@Zirak nope XD
@Zirak why, whats wrong with it?
 
5:36 PM
@ThiefMaster you realize mp3 frames can have different headers ?
how are you going to re-create the headers ?!?!?!
 
It tells me you didn't go through a js primer before coming here
 
i don't have to re-create them. i just parse them so i can get the size of the frame
 
@Zirak i've watched a few videos on functions and stuff
 
nvm got confused :-| , show me whole code maybe we can figure something out , my best bet is you are doing something wrong in the math .. not sure what!
 
@Zirak Yes, but how is it normal to use the data when doing further processing? Do you create a Car class and extract the data to it or are you just passing the object around through functions?
 
m59
5:38 PM
 
something like placing buffer in wrong position then expected
which can cause issues like that [ had something like this in my encoder when the fifo was errornously writing on the top of itself ]
 
m59
@Zirak that's like 1/20th of the whole plugin. Imagine how many if statements are to come with that approach
 
@Andy There are so many ways to model data. Really, tons. There's an entire branch of CS devoted to it and people get Nobel prizes for it and all that serious shit. How you do it is data-sensitive, design-sensitive and sensitive in many other way.
 
when sending the buffered data to the client it's simply client.write(self.audioBuffer.slice(0, self.audioBufferUsed)); - so that should work, too :x
 
you don't get the question
 
5:39 PM
(i even tried replacing that with a loop where i printed each frame header and well.. they were ok)
 
@m59 wat?
 
@ThiefMaster where is the rest of the code
i am damn sure you are re-writing frames on the top of themselves
 
m59
@Zirak i wrote the basic stuff in the jsfiddle
 
@Andy Very likely, because it's a very generic one: "How do you model data". Needz more infoz.
@m59 ...?
 
m59
5:41 PM
@Zirak jsfiddle.net/zZd5G
 
I've seen it. So?
 
@Zirak i've got it working zirak, the adding varaibles
@Zirak but it wont work with decimals
 
m59
that's a good approach to you??
 
@RyanConway I'm very proud of you
 
@ThiefMaster testing
 
5:41 PM
<script>

var x = 20
var y = 30

result = x+y

alert (result);

</script>
 
:( why world make me sad
 
the buffering stuff is not in there though.. i'll pastebin a diff
 
:-|
 
@Zirak Let say you retrieved a document from MongoDB. Do you extract that data over to an object of class Car for instance. Since the Car class has methods you can call myCar.driveFast() on it...or do you just have functions such as driveFast(carDocument); ...or other approaces
 
@Andy Choose whichever the hell works for you!
They're different paradigms, different methods to the same end!
Aaaaggghhh
 
5:44 PM
0
Q: is this javascript property defaulting pattern horrible?

coriIn some javascript code I'm working on refactoring I've handled cases where I wanted to default a property to true without having to go through the code-base and add the property to every instance of callers by doing something like this: if(typeof('thisBool') === 'undefined' || thisBool) { /...

 
self.audioBuffer.copy(self.audioBuffer, 0, header.frameBytes, self.audioBufferUsed - header.frameBytes);
self.audioBufferUsed -= header.frameBytes;
 
@Feeds YES, STOP BEING STUPID. GAAAHHH
 
what are those two lines doing ^
 
it deletes the first frame in the buffer and fills the hole by moving all remaining content to being at position 0
 
Y PEOPLE BLAME WRONG THINGS, DON'T USE innerHTML AND THERE WON'T BE ANY OF THESE SECURITY HOLES
 
5:49 PM
did u checked for its correctness ?
and meh buffertools is not supported on windows , i will have to re-boot to test it
 
so i am just re-re-re reading your code
 
How come my alert("50"); line does not work
 
@RyanConway look at ur braces: jsfiddle.net/maniator/hPyxp/1
that code makes no sense
 
}
if (totalprice == 0) {
    return;
}
else {
    totalprice()
    alert("50");
    return true; // assuming the return value is useful
}
}
lol, nice
@RyanConway in programming, syntax matters a lot
@Loktar <3
 
5:56 PM
if (totalprice == 0) shouldn't i remove the ()
 
@ThiefMaster dude dude dude header.frameBytes looks like you forgot something ...
 
Hi . a question please. if I have this html span <span class="myclass" data-my-text="some text"></span>​ . is this what $(".myClass").data("my-text") does ? I know how JQ's data works. but isn't there any collusion here ?
 
@RoyiNamir wha?
 
afaik by what you are doing header.frameBytes will just give the ouput of data following the header, no ?
 
@Abhishek hm.. forgot what?
hmmm
 
5:57 PM
and the header is always 4 byte
so basically you are moving it [frame size - 4 ]
you could just use the sync bit to shift instead :-P , if not unefficient
 
wuddup peeps and peepettes
 
lemme just write a small test though i think we can insert and delete using a fifo , dunno though
 
nope, the size seems to be for the whole frame
 
 header.frameBytes = Math.floor(12 * header.bitRate / header.sampleRate + header.padding) * 4;
 header.frameBytes = Math.floor(144 * header.bitRate / header.sampleRate + header.padding);
really ?
 
sync bits: not really. they can show up inside the actual frame data, too - and in that case they are not really sync bits
 
5:59 PM
hmm
 
@RoyiNamir returns "some text"
 

« first day (811 days earlier)      last day (4138 days later) »