« first day (211 days earlier)      last day (4804 days later) » 

12:00 AM
@GeorgeEdison this is totally outstanding work!
 
Oh, you saw that.
I've been working on it for the last few days.
Did you read the technical info?
 
Reading right now
My goodness, what a lot of work
I'm having no trouble imagining this took days
 
It did.
...and a lot of jsfiddle's.
 
I have the feeling that this may have long-term uses beyond just Meta freehand circles.
 
Me too.
That was the intention.
 
12:02 AM
Maybe not on SO proper, but some of the other SE sites
Graphic design for example
 
For example, Meta freehand mustaches.
 
@GeorgeEdison a little debugging shows me that canvas_context.moveTo(prev_x, prev_y); fails because both prev_x and prev_y are undefined. I wonder where they are lost though.
 
That's strange...
Maybe it's the 'event.offsetX'...
 
12:05 AM
One practical difficulty is that when you ask or answer a question with an image you want to draw on, you have to publish it first with the unannotated image in it before you can draw on it. But there's nothing you can do about that, the engine would need a "ask in stealth mode" feature to remedy that
 
@Pekka not only that but also the inventive use of changing the url to pass one or more parameters from the underlying frame back to the parent. Can't you remove a frame at that point?
@waffles what's that now?
 
top voters in the last 14 days on SO
 
@waffles is that an interesting metric for something?
 
@GeorgeEdison, yup, that's it... both offsetX and Y are undefined
 
Aha!
Now I can look for a fix for that.
 
12:07 AM
@drachenstern thinking of having it as a tab for /users
"Active Voters" ... 14 days ... more than 10 votes
 
@waffles but .... but .... but .... what's the interesting metric? Just to have most active voters?
what's the orderby for users with consistent numbers of votes?
 
Votes are critical ... and not enough people are voting, this would give back a bit to the people who actively vote by featuring them
and possibly encourage voting
 
@waffles nice idea
 
@waffles Hey, I started making the effort to vote! :p But feel free to give me more incentive ;)
 
@waffles so would you put this as the first tab on users?
 
12:09 AM
@drachenstern not a default tab ... probably after "new users"
 
@waffles idk, if it's the default that people see, it'll make 'em think a little more, no?
And for voting in the past 14 days, I would set the threshhold higher than 10. I think 100 upvotes out of 14 days
that's ~ 7 per day
 
on photo.se only 50 or so people voted more than 10 times in the last 14 days
 
Next Question:
 
this can not be a default tab ... it would be "too much in your face" if we did that
but we could have a "top voter" or something on the profile
 
12:12 AM
I've got a CSV which I need to convert to a JavaScript array.
 
@waffles I like that a lot
 
Can I use string replacement to replace line breaks with the characters I need?
 
@waffles I see your point
@waffles ouch
@Moshe examples work so much better than mythical maybes
you want to replace \n with },{ or something?
where are you processing it? PHP?
 
TextWrangler, A text editor for mac
I want to make a multidimensional array
 
@KlausByskovHoffmann: I think I fixed it.
 
12:14 AM
I need to replace newlines with ],[
for a JS array
 
@Moshe: That's easy.
 
@Moshe so is the question about textwrangler in particular?
 
I fixed it too
 
You mean replace newlines in a string with '],['
@KlausByskovHoffmann: You did? :)
 
@GeorgeEdison Yea, no quotes though
 
12:15 AM
Yup :-)
 
@drachenstern I'm not sure
 
@Moshe it sounds like you are asking about in TextWrangler specifically.
 
I drew something and saved it :-)
 
@Moshe: "a sample\n\nstring".replace(/\n/g, '],[');
@KlausByskovHoffmann: It worked?!?!
 
@GeorgeEdison In textwrangler?
 
12:16 AM
Basically the methods ended up looking like this (sorry everyone for the long code post):
// When the mouse is clicked...
$(canvas_element).mousedown(function(event) {

$(canvas_element).data('drawing', true);

var x = event.pageX - $(canvas_element).offset().left;
var y = event.pageY - $(canvas_element).offset().top;
// Grab the current coords
$(canvas_element).data('prev_x', x);
$(canvas_element).data('prev_y', y);

return false;

});

// When the mouse is moved...
$(canvas_element).mousemove(function(event) {

// Only do anything if we're drawing on the
// canvas at the moment.
if($(canvas_element).data('drawing'))
 
@Moshe: In JavaScript.
 
Okay...
 
@GeorgeEdison I think it should work in other browsers than FF too
 
I did something similar.
 
@Moshe yeah, you're asking about a particular tool. Just do it in js like he said
 
12:18 AM
I used $().position()
 
@drachenstern Ok
 
@GeorgeEdison yeah, it looks like it worked doesn't it: meta.stackoverflow.com/questions/3122/formatting-sandbox/…
:-)
Only, for some reason it doesn't draw in red.
oh, hangon, I fiddled with that too. probably just a "bug" in my version
 
Hmmm... that's weird.
 
Which browsers support console.log()?
 
Chrome does.
 
12:20 AM
Firebug
 
Er, Firefox does, right?
 
I don't know. I'd have to check.
 
I have chrome
 
@GeorgeEdison I have red working again... but when I try to save (the second time) it tells me that There was an error retrieving the imgur.com URL.
 
Oh, that's not good.
Sounds like the PNG that imgur is sending back is malformed in some way.
 
12:24 AM
@GeorgeEdison anyway, I'm off to bed now but I'll be available for some more testing in around 22 hours
 
Thank you so much!
I appreciate your help in this.
 
no problem
 
12:39 AM
Does Javascript have a memory limit with large arrays?
I'm trying to load all the zip codes into memory... Bad idea right?
has brilliant idea
I can break the zip codes up into groups and query the proper one.
 
@Moshe like by state?
What are you doing Moshe ... you need a lookup yes, but not as a single object in memory
 
Yea, basically
 
Let me go find you some edge cases to consider
 
Enter a zip, it fills in your City/State
I essentially need to "paginate" the state/city info
 
nah, you have a different issue
or you should
 
12:46 AM
Which is?
 
77583
 
?
 
Covers: Lochridge, TX
and Arcola, TX
But Arcola, TX could also be under 77545
 
Ok, so the user can edit the data if necessary
 
it's not 1:1
 
12:48 AM
It's close enough to work with
IMHO
 
So what I was gonna say is you could do city = zips[given] where zips is an object
like a hashmap
then it dawned on me
if every entry in zips were a map of itself, then you could do that
 
Right, but I'm okay with it being only so accurate.
It's close enough, it just populates a field which the user can change
Odds are it's correct.
 
so zips[77583] would be { "cities" : [ { "city":"Arcola","state":"TX"} , {"city":"Lochridge","state":"TX"} ] }
 
Anyhoo, how would go a about managing an insanely large array?
 
and zips[77545] would be { "cities" : [ { "city":"Arcola","state":"TX"} ] }
so then as you got back your results, you could query for length of the object, and know to present a dialog or return one result or give "that appears to be an invalid request"
@Moshe like that? I would keep it in a database and generate my JSON on the fly, but that's just me
 
12:52 AM
@drachenstern A db is too heavy for this.
 
@Moshe for long term storage or for accessing for what you need?
 
@drachenstern accessing.
This is a two month webpage for a raffle
 
@Moshe I was referring to long term storage
generate it on the fly as you need, so cache the intermediate results every so often and only regenerate as you need it regenerated
 
I'm not sure how I would do that.
Hang on, I'm trying to diagnose this console error, it may be fine.
 
well if you're only ever going to use it this once then just manage it as you have it
 
12:54 AM
I may reuse some of this data in an iOS app later, but not now, at any rate.
 
yeah, I'm with you
I am incredibly proud of myself that I remembered all my json creation by hand
 
Is this valid?
var array=[12345, "city", "state"];
or must the zip be in quotes?
 
well except you have mismatched quotes
 
better?
 
yeah
that's valid
 
12:57 AM
So I can store literal numbers
great
 
sure, why not
 
The question is if I want to.
 
you do realize that in js everything tries to be an object right?
 
yeah
I do
 
12:58 AM
Hey @Pekka is here
 
Indeed
 
Hey, @Pekka!
@drachenstern - I'm not sure I'm doing this right...
 
@Moshe throw it at me
 
var zips = [[12345, "city", "state"], [12345, "city", "state"], [12345, "city", "state"]];
etc
error in chrome console
Was wondering if it's a memory bug or syntax bug
 
syntax
 
1:00 AM
What's wrong?
 
I'll quote ok?
 
ok
 
, state"]
 
I just typed that now.
aside from that...
Well, there are 40k records
 
1:02 AM
Can't verify them...
 
what's the problem?
 
What browser is that taken in?
 
Chrome
 
Which tab?
 
???
the console tab?
 
1:03 AM
Of the inspector
or where do you see the objects structures?
hang on
er, no way!
I just searched for TRUE
in my text file
 
There is a city called "True" in "WV" and it wasn't quoted.
 
Will you send me a copy of your txt file?
you don't have to do it right now
 
Was wondering what the Console was blabbering about.
 
I just want to test somethings
 
1:07 AM
@drachenstern Want the Zip data?
It works now.
 
@Moshe yah
you've gmailed me before
 
oh, right
@Zypher - Hi
Ok, i got places to be.
Thanks @drachenstern.
 
What's up george
@Moshe I try
 
Heh, that was funny though;
True, West Virginia
Caused a bug in my JS
 
'allo
 
1:10 AM
George do you get @so mail to your phone?
or wait, ya'll are on gmail domains huh?
 
ive got m phone hooked up to get mail from googleapps:)
 
k, gonna forward you someting
 
kk
im on my 3g card in my laptop anyway :)
ja
 
phone's not picking it up :\
 
hrm?
 
1:14 AM
it finally cooperated
spam filter may kick it as being just an image with a few words and a short subject
it ain't spam tho ;)
 
gawd damn
 
no no it aint!
 
She teases me so! :p
 
haha damn women that is why us guys are crazy
 
1:16 AM
I know right
 
sigh is all i can say bout that
 
I didn't post it in here :p
and it isn't offensive
 
the fuzz cheese it
 
1:18 AM
da plane boss, da plane
 
@drachenstern that wasn't even at you q:
 
@RebeccaChernoff :p ok
 
343 new messages? Anything interesting happen in all that?
 
@mootinator not really
 
pretty sure the answer's always no, heh.
 
1:20 AM
Any PHP developers?
0
Q: I can't open this PNG file with imagecreatefrompng()

George EdisonHere is a PNG file: http://imgur.com/NUl4v.png (Yes, never mind that it's a funny penguin with a sign...) When running the following code: imagecreatefrompng('http://imgur.com/NUl4v.png'); I get an error: PHP Warning: imagecreatefrompng() [function.imagecreatefrompng]: Cannot read image ...

 
@RebeccaChernoff sometimes its mebbe
 
@GeorgeEdison no but if you hum a few bars I can fake it
 
I was a phper
Before Microsoft paid me off.
 
They don't like PHP there? :P
 
@GeorgeEdison whats the file perms?
 
1:21 AM
@GeorgeEdison no, I can't help with that. I would suggest opening it in gimp, saving with a new name, and trying again
@Zypher ooh, good call. it's in /home/
 
@Zypher: It's a remote file.
I can open it with file_get_contents().
 
dammit, gotta shut down for a minute or two...fan's going bonkers. >_<
 
@GeorgeEdison doesn't change the perms question
 
brb >_<
 
@RebeccaChernoff quick, now's our chance, she's gone!
 
1:22 AM
@RebeccaChernoff: Maybe a rogue program is eating your CPU?
 
@GeorgeEdison so PHP can open it with file_get_contents but not imagecreatefrompng
 
can you post the rest of theerror message?
 
yeah, try and resave it
 
@GeorgeEdison Then it's trying to use /home/test/... as a temp folder perhaps? And not having permission
 
@Zypher: It's just a path.
...it's the script's current path.
 
1:23 AM
ja i know but sometimes the path itsself is interesting
 
@Zypher haha
 
For security reasons, I can't give the full path.
 
Hem.
 
It's exactly the path to the script though.
 
I want to ask you to move it to the site root tho
 
1:24 AM
/home/test/nuclearlaunchcodes/110249873/
 
If the script was in /home/bob/test.php, then it would say /home/bob/test.php.
 
just for S&Gs
 
The site root?
How is that going to make a difference?
 
and I want you to say "ok cole, I resaved it from gimp with a new name and as PNG and it's saying the same thing"
@GeorgeEdison cos I wonder that it's not a perms issue
I heard you say it's not, but I get bit on shite like that all the time
 
@GeorgeEdison ah good enough
 
1:26 AM
@drachenstern: It's opening a remote file... there's no permissions available on a remote file.
It's accessed over the HTTP protocol.
 
@GeorgeEdison so /home/test/bob.php is actually http://server/home/test/bob.php and your app is on http://another/app/path/script.php ?
oh facepalm, I finally grokked the error message
 
and you have allow url fopen enabled?
 
@Zypher: Probably... other images work.
It's just that particular one.
 
@Zypher you're reading what I'm reading
 
:)
 
1:29 AM
4 mins ago, by drachenstern
and I want you to say "ok cole, I resaved it from gimp with a new name and as PNG and it's saying the same thing"
 
Is it a large file? I'm reading people having problems with large files :)
 
Hmmm.
 
Oh wait, you linked the file, that wouldn't be it.
 
It works if I save it and open it locally.
 
just for S&Gs try it with .jpg instead of .png
did you see it with this?
0
Q: imagecreatefrompng error

bhaskaragr29<?php function LoadPNG($imgname) { /* Attempt to open */ $im = @imagecreatefrompng($imgname); /* See if it failed */ if(!$im) { /* Create a blank image */ $im = imagecreatetruecolor(150, 30); $bgc = imagecolorallocate($im, 255, 255, 255); $...

0
A: imagecreatefrompng error

Tatu UlmanenTo use a file from a remote server, use imagecreatefromstring in conjunction with file_get_contents: $im = imagecreatefromstring(file_get_contents($imgname)); Note that a URL can be used as a filename with file_get_contents only if fopen wrappers have been enabled. If this doesn't solve your...

 
1:31 AM
@drachenstern ):
 
@RebeccaChernoff :p
 
@RebeccaChernoff: Did you figure out the problem?
 
@GeorgeEdison try double quotes instead of single?
 
@GeorgeEdison Hm? I just shutting down for a few minutes.
 
What for?
 
1:33 AM
oops, looks like my station is next time to sign off
 
I needed a break from trying to figure it out so I went with rebooting basically.
 
did you try my solution?
@RebeccaChernoff next time try this technique. I've found it to have some success. Throw the computer against the wall.
It does relieve the frustration of it not working (the success part).
 
tempting (;
 
It works now!
@Zypher: Thanks for trying.
 
wait, so single quotes fixed it?
oh, you used that other answer. you should've linked back :p
 
1:40 AM
@Pekka: I fixed the limitation with only being able to edit the image once.
 
Ooooh Earlz comment makes sense.
 
No it doesn't!
 
image != png even tho in English they do.
So you need the contents of the file.
 
Please read my reply to that comment.
 
na na na na na na na na na na Katamari Damacy
 
1:43 AM
@GeorgeEdison yeah, and I read the documentation, but I'm still not sure
you're not passing a stringliteral are you?
you're passing a var?
imagecreatefrompng($literalfilename)
 
Yeah, imagecreatefrompng accepts a URL as long as you've enabled said support. Incidentally, I have no problem opening the file using a URL.
 
incidentally I don't write PHP anymore so I'm kinda :\
 
[redacted]
I suppose I should stop pretending I'm doing something useful and help wife do dishes.
 
@mootinator probably
 
Hm, that allow_url_fopen answer was clearly wrong. I wonder who up voted it. :/
 
1:57 AM
@TimStone people who are good at voodoo programming
Hey @TimPost
9 hours ago, by Sankar Ganesh
@drachenstern and @mootinator: this rooms gives me a another good friend like you guys, his name is @TimPost
 
That is not a unicorn.
Closed as "Not a unicorn"
 

« first day (211 days earlier)      last day (4804 days later) »