User:Aichon/Archive 2010: Difference between revisions

From The Urban Dead Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1,192: Line 1,192:
Cheers,
Cheers,
<br>{{User:Dezonus/sig}} 14:55, 2 October 2010 (BST)
<br>{{User:Dezonus/sig}} 14:55, 2 October 2010 (BST)
== Massively Overdue Quizzle Prize ==
{|style="border:solid 2px Gold;width:250px;text-align:center"
|rowspan=2|[[Image:Damn.gif|100px]]
|style="background:Gold;color:white;font-size:small;line-height:1.5;width:100%"|'''Dancing Bear made of Gold!'''
|-
|style="font-size:xx-small;line-height:2"|Yonnua has given Aichon an animated .gif of a dancing bear made of gold for solving a quizzle! (It might take a second to load)
|}
--{{User:Yonnua Koponen/signature‎}} 23:24, 2 October 2010 (BST)
==Improvements to UDMap Script==
I made several improvements to the UDMap script that I'd like to share with the rest of the world. My version of the script is currently available [http://sites.google.com/site/thvortex/udmap.user.js here]. Would you be willing to incorporate these changes back into your own script page? I figured it would be easier for people to download off of your page since they already know where to find it, etc. I don't even have my own User:Thvortex page setup yet on the wiki. Anyway, below is the list of improvements I made.
* Clicking on a space in the suburb map opens the wiki page for that location in a new browser window. Yes, this works for all 100,000 locations :) It's handy for checking the recent status of a building. It did make the script about 300KB larger to include the link information.
* When moving the mouse over the suburb, there is now a GPS coordinate added to the name of the building or street over which the mouse is hovering.
* Clicking on the city map to change the suburb view did not work in Firefox and GreaseMonkey because of the security model that GreaseMonkey uses. Basically <tt>window.switch_map</tt> doesn't work but GreaseMonkey has a workaround in the form of <tt>unsafeWindow.switch_map</tt>. <b>Please verify my script still works in Safari though</b>.
* I make use of DumbWitness a lot, and I noticed that UDMap didn't quite work right in the captured screenshot. Basically, moving the mouse over the suburb map was not displaying the building names anymore. Turns out that DumbWitness was munging the page a little bit and when it saw a <tt>\"</tt> double-quote escape in a Javascript string it would cut off the rest of the code. So in one place I switched to using single quotes and apparently DumbWitness doesn't mind a <tt>\'</tt> escape. Of course, clicking on the city map in the DumbWitness screenshot still won't do anything because that requires a call-back to the user script, and that's no longer accessible in the captured screenshot.
--[[User:Thvortex|Thvortex]] 20:58, 12 October 2010 (BST)
:Holy cow, those changes are awesome and that's a lot of work you did there. Looking through the diff file, I don't see anything unexpected, and after installing it on Safari and fooling around with it a bit, I absolutely love the changes you made (and, yep, the <code>unsafeWindow</code> change works fine).
:How did you get all of the location links anyway? I had considered a feature like that at one point, but didn't feel like making a program to go through and determine the valid ones links from the invalid. I figured it'd just be easier and more generally useful at this point to push through a wiki project which aimed to create pages for each set of coordinates which then redirect to the actual location page, but I hadn't gotten around to that either. >_<
:The only change I might make is to put the coordinates at the front of the line, rather than the end, that way they don't look like they bounce around so much, but otherwise I absolutely love it all.
:Also, I get the distinct impression that you're much more proficient at this stuff than I am (it's just an idle time hobby for me), so any changes you want to suggest to other scripts would be most welcome. {{User:Aichon/Signature}} 21:29, 12 October 2010 (BST)
::What I'd like to know is if this will break any of Aichon's current scripts... >_< --{{User:Axe Hack/Sig}} 21:34, 12 October 2010 (BST)
:::It doesn't. The changes he made don't affect any of my other scripts from what I can see. I'll have an updated copy linked from my userscripts page in a sec. I did move the coords to the front of the name, and I also turned off the display for dark buildings and educational buildings, since I had inadvertently uploaded that version of the script awhile back (I use that myself for my Philosophe Knight, since we care about Centers of Learning, but I didn't mean to put it up for general use), but otherwise left it pretty much as you had it, Thvortex. {{User:Aichon/Signature}} 21:41, 12 October 2010 (BST)
::Aichon, For the non-descript locations I did a search/replace with regular expressions where the replace string can have <tt>\1</tt>, <tt>\2</tt>, etc. to substitute in parenthesized parts of the regex match. To handle the building names, I actually wrote a Python script that processed the Javascript array definitions to figure out which names are duplicate and therefore need to have the suburb added to the link. If you're curious, I can give you that little script as well. For a few like "The Dewberry Building" I had to go back and fix the links by hand. And I meant to say 10,000 locations not 100,000 :)
::And I agree that putting the GPS coordinates in the front is a better idea.
::While I do a lot of programming at work, it's all operating system code in C. I'm still somewhat of a newb when it comes to Javascript and Web development in general.--[[User:Thvortex|Thvortex]] 22:17, 12 October 2010 (BST)
:::Dangit all, why didn't I think of just processing over that array? Such a simple solution. For some reason I had it in my head to run a bot over the wiki in order to resolve the building names that repeat, and it was going to be more effort than it was worth. And sure, I'd be interested in having a copy of that script around for possible later use. {{User:Aichon/Signature}} 00:15, 13 October 2010 (BST)
::::The script is [http://sites.google.com/site/thvortex/makelinks.py here]. Commented lines on top are the search/replace expressions I've been using. The Javascript declarations were close enough to Python's that I could just copy & paste the code over. The extra <tt>o += </tt>... code was to keep the order of the declarations the same on output. I would tweak the script slightly for each building type.--[[User:Thvortex|Thvortex]] 06:43, 13 October 2010 (BST)
:::::Many thanks. And thanks again for the changes to the script. They still look great a day later. ;) {{User:Aichon/Signature}} 22:46, 13 October 2010 (BST)
== Damn my eyes! ==
Where is UD? --{{User:Rosslessness/Sig}} 13:37, 15 October 2010 (BST)
:Found it. --{{User:Rosslessness/Sig}} 13:41, 15 October 2010 (BST)
::I'm so confused... {{User:Aichon/Signature}} 16:18, 15 October 2010 (BST)
:::Your News update from the 6th. --{{User:Rosslessness/Sig}} 17:33, 15 October 2010 (BST)
::::Oh, that wasn't my update. Someone else posted it. I just responded. {{User:Aichon/Signature}} 18:10, 15 October 2010 (BST)

Revision as of 17:25, 29 October 2010

Aichon:Talk Archive 2010
Aichon
ˈīˌkän :Talk Archive 2010