Monthly Archives: March 2012

N-400 pdf does not open on Mac because of Security Reason

If you tried to download the Citizenship form N-400, you would notice that it does not opon. It shows wrong file size (106kb) and it says you need pdf to open this file.

The error appears because of security reason. This particular pdf file has high security features so that it can not be edited and saved. Mac OSX Snow Leopard, Lion, Mountain Lion all have default pdf writers. That means you do not need to download pdf reader or writer. The OSX itself allows to save any file as pdf or edit a pdf. N-400 form cannot be opened on a system which has pdf writer installed on it. There it will not open on mac.

You will run into similar problem on Windows if your installed any PDF writer such as PrimoPDF which is basically a driver to write print a document as pdf file. You must uninstall any pdf writer before you could open N-400 form.

You can use XPS reader on Windows to save you your pdf file though. Simply open the file as pdf, fill it out and then issue print command. Make sure you select XPS document when printing. The file will be save with data. Of course you can only open this document on a windows plateform where XPS is installed. XPS is installed on all Windows 7 (and Vista I guess) PCs. This solution works pretty well.

can’t open XPS file in Windows XP

To view XPS files you might have to downalod Microsoft XPS Essential Pack. The problem that I was facing on Windows XP pc, each time I would double click xps file, it would opoen a new broswer window and popup a dialog “Save your xps file”. I noted that I indeed was using XPSViwer.exe. After isntalling the above pack, it add a second option called “XPS Viewer EP”. Use that option. I have highlighted in the image below. Right click on the file and choose open with (if open with does not appear, hold shif key down and  right click)

 

 

XPSViewer.exe does no work. For some reason it tries to pen it in Firefox and firefox than give you a dialog, do you want to save. I can never open it. You can easily view the file with XPS Viewer EP program.

Reset stored password in .rdc file

If you have a RDP (Remote Desktop Protocol) file to connect to a remote server and you saved your password, there is an easy way to reset it. Generally even the password is wrong, it will not ask you again to enter your credentials.

 

To reset, right click on .rdp file and select edit. One Windows PC this should not bring up notepad, rather open a small window with a check box, “Always ask for credentials”. Check this box and click ok.

Remote Desktop Connection Password Reset

RDP file

 

Macbook Pro Slow and Freezes a lot

If you 2011 macbook pro is slow, freezes a lot, it could be because it needs more RAM. They come with 4GB RAM but if you open a lot of browser window and doing multiple things, you will quickly find that 4GB is not enough the OS will start paging the memory contents to external hard drive. Here is the usage below

 

Macbook Pro Activity Monitor Lions

 

There are a couple of things look for. Free Memory is 520 MB. The most important thing that makes your computer slow is the swap used. Every time the OS uses swap, it is going to freeze. You can prove it by running activity monitor on. Work in you laptop as you would regularly do. As soon as it freezes, check your activity monitor. You will notice that the swap is either increasing or increased. This proves the freeze is because of memory swap.

There is an interesting fact about macbook pro (and other computers) freezing. Even when it freezes it does not uses full memory power. That means the freeze is because of other bottleneck not the CPU itself. In this case , it basically reads/write to hard drive and since the hard drive is quite slow, it has to stop on everything while fetching and swapping that data. This makes your laptop slow.

If you think this is the reason your mac is slow, because let me know in comments. Ideally the swap size should be 0 or close to 0. A possible solution is to upgrade you ram to 8 GB or 16 GB. Since RAM is really cheap now a days, it cost less than $50 to upgrade to 8GB. Note, the apple site list macbook pro upgradable to 8GB but you can actually upgrade it to 16GB. This is undocumented.

 

 

Transaction (Process ID 64) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

I got the above error in ASP.NET 3.5, Visual Studio 2008. I had simply updated a stored procedure that was part of another database. The only change that I made was add an additional paramater to be passed to the stored procedure. Well I begin to get this error without any good reason. I researched and found a couple of helpful command to check database integerity like these


DBCC CHECKDB

but that did not help much as I could not figure out what the different results means. So then I run my own query to find out which tables were last updated in the database using this query


SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseTable, last_user_update,*
FROM sys.dm_db_index_usage_stats
WHERE database_id = DB_ID( 'MYDBNAME')

Surprisingly it ran successfully but gave 0 number of rows. I had run this query before and I knew it gave me the list of tables that were last modified. So I ran it on the actual live server and indeed I got the result.

Turns out my db has been corrupted. I have a test system and I can probably restore a fresh copy into my system, that will solve my problem. Just wanted to put this out. The above query can easily verify the integrity of your database, rather than running some complex and intensive commands that may stress your database as well. At least in my case, it did.