Recently in At Work Category

2008 Sep 30
some times seminars can also be interesting at least for me most of the times i find them boring and a waste of my time. A recent seminar i joined made me think twice with some of the seminars i missed before. the last task we had from the seminar which i enjoyed the most is the testing the leadership skill you have learned from the seminar. The task is to solve the puzzle called traffic jam.

Setup
2 groups of five with each team having their own uniform color. All 10 individual setting in from of each other, each team facing the other team. an extra chair placed at the center of the last two persons. See illustrations below, ill name the first team as alphabet and the other as numbers. everybody is facing the empty chair.

  1 2 3 4 5
@
  A B C D E

Objective
The objective of the game is to switch places with the team by following some rules.

Instructions
  • a person can move in a space (blank chair) beside him
  • a person can skip a person or move around a person
  • a person can only move forward
  • only one person can move at a time

Well after an hour, i was able to crack this game. it was very frustrating not to be able to get the solution in time because the speaker place a timer on the board and it was just 45 minutes. anyway here's my solution:

The Solution to the Traffic Jam game
Team Alphabet moves first, Person A move to the blank chair.

A12ABC1234ABCDE12345ABCDE2345CDE45E


2008 Apr 29
Basecamp is using textile to format and display its messages. The following is a list of codes used to modify the look of your messages inside basecamp.

You can format the messages in basecamp using the following codes below:

Paragraph Codes
The following codes are commonly used in composing paragraphs in basecamp, adding in the following codes helps you convey the message you wish to tell and makes it easier to read and understand the context.

Header: hn. <text>
h1. Header 1 is equivalent to <h1>Header 1</h1>

Blockquote: bq. <text>
bq. A block quotation. is equivalent to <blockquote>bq. A block quotation.</blockquote>

Footnote: fn1. <text>
fn1. Footnote text. is equivalent to <p id="fn1"><sup>1</sup> Footnote text.</p>

Example:
This text has a footnote below[1].
fn1. This is the footnote of the text above.

Text Alignments
p<. align left
p>. align right
p=. centered
p<>. justified
p(., p((. left indent 1em, 2em, etc.
p). right indent 1em

Example:
p=. This text is centered is equivalent to <center>This text is centered</center>


Phrase Codes
These codes below allows us to importance to a portion of our text in basecamp and adding some emphasis to it. We can use either the emphasis or the boldface HTML code when adding some importance to the message we have written. Other HTML code can also be used.

Emphasis
Prepend and append underscores to the text you wish to be emphasized.
_text on emphasis_ is equivalent to <em>text on emphasis</em>

To make italics text we use double underscores
__text on italics__ is equivalent to <i>text on italics</i>

Strong emphasis
Use asterisk to make text appear with strong emphasis
*text on strong emphasis* is equivalent to <strong>text on strong emphasis</strong>

And, use double asterisk to make them apear as boldface
**text on boldface** is equivalent to <b>text on boldface</b>

Citations
Enclose citation text with double question marks
??cited text?? is equivalent to <cite>cited text</cite>

Mark as deleted
Also called overstrike. Useful in editing copy with multiple versions.
-text to be deleted- is equivalent to <del>text to be deleted</del>

Mark as inserted
Used mutually with the overstrike tag. Marks the text as newly inserted text.
+inserted text+ is equivalent to <ins>inserted text</ins>

Span
Allows us to customize out text based on color or formating using the CSS standard code. Use the percent symbol to start a span tag.
%{color:red}text in red color% is equivalent to <span style="color:red;">text in red color</span>


Lists
Precede each line with pound sign to make an ordered list like this:

# line 1
# line 2
# line 3

Which becomes,

<ol>
<li>1 line 1</li>
<li>2 line 2</li>
<li>3 line 3</li>
</ol>

To make a bulleted list, use the asterisk instead like this:

* line 1
* line 2
* line 3

Which becomes,

<ul>
<li>1 line 1</li>
<li>2 line 2</li>
<li>3 line 3</li>
</ul>


To add a nested list or increase the list indention we add another asterisk link this:

* line 1
** line 1.1
** line 1.2
* line 2
* line 3


Which becomes

<ul>
<li>line 1</li>
<ul>
<li>line 1.1</li>
<li>line 1.2</li>
</ul>
<li>line 2</li>
<li>line 3</li>
</ul>


Creating Tables
Use the pipe symbol to make tables

|This|is|a|table|
|with|two|rows|inside|


is equivalent to

<table>
<tr>
<td>This</td><td>is</td><td>a</td><td>table</td>
</tr>
<tr>
<td>with</td><td>two</td><td>rows</td><td>inside</td>
</tr>


Inserting Links
Inserting hyperlinks in basecamp is similar to inserting text in wikipedia, just enclose the anchor text with double quotation marks followed by a colon and the url
"Tildemark blogs":http://www.tildemark.com is equivalent to <a href="http://www.tildemark.com>Tildemark blogs</a>

Inserting Images
Use the exclamation symbol to insert an image into basecamp.

!http://www.basecamphq.com/images/basecamplogo-small.png! is equivalent to <img src="http://www.basecamphq.com/images/basecamplogo-small.png" alt="basecamp logo"/>


Image Links

To make the image clickable we add the link code adding in a colon and the corresponding link.
!http://www.basecamphq.com/images/basecamplogo-small.png!:"http://www.basecamphq.com" is equivalent to <a href="http://www.basecamphq.com"><img src="http://www.basecamphq.com/images/basecamplogo-small.png" /></a>

Superscripts
Use caret symbol to make superscripts
e = m * c ^2^ is equivalent to e = m * c <sup>2</sup>

Subscripts
Use the tildemark to make subscripts
log ~b~ (x) = y is equivalent to log <sub>b</sub> (x) = y

Source Codes
To add source code listing we use the @ symbol
@print "hello world";@ is equivalent to <code>print "hello world";</code>

More examples with textile code for basecamp here.

2008 Mar 15

Obviously, its seldom to see people using batch files nowadays. Most people dont even know what it is. On, contrary i still use them on my daily tasks to automate things, its like having Perl on a Linux box. but things are changing now, i guess using batch files isn't the trend anymore these days. The same with Linux OS, Windows also comes in handy with some tools used to automate tasks and using batchfiles is one of them. Since we're using Windows XP now, its also wise to do things in GUI mode in contrary with the old style DOS mode edit.

While downloading some pictures from a camera, I found them hard to manually rename its filename to a more meaningful title and not some random "DSC001323.JPG". After rename 10 or 15 files, i got bored, thinking this would take me forerver to rename them all for they are more than a thousand in total. If you can still recall that neat application called Irfan View, my life would have been alot easier.

Well anyway, lets change things we normally do and instead of using batch files we use vb script. A zipped version of the mass renaming script is also available for download.

''''''''''''''''''''''''''''''''''''''''''
' Mass Rename Script by tildemark
' http://www.tildemark.com
'
'
' Usage:
'   Place this script on a list of files you wish to rename.
'   Run this script by double clicking on the filename.
'
'
' For bugs send it to tildemark@gmail.com
'
''''''''''''''''''''''''''''''''''''''''''

Dim fso, Path, Folder, Counter, Prefix, File, Extension

set fso = CreateObject("Scripting.FileSystemObject")

Path = InputBox("Input the location of the files to be renamed. ('.' means current folder)", "Mass Rename Script", ".")

Prefix = InputBox("Input the filename prefix", "Mass Rename Script")
If Prefix = "\" Then WScript.Quit

Extension = InputBox("Input the file extension to be renamed", "Mass Rename Script")
If Extension = "\" Then WScript.Quit

Counter = InputBox("Input the starting offset", "Mass Rename Script")

Set Folder = fso.GetFolder(Path)

For Each File In folder.Files

  If Not ((File.Attributes And 8) = 8) Then
    If fso.GetExtensionName(File.Path) = Extension Then 
      File.Name = Prefix & CStr(Counter) & "." & Extension
    End If
  End If
  Counter = Counter + 1
Next

MsgBox("Done")

2008 Jan 23

I'm not sure if a lot of people who dabble on their keyboard almost 8 hours everyday know this but if they don't watch out they may eventually experience carpal tunnel syndrome (CTS). This is a condition where a nerve is compressed around the wrist usually the part where its almost always pressed like the underneath of the hand holding the mouse.

I'm usually in front of the computer almost 12 hours everyday, except on weekends (I do have a life you know). In order to combat Carpal Tunnel Syndrome, I use an ergonomic keyboard and mouse. You can find some good stuff about office ergonomics at ergoware.com. To combat CTS, I use my left hand to operate the mouse even though I'm right handed. I only use my right hand when I play games (he he he).

The best thing to do though to prevent CTS is to always take a break in between work specially if you just sit in front of the computer the whole day. Remember, all work and no play makes Jack a dull boy.

2008 Jan 11

The merge and Center button in Excel only centers the top left text and deletes the rest. What if the two columns of First names and last names are to be merged into the format: Last name, First name it would then become a problem.

Using the Ampersand ( & ) operator, it allows us to merge cells in an excel worksheet. you can create a formula to merge cells in excel or just insert it right away on the cell formula bar.

Problem:
And you wish to merge the two cells at A1 and A2 to the cell at A3

Given:
Cell A1 has the text "Lastname"
Cell A2 has the text "Firstname"

Solution:
* First position your active cell on A3.
* On the formula bar input the following: =A1&A2 [ENTER]

It should display LastnameFirstname on cell A3

To add a space and a comma, use the following:
=A1&", "&A2
it will output: Lastname, Firstname

alternatively you can also use the concatenate function, like this:
=CONCATENATE(A1,", ",A2)

2008 Jan 8
By default autorun is enabled on windows xp, this puts your pc into potential malaware risk or even virus infection. Mostly, viruses and worms are spread using the windows autorun feature. We should disable autorun on your computers to prevent it from being infected with any virus, malaware or worms. Here are several ways to disable the autorun function:

Disable Autorun with TweakUI.
The most convenient way is to install TweakUI a PowerToy from Microsoft we can download for free . Download TwealUI and install it. This PowerToy gives you access to system settings that are not exposed in the Windows XP default user interface, including mouse settings, Explorer settings, taskbar settings, and more.

1. Run TweakUI
2. Navigate to My Computer -> AutoPlay -> Drives
3. Uncheck the drive you wish to disable the AutoPlay function.
4. Navigate to My Computer -> AutoPlay -> Types
5. Uncheck Enable Autoplay for CD and DVD drives
6. Uncheck Enable Autoplay for removable drives
7. Click Apply button
8. Click OK button

Disable Autorun with Group Policy Editor
If you are a geek type and want to do it the hard way we could use the GPEDIT.MSC tool to disable Autorun. GPEDIT.MSC does not work on Windows Home Edition, only on Windows XP.
1. Navigate to Start -> Run
2. type GPEDIT.MSC
3. Click OK
4. Navigate to Local Computer Policy -> Computer Configuration -> Administrative Template -> System
5. Double click Turn Off Autoplay
6. Select Enabled from the radio buttons
7. On the Turn off autoplay dropdown box select All drives
8. Click OK button, Close Group Policy Editor

Disable Autorun with the Registry Editor
If you are using Windows Home, you can disable autorun using the registry editor.

1. Navigate to Start -> Run
2. type REGEDIT, click OK button
3. Navigate to HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Services -> CDROM
4. Double Click on Autorun
5. Change from 1 to 0. The default value 1 means autorun is enabled on CDROM
6. Navigate to HKEY_CURRENT_USER -> Software -> Microsoft -> Windows -> CurrentVersion -> Policies -> Explorer
7. Double click on NoDriveTypeAutoRun
8. Change the current valut to B5 in Hex. This disables CDROMs and USB drives

To disable other devices refer to the table below.
Value Meaning
0x1 Disables Autoplay on drives of unknown type.
0x4 Disables Autoplay on removable drives.
0x8 Disables Autoplay on fixed drives.
0x10 Disables Autoplay on network drives.
0x20 Disables Autoplay on CD-ROM drives.
0x40 Disables Autoplay on RAM disks.
0x80 Disables Autoplay on drives of unknown type.
0xFF Disables Autoplay on all types of drives.

By default, Autoplay is disabled on removable drives, such as the floppy disk drive (but not the CD-ROM drive), and on network drives. The default value 0x95 (149) is the sum of 0x1, 0x80 (unknown types), 0x4 (floppy drives), and 0x10 (network drives). 0xB5 is the sum of 0x1, 0x4, 0x10, 0x20 and 0x80. B5 in Hex or 181 in Decimal.
2007 Dec 17
Usually when doing some 'copy' 'and paste' stuff would end with so many duplicates. It would be very tedious in manually editing them. when collecting sites for link exchanges, we will get lots of duplicate domains especially from google and wikipedia which most of the links.

Normally, we use advanced filter but something is wrong with it, its not filtering the character 'a'. I got two of them and the result still has two of them. Here is how i did it with advanced filter.

1. Click On an empty cell column
2. On the menu choose: Data -> Filter -> Advanced Filter
3. In the dialog box, type in the range of cells to filter at the List Range text box. e.g. type in $A$2:$A$1319 for cell A2 to cell A1319
4. On the Copy to text box type in the cell location of the output (filtered list)
5. Click on the Unique records only check box
6. Press OK

With the tool duplicate remover, we could remove repeating domain names in an instant. But if we are just simply collecting words and similar list that we become another story. Usually we collect word or phrases and paste them in an excel worksheet. but the question is how to filter the list and remove the duplicates? well i run unto the same problems and luckily i found a macro on the internet, so it saved me the time in creating one.

1. Open Excel.
2. Alt + F11 to open the Visual Basic Editor (VBE).
3. Insert-Module.
4. Paste the code below.
5. Close the VBE (Alt + Q or the X in the top-right corner).

Excel Macro

Option Explicit Sub DeleteDups() Dim x As Long Dim LastRow As Long LastRow = Range("A65536").End(xlUp).Row For x = LastRow To 1 Step -1 If Application.WorksheetFunction.CountIf(Range("A1:A" & x), Range("A" & x).Text) > 1 Then Range("A" & x).EntireRow.Delete End If Next x End Sub

Test the Code
1. In Column A add any data.
2. Tools-Macro-Macros
3. Select DeleteDups and press Run.

source: remove duplicates
2007 Feb 2

Here are common linux command examplers for managing user accounts.

Displaying user details
Syntax: id {username}
shell> id tildemark

Create a new user with username tildemark
Syntax: useradd {username}
shell> useradd tildemark

Create a new user with username tildemark under group admin
Syntax: useradd -g {group} {username}
shell> useradd -g admin tildemark

Creating a new user with username tildemark and assign a home folder
Syntax: useradd -d {location} {user}
shell> useradd -d /home/tildemark tildemark

Creating a new user tildemark and assigning a password pass
Syntax: useradd -p {password} {username}
shell> useradd -p pass tildemark

assigning password to user tildemark
Syntax: passwd {username}
shell> passwd tildemark

Creating a new group
Syntax: groupadd {group}
shell> groupadd developers

Creating a new user and assigning it multiple groups admin, developers
Syntax: useradd -G {group1}, {group2} {,...}
shell> useradd -G admin, developers

Assigning user tildemark to group admin, developers
Syntax: usermod -G admin, developers tildemark

Delete an existing user
Syntax: userdel {username}
shell> userdel tildemark

2007 Jan 31

Most of the time i do work with the linux shell, so most of the time i will be using ls to display files the current folder. However, in windows the command to display files is dir. i would always interpret cmd as a linux shell.

Back with the good old days, we could use doskey to assign shortcuts to DOS commands. So, we could just assign ls to its windows equivalent like this:

C:\> doskey ls=dir

Now, whenever we type ls, dir command is executed. We could also do that in Windows XP Command prompt, but the problem is after you have closed the window the doskey is also removed as well and we have to type it again every time we would run cmd.

There is actually a work around with that, we could modify our cmd shortcut in the start menu to add the doskey instructions there so that everytime the cmd is loaded the extra line is also executed as well.

cmd-shortcut.jpg cmd-properties.jpg

i have modified my shortcut target from


%SystemRoot%\system32\cmd.exe

to

%SystemRoot%\system32\cmd.exe /k doskey ls=dir

the /k makes the window stay after the doskey is executed. For more additional options about cmd you can issue the command

C:\> cmd /?

here are a few common options:
/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
/S Modifies the treatment of string after /C or /K
/Q Turns echo off
/D Disable execution of AutoRun commands from registry


Alternatively, you could also change the value of your registry at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor

to

Value name: AutoRun
Value data: doskey ls=dir

Actually, its better to use the registry option because after adding the code to the shortcut properties; the code completion for the command prompt no longer works.

2007 Jan 30

Making a tarball and adding a mysqldump to it then naming it as example.tar:


shell> tar cvf example.tar dump.sql


Making a tarball and adding all files in the current directory then naming it as example.tar:


shell> tar cvf example.tar *


Compressing the tarball by zipping it (.gz):


shell> gzip example.tar


Restoring a tarball gzip file example.tar.gz


shell> gunzip example.tar.gz
shell> tar xvf example.tar

2006 Oct 14

Creating a hyperlink in excel is simple. Notice that after typing any uri in excel the text automatically turned into a hyperlink. You can add any link as you like in excel as long as there is a prepended http:// phrase before the text entered.

Now, what if we are going to add a dynamic URL? It would be best explained by example, so here it goes.

For example: We are asked to check multiple sites for the following internet standards; W3C HTML Validator and WDG HTML Validator.

We have a reference cell A1 have the text http://tildemark.com. We all know the URL for the respective standards as:

W3C - http://validator.w3.org/check?uri=http://www.tildemark.com
WDG - http://www.htmlhelp.com/cgi-bin/validate.cgi?url=http://www.tildemark.com&warnings=yes

Now, all we need to create an entry such that each time we change the domain names the entry on each validator also changes.

Do the following on Excel:

Cell A1 - http://www.tildemark.com

  A B
1http://www.tildemark.com       
2  
3  
4  
5  
...  
9=HYPERLINK
("http://validator.w3.org/check?uri="&A1,"Check W3C HTML Validator")
 
10

=HYPERLINK
("http://www.htmlhelp.com/cgi-bin/validate.cgi?url="&A9&"&warnings=yes",
"Page passed WDG validator")

 

More info at Office Website.

2006 Oct 11

Removing a bunch of hyperlinks can be tedious. imagine the time you have to right-click on each of those links and selecting 'remove hyperlink' on the context menu. Of course it would just take two clicks, but what if you are to remove a hundred of them or perhaps 1000 of them? I'm sure that would scrape out the paint of your right-mouse button. :)

I have some simple techniques you can use in order to remove multiple hyperlinks on a page:

Removing just one hyperlink
1. Right-Click on the cell and select Remove Hyperlink on the context menu.

Removing the cell format
1. Select the cells having hyperlinks. You can use CTRL+LEFT CLICK to randomly select a cell.
2. On the menu click on Edit. Hover your mouse to the option Clear and select Fomats. Please note that the cell is still clickable to remove the hyperlink completely you have to select Clear->All.

Remove hyperlink on selected cells the better way
1. Type in any text or number in a blank cell
2. Right-click and select Copy on the context menu.
3. While pressing CTRL, select each hyperlink you wish to be removed
4. On the Edit menu, select Paste Special.
5. Under Operation, click Multiply and then click OK.

Removing using a macro
Assuming you know excel programming you could create a macro to automatically remove the hyperlinks.
1. Start Visual Basic Editor. Alternatively you can press ALT-F11 to start the editor.
2. Double click the workbook you are using on the Project Explorer.
3. Type the following text:


Sub RemoveHyperlinks()
ActiveSheet.Hyperlinks.Delete
End Sub

4. Save your work.
5. Run your macro by pressing ALT-F8 or using the menu by Tools->Macro->Macros
6. Select the macro you have made, it should have the name 'RemoveHyperlinks'.


About this Archive

This page is a archive of recent entries in the At Work category.

Blogging is the next category.

Find recent content on the main index or look in the archives to find all content.

Recent Activity

Tuesday

  • tildemark tweeted, "most of the times, we really can not trust the alarm clocks."

Friday

  • tildemark saved the link COMMAND & CONQUER RED ALERT 3
  • tildemark tweeted, "wordpress had given away tshirts at the wordcamp davao. http://www.philippines.wordcamp.org manila is next on sept 6 2008."

Thursday

  • tildemark tweeted, "@gmtristan hello sir, can i posibly get a copy of the pics we had at the hodet davao?"
  • tildemark saved the link Web Hosting Promo Codes - Promo-Code.net
  • tildemark tweeted, "when loading big pdf files, chrome freezes until the file is downloaded"
  • tildemark saved the link Google Chrome - Download a new browser
  • tildemark saved the link FreelanceSwitch Hourly Rate Calculator

Today

  • tildemark tweeted, "flash is now working but i always acidintally click the quit button and everything is gone. i wish chrome has a warning message"
  • tildemark tweeted, "i cant see flash on chrome waaaa"