-
Recent Posts
Recent Comments
Archives
Categories
Meta
Phrases I love
- What’s the greatest day in the world? Today
- Definition of Junk: The stuff you keep for years, throw out and need three weeks later
- GUI interface using visual basic to track the killers IP address CSI
- This too shall pass
- What could we all achieve if we didn’t look for Credit
Posted in Uncategorized
Leave a comment
Top five regrets of the dying
From: http://www.guardian.co.uk/lifeandstyle/2012/feb/01/top-five-regrets-of-the-dying
A nurse has recorded the most common regrets of the dying, and among the top ones is ‘I wish I hadn’t worked so hard’. What would your biggest regret be if this was your last day of life?
1. I wish I’d had the courage to live a life true to myself, not the life others expected of me.
“This was the most common regret of all. When people realise that their life is almost over and look back clearly on it, it is easy to see how many dreams have gone unfulfilled. Most people had not honoured even a half of their dreams and had to die knowing that it was due to choices they had made, or not made. Health brings a freedom very few realise, until they no longer have it.”
2. I wish I hadn’t worked so hard.
“This came from every male patient that I nursed. They missed their children’s youth and their partner’s companionship. Women also spoke of this regret, but as most were from an older generation, many of the female patients had not been breadwinners. All of the men I nursed deeply regretted spending so much of their lives on the treadmill of a work existence.”
3. I wish I’d had the courage to express my feelings.
“Many people suppressed their feelings in order to keep peace with others. As a result, they settled for a mediocre existence and never became who they were truly capable of becoming. Many developed illnesses relating to the bitterness and resentment they carried as a result.”
4. I wish I had stayed in touch with my friends.
“Often they would not truly realise the full benefits of old friends until their dying weeks and it was not always possible to track them down. Many had become so caught up in their own lives that they had let golden friendships slip by over the years. There were many deep regrets about not giving friendships the time and effort that they deserved. Everyone misses their friends when they are dying.”
5. I wish that I had let myself be happier.
“This is a surprisingly common one. Many did not realise until the end that happiness is a choice. They had stayed stuck in old patterns and habits. The so-called ‘comfort’ of familiarity overflowed into their emotions, as well as their physical lives. Fear of change had them pretending to others, and to their selves, that they were content, when deep within, they longed to laugh properly and have silliness in their life again.”
What’s your greatest regret so far, and what will you set out to achieve or change before you die?
Posted in Uncategorized
Leave a comment
Getting a list of File sizes with Powershell
Simple enough to do:
get-childitem -recurse | ?{!$_.PSIsContainer}| Select-Object Name, length | format-table -auto
Posted in Uncategorized
Leave a comment
Searching Outlook with PowerShell
So, I was in the office this afternoon and had to pull some stats from email. I had a few options but the most interesting option was to work out how to scan a set of mails for specific information.
The data I wanted to get was: Title and Send Date. The script I used is below:
$olFolderInbox = 6 #the number 6 indicates Inbox
$ol = new-object -comobject “Outlook.Application”
$mapi = $ol.getnamespace(“mapi”)
$inbox = $mapi.GetDefaultFolder($olFolderInbox)
$msgs = $inbox.Folders.Item(“work”).Folders.Item(“bla”) #these are the folders I am searching inforeach ($msgs in $inbox.Folders.Item(“work”).Folders.Item(“bla”))
{
$msgs.items | Select-Object Subject, senton | export-Csv d:\emails.csv -noTypeInformation
}
To search in different folders use the following CONST:
- olAppointmentItem = 1
- olFolderDeletedItems = 3
- olFolderOutbox = 4
- olFolderSentMail = 5
- olFolderInbox = 6
- olFolderCalendar = 9
- olFolderContacts = 10
- olFolderJournal = 11
- olFolderNotes = 12
- olFolderTasks = 13
- olFolderDrafts = 16
There’s a lot of useful information available , if you want to get a sample of detail run the below script and it’ll get the data of 5 mails
$sentMail = $outlook.Session.GetDefaultFolder(5) # == olFolderSentMail
$sentMail.Items | select -first 5 TaskSubject
Posted in Uncategorized
Leave a comment
65
Sergio Valente put it best when he said,
‘How you look tells the world how you feel.’
‘How you look tells the world how you feel.’
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Copied
from – www.thetransitionalmale.com/65style (I happened across this link rather than was browsing the site)
Posted in Uncategorized
Leave a comment
Do… For…
I’m always in need of the a for…in…do batch command but always found
the decription provided overly complext, Powershell does it really well but
again is complex (for me at least). I found this article and it mader a lot of
sense:
the decription provided overly complext, Powershell does it really well but
again is complex (for me at least). I found this article and it mader a lot of
sense:
The very useful “for…in…do” statement is discussed
Computers are very good at doing the same thing over and over. The command
line contains a powerful and versatile method for carrying out this type of
operation. With this method, you can automate many time-consuming tasks. The
basic statement is of the form: for {each
item} in {a collection of items}
do {command} (For those who persist in calling
the command line DOS, note that the 32-bit version of the “For” statement is
much more powerful than the old 16-bit DOS version.)
A single-letter replaceable variable is used to represent each item as the
command steps through the the collection (called a “set”). Note that, unlike
most of Windows, variables are case-dependent. Thus “a” and “A” are two
different variables. The variable has no significance outside the “For”
statement. I will be using X throughout the discussion but any letter will do.
(In principle, certain non-alphanumeric characters can also be used but that
seems like a bad idea to me.) The variable letter is preceded with a single
percent sign when using the command line directly or double percent signs in a
batch file. Thus the statement in a batch file looks like this:
powerful is the variety of objects that can be put in the set of things that the
command iterates through, the availability of wildcards, and the capability for
parsing files and command output. A number of switches or modifiers are
available to help define the type of items in the set. Table I lists the
switches. They are listed in upper case for clarity but are not case-sensitive.
The set of things that are to used can be listed explicitly. For example, the
The well known action of stepping through a series of values that was discussed in connection with “if” and
If you wish to use directories in the variable set, use the switch /d. The
If you want a command to apply to the sub-directories as well as a parent
Now we come to a truly powerful switch that was not even dreamed of back in
line contains a powerful and versatile method for carrying out this type of
operation. With this method, you can automate many time-consuming tasks. The
basic statement is of the form: for {each
item} in {a collection of items}
do {command} (For those who persist in calling
the command line DOS, note that the 32-bit version of the “For” statement is
much more powerful than the old 16-bit DOS version.)
A single-letter replaceable variable is used to represent each item as the
command steps through the the collection (called a “set”). Note that, unlike
most of Windows, variables are case-dependent. Thus “a” and “A” are two
different variables. The variable has no significance outside the “For”
statement. I will be using X throughout the discussion but any letter will do.
(In principle, certain non-alphanumeric characters can also be used but that
seems like a bad idea to me.) The variable letter is preceded with a single
percent sign when using the command line directly or double percent signs in a
batch file. Thus the statement in a batch file looks like this:
for %%X in
(set) do (command) What makes the “For” statement sopowerful is the variety of objects that can be put in the set of things that the
command iterates through, the availability of wildcards, and the capability for
parsing files and command output. A number of switches or modifiers are
available to help define the type of items in the set. Table I lists the
switches. They are listed in upper case for clarity but are not case-sensitive.
| Switch | Function |
|---|---|
| /D | Indicates that the set contains directories. |
| /R | Causes the command to be executed recursively through the sub-directories of an indicated parent directory |
| /L | Loops through a command using starting, stepping, and ending parameters indicated in the set. |
| /F | Parses files or command output in a variety of ways |
I will consider a number of examples that illustrate the use of “For” and its
switches.
Simple iteration through a list
The set of things that are to used can be listed explicitly. For example, the
set could be a list of files: for %%X in (file1 file2 file3) do
command (Care must be taken to use correct paths when doing file
operations.) A different example where the set items are strings is: For
%%X in (eenie meenie miney moe) do (echo %%X)Wildcards can be also be
used to denote a file set. For example: for %%X in (*.jpg) do
commandThis will carry out the command on all files in the
working directory with extension “jpg”. This process can be carried further by
using several members in the set. For example to carry out a command on more
than one file type use: for %%X in (*.jpg *.gif *.png *.bmp) do command
command
%%X in (eenie meenie miney moe) do (echo %%X)
command
Looping through a series of values
The well known action of stepping through a series of values that was discussed in connection with “if” and
“Goto” statements is succinctly done with the switch /l (This switch is an
“ell”, not a “one”) . The statement has the form: for /l %%X in
(start, step, end) do command The set consists of
integers defining the initial value of X, the amount to increment (or decrement)
X in each step, and the final value for X when the process will stop. On the previous page, I gave an example batch file that
listed all the numbers from 1 to 99. If we use a “For” statement, that task can
be accomplished with one line:for /l %%X in (1,1,99) do (echo %%X >>
E:\numbers.txt)The numbers in the set mean that the initial value of X is
1, X is then increased by 1 in each iteration, and the final value of X is
99.
(start, step, end) do command
E:\numbers.txt)
Working with directories
If you wish to use directories in the variable set, use the switch /d. The
form of the command is for /d %%X in (directorySet) do
commandAn example that would list all the directories (but not
sub-directories) on the C: drive is for /d %%X in (C:\*) do echo %%X
command
Recursing through sub-directories
If you want a command to apply to the sub-directories as well as a parent
directory, use the switch /r. Then the command has the form: for /r
[parent directory] %%X in (set) do command
Note that you can designate the top directory in the tree that you want
to work with. This gets around the often cumbersome problem of taking into
account which is the working directory for the command shell. For example the
statement: for /r C:\pictures %%X in (*.jpg) do (echo %%X >>
E:\listjpg.txt) will list all the jpg files in the directory C:\pictures
and its sub-directories. Of course, a “dir” command can do the same thing but
this example illustrates this particular command.
[parent directory] %%X in (set) do command
E:\listjpg.txt)
Parsing text files, strings, and command output
Now we come to a truly powerful switch that was not even dreamed of back in
the DOS days of yore. The switch /f takes us into advanced territory so I can
only indicate the many aspects of its application. Things become rather complex
so those who are interested should consult programming books or the Microsoft documentation.
However, here is a brief sketch of what’s involved.
This version of the “For” command allows you to examine and parse text from
files, strings, and command output. It has the form for /f“Options”
[options] %%X in (source) do command
are the text matching criteria and “source” is where the text is to be found.
One of the interesting applications is to analyze the output of a command or
commands and to take further action based on what the initial output
was
Posted in Uncategorized
Leave a comment
Looping through a series of Chart data points
This has taken an age to find but turned out to be very simple, simply put
I have a ton of bar charts and want to add series name to them. to do this
manually is a pain in the @$$ so here is the magic…
I have a ton of bar charts and want to add series name to them. to do this
manually is a pain in the @$$ so here is the magic…
Dim a As Integer
a = ActiveChart.SeriesCollection.Count
Do While a > 0
ActiveChart.SeriesCollection(a).Select
ActiveChart.SeriesCollection(a).ApplyDataLabels
ActiveChart.SeriesCollection(a).DataLabels.ShowSeriesName = True
ActiveChart.SeriesCollection(a).DataLabels.ShowValue = False
a = a – 1
Loop
Awesome….
Posted in Uncategorized
Leave a comment
Schedule charts in Excel
Every now and then I need to get a spreadsheet opened data refreshed and
then published onto a sharepoint site. Once you have the data set-up in the
spreadsheet. Add the below code either to Private Sub
Workbook_Open() or in its own subroutine.:
then published onto a sharepoint site. Once you have the data set-up in the
spreadsheet. Add the below code either to Private Sub
Workbook_Open() or in its own subroutine.:
Private Sub Workbook_Open()
‘refresh all data in the
workbook
ActiveWorkbook.RefreshAll‘have the below sheet be the
first item shown
Sheets(“Code defect trend – all teams”).Select‘stop any popups being displayed
Application.DisplayAlerts =
False‘Save the workbook
ActiveWorkbook.Save‘Publish the workbook to a particular sharepoint/web server
ActiveWorkbook.SaveAs Filename:= _
“http://sharepoint/site/Bug_Trend.htm“
_
, FileFormat:=xlHtml, ReadOnlyRecommended:=False,
CreateBackup:=False‘Quite the application
Application.Quit
End Sub
If you do set the macro to run at start and want to edit the file
press the shift key when opening the file, this will stop the macro from
running.
Posted in Uncategorized
Leave a comment
Elevator Pitch
The elevator door opens. And there stands your ideal investor. It’s the
chance of a lifetime. But that chance only lasts as long as the elevator ride -
you have less than a minute to make an impression. Hopefully, you’ve got a
well-crafted elevator pitch ready to give.
The elevator pitch is not the hurried presentation of a full-blown business
plan. It’s an introduction, an overview and a pitch – and a short one at that -
meant to capture the attention of a potential investor. Of course, an elevator
ride is a short one. Guides for elevator speeches that say you have one minute
surely overestimate the amount of time it takes for an elevator to move from
floor to floor. Of course, an elevator speech isn’t restricted to elevators.
Rather, it comes in handy for any occasion where a concise presentation is
appropriate.
When crafting your pitch there are two key things to keep in mind: its
content and its form. In other words, it’s not just what you say but how you say
it. Here are a 10 tips to keep in mind as you craft your elevator pitch.
1. Keep it short. Be succinct. According to Wikipedia, an adult’s
attention span is eight seconds, so be sure to give just enough information (and
more importantly perhaps the right information) so that after only hearing a
sentence or two, someone knows what you do – and if it’s a pitch, what you need.
2. Have a hook. As Mel Pirchesky advises,
“The objective of the first ten or fifteen seconds is to have your prospective
investors want to listen to the next forty-five or fifty seconds differently,
more intently than they would have otherwise.”
3. Pitch yourself, not your ideas. As Chris Dixon
writes, “The reality is ideas don’t matter that much. First of all, in
almost all startups, the idea changes – often dramatically – over time.
Secondly, ideas are relatively abundant.” Instead of talking about ideas,
highlight what you’ve done – the concrete accomplishments or skills – rather
than some intangible concept or a future goal.
4. Don’t forget the pitch. It’s easy to get so caught up in
the details of who you are that you neglect to mention what you need. What
amount of financing are you seeking, for example?
5. Don’t overwhelm with technical or statistical
terminology. While being able to tout one or two amazing and memorable
phrases or figures can be useful, don’t fill your elevator speech with numbers
or jargon.
6. Practice. Rehearse your elevator pitch so that when the
opportunity to give it comes, you can deliver it smoothly.
7. Use the same tactics for print. You can hone your
elevator skills by practicing them in writing. Babak Nivi describes the email
elevator pitch here.
8. Revise. As your startup moves through various stages, be
sure to update and refresh your pitch.
9. Be involved in the startup community before you pitch.
Business Insider suggests
“Engaging in online discussions, writing insightful blog posts, and
participating in the relatively small startup community can earn you a ‘strong
presence’ that gets you noticed by potential investors.” Building relationships
with investors before pitching to them will help your success.
10. Listen. When seeking to build strong networks, remember
it can be just as important to listen as it is to talk.
Posted in Uncategorized
Leave a comment
