How to Configure Microsoft Word to write blog posts in WordPress

I don’t know how I have missed this feature in word. I have previously used Microsoft live writer for writing blog posts but then it was bundled with some other Microsoft products and became totally useless.

It’s a happy accident today, when I learnt that the same facility is available via word and it’s inbuilt. So here am I writing about this using the facility.

 

The setup is simple. Here are the steps

Step 1

File ->New -> Blog Post -> Create    

 

Step 2

Click Register Now.

Step 3

Choose your blog provider

 

Step 4

Enter the WordPress detail. This may be different for other providers.

 

Step 5

 

Last warning and you are done…

If you face any errors, check the blog url, changing http:// to https:// helped in my case.

Happy writing!

Few Python Regex for FORTRAN Code

 

Most of my day job involves Fortran code and finding quick details is a regular need. Here are four regex in python that I have been using for some time now. Sharing it here.

To Find Subroutines and Functions

 import re procedule_name=re.compile(r'\s*(RECURSIVE)?\s+(SUBROUTINE|FUNCTION)\s+\S+\(.*',re.IGNORECASE) 

 

To Find All Call Statements
			

 callname=re.compile(r'^\s*call\s*\S*[(]?\S*[)]?',re.IGNORECASE) 

    

 

To Find Variables (Integer, Double Precision, Logical, Real)
			

 variregex=re.compile(r'^\s+(logical|integer|double.+precision|real(\*\s*\d)?)\s+\S*',re.IGNORECASE) 

 

To Find Character Variables
			

 characteregex=re.compile(r'^\s+(character+([\*\s*\d+]|\(\S*)*)\s+\S*',re.IGNORECASE) 

 

Brain’s Attic

I keep getting back to this passage again and again. 

I need to learn something from this. 

I consider that a man’s brain originally is like a little empty attic, and you have to stock it with such furniture as you choose. A fool takes in all the lumber of every sort that he comes across, so that the knowledge which might be useful to him gets crowded out, or at best is jumbled up with a lot of other things so that he has a difficulty in laying his hands upon it.

Now the skilful workman is very careful indeed as to what he takes into his brain-attic. He will havenothing but the tools which may help him in doing his work, but of these he has a large assortment, and all in the most perfect order. It is a mistake to think that that little room has elastic walls and can distend to any extent. 

Depend upon it there comes a time when for every addition of knowledge you forget something that you knew before. It is of the highest importance, therefore, not to have useless facts elbowing out the useful ones. 

– (Holmes; A Study in Scarlet)

Outlook emails vba code

Spring cleaning the desktop, found this old vba code that I must have mashed together sometime back.

Well I tested it today and it works, so posting it here for future use.

What it does, collects every email for the GAL in outlook…


Sub GetAllGALMembers()
Dim olApp As Outlook.Application
Dim olNS As Outlook.NameSpace
Dim olGAL As Outlook.AddressList
Dim olEntry As Outlook.AddressEntries
Dim olMember As Outlook.AddressEntry
Set olApp = Outlook.Application
Set olNS = olApp.GetNamespace("MAPI")
Set olGAL = olNS.GetGlobalAddressList()

Set olEntry = olGAL.AddressEntries
On Error Resume Next
Open "d:\project\email\emails.csv" For Output As #1
Dim i As Long
For i = 1 To olEntry.Count
Set olMember = olEntry.Item(i)
If olMember.AddressEntryUserType = olExchangeUserAddressEntry Then
strName = olMember.Name
strAlias = olMember.GetExchangeUser.Alias
strAddress = olMember.GetExchangeUser.PrimarySmtpAddress
strPhone = olMember.GetExchangeUser.BusinessTelephoneNumber
strCity = olMember.GetExchangeUser.City
strCom = olMember.GetExchangeUser.CompanyName
strJobT = olMember.GetExchangeUser.JobTitle
strDepar = olMember.GetExchangeUser.Department
strOffLoc = olMember.GetExchangeUser.OfficeLocation
Print #1, strName & vbTab & " (" & strAlias & ") " & vbTab & strAddress & vbTab & strPhone & vbTab & strCity & vbTab & strCom & vbTab & strJobT & vbTab & strDepar & vbTab & strOffLoc
End If
' for testing
' If (i = 200) Then
'  GoTo 10
' End If
Next i

10 msgbox ('Done!!')

End Sub

 

Amazing Machine Learning in 1950!! 

Watch this excellent videos from the 1950’s that demonstrates machine learning. Amazing!

Learnt about this from the book on Bell Labs that’s one of my top recommended read for anyone.

If you are interested in Machine Learning, don’t miss this other video on Algorithms and Techniques that are changing our world

 

 

 

Matter, Energy, Time, Space and Programming

Was reading C++ in Action and came across this .
What’s the most important thing in the Universe? Is it matter? It seems like everything is built from matter-galaxies, stars, planets, houses, cars and even us, programmers. But what’s matter without energy? The Universe would be dead without it. Energy is the source of change, movement, life. But what is matter and energy without space and time? We need space into which to put matter, and we need time to see matter change.
Programming is like creating universes. We need matter: data structures, objects, variables. We need energy–the executable code–the life force of the program. Objects would be dead without code that operates on them. Objects need space to be put into and to relate to each other. Lines of code need time to be executed. The space-time of the program is described by scopes. An object lives and dies by its scope. Lines of executable code operate within scopes. Scopes provide the structure to program’s space and time. And ultimately programming is about structure.