Tuesday, November 26, 2013

Optimize the size of xap file an easy way.

Your silverlight projects .xap file is getting bigger, this happens because of some assembly issues. And ofcourse there are some ways to optimize it.

http://blogs.telerik.com/miromiroslavov/posts/10-09-15/5-ways-to-reduce-your-xap-size.aspx

The above article shows few popular ways to reduce the size of xap file.

I had a xap file what was almost 4 mb in size. so I decided to do some optimization.

First thing i did is to remove all unused references and control references. fortunately resharper has some good feature on this. I right clicked on the project and selected “Optimize Reference” and removed all unnecessary references.

Now my xap file is reduce to 1.6 mb. that is almost 200% reduced. awesome.

image

Next there are some option for assembly caching, if you go you the silverlight tab of the project you would see that there is a checkbox for “Reduce XAP size by using…….” Just check it and recompile it. 

image

Next what happen is all the other assemblies that is been used are zipped and added in client bin folder. and reduce the xap file size to negligible.

image

But that does not help that much I guess as the total is still about 1.6 mb. any its a feature and we can used it.

Until next time cheers!.

Update: Checkout this kick ass article to get crazy on size reduction

http://blogs.telerik.com/xamlteam/posts/08-05-13/increasing-the-compression-ratio-of-the-xap-files.aspx

Saturday, October 19, 2013

Unlock password protected pdf files: pdfunlock.

I have been doing some works with pdf files auto fill with itextsharp. one of the file that client gave me was secure and password protected. When ever I try to open this using Adobe Acrobat Pro. Its shows that it have to be opened by Adobe life cycle designer.

Then I installed Adobe life cycle designer and tried opening it, unfortunately end up getting a password window and couldn’t  proceed.

Then of course googled it and found this awesome web where you can unlock pdf online.

http://www.pdfunlock.com/

Cheers!

Thursday, September 12, 2013

Visual studio 2012 Blue Theme

Dear Community, I believe lot of the die hard fan of Microsoft development platform  wondered why visual studio 2012 got rid of the blue theme, in my personal opinion i really liked it, then while working and viewing videos in channel 9  I discovered that we can have different different colors theme in visual studio, and that’s  been there from the beginning.

Man I am stupid, should have figured it out that they have some kind of plan for that. Any way the easies way to get this blue theme going again in visual studio is to use extension.

How to get the blue theme?

Go to visual studio 2012’s extension manager and then search for “Color” in online category.

image

You will find couple of interesting extortions, Download the “Visual Studio 2012 Color Theme Editor”

image

The download and install will begin instantaneously, after that the Visual studio will be required to restart.

After restart you will get option like the below where you can choose your color theme. Choose the right one. In my case I have chosen “Blue”.

image

You can also customized the theme and create your own theme, but that is a whole other story. Until next time. Happy coding.

Friday, August 2, 2013

Team foundation server windows explorer extension

We all used svn that’s for sure for personal use or perhaps company policy to use it doesn't matter, in source control race TFS is getting behind. At lease i felt it, but some recent improvements now taking this back bench product to front bench.

For instance we can have git like behavior in tfs if we want, cool right?. But today I wish to share a different type of tool that can ease the tfs experience a little bit better, in fact its a windows explorer extension, named “Microsoft Visual Studio Team Foundation Server 2012 Power Tools”

You guys can download it from “http://visualstudiogallery.msdn.microsoft.com/b1ef7eb2-e084-4cb8-9bc7-06c3bad9148f

I have used it and its kind of can give you a feeling like tortoise. It has overlay icons just like svn.

image

Now some critic, the extension has relatively slow in performance, at least in my system. It doesn't have branching or switching stuff like other source control extensions, its primitive but at least now we have an extension.

I got excided to realize that now i can add documents folders and other stuff in tfs without need to open visual studio. so its cool and if we all start using it hopefully more feature will be available in future. 

Thursday, July 4, 2013

Thousands of warning! in visual studio 2012? Why?

So what happen is, I had my XML documentation file checkbox in build tab of project was checked. And I had few service references in my project.

As you can guess all of the service ref has around more than 2000 methods, since this checkbox was checked all the public methods of service proxy class was giving a warning about summery of the function.

image

It was frustrating to see that amount of warning in my project, Then unchecked the checkbox and wallah all the warning are gone.

Inner peace is on,,,,

Friday, February 1, 2013

Set value of input type password or asp.net textbox where TextMode="password".

Old school stuff, probably everyone knows it, still sharing because had a little bit trouble tackling this. Thought its very easy and it is,

Why we need this? Here is why, you have a cookie where you save username and password for later use, and of course the cookies are encrypted.

Now you retrieve the cookie found that a user login info is there and user checked the “Remember Me” stuff. You need to set to both username and password in the text fields and pre-populate those.

In my case the password field is html markup.

 

<input id="password" type="password" placeholder="Password" required="required" runat="server"
clientidmode="Static" value="" />
 
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1"
Text="*" ErrorMessage="*" ControlToValidate="password" ForeColor="Red"></asp:RequiredFieldValidator>

Now I set the code from c# as below run the app didn’t worked.

1. password.Value = "1234567890";
2. password.Attributes.Add("value","1234567890");

After trying the first case I realized that its not going to work, then googled it found few suggestions that adding as attribute should work. No luck here also, I wonder why it didn’t worked in few of the posts developers are saying that it works, but in my case it didn’t. Finally take a D Tour and Used javascript the nail the bad boy.


Step one:

Page.ClientScript.RegisterStartupScript(this.GetType(),"statusup","SetDefaultPass('1234567890');",true);
Step Two:

<script language="javascript" type="text/javascript">
function SetDefaultPass(parameters) {
try {
document.getElementById('password').value = parameters;
} catch (e) {
alert(e);
}
}
</script>

That’s its this fine finally it worked like magic. no issue now.


Hope this helps to some lame, like me some day :D.


Cheers!