Skip to main content

Posts

DOS Batch Files - Still Useful

I figured something out today - HOW TO: Separate filename and directory from a path. This is really fun!  The idea I had was to allow me to drag and drop a file onto a batch file and have it spit out the MD5 code for it.  Simple right?... hardly... Here's the code... @echo off REM Check to see if filename is specified if %1.==. goto end set filename=%1 REM Remove double quotes from filename for /f "tokens=1* usebackq delims=?" %%i IN ('%filename%') DO (     set filename=%%~i ) REM Build directory path set dir_path= :loop for /f "tokens=1,2* usebackq delims=\" %%i IN ('%filename%') DO (     set dir_path=%dir_path%%%i\     if not %%k.==. (         set filename=%%j\%%k         goto loop     )     set filename=%%j ) echo DIRPATH:%dir_path% echo FILENAME:%filename% pause :end

Analog Clock Trivia?

Alright... now I've seen some pretty weird stuff on the Internet... but how about this? Picture an analog clock with an hour hand, minute hand, and second hand, ticking every second.  Have you ever wondered... How often is the second hand between the hour and minute hands? At what time is the clock equally divided into three parts (by the positions of the hour, minute, and second hands)? ... ya, I think about this stuff all the time. (sarcastic) Well... in case you were wondering, I've found the answers.  The second hand is between the hour and minute hands about 32% (13832 of 43200) of the time.  There are a total of 43200 possible positions for the hour, minute, and second hands on an analog clock.  That is, 60*60*12. And... a perfect analog clock really never is divided equally into three parts by the hands (unless you count the times when the second hand is in motion to its next position... that is, in the middle of a "tick").  However, it...

Programmer's Drinking Song

99 little bugs in the code, 99 bugs in the code, Fix one bug, compile again, 101 little bugs in the code. 101 little bugs in the code, 101 bugs in the code, Fix one bug, compile again, 103 little bugs in the code... (continue ad infinitum)

Mon ordinateur français

Depuis hier, je lisais français dans mon ordinateur.  C'est vraiment fantastique! Finally, I am forcing myself to become acquainted with new French vocabulary - I changed the language on my computer to French.  My desktop, GMail, OpenOffice, tout les programmes... en français. It should be interesting to learn some new French vocabulary and have a little fun, too.  Since I am running Ubuntu Linux on my laptop and in French, it should be fairly difficult for a typical person to understand what I am doing.   :) I also noticed in my GMail account the following message: Vous utilisez actuellement 42 Mo (1 %) de votre espace de 2897 Mo.  Literally translated, the prompt states: You are actually using 42 Mo (1%) of your space of 2897 Mo.  The only problem is... what is a "Mo"?  So, I looked it up on Wikipedia.... mégaoctet , une unité de capacité de la mémoire des ordinateurs.  As it turns out, an Mo is a megaoctet, which is essentially a...

Integral Symbol

A nerdy thought... The cumulative standard normal probability density function curve looks like an integral symbol… that's kind of interesting because the cumulative probability density function is typically derived by integrating the probability density function. See http://en.wikipedia.org/wiki/Normal_distribution

Max & Erma's Torilla Soup

Nice and spicy. This makes a lot. 15 servings 1¼ hours 15 min prep Ingredients: 2 (10 1/2 ounce) cans cream of mushroom soup 2 (10 1/2 ounce) cans cream of chicken soup 2 (10 1/2 ounce) cans cream of celery soup 2 (10 1/2 ounce) cans cheddar cheese soup 2 (15 ounce) cans chicken broth 1 (15 ounce) can diced tomatoes 1 cup salsa (chunky) 1 (4 1/2 ounce) can diced green chilies 1 onion, chopped 1/4 cup fresh cilantro, chopped 4 garlic cloves, minced 1 teaspoon red chili powder salt, to taste pepper, to taste 4 chicken breasts, cooked and chopped Directions: 1.) Add all to large pot. Bring to a boil and simmer 1 hour. 2.) Can be topped with: flour tortilla chips, cut into strips and fried. (or shredded cheese) 3.) I did not add the cilantro, red chili powder, salt or pepper. (I forgot). 4.) I also used fat free soups where I could. 5.) This was still delicious. Taken from: http://www.recipezaar.com/148807