Shuler Enterprises - Main
Jump to navigation
02 September
Google's chrome browser finally gets it
Firefox is a really great browser and everything, but when I'm going to a website that I know might jack up my browser (such as using Oracle's java web forms), I have to use Internet Explorer.
Why?
It's not because IE is more stable. From my experience, IE is less stable, but when IE crashes - depending on how you use it - only one window is lost.
If you start a new instance of Internet Explorer from the quicklaunch or Start Menu, a shiny new process is created with no ties to any other windows. If it crashes, your other windows remain untouched.
Now, you only get this benefit when you launch a completely new browser. If you open a new window from the file Menu in IE, or open a new tab, or right-click -> open link in new window... you do not get the same protection. These are created as threads. When one thread crashes, any other windows / tabs created from the original IE window will be destroyed as well.
But at least Internet Explorer provides the ability to have separate browser processes. Firefox does not. It was rumored that they would enable this in Firefox 3, but they didn't. In fact, if Firefox, if a browser process hangs and cannot be terminated, you have to restart the whole freaking computer.
The Firefox developers (and fanboys) ignored the many requests for running in separate processes, and even went so far as to tell the requesters off.
Well darn. There is no free software, decent web browser that you can trust to keep your gmail safe when some facebook app crashes.
Enter Google Chrome.
Web comic explaining tech behind Google Chrome
Seems the engineers at Google understand - web browsers crash (novel concept, right...). When one page crashes, it should not crash all of them. So, Google designed a new web browser that, among other things, isolates all browser tasks into separate processes.
I don't necessarily want to have to switch to this new browser, although I am certainly going to give it a try. Eventually, I hope that Mozilla will take the hint, and fix Firefox.
24 May
Found a bug in Vista
I found a bug in windows Vista SP1, but now I have a problem - there is no way to report it. Apparently Microsoft is so audacious as to think their beta testers tried all possible input combinations. It's just a bad philosophy, and the reason why Windows will eventually fail. Anyway, in the hope that maybe placing this online will accomplish something, here is my bug.
I tried to copy my iTunes library to a fat32 formatted external hard drive. I dragged and dropped, and Windows copied for a while and completed, but threw no errors.
When I tried to access it the next day, a good half of the library was missing!
What appears to have happened is that Vista hit an artist with an "international" character (just an accent over an e) and stopped copying. No complaints, no errors, no dialogs (lord knows Microsoft knows how to create dialogs).
So now I have no way of knowing what is getting skipped when I copy files. I think I may try using the command line xcopy, but seriously, this is ridiculous.
EDIT:
Found another bug.
I had a folder called "pictures". I renamed this to "pictures_old" so that I could copy in a folder of the same name without merging them. What does Windows do? It says "a folder named pictures_old already exists, to I want to merge?" WTF??!? I had to copy the pictures to a totally different location.
Windows sucks. I hope Apple decides to let Mac OS X run on any PC, because they would easily destroy Microsoft. That or linux developers get their heads out of their respective butts and embrace standards in user interface design.
06 May
Installing oci8 for PHP 5 on SuSE 10
Filling in where the internets failed me again, here are step-by-step instructions for getting oci8 extensions running in php without having to recompile anything.
Prerequisites
First, you will need to download some stuff and make sure you have certain packages installed:
Oracle Instant Client
I used version 10.2.0.3 cause I know it works.
http://www.oracle.com/technology/tech/oci/instantclient/index.html
Do not download the rpm version, it is much easier to use the zip version. Trust me, I've tried them both.
There are three files you should snag:
* Instant Client Package - Basic (instantclient-basic-linux32-10.2.0.3-20061115.zip)
* Instant Client Package - SQL*Plus (instantclient-sqlplus-linux32-10.2.0.3-20061115.zip)
* Instant Client Package - SDK (instantclient-sdk-linux32-10.2.0.3-20061115.zip)
oci8 PECL package
I used version 1.3.2. If you have problems, try version 1.3.0. (1.3.1 didn't work for me)
http://pecl.php.net/package/oci8
You will be grabbing one file - oci8-1.3.2.tgz
Packages
Obviously, all the necessary components to have php5 with apache2 working. The default install should have everything you need, but just in case, the ones you might be missing are:
* php5-devel
* php5-pdo (maybe - not sure)
* php5-pear
* php5-pear-log
* something with which to unzip things
Also, if you are running suse 10, throw in for good measure:
* orarun
(creates oracle user, and a few other oracle friendly things)
Procedure Part 1 - Install Instant Client
Note: I did all this as root because the oracle user on my box doesn't have interactive login, and I'm too lazy to fix it.
(If the directory "/opt/oracle" doesn't exist, create it and make oracle:oinstall the owner)
ftp the four files into /opt/oracle
On the server:
> cd /opt/oracle
unzip the three Instant Client files. A new directory called instantclient_10_2 should have been created.
If you are root, make sure oracle owns everything:
> chown -R oracle:oinstall instantclient_10_2
Now you need to create the symbolic link for libclntsh.so -> libclntsh.so.10.1
> cd /opt/oracle/instantclient_10_2
> ln -s libclntsh.so.10.1 libclntsh.so
Again, if you are root, make oracle own the symlink
> chown -h oracle:oinstall libclntsh.so
Finally, to make sure that your libraries are found correctly at runtime, edit the file "/etc/ld.so.conf" (as root) and add the path to your instantclient install (/opt/oracle/instantclient_10_2) to the list of paths (add it on a new line before any include statements)
Save the file, then run (as root)
> /sbin/ldconfig
The Instant Client is ready to go!
Procedure Part 2 - Install oci8 PEAR extension
This part should be super easy! Do this as root:
> cd /opt/oracle
> pear5 install oci8-1.3.0.tgz
(That's right, you don't even have to untar the oci8 archive!)
At the prompt, enter:
instantclient,/opt/oracle/instantclient_10_2
There shouldn't be any errors. If there are, it probably relates to missing packages.
Almost done!
The last step is to add the following line to php.ini, and reboot apache.
extension=oci8.so
On SuSE, you will need to edit two files /etc/php5/apache2/php.ini and /etc/php5/cli/php.ini
I recommend adding the line after the comment block for "Dynamic Extensions"
reboot apache by running:
> apache2ctl -k stop
> apache2ctl -k start
Check to see if it worked. If apache doesn't start, check your error logs(/var/log/apache2/error_log). You can always get apache running again by commenting out the line you added to php.ini.
13 April
Time
I found this bit of prose recorded in a bedside notebook of mine.
"
Time is not a tick-tock.
It is like a river -
gentle or rapid it's pace is a whoosh
or a rumble. a burble or a roar,
a hum...
time is taught from birth as nothing more than a tick-tock,
a blink-blink, a tap-tap at a constant rate, impulsive, consistent.
Time passes in silence with mind shattering crash after crash - as the
clockwork interrups nature's flow with omnidirectional shockwaves of
sructure.
Stop
Go
Stop
Go intermittant tasks are measured in the turning of a gear.
Time has been bottled up, refined, forified and sold to humanity
to be used one drop at a time -- the river tamed by the superiority of mankind.
The roar, the rush, the trickle nothing but a Drip, Drip, Drip...
"
08 April
Security phrase and image
A lot of banks have started adding a security image and / or phrase to the login process in order to help prevent phishing.
It works like this. When you set up your account, you chose a picture from a list (usually things like puppies, kittens, bicycles, cars, etc), and you enter a phrase that will be displayed with this picture. This is stored with your account.
Later, when you login you first enter your username. You are presented with the picture and phrase to prove that you are at the bank's true website and not a phishing site that just looks like your bank's site. On this second page, you verify that the image and phrase are correct, then enter your password with confidence.
Sounds like a great idea, right? I thought so to at first, and a lot of people think that it is a very good security measure.
Unfortunately as currently implemented there is a serious flaw in the logic. What is to stop a phishing site from programmatically requesting this image and phrase on your behalf?
A
Captcha would not help either. The phishing site could simply pass the captcha to the user, and the result back to the bank site.
No, this creates a false sense of security. By telling people that these features ensure the site is genuine, they will more readily believe it when a phishing site provides the same "security".
I believe I could make a proof of concept, but with the current state of freedom in the US, I'd probably go to jail for it.
03 April
Programatically modify firefox settings
I refuse to believe that nobody has needed to silently push firefox setting / configuration in an unattended manner, but I was unable to find any directions on how to do so. In particular, I need to automatically, using a script, modify the no-proxy exclusion list.
Here is the way I eventually ended up doing it.
Firefox stores it's configuration in prefs.js in the Profile folder for the user.
That is (on XP anyway) C:\Documents and Settings\[user]\Application Data\Mozilla\Firefox\Profiles\[randomtext].default\prefs.js
Which can be specified as %APPDATA%\Mozilla\Firefox\Profiles\[randomtext].default\prefs.js
Since it contains a random string, how the heck do you find it??
Well, you can parse the profiles.ini file in %APPDATA\Mozilla\Firefox. It looks like this:
[General]
StartWithLastProfile=1
[Profile0]
Name=default
IsRelative=1
Path=Profiles/cutfy0h4.default
Luckily, you can use a FOR loop within a winxp/2k batch file to grab the profile name(s).
FOR /F "delims==/ tokens=3 usebackq" %%i IN ("%APPDATA%\Mozilla\Firefox\profiles.ini") DO (
echo %%i
)
This will echo just the "cutfy0h4.default", and it will only return for lines of the file that contain 3 fields.
(For more information about the FOR loop, see here:
http://www.robvanderwoude.com/ntfor.html.)
Now that we can locate the profile, how the heck do we modify the setting?
Turns out, firefox looks for a file called user.js, and applies those settings AFTER applying prefs.js. Any settings in user.js will be applied to prefs.js.
So you put your settings in user.js, copy it into the profile folder, start and stop firefox, then delete user.js. (If you don't delete user.js, the user will be unable to modify the setting).
Warnings:
1. I am not responsible if this breaks anything. USE AT YOUR OWN RISK!!
2. If there are multiple profiles, it will not work right. In most cases there should only be one.
3. If firefox adds more stuff to profiles.ini, or fixes the direction of the slash in the profile path, this script will break.
4. This was developed with Firefox 2.0.0.13
Here is my final script:
You will need a file called "user.js.install" in the same folder as the batch file containing whatever settings you want to change. (Use prefs.js as your guide) Like this one:
user_pref("network.proxy.no_proxies_on", "localhost, 127.0.0.1, superserver, 192.168.0.1");
Here is the batch script:
taskkill /IM firefox.exe > javainst.log 2>&1
FOR /F "delims==/ tokens=3 usebackq" %%i IN ("%APPDATA%\Mozilla\Firefox\profiles.ini") DO (
echo "%APPDATA%\Mozilla\Firefox\Profiles\%%i\prefs.js" >> proclog.log 2>&1
IF EXIST "%APPDATA%\Mozilla\Firefox\Profiles\%%i\prefs.js" (
copy /Y user.js.install "%APPDATA%\Mozilla\Firefox\Profiles\%%i\user.js" >> proclog.log 2>&1
start firefox.exe
rem wait 7 seconds for firefox to start
ping 1.1.1.1 -n 1 -w 7000
taskkill /IM firefox.exe >> proclog.log 2>&1
del "%APPDATA%\Mozilla\Firefox\Profiles\%%i\user.js" >> proclog.log 2>&1
)
)
27 March
Javascript gripe # 2
The add() function of the html select object functions totally different in IE and Firefox.
It is defined as :
selectObject.add(option,before)
Where option is an option object. Before is the tricky part.
In firefox, the second parameter is supposed to be a reference to the option object you want to place your new object in front of. In IE, it is the index to the object you want to remove.
These are fundamentally different.
In FF, you have to do this:
boxRef.add(newOpt,boxRef.options[i]);
in IE, you do this:
boxRef.add(newOpt,i);
Apparently, Firefox is correct according to the DOM specifications:
void add(in HTMLElement element, in HTMLElement before) raises(DOMException);
void remove(in long index);
But tell me, why does the add method use an object while the remove uses an index???. The standard is messed up, not IE.
Anyway...
Javascript tip
I was having the most unusual problem in a function that used a for loop to find selected items in a html select list. My iterator variable "i" was for some reasen ending up with a value higher than the for loop would allow.
As it turns out, if you declare a variable without using the "var" keyword, that variable has global scope.
Case in point:
function pressRemove() {
fromBox = selBox;
toBox = allBox;
for (i=fromBox.length-1;i>=0;i--) {
if (fromBox.options[i].selected) {
addOpt(toBox,fromBox.options[i].value,fromBox.options[i].text,2);
fromBox.remove(i);
}
}
}
The function addOpt includes it's own for loop, also using a variable named i. That inner for loop was overwriting the value in this for loop!
...
for (var i=fromBox.length-1;i>=0;i--) {
...
By changing all the for loops to declare their variables, the problem was solved. Personally, I think that is a really stupid "feature", but since both IE and Firefox do it, it is expected.
21 March
Mac vs PC?
Apple is right, 100%. OS X is better than windows hands down. Expecially better than Vista.
Mac computers, on the other hand, are far inferior in value, performance, features, expandability and future-proof-ness.
All of the consumer Mac machines are either one-piece or extremely compact. Can you upgrade? No, Apple makes more money if you buy another EXTREMELY overpriced computer if your old one get too slow.
Every one of Apple's computers were designed with form overshadowing function. They are pretty, and stylish, but they lack the things that really matter.
If OS X was available on hardware that I could control, upgrade and modify at will, (e.g. a PC) I would switch immediately. Apple could destroy Windows by doing this, and at this point it would be trivial for them to do so (research the Hackintosh...). They will not, though. Apple is well aware that their lucrative hardware sales are driven by the superior operating system, and that nobody in their right mind would pay $2,000 for a Mac when they could get the same thing for $750 in a PC.
20 March
I want to create something!
Sometimes I get it the mood to make something beautiful.
Like right now. I want to make music. Composing it would be fine, or performing. But guess what? I cannot do either.
I can hear something, and tell that it is beautiful. I am very good at analyzing music... but I just can't create it! Nor can I play it very well. My sister has amazing piano skill she takes for granted. A song I struggled with off and on for a month to get one hand at a time slowly... she could sight read both hand at near full speed.
With practice I can get better at a song, but not at playing. When I mess up, I cannot gracefully recover.
It is similar with visual art. I wish I could express the imagery in my mind on paper (or some other format) but my hands are incapable. I can only draw well when I trace, and even then it looks like the work of a child.
I am left-handed. Doesn't that mean I'm supposed to be more creative?
I often argue that my art is in writing code. I express my creativity through programming. But this is something very few people can appreciate - most would rather not even try.
Occasionally I can be creative with words, but I tend not to write about beautiful things.
It is a stange feeling, the desire to create. It is even more strange to be unable to.
27 February
Revenge of the spam-bot
I guess the spammers saw my totally useless complaint about spam, because somehow they managed to defeat the capcha for comment posting.
I'm guessing there was a nucleus exploit, so I have upgraded to the latest version and will see what happens.
25 February
Confederate flag = State's rights?
The argument I have heard from "open-minded" individuals is that the use of the confederate flag, or an appreciation / loyalty to the Confederacy is not so much about slavery as it is about state's rights.
I hereby proclaim this bullcrap.
http://en.wikipedia.org/wiki/Cornerstone_Speech
The Cornerstone Speech is so named because of one section.
In particular,
"
The new constitution has put at rest, forever, all the agitating questions relating to our peculiar institution — African slavery as it exists amongst us — the proper status of the negro in our form of civilization. This was the immediate cause of the late rupture and present revolution. Jefferson in his forecast, had anticipated this, as the "rock upon which the old Union would split." He was right. What was conjecture with him, is now a realized fact. But whether he fully comprehended the great truth upon which that rock stood and stands, may be doubted.
...
(Jefferson's) ideas, however, were fundamentally wrong. They rested upon the assumption of the equality of races. This was an error. ...
Our new government is founded upon exactly the opposite idea; its foundations are laid, its corner–stone rests, upon the great truth that the negro is not equal to the white man; that slavery — subordination to the superior race — is his natural and normal condition.
"
I'm afraid this leaves no room for discussion. The confederacy wasn't about state's right; it was about slavery. The confederacy was formed because Republicans - the anti-slavery party - had gained power, and the south didn't want to lose their cheap labor.
Rationalizing the use of the confederate flag, and glorifying the confederacy is much like doing the same for the swastika, and the nazi party.
Indeed both movements were based on the belief that one race is somehow superior to another.
The difference:
Germany has the common decency to be ashamed of what it did.
The Southern U.S. still doesn't see what it did wrong.
13 February
Hate Spam?
I know I do. Not the meat product - I'm man enough to admit liking it - the emails.
What I find fascinating about them is that I can usually tell in under 1 second whether an email is spam or not from the subject alone. Even on those rare emails that slip through gmail's filters. Granted, not all people have such a finely tuned spam-o-meter, but it still amazes me that spam continues to be difficult to block. It is so easy for me to tell, yet so hard for a computer. There must be a way to represent the problem is a way that is easier for a computer to comprehend... but I'm not going to waste time pondering that.
Even if we block it, spammers will still send it because it is essentially free, and guaranteed to make it as far as your mail server, and at least into your spam folder where you MIGHT look at it.
The way to significantly reduce spam is to put the filtering software at the other end. Spammers send out large numbers of emails from the same IP address (or small range of IP addresses). When these emails first hit the network, there could be "filtering" software watching for abusive emailing. My support of such a solution depends on how email works - which I am unclear about. If email works like http - where I can set up a server and the ISP does nothing beyond routing packets - then it would be bad to allow ISPs to start snooping. But if sending emails requires the use of an ISP - or somebody's email server, then the ISP is already involved, and such a filter would be a small imposition. Done right, it could cut spam off at the source, before the complaints start rolling in.
Of course, if everybody used gmail, spammers might realize they are wasting their time.
08 February
Open Source
I have long been fond of Open Source solutions, often choosing Open Source over other commercial alternatives for my own use. One reason for this is purely financial: I simply cannot afford a personal copy of photoshop or windows server. So I use The Gimp and Linux.
Now that I am searching for a solution in a corporate environment, needs change. The company will pay for whatever solution I choose.
In particular, I am looking for a future-proof replacement for a bunch of Oracle Forms and Reports. I was initially considering following Oracle's recommended migration path - switching to Oracle Application Server using Oracle's java Application Development Framework.
Until I saw the licensing and support costs...
For what we need, the cost is outrageous. The fact that we have to pay a full licensing cost for the dev and production environments is unreasonable.
So I have started looking into other free or Open Source alternatives. JBoss and Geronimo are the two main Open source app servers, but there is no clear winner, nor any decent comparisons other than pseudo-religious GPL vs Apache licensing debates. I need something that will be easy to manage and diagnose. As a relative Java newbie, ease of use is the most important feature.
If I choose a commercial solution, I will undoubtedly get some kind of support from the manufacturer. After having worked with Oracle's Global support services for two years, I can confidently declare that it is not worth $8,800 / CPU / year (and that is just the database).
But if I choose an open-source solution, I am on my own if something breaks... sort-of.
Oracle's database is robust and feature-packed, but not if you don't have access to Metalink (Oracle's paid support site). Following the publicly available documentation will often run you into bugs. For example, if you try to install Grid Control on a SuSE machine, it will invariably fail if you have any environment variables with spaces, semicolons, percents or other strange characters. This information is only available through Metalink.
Searching the internet will usually not get you any better info about Oracle, because all the support info is hidden in a very expensive support site.
In the case of Open Source software - such as MySQL - all that support information is on the internet. MySQL has a paid support site, but it is generally less useful than newsgroups or forums.
My point is that with commercial software, there isn't much support on the internet because not as many people use it, and those that do only deal with the software vendor for support. Additionally, the software vendor may consider support proprietary information, and not allow it on the internet. The only option is to pay for support.
With Open Source software, most people look to the internet for support, therefore making most solutions available to the public free of charge.
I still have not made up my mind, but I believe that ultimately free software will provide a significant cost savings.
05 January
Words?
When you speak, your words are in my head.
Not a stream of random consonants and vowels.
Not a hierarchy of nouns and verbs.
Not a set of sentences, nor a block of text.
That my ears hear the sound is of small significance;
For me to understand you, I must speak in unison
- for a moment, despite all else, we think alike -
Your words, inside my head.