darkoshi: (Default)
I got my taxes done.

I made a pie with a chocolate filling. It's somewhat gooey, not what I was expecting from the photo on the box. But it's actually good, even though it also tastes oddly like it contains grape syrup mixed in with the chocolate. Based on the ingredients list, I can't imagine why. It contains alkalized cocoa, and the link I posted before indicates that the non-alkalized sort is the kind that's more likely to taste "fruity".

I also made some Waldmeister Goetterspeise which is a German jello with a unique flavor not found in the U.S. My aunt used to make it for me as a kid (with vanilla sauce on top!), and I still like it. The flavor isn't as intense as I remembered though.

I trimmed my hair a bit. It was tickling the back of my neck too much a few days ago. My torso gets itchy sometimes. When I scratch, the skin gets pinkish red, and small itchy bumps, widely scattered, appear. When I stop scratching, it goes away. I haven't figured out a cause. It's been happening for a few years now. (Of course, having written "torso" there, now a few spots on my arms and legs started itching.)

I'm over my cold, but still have a lot of phlegm. That always used to be the one of the worst parts of a cold, the weeks and weeks of snot that would only slowly diminish back to normal levels. So I did neti today for the first time in possibly 5 years. I stopped using neti around then, after reading warnings against doing neti with unsterile tap water. Well, I used tap water today, like I used to. Anything else is too much trouble. But after reading the warnings again, I may forgo the whole thing for another 5 years.

I used LJSec to delete my old protected posts from LJ, as that was something that had been on my to-do list for a while. There may not be much point in having done it, but at least it is off my list now. First, I did another import of all entries & comments from LJ over to DW, as well as a few backups of both my LJ and DW (with LJArchive), to make sure I wouldn't lose anything. The only problem with LJArchive is that imported comments don't show up with the user's LJ name like it does on the Dreamwidth pages, but rather with a generic ext_#### ID. If I have time someday, I'd like to see if I can update the utility to fix that.

A few weeks ago, I cancelled my Netflix subscription, as I was using it so rarely. Qiao has another Netflix account anyway, which I can use when I want to. He also has an Amazon Prime account for watching videos.

Last week at work, I was able to find the cause of another problem, and fix it. Well, I probably fixed more than one problem, but the last one is the one I remember. It gives me such a rush, a good feeling, being able to discover what obscure thing is making the code not work right and how to fix it, when I still don't even understand what half of the rest of the code is meant to do. I was thinking, I've been working on this same general code base, though it has undergone many transfigurations, for the past 22 years. I could spend my whole *life* working on it, and I still wouldn't understand it all, especially because it is constantly being changed. That made me think for a moment that maybe I should leave this job, just so that *whole life* part wouldn't come true. Eh. But whatever, this code or some other code, what difference. Hmm. Coming up on the end of the quarter. Wonder if they will have layoffs.

lovely goose chase

Monday, March 13th, 2017 11:22 pm
darkoshi: (Default)
I finally figured out that the problem I've been debugging for the last 2 days, was only happening due to me having set a breakpoint in a certain place. One module was writing data to a cache. When another module tried to read the data, it wasn't found. The cache is configured with a "timeToLive" value of 180 seconds (which was unbeknownst to me before, but NOW I KNOW). My breakpoint was causing the data to expire before it could be read, which then caused other errors.

It makes perfect sense now. Back when this problem started happening, it didn't make any sense at all. What I was testing had been working fine before, and then it started getting these strange unexpected errors for no discernible reason.

The ironic part is that I had set the breakpoint in order to change some data on a database row, in order to force an error, as I was trying to test the module's error handling. But then, instead of getting the expected error, I started getting unexpected errors, even when I didn't change the row. At least all this did allow me to find and fix some other problems with the error handling.

optimism

Tuesday, February 28th, 2017 06:33 pm
darkoshi: (Default)
Apparently I'm much more of an optimist than I realize.

I can't say how many times I find a problem in the code, fix it, and expect the fix to work fine, and there not to be any more major issues. Or at least, not until after I've verified the first fix.

Not that I don't know that there might still be other problems, but just that early in the day, I seem to have unbounded *optimism*. The kind of feeling that makes me think, I can test this fix, and then go on to test that other fix my co-worker put in, and then successfully retest the scenario the BA was having problems with, and then maybe even have time to debug the other outstanding issue. Like, I seriously expected I might be able to do all of that today!

It's not supposed to happen that in testing the first fix, I get totally unexpected results, and upon research determine that those results are due to stranded data from yesterday's failed tests, plus additional problems in the error handling logic, plus maybe the cursors needing extra conditions in them, plus who knows what else.

Please, not another can of worms. I've got enough cans of worms already!

*Optimism*, because this code was extensively tested in the past and was working pretty good back then. Even though I should be pessimistic due to all the issues we've already found, which have mainly been due to a large code refactoring project that was done last year.

bless

Saturday, July 16th, 2016 08:18 pm
darkoshi: (Default)
I've been updating scripts for setting up a local debug/testing environment for work.

I worked late on it last night. If I don't take extra time in my off hours to get it done, I'll never finish it, even though it is something that will make the rest of my tasks easier to finish, as well as helping out co-workers.

This morning, after getting only 5 hours sleep because I woke up early, I just wanted to tweak a few things and test it out. I should be able to kick it off and let it run while I'm doing other things, then kick off a few more things, etc. It started out well. Except that Eclipse wasn't picking up the right default JRE, which for our environment isn't the same as the JDK version that we need to use for running Eclipse itself.

It was unclear how to configure Eclipse's prefs and configuration files so that it would use my dynamically inserted JDK path. That took what, 5 hours to get working? Because of fascinating details about how all that works, which I'm too tired to describe now but maybe later elsewhere.

Then I had to do more tweaking because some files need single backward slashes in the paths, and some files need double backward slashes... and good heavens it didn't like having a combination of forward and backward slashes either...

Then I had to tweak it more, because in changing all those slashes in the paths, I accidentally also changed slashes that weren't in the paths. So I had to add logic to swap those back. At this point, even though that may seem convoluted, it's the simplest way to do it.

REM ... undo the slash changes that weren't in the paths. Change the double slashes back to single slashes.
powershell -Command "(Get-Content '%EclipseDir%\org.eclipse.jdt.launching.prefs') -replace '<\\\\', '</' | Out-File -encoding ASCII '%EclipseDir%\org.eclipse.jdt.launching.prefs'

I already inserted a "Sheesh!" to the end of the comment, and was debating adding "Please Lord let it work right this time" or perhaps, "Please Lord, bless this code..."
because you know, even if I don't believe in a Lord, it would probably amuse the next person who looks at the file.

.

and also thunderstorm and yapping dog and vegan grilled cheese sandwiches - Follow Your Heart has a new Smoked Gouda cheese which combines/melts well together with the Tofutti American cheese slices.

and also being partly upset with myself for having wasted more than half my weekend on work work. and yet still wanting to continue on it.

Dampfnudelwetter

Friday, October 2nd, 2015 11:18 pm
darkoshi: (Default)
I could have made brownies. I could have watched a movie. I could have washed the dishes.

Instead I wanted to get this task I was working on for work, working. Because it was one of those coding/testing/figuring out/tweaking/trying again/failing/getting a little further/thinking of a new way of trying again/etc tasks that's hard to walk away from.
Now it's 11:30pm and is it working? NO!!!! The zipped files aren't working; the gzipped files aren't working; the compiled stylesheets don't seem to be making any difference; waaaaahhh! phooey!

It keeps raining and raining and raining. It was a fine mist most of today.

At the Little Oktoberfest in Munich, when I was a kid in weather like this, they sold Dampfnudeln (steamed dumplings) with a plum filling and vanilla sauce. I remember them as being so big. But they can't have been that big; I must have been small.

And then I do a websearch and find out that the Little Oktoberfest was in July, not October, so the weather couldn't have been all that cold and damp. Though it was Germany, so yes it could.

My aunt made green Wackelsalat with vanilla sauce.

Now it's 12:30am, and at least one of the 3 things I wanted to verify were working, seems to be working, maybe. Yes! It does! Woo-ha!

Fife tings

Thursday, November 6th, 2014 07:56 pm
darkoshi: (Default)
When you see this, take a minute and share five good things of your day with the world, uncut.

1. I saw that raccoon again*!
2. It was mild, overcast, and breezy at lunchtime**, with that ambiance of being surrounded by familiar/benevolent forces of nature. The colors were pretty too.
3. I got to use De Morgan's laws on an actual*** practical problem!
4. I made it home from work before Qiao for a change, though only by a few minutes.
5. Tomorrow is Friday!


* Again, while leaving work after dusk. It was crossing the street from the other side, nearly to the center. I could see headlights coming up behind me, so I silently begged it to either finish crossing the street in front of me, or to run back to the other side. But it just stood there as if telling me to go on and get out of its way. So I drove on. I hope the other car didn't run it over.

** I purposely walked by the area where the turkeys were yesterday, but then was so lost in thought that I forgot to even look up to see if they were still around.

*** As in the negation of something like ((aaa >= bbb and aaa < ccc) or (ddd <= bbb and ddd > ccc)). But then I found a way to also simplify the original condition.

bah bah batch file

Saturday, March 22nd, 2014 04:45 pm
darkoshi: (Default)
Trying to figure out how to get the logic in a big Windows batch file to work right is about driving me crazy.

I keep running up against walls for the things that ought to be *simple*.
Like echoing a variable value.
Like comparing a variable to another value.

Sheeesh!

Consider the following.
-----------------------

for /f "tokens=1,2*" %%a in (tmp.txt) do (

SET var1=%%a
SET var2=%%b
SET var3=%%c

echo %%c xxx

setlocal enableDelayedExpansion

echo !var3!
echo "!var3!"
)
------------------------

Why does the 1st ECHO statement display an output with the 'xxx' *before* and partially *overlaying* the value that was read from the file, like this???
xxxIYUIYOIYI

The 2nd ECHO statement displays the correct value.

The 3rd ECHO statement displays the first double-quote character, then the correct variable value. But it doesn't display the 2nd double-quote character. WHY NOT??? How can I figure out if there are spaces on the end, if it doesn't let me display anything after it??

Heaven forbid what I really want to do is like this:
IF "!var3:~19!" == " " call :someOtherFunction
or like this:
IF "!var3:~-2!" == " " call :someOtherFunction


How can I figure out why the If statements aren't working, if I can't even get a simple ECHO to work right?

If I replace the double quote chars in the ECHO statement with some other chars, it still has the same problem.

It doesn't help that I was up til 2am working on this batch file last night, and was only able to get 5.5 hours sleep. Due to waking up early and not being able to fall back asleep.
On top of having woken up 1.5 hours early yesterday morning.
darkoshi: (Default)
Yesterday I had to download ActiveMQ for work.

I'm somewhat familiar with verifying the hashes of downloaded files, and have used a few different tools for doing that. The ActiveMQ page indicates that MD5 signatures can be used to verify the downloaded files. That sounded like the hashes that my tool could verify. But nowhere on the page did I see the actual MD5 values that one would compare against.

The ActiveMQ page also indicates that PGP or GPG signatures could be used for verifying the files. Ok... I figured that maybe this was a good reason for me to finally try out PGP and see how it works.

I read about the differences between PGP and GPG, and decided to try GPG. So I went to the GnuPG download page. But found that it only has the source code. Apparently the binary packages are only available on the mirrors. There's no mirror in the U.S. The Canada mirror site wasn't responding. So I looked at a few of the other mirrors.

It seems the latest GnuPG 2.0 version is not available in a Windows version. Why not? I don't know, but after reading a bit, it sounded like the 1.4.* version should suffice for my needs.

Versions 1.4.0 and older are available as zip files, while new versions up to 1.4.9 are exe files. Why no zips for the later versions? I'd prefer not having to install anything... And how would I verify these downloads? Where are the checksums for them?

It was at this point that I decided to forgo verifying the downloaded ActiveMq files.
I had a fuzzy head type head-ache, by the way. Makes it harder to think.

Based on this experience, I'm not surprised that the use of PGP encryption hasn't caught on all that much. It seems you have to be a developer to even figure out how to get it. Heck, the first answer on this page to the question "Where can I find a command-line version of GPG for Windows?" is "You could download it and compile it yourself".

I subsequently found this Gpg4win download page which has a small 4MB version and also lists the SHA1 checksums. Whenever I feel up to it, I may try that one out.

(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.