Archive

Archive for the ‘.NET’ Category

Windows Phone 7 Dev – Images and ApplicationBarIconButton

July 17th, 2011 No comments
Number of View: 591

I have been working on a windows 7 phone application. I know, many of you may give me a hard time about developing for winphone7 vs iPhone or android. Well, I’m working on getting to each of them eventually. Currently Phone 7 made sense.

So far development has been pretty straight forward. I was adding an application bar to the bottom of the app to allow for menu items and icons for actions. In doing so I could not for the life of me get the icons to show. I tried chaning he names the uri path and even the case of the images. No matter what I did I could not figure out why they would not show.

In the end, after some googling I found that it is an issue with the image file. In my case mail.png file.

The (.png) file has a visual studio property of Build Action set to Resource by default. If you change the image to content the image will show. What a crazy setting.

The fix was to change it to content. It seems strange that this would not be the default action for an image in a Win7Phone project.

Thanks to the UK solutions development team:
http://blogs.msdn.com/b/mcsuksoldev/archive/2010/07/14/windows-phone-applicationbariconbutton-not-displaying-icons.aspx

32bit or 64bit compiled application

June 21st, 2011 No comments
Number of View: 769

How do you tell if an app has been compiled in 32bit, 64bit or any cpu.  There is a great little tools called corflags.  Corflags is built into visual studio.  You can open a visual studio command prompt to run this tools.  I created a vs2010 solution with 3 projects, the project were compiled with the above 3 options.  Here is the feed  back from corflags:

My applcations are capps32, cappsany, and capps.  I compiled each to a specific target compiled architecture.

the breakdown of how to determine if your application is compiled for any cpu , x86, or 64bit is

anycpu: PE = PE32 and 32BIT = 0
x86: PE = PE32 and 32BIT = 1
64-bit: PE = PE32+ and 32BIT = 0

 

 

Categories: .NET, Tech Tags: , ,

Command Line tips

June 20th, 2011 No comments
Number of View: 733

I find myself in a command prompt in windows a lot.  I enjoy using it.  From simple items like getting an ip address or copying files (robocopy)  I use it a lot.   More recently I have been in powershell a lot more.  Powershell uses most of the same tricks as the command prompt.

I have used these tips and tricks from the command prompt - http://commandwindows.com/vista-tips.htm

Recently at teched I found another great tip the “F7″ key.  I think almost everyone knows that you can use the up arrow to get to your previous command.  ”F7″ allows you to list all your recent commands and then select them.  So image a long select script in power shell, you can hit “f7″ and look at the script.

 

iPad and Microsoft

May 17th, 2011 No comments
Number of View: 883

I am currently at microsoft techEd in Atlanta. Microsoft has some great things going on.

Any time you put 10000 geeks together you see a lot of tech. The main take away I found was that the iPad has won.

I see as many iPads as I do laptops. That is interesting especially at a Microsoft conference. This simple observation tells me that either Microsoft users like apple better than android or that the iPad is a better tablet.

You could argue that the iPad has been out longer, but is seems that most iPads l see are ipad2.

Categories: .NET, iPad, Security Tags:

Backup Gmail with Thunderbird

March 3rd, 2011 No comments
Number of View: 1311

In light of the recent events where Gmail lost some users mail. I thought it is appropriate that I post the method I use to back mail. Not only is this method useful for gmail but also google apps or any other mail system that can use IMAP or POP.

To make sure that everything is safe I use Thunderbird. Thunderbird allows you to both consume / use mail and also create a solid backup solution. On my server in the house I install thunderbird and then connect it to all my main mail systems (Gmail / google apps).

To enable IMAP or POP you need to go into gmail mail settings | Forwarding and POP /IMAP

Once thunderbird is configured you can have it download all the mail and attachments.

On a windows system the files are stored at:
c:\users\USERNAME\AppData\Roaming\Thunderbird\Profiles
C:\users\jimiz\AppData\Roaming\Thunderbird\Profiles

You will then see a guid like folder

So take a few minutes download thunderbird. Point it at Gmail (add your credentials) and start downloading your mail. I forgot to mention that I just add that folder into the sync process to Dropbox for a all around backup.

Categories: .NET, Applications Tags:

Network Performance – iPerf and jperf

March 2nd, 2011 No comments
Number of View: 2487

I recently setup my new laptop and wanted to test the network connection. I have had some issues with the speed and performance on wireless with the new T410. My home network has both a G wireless and N wireless network available. I have been seeing poor performance on the new thinkpad, while the old T61 would get almost twice the performance. I wanted to test this, and found a great tool iperf to allow me to validate my concern (I have since learned that the wireless cart in the t410 is a bit suspect)

iperf is a little gem to have for testing. It is a network packet generation tool that will allow you to measure bandwidth. It has a server and a client portion.

You can read about iperf here: http://en.wikipedia.org/wiki/Iperf
I used a quick tutorial from Linhost.info http://linhost.info/2010/02/iperf-on-windows/ to get the install going. I had 2 cases I wanted to test. My new laptop to another box on the wireless network and my laptop to a pc on the wired network. (both G and N).

First Step was to download the application. I got it from here. UCF.edu: (https://nocweboldcst.ucf.edu/files/iperf.exe)

To run you only need to open a command prompt (start | run | cmd) and change directory to where you saved the file.

I needed to run iperf on both a windows and a linux box. The install for windows is simply download and run the iperf.exe. On linux I needed to grab the latest release. I am running ubuntu so it can simply be done by running sudo apt-get install iperf

To configure the the server side of iperf you only need to run the command iperf -s (both on linux and windows). To allow this to work on linux I needed to open port 5100. To do this on ubuntu I ran the following command to open ufw.
sudo ufw allow 5100

To test I ran iperf -s on both the ubuntu and my windows pc on the network.
On the client machine, the T410 laptop in my case I ran

iperf -c 192.168.2.22 (this calls iperf with the client switch and the name of the server to communicate with-192.168.2.22).
Here are the results of the Ubuntu box on the wireless network
Client

The results were: (6.67 Mbits/sec)
Interval Transfer Bandwidth
0.0-10.0 sec 7.96 MBytes 6.67 Mbits/sec
Server

I then ran the same test to the PC on the LAN directly to the wireless AP. This resulted in 14.8 Mbits/sec

From my test results I can see that using the G network is only getting me about 2Mbits per second. However connecting to a wired pc through the G network results in about 14Mbits per seconds.

To be a bit more robust in testing I had the Linux box run the test to the windows PC as well.

this shows that 2 wireless clients do not get that great of throughput between them.

To round out this post there is also a graphical element to iperf (jperf) it is written java and can be downloaded at Google Code http://code.google.com/p/xjperf/downloads/detail?name=jperf-2.0.2.zip&can=2&q=

Once you download and extract the files you can run jperf.bat to launch the application.
Here is a screen capture of jperf running on the Laptop connecting to the Windows PC on the LAN

Overall iperf has been a great tool to help diagnose issues with network latency and bandwidth.

Categories: .NET, Applications, General, Tools Tags: ,

Free Icon set for Developers

January 8th, 2011 No comments
Number of View: 772

I am frequently creating Visio diagrams to use for software development or web applications.  I typically use the built in elements and icons.  Recently I have found it difficult to find some items that I would like to have in my designs.    The great team and group over at OSA (www.opensecurityarchitecture.org) have many tools to both help with designs but also elements in the designs.


If you are not familiar with OSA I would recommend looking at some of their patterns or their library to understand how this great group can be useful.  They help both visually display IT standards but also security standards.

Recently I have been using their Creative Commons released Icon set to help in my designs.  Simple icons like padlocks, wifi signals, users, and servers.  Not only are they good looking but it is very functional.    It never hurts to have a design that is both elegant and useful.

QR Code Generator – 2d barcode

December 8th, 2010 No comments
Number of View: 1552

I’ve been doing some research on QR codes (the funny looking squares you see in magazines and Sunday advertisements). QR codes are “Quick Reference” barcodes that can contain a lot of information. They started to become popular in Japan and have recently been showing up more and more in media and at stores.

There are a few great QR code generators out there but I set out to make one for myself that I would be able to share. I used an opensource qrcode library from twit88.com.

Head over to www.tilde32.com/qr.aspx to use the generator. Create a QRcode for your site, or for a business card, even your wifi info. You can use the permalink to add the QR code to your site or just download and save the image. I have also been working on a GDI app that you can add your logo on top of the QR code (coming soon) Similar to what the BBC did with their logo. I am also adding a Microsoft TAG generator.

QR code for : jimiz.net

Why are QR codes so popular? There are over 50 Million smartphone users in the US. Any smartphone with a camera should have the ability to read a QR code. It is a simple way to transmit data to a end user. QR codes are easy and free to create and can store a lot of data. They are easy to embed into media and marketing materials.

Troubleshooting a .NET error – A Generic Error in Occured in GDI+

December 8th, 2010 No comments
Number of View: 1542

I recently launched a new application that generates an image. In the app I created a custom image handler that returns a 2D barcode. The Handler used the System.Drawing class to generate the image. This all worked great locally on both Visual Studios Cassini and my local IIS box. However when I published the application to my server (win 2008) I was getting this obscure error “A generic error occurred in GDI+.”

What a great informative error. I did a quick google search only to find that this is a common issue. Many of the posts suggest this is a security issue, and that may be true is you were saving the image to a file structure. In my app, I am streaming the results out of memory back to the context in the handler, so it can display the image.

The offending line of code was:
context.Response.ContentType = "image/Jpeg";
System.Drawing.Image.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg)

I started looking at permissions, I assumed that since 90% of the fixes I read were done with permissions that this would be the simple answer. I was wrong, in my case permissions did not help. In a last ditch attempt I changed the image type. I was using System.Drawing.Image.ImageFormat.Jpeg I changed this to ImageFormat.Png.

This simple format change allowed the page to render on the server. I am not sure why the rendering of a jpg would be more of an issue than a PNG but I am ok with the result.

Fixed code
The offending line of code was:
context.Response.ContentType = "image/Png";
System.Drawing.Image.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Png)

If you are unfortunate enough to have this error I hope this post helps you. Good luck with the dreaded A generic error occurred in GDI+ error.

Setup VPN on DDWRT

November 4th, 2010 No comments
Number of View: 3075

I use DDWRT as my home router / firewall. It has some of the best features that can be found on a router. Visit DDWRT for more information.

I use the VPN when I am not in a trusted location. I have setup my iPhone, iPad, and computers to use this as my connection to the internet any time I am not at home. By having a secure connection I am comfortable using the web where ever I am. Connections from a non trusted connection, say a coffee shop wireless. Traffic from your computer is sent encrypted from the PC over the VPN to your home router, then out to the internet.

To setup the VPN on DDWRT you need to log into the admin section. Select SERVICES | VPN. You need to enable PPTP, Broadcast support, and Force MPPE Encryption.

The Server IP is the internal IP of your router (192.168.2.1 is what I use)
The Client IP(s) are the dynamic IP’s you want the connecting devices to use. I have set 192.168.2.200-220, this allows for 20 devices to connect and get IP’s.
CHAP-Secrets: the username / passwords for each user. Note the “*” after both the username and password.
Unless you have a Radius server keep that set to Disabled.

With DDWRT you can have a simple and easy VPN server setup at your home that allows you to connect securely back to your home or office. I often use my vpn to also remote take over machines at my house. I have my iPad configured to use this setting when ever I am on a non trusted connection.

Categories: .NET, Applications, iPad, iphone Tags: , , ,

Evernote – WPF to C++

October 27th, 2010 No comments
Number of View: 3388

I have used Evernote for quite a while, I ran into this blog post from a re-tweet on twitter.

It is a post from the EverNote team about re-writing their application in C++ from WPF

http://blog.evernote.com/2010/10/26/evernote-4-for-windows-is-here/

I find this interesting that a development team is moving away from WFP. I am not surprised that there are WPF performance issues, however I don’t this this is a knock on .NET.

Categories: .NET, Applications Tags:

Convert any Video Quickly to iPad

October 21st, 2010 No comments
Number of View: 762

Here is a great application to help quickly convert any video to another format ipad / iphone.

http://videoconverter.hamstersoft.com/

This simple application makes converting video easy enough my mother could do it. You drag a video into the main window and then start the video transformation process.

I love that you visually select the type of destination for you video.

So head on over and start the download.

Categories: .NET, Applications, iPad, Music, Podcast Tags: , ,

strong passwords – how to

October 19th, 2010 No comments
Number of View: 540

Here is a great video to instruct people on how to create a easy to remember strong password

Categories: .NET, Applications, Security Tags:

ASP.net Security Patch

September 30th, 2010 No comments
Number of View: 7314

The Microsoft team has put out a patch for the POET vunerablity in ASP.net.

http://weblogs.asp.net/scottgu/archive/2010/09/28/asp-net-security-update-now-available.aspx

This vulnerability allowed access to files on the server. This is very bad considering some of the files on an IIS server are not meant to be shared, in particular the web.config file. Prior to the patch there were some workarounds that would help stop this attack. URLscan modifications and also defining a custom error page.

Categories: .NET, Applications Tags:

IISreporter – new site

September 10th, 2010 No comments
Number of View: 646

There is a new site over at iisreporter.com. Check out the new look and feel and leave some comments or suggestions.

IISreporter is an application that shows you connections and information regarding IIS in real-time. It allows administrators to see how many people are currently connected to the server. It is available for free and can be downloaded at iisreporter.com/download

A new version is in the works that will list sites and the number of connections to each specific site. There is also a web based version that allows you to remotely view information and connections.