There is all sorts of buzz around regarding Microsoft's new operating system: Windows 7. Plenty of people have opinions on what's good or not and how it performs. So far, it performs much better for me than Vista ever did, but that is not the goal of this entry.
A co-worker and friend of mine was most disappointed with the loss of a key feature for him: the Quick Launch toolbar. This useful little feature has been lingering around for a long time giving us easy access to applications. Even though Windows 7 allows you to pin applications to your taskbar, giving access even when not running, he would much rather keep them separated.
That is quite understandable as Windows 7 doesn't really give a good indication of whether or not an application is running.
For anyone else that is missing the Quick Launch bar, it's really easy to make your own (and you can use this to make your own toolbars in past versions of Windows, as well).
All done! Now you have a toolbar on your taskbar that you can move around, change text/icons and drag shortcuts onto. After a little customization, you can't even tell the difference.
A co-worker and friend of mine was most disappointed with the loss of a key feature for him: the Quick Launch toolbar. This useful little feature has been lingering around for a long time giving us easy access to applications. Even though Windows 7 allows you to pin applications to your taskbar, giving access even when not running, he would much rather keep them separated.
That is quite understandable as Windows 7 doesn't really give a good indication of whether or not an application is running.
For anyone else that is missing the Quick Launch bar, it's really easy to make your own (and you can use this to make your own toolbars in past versions of Windows, as well).
- First thing is first: Create a folder in "My Documents" or somewhere else where it won't be in your way.
- (Optional) Drop a shortcut or two in the folder. This can always be done later.
- Right-Click on the taskbar, mouse-over the "Toolbars" entry and click "New Toolbar..."
- Navigate your way to the folder that you created and press enter.
All done! Now you have a toolbar on your taskbar that you can move around, change text/icons and drag shortcuts onto. After a little customization, you can't even tell the difference.
Every now and then I read an article that really hits home.
The Mythical Business Layer
A friend of mine,
hippiehunter, introduced me to this site Worse Than Failure (WTF) today with an article about a Third Class Programmer stuck in a truly terrible environment; surrounded by terribly incompetent programmers and developers while he was painfully aware of just how bad they are.
That inevitably led me to read more articles on the site, bringing me to the Mythical Business Layer.
All I can say is that my job is to program a development environment for a language that is purely for business layer programming.
The Mythical Business Layer
A friend of mine,
That inevitably led me to read more articles on the site, bringing me to the Mythical Business Layer.
All I can say is that my job is to program a development environment for a language that is purely for business layer programming.
- Mood:
amused
I have a new respect for Windows batch files. I am currently writing
the most complicated batch file that I have ever seen. Not because I
necessarily have to, but the temptation to create this abomination is
far too tempting. My options are create a Microsoft Word document
detailing the instructions for upgrading this piece of software (which
I probably will still write anyway) or write this batch file which
walks you through the process interactively.
A batch file that executes the mundane commands in the background and
then instructs you what to do, how to change files, what to look for,
then executes more mundane commands. It is the ultimate lazy
programmer tool that I will inevitably rely upon down the road when I
have no idea how this process works.
Did you know that you can have batch file subroutines and, more or
less, functions?
The basic idea is that you can use goto (I know it's evil in
modern languages.. but it's all you have here) to create a subroutine.
By using call instead of goto you make the label
re-entrant upon goto :EOF (and yes, you need the colon before
EOF). With some experimenting, I discovered that the call will
even take parameters just like your batch file. %1 is the first param.
%2 the second. Etc.
But what about the function? Well, I'm actually showing two different
concepts here. You could simply set a variable without the
setlocal...endlocal block and be done with it. But when you use
setlocal and endlocal you get a little bit of data
encapsulation. You're no longer dealing with straight environment
variables. Now you have LOCAL variables! But wait, what's this &
set RETURN stuff doing? This is where I thought it was a little
clever. Using & you can write multiple commands on a single line.
Even though endlocal escapes you from your local variables, the
entire line has already been interpreted. %RET% is no longer the
variable. It's the contents. This gives you an easy way to set a
return variable. Cool, eh?
It's amazing what you can accomplish with this simple improved
functionality. The first thing I thought would be useful:
This should pretty well demonstrate the uses. I had no idea batch
files could be this powerful. Heck, with the substring capability, you
could have "LIKE" comparisons.
Effectively: IF myvar like "BYE*" THEN
This power makes my life so much easier.
Resources:
SS64
Microsoft
the most complicated batch file that I have ever seen. Not because I
necessarily have to, but the temptation to create this abomination is
far too tempting. My options are create a Microsoft Word document
detailing the instructions for upgrading this piece of software (which
I probably will still write anyway) or write this batch file which
walks you through the process interactively.
A batch file that executes the mundane commands in the background and
then instructs you what to do, how to change files, what to look for,
then executes more mundane commands. It is the ultimate lazy
programmer tool that I will inevitably rely upon down the road when I
have no idea how this process works.
Did you know that you can have batch file subroutines and, more or
less, functions?
@echo off REM ******************************************* REM My Batch Example REM REM Author: Marty Lewis REM Rev: 9/13/07 REM ******************************************* echo Welcome to my batch file. Let's execute a subroutine. call :MYSUB echo The Subroutine is even re-entrant! echo. echo How about a Function? set PARAM=1 set ANOTHERPARAM=2 call :MYFUNCTION %PARAM% %ANOTHERPARAM% echo %RETURN% echo Hey, how about that? goto :EOF :MySub echo YAY! A Subroutine goto :EOF :MyFunction setlocal echo You passed in %1 and %2! set /a RET=%1 + %2 endlocal & set RETURN=%RET% goto :EOF
The basic idea is that you can use goto (I know it's evil in
modern languages.. but it's all you have here) to create a subroutine.
By using call instead of goto you make the label
re-entrant upon goto :EOF (and yes, you need the colon before
EOF). With some experimenting, I discovered that the call will
even take parameters just like your batch file. %1 is the first param.
%2 the second. Etc.
But what about the function? Well, I'm actually showing two different
concepts here. You could simply set a variable without the
setlocal...endlocal block and be done with it. But when you use
setlocal and endlocal you get a little bit of data
encapsulation. You're no longer dealing with straight environment
variables. Now you have LOCAL variables! But wait, what's this &
set RETURN stuff doing? This is where I thought it was a little
clever. Using & you can write multiple commands on a single line.
Even though endlocal escapes you from your local variables, the
entire line has already been interpreted. %RET% is no longer the
variable. It's the contents. This gives you an easy way to set a
return variable. Cool, eh?
It's amazing what you can accomplish with this simple improved
functionality. The first thing I thought would be useful:
@echo off REM ******************************************* REM substring function REM REM Author: Marty Lewis REM Rev: 9/13/07 REM ******************************************* set MYSTRING="1234Hello World!" call :substring %MYSTRING% 4 echo %RETURN% set MYSTRING="1234Hello World!aslkdj" call :substring %MYSTRING% 4 -6 echo %RETURN% set MYSTRING="Hello World!aslkdj" call :substring %MYSTRING% 0 12 echo %RETURN% goto :eof :substring setlocal REM First thing is first. Take the quotes off the first param! set MYSTRING=%1 set MYSTRING=%MYSTRING:~1,-1% set START=%2 set LEN=,%3 REM Was there a second param? If not, set it to 0. if "%START%"=="" set START=0 REM Was there a third param? No? Who needs it?! if "%LEN%"=="," set LEN= call set RET=%%MYSTRING:~%START%%LEN%%% endlocal & set RETURN=%RET% goto :eof
This should pretty well demonstrate the uses. I had no idea batch
files could be this powerful. Heck, with the substring capability, you
could have "LIKE" comparisons.
call :substring %myvar% 0 3 IF %return%=="BYE" (Do something)
Effectively: IF myvar like "BYE*" THEN
This power makes my life so much easier.
Resources:
SS64
Microsoft
- Location:Work
- Mood:
nerdy - Music:Ayumi Hamasaki
Greetings blog.. and bloggers.
If you're here looking for drama, trauma and other things that generally get on people's nerves, I'm afraid you've come to the wrong place. This blog is dedicated to programming; code, concepts and thought-process. I don't claim to be a master of any of the afore-mentioned topics, but I do find my bit of joy in all three. The intent of this blog is to allow me to share and write out my thought processes about problems, brainstorm concepts and log bits and pieces of code for later use. I would also like to use this blog to work and map out ideas for projects I'm working on but remain very careful not to release any sensitive, customer-private or copyrighted information.
Do I expect a huge viewer base to be here looking at my blog? No. I don't think there's enough people interested in the same things to amass readers and contributors. Some input here and there would be nice, but this blog is mostly for my own reference.
Who am I? I'm a software engineer in Rancho Cordova, CA for a software company that produces a business programming language. I also do scripting, coding and database management for the online game: Archverse. I'm also a freelance developer. Under "freelance" work I'm currently involved in a project to launch the first fully functional website for an older, billion dollar per year industry.
I don't know how often this blog will be updated. If you look at the date it was created and the date this first entry was posted, you might get a pretty good idea. Whenever I have something to share, something to work out or something I just want to remember later, you'll probably see an update.
Until then,
~MDL
If you're here looking for drama, trauma and other things that generally get on people's nerves, I'm afraid you've come to the wrong place. This blog is dedicated to programming; code, concepts and thought-process. I don't claim to be a master of any of the afore-mentioned topics, but I do find my bit of joy in all three. The intent of this blog is to allow me to share and write out my thought processes about problems, brainstorm concepts and log bits and pieces of code for later use. I would also like to use this blog to work and map out ideas for projects I'm working on but remain very careful not to release any sensitive, customer-private or copyrighted information.
Do I expect a huge viewer base to be here looking at my blog? No. I don't think there's enough people interested in the same things to amass readers and contributors. Some input here and there would be nice, but this blog is mostly for my own reference.
Who am I? I'm a software engineer in Rancho Cordova, CA for a software company that produces a business programming language. I also do scripting, coding and database management for the online game: Archverse. I'm also a freelance developer. Under "freelance" work I'm currently involved in a project to launch the first fully functional website for an older, billion dollar per year industry.
I don't know how often this blog will be updated. If you look at the date it was created and the date this first entry was posted, you might get a pretty good idea. Whenever I have something to share, something to work out or something I just want to remember later, you'll probably see an update.
Until then,
~MDL
- Location:Work
- Mood:
amused - Music:Ahh, the sound of keyboards
