Wednesday Jul 01, 2009

I've been using this for 2 months for day-to-day work, both on IE and Firefox. This works pretty reliably.

iMacros for Firefox - Script your Firefox Web Browser
Whatever you do with Firefox, iMacros can automate it.
iMacros for Firefox is 100% free for private and commercial use.

This is a sample which toggles Sun Java System Identity Manager 7.1's trace flag. iMacros has recording capability so all but 2 lines were automatically generated.

VERSION BUILD=6210326 RECORDER=FX
TAB T=1
URL GOTO=http://idmserver:8080/idm/login.jsp?nextPage=debug%2Fsession.jsp
' These 2 lines were added by hand becase iMacros didn't record these.
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:mainform ATTR=NAME:accountId CONTENT=configurator
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:mainform ATTR=NAME:password CONTENT=configurator
TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:mainform ATTR=VALUE:Login
TAG POS=1 TYPE=INPUT:BUTTON FORM=ACTION:http://idmserver:8080/idm/debug/session.jsp ATTR=NAME:Show_Trace&&VALUE:ShowTrace
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:formname ATTR=NAME:isLogging CONTENT=YES
TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:formname ATTR=NAME:Save&&VALUE:Save

Sunday Dec 21, 2008

I use this Chinese dictionary daily. It was just updated yesterday.

MDBG Chinese-English dictionary - CC-CEDICT download
Chinese to English dictionary with pronunciation in pinyin
Well, actually you can 'grep' this dictionary by English word. So, this is "English to Chinese" dictionary at the same time. I think this applies to most electronic dictionaries.

Pinyin used in this dictionary is different from the 'official' one for good reasons. It's very intuitive. I think those who knows official pinyin can learn this in 5 minutes.

Pinyin - Wikipedia, the free encyclopedia
most commonly used romanization system for Standard Mandarin
The beauty of dictionary being in plain text is you can grep it. So, here's my bash function to look up the dictionary.
$ declare -f ch
ch () 
{ 
    unzip -p ~/cedict_1_0_ts_utf-8_mdbg.zip cedict_ts.u8 | \grep -E --color "$*"
}

I search for words pronounced 'yan' in 3rd tone and 'jing' in any tone. And something related to 'eye'.
$ ch yan3 jing.*eye
擦亮眼睛 擦亮眼睛 [ca1 liang4 yan3 jing1] /remove the scales from one's eyes/sharpen one's vigilance/
眼睛 眼睛 [yan3 jing5] /eye/
眼鏡 眼镜 [yan3 jing4] /spectacles/eyeglasses/CL:副[fu4]/

Friday Nov 28, 2008

To plot GPS data on google maps like in my previous entry, I used this great piece of software.

SportTracks FTPPlugin

The configiration dialog is:



  1. Roller Weblogger, which runs blogs.sun.com, apparently doesn't accept ftp upload. So, don't bother setting ftp dir/username.
  2. Google Maps API key: I think I could have asked our blogs.sun.com administrator to get blogs.sun.com wide key. Instead, I created my personal key. Below is the response from http://code.google.com/apis/maps


Thank you for signing up for a Google Maps API key!

Your key is:

JUNKJUNKlToFQeUTOysX7DNx0_kl4hSxWa86HAc71oxYJfiYpUgzDrZrbBR6oDBJ8KNrUiDx5iR2Pnu123456w

This key is good for all URLs in this directory:

http://blogs.sun.com/LetTheSunShineIn/resource/

Here is an example web page to get you started on your way to mapping glory:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=JUNKJUNKlToFQeUTOysX7DNx0_kl4hSxWa86HAc71oxYJfiYpUgzDrZrbBR6oDBJ8KNrUiDx5iR2Pnu123456w"
      type="text/javascript"></script>
    <script type="text/javascript">

//<![CDATA[
function load() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(37.4419, -122.1419), 13); } }
//]]> </script> </head> <body onload="load()" onunload="GUnload()"> <div id="map" style="width: 500px; height: 300px"></div> </body> </html>

Check out the API documentation for more information.

Friday Nov 21, 2008

I use firefox2 and I often see blogs.sun.com entries where graphics(such as screenshots) are unreadable because it's squeezed according to style sheets. Examples are:

Trying out search , search referral feature in LDAP BC : Sainath Adiraju's Blog Zone
Java CAPS Tip : Application Reconfiguration : The Crooked Stick

Look at graphics at the bottom of these 2. There are some workarounds.

  1. Firebug to tweak stylesheet on the fly.
  2. My greasemonkey script will un-squeeze those images to 100% in most cases. But this script only works for about 15% of all blogs.sun.com blogs.
What's the best style sheet setting to avoid this to begin with? My guess is there's no answer that works universally.

Friday Nov 14, 2008

As I ranted on my previous entry, CSS for some themes on blogs.sun.com are not perfect. So, on many blogs.sun.com pages, you can't tell whether you visited the link or not. So, you need a workaround that works on browser side. I googled and found this.

Nothing's Too Sacred: Change the colour of visited links in Firefox & Mozilla
there are certain sites you visit with Firefox/Mozilla/SeaMonkey where the links won't change colour after you visit them? It can be a real nuisance

I'm on Windows so I added this line to "Documents and Settings/${username}/Application Data/Mozilla/Firefox/Profiles/${uuid}.default/chrome/userContent.css"

a:visited { font-style: italic !important; Color: #551A8B !important}

I want to add one twist to the methods explained in the link above. If you changed the default color for "visited links", you may want to use the value from "about:config" instead of "Purple".


Thursday Nov 13, 2008

Firefox and IE has this feature for a very long time, probably from ver. 0.1, that "Unvisited Links" and "Visited Links" are shown in different colors. They even let you pick colors.

I found several internal sites where visited & unvisited links are shown in same colors. To me, this is plain stupid. So,  I fixed one of them by modifying the default CSS for the CGI program.

Then I realized..., well, this isn't working for my blog pages, either. So, I digged...., using Firebug.

Firebug :: Firefox Add-ons
integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live

1. Right click on a link and choose "Inspect Element". Firebug pane opens.





2. see what css is applied. Here, you can see all kinds of links, whether visited or not, are shown in same colors.


3. I think the best we can do is keep it simple and let the browser do colorings. So, click on 'Stop' traffic sign and comment the
    "color" line out. Confirm the link color changes from blue to purple which is browser's default.



4. I went into my blogs.sun.com setting page and removed "color: #458ABA;" line.



Friday Sep 12, 2008

How do you guys save or print out the great entries on blogs.sun.com without any frills? Like you do when viewing wiki, other sun.com pages, newspaper articles?

I have been using 2 methods.

  1. copy&paste if it's text only entry.
  2. Use firebug and "Copy innerHTML" to save the core part to local file. Open the file in browser again.
I thought GreaseMonkey can help here. So, I searched scripts archive and found this.

AppleGrew's Mind: My first GreaseMonkey script: Blogspot Post PrintView

Great! I copied and changed 3 or 4 lines to make it work for a popular blog theme on blogs.sun.com. This theme is used by these 2 colleagues, for example.

  1. Java CAPS Tip : Building a JMS Browser Monitoring / Management Plug-in Module for NetBeans 6.1 : The Crooked Stick
  2. Bill Vass' Weblog

So, how does the script work? Here are 2 screenshots for the former one.

1. 'Print' button appears next to timestamp.



2. Click on 'Print' link. All decorations are removed!




I think our CEO Jonathan uses a different theme. But my GreaseMonkey script sort of works.

Jonathan Schwartz's Blog: Fanning the Winds of Change in Storage

1. 'Print' link appears next to timestamp.



2. Click on 'Print' link. Texts are center aligned so they are hard to read.



My script can be copied from here.

Wednesday Mar 12, 2008

申告期限が来週月曜に迫ってきました。騒がれはじめてきた新銀行東京との関係ご存知ですか?
それは
  銀行カードと公的認証サービス(接触型ICカード)のカードリーダーは共通
ということです。(すみません。大したことなくて)

例えば以下のようなところで話題になりました。
スラッシュドット・ジャパン | 「セーフティパス」がサービス終了へ

e-Taxで確定申告 │ さらに便利で使いやすく!
に書いてあるように今年と来年は電子申告により最高5,000円の所得税の税額控除を受けられます。
私はこのために申告用にリーダーを買いました。もし、新銀行東京インターネットバンキングでセーフティパス方式を選択していたら買う必要はありませんでした。

ちなみに納付に使えるいつでも、どこでも、ペイジー。には新銀行東京は対応していません。

さて電子申告についてはJavaなのにWindows限定とか、ActiveXでないのにFirefoxでは駄目とか面白い仕様がいくつかあるので機会があったら書きたいと思っています。

This blog copyright 2009 by Katsumi Inoue