(no subject)

Saturday, June 29th, 2013 12:50 am
darkoshi: (Default)
This afternoon at work while I was looking at some code, I came across a section which included the exact same case statement twice in a row. The 2nd one was commented with "Extra code added for ..." (where ... was a project from a long time ago).

After looking at it a few moments, the comment started to seem very funny to me.

As a co-worker said one time when his screen flipped sideways for no apparent reason, it was the highlight of my day.

Maybe you just had to be there.

Oh. I also got fairly close up to some turkey vultures today while walking around the pond at lunchtime. One was sort of chasing another to shoo it away, like the geese do sometimes. The vultures have a rather elegant way of running.

I need to go to bed. All I need to do is to click the Post button and shut down the computer. I can do it. I can. I can.

sigh.

nothing important to say, I guess.
darkoshi: (Default)
Based on an articles such as these, I've gone ahead and disabled Java in my browsers:

As it turns out, I had a fairly old version of Java on my machine, due to having turned off updates a couple of years ago. So I updated to the Java version with the latest patches (1.7.0_11) and turned updates back on. As I had disabled Java in the browsers, I decided to have Java to check for updates on a weekly rather than daily basis.

The next day after I booting my computer, my ESET firewall notified me that Java Update Scheduler (jusched.exe) was attempting to access the internet. In order to track how often Java was checking for updates, I only gave it temporary permission and did not create a firewall rule for it yet. I also changed the Java settings to check monthly instead of weekly, to see if that would make a difference.

Yet jusched.exe still attempts to access the internet every day! I'm not even clear why jusched.exe is accessing the internet. From what I understand, it is only a scheduler, and jucheck.exe is the program which should check for updates.

In addition, the Java "Automatic Update Advanced Settings" dialog is quite odd. There isn't really a setting to control how often it checks for updates. There is only a setting to control how often you are *notified* of updates.



When you select "Weekly", it says, "Java will check every Sunday at 12:00AM and notify you within 7 days".

When you select "Monthly", it says "Java will check weekly on Sunday and notify you within 30 days".

Regardless if you select weekly or monthly, it claims that it will check weekly. Furthermore, what is the point of checking for updates but then waiting 7 or 30 days to notify you that updates are available? I would expect a program to notify me of available updates right after it has checked and found them. I want to control how often it checks for them, not how long it waits to tell me about them after it finds them.

I believe that this is why I turned off updates 2 years ago - it annoys me the settings dialog claims that it will check weekly when in fact it checks daily, and that I can't control how often it checks for updates.

This page explains how to set up your own task in Windows Task Scheduler to check for updates, rather than using the Java Update Scheduler. But each time this task runs, you'll get at least 1 popup window which you'll have to close, even when no updates are available.

I feel that one shouldn't have to go through that much trouble... I'm feeling rather disappointed by Java, which is a shame as it is currently my preferred programming language.
darkoshi: (Default)
I made another update to my ToggleDocumentColors add-on today (version 1.4.20120122), for a bug related to the one I worked on yesterday.

According to the add-on's Statistics Dashboard, it currently has over 200 daily users.

..

If you are a user of the add-on, and want to report any bugs, feel free to reply to this post.

bug fixing

Sunday, January 22nd, 2012 04:16 am
darkoshi: (Default)
I fixed a bug in my Firefox add-on today. It was trickier to fix than I had expected. It seems that you get a new instance of the add-on object for each browser window that is opened. In any case, the event observers that you set up in the add-on code get called for each window, so any logic which is in the observe() function may end up getting executed multiple times for a single event.

When I try to understand some code examples, I feel like I don't know much JavaScript at all. Javascript seemed much simpler when I first learned it. Now it seems full of syntax that I'm not familiar with. Some day I hope to understand this kind of stuff.

The only simple way I could think of dealing with my add-on's problem, was to write out a user preference value and use it like a global variable which all instances of the add-on could check, to determine whether or not to execute the code in the observe() function.
darkoshi: (Default)
I've been updating my Firefox/SeaMonkey add-on.

One thing I wanted, was for the add-on to automatically add the "Toggle Colors" button to the navigation toolbar when the add-on is installed, so that the user doesn't have to manually do it.

I was using the code from this page:
https://developer.mozilla.org/en/Code_snippets/Toolbar

It worked on Firefox, but not on SeaMonkey.

The code on that page has a condition to avoid adding the button, if it is already there.
For Firefox, document.getElementById(id) returns null when the button isn't on the toolbar yet. But for SeaMonkey, it isn't null... the button is already in the document, but not on the toolbar. The button is on "BrowserToolbarPallette", which apparently is in the document for SeaMonkey, but not for Firefox.

I updated the code as follows, so that it would work for both Firefox and SeaMonkey.
Instead of using this condition at the start of the function:
    if (!document.getElementById(id)) 

I had to use this:
    var button;
    button = document.getElementById(id);

    if (!button ||
        button.parentNode.id == "BrowserToolbarPalette") // need this for SeaMonkey
    {
        ...
    }

I also had to slightly change the code to remove the "let" keyword, which didn't work in my browser.

coding peeve

Monday, May 30th, 2011 03:22 am
darkoshi: (Default)
My company is working with another company to get one of their large COBOL applications translated into java. The other company doesn't think that including white-space in the code for legibility is important. Apparently the people on my side don't think it's that important either, as we surely could have requested it be done anyway, and how difficult could it be to add spaces and line-breaks?

So a lot of the translated code that we're getting looks like this:
cut due to width )
This peeves me.

A lot of our programmers are new to Java. So when they start working on the code and updating it, they will likely mimic the above formatting, possibly not even realizing that it's possible or preferable to put in whitespace and linebreaks.

(no subject)

Sunday, May 15th, 2011 02:01 pm
darkoshi: (Default)
My place of employment is moving their code-base more towards Java. That's part of the reason why we're being provided with new computers - in order to run the new code, more workstation processing power is needed, as compared to the old code which largely ran on a mainframe. We're being given training too. I skipped the first class on Java, as I'm already pretty familiar with Java. But we've been encouraged to do some online refresher courses too, on our own time. Yesterday I took one. Just now I was going to take another, but discovered that the website (Skillsoft) that hosts the company's online training materials is down for a 2-hour "standard weekly maintenance". Taking a commercial website down for extended maintenance like that every week seems so... archaic.
darkoshi: (Default)
If a variable has a select attribute, then its value will always be one of the four basic XPath data-types (string, number, boolean, node-set).

If a variable has empty content and does not have a select attribute, then the value of the variable is an empty string. Thus
	<xsl:variable name="x"></xsl:variable> 
is equivalent to
	<xsl:variable name="x" select="''" /> 


A variable with non-empty content ALWAYS returns a value of type Result Tree Fragment (RTF).

A RTF is "treated equivalently to a node-set that contains just a single root node."
I don't understand what is meant by "treated equivalently", considering that you can't perform XPath expressions on a RTF.

However, for a variable of type RTF, this kind of test will always evaluate to true:
	<xsl:if test="$RTF"> 

as a single root node is a non-empty nodeset, and non-empty nodesets get converted to a boolean value of True. Therefore when $RTF is converted to a boolean, it evaluates to true.
That is the case even when the variable is defined like this:
	<xsl:variable name="RTF">
		<xsl:if test="something that evaluates to false">
			...
		</xsl:if>
	</xsl:variable>

For this variable, both of the following evaluate to true! (even though an empty string would normally be equivalent to false)
	<xsl:if test="$RTF">
	<xsl:if test="$RTF = ''">



<xsl:value-of> always returns the *string-value* of the XPath expression, boolean or otherwise.
(see http://cygwin.com/ml/xsl-list/2000-10/msg00198.html)
<xsl:variable name="RTF">
	<xsl:value-of select="'abc'" />
</xsl:variable>


In this case, $RTF is *not* a string - it is still a result tree fragment.
But when a RTF is compared to a string, apparently the RTF is converted to a string.
So this condition evaluates to true:
	<xsl:if test="$RTF = 'abc'"> 

and this evaluates to false:
	<xsl:if test="$RTF = 'abcd'"> 


...
Distinguishing between an empty node-set and an empty string...

If your XSL template has an optional parameter which may or may not be passed,
and which may be an empty or non-empty node-set when it is passed,
then it is hard to distinguish between the parameter not having been passed, versus an empty node-set having been passed, as in both cases, comparing the parameter to '' returns true.

One way around this problem is to give the parameter a default non-empty string value which the passed node-set should never contain, and then to check if the parameter's value is other than that default value.
If the parameter is passed and non-empty, then it won't equal the default value.
If the parameter is passed and is empty, then it also won't equal the default value.
<xsl:param name="inputNode" select="'_not_passed_'" />

<xsl:if test="not($inputNode = '_not_passed_')">
	<!-- if true, this means the parameter *was* passed. -->
darkoshi: (Default)
Yay, the Firefox add-on which I took and updated last year has been approved:
ToggleDocumentColors.

I feel a little weird calling it "my" add-on, since I didn't create it from scratch; I took someone else's add-on and made updates to it. But I had emailed the original author and they never replied. I guess that is how open-source works sometimes.
darkoshi: (Default)
I was able to update the ToggleDocumentColors extension to do what I wanted it to do. Now I can set my colors to whatever values I want, without it causing problems when I'm using the page-specified settings.

I emailed the add-on's author in case they want to incorporate my change into a new version of the add-on. But the change might confuse some people, and maybe most people don't set their colors like I did anyway, so it would not be an issue for them in the first place. So, I'm not really sure if it would be a good idea to update the add-on for other people, or not.

Instead of feeling accomplished by my accomplishment, I just feel tired. It took way longer to get it working than I was expecting, which is rather typical. Don't get me wrong - coding the add-ons does seem to be quite simple; it just takes a while to figure things out. (especially when the functions throw exceptions for undocumented reasons! grrr!)

modifying add-ons

Tuesday, April 21st, 2009 06:07 pm
darkoshi: (Default)
I'm feeling an urge to try modifying that ToggleDocumentColors add-on. It might be fun, especially if I am successful at it. I want the add-on to be able to save-off your specified text color, and when switching to the page-defined colors, to set the text color to black (since that is what many websites assume your text color is, even when it isn't), and then when switching back to your user-defined colors, to set the text color back to your selected color.

It's just a matter of having enough time to do it. My work has been rather stressful since the beginning of the year. It seems there is always a deadline looming to get something done, and too much to do, to get it done in that time. It's been scope-creep galore. So right now I'm debating with myself whether to connect to my work computer in order to continue debugging what I left off at this afternoon, or not. I think not. My scheduled work-hours are over, and I've got plenty of other stuff to do, even notwithstanding partaking in the joy of open-source coding.

(no subject)

Tuesday, February 26th, 2008 06:52 pm
darkoshi: (Default)
I was looking at a section of code at work today for a long time, without it making sense to me. I had a headache, too. Then I finally figured out why it was coded like it was and felt better.

But until then, it was an unpleasant feeling. A feeling I get once in a while, especially when comparing myself to other persons who appear to be smarter/faster than me at certain tasks. Maybe I'm not as intelligent as I used to be. Maybe my thinking skills are deteriorating with age. This must be what it feels like (for example) for people who aren't good at math, when they have to take math classes in school. Your brain hurts, and it doesn't make sense, and you feel stupid. Mental skills aren't really something you have much if any control over, just like most other skills. It's just luck that you have them.

It might be somewhat easier figuring out code, if I had trust that it must somehow make sense. But sometimes I finally figure out how certain code is working, and it turns out to be coded badly, and it is just an odd coincidence that it even works. So when I'm looking at code, I am never really sure if there is any sense behind it or not. But even when it doesn't make sense, I know the rules of programming, so I feel like I should be able to figure it out.

It would be nice if the code were commented. Sometimes I write down my own comments on the code in a separate file of my own, in case I need to come back to that code again in the future. No sense in having to figure it all out again later.
darkoshi: (Default)
Version 1.0.0.3 of my KaleidoShine screensaver is now available:
- added a "Vivid colors / less pastels" option (this was a default in the previous version, but is now configurable)
- changed the seed for the random function to be more random by multiplying it by the thread id

I think the colors are looking better now. If anyone is interested in the source code, let me know. It is coded in Microsoft Visual C++ v7.
darkoshi: (Default)
New version uploaded:
http://home.earthlink.net/~shaku8jinn/mir/mo/zip/KaleidoShine.zip

Added a "Brightness" control, a "Restart a new set of shapes every X minutes" control, and a "Random mode" checkbox to the Settings dialog.

To install the screensaver, the KaleidoShine.scr file should be unzipped and copied to the WINDOWS folder. Previously, I mentioned copying it to the WINDOWS/system32 folder, but either folder will work.

(no subject)

Saturday, December 29th, 2007 06:23 pm
darkoshi: (Default)
Often, the hardest part of writing a program is deciding on the user interface; what labels and captions to use in the dialog boxes... what is the best wording; what would make sense to someone who is not familiar like I am with the program's functions?
darkoshi: (Default)
I've finished coding my screensaver, and have named it "KaleidoShine" - this is an improvement, I feel, from the "Newwave" name I had used previously for the regular (non-screensaver) program.

If your computer is running Windows and you'd like to try the screensaver out, it can be downloaded from here:
http://home.earthlink.net/~shaku8jinn/mir/mo/zip/KaleidoShine.zip

Unzip the KaleidoShine.scr file and place it in your Windows\System32 folder. Then it will be available for selection when you right-click on your desktop, open the Properties window, and go to the "Screen Savers" tab. You can configure the speed, shapes, and number of shapes in the Settings window.

The original Windows program is still available for download from here:
http://home.earthlink.net/~shaku8jinn/mir/mo/givez.htm#newwave
It has additional color configuration options that I did not include in the screensaver.

The online java version which has fewer features but which can run in a browser is also available at the above link; but it is somewhat buggy. On my machine for example, I have to switch to another window and back again before it displays right.

(no subject)

Sunday, November 4th, 2007 10:04 pm
darkoshi: (Default)
Oh wow. Between yesterday and now, I was able to convert my newwave eye-candy program into a working screen-saver. There are still some things I need to fix/improve, but it works. On my machine anyway. Still need to try it out on a different machine.

And today, I also finished sewing one pair of pants shorter, and cleaned the refrigerator door seal, and painted part of the trim on the bathroom door. And around 6:30pm, I remembered I hadn't set my clocks back yet, and that it was actually only 5:30pm. And I put out the trash and recyclables by the street for tomorrow. And I took my jackolantern out of the fridge again and put a tealight candle in him so he could glow another night... the candle just went out, so I guess that's another clue it's time for bed. And I took a shower, and my throat is feeling... I'd better take a garlic pill.

(no subject)

Friday, July 20th, 2007 11:18 pm
darkoshi: (Default)
Since people have been posting kitten pix, it made me want to post one of Juniper-kitty:



That was one of the very few I managed to take, where she wasn't a moving blur. She's still getting along well with the puppy-dog, last I heard.

I'm so tired and busy, that by the time I have time to write in my journal, it no longer seems important to do so.

I came home, wanting to mow (whack?) my grass. (I use a weed-wacker.) I was looking forward to cutting the grass, so that when it started raining, I was disappointed. Isn't that weird? It's not that I truly enjoy cutting grass, but I want to make my yard look good. I don't want to contribute to making the neighborhood look bad by having an unkempt-looking yard. Even though personally, I prefer wild-growing grass to short-shorn grass, it now bothers me, not having my grass short.

I got Forestfen a good deal on DSL, to replace the previous account I had at her house. It's only $10 a month, with a 12-month term agreement. It's the "lite" DSL, but I think it is fast enough for her purposes. Wish I could have gotten a deal like that at my new house (I'm paying 3 times as much, and it will go up to 4x as much later on), but it's not available here.

Yesterday and today at work, I wrote myself a webpage with javascript for converting byte-arrays of EBCDIC codes in signed-integer format to ASCII. The Eclipse debugger displays the byte-arrays as signed numbers, and since most EBCDIC tables only include unsigned-integer or hex codes, it was difficult to decipher them. Now I just have to copy & paste & click a button. If I had a lot of free time, I could try coding an Eclipse plugin to do it automatically within the debugger.

Maybe I should download Eclipse to my home computer. I was playing with one of my old audio programs yesterday, and it was having problems. I could re-code it in Java.... but that would take time and effort, which I need to spend on other things for now.

Like mowing grass. And figuring out how to get tile layed down in my washer-dryer area. And getting a washer & dryer. And getting electrical stuff done. And paint. And plumbing. And towel racks. I'm beginning to think I might not get some of this stuff done this year. Maybe I ought to just let things be and relax.

(no subject)

Saturday, June 17th, 2006 11:13 pm
darkoshi: (Default)
I had an idea for a fun computer program. You would record samples of various vowel sounds spoken by your own voice. The point of the program would be to hear yourself speaking in a different or totally new "accent". So to create the new accent, some of the vowel sounds would be switched with each other - you could control this manually, or have the program do it. Then you could then record yourself speaking, and have the program swap the vowel sounds in your recording with the other vowel sounds, and play it back with the new "accent".

May 2025

S M T W T F S
    123
45678910
11121314151617
1819 202122 2324
25262728293031

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Friday, May 23rd, 2025 10:43 am
Powered by Dreamwidth Studios