« first day (801 days earlier)      last day (4148 days later) » 

1:14 AM
Nexus 7. Me likely :-)
and there's my first auto complete fail
 
helllo
anybody online here?
 
0
Q: javascript (mostly psudo code) help me optimize this algorithm to generate rooms (bottleneck comes from how I check if a room is with in a room)

zidsalOk I'm working on a game in javascript and I'm trying to generate rooms in a map, for this example the map is 32 by 24 (each tile is 32 by 32 pixels). a room is made up of a collection of tiles, a room is always in a square or rectangle shape e.g. 16,16,8,8 would make a room that draws from the...

 
2:01 AM
Can someone help explain the difference between: (function () {
// Declare global-to-page object to contain global-to-viewer elements.
var global = (function () {return this; } ).call();
global.Z = {};
})();\
and
var Z = {}
 
2:15 AM
0
Q: Javascript function optimization

ShimmyI created a function that rewrites file names according to the available space on screen: @{ var index = 0; foreach (var item in Model) { <div class="gallery-item"> <a href="@item.Uri" title="Click to open file" target="_blank" style="display:block; width: 100%;"> ...

 
Any of you guys used the Asus Transformer TF300 or TF700/infinity? Mostly looking knock out a need for tablet and ultraportable laptop in one shot.
@atomSmasher, not sure what's up with the empty .call() thing. IIRC there are some slight difs between assigning as a property of global and declaring in global but I'm having to google for that.
 
I still think netbooks are better suited for that
depends tho
what u intend to do
 
@ErikRepen ok, thank you. I thought it was kinda strange. I am trying to go through a ton of code and it's really hard to read. He wrote a 10,000 page novel with no API or direction
 
@skopp mostly typical tablet + android testing + lightweight text editing of JS.
 
okay... yeah tab
 
2:27 AM
If it played movies on my high-def TV well, that would be a huge plus too.
 
how long u willing to wait
firefox os is out already
no devices have it
YET
I've started developing for it. Slick I must say
 
@ErikReppen Any thoughts on how you would jsdoc that chunk? Everything in the entire program is based off of the Z. For example the remaining objects and functions are Z.foo(). I am not sure what I would classify the junk surrounding the global.Z instantiation. The outer function has no name!
 
The outer function having no name is meant to help avoid accidental global declarations. Everything is scoped to the function.
Unless you explicitly assign to global for instance.
 
@atomSmasher, pretty sure he's just making sure that the global object isn't being contaminated?
 
Otherwise stuff like for(x in someObject) would create a global var X.
Well x not X.
@atomSmasher yeah, as simple as that. Z is just a global namespace basically.
 
2:37 AM
gotcha, that makes perfect sense. This is the start of 10,000 lines of code. I am trying to 'javadoc' his code so I can make my own API for modifications. He doesn't provide any API whatsoever. I started to copy my eclipse outline but it's a nightmare. I think jsdocing would be even worse.
yeah I have created plenty of object literals using the a simple var Z = {}. He threw a curveball with the fancy global and function!
 
@atomSmasher the .call is strange. It returns 'this'. Not sure what the point of calling it is.
 
@ErikReppen I am glad I'm not the only one unsure about it. Most of the googling I have done involves parameters to call.
 
Might be some obscure platform or circumstance where this at the global level doesn't work right.
 
Merry Christmas to all, and to all a good night!
 
you too!
 
3:04 AM
Yeah, Merry Christmas + holidays.
@atomSmasher, wait, no API or no documentation for the API? It's a lot easier to read the attributes of a JS object than a Java object.
 
@ErikReppen I agree the remaining objects and functions will be a breeze. I just wasn't sure how to classify the first chunk, but I think I have it figured out. jsDoc makes it very easy. Just alootttttt of code to go through. Not a single drop of API! I am not sure if you are familiar with Zoomify, but I hope you never have to use it!
 
 
1 hour later…
4:36 AM
Merry Christmas
 
I would like to share a post about freedom and forgiveness in Javascript: 10kloc.wordpress.com/2012/12/25/…
 
5:03 AM
posted on December 25, 2012

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} Merrrrrry Christmas, geeks. Your gift is a sneak at a new project I'

 
6:03 AM
0
Q: How to call startcart() just before closing body tag

SteveRHow would I put the following code, for a certain shopping cart, just before the closing body tag in my WordPress site? In the footer? It seems to me that I would only want to call startcart() for product pages. Thanks very much. <script language="javascript" type="text/javascript"> startc...

 
6:57 AM
0
Q: Are there any OO-principles that are practically applicable for Javascript?

SpoikeJavascript is a prototype-based object oriented language but can become class-based in a variety of ways, either by: writing the functions to be used as classes by yourself use a nifty class system in a framework (such as mootools Class.Class) generate it from Coffeescript In the beginning I ...

 
7:50 AM
And it sucks when dealing with some browser incompatibilities. I think jAndy did a DOM extending project around now and he faced a lot of FF issues
 
8:10 AM
MERRY CHRISTMAS.
NOW CODE JAVASCRIPT ALL DAY.
 
 
1 hour later…
9:19 AM
@Raynos MERRY CHRISTMAS!
NOW DONT TOUCH JAVASCRIPT FOR ALL DAY.
 
4
Q: How to create new div when the content is is overflowing past the fixed height of the div?

JametsonCSS .page{ width: 275px; hight: 380px; overflow: auto; } HTML <div class="page">dynamic text</div> How to create a new div when the dynamic text is overflowing past the fixed height of the div? Example: <div class="page">Some dynamic texts will ap...

 
 
3 hours later…
12:15 PM
0
Q: jQuery countdown - accuracy

Badaboooooomi'm using this simple plugin to show a simple countdown in my pages, what i would like is to keep it more accurate, cause somentimes it seems it isn't accurate. This is the plugin: /* countdown is a simple jquery plugin for countdowns Dual licensed under the MIT (http://www.opensource.org/lice...

 
12:52 PM
0
Q: Strophe session attachment -- 403 forbidden

mlakharaI am working on an XMPP web application which need to include session attachment. I am using Openfire XMPP server. I have successfully implemented the server side attachments where the session is created and I get the sid and rid of a session. Unfortunately, I am stuck in the next part. As I kno...

 
Hello, Merry Christmas
 
1:15 PM
Happy festevus
 
Ron
1:32 PM
Can I link between 2 variables?
for example link a variable to b variable, so when one of them is changed the second one changes to the same value/object/w.e?
 
Not directly, but you can use objects.
If a and b are the same object, changes will be reflected in both.
 
Ron
I see, thank you.
 
2:09 PM
In one minute, he had over a 100 retweets
 
2:20 PM
"JavaScript is still a spin-off of java, right?" -- stackoverflow.com/posts/comments/19381554
 
0
Q: XMLHttpRequest don't send to another page

Ali RiyadhI use this code to upload files, and this code have a progressbar. The problem with this code is that it never send me to "upload.php" after it have uploaded the file, after it reach 100% on the progressbar. (It's not my code). The code: // get form data for POSTing //var vFD = document.getEle...

 
@RobW is there some place we can punish those people?
 
2:41 PM
> Hey baby, do you have jQuery installed? Cause you are sizzlin'.
 
2:55 PM
0
Q: Which email detection regex is better?

GeotargetHere I have 2 email validation regexps, which one is better and why? new RegExp("^[a-zA-Z0-9_-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,}$", "i"); new RegExp("^([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4})*$", "");

 
The golden version is nicer though :p
Hard to get without abusing reddit etc. for it though ;)
 
haha yeah I guess
omg, clojure has matching patterns!
 
3:55 PM
^-- full of win
 
4:43 PM
0
Q: How/where can I improve this code?

Hassan KhanI'm quite new to Javascript, what areas of the code should I concentrate on improving, and if possible, how to improve them. (function( global ) { var emojify = (function() { // Get DOM as local variable for simplicity's sake var document = global.window.document; return { // This function...

 
5:26 PM
MERRY CHRISTMAS
 
@Loktar That was yesterday
 
Its today here :P
 
@Loktar What do I care about your definition of "here" :P
 
What do I care of your definition of "yesterday" :P
in fairness
its today there as well
just sayin
its today everywhere today!
 
I'm not into the whole christmas stuff anyways
 
5:29 PM
@Loktar What do I care about anything you "say" :P
 
Ah I love christmas man
favorite time of year
 
Doesn't make a difference to me, but there's loads of games on sale :p
So I'm liking it right now
 
yeah
 
Don't you live in Nebraska? Isn't it like -10000 degrees and 40 ft of snow?
 
except the steam sales are very meh this year
@twiz haha nah its pretty cold I guess like 2 F, but not much snow
 
5:31 PM
Yeah. GOG seems to have some good ones
 
when I lived in MI we had much more snow
@AmaanCheval yeah
and Amazon
 
Did you get the Humble Indie Bundle?
Snapshot has been fun so far
 
yeah I havent played that game yet though
been playing chivalry
 
I haven't tried any except for Snapshot and The Binding of Isaac
 
that ones fun
Binding of Isaac
friggin hard
 
5:34 PM
Tough too
 
Did that one have Faster than Light?
 
Nope
 
Faster than Light is a really fun game as well
 
Can anybody make a course on codecademy.com on .prototype?
 
@henrymb67 what do you need to know?
tons of great tuts out there
 
5:38 PM
@Loktar the tutorials i read are a tad bit hard to follow
any that you recommend?
 
@Loktar how was Christmas with your kids?
Up at five am?
 
literal notation vs constructor notation... which should be used when?
 
6:04 PM
for plain objects? always the literal. it's much nicer
same for arrays
 
@Abhishek Merry <whatever you celebrate over there>!
 
@rlemon i ceeleebrate everything
 
a festivus for the rest of us
!!/google festivus
 
6:17 PM
@henrymb67 If you only need a simple container of data, go with a simple literal. Otherwise you can use a constructor to add methods and properties to the object during construction.
 
6:28 PM
0
Q: PHP: Preg_match_all to extract html into string

Redboxi have html like this: <ul id="video-tags"> <li><em>Tagged: </em></li> <li><a href="/tags/sports">sports</a>, </li> <li><a href="/tags/entertain">entertain</a>, &...

 
6:39 PM
@rlemon nah like 7:50 lol
 
6:51 PM
happy christmas!
 
Happy holidays to everyone!
 
@Loktar Did you end up pranking one of your kids again?
 
 
1 hour later…
8:15 PM
@AmaanCheval how does this looks
optionally i can go one step crazier [ lemme demonstrate ]
 
Looks fine!
 
this is second option
imho second is a bit overkill
 
the first one looks like the avatar is floating in the wrong position, at least to me
 
@IvoWetzel same
@IvoWetzel what you say move the avatar down ?
 
yes, I think that would be the best option here
 
8:25 PM
It will look a lot like a facebook ripoff though
but then i can use the second's effect on Top and make it look fine (x
 
I didn't even have facebook in mind here
but then again, I'm hardly ever on facebook
 
:o oh well
i was watching facebook on phone so kind amy mind yelled hey that one is going to look like FB!
 
9:02 PM
@IvoWetzel , @AmaanCheval how does it looks now ?
 
@OlegOrlov Ternary expressions don't scale.
 
@Abhishek Looks good
 
That's the only reason. If it's small, sure. If it's larger-than-small, don't.
 
@Zirak Bullshit
 
No, "ternary expressions"
Common typo
 
9:05 PM
Am off to bed , more on this tomorrow with final layout ;D
 
a ? b : c ? d : e;
That's not very nice
 
Yeah, was just kidding
 
have you seen jquery code?
they use ternary operators in some places...
 
Sometimes i use complicated ones in CS class just to show how smart I am :p
 
Ah yes...jquery contained some pearls of horrid conditions.
 
9:06 PM
Just like SomeKittens runs sudo apt-get update if someone's standing behind him
 
oh, how people love smushing return statements into 1 line...
 
@FlorianMargaine Wow
 
they have those everywhere in the code
 
Ternary operators in for statements are a hit as well
 
9:08 PM
^ @FlorianMargaine
if u have a spare minute
think on how can we implement it with templates
just the top part will be a PITA
 
@Zirak Why so?
 
Because people love abusing for statements as well
And think "hey, it's 1 line anyway, and I really hate putting (the instantiation outside|the assignment inside|the condition inside) and be sane or use a while loop..."
 
@AmaanCheval oh try benchmarking vs others stuff someday
 
@Abhishek what do you mean?
 
Or something like that. Probably not even close.
 
9:10 PM
@FlorianMargaine T.T , nvm am too tired to explain that .. laters man
merry x-mas again
 
merry christmas :)
nested ternaries!
 
Guilty of doing that
Not of going all that far
But I've nested ternaries on multiple occasions
 
Let's grep the jquery source for swearwords
 
do you mean "IE"?
 
9:13 PM
Yes.
That or "your mother is a filthy whore".
Whichever.
 
104
23 for "IE6"
for those that want to reproduce: git clone https://github.com/jquery/jquery && cd jquery/src && grep -r "IE" | wc -l
I might checkout an older branch though
recent versions have removed old hacks
 
 
2 hours later…
11:32 PM
I have gone cross-eyed. And it's not the eggnog. Let's say I have X.ObjectA = new Foo(); and Foo() contains "this.bar = function(){stuff}" which is later called using the following syntax: X.init(){X.ObjectA.bar();} what does 'this' in Foo point to?
 
hey guys
compliments of the season
 
you too!
 
I am having a problem here....I'm trying to upload a canvas .ToDataURL() to facebook api using javascript. My problem begins with android 2.3 browsers and there inability to utilize unit8array
Is there anyway to work around having to use unit8array to send image data to facebook via javascript?
*uint8array
crickets
 
Did you see this: "In the past, this had to be simulated by treating the raw data as a string and using the charCodeAt() method to read the bytes from the data buffer."
 
11:48 PM
hmmmm no i didn't can you send me to the reference material you got it from so as to research a possible solution?
 
It may be to slow.. not sure your application
 
hhmmmm
this is confusing as in order to send it across ajax i need to pass it as an arraybuffer
i decode the data string then i use the following `if ( XMLHttpRequest.prototype.sendAsBinary === undefined ) {
XMLHttpRequest.prototype.sendAsBinary = function(string) {
var bytes = Array.prototype.map.call(string, function(c) {
return c.charCodeAt(0) & 0xff;
});
this.send(new Uint8Array(bytes).buffer);
};
}`
dammit how do i format code in chat?
 

« first day (801 days earlier)      last day (4148 days later) »