installing pycrypto on windows with easy_install

If you have been hitting this error:

error: Setup script exited with error: Python was built with Visual Studio 2003;

extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing “-c mingw32″ to setup.py.

 

trying to install pycrypto on windows, http://blog.sadphaeton.com/2009/01/20/python-development-windows-part-2-installing-easyinstallcould-be-easier.html#comment-8 gives a great article on how to tell easy_install to use the mingw32 compiler instead of Visual Studio.

As of this writing, there was an error on the article which says you need to put a disutils.cfg file in ..python/lib/distutils/. The file name should be distutils.cfg.

Technorati tags: , , ,

Import Palm Desktop data into Outlook

My situation – I wanted to import my Palm Desktop data to Outlook.

There is an offering by chapura that does this but it costs some $.

I found out this free alternative which will do it.

The experience I had with exporting Palm data to comma delimited files or tab delimited files were not satisfactory.

A better way is for Palm to export vcs for calendar events and vcf for the contacts information that Outlook can import. But there are also no ready scripts in python to export Palm data to vcs, vcf files.

Fortunately, Palm ships with software to synchronize the handheld data to either Palm Desktop or Outlook.

Therefore I could import Palm Desktop data by first transferring my Desktop data to Palm handheld and then synchronize the handheld with Outlook.

Here are the steps:

Step 1 – Transfer Palm Desktop to handheld

sync step 1

Configure Hotsync Custom:

Use either Synchronize files or Desktop overwrites handheld

 

Step 2 – Configure Hotsync to sync handheld to Outlook

palm to outlook 

sync step 2

Essentially you are setting up the Palm handheld to synchronize to Outlook instead of Palm Desktop

 

 

 

 

sync step 2a 

Step 3 – Transfer handheld date to Outlook

Configure Hotsync Custom:

Use either Synchronize files or Handheld overwrites Desktop

sync step 3

Technorati tags: , , , , ,

Comparing dictionaries in doctest

Here’s a nifty way to compare dictionaries in doctest in Python.

 

>>> d = function_that_returns_a_dict()

>>> expected_d = {… some expected result }

>>> d = True if d == expected_d else d
>>> d
True

Technorati tags: ,

Date formatting in Python – use strftime, like Oracle's to_char

time — Time access and conversions — Python v2.6.1 documentation

time.strftime(format[, t])¶

Convert a tuple or struct_time representing a time as returned by gmtime() or localtime() to a string as specified by the format argument. If t is not provided, the current time as returned by localtime() is used. format must be a string. ValueError is raised if any field in t is outside of the allowed range.

The strftime function is similar to Oracle SQL’s to_char function to display a date in various formats.
You will however need to be familiar with directives.

For example, to display a date in Oracle’s format (‘dd-MON-yy’), the function is

assuming d is a datetime,
d.strftime(‘%d-%b-%y’).upper()

Cookie

Account keep getting locked out after change domain password

event viewer I changed my domain password and thereafter my account kept getting locked out.

It was like my computer was still using the old password to connect to the domain resources.

Browsing the event viewer, I found a lot of Warnings corresponding to the date that my account started to get locked out frequently.

stored user names and passwordsThe Source was from Kerberos, event id 14 –

There were password errors using the Credential Manager. To remedy, launch the Stored User Names and Passwords control panel applet, and reenter the password for the credential …

Ah, this looked promising – this is precisely what I suspected that is somehow my computer did not update the credentials.

Next I found this article on how to get to the Stored User Names and Passwords applet quickly. Just run

rundll32.exe keymgr.dll,KRShowKeyMgr

in a command prompt.

After that, just update the password for the domains.

TypeError: not all arguments converted during string formatting

I hit this error with some python code:

TypeError: not all arguments converted during string formatting

I took a long time to finally trace it to this:

output = 'inserting %s report centers for ' % (number_of_segments, column_set_name)

It means I provided 2 values to replace (number_of_segments, column_set_name) but only provided one place holder (%s).

This is the correct code:

output = 'inserting %s report centers for %s' % (number_of_segments, column_set_name)

 

Technorati tags: ,

Autorun citrix .ica file

save ica file

I work with citrix a lot in my office and then one day, I started to have to save the .ICA file and then click on .ica file to run citrix.

What I wanted was for it to automatically run the .ica file without first asking me to save the file first.

I researched for a long time on how to run downloaded file automatically but did not find a solution.

do not save encrypted pages to diskToday, I found the solution.

Go to Internet Options and uncheck Do not Save Encrypted Pages To My Disk like in the screenshot.

Now my ICA files run automatically on clicking.

Technorati tags: , ,

Close all other windows in Vim

Vim documentation: usr_08

CLOSING ALL OTHER WINDOWS If you have opened a whole bunch of windows, but now want to concentrate on one of them, this command will be useful: :o nly This closes all windows, except for the current one. If any of the other windows has changes, you will get an error message and that window won’t be closed.

Run office PC from home

This morning, I learnt how to switch on my office PC from home.

In my scenario, my office has citrix which I can log in to.

Before this morning, I had to leave my PC on before I left work if I wanted to use it from home. At home, I would log on to citrix and then remote desktop to my office PC.

This wikipedia article provided good resource to find scripts to switch on my PC from home. I used one of the scripts provided and tested it to wake up my computer via citrix. It worked. Once that was accomplished, I could then remote just as if I had left the computer on.

Now I don’t have to leave my computer on if I want to work from home.

Technorati tags:
Pages:«123456»