All posts by Mark Jacobsen

New cffreedom-utils repo on github

For the last 10 years or so I’ve built up a number of Java utility functions and classes to help me write code easier. Over time I’ve probably had to re-write many of the functions as I’ve moved teams, lost the code, or just wanted to make it better. I’ve also had to jar up and help other developers use the code one too many times. Since I’m finally sick of that I’ve switch over to Maven for dependency and build management, moved the library to github, and am open sourcing the development so that others can take advantage of my work, and contribute to it to make it better.

You can find the project at https://github.com/communicationfreedom/cffreedom-utils. Please take a look, and consider helping make it even better.

Note: Since I’ve been using the project more and more the pace of change is pretty steep and the package structure has been changing frequently, but I believe that is starting to settle down a bit.

Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.

Weekly Round-Up: 4/28/13 to 5/4/13

The Weekly Round-Up is a once weekly collection of my #1Aday daily shares. Hope you find something of interest!

Mon 4/29
Scott Dinsmore @_Scott_Dinsmore on: How Simplicity Swindled the Investment Banker (and the rest of the world) – http://markjacobsen.net/l/1784

Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.

Weekly Round-Up: 4/21/13 to 4/27/13

The Weekly Round-Up is a once weekly collection of my #1Aday daily shares. Hope you find something of interest!

Mon 4/22
Mark Schaefer @markwschaefer has – A Rant: In praise of The Unremarkable – http://markjacobsen.net/l/1779

Tue 4/23
Johann Hari on: The dark side of Dubai – http://markjacobsen.net/l/1780

Wed 4/24
MMM @mrmoneymustache hits another home run on: The Incomparable Advantage of Having to Work for what you Get – http://markjacobsen.net/l/1781

Thu 4/25
Laura Beck says: Don’t Call People Fat in Front of Your Kids Unless You Really Want to Screw Them Up – http://markjacobsen.net/l/1782

Fri 4/26
David Cain @DavidDCain tells you: How to Make Trillions of Dollars – http://markjacobsen.net/l/1783

Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.

Weekly Round-Up: 4/14/13 to 4/20/13

The Weekly Round-Up is a once weekly collection of my #1Aday daily shares. Hope you find something of interest!

Mon 4/15
Living With Less. A Lot Less – I like the point about filling our space whether we need to or not – http://markjacobsen.net/l/1774

Tue 4/16
Joshua Becker @joshua_becker says: Maybe the Answer is Owning Less – http://markjacobsen.net/l/1775

Wed 4/17
James Collins: Manifesto – http://markjacobsen.net/l/1776

Thu 4/18
James Altucher @jaltucher on: Why I Am Never Going to Own a Home Again – http://markjacobsen.net/l/1777

Fri 4/19
MMM @mrmoneymustache says: A Peak Life is Lived Off-Peak – http://markjacobsen.net/l/1778

Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.

Weekly Round-Up: 4/7/13 to 4/13/13

The Weekly Round-Up is a once weekly collection of my #1Aday daily shares. Hope you find something of interest!

Mon 4/8
The @tmninja on: Why Your Todo List Should Never Be Empty – http://markjacobsen.net/l/1770

Tue 4/9
Science Explains Why You Should Stop Hitting the Snooze Button – http://markjacobsen.net/l/1771

Wed 4/10
MMM @mrmoneymustache clues you in on: A Lifetime of Riches – Is it as Simple as a Few Habits? – http://markjacobsen.net/l/1772

Fri 4/12
Kristen Howerton: Can We Bring The Holidays Down A Notch? <- Amen to that! - http://markjacobsen.net/l/1773

Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.

Outlook Macros to Categorize and Archive Messages

If you’re still rockin’ Outlook 2007 and want to create some macros to categorize or archive your email, here’s some copy and paste code to have fun with…


Sub Archive()
    Call CommonCategorizeAndArchive(True, False, False)
End Sub

Sub Categorize()
    Call CommonCategorizeAndArchive(False, True, False)
End Sub

Sub CategorizeAndArchive()
    Call CommonCategorizeAndArchive(True, True, False)
End Sub

Sub Task()
    Call CommonCategorizeAndArchive(True, True, True)
End Sub

Private Sub CommonCategorizeAndArchive(archiveEm As Boolean, categorizeEm As Boolean, taskIt As Boolean)
    Dim olApp As New Outlook.Application
    Dim olItem As Object
    Dim olExp As Outlook.Explorer
    Dim olSel As Outlook.Selection
    Dim olArchive As Outlook.Folder
    Dim olTasks As Outlook.Folder
    Dim olNameSpace As Outlook.NameSpace
    Dim olTmpMailItem As Outlook.MailItem
    
    Set olExp = olApp.ActiveExplorer
    Set olSel = olExp.Selection
    Set olNameSpace = olApp.GetNamespace("MAPI")
    
    Set olArchive = olNameSpace.GetDefaultFolder(olFolderInbox).Folders("@Archive")
    Set olTasks = olNameSpace.GetDefaultFolder(olFolderInbox).Folders("zTasks")

    For intItem = 1 To olSel.Count
        Set olItem = olSel.Item(intItem)
        olItem.UnRead = False
        
        If (categorizeEm = True) Then
            olItem.ShowCategoriesDialog
        End If
        
        If (archiveEm = True) Then
            olItem.Move olArchive
        End If
        
        If (taskIt = True) Then
            Set olTmpMailItem = olItem.Copy
            olTmpMailItem.Move olTasks
        End If
    Next intItem
End Sub
Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.

Weekly Round-Up: 3/31/13 to 4/6/13

The Weekly Round-Up is a once weekly collection of my #1Aday daily shares. Hope you find something of interest!

Mon 4/1
Dan Rowinski says: The Hackers Are Winning – http://markjacobsen.net/l/1765

Tue 4/2
Mansal Denton gives you the: Top 10 Time Killers (and How to Fight Back) – http://markjacobsen.net/l/1766

Wed 4/3
Why you need F-you money – http://markjacobsen.net/l/1767

Thu 4/4
Meghan Nathanson on: 10 Ways to be Mindful with your Children Again – http://markjacobsen.net/l/1768

Fri 4/5
Leo @zen_habits on: Getting Your Family On Board with Life Changes – http://markjacobsen.net/l/1769

Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.

Weekly Round-Up: 3/24/13 to 3/30/13

The Weekly Round-Up is a once weekly collection of my #1Aday daily shares. Hope you find something of interest!

Mon 3/25
How car salesmen use the Four Square Worksheet to get you to pay as much as possible – thanks genius for posting 🙂 – http://markjacobsen.net/l/1760

Tue 3/26
17 Things Car Salesmen Don’t Want You to Know – http://markjacobsen.net/l/1761

Wed 3/27
Get the Best Price on Your Next Car by Never Setting Foot on the Lot Until You’re Ready to Buy – http://markjacobsen.net/l/1762

Thu 3/28
Money Might Be Ruining Your Mood (Here’s How to Stop It) – http://markjacobsen.net/l/1763

Fri 3/29
Email Best Practices for Teams – http://markjacobsen.net/l/1764

Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.

XPath Query Not Returning any Results in Java

In looking over documentation on XPath queries it seemed easy enough to be able to pull out values from XML, but try as I might I kept getting no results back. Even searching on the root element “/elementName” didn’t return any results. Of course, as with all things Java there’s a trick and that trick is to call setNamespaceAware(). Here’s a quick and dirty example…


DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
domFactory.setNamespaceAware(false); // NEVER FORGET THIS
DocumentBuilder builder = domFactory.newDocumentBuilder();
XPathFactory factory = XPathFactory.newInstance();
XPath xpath = factory.newXPath();
XPathExpression expr = xpath.compile("/items/item[@id='2']");
return (NodeList)expr.evaluate(domDocument, XPathConstants.NODESET);
Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.

Weekly Round-Up: 3/17/13 to 3/23/13

The Weekly Round-Up is a once weekly collection of my #1Aday daily shares. Hope you find something of interest!

Mon 3/18
Christopher S Penn @cspenn reminds us about the power of open standards asking: What will kill email? – http://markjacobsen.net/l/1754

Tue 3/19
John Cheese on: 4 Things Politicians Will Never Understand About Poor People – http://markjacobsen.net/l/1755

Wed 3/20
The @tmninja on: 10 Mistakes Companies Make That Destroy Employee Productivity – http://markjacobsen.net/l/1756

Thu 3/21
Big Food Is Making Us Sick – http://markjacobsen.net/l/1757

Fri 3/22
How I failed my daughter and a simple path to wealth – http://markjacobsen.net/l/1759

Please remember to subscribe to the newsletter or feed to stay up to date!

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself.