I'm no guru, but I hope that what I find useful will help someone else. Enjoy.
Friday, January 19, 2007
Running into The Man in Blue
While the information was valuable, what impressed me, and inspires me, is the design of his portfolio site. It's clean, usable, and incredibly simple. The interface is poetically enjoyable and intuitive. I would hope no one would copy this site, that would be wrong, but instead find inspiration in his design.
Please have a look: The Man In Blue
Wednesday, December 13, 2006
Feeling Regular and the use of Fibre.
I'm finally getting around to exploring Regular Expressions (RegEx) and coming to realize the value of the beast and the simplicity of the design. I picked the brain of my friend and mentor, Brent Ashley today and he showed me the RegEx Coach and introduced me to some of the logic. I found more in my O'Reilly book, "JavaScript: The Definative Guide" (I have the 3rd edition) tonight and I can say one thing about RegEx.
LEARN IT! Come to understand it and you'll be SO far ahead of the game. It is far from being the ONLY thing you need to know, but it will make you that much better at doing things the right way.
Now, I also asked Brent to do a code an informal code-review on a little VBScript thing I was working on. Frankly, it wasn't going well because I was just a little more rusty that I enjoy being, but I asked for the review to get an idea of where I need to improve. I found out.
It's tough to hear that you're not an ace, but you NEED to hear it. Efficiency is everything in development and my design was weak. There's much more I need to learn, but his manner of showing me where I can improve was skillful and conscientious.
Monday, November 13, 2006
Slow running Linux VM on VMWare ESX?
Create a script that connects to a reliable time server and retrieves the time:
#!/bin/bashNow, add two entries to crontab:
# Sync HWClock to timeserver.mynetwork.local
/bin/date
/sbin/service ntpd stop
/usr/sbin/ntpdate 192.168.0.50
/sbin/hwclock --systohc
/sbin/service ntpd start
/bin/date
1 */1 * * * /var/scripts/scheduled/synctime >> /var/log/synctime.logYou can certainly adjust the times, this is set to get the real time once an "hour" at the 1. Then sync the OS from the VM hardware clock every 2 minutes.
*/2 * * * * /sbin/hwclock --hctosys
Sample output of synctime:
Mon Nov 13 16:01:01 EST 2006
Shutting down ntpd: [ OK ]
13 Nov 16:04:46 ntpdate[19413]: step time server 192.168.0.50 offset 223.590418 sec
ntpd: Synchronizing with time server: [FAILED]
Starting ntpd: [ OK ]
Mon Nov 13 16:04:49 EST 2006
Monday, October 09, 2006
UPDATE Query from Excel to (My)SQL Database
Notably this does not update all values, only values where there is data, if you were to use this routine to post to a database repeatedly I would suggest adjusting the 'If ActiveCell.Value <> "" Then' functionality to set Null values as needed.
Sub UpdateDB()
'
' 09/10/2006 by Cameron Stevens
'
Set myconn = CreateObject("adodb.connection")
Connection = "Driver={MySQL ODBC 3.51 Driver}; Server=MyServer; ~SPLIT LINE~
uid=webuser; pwd=b33rg00gl3s; database=brewery; option=3; port=3306;"
myconn.Open (Connection)
Set result = CreateObject("adodb.recordset")
Sql = "USE brewery;"
Set result = myconn.Execute(Sql)
Range("A1").Select
Selection.Offset(1, 0).Select
strUpdate = "UPDATE tblBottlePrices SET "
While ActiveCell.Value <> ""
strWHERE = " WHERE order_id='" & ActiveCell.Value & "' "
Selection.Offset(0, 4).Select
strSET = " "
If ActiveCell.Value <> "" Then strSET = strSET & "retail_price='" & ActiveCell.Value & "' "
Selection.Offset(0, 1).Select
If ActiveCell.Value <> "" Then strSET = strSET & ", discount_price='" & ActiveCell.Value & "' "
'Selection.Offset(0, 1).Select
strUQuery = strUpdate & strSET & strWHERE
Set result = myconn.Execute(strUQuery)
'MsgBox strUQuery
Selection.End(xlToLeft).Select
Selection.Offset(1, 0).Select
Wend
myconn.Close
Set result = Nothing
Set myconn = Nothing
End Sub
Accessing or Deleting an Inaccessible File/Folder
While this isn't the only way into a file that's inaccessible, it may be the last resort with a file that's got a corrupt filename.
3D Text Screen Saver
- Open Regedit and search for the string HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText
- Create a new String Value called Magic
- Enter a value for it which will be the name of the file you want to use (e.g. c:\winnt\magic.txt)
- Create the file (c:\winnt\magic.txt) using notepad. The format is as follows:
-Test
blah
deedum
hello
n00b
Important - The first word must be preceded by a hyphen as this is used to designate a group of words. It is this word that you must enter into the 3D Text screensaver 'textbox'. When you run the screensaver you will get a random showing af all the words under the hyphened word in the text file. You can add more sections to the text file (again give each section a hyphened keyword to use in the screen saver dialogue box).
Safe Data: Backup and Recovery
Please have a look at this White Paper from Sun Microsystems and call me if you have any questions or concerns.
There is no individual ownership when you are part of a team, it's the sum of the parts that makes you the RESILIENT team you need to be...
-
Though this can be applied in many ways, the WindowsNT/2000 Command Prompt has some powerful differences over the old MS-DOS Batch Language....
-
You can eliminate the use of this middle-man tool by creating Desktop or Quick Launch toolbar shortcuts to the actual program easily, but it...
-
Now this example uses putty.exe right now, but the original purpose was to alert when a jrun.exe was getting too big for it's britches....