Tuesday, December 20, 2011
LowProfileImageLoader and Windows Phone
Nice trick to help the Windows Phone 7 UI thread stay responsive by loading images in the background.
Link: http://blogs.msdn.com/b/delay/archive/2010/09/02/keep-a-low-profile-lowprofileimageloader-helps-the-windows-phone-7-ui-thread-stay-responsive-by-loading-images-in-the-background.aspx
DeferredLoadListBox and Windows Phone
Nice trick to help Windows Phone 7 lists scroll smoothly and consistently.
Link: http://blogs.msdn.com/b/delay/archive/2010/09/08/never-do-today-what-you-can-put-off-till-tomorrow-deferredloadlistbox-and-stackpanel-help-windows-phone-7-lists-scroll-smoothly-and-consistently.aspx
SimpleMembership and MVC3
A tutorial on how to use SimpleMembership in MVC3. Link: http://anderly.com/2011/08/11/using-simplemembership-in-mvc3/
Free eBook: OWASP Top 10 for .NET developers
OWASP stands for Open Web Application Security Project. A must-read for the new year. Link: http://www.troyhunt.com/2011/12/free-ebook-owasp-top-10-for-net.html
Monday, December 19, 2011
Thursday, December 8, 2011
Tuesday, November 15, 2011
Friday, November 11, 2011
Friday, October 28, 2011
My first iPhone/iPad app 'Nghe Si' is in the App Store
Nghe Si is an iOS/iPhone/iPad app enabling users to follow their favorite Vietnamese celebrities' latest updates including posts, photos, and videos.
Check it out: http://itunes.apple.com/us/app/nghe-si/id473961965?mt=8
Check it out: http://itunes.apple.com/us/app/nghe-si/id473961965?mt=8
Android MainHelloButton App
LinearLayout
Orientation horizontal
LinearLayout
layout_height wrap_content
layout_width fill_parent
orientation vertical
layout_gravity center
id blank
id @+id/myTextView
text @string/message_start
textColor @color/text_color
layout_margin 20dp
layout_height wrap_content
layout_width wrap_parent
layout_gravity center
src\MainHelloButton.java
import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;
import android.util.Log;
import android.view.View;
public class MainHelloButton extends Activity{
private int mPressCount;
private static final String TAG = "MainHelloButton";
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Button myButton = (Button) findViewById(R.id.my_button);
final TextView myTextView = (TextView) findViewById(R.id.my_text_view);
myButton.setOnClickListener(new View.OnClickListener(){
public void onClick(View v){
mPressCount++;
Resources res = getResources();
string msg = res.getString(R.string.message_format, mPressCount);
myTextView.setText(msg);
Log.d(TAG, "Log a button click press = " + mPressCount);
}
});
}
}
Change app icon in AndroidManifest.xml file
Log.d ~ debug
Log.wtf ~ what a terrible failure
Log.f ~ failure
Window -> Show View -> Other -> Android -> LogCat
Orientation horizontal
LinearLayout
layout_height wrap_content
layout_width fill_parent
orientation vertical
layout_gravity center
id blank
id @+id/myTextView
text @string/message_start
textColor @color/text_color
layout_margin 20dp
layout_height wrap_content
layout_width wrap_parent
layout_gravity center
src\MainHelloButton.java
import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;
import android.util.Log;
import android.view.View;
public class MainHelloButton extends Activity{
private int mPressCount;
private static final String TAG = "MainHelloButton";
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Button myButton = (Button) findViewById(R.id.my_button);
final TextView myTextView = (TextView) findViewById(R.id.my_text_view);
myButton.setOnClickListener(new View.OnClickListener(){
public void onClick(View v){
mPressCount++;
Resources res = getResources();
string msg = res.getString(R.string.message_format, mPressCount);
myTextView.setText(msg);
Log.d(TAG, "Log a button click press = " + mPressCount);
}
});
}
}
Change app icon in AndroidManifest.xml file
Log.d ~ debug
Log.wtf ~ what a terrible failure
Log.f ~ failure
Window -> Show View -> Other -> Android -> LogCat
Tuesday, October 25, 2011
Free Javascript and CSS E-books
Just for answering a few questions from SitePoint. Good stuff.
http://www.sitepoint.com/launch/2e46ac
http://www.sitepoint.com/launch/2e46ac
Monday, October 24, 2011
Thursday, October 20, 2011
ios AdMob
// Create a view of the standard size at the bottom of the screen.
GADRequest *request = [GADRequest request];
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){
bannerView_ = [[GADBannerView alloc]
initWithFrame:CGRectMake(20.0,
self.view.frame.size.height -
GAD_SIZE_728x90.height,
GAD_SIZE_728x90.width,
GAD_SIZE_728x90.height)];
}
else{
bannerView_ = [[GADBannerView alloc]
initWithFrame:CGRectMake(0.0,
self.view.frame.size.height -
GAD_SIZE_320x50.height,
GAD_SIZE_320x50.width,
GAD_SIZE_320x50.height)];
}
// Specify the ad's "unit identifier." This is your AdMob Publisher ID.
bannerView_.adUnitID = @"ADMOBID";
// Let the runtime know which UIViewController to restore after taking
// the user wherever the ad goes and add it to the view hierarchy.
bannerView_.rootViewController = self;
[self.view addSubview:bannerView_];
[self.view bringSubviewToFront:bannerView_];
// Initiate a generic request to load it with an ad.
[bannerView_ loadRequest:request];
GADRequest *request = [GADRequest request];
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){
bannerView_ = [[GADBannerView alloc]
initWithFrame:CGRectMake(20.0,
self.view.frame.size.height -
GAD_SIZE_728x90.height,
GAD_SIZE_728x90.width,
GAD_SIZE_728x90.height)];
}
else{
bannerView_ = [[GADBannerView alloc]
initWithFrame:CGRectMake(0.0,
self.view.frame.size.height -
GAD_SIZE_320x50.height,
GAD_SIZE_320x50.width,
GAD_SIZE_320x50.height)];
}
// Specify the ad's "unit identifier." This is your AdMob Publisher ID.
bannerView_.adUnitID = @"ADMOBID";
// Let the runtime know which UIViewController to restore after taking
// the user wherever the ad goes and add it to the view hierarchy.
bannerView_.rootViewController = self;
[self.view addSubview:bannerView_];
[self.view bringSubviewToFront:bannerView_];
// Initiate a generic request to load it with an ad.
[bannerView_ loadRequest:request];
iOS NSURLConnection
responseData = [[NSMutableData data] retain];
NSURLRequest *request = [NSURLRequest requestWithURL:
NSURLRequest *request = [NSURLRequest requestWithURL:
[NSURL URLWithString:@"http://www.url.com"]
cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
timeoutInterval:60.0];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
[connection start];
#pragma mark NSURLConnection delegate methods
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
[responseData setLength:0];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
[responseData appendData:data];
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
}
Wednesday, October 19, 2011
iOS how to display status bar vertically
[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeRight;
Thursday, October 6, 2011
R.I.P Steve Jobs
"Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose. You are already naked. There is no reason not to follow your hear." -1987
Source: http://jmak.tumblr.com/post/9377189056
Source: http://jmak.tumblr.com/post/9377189056
Monday, September 26, 2011
Trying out Linkedin Ads
Clicks: 22
Impressions: 165,863
Click Through Rate: 0.013%
Avg. Cost Per Click: $2.98
Total Spent: $65.56
Impressions: 165,863
Click Through Rate: 0.013%
Avg. Cost Per Click: $2.98
Total Spent: $65.56
Friday, August 19, 2011
Thursday, August 18, 2011
How to Increase Message Size Quota
Issue:
The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
Solution:
Increase the following properties in web.config
maxBufferSize="20000000"
maxBufferPoolSize="20000000"
maxReceivedMessageSize="20000000"
maxStringContentLength="20000000"
maxArrayLength="20000000"
The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
Solution:
Increase the following properties in web.config
maxBufferSize="20000000"
maxBufferPoolSize="20000000"
maxReceivedMessageSize="20000000"
maxStringContentLength="20000000"
maxArrayLength="20000000"
Second Day of Adwords Campaign
After one day of running Adwords campaign: 1359 impressions, 2 clicks, $.80
Wednesday, August 17, 2011
XigniteMetalsSoapClient
using RemoteMetals = NopSolutions.NopCommerce.Web.xMetalService;
private xMetalService.XigniteMetalsSoapClient proxy;
proxy = new xMetalService.XigniteMetalsSoapClient("XigniteMetalsSoap");
RemoteMetals.Header header = new RemoteMetals.Header();
header.Username = "xxxxx";
header.Password = "yyyyy";
RemoteMetals.LondonFixing objLondonFixing = proxy.GetLastLondonFixing(header, RemoteMetals.FixingTypes.LondonGold, RemoteMetals.FixingCurrencyTypes.USD);
chart = proxy.GetLondonFixingChart(header, RemoteMetals.FixingTypes.LondonGold, RemoteMetals.PeriodType.Morning, RemoteMetals.FixingCurrencyTypes.USD, "8/15/2010", "8/15/2011", RemoteMetals.StockChartStyles.Line, 600, 400);
if (objLondonFixing == null)
{
/// add error processing here
/// this condition could be caused by an HTTP error (404,500...)
Response.Write("Service is unavailable at this time.");
}
else
{
switch (objLondonFixing.Outcome)
{
case RemoteMetals.OutcomeTypes.Success:
/// add processing for displaying the results, e.g.
/// display the value for Value
/// other values could be consumed in the same manner
Response.Write(objLondonFixing.Value);
Response.Write(chart.Url);
break;
default:
/// add processing for handling request problems, e.g.
/// you could pass back the info message received from the service
Response.Write(objLondonFixing.Message);
break;
}
}
private xMetalService.XigniteMetalsSoapClient proxy;
proxy = new xMetalService.XigniteMetalsSoapClient("XigniteMetalsSoap");
RemoteMetals.Header header = new RemoteMetals.Header();
header.Username = "xxxxx";
header.Password = "yyyyy";
RemoteMetals.LondonFixing objLondonFixing = proxy.GetLastLondonFixing(header, RemoteMetals.FixingTypes.LondonGold, RemoteMetals.FixingCurrencyTypes.USD);
chart = proxy.GetLondonFixingChart(header, RemoteMetals.FixingTypes.LondonGold, RemoteMetals.PeriodType.Morning, RemoteMetals.FixingCurrencyTypes.USD, "8/15/2010", "8/15/2011", RemoteMetals.StockChartStyles.Line, 600, 400);
if (objLondonFixing == null)
{
/// add error processing here
/// this condition could be caused by an HTTP error (404,500...)
Response.Write("Service is unavailable at this time.");
}
else
{
switch (objLondonFixing.Outcome)
{
case RemoteMetals.OutcomeTypes.Success:
/// add processing for displaying the results, e.g.
/// display the value for Value
/// other values could be consumed in the same manner
Response.Write(objLondonFixing.Value);
Response.Write(chart.Url);
break;
default:
/// add processing for handling request problems, e.g.
/// you could pass back the info message received from the service
Response.Write(objLondonFixing.Message);
break;
}
}
Sunday, August 14, 2011
Wednesday, August 10, 2011
New C# 4.0 Features
Parameters
Co- and Contravariance
dynamic
New Compiler Options
- Optional
- Named
- Overload Resolution
Co- and Contravariance
- Covariance - same relationships
- Contracovariance - inverted relationships
dynamic
- run-time
- DLR - Dynamic Language Run-time
New Compiler Options
- Embedding COM Interop type information
- Specifying an app.config file to the C# compiler
Wednesday, August 3, 2011
Thursday, July 28, 2011
Tuesday, July 26, 2011
VS 2010's Own Dev Server Path
Instead of "C:\Windows\System32\inetsrv", go here: "C:\Program Files\Common Files\microsoft shared\DevServer\10.0".
Saturday, June 25, 2011
Tuesday, June 21, 2011
Wednesday, June 15, 2011
Some Good Links on Testing in TFS
patterns & practices: Team Development with Visual Studio Team Foundation Server
http://tfsguide.codeplex.com/releases/view/6280
Visual Studio UI Automation Testing (includes CodedUI)
http://social.msdn.microsoft.com/Forums/en-US/vsautotest/threads
How to: Create a Coded UI Test
http://msdn.microsoft.com/en-us/library/dd286681.aspx
How to: Generate a Coded UI Test by Recording the Application Under Test
http://msdn.microsoft.com/en-us/library/dd286608.aspx
How to: Create a Data-Driven Coded UI Test
http://msdn.microsoft.com/en-us/library/ee624082.aspx
Creating and Running Unit Tests for Existing Code
http://msdn.microsoft.com/en-us/library/dd293546.aspx
How to: Create a Data-Driven Unit Test
http://msdn.microsoft.com/en-us/library/ms182527.aspx
Walkthrough: Using a Configuration File to Define a Data Source
http://msdn.microsoft.com/en-us/library/ms243192.aspx
http://tfsguide.codeplex.com/releases/view/6280
Visual Studio UI Automation Testing (includes CodedUI)
http://social.msdn.microsoft.com/Forums/en-US/vsautotest/threads
How to: Create a Coded UI Test
http://msdn.microsoft.com/en-us/library/dd286681.aspx
How to: Generate a Coded UI Test by Recording the Application Under Test
http://msdn.microsoft.com/en-us/library/dd286608.aspx
How to: Create a Data-Driven Coded UI Test
http://msdn.microsoft.com/en-us/library/ee624082.aspx
Creating and Running Unit Tests for Existing Code
http://msdn.microsoft.com/en-us/library/dd293546.aspx
How to: Create a Data-Driven Unit Test
http://msdn.microsoft.com/en-us/library/ms182527.aspx
Walkthrough: Using a Configuration File to Define a Data Source
http://msdn.microsoft.com/en-us/library/ms243192.aspx
Tuesday, June 14, 2011
Client Network Utility
Checking 'Force protocol encryption' option in Client Network Utility allows new instance of SQL Server 2008 to start.
Free Pluralsight .NET Training - Introduction to WebMatrix
Pluralsight .NET Training - Introduction to WebMatrix
Learn from the experts how to use WebMatrix to build and customize web sites.
Course available at no cost for 48 hours through 6/15/2011.
http://www.pluralsight-training.net/microsoft/OLT/Course/Toc.aspx?n=webmatrix-introduction
Learn from the experts how to use WebMatrix to build and customize web sites.
Course available at no cost for 48 hours through 6/15/2011.
http://www.pluralsight-training.net/microsoft/OLT/Course/Toc.aspx?n=webmatrix-introduction
Thursday, June 9, 2011
ILDASM.EXE Tool
Run the ildasm.exe tool to determine the framework version of c:\dlls\TOBEREPLACED.dll.
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin>ildasm.exe c:\dlls\TOBEREPLACED.dll /meta[=MDHEADER] /text /noil
// Microsoft (R) .NET Framework IL Disassembler. Version 3.5.30729.1
// Copyright (c) Microsoft Corporation. All rights reserved.
// warning : THIS IS A PARTIAL DISASSEMBLY, NOT SUITABLE FOR RE-ASSEMBLING
// ================================= M E T A I N F O
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin>ildasm.exe c:\dlls\TOBEREPLACED.dll /meta[=MDHEADER] /text /noil
// Microsoft (R) .NET Framework IL Disassembler. Version 3.5.30729.1
// Copyright (c) Microsoft Corporation. All rights reserved.
// warning : THIS IS A PARTIAL DISASSEMBLY, NOT SUITABLE FOR RE-ASSEMBLING
// ================================= M E T A I N F O
Monday, June 6, 2011
Wednesday, June 1, 2011
Killer Combo: MacBook Pro + Virtual Box running Win 7 Ultimate
Now I can do iPhone and .NET development on the same machine. Sweet!
Missing Test DLLs
Added from:
C:\Program Files\Microsoft Visual Studio 9.0 Team Test Load Agent\LoadTest\Microsoft.VisualStudio.QualityTools.LoadTestFramework.dll
C:\Program Files\Microsoft Visual Studio 9.0 Team Test Load Agent\LoadTest\Microsoft.VisualStudio.QualityTools.WebTestFramework.dll
C:\Program Files\Microsoft Visual Studio 9.0 Team Test Load Agent\LoadTest\Microsoft.VisualStudio.QualityTools.LoadTestFramework.dll
C:\Program Files\Microsoft Visual Studio 9.0 Team Test Load Agent\LoadTest\Microsoft.VisualStudio.QualityTools.WebTestFramework.dll
Friday, May 27, 2011
Wednesday, May 18, 2011
Free VS 2010 Video Training
http://www.pluralsight-training.net/microsoft/OLT/Course/Toc.aspx?n=vs2010-moreintro
Using Visual Studio well is about more than writing code, or reading code written by others. To be truly productive, you need to debug well, and understand the designers that help you build your user interface. This course also shows you how to add helpful extensions that make Visual Studio even better.
Using Visual Studio well is about more than writing code, or reading code written by others. To be truly productive, you need to debug well, and understand the designers that help you build your user interface. This course also shows you how to add helpful extensions that make Visual Studio even better.
Thursday, May 12, 2011
Standard Windows Azure Rates
Standard Rates:
Windows Azure
Virtual Network***
Storage
Content Delivery Network (CDN)
SQL Azure
Business Edition
AppFabric
Service Bus
Caching****
Data Transfers
Asia Pacific Region
Inbound data transfers during off-peak times through June 30, 2011 are at no charge. Prices revert to our normal inbound data transfer rates after June 30, 2011.
Windows Azure
- Compute*
- Extra small instance**: $0.05 per hour
- Small instance (default): $0.12 per hour
- Medium instance: $0.24 per hour
- Large instance: $0.48 per hour
- Extra large instance: $0.96 per hour
Virtual Network***
- Windows Azure Connect - No charge during CTP
Storage
- $0.15 per GB stored per month
- $0.01 per 10,000 storage transactions
Content Delivery Network (CDN)
- $0.15 per GB for data transfers from European and North American locations
- $0.20 per GB for data transfers from other locations
- $0.01 per 10,000 transactions
SQL Azure
- Web Edition
- $9.99 per database up to 1GB per month
- $49.95 per database up to 5GB per month
Business Edition
- $99.99 per database up to 10GB per month
- $199.98 per database up to 20GB per month
- $299.97 per database up to 30GB per month
- $399.96 per database up to 40GB per month
- $499.95 per database up to 50GB per month
AppFabric
- Access Control
- No charge for billing periods before January 1, 2012
Service Bus
- $3.99 per connection on a “pay-as-you-go” basis
- Pack of 5 connections $9.95
- Pack of 25 connections $49.75
- Pack of 100 connections $199.00
- Pack of 500 connections $995.00
Caching****
- 128 MB cache for $45.00
- 256 MB cache for $55.00
- 512 MB cache for $75.00
- 1 GB cache for $110.00
- 2 GB cache for $180.00
- 4 GB cache for $325.00
Data Transfers
- North America and Europe regions
- $0.10 per GB in
- $0.15 per GB out
Asia Pacific Region
- $0.10 per GB in
- $0.20 per GB out
Inbound data transfers during off-peak times through June 30, 2011 are at no charge. Prices revert to our normal inbound data transfer rates after June 30, 2011.
Tuesday, April 12, 2011
Guestbook Sample App Solution Structure
Guestbook/
src/
...Java source code...
META-INF/
...other configuration...
war/
...JSPs, images, data files...
WEB-INF/
...app configuration...
lib/
...JARs for libraries...
classes/
...compiled classes...
New Course Silverlight 5 - FREE for next 24 hours (4/13)
New Course Silverlight 5 - FREE for next 24 hours
(free for 24 hrs starting Apr. 13, 2011!)
by Shawn Wildermuth
As the new version of Silverlight 5 has hit the interwebs, it's time for existing developers to learn what features can impact their projects. In this new course Shawn will show you the different areas of the new Silverlight 5 API's including: Data Binding changes, 3D support, performance improvements and elevated trust changes.
Watch What's new in Silverlight 5 FREE for the next 24 hours!
http://www.pluralsight-training.net/microsoft/olt/Course/Toc.aspx?n=silverlight5-new-features&utm_campaign=Newsletter&utm_medium=email&utm_source=VR
(free for 24 hrs starting Apr. 13, 2011!)
by Shawn Wildermuth
As the new version of Silverlight 5 has hit the interwebs, it's time for existing developers to learn what features can impact their projects. In this new course Shawn will show you the different areas of the new Silverlight 5 API's including: Data Binding changes, 3D support, performance improvements and elevated trust changes.
Watch What's new in Silverlight 5 FREE for the next 24 hours!
http://www.pluralsight-training.net/microsoft/olt/Course/Toc.aspx?n=silverlight5-new-features&utm_campaign=Newsletter&utm_medium=email&utm_source=VR
Sunday, April 3, 2011
Wednesday, March 30, 2011
Wednesday, March 23, 2011
Tuesday, March 15, 2011
Pluralsight: "ReSharper Fundamentals" - Free for 48hrs!
ReSharper Fundamentals Training - Free for 48hrs!
by James Kovacs - Released 10 March 2011
In the new course, ReSharper Fundamentals James Kovacs provides an introduction to JetBrains' ReSharper, a developer productivity tool for Visual Studio. James covers browsing, code cleanup, refactoring, coding assistance, microcode generation, templating, and a grab bag of other useful features. Both new and long-time users of ReSharper can learn a wealth of productivity enhancing tips from this course.
Watch ReSharper Fundamentals free for the next 48hrs!
http://www.pluralsight-training.net/microsoft/OLT/Course/Toc.aspx?n=resharperfundamentals
by James Kovacs - Released 10 March 2011
In the new course, ReSharper Fundamentals James Kovacs provides an introduction to JetBrains' ReSharper, a developer productivity tool for Visual Studio. James covers browsing, code cleanup, refactoring, coding assistance, microcode generation, templating, and a grab bag of other useful features. Both new and long-time users of ReSharper can learn a wealth of productivity enhancing tips from this course.
Watch ReSharper Fundamentals free for the next 48hrs!
http://www.pluralsight-training.net/microsoft/OLT/Course/Toc.aspx?n=resharperfundamentals
Tuesday, March 8, 2011
Free Test First Development Training
This is too good to not share. Hope you enjoy it.
http://www.pluralsight-training.net/microsoft/Find.aspx?f=Test+First&olt=true&h=True
http://www.pluralsight-training.net/microsoft/OLT/Course/Toc.aspx?n=test-first-development-1
http://www.pluralsight-training.net/microsoft/OLT/Course/Toc.aspx?n=test-first-development-2
http://www.pluralsight-training.net/microsoft/Find.aspx?f=Test+First&olt=true&h=True
http://www.pluralsight-training.net/microsoft/OLT/Course/Toc.aspx?n=test-first-development-1
http://www.pluralsight-training.net/microsoft/OLT/Course/Toc.aspx?n=test-first-development-2
Monday, February 28, 2011
Major Classic ASP to .NET Conversion Project Complete
Excited to say it's complete. Learned a lot through the process. Now moving on to the next project: eLetters and Search Tools.
Thursday, January 27, 2011
Friday, January 21, 2011
PHP and Facebook SDK
Found this nice tutorial http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/
Subscribe to:
Posts (Atom)