« first day (817 days earlier)      last day (4129 days later) » 

7:00 PM
@Neal Since you're using GFM, you can use the syntax-highlighter
```language
code
```
Also, y u no mention memoization?
Or the different kinds of recursion
Or the fact that the DOM, a tree, is a recursive data-structure (thus using recursion to travel is is oh-so-natural)
 
@Zirak You can make a post about that if you want to help on the blog ^_^
I did the best with what I knew and with what people were able to help me with.
 
there :P shitty lightbox that doesn't grow the images
also, clicking ANYWHERE dismisses it
 
@Neal meh
 
@rlemon ha
 
That winking teresko...
 
7:10 PM
well @rlemon devasted to see ones chesticles not on there.... naughty naughty
 
@KirstyHarris you were not in the folder I grabbed these out of
these are also not all I have done
 
lol i messing :P
 
@Zirak/@rlemon -> one of you want to rip into this a little bit? CS version, JS Version
 
please.. use a proper pastebin
one that breaks lines is horrible for code
 
7:16 PM
Suggestions?
Also, are there any fiddlesque site that let you use workers?
 
i'd use gist
 
I really dislike reading cs
 
@rlemon It feels like a room without walls, but with a floor, yeah its still able to hold a bed, but I don't feel safe
 
Some of us like sleeping under the stars :D
For what it's worth, theres a button to prevent page breaks
Which leads to a CSS bug, nice
 
On the CS, line 27, is _initStart supposed to be the same as constant?
Speaking of which, why the hell are you doing something like constant?
_initStart isn't used anyway. so wat?
 
7:20 PM
Sometimes I just give up...
 
@Zirak, nah, shit that's just poor refactoring, it's gone in my current version
 
Ok. I am done.... read my post. thank you. — Neal 16 secs ago
 
And constant just wanted to see if it would work!
 
....
 
Lines 72-75...?
And you can replace 84-87 with a reduce
 
7:25 PM
wow, I've never looked at cs before
it's got a funky lambda syntax
or something
 
Line 101 seems...wasted
cfs doesn't have a python-style pass or something?
 
I thought there would be but I can't find it!
For 72-75, is there a better way to remove the min and max values from an array?
 
ooohhh, that's what it was doing
I'd sort the array
 
Oh yeah and just remove them, dug
Duh*
Can you not edit posts on the mobile chat?
Oh, found it
 
Man, I'm a genius. Had F12 be the shortcut for toggling the terminal, but it kept conflicting with other shortcuts. So I thought "what key is never used by anything?"
And then it hit me. "Pause/Break"
 
7:32 PM
Toggling the terminal?
 
@Zirak I use them all the time :(
stupid Visual Studio
 
@Zirak win+pause/break
 
I never used PgUp and PgDn
and does anyone here seriously ever NOT have numlocks on?
 
@AmaanCheval There are Quake-style terminal emulators (droops at the top) like Guake. Where that aint possible, I just toggle visibility (minimize/maximize).
@rlemon waat? I use them all dem times.
 
F U Ubuntu and not enabling it on startup by default.
@Zirak only in games will I use them, or if a webapp tells me too
otherwise I just arrow keys or mouse
I'm not saying that it is good to do so, just commenting on my bad habbits
 
7:34 PM
@rlemon They're great for reading long articles for the lazy
 
I never use the mouse for navigation. Emacs hath given me awesome search capabilities, and I intend to use them.
 
@rlemon... decided.. my website is going to be a project, and more freelance... and bloggy.... i will get jobs as and when i see fit with the porfolio... as its an arse of upkeep ha
 
@SomeKittens see I just scrollwheel click and drag
^ reading articles
coding i'm all keyboard... but I don't use the pgup and dn keys I just hold the up or down arrows
 
My mouse is too much blood-tainted. Too many headshots.
 
I'll use it for long code
 
7:36 PM
@rlemon Oh gawd
 
like I said, my own bad habits
 
Well stop it!
 
I also smoke. I hurd it was bad for you.
 
Kill it with fire!
 
^ I do kill the ciggs with fire
 
7:36 PM
hrm, burning a man as penalty for smoking...
 
slowly burning them until they'r nothing but a dirty butt.
 
What fags.
 
no one understood what I was talking about when I said 'bag fags' in the states
Native smokes come in a bag.
200 smokes for $10
 
yea they taste like hell.
@KirstyHarris do English people still call smokes fags?
^ mega fails all over this sentence
 
7:40 PM
I just remembered a thing of beauty from @ThiefMaster
Oct 2 '12 at 10:34, by ThiefMaster
And you can drive there over a highway instead of walking up the stairway!
(in reference to hell vs. heaven)
 
@rlemon... yea lol
or gay boys.... they have a tendency to call them fags as well
 
"bum a fag" will still make my westerner self laugh.
2
 
burn a fag? ;o
 
you crazy brits have so many slangs that make no freaking sense at all.
 
i didn't know you are a WBC member :P
 
7:41 PM
:P
 
@Neal Oh, no, no. Only the first one
 
I really hope both of those petitions make it
 
@Zirak Yeah, saw your commit mention
 
1) WBC is officially listed as a hate group.
2) WBC get's it tax exempt revoked.
^ please Obama... make this happen.
 
7:42 PM
World Boxing Council? What have they done to you?
 
I'm not even american, or gay, or religious... but these guys piss me off.
@Zirak hardy har har.
if you do not know about westbro baptist church then you need to read more interwebz
 
(googling WBC only gave me White Blood Cell stuff ~_~)
aha!
 
@KirstyHarris Best of luck!
 
...I knew that
 
lol
 
7:44 PM
for @AmaanCheval
?
 
WestBro Baptist Church?
 
yeah
 
Does no one see linked replies?
 
Westboro*
 
WestBoro **
Ninja'd
my muscle memory just auto types 'bro'
 
7:44 PM
9 mins ago, by Kirsty Harris
@rlemon... decided.. my website is going to be a project, and more freelance... and bloggy.... i will get jobs as and when i see fit with the porfolio... as its an arse of upkeep ha
 
oh! haha!
 
I see them. I ignore them - too much going on
 
ty, i feel that i could be a really cool blogger and learn people stuff better :)
 
I will deal with that conversation when i'm done with this one !
 
I disagree :P
 
7:45 PM
:P
 
@jAndy You lost the game.
 
thats a nice welcome :p
 
Every time I see your picture in the room, I think of the game
 
ohhh thanks.. thank... thank you... thats the highest grade a player can get
! :)
 
7:47 PM
^ every time I see him I think of "The Game"
 
room topic changed to JavaScript: want to learn something? watch this: youtube.com/watch?v=TfwsGH7-0lk&feature=youtu.be [ecmascript-5] [javascript] [not-a-tag]
 
NO
YOU WILL NOT POST VIDEOS IN OTHER LANGUAGES
 
Surprisingly, not a rickroll
 
room topic changed to JavaScript: want to learn something? watch this: youtube.com/watch?v=tGk5ioEXlIM [ecmascript-5] [javascript] [not-a-tag]
 
nvm...
 
7:48 PM
Whoa, still not a rickroll
 
@rlemon: relax, changed it
 
@jAndy: relax, changed it
 
Boo, 30 minutes long
 
I'm tempted to make 'the game' blink....
 
7:49 PM
its a great video, something close to the truth
@AmaanCheval: totally worth it
 
I'm watching it, then
Hahahahaha, "There's a set of balls in the back. Put 'em on, you'll need 'em"
 
if I had the power, I'd make any tv station on this planet stream this for a week
 
posted on January 10, 2013

MIDI.js isn’t particularly new, but it just came up again and I haven’t talked about it before.  It is an entire MIDI sequencer written in JavaScript, from Soundfont to speakers using the Web Audio API.  There are a number of demos available on the website which show off the library, including simple MIDI players, visualizations, virtual instruments and more. MIDI.js works by provi

 
@jAndy justin.tv
jsfiddle.net/rlemon/LZQg7/8 someone fix this for me :P see where // fix the height and width here
 
@rlemon: yea.. but I doubt I can reach like 10-(power of 63) of people there
(in comparison to any tv station on the planet)
 
7:58 PM
@rlemon Just this much looks fine to me jsfiddle.net/amaan/LZQg7/9
Work with that to have some padding and shit
 
// fix the height and width here
if (window.innerWidth > window.innerHeight) {
    img.width = window.innerWidth;
} else {
    img.height = window.innerHeight;
}
fakk, I never thought of that
I was using a buncha window.getComputedStyle(overlay).height shit
@AmaanCheval thanks
hrm... ok well there still needs to be more checks now :P
I don't want to stretch small images :P i'm on it!
// fix the height and width here
if (window.innerWidth > window.innerHeight) {
    if (img.width > window.innerWidth) img.width = window.innerWidth * 0.9;
} else {
    if (img.height > window.innerHeight) img.height = window.innerHeight * 0.9;
}
now it works.
 
Woohoo!
I've had to mess with resizing canvases way too much
In the end, CSS was the easiest way
 
please tell me you're not applying height / width to canvas with css?
that just stretches the pixles.
I learned the hard way never to do this
 
I know, I know
But you know, it didn't even look bad on the game
I didn't even try the CSS way at first
Used ctx.scale and ratios to make the logic code work well
Then on the next game, I thought I'd try CSS. It was a lot simpler
Looked just as good bad
 
8:13 PM
lol
 
$('canvas').attr('width', $('#canvasContainer').width());?
 
jsfiddle.net/rlemon/LZQg7/show ok I think it's done now. (I'm still waiting for my server setup to complete)
 
@phenomnomnominal What's with the jQuery?
 
@phenomnomnominal :(
 
@rlemon Awesome!
 
8:14 PM
@AmaanCheval, meh, makes my life easier
 
canvas.width = canvas.parentNode.offsetWidth;
 
@rlemon :shudder:
 
I didn't even have that
 
@phenomnomnominal SO DOES DEATH
 
It was literally this:
 
8:14 PM
I don't fear death, nor jQuery
2
 
#game {
    width: 100%;
    height: 100%;
}
 
@AmaanCheval you will run into issues with this
I promise you
 
Yeah lots
 
Such as?
 
@phenomnomnominal: make that one line please, wanna star
 
8:15 PM
like resizing?
 
:P
 
you'll see.
just watch.
 
@phenomnomnominal We want it to resize
 
ask @Loktar whats wrong with that
 
Just tell me!
 
8:15 PM
he's better at explaining this than I
 
@AmaanCheval, but the canvas inside won't resize?
 
I'll just half ass it with no good reasoning. he know the caveats and why it sucks.
 
@phenomnomnominal The canvas is the one with the id game
@rlemon At least try
 
Then it will just stretch right?
 
stupid question. You know in responsive, when you want the images to resize as well what CSS do i need to put?
 
8:16 PM
The game is supposed to be the only thing on the screen, and it's supposed to be fullscreen
If it's along with other things, it'll be in an iframe
 
@KirstyHarris, not a stupid question, but very annoying PROBLEM not question
 
I just lost the game. :/
 
@AmaanCheval, start with a small window, load the game, then make the window fullscreen
 
awww sorry :( i did have it somewhere @phenomnomnominal
 
8:17 PM
var height, width;
function mcSize() {
  width = canvas.width = canvas.parentNode.offsetWidth,
  height = canvas.height = canvas.parentNode.offsetHeight;
}
window.onresize = mcSize;
mcSize();
 
all this talk about games really sucks
 
try measuring pixels.
 
I lost the game
 
would you mind sharing with me @phenomnomnominal
 
100% ... but the canvas still has a 200px width..
HOW WILL THIS WORK?!?!?!?!
 
8:18 PM
@KirstyHarris, nah it's really annoying!
 
you need to set the width property on the canvas element itself.
 
To solve
 
@phenomnomnominal Just did that o.O
 
ok, i will google it i know its to do with image {}...
 
Nothing wrong I see
 
8:18 PM
@KirstyHarris, fiddle with min/max-width/height: 100%, I can never remember which one it is
 
ok will try that. Ta
 
@AmaanCheval just remember this conversation when it does blow up on you. I'm pre "Told you so!"ing you right now.
 
@AmaanCheval, can I see?
 
TOLD YOU SO!!!!!
 
img { height:100%; width:auto; }
 
8:19 PM
@phenomnomnominal Not yet
 
found it on SO ha!
 
@RyanKinal whaaaaa?
y u no leik?!?!?!
 
It's creepy :-P
 
lol
I thought you were commenting on the code :P
 
@phenomnomnominal I mean, it looks like complete shit on an extremely small screen. But when it's resized gradually to a more apt resolution, it looks fine
 
8:20 PM
I use .hidden and .classList
F U IE
i'm such a rebel
 
I'm nowhere on the gallery :(
@KendallFrey's is hilarious XD
 
have I made an image of you yet?
 
@rlemon Nope. The pictures creep me the hell out.
 
@RyanKinal hehehe
then it's a job well done by me
 
@rlemon Na :p
 
8:21 PM
@AmaanCheval then why would you expect to see yourself
 
I'm really curious, though. Why would the CSS resizing blow up in my face?
@Loktar Thoughts?
 
I have no idea what you're talking about but canvas.width is in the same as canvas.style.width, afaik
 
I asked Simon a while ago, and he said he thought it was okay
 
@AmaanCheval ok fancy this: default canvas height = 100, width = 200; you assign height = 1000 in css right? wrong. it stretches the 100 pixels to fit the 1000, so each y block is really ten times what you think it is.
 
@rlemon Right. What's the advantage of using ctx.scale over CSS in that scenario?
Also, note that it's only for mobiles and we allow only one orientation. So there won't be that huge a variance
 
8:24 PM
canvas.width !== canvas.style.width I don't think?
 
canvas.width = 100, canvas.style.width = 500px. You not how a 100 pixel width image, being stretched to 500 pixels
 
It isn't
style.width will stretch the images within
.width will only change the canvas size available to draw
 
Yeah exactly
 
I just realized we're all repeating each other
 
Originally, I wrote code that maintained the ratio as much and centered the canvas. 'twas a lot of work
2 mins ago, by andrewjackson
I have no idea what you're talking about but canvas.width is in the same as canvas.style.width, afaik
It isn't the same thing
 
8:26 PM
I meant that it wasn't
 
I always just update the width on resize
 
And then ctx.scale?
 
9 mins ago, by rlemon
var height, width;
function mcSize() {
  width = canvas.width = canvas.parentNode.offsetWidth,
  height = canvas.height = canvas.parentNode.offsetHeight;
}
window.onresize = mcSize;
mcSize();
 
I've never had to use scale?
 
I don't ever scale.
 
8:26 PM
Ah
 
@rlemon yah
 
but never made a very intensive canvas application.
 
That's the problem I've got. Got to make it full screen
 
SO just don't worry about aspect?
 
@AmaanCheval wait for Loktar to return. ask him
 
8:27 PM
I did originally; but my boss is happy with the CSS scaling too
 
Your boss isn't a Canvas expert is he?
 
Well sweet then
 
Of course not. It works and looks well on all the devices he's tried
I'm not saying this is the optimum solution
 
@AmaanCheval wait for Loktar, see what he says. Simon would be good as well. (not sure who else has made larger games)
 
I'm saying this isn't as bad
@rlemon I asked Simon earlier
 
8:29 PM
I just know there are problems with Canvas and CSS height/width definitions and although the issues may not be visible right away to make things less error prone i'd avoid it all together.
 
I know, I know! I remember having ugly problems with them
 
^ as a precautionary
 
3 hours ago, by Simon Sarris
@AmaanCheval use CSS scale, and you might want to consider setting the meta viewport scale to half
 
@Greg welcome
I don't know when you got here.... but here you go anyways.
 
8:32 PM
Hahahaha
 
Gorgeous
 
Oh, @Loktar has been having trouble with logging in using OpenID
He tweeted about it
Grr, it's really bothering me now
@phenomnomnominal Give me your email address
 
function random_sort() {
    var n = Math.random();
    if (n > (1 / 3)) {
        if (n > (2 / 3)) {
            return 1;
        }
        return 0;
    }
    return -1;
}
is this a good way to implement a random sort for an array
arr.sort(random_sort); // so far it works.
 
@AmaanCheval - craigspence0@gmail.com
 
@phenomnomnominal Emailed you. Note that it's for mobile and if / when it'll be shown on desktops, it'll be in an iframe
So my scaling code won't really matter on desktops
 
8:40 PM
function random_sort() {
    var n = Math.random();
    return (n > (1 / 3) ? (n > (2 / 3) ? 1 : 0) : -1);
}
:D
@AmaanCheval, didn't get an email
it's craigspence(ZERO)@... in case you didnt just copy
 
I did copy
 
Hmm
Went to spam!
 
@phenomnomnominal yea. I get bitched at every time I write code like that :P
 
@rlemon Ever heard of the Fisher-Yates algorithm?
 
8:45 PM
@Zirak what makes it better
and yes I have
I was half implementing it when I thought of this approach
 
eh, for your purpose it's fine.
 
@rlemon haha I would prefer to have code written out in 20 if/elses than one line of shit like that...
 
@AmaanCheval I can't even play it on my phone?
 
@phenomnomnominal You can't?
 
If you aimed at making true(er) random order, then I'd have suggested you simply do tests. See the statistical bias each method has.
 
8:49 PM
Which phone, OS, browser?
 
Random order...a nice oxymoron.
 
@rlemon Math.round(Math.random() * 2) - 1 imo
 
@AmaanCheval iphone 5 chrome iOS6 Horizontal mode
 
Ah, yeah, locked orientation
 
works fine vertical
 
8:50 PM
Portrait only
 
the add goes over the bottom a wee bit
 
I forgot to resize the rotation image
 
It looks great
but if you change direction mid swipe piggie keeps going the same way
 
@canon shit.... why didn't I think of this.
 
Ah, thanks. I'll fix that
 
8:52 PM
Also, if you quit out of chrome and come back it becomes a little square
 
I can't reproduce the swipe thing
 
@rlemon :P
 
Oh
@phenomnomnominal Ah, that's because I assume Safari on iOS, and add 60 pixels for the URL bar
Can't get it to become a little square either
Just starts playing
 
> banana | Virtual Dedicated | Pending Server Setup | CentOS 6
y u no ready yet!
 
@phenomnomnominal Ooh, got the swipe thing you were talking about when I swiped to change tabs
 
8:56 PM
Oh sweet
 
m59
hello there!
 
@rlemon How are you going to monetize it?
Ads?
 
@AmaanCheval yes
 
m59
I'm trying to avoid using an if statement in a for loop. The "if" checks the options for which kind of feed is being used and loops through feed.foo.bar or feed.bar.foo accordingly. I don't like that it has to check everytime it loops
is there a standard solution to this?
 

« first day (817 days earlier)      last day (4129 days later) »