7 habits of effective people

Posted in Uncategorized | Leave a comment

Phrases I love

  1. What’s the greatest day in the world? Today
  2. Definition of Junk: The stuff you keep for years, throw out and need three weeks later
  3. GUI interface using visual basic to track the killers IP address CSI
  4. This too shall pass
  5. 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 in

foreach ($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.’

  • If you can slip two fingers between your
    neck and the buttoned collar of a new dress shirt, the shirt will fit
    comfortably after laundering.
  • The shirt placket, the belt buckle, and the
    trouser fly should all line up.
  • Speaking of belt buckles, the point of your
    tie should never fall below it.
  • Rent no
    clothing.
  • Ninety-dollar shoes last half as long as
    $180 shoes, but $360 shoes will last you your whole
    life.
  • Three-hundred-sixty-dollar shoes will not
    last your whole life if you break their backs by refusing to use a
    shoehorn.
  • Three-hundred-sixty-dollar shoes without a shine
    can look like $90 shoes.
  • Women notice
    shoes.
  • They also notice nose hair; so should
    you.
  • Good shoes and a good haircut matter more
    than a great suit.
  • Neckties decorated with cartoon characters,
    golf tees, or the paintings of dead rock musicians coordinate with
    nothing.
  • It is never acceptable to loosen your tie,
    except during the process of its removal.
  • You are in your car an hour each day; you
    are in your clothes from morning to night. Spend
    accordingly.
  • The seat-belt shoulder strap goes under your
    necktie.
  • You can’t wear a bow tie with anything other
    than a tuxedo if you’re under forty-five or not a famous novelist or not a total
    geek, professor.
  • Very few people want to see you in
    compression shorts, and those who do might not be your target
    audience.
  • Likewise tight, black leather pants, Mr. Bon
    Jovi.
  • A $250 shirt will look like a $25 shirt if
    it is professionally laundered instead of hand
    washed.
  • Still, you will be happiest if you regard
    dress shirts as disposable.
  • By the way, this blue-shirt craze is getting
    really tiresome.
  • Buy the lightest-weight tuxedo you can find,
    because dancing and drinking and scantily clad women cause formal affairs to
    become overheated.
  • One ring, maximum. On a finger. Not from
    college. Not from high school. Silver or platinum, not
    gold.
  • On airplane trips, briefs are more
    comfortable than boxers, as contents may shift during takeoff and
    landing.
  • There are no
    bargains.
  • A man in a good suit and tie looks chic; a
    man in a good suit without a tie looks more
    chic.
  • A man who uses the word chic had better be
    kidding around.
  • A man in a suit without a tie can wear
    loafers; a man in a suit with a tie
    cannot.
  • Ed Bradley doesn’t look as good with that
    earring as he thinks he does.
  • Jack Nicholson can wear two-tone spectator
    shoes only because he is Jack Nicholson.
  • It is far better to arrive at an event
    overdressed than underdressed: People will think you’ve got somewhere more
    important to go afterward.
  • Cheap cashmere is less soft and more fragile
    than expensive wool.
  • A T-shirt that shows through a dress shirt
    is the male equivalent of visible panty
    lines.
  • Do not wear button-down collars with
    double-breasted suits.
  • Do not unbutton double-breasted suits,
    Letterman notwithstanding.
  • The only thing worse than wearing socks that
    don’t cover one’s calves is wearing patterned socks that don’t cover one’s
    calves.
  • If you lose one cuff link, remove the
    remaining orphan; this will make it look as if you have insouciant personal
    style and omitted them on purpose.
  • Keep a lint roller in your office. And in
    your car.
  • A good suit treated well shouldn’t be dry-cleaned
    more than twice a season; a good tuxedo treated well should never be
    dry-cleaned.
  • Unless you’re a quarterback, never wear
    anything with your name and/or number on
    it.
  • Jeans should never meet an
    iron.
  • What you find at an outlet store is what
    other people refused to buy or what a company thinks you will buy because you’re
    the kind of person who shops at an outlet
    store.
  • Khakis religiously worn on Fridays are no
    less a uniform than a business suit worn the prior four
    days.
  • Nonetheless, you can never have too many khakis.
    Or white heavyweight-cotton T-shirts or canvas tennis shoes. For
    Saturday.
  • Numbers to remember: one half inch of shirt
    cuff; one and a half inches of trouser cuff; two inches more belt than inches on
    your waist.
  • Your belt and shoes should match in color,
    if not in material.
  • Speaking of color, there is little use for
    pink, peach, or teal.
  • It’s not the name on the label or the
    numbers on the credit-card statement but how good you look in
    it.
  • Even Al Gore shouldn’t wear a watch with a
    built-in calculator.
  • Like cars and stereo equipment, clothes are
    not really ‘invest-ments,’ because they cannot appreciate. They’re
    clothes.
  • It’s more important in a man’s daily life to
    have a good tailor than a good doctor.
  • Clothing salesmen can change your life in a
    good way, but not many of them.
  • Two elements of style that will last longer
    than any man who is smart enough to own them: a sterling belt buckle from
    Tiffany and simple cuff links.
  • A restaurant meal tastes better when you’re
    wearing a suit coat.
  • Band-collar shirts make you look either
    stupid or like a priest or like a stupid
    priest.
  • Whether a tie is too fat or too skinny
    should be decided by you, on a tie-by-tie
    basis.
  • When in doubt, ask a
    woman.
  • Know that she will often be wrong, too, and
    that ultimately a man is alone in a vast sea of indecision that he must
    ply.
  • Never trust a fashion magazine.
    CelebrityTrendZ is not a fashion magazine. CelebrityTrendZ likes you very much
    and is only trying to help.
  • Cigars are never stylish in mixed
    company.
  • If you hang your jacket on a chair and then
    sit on the chair and lean back, your jacket will look as if you had hung it on a
    chair and then sat on the chair and leaned
    back.
  • Drape your scarf on that chair and you’re
    going to lose it, and we are not your
    mother.
  • A black knit tie coordinates with jeans and a
    blazer as well as it does with a French-cuffed shirt and a custom-made
    suit.
  • Levi’s.
  • Deep in the heart of the Middle West, some
    people are actually wearing those baggy, printed workout pants again, and you
    owe God your deepest thanks that you have the presence of mind to not be among
    them.
  • The most important thing about selecting a hotel
    is the ability of the staff to press a shirt instantly, anytime, day or
    night.
  • First suit: navy solid. Second suit: gray
    solid. Third suit: navy pinstripe. Fourth suit: gray chalk stripe. Fifth suit:
    black. Sixth suit: You need no sixth suit.
  • To have absolute style is to break absolute
    rules – sometimes even these.
  • There is no foot pain so severe, no dress
    shoe so fragile, no commute so arduous, as to justify the sartorial holocaust
    that is wearing sneakers with a suit.
  • Unless you have a harelip or happen to be
    Wilford Brimley, you look exactly half as attractive with a mustache. (I
    disagree with this one! -
    Nick)

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 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: for %%X in
(set) do (command)
What makes the “For” statement so
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.

Table I. Modifying switches used with FOR
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
command
This 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

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.

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
command
An example that would list all the directories (but not
sub-directories) on the C: drive is for /d %%X in (C:\*) do echo %%X

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.

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] %%X in (source) do command
“Options”
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…
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.:

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.

[ORIGINAL SOURCE]

Posted in Uncategorized | Leave a comment