It is currently Sun May 05, 2024 3:27 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2  Next
Author Message
Offline
 Post subject: Mousing over diagrams
Post #1 Posted: Sun Apr 25, 2010 12:26 am 
Oza
User avatar

Posts: 2508
Liked others: 1304
Was liked: 1128
When mousing over a diagram, it would be nice if the pop-up would contain a lot less information. As it is, the huge white window full of %20s is a bit bothersome.

_________________
Patience, grasshopper.

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #2 Posted: Sun Apr 25, 2010 12:29 am 
Gosei
User avatar

Posts: 1848
Location: Bellevue, WA
Liked others: 90
Was liked: 837
Rank: AGA 5d
KGS: Capsule 4d
Tygem: 치킨까스 5d
Hmm, strange...I'm not getting this problem on my end (OS X, Chrome 5.0 Beta).

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #3 Posted: Sun Apr 25, 2010 12:34 am 
Lives in gote
User avatar

Posts: 505
Location: Montana
Liked others: 80
Was liked: 62
I'm only seeing it when the page first begins loading. I thought it might be the alternate text for the image, as the issue daal is saying makes it very much sound like that. It's not happening to me, though. Daal, what browser are you using?

Looking at the source code for the page itself, it looks like the javascript behind the processing of the diagram code is what's causing this (does a bunch of replaces on the text sent in and then adds it to the link that gets sent to the actual image/diagram/sgf creator).

_________________
KGS: schultz [?].

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #4 Posted: Sun Apr 25, 2010 12:36 am 
Lives with ko
User avatar

Posts: 206
Location: Finland
Liked others: 29
Was liked: 9
Rank: mid-SDK
GD Posts: 495
KGS: Gresil
Does your browser show image URLs when mousing over? Turn that off, because it looks like a diagram's URL encodes the entire diagram definition. Here's the URL of a random diagram:

Code:
http://www.lifein19x19.com/forum/example4.php?request=SGF&msg=$$Bcm151 Moves 151 to 160 This is a long title, which I am going to keep writing about. You can write paragraphs and paragraphs, and the captions should wrap correctly, and not overlap with the image. Hopefully this works on all diagram sizes. If it does, that would be cool. And nothing else to say here, I guess...
$$ ---------------------------------------
$$ | . . . . . . . . . . . . O . . . . . . |
$$ | . . . . O X . . . . X O X O O . O . . |
$$ | . O O O . X . . . X . . X X O O X . . |
$$ | . . X O . . . X . , X . . X X X O O . |
$$ | . . X O . X X X X O . O . . . X X O . |
$$ | . . . . O O O X O . . . . . X X O . . |
$$ | . . X . . . . O O . . O . . X O . O . |
$$ | . . . . O X . . . . . . X X O O . . . |
$$ | . X X . O 6 . O . O . X . . . O O . . |
$$ | . O X , X . X O . , . . . . X O X X . |
$$ | . O O X . . X O X X . X X X . X . . . |
$$ | . . . X . . . X O . . O X O X X 5 O . |
$$ | . . O X . . . X O . O . O O O . X 4 . |
$$ | . . O X . . . X O . . . O . X O O O . |
$$ | . . O . . . . O X O O . O . . X . . . |
$$ | . . O X X . . . X X X O . O . X O . . |
$$ | . . X O X . . . X . . X O . . X O . . |
$$ | . . O O X 3 . . . . . . X X . X O 0 . |
$$ | . . 2 C O . . . . . . . . . . 9 7 8 . |
$$ ---------------------------------------


_________________
So you've got an eye?
That don't impress me much

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #5 Posted: Sun Apr 25, 2010 12:38 am 
Lives in gote
User avatar

Posts: 505
Location: Montana
Liked others: 80
Was liked: 62
Gresil wrote:
Does your browser show image URLs when mousing over? Turn that off, because it looks like a diagram's URL encodes the entire diagram definition. Here's the URL of a random diagram:

Code:
http://www.lifein19x19.com/forum/example4.php?request=SGF&msg=$$Bcm151 Moves 151 to 160 This is a long title, which I am going to keep writing about. You can write paragraphs and paragraphs, and the captions should wrap correctly, and not overlap with the image. Hopefully this works on all diagram sizes. If it does, that would be cool. And nothing else to say here, I guess...
$$ ---------------------------------------
$$ | . . . . . . . . . . . . O . . . . . . |
$$ | . . . . O X . . . . X O X O O . O . . |
$$ | . O O O . X . . . X . . X X O O X . . |
$$ | . . X O . . . X . , X . . X X X O O . |
$$ | . . X O . X X X X O . O . . . X X O . |
$$ | . . . . O O O X O . . . . . X X O . . |
$$ | . . X . . . . O O . . O . . X O . O . |
$$ | . . . . O X . . . . . . X X O O . . . |
$$ | . X X . O 6 . O . O . X . . . O O . . |
$$ | . O X , X . X O . , . . . . X O X X . |
$$ | . O O X . . X O X X . X X X . X . . . |
$$ | . . . X . . . X O . . O X O X X 5 O . |
$$ | . . O X . . . X O . O . O O O . X 4 . |
$$ | . . O X . . . X O . . . O . X O O O . |
$$ | . . O . . . . O X O O . O . . X . . . |
$$ | . . O X X . . . X X X O . O . X O . . |
$$ | . . X O X . . . X . . X O . . X O . . |
$$ | . . O O X 3 . . . . . . X X . X O 0 . |
$$ | . . 2 C O . . . . . . . . . . 9 7 8 . |
$$ ---------------------------------------


Gresil beat me to it, was editing my post while he posted the above. ;) This is what it is doing. I saw another version of this that actually takes all that text and creates a md5 hash of the text and uses that as the name of the image and sgf file. Would be a way to clean this up quite a bit.

Edit - Found where I saw that, and feel a little silly. Code that is tagged with a familiar author...Adrian Petrescu.

_________________
KGS: schultz [?].

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #6 Posted: Sun Apr 25, 2010 2:04 am 
Oza
User avatar

Posts: 2508
Liked others: 1304
Was liked: 1128
I'm using Opera, and I don't have any idea how to turn off image urls.

BTW, I wanted to post a screenshot of what I'm seeing, and I can't figure out how to do that either :(

Edit: It must be a browser thing, The pop-ups don't show up in Firefox...

_________________
Patience, grasshopper.

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #7 Posted: Sun Apr 25, 2010 3:19 am 
Oza
User avatar

Posts: 2508
Liked others: 1304
Was liked: 1128
I uploaded this to Imgur (thanks sol.ch), but is there a more direct way to post an image? In any case, this is what I'm seeing:

Image

_________________
Patience, grasshopper.

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #8 Posted: Sun Apr 25, 2010 7:06 am 
Gosei
User avatar

Posts: 1449
Liked others: 1562
Was liked: 140
Rank: KGS 6k
GD Posts: 892
daal wrote:
I uploaded this to Imgur (thanks sol.ch), but is there a more direct way to post an image?

You can use the "upload attachment" function below the main post writing area.

_________________
a1h1 [1d]: You just need to curse the gods and defend.
Good Go = Shape.
Associação Portuguesa de Go

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #9 Posted: Sun Apr 25, 2010 9:15 am 
Honinbo

Posts: 9545
Liked others: 1600
Was liked: 1711
KGS: Kirby
Tygem: 커비라고해
Yes, currently information is passed through the URL to generate an image on the fly. The image is not actually saved anywhere. This was because it was the only way I could figure out how to make diagrams work at the time. I think there's probably an alternative method that we can look into, but maybe after I work on the space issue with the diagrams that I think simpkin brought up.

_________________
be immersed

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #10 Posted: Sun Apr 25, 2010 9:25 am 
Gosei
User avatar

Posts: 1435
Location: California
Liked others: 53
Was liked: 171
Rank: Out of practice
GD Posts: 1104
KGS: fwiffo
Does the server side script even cache the generated images?

_________________
KGS 4 kyu - Game Archive - Keyboard Otaku

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #11 Posted: Sun Apr 25, 2010 10:13 am 
Dies with sente
User avatar

Posts: 92
Location: シアトル
Liked others: 24
Was liked: 36
Rank: DGS 9k
GD Posts: 1315
daal wrote:
I'm using Opera, and I don't have any idea how to turn off image urls.

I'm using Opera too, but I'm not seeing it--but if I remember correctly, I've used versions of Opera that will use the image URL as the alt text if no alt text is specified. That means that this problem could be fixed by just adding some short alt text for the image (like "Go Diagram"), I'm guessing.

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #12 Posted: Sun Apr 25, 2010 10:29 am 
Honinbo

Posts: 9545
Liked others: 1600
Was liked: 1711
KGS: Kirby
Tygem: 커비라고해
fwiffo wrote:
Does the server side script even cache the generated images?


Well, if I think about the actual implementation, there's a good chance that it does. Basically, we just use the php imagepng function, which outputs the raw image stream directly. I haven't looked into how php implements this.

The imagepng function can also take a filename as a parameter, in which case it will save the file to the given location.

_________________
be immersed

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #13 Posted: Sun Apr 25, 2010 10:35 am 
Honinbo

Posts: 9545
Liked others: 1600
Was liked: 1711
KGS: Kirby
Tygem: 커비라고해
ross wrote:
daal wrote:
I'm using Opera, and I don't have any idea how to turn off image urls.

I'm using Opera too, but I'm not seeing it--but if I remember correctly, I've used versions of Opera that will use the image URL as the alt text if no alt text is specified. That means that this problem could be fixed by just adding some short alt text for the image (like "Go Diagram"), I'm guessing.


I'm wasn't seeing the behavior before, either, but I added the alt text like you suggested for now.

_________________
be immersed

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #14 Posted: Sun Apr 25, 2010 12:59 pm 
Oza
User avatar

Posts: 2508
Liked others: 1304
Was liked: 1128
Kirby wrote:
ross wrote:
daal wrote:
I'm using Opera, and I don't have any idea how to turn off image urls.

I'm using Opera too, but I'm not seeing it--but if I remember correctly, I've used versions of Opera that will use the image URL as the alt text if no alt text is specified. That means that this problem could be fixed by just adding some short alt text for the image (like "Go Diagram"), I'm guessing.


I'm wasn't seeing the behavior before, either, but I added the alt text like you suggested for now.


Doesn't seem to have done the trick, but thanks for the effort.

_________________
Patience, grasshopper.

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #15 Posted: Sun Apr 25, 2010 1:09 pm 
Honinbo

Posts: 9545
Liked others: 1600
Was liked: 1711
KGS: Kirby
Tygem: 커비라고해
daal wrote:

Doesn't seem to have done the trick, but thanks for the effort.


It looks like your browser shows the URL regardless of the ALT text, then. I'm thinking that we're going to have to save the images on the server to adjust this, rather than generating them dynamically. I don't see how using an MD5 for a dynamically generated filename would allow for us to get around saving the images to disk since MD5 can have collisions. Perhaps we could save the files to the server using an MD5 hash for the filename, and if a duplicate filename existed, we could increment the filecount (eg. <md5-hash>1.gif, <md5-hash>2.gif, etc.). This would be inefficient for the cases where you have two of the same images (because we would generate separate, but identical images).

On the other hand, perhaps the chances of having an MD5 collision are low enough that we could use this filenaming scheme.

_________________
be immersed

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #16 Posted: Sun Apr 25, 2010 6:02 pm 
Lives in gote
User avatar

Posts: 505
Location: Montana
Liked others: 80
Was liked: 62
Kirby wrote:
daal wrote:

Doesn't seem to have done the trick, but thanks for the effort.


It looks like your browser shows the URL regardless of the ALT text, then. I'm thinking that we're going to have to save the images on the server to adjust this, rather than generating them dynamically. I don't see how using an MD5 for a dynamically generated filename would allow for us to get around saving the images to disk since MD5 can have collisions. Perhaps we could save the files to the server using an MD5 hash for the filename, and if a duplicate filename existed, we could increment the filecount (eg. <md5-hash>1.gif, <md5-hash>2.gif, etc.). This would be inefficient for the cases where you have two of the same images (because we would generate separate, but identical images).

On the other hand, perhaps the chances of having an MD5 collision are low enough that we could use this filenaming scheme.

The chances of an MD5 collision are relatively low and I would think we wouldn't really need to worry about this. See: http://www.miketaylor.org.uk/tech/law.html for a simplified description of this. :) And if a collision ever did occur, I don't think we'd have to wait long to hear about it! Plenty of us follow all the Malkovich games as it is, and that's where the vast majority of the diagram images are used. :P

Also, I know Adrian wrote the wordpress plugin creating the diagram codes that did the above. Simply did an md5 hash of what was sent in to create a filename that could be checked so we didn't create duplicate images.

_________________
KGS: schultz [?].

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #17 Posted: Sun Apr 25, 2010 7:14 pm 
Lives with ko
User avatar

Posts: 251
Location: Waterloo, Ontario (Canada)
Liked others: 110
Was liked: 155
Rank: AGA 1k
GD Posts: 1190
KGS: apetresc
IGS: apetresc
OGS: apetresc
Universal go server handle: apetresc
schultz wrote:
Also, I know Adrian wrote the wordpress plugin creating the diagram codes that did the above. Simply did an md5 hash of what was sent in to create a filename that could be checked so we didn't create duplicate images.


I'm flattered that you remembered the details of that code from so long ago :)

I don't think we have to worry about collisions. The chances of a collision in a data set as small as the collection of all diagrams on this board are extremely vanishingly small; it was a significant academic event when someone was able to produce any two strings that had the same MD5 hash, and as far as I know, it's still an open question how to generate any collision for a given hash. The fact that the strings we'd be hashing are, by their nature, almost identical, doesn't matter. md5 is very "discontinuous" in that sense.

The reason I think it may be important to implement this at all is because we may soon run into Internet Explorer's 1000-character-URL limit if we make GET requests with the entire diagram with escape characters in there.

_________________
The road to wisdom? Well, it's plain, and simple to express: Err, and err, and err again; but less, and less, and less!
Image Image Image Image

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #18 Posted: Sun Apr 25, 2010 7:27 pm 
Honinbo

Posts: 9545
Liked others: 1600
Was liked: 1711
KGS: Kirby
Tygem: 커비라고해
schultz wrote:
Kirby wrote:
daal wrote:

Doesn't seem to have done the trick, but thanks for the effort.


It looks like your browser shows the URL regardless of the ALT text, then. I'm thinking that we're going to have to save the images on the server to adjust this, rather than generating them dynamically. I don't see how using an MD5 for a dynamically generated filename would allow for us to get around saving the images to disk since MD5 can have collisions. Perhaps we could save the files to the server using an MD5 hash for the filename, and if a duplicate filename existed, we could increment the filecount (eg. <md5-hash>1.gif, <md5-hash>2.gif, etc.). This would be inefficient for the cases where you have two of the same images (because we would generate separate, but identical images).

On the other hand, perhaps the chances of having an MD5 collision are low enough that we could use this filenaming scheme.

The chances of an MD5 collision are relatively low and I would think we wouldn't really need to worry about this. See: http://www.miketaylor.org.uk/tech/law.html for a simplified description of this. :) And if a collision ever did occur, I don't think we'd have to wait long to hear about it! Plenty of us follow all the Malkovich games as it is, and that's where the vast majority of the diagram images are used. :P

Also, I know Adrian wrote the wordpress plugin creating the diagram codes that did the above. Simply did an md5 hash of what was sent in to create a filename that could be checked so we didn't create duplicate images.


Personally, I don't really buy the argument about using MD5 without any worries at all. There have been enough exploitations of MD5 to create a concern when you're using it for an important application. A popular example is this one: http://www.win.tue.nl/hashclash/rogue-ca/. However, it is true that these people were actively trying to break the system. It's also against my philosophy to develop something with a known problem if it can be avoided (like in this case by not generating filenames at all)...

But you guys are right: there is a problem with the current implementation if the characters in the URL get too long. Also as has been said, if a collision did occur, we could address it at that time. And the probability of a collision is still low, especially if nobody is trying to attack the system. Another point is that it seems that diagrams have already been implemented in this manner without problems, so it might be OK to follow suit...

It's not as straightforward as copying what Adrian has done verbatim because of the limitations in the BBCode, but we should probably go this route. I think that the possibility of MD5 collisions is low enough that it is a much lesser issue to worry about than passing things through the URL like this.

So if we do go that route, what about using php's sha1 function? It's unlikely that we'll have an MD5 collision, and probably even more unlikely that we'll have a sha1 collision. It probably doesn't make a difference, since we'll probably get no collisions at all, but it might make me feel a little happier inside.

_________________
be immersed

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #19 Posted: Sun Apr 25, 2010 10:09 pm 
Oza
User avatar

Posts: 2508
Liked others: 1304
Was liked: 1128
I've gotten rid of it. I asked the question in the Opera forums, and

Tools>Preferences>Advanced>Browsing> disable tooltips.

That did the trick.

_________________
Patience, grasshopper.

Top
 Profile  
 
Offline
 Post subject: Re: Mousing over diagrams
Post #20 Posted: Sun Apr 25, 2010 10:59 pm 
Lives in gote
User avatar

Posts: 505
Location: Montana
Liked others: 80
Was liked: 62
Kirby wrote:
Personally, I don't really buy the argument about using MD5 without any worries at all. There have been enough exploitations of MD5 to create a concern when you're using it for an important application. A popular example is this one: http://www.win.tue.nl/hashclash/rogue-ca/. However, it is true that these people were actively trying to break the system. It's also against my philosophy to develop something with a known problem if it can be avoided (like in this case by not generating filenames at all)...

But you guys are right: there is a problem with the current implementation if the characters in the URL get too long. Also as has been said, if a collision did occur, we could address it at that time. And the probability of a collision is still low, especially if nobody is trying to attack the system. Another point is that it seems that diagrams have already been implemented in this manner without problems, so it might be OK to follow suit...

It's not as straightforward as copying what Adrian has done verbatim because of the limitations in the BBCode, but we should probably go this route. I think that the possibility of MD5 collisions is low enough that it is a much lesser issue to worry about than passing things through the URL like this.

So if we do go that route, what about using php's sha1 function? It's unlikely that we'll have an MD5 collision, and probably even more unlikely that we'll have a sha1 collision. It probably doesn't make a difference, since we'll probably get no collisions at all, but it might make me feel a little happier inside.

I know it's not as straightforward as what Adrian did, unfortunately. I attempted to essentially modify it to work with the BBCode stuff a while ago, but kind of hit my personal limit on javascript and php coding. Always planned on going back and figuring it out, but then my club's forums kind of dried up and died so all my incentive disappeared.

And I see no problem with using php's sha-1 function. It makes sense, and should (theoretically) make collisions even less likely. And if it makes you a little happier, then why not. :)

Adrian Petrescu wrote:
schultz wrote:
Also, I know Adrian wrote the wordpress plugin creating the diagram codes that did the above. Simply did an md5 hash of what was sent in to create a filename that could be checked so we didn't create duplicate images.


I'm flattered that you remembered the details of that code from so long ago :)

Got a little lucky. ;)

Just happened to be looking through that code because of what was brought up in this thread, and realized the name looked very familiar. Never made the connection in the past (also would make sense, though, since you were using a different username). :P

_________________
KGS: schultz [?].

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group