« first day (1175 days earlier)      last day (3772 days later) » 

7:01 PM
@rlemon You could also do return { r: h >> 8, g: h >> 4 & 0xf, b: h & 0xf } of course
 
@JanDvorak it is not ninja'd if we can see ur edits :-P
 
!!urban "ninja'd"
 
@JanDvorak Could not process input. Error: Unexpected end of input: Expected ' on line 1 on column 8
@JanDvorak No definition found for "ninja'd"
 
@copy that doesn't give me correct results.
 
@rlemon "123".repeat(2).split("").sort().join("")
 
7:02 PM
@copy nvm, I understand what you meant now
 
so gross
 
Hmmm. Got some testing feedback finally.
And now I have 25 cases assigned to me..
 
@rlemon Oh wait, but that's not the same
return {
    r: h >> 8 | h >> 4 & 0xf0,
    g: h >> 4 & 0xf | h & 0xf0,
    b: h & 0xf | h << 4 & 0xf0
}
 
guys, is there a way to get jshint node output in JSON format?
 
7:07 PM
var colorConverter = function(hex) {
    hex = hex.replace(/#/, '');
    if(hex.length == 3)
        hex = hex.replace(/./g, '$&$&');
    var n = parseInt(hex, 16) | 0;
    return {
        r: n >> 16 & 0xff,
        g: n >> 8 & 0xff,
        b: n & 0xff
    };
};
 
@Annie jshint is meant for human consumption
 
@JanDvorak just don't try jslint
that stuff tastes Horrible!
 
stick the | 0 in there in case parseInt returns NaN so it'll change to 0
 
I created a fiddle - anyone know how to get this to be in the desired order? jsfiddle.net/jeremybolanos/N9q6T
 
7:10 PM
@SomeKittens was also this cold where I am
this morning we were discussing it. colder here than both poles
 
@jbolanos iterate over listOrder indexing into vendorData with its elements?
 
crap - brb - gotta crap - will probably end up asking again later. I'm stumped.
 
@jbolanos What "order" do you want them in?
 
toilet time is not worth telling us
 
user1125394
cssdeck.com notbad.jpg
 
7:13 PM
@JanDvorak, I guess the browser version returns errors in JSON.
 
It's 57F here.
 
@rlemon "123".replace(/./g, function(c) { return c + c }); seems to be faster than map() on chrome and ie... the map is faster on firefox
 
$.each(listOrder, function(i){
    k = listOrder[i]
    v = vendorData[k]
    var ul = document.getElementById('list');
    var li = document.createElement('li');
    li.appendChild(document.createTextNode(k));
    ul.appendChild(li);
});
 
@canon using .replace(/./g,'$&$&')
 
7:15 PM
@jbolanos That works; there's probably a more concise way to do it without using the index;
 
.map is nice, but support + speed issues
however speed for something like this is moot
 
Have a good weekend all!
 
user1596138
Been running into a lot of @loktar 's old answers today
 
working with canvas?
 
user1596138
Exactly.
 
user1596138
7:19 PM
But was looking for a way to make an image from a rendered div. Apparently it's not going to happen.
 
user1596138
Egwhw
 
it works pretty well actually
 
user1596138
Ok maybe it does look promising.
 
I was impressed
 
user1596138
7:21 PM
But no backgrounds/borders/anything really but text/images...
 
One of the browsers supports it..
supports screenshots directly
 
you select the container
@Loktar FF iirc
 
cant remember if its chrome or FF
 
FF always has the cool shit
 
just not the speed
 
7:23 PM
well I've noticed it has huge speed boosts on the strangest stuff
setAttribute in FF is lightning fast
like 50X faster than chrome on certain cases
 
in PHP, 2 hours ago, by Madara Uchiha
http://i.imgur.com/sfzQ7Um.jpg < Android chrome
in PHP, 2 hours ago, by Madara Uchiha
http://i.imgur.com/43XizIK.jpg < Ubuntu chrome
Why?! TT^TT
 
That will actually work for me - simple and flexible
 
@MadaraUchiha example code?
 
@rlemon Hold on
 
also, is that an image? video? canvas element?
 
7:26 PM
@rlemon It's a div, with a background
 
and on Ubuntu are you using Chrome or Chromium ?
 
I suspect that mainArea.style.backgroundSize = "cover"; is to blame
Chrome
    Viewer.prototype.init = function(node) {
        Viewer.stop();
        this.controls = this.generateControls();
        mainArea.style.width = "640px";
        mainArea.style.height = "360px";
        mainArea.style.border = "1px dashed black";
        mainArea.style.backgroundImage = "url('" + node.src + "')";
        mainArea.style.backgroundSize = "cover";
        mainArea.style.backgroundPositionX = 0;
    };
That's the relevant piece of code
 
hrm
 
if i cache a jquery object then reload the chunk of the page where there element exists my cached object won't grab that right?
 
try 100% 100%
 
7:27 PM
<div id="viewer">
    <div id="mainArea"></div>
    <div id="controls"></div>
</div>
But it isn't 100% 100%
 
cover is 100% 100% no?
 
It's a sprite, I want the sprite to scale exactly to the frame's size
Is it?
I'll try
 
ohh nvm
well idk
100% 100% will size the background to the container
afaik it should be the same result
 
No, it isn't the same.
 
cover
This keyword specifies that the background image should be scaled to be as small as possible while ensuring both its dimensions are greater than or equal to the corresponding dimensions of the background positioning area.
 
7:29 PM
It stretches the background to fit the container
 
you are correct. I have just used them for the same results before
 
@rlemon auto 100% seems more appropriate
Let's see how the mobile version handles it
Still the same
 
when you reload a section of the page does it sever the connection to any cached jquery elements?
 
@hunterc huh? like event listeners or detatched elements
 
@rlemon so i store an element: var tmp = $('#element'); then i reload a chunk of the page with the .load() function. then when i try to add a class it doesn't work: tmp.addClass('load')
 
user1596138
7:34 PM
Is there no way for me to look at the computed styles of an element and draw the background accordingly?
 
@hunterc if you mean the elements within the part tthat are loaded... yeah, these nno longer exist
 
user1596138
@MadaraUchiha lol alright...
 
how do I undo the last commit
I haven't merged yet
 
user1596138
7:36 PM
I know how to access styles.. Haha. I want to redraw on canvas according to those styles.
 
or really, just change the commit message
 
@rlemon git?
 
@Jhawins why not just use html2canvas
@hunterc yes
 
@hunterc sweet thanks
 
user1596138
7:37 PM
@rlemon It doesn't render the backgrounds/borders or really anything but text and images.
 
seems to render that entire page perfect
 
user1596138
What're you smokin
 
user1596138
Or is it not working for me because of Safari
 
just travel to Europe
 
posted on January 03, 2014 by Victor Rodriguez

F-Secure's Mikko Hypponen Cancels RSA Talk In Protest On December 20th, Reuters broke a story alleging that your company accepted a random number generator from the National Security Agency, and set it as the default option in one of your products, in exchange of $10 million. Your company has issued a statement on the topic, but you have not denied this particular claim. Eventually,

 
7:39 PM
^ on Chrome
 
or Asia, where fire foxes live.
 
some stuff is lost, I think that is all iframe data
 
user1596138
background-image must be throwing it off with the gradient...
 
@Jhawins minimally that project will have the code you need to render the HTML elements to canvas.
save yourself the effort
and if you want a function to read a background gradient and produce the canvas equiv I can write that. but you'll have to wait a bit
 
user1596138
But I need to add to it for background-image to render too. So I'm trying to improve it.. Unless there's something else going on still.
 
7:41 PM
what is the goal here?
 
user1596138
It's cool. Just wondered if there was a function/simple method already worked out. Pretty uncommon goal though I think.
 
user1596138
Pretty much screenshot a div in canvas.
 
user1596138
A fully rendered/styled div.
 
user1596138
Reasoning behind this: None. So maybe I shouldn't bother haha
 
user1596138
I just wanted to do it.
 
7:42 PM
haha
 
@rlemon anyway to preserve a cached jquery object after calling load() on that element?
 
well you can sniff all of the computed styles and draw it on Canvas. but that seems like a very tedious piece of code to write
@hunterc give a better explanation please.
 
user1596138
Yeah that's what I'm thinking... Very tedious. There must be a better excuse for me to play with canvas haha.
 
what do you mean by 'cached jquery object'
@Jhawins particle systems seem to be a good starting point
or grid collision
 
user1596138
Sure sure but I have no desire to mess with them :P.
 
7:44 PM
then dick with the video / webcam api + canvas
 
user1596138
I have a desire to render a div in canvas for some reason...
 
user1596138
Which is dumb.
 
nahh, it is just not fun to do
 
user1596138
I will keep my dick out of the webcam, but I might play with it.
 
user1596138
7:45 PM
Ambiguous... What does he mean he's going to play with... ;)
 
@rlemon cached: var tmp = $('#element');
 
@hunterc no.
 
@rlemon @mikedidthis That mouse thing is incredible youtube.com/watch?v=V43t_S7VGJA
 
the DOM container is replaced with new content and all associations are lost
assuming #element is in the container you are replacing the contents of
you will have to re-select the element. or depending on what you need it for, delegate the events
 
7:48 PM
@rlemon okay. thanks. didnt know if it was just a pointer on the page
 
@rlemon ah, I didn't know about $&. That's useful.
 
@SomeGuy I can't remember who introduced the idea, or when... but for as long as I can remember the brain has been a organic computer filled with circuits... opposed to the chemical stew they taught us in Bio
@canon neither did I until @nderscore (?) showed me
 
@rlemon Well, they don't really have to be mutually exclusive
 
do you know about $` and $' ?
 
7:50 PM
I've always believed that the brain's gotta be hackable one way or another
 
@SomeGuy no, but in your way of thinking of how to manipulate the brain. Classical (when I was in school learning about neuroscience) methods and theories were all just flooding the brain with chems. Think of drugs we use for emotional control, add, adhd, depression, etc.
 
@rlemon Ah, right
 
now we are starting to move into more of a 'well the brain is actually a computer and we will get much more accurate and better results if we treat it as such'
 
Recovered my steam account <3
 
Well, the chemical way is easier for us to learn about
 
7:52 PM
yea :P - but the other train of though (imo) is more valuable for us today
 
Really butthurt black ops mac editions is freaking $50
 
!!> 'abc'.replace(/\B.\B/,"$`$&$&$'")
 
@nderscore "aabbcc"
 
@rlemon Yeah, and that way we'd actually be learning more about the brain itself than what the brain uses
 
m59
[] of light
2
[light]
 
user1596138
7:56 PM
['light', 'light', 'light']
 
m59
or [sunshine]
that cracks me up =D
 
user1596138
!!> [arrayOfLightBitch]
 
!!> Array(42).join('light');
 
@Jhawins "ReferenceError: arrayOfLightBitch is not defined"
@rlemon "lightlightlightlightlightlightlightlightlightlightlightlightlightlightlightlig‌​htlightlightlightlightlightlightlightlightlightlightlightlightlightlightlightligh‌​tlightlightlightlightlightlightlightlightlight"
 
user1596138
!!urban array of light
 
7:56 PM
@Jhawins That didn't make much sense. Use the !!/help command to learn more.
@Jhawins No definition found for array of light
 
m59
a ray of light
 
user1596138
Come on Caprica do something funny..
 
!!> Array.of("light")
 
@KendallFrey ["light"]
 
m59
LOLZZZ
 
user1596138
7:57 PM
!!> light = []; light instanceof Array
 
@Jhawins true
 
And I still don't know what Array.of does that Array doesn't
 
@KendallFrey a FF thing?
 
Could be.
 
7:58 PM
seems to be
 
I think it's ECMAScript
 
TypeError: Object function Array() { [native code] } has no method 'of'
^ Chrome latest stable
but FF does allow it
!!refresh
@ThiefMaster ahoyhoy
 
user1596138
!!mdn array.of
 
8:00 PM
 
They really added it on the off-chance that someone might need that?
 
the polyfill is funny
if (!Array.of) {
  Array.of = function() {
    return Array.prototype.slice.call(arguments);
  };
}
 
@KendallFrey Only thing seems to be that using this with a single argument will work differently
 
oh, that, yeah
but still, [derpity]
 
Not only is this a dupe of your own post as Mike B pointed out, the answer on your other post answers it! Sheeshrlemon 7 secs ago
still looking for more feedback on this: github.com/rlemon/liveshadowjs/issues/3
if it is stupid I don't wanna bother implementing it
 
8:08 PM
20 more JS upvotes and I got me the JS bronze
 
user1596138
Ugh
 
user1596138
0
Q: how to delete a checkbox on condition using jquery

user2942566I have something like this: <th colspan="2">Status</th> `<th class="data-name">Name</th>` `<th class="data-name">Description</th>` The Status field has 2 values: the checkbox is 'in Use' and 'Not used'. I want to add a validation to the checkbox saying, if the status is 'in Use...

 
hmm... in firefox, reduce() was fastest
 
He's talking about pretty much exactly what you spoke about earlier
 
stupid spidermonkey caching
 
8:13 PM
@SomeGuy hehe
 
user1596138
@SomeGuy Exactly ;)
 
user1596138
The info had to come from somewhere haha
 
one of those articles / shows I watched as a kid outlined the principals and the idea of it all. It made a lot of sense to me and it just 'clicked' for me. since then it has been how i've viewed it all.
btw - do you just research the fuck out of every idea we discuss in here?
 
Hahaha, I research the fuck out of anything I find interesting
 
good man!
never stop
 
8:16 PM
HAMMERTIME!
 
So, any ideas for my question from a while back?
 
window.getComputedStyle(element).backgroundColor will all browsers return this as rgb?
 
53 mins ago, by Madara Uchiha
Why?! TT^TT
 
@MadaraUchiha without being able to play with it, no clue.
set up a fiddle or something
 
@rlemon Will try
Thing is, it relies on AJAX to load the sprites in the first place, I'll have to make some modifications
 
8:20 PM
just a static example will work
 
@rlemon According to MDN, yeah
Oh, wait. getComputedStyle returns the used value not the computed value
 
@SomeGuy haha I read the page and missed the 'computed style' part
 
Haha
 
yea it won't make a diff for bg color
 
Seems like you'll still always get an rgb/rgba return
Yeah, makes no difference in this case
 
8:28 PM
var getColor = function(elm) {
	var rgb = window.getComputedStyle(elm).backgroundColor.match(/^rgb\((.*)\)$/, '')[1].split(',');
	return {
		r: rgb[0],
		g: rgb[1],
		b: rgb[2]
	}
};
I don't like this ....
 
@rlemon How do I generate a "static" example? :P
 
@MadaraUchiha without ajax loading in the images.
just put one image as the background with css or something
 
The images are local though, I get your point though
 
This seems to reflect the issue well enough
 
8:33 PM
okay let me finish testing my code then i'll look
 
OK, thanks.
 
why .match(/^rgb\((.*)\)$/, '')[1].split(',') vs .match(/\d+/g)?
 
Guys, small Q: Could anyone tell me how do I resize an image proportionally AND center it?
What I want:
- A single image on a html page
- Scaled proprtionally
- Horizontally-vertically centered

I tried to use up every Q I found regarding scaling/align, but I can't get things working. (I cannot really post a jsfiddle as all I had is a mess from all the pasted codes together.)
I know this is both JS (resize) and CSS (center)
 
@Shiki Have you tried learning and understanding, rather than copypasting code and hoping it works?
 
The tradeoff just not worth it. :/
I knew JS/HTML/CSS before, but I always forget it all. I spent days re-learning everything every single time I had to work with these. Then I forget about it all because I just don't need them. Only like once a year or even less than that.
*knew => managed to write code/make sites I had to.. was never an expert as you can see, but you know it was enough for a while to do things
 
8:42 PM
@Shiki In that case, you may want to hire a developer to do the job for you. We can help you when you have problems, we will not write the code for you
 
How much would they ask for making a single html page with a single image with this single css property?
 
There are a lot of methods to center an element on the page. Google is your best friend.
Resizing proportionally? Just set a width, the browser will do the rest.
 
@canon because i'm an idiot
4
 
heh
 
fix'd: included a text-only "work in progress" message.
 
8:55 PM
@mikedidthis Not sure if I've linked this before, but I believe I haven't en.wikipedia.org/wiki/H._H._Holmes
 
@MadaraUchiha after tinkering, Android (Chrome Mobile 18?) it appears that the image is scaled funky
zoom in on the browser (pinch) and see the breakpoints jump
forcing initial scale Might help.
using an image underlay vs a background image will def work
 
remind me how to set an initial zoom?
Also, an image underlay will not work because it's a sprite
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> <!--320-->
right?
 
yea something like that
I just google it normally.
@MadaraUchiha image underlay would work fine.
 
The bit about google at the bottom here irks me. It means I can't export maps. >:(
 
@rlemon How? With a sprite?
 
9:06 PM
you can have an image-based "sprite"... just use a clipping container
 
@MadaraUchiha container with overflow:hidden and position the image absolutely inside the container just like you would the background offset
 
^ that
 
It's not exactly "underlaying" if it's inside the container :P
 
you know what I mean.
 
9:07 PM
bitch, please :P
 
!!meme bitch please
 
@MadaraUchiha Sorry, I don't know that one.
 
!!meme okay
 
Hello good Sirs. Hopefully a quick question, but in this fiddle how would I write it so I could run a method from console.
 
9:16 PM
@Fabien What browser are you on?
 
Chrome
 
JSFiddle runs the results in a different frame than the main window
 
@Fabien run what method?
 
Any public one.
 
in your console, click <top frame> and select result
 
9:17 PM
So for instance assume I had a method in there called "this.getWindowHeight" which just returns 12. And I wanted to console.log(getWindowHeight());
from console
 
@Fabien what SomeKittens said. there's a dropdown at the bottom of the chrome console, pick the window you want to "run in"
 
Sorry, I guess I am not being clear. Not how to run it from console, how do I structure the code to make it callable from console
 
OH, ok. Yeah, that's different
 
@Fabien that's what I asked. what do you want to run?
 
You'll need to declare the functions in the global context (i.e. not inside something else)
 
9:20 PM
@Fabien generally, if you stick it in window.something then (for example) something() will call it
as a test hack - to be able to get at something that is hidden inside an IIFE
 
Update Fiddle Hopefully it's a little clearer
 
You'll need to deliberately leak to global scope (no var statement): jsfiddle.net/5xvrA
 
Line 78 obviously wont work
 
@Fabien for example: jsfiddle.net/Qz2fG/7
 
9:23 PM
Ah fair enough
Cool, cheers for the help guys.
 
user1125394
jsbin.com/afiMEWa/2 collaborative painting
 
Wow. I can tell that I haven't coded in Java in awhile because I couldn't remember what an array literal looked like...
 
Java has array literals?
 
@KendallFrey It's not like we're talking about PHP or something …
 
C# doesn't have array literals.
 
9:33 PM
@KendallFrey What? PHP has array literals, with crappy syntax: array(1,2,3)
 
C# wants array literals
 
user1125394
you mean Boob[] bs = {b1, b2} ?
 
That's not technically a literal
 
sure it is
 
It only works for initial assignment IIRC
you can't pass it as a value
 
9:35 PM
number literal: 1 bool literal: true string literal: "hello" array literal: array(1,2,3)
 
@ctrl Yeah; that's what I meant.
 
yes you can, I do it all the time
 
And I think you can in Java; the specific example I saw was:
 
@doug65536 You talking about PHP?
 
@KendallFrey yes
 
9:35 PM
@doug65536 Well, I'm not.
 
@ApiErrors({SomeException.class})
 
ah ok, I lost track of what we were talking about then :)
 
I got really confused trying to figure out what the curly braces did...
 
java is to javascript as pork is to porcupine
 
mmm pork-upine
 
9:39 PM
Family Feud knows that
"Name a word that follows 'pork'" "CUPINE!"
 
Or "pine" to "pineapple".
Or "grape" to "grapefruit".
I could go on, really, but I think you get the point.
 
Java is to JavaScript as penis is to PenIsland
 
user1125394
String::length ekk what's that
 
Huh; I have no idea...
 
9:52 PM
Namespaces, a very reasonable concept
 
I heard people mention it..
but never saw it posted
ITS FRIDAY!!!
/me heads home
 
It's not namespaces.
73
Q: :: (double colon) operator in Java 8

Narendra PathaiI was exploring the Java 8 source and found this particular part of code very surprising. //defined in IntPipeline.java @Override public final OptionalInt reduce(IntBinaryOperator op) { return evaluate(ReduceOps.makeInt(op)); } @Override public final OptionalInt max() { return reduce(Ma...

Basically it's shorthand for () -> String.length() in this case.
 
user1125394
o nice
 
["light"]
 
user1125394
 
10:24 PM
html5 vibrate api
nice...
 
10:45 PM
would have been more epic with a unicorn hat.. but, still epic
 
ooooo
I have that mask....
and cats.....
 
that vibrate API works without user confirmation ?!
that would be aweful if that works with a background-processed browser too :-P
 
Accepting my own user story: i.imgur.com/EIoioAl.gif
 
user1125394
gosh c9.io has also git in the terminal
 

« first day (1175 days earlier)      last day (3772 days later) »