Monday, December 28, 2009

Ashik Iqbal's New Domain Name

www.ashik.info
Ashik Iqbal has introduced his new domain ashik.info. From now the http://ashikiqbal.blogspot.com is hosted in http://www.ashik.info. You all are requested to use www.ashik.info instead of the previous. Also you all are requested to send me mail to mail@ashik.info.

Best Regards,
Ashik Iqbal

Thursday, November 26, 2009

Eid Mubarak

Wishing you all a very happy Eid Mubarak.




But, please don't do this.

Wednesday, October 14, 2009

Get a Great Body in 5 Steps

Here are some interesting exercises that can be done at home easily without any equipment. Also you can do it wherever you want!

Do one to three sets of each exercise, with eight to 15 repetitions per set.

Step 1: The Warm Up

Leg lifts: Stand with your feet apart at hip width. Place your hands on your hips. Bend both knees slightly and shift most of your weight onto your left leg.

Keeping your knee slightly bent, lift your right leg up and out to the side, about six inches. Lower to the original position. Repeat with the right leg, then with the left.

Arm curls: Use hand weights or dumbbells. Hold a weight in each hand, arms at your sides, palms facing forward.

Stand with your feet apart at hip width, knees slightly bent. Curl the weights up to your shoulders, then lower to the original position.

Step 2: Stretch Exercises

Hamstring stretch: Lie on the floor and stretch your legs. Raise your left leg, using a towel to assist, until you feel the tension in your hamstring. Hold. Repeat on other side.

Inner thigh stretches: Sit on floor; place the soles of your feet together. Drop your knees toward floor. Gradually, lower your torso towards the floor until you feel a gentle tension in your inner thighs. Release.

Modified hurdler: Sit on floor, right leg extended, left foot against the right knee. Lower your torso and reach for your ankle until your hamstring feels tight. Repeat on other side.

Step 3: Floor Exercises

Crunches: Lie on the floor with your feet hip width apart. Cradle your head in your hands without lacing your fingers together and with your elbows pointed slightly inward.

Tilt your chin a little bit toward your chest and pull your abdominal muscles in. Exhale through your mouth as you curl your head, neck and shoulders up off the floor. Hold this position for a moment, then inhale as you return to your original position.

Squats: Stand tall with your feet apart at hip width, with your weight slightly back on your heels. Place your hands on your hips. Sit back and down as if you're sitting into a chair directly behind you. Lower as far as you can without leaning your upper body more than a few inches forward (this depends on your flexibility and your build).

If you can bend your knees far enough so that your thighs are parallel to the floor, stop. Don't allow your knees to travel out in front of your toes. Once you feel your upper body fold forward over your thighs, straighten your legs and stand up. Take care not to lock your knees as you complete the movement.

Push-ups: Lie on your stomach. Bend your knees and cross your ankles. Bend your elbows and place your palms on the floor, in front of your shoulders and a bit to the side. Straighten your arms and lift your body so you are balanced on your palms and knees.

Tuck your chin a few inches towards your chest so that your forehead faces the floor. Tighten your abdominal muscles. Bend your elbows and lower your entire body at once. Rather than trying to touch your chest to the floor, lower until your upper arms are parallel to the floor. Push back up.

Step 4: Stretching Exercises

Dips: Sit at the edge of the desk or on a sturdy chair. Place your hands with the palms facing your body. Slide yourself off the seat and support yourself with just with your hands. Slowly lower yourself by bending your elbows until your upper arms are parallel to the floor, and then press yourself back.

Lunges: Stretch your legs a stride's distance apart. Slowly bend your knees until you are in a kneeling position with your knees not quite touching the floor. Don't look down; don't allow your knees to shoot out past your toes. Return to your original position.

Step 5: Face Exercises

~ Tilt your head backwards. Let your upper lip cover your lower lip. Maintain the posture as you curl your tongue up inside the mouth and press it against your upper palette. Then smile.

~ This exercise helps to get rid of furrows and lines on the forehead. All you have to do is lift the eyebrows upward and open your eyes wider with each count.

~ Place the entire thumb inside your mouth, between the teeth of the upper jaw and the upper lip. Press the upper lip back into the teeth so that your thumb is squeezed.

Thursday, October 1, 2009

Split Function in Sql Server to break Comma-Separated Strings into Table

Sql Server does not (on my knowledge) have in-build Split function.

Split function in general on all platforms would have comma-separated string value to be split into individual strings.

In sql server, the main objective or necessary of the Split function is to convert a comma-separated string value (‘abc,cde,fgh’) into a temp table with each string as rows.

The below Split function is Table-valued function which would help us splitting comma-separated (or any other delimiter value) string to individual string.

CREATE FUNCTION dbo.Split(@String varchar(8000), @Delimiter char(1))
returns @temptable TABLE (items varchar(8000))
as
begin
declare @idx int
declare @slice varchar(8000)

select @idx = 1
if len(@String)<1 or @String is null return

while @idx!= 0
begin
set @idx = charindex(@Delimiter,@String)
if @idx!=0
set @slice = left(@String,@idx - 1)
else
set @slice = @String

if(len(@slice)>0)
insert into @temptable(Items) values(@slice)

set @String = right(@String,len(@String) - @idx)
if len(@String) = 0 break
end
return
end


Split function can be Used as

select * from Split('Orange,Red,Yellow,White,Black,,',',')


Above Split function can be used to pass parameter to IN clause in sql server.

Wednesday, September 30, 2009

How to Take Care of Your Wife

In the world, one single rule applies to the men: Make the Woman happy. Do something she likes, and you get points. Do something she dislikes and points are subtracted. You don't get any points for doing something she expects. Sorry, that's the way the game is played.


Here is a guide to the point system:


SIMPLE DUTIES
  • You make the bed (+1)
  • You make the bed, but forget the decorative pillow (0)
  • You throw the bedspread over rumpled sheets (-1)
  • You go out to buy her what she wants (+5)
  • In the rain (+8)
  • But return with Beer (-5)
  • You check out a suspicious noise at night (0)
  • You check out a suspicious noise, and it is nothing (0)
  • You check out a suspicious noise and it is something (+5)
  • You pummel it with iron rod (+10)
  • It's her pet (-10)

SOCIAL ENGAGEMENTS
  • You stay by her side the entire party (0)
  • You stay by her side for a while, then leave to chat with a college buddy (-2)
  • Named Tina (-4)
  • Tina is a dancer (-10)

HER BIRTHDAY
  • You take her out to dinner (0)
  • You take her out to dinner and it's not a sports bar (+1)
  • Okay, it's a sports bar (-2)
  • And it's all-you-can- eat night (-3)
  • It's a sports bar, it's all-you-can- eat night, and your face is painted the colors of your favorite team (-10)

A NIGHT OUT
  • You take her to a movie (+2)
  • You take her to a movie she likes (+4)
  • You take her to a movie you hate (+6)
  • You take her to a movie you like (-2)
  • It's called 'DeathCop' (-3)
  • You lied and said it was a foreign film about orphans (-15)

YOUR PHYSIQUE
  • You develop a noticeable potbelly (-15)
  • You develop a noticeable potbelly and exercise to get rid of it (+10)
  • You develop a noticeable potbelly and resort to baggy jeans and baggy Hawaiian shirts (-30)
  • You say, "It doesn't matter, you have one too." (-8000)

ENJOY THE 'BIG' QUESTION
  • She asks, "Do I look fat?" (-5) [Yes, you LOSE points no matter WHAT]
  • You hesitate in responding (-10)
  • You reply, "Where?" (-35)
  • Any other response (-20)

COMMUNICATION
  • When she wants to talk about a problem , you listen, displaying what looks like a concerned _____expression (0)
  • You listen, for over 30 minutes (+50)
  • You listen for more than 30 minutes without looking at the TV (+500)
  • She realizes this is because you have fallen asleep (-10000)

Monday, September 21, 2009

Tuesday, September 15, 2009

SQL DATEDIFF Function

Returns the number of date and time boundaries crossed between two dates.

SQL DATEDIFF Syntax
DATEDIFF ( DatePart , StartDate , EndDate )

DECLARE @StartDate DATETIME
DECLARE @EndDate DATETIME
SET @StartDate ='2007-06-05'
SET @EndDate ='2007-08-05'

SELECT DATEDIFF(Year, @StartDate, @EndDate) AS NewDate

Return Value = 0 Year

SELECT DATEDIFF(quarter, @StartDate, @EndDate) AS NewDate
Return Value = 1 quarter

SELECT DATEDIFF(Month, @StartDate, @EndDate) AS NewDate
Return Value = 2 Month

SELECT DATEDIFF(dayofyear,@StartDate, @EndDate) AS NewDate
Return Value = 61 day

SELECT DATEDIFF(Day, @StartDate, @EndDate) AS NewDate
Return Value = 61 Day

SELECT DATEDIFF(Week, @StartDate, @EndDate) AS NewDate
Return Value = 9 Week

SELECT DATEDIFF(Hour, @StartDate, @EndDate) AS NewDate
Return Value = 1464 Hour

SELECT DATEDIFF(minute, @StartDate, @EndDate) AS NewDate
Return Value = 87840 minute

SELECT DATEDIFF(second, @StartDate, @EndDate) AS NewDate
Return Value = 5270400 second

DECLARE @StartDate DATETIME
DECLARE @EndDate DATETIME
SET @StartDate ='2007-06-05'
SET @EndDate ='2007-06-06'

SELECT DATEDIFF(millisecond, @StartDate, @EndDate) AS NewDate

Return Value = 86400000 millisecond

Tuesday, August 25, 2009

10 Windows XP Services You Should Never Disable

1. DNS Client
If you stop this service, you will disable your computer’s ability to resolve names to IP addresses, basically rendering Web browsing all but impossible.

2: Network Connections
If this service is disabled, network configuration is not possible. New network connections can’t be created and services that need network information will fail.

3: Plug and Play
If you disable Plug and Play, your computer will be unstable and incapable of detecting hardware changes.

4: Print Spooler
When the Print Spooler service is not running, printing on the local machine is not possible. 5: Remote Procedure Call (RPC)Bad news. The system will not boot. Don’t disable this service.

6: Workstation
Disable the Workstation service and your computer will be unable to connect to remote Microsoft Network resources.

7: Network Location Awareness (NLA)
Your computer will not be able to fully connect to and use wireless networks. Problems abound!8: DHCP ClientWithout the DHCP Client service, you’ll need to manually assign static IP addresses to every Windows XP system on your network. If you use DHCP to assign other parameters, such as WINS information, you’ll need to provide that information manually as well.

9: Cryptographic Services
Disable Cryptographic Services at your peril! Automatic Updates will not function and you will have problems with Task Manager as well as other security mechanisms.

10: Automatic Updates
New security updates will not be automatically installed to your computer.

Wednesday, August 19, 2009

Convert String to System.Drawing.Color in ASPX C#

Here is a small example of how to convert a System.Drawing.Color to the HTML color format (Hex value or HTML color name value) and back.

System.Drawing.Color c = System.Drawing.ColorTranslator.FromHtml("#F5F7F8");
String strHtmlColor = System.Drawing.ColorTranslator.ToHtml(c);

Sunday, August 2, 2009

Happy Friendship Day 2009


Developing 100 Friends in 1 year is not a gain. But developing 1 Friend for 100 years is a great achievement. "Happy Friendship Day 2009"

Friday, July 31, 2009

Amazing Time & Date

On August 7, 2009

At 12hr 34 minutes and 56 seconds on the 7th of August 2009, the time and date was-

12:34:56 07/08/09
1 2 3 4 5 6 7 8 9

This will never happen in your life again??!!!!

Thursday, July 30, 2009

Show/Hide from JavaScript Code

To make a DIV visible or hidden from JavaScript use the code

<script type="text/javascript">
    var DivToApply = document.getElementById("Div1");
    DivToApply.style.visibility = "visible";
    DivToApply.style.visibility = "hidden";
</script>



Tuesday, July 14, 2009

Make a Checkbox Read-Only

To make a html input type checkbox readonly is not possible from its default properties. So we can just use this small tricks to make it read only.

<input type="checkbox" onClick="return false;" CHECKED />Readonly
<input type="checkbox" CHECKED DISABLED />Disabled

It looks like:


Tuesday, June 9, 2009

Speedup Mozilla Firefox Page Loading



Here's something for broadband people that will really speed Firefox up:

1. Type about:config into the address bar and hit return. Scroll down and look for the following entries:

network.http.pipelining
network.http.proxy.pipelining
network.http.pipelining.maxrequests

Normally the browser will make one request to a web page at a time. When you enable pipelining it will make several at once, which really speeds up page loading.

2. Alter the entries as follows:

Set network.http.pipelining to true

Set network.http.proxy.pipelining to true

Set network.http.pipelining.maxrequests to some number like 30. This means it will make 30 requests at once.

3. Lastly right-click anywhere and select New-> Integer. Name it nglayout.initialpaint.delay and set its value to 0 (zero). This value is the amount of time the browser waits before it acts on information it recieves.

If you're using a broadband connection you'll load pages MUCH faster now!


You have to close your browser after you make the changes. When you start it back up they will be in effect.

Thursday, May 21, 2009

How to get rid of the installer/configuration dialog when running Office 2007 and Office 2003 on the same system

After installing both Office 2007 and Office 2003 on same system you may face the problem of the following dialogs below every time you switch between Office 2007 Program and Office 2003 Program. Which is so disturbing and time killing.






Add the following Registry entries to solve the problem.


reg add HKCU\Software\Microsoft\Office\11.0\Word\Options /v NoReReg /t REG_DWORD /d 1

reg add HKCU\Software\Microsoft\Office\12.0\Word\Options /v NoReReg /t REG_DWORD /d 1

Just copy each line and paste in the RUN dialog (Win+R) and press OK.
After doing it if the dialogs appear further just continue the installing process for that time.
It will not shown again.

What’s New in SQL Server 2008


  • Transparent Data Encryption

    Enable encryption of an entire database, data files, or log files, without the need for application changes. Benefits of this include: Search encrypted data using both range and fuzzy searches, search secure data from unauthorized users, and data encryption without any required changes in existing applications.

  • Extensible Key Management

    SQL Server 2005 provides a comprehensive solution for encryption and key management. SQL Server 2008 delivers an excellent solution to this growing need by supporting third-party key management and HSM products.

  • Auditing

    Create and manage auditing via DDL, while simplifying compliance by providing more comprehensive data auditing. This enables organizations to answer common questions, such as, "What data was retrieved?"

  • Enhanced Database Mirroring

    SQL Server 2008 builds on SQL Server 2005 by providing a more reliable platform that has enhanced database mirroring, including automatic page repair, improved performance, and enhanced supportability.

  • Automatic Recovery of Data Pages

    SQL Server 2008 enables the principal and mirror machines to transparently recover from 823/824 types of data page errors by requesting a fresh copy of the suspect page from the mirroring partner transparently to end users and applications.

  • Log Stream Compression

    Database mirroring requires data transmissions between the participants of the mirroring implementations. With SQL Server 2008, compression of the outgoing log stream between the participants delivers optimal performance and minimizes the network bandwidth used by database mirroring.

  • Resource Governor

    Provide a consistent and predictable response to end users with the introduction of Resource Governor, allowing organizations to define resource limits and priorities for different workloads, which enable concurrent workloads to provide consistent performance to their end users.

  • Predictable Query Performance

    Enable greater query performance stability and predictability by providing functionality to lock down query plans, enabling organizations to promote stable query plans across hardware server replacements, server upgrades, and production deployments.

  • Data Compression

    Enable data to be stored more effectively, and reduce the storage requirements for your data. Data compression also provides significant performance improvements for large I/O bound workloads, like data warehousing.

  • Hot Add CPU

    Dynamically scale a database on demand by allowing CPU resources to be added to SQL Server 2008 on supported hardware platforms without forcing any downtime on applications. Note that SQL Server already supports the ability to add memory resources online.

  • Policy-Based Management

    Policy-Based Management is a policy-based system for managing one or more instances of SQL Server 2008. Use this with SQL Server Management Studio to create policies that manage entities on the server, such as the instance of SQL Server, databases, and other SQL Server objects.

  • Streamlined Installation

    SQL Server 2008 introduces significant improvements to the service life cycle for SQL Server through the re-engineering of the installation, setup, and configuration architecture. These improvements separate the installation of the physical bits on the hardware from the configuration of the SQL Server software, enabling organizations and software partners to provide recommended installation configurations.

  • Performance Data Collection

    Performance tuning and troubleshooting are time-consuming tasks for the administrator. To provide actionable performance insights to administrators, SQL Server 2008 includes more extensive performance data collection, a new centralized data repository for storing performance data, and new tools for reporting and monitoring.

  • Language Integrated Query (LINQ)

    Enable developers to issue queries against data, using a managed programming language, such as C# or VB.NET, instead of SQL statements. Enable seamless, strongly typed, set-oriented queries written in .NET languages to run against ADO.NET (LINQ to SQL), ADO.NET DataSets (LINQ to DataSets), the ADO.NET Entity Framework (LINQ to Entities), and to the Entity Data Service Mapping provider. Use the new LINQ to SQL provider that enables developers to use LINQ directly on SQL Server 2008 tables and columns.

  • ADO.NET Data Services

    The Object Services layer of ADO.NET enables the materialization, change tracking, and persistence of data as CLR objects. Developers using the ADO.NET framework can program against a database, using CLR objects that are managed by ADO.NET. SQL Server 2008 introduces more efficient, optimized support that improves performance and simplifies development.

  • DATE/TIME

    SQL Server 2008 introduces new date and time data types:

    • DATE—A date-only type

    • TIME—A time-only type

    • DATETIMEOFFSET—A time-zone-aware datetime type

    • DATETIME2—A datetime type with larger fractional seconds and year range than the existing DATETIME type

    The new data types enable applications to have separate data and time types while providing large data ranges or user defined precision for time values.

  • HIERARCHY ID

    Enable database applications to model tree structures in a more efficient way than currently possible. New system type HierarchyId can store values that represent nodes in a hierarchy tree. This new type will be implemented as a CLR UDT, and will expose several efficient and useful built-in methods for creating and operating on hierarchy nodes with a flexible programming model.

  • FILESTREAM Data

    Allow large binary data to be stored directly in an NTFS file system, while preserving an integral part of the database and maintaining transactional consistency. Enable the scale-out of large binary data traditionally managed by the database to be stored outside the database on more cost-effective storage without compromise.

  • Integrated Full Text Search

    Integrated Full Text Search makes the transition between Text Search and relational data seamless, while enabling users to use the Text Indexes to perform high-speed text searches on large text columns.

  • Sparse Columns

    NULL data consumes no physical space, providing a highly efficient way of managing empty data in a database. For example, Sparse Columns allows object models that typically have numerous null values to be stored in a SQL Server 2005 database without experiencing large space costs.

  • Large User-Defined Types

    SQL Server 2008 eliminates the 8-KB limit for User-Defined Types (UDTs), allowing users to dramatically expand the size of their UDTs.

  • Spatial Data Types

    Build spatial capabilities into your applications by using the support for spatial data.

    • Implement Round Earth solutions with the geography data type. Use latitude and longitude coordinates to define areas on the Earth's surface.

    • Implement Flat Earth solutions with the geometry data type. Store polygons, points, and lines that are associated with projected planar surfaces and naturally planar data, such as interior spaces.

  • Backup Compression

    Keeping disk-based backups online is expensive and time-consuming. With SQL Server 2008 backup compression, less storage is required to keep backups online, and backups run significantly faster since less disk I/O is required.

  • Partitioned Table Parallelism

    Partitions enable organizations to manage large growing tables more effectively by transparently breaking them into manageable blocks of data. SQL Server 2008 builds on the advances of partitioning in SQL Server 2005 by improving the performance on large partitioned tables.

  • Star Join Query Optimizations

    SQL Server 2008 provides improved query performance for common data warehouse scenarios. Star Join Query optimizations reduce query response time by recognizing data warehouse join patterns.

  • Grouping Sets

    Grouping Sets is an extension to the GROUP BY clause that lets users define multiple groupings in the same query. Grouping Sets produces a single result set that is equivalent to a UNION ALL of differently grouped rows, making aggregation querying and reporting easier and faster.

  • Change Data Capture

    With Change Data Capture, changes are captured and placed in change tables. It captures complete content of changes, maintains cross-table consistency, and even works across schema changes. This enables organizations to integrate the latest information into the data warehouse.

  • MERGE SQL Statement

    With the introduction of the MERGE SQL Statement, developers can more effectively handle common data warehousing scenarios, like checking whether a row exists, and then executing an insert or update.

  • SQL Server Integration Services (SSIS) Pipeline Improvements

    Data Integration packages can now scale more effectively, making use of available resources and managing the largest enterprise-scale workloads. The new design improves the scalability of runtime into multiple processors.

  • SQL Server Integration Services (SSIS) Persistent Lookups

    The need to perform lookups is one of the most common ETL operations. This is especially prevalent in data warehousing, where fact records need to use lookups to transform business keys to their corresponding surrogates. SSIS increases the performance of lookups to support the largest tables.

  • Analysis Scale and Performance

    SQL Server 2008 drives broader analysis with enhanced analytical capabilities and with more complex computations and aggregations. New cube design tools help users streamline the development of the analysis infrastructure enabling them to build solutions for optimized performance.

  • Block Computations

    Block Computations provides a significant improvement in processing performance enabling users to increase the depth of their hierarchies and complexity of the computations.

  • Writeback

    New MOLAP enabled writeback capabilities in SQL Server 2008 Analysis Services removes the need to query ROLAP partitions. This provides users with enhanced writeback scenarios from within analytical applications without sacrificing the traditional OLAP performance.

  • Enterprise Reporting Engine

    Reports can easily be delivered throughout the organization, both internally and externally, with simplified deployment and configuration. This enables users to easily create and share reports of any size and complexity.

  • Internet Report Deployment

    Customers and suppliers can effortlessly be reached by deploying reports over the Internet.

  • Manage Reporting Infrastructure

    Increase supportability and the ability to control server behaviour with memory management, infrastructure consolidation, and easier configuration through a centralized store and API for all configuration settings.

  • Report Builder Enhancements

    Easily build ad-hoc and author reports with any structure through Report Designer.

  • Forms Authentication Support

    Support for Forms authentication enables users to choose between Windows and Forms authentication.

  • Report Server Application Embedding

    Report Server application embedding enables the URLs in reports and subscriptions to point back to front-end applications.

  • Microsoft Office Integration

    SQL Server 2008 provides new Word rendering that enables users to consume reports directly from within Microsoft Office Word. In addition, the existing Excel renderer has been greatly enhanced to accommodate the support of features, like nested data regions, sub-reports, as well as merged cell improvements. This lets users maintain layout fidelity and improves the overall consumption of reports from Microsoft Office applications.

  • Predictive Analysis

    SQL Server Analysis Services continues to deliver advanced data mining technologies. Better Time Series support extends forecasting capabilities. Enhanced Mining Structures deliver more flexibility to perform focused analysis through filtering as well as to deliver complete information in reports beyond the scope of the mining model. New cross-validation enables confirmation of both accuracy and stability for results that you can trust. Furthermore, the new features delivered with SQL Server 2008 Data Mining Add-ins for Office 2007 empower every user in the organization with even more actionable insight at the desktop.

Source: http://msdotnetsupport.blogspot.com

Sunday, May 17, 2009

Java Script Trim Function

RIGHT TRIM
function RTrim(VALUE){
var w_space = String.fromCharCode(32);
var v_length = VALUE.length;
var strTemp = "";
if(v_length <>
return"";
}
var iTemp = v_length -1;

while(iTemp > -1){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(0,iTemp +1);
break;
}
iTemp = iTemp-1;
} //End While
return strTemp;
} //End Function


LEFT TRIM
function LTrim(VALUE){
var w_space = String.fromCharCode(32);
if(v_length <>
return"";
}
var v_length = VALUE.length;
var strTemp = "";
var iTemp = 0;

while(iTemp <>
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(iTemp,v_length);
break;
}
iTemp = iTemp + 1;
} //End While
return strTemp;
} //End Function


BOTH END TRIM
function Trim(TRIM_VALUE){
if(TRIM_VALUE.length <>
return"";
}
TRIM_VALUE = RTrim(TRIM_VALUE);
TRIM_VALUE = LTrim(TRIM_VALUE);
if(TRIM_VALUE==""){
return "";
}
else{
return TRIM_VALUE;
}
} //End Function

Some Regular Expression

using System.Text.RegularExpressions

Roman Numbers

string p1 = "^m*(d?c{0,3}|c[dm])(l?x{0,3}|x[lc])(v?i{0,3}|i[vx])";

string t1 = "vii"; Match m1 = Regex.Match(t1, p1);

Swapping First Two Words

string t2 = "the quick brown fox";

string p2 = @"(\S+)(\s+)(\S+)";

Regex x2 = new Regex(p2);

string r2 = x2.Replace(t2, "$3$2$1", 1);

Keyword = Value

string t3 = "myval = 3";

string p3 = @"(\w+)\s*=\s*(.*)\s*";;

Match m3 = Regex.Match(t3, p3);

Line of at Least 80 Characters

string t4 = "********************"

+ "******************************"

+ "******************************";

string p4 = ".{80,}";

Match m4 = Regex.Match(t4, p4);

MM/DD/YY HH:MM:SS

string t5 = "01/01/01 16:10:01";

string p5 = @"(\d+)/(\d+)/(\d+) (\d+):(\d+):(\d+)";

Match m5 = Regex.Match(t5, p5);

Changing Directories (for Windows)

string t6 = @"C:\Documents and Settings\user1\Desktop\";

string r6 = Regex.Replace(t6, @\\user1\\, @\\user2\\);

Expanding (%nn) Hex Escapes

string t7 = "%41"; // capital A

string p7 = "%([0-9A-Fa-f][0-9A-Fa-f])";

// uses a MatchEvaluator delegate

string r7 = Regex.Replace(t7, p7, HexConvert);

Deleting C Comments (Imperfectly)

string t8 = @"

/*

* this is an old cstyle comment block

*/

";

string p8 = @"

/\* # match the opening delimiter

.*? # match a minimal numer of chracters

\*/ # match the closing delimiter

";

string r8 = Regex.Replace(t8, p8, "", "xs");

Removing Leading and Trailing Whitespace

string t9a = " leading";

string p9a = @"^\s+";

string r9a = Regex.Replace(t9a, p9a, "");

string t9b = "trailing ";

string p9b = @"\s+";

string r9b = Regex.Replace(t9b, p9b, "");

Turning '\' Followed by 'n' Into a Real Newline

string t10 = @"\ntest\n";

string r10 = Regex.Replace(t10, @"\\n", "\n");

IP Address

string t11 = "55.54.53.52";

string p11 = "^" +

@"([01]?\d\d|2[0-4]\d|25[0-5])\." +

@"([01]?\d\d|2[0-4]\d|25[0-5])\." +

@"([01]?\d\d|2[0-4]\d|25[0-5])\." +

@"([01]?\d\d|2[0-4]\d|25[0-5])" ;

Match m11 = Regex.Match(t11, p11);

Removing Leading Path from Filename

string t12 = @"c:\file.txt";

string p12 = @"^.*\\";

string r12 = Regex.Replace(t12, p12, "");

Joining Lines in Multiline Strings

string t13 = @"this is

a split line";

string p13 = @"\s*\r?\n\s*";

string r13 = Regex.Replace(t13, p13, " ");

Extracting All Numbers from a String

string t14 = @"

test 1

test 2.3

test 47

";

string p14 = @"(\d+\.?\d*|\.\d+)";

MatchCollection mc14 = Regex.Matches(t14, p14);

Monday, May 11, 2009

What I want to mean by these Paintings? Try to invent.

(A)
(B)

(C)
I don't know why I made these three great paintings. Please try to invent the meanings from your point of view and post your opinions.

Sunday, May 10, 2009

Different Types of Marketting

  • You see a gorgeous girl at a party. You go up to her and say: "I am very rich. "Marry me!" - That's Direct Marketing... "

  • You're at a party with a bunch of friends and see a gorgeous girl. One of your friends goes up to her and pointing at you says: "He's very rich. "Marry him." -That's Advertising. .."

  • You see a gorgeous girl at a party. You go up to her and get her telephone number. The next day, you call and say: "Hi, I'm very rich. "Marry me - That's Telemarketing. .."

  • You're at a party and see gorgeous girl. You get up and straighten your tie, you walk up to her and pour her a drink, you open the door (of the car)"Marry Me?" - That's Public Relations... "

  • You're at a party and see gorgeous girl. She walks up to you and says:"You are very rich! "Can you marry ! me?" - That's Brand Recognition. .."

  • You see a gorgeous girl at a party. You go up to her and say: "I am very rich. Marry me!" She gives you a nice hard slap on your face. - "That's Customer Feedback..."

  • You see a gorgeous girl at a party. You go up to her and say: "I am very rich. Marry me!" And she introduces you to her husband. - "That's demand and supply gap..."

  • You see a gorgeous girl at a party. You go up to her and before you say anything, another person come and tell her: "I'm rich. Will you marry me?" and she goes with him - "That's competition eating into your market share..."

  • You see a gorgeous girl at a party. You go up to her and before you say: "I'm rich, Marry me!" your wife arrives. - "That's restriction for entering new markets..."

Sunday, April 12, 2009

JavaScript alert from UpdatePanel in ASPX (C#)

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "clientScript", "alert('Item saved successfully.')", true);

The last true is to add javascript tags.

Tuesday, January 6, 2009

Mobile Glossary

3G
3G Stands for 3rd-generation. Analog cellular phones were the first generation. Digital marked the second generation.
3G is loosely defined, but generally includes high data speeds, always-on data access, and greater voice capacity. The high data speeds are possibly the most prominent feature, and certainly the most hyped. They enable such advanced features as live, streaming video.
There are several different 3G technology standards. The most prevalent is UMTS, which is based on WCDMA. (WCDMA and UMTS are often used interchangeably.)

Alarm
An alarm feature which can be set for a specific time and date or can used as a daily alarm.
If the phone has a calendar feature, the alarm feature may be integrated with that (in some Motorola phones for example), so an alarm is simply a calendar event. Although some phones with a calendar feature also have a separate alarm feature.

Alphanumeric Display
A display capable of containing letters and numbers, but not graphics.

Bluetooth
A wireless personal area network (PAN) specification that connects phones, computers, appliances, etc. over short distances without wires by using low power radio frequencies.
Bluetooth allows you to leave your phone in your pocket, while talking on your phone with a Bluetooth headset - with no wires. You can also exchange contact or scheduling information with other Bluetooth-enabled phones nearby, or send such information to a nearby Bluetooth-enabled printer.

Calendar
Calendar feature allows you to store scheduling and event information in your phone. Some phones also offer the ability to sound an alert to remind you of upcoming events.

CDMA
Code Division Multiple Access. A type of digital wireless technology that allows large amounts of voice and data to be transmitted on the same frequency. CDMA is second-generation cellular technology (or 2G) and is available in Canada, the United States, Pacific Asia, and Latin America. Most CDMA service providers will migrate to a high-speed data technology called 1xRTT.
The CDMA phones are not listed on GSMArena.com.

Dual-band
Phones that can switch between two different bands of frequencies.
In Europe Dual-band usually means GSM900/GSM1800 capable phone, while in USA it might mean GSM850/GSM1900 or combination of two other bands.

EDGE
Enhanced Data rates for Global Evolution. A technology being promoted by the TDMA and GSM communities that is capable of both voice and 3G data rates up to 384 Kbps. The standard is based on GSM standard and uses TDMA multiplexing technology.

EMS
Enhanced Message Service. An extension of SMS that enables the sending of a combination of simple melodies, images, sounds, animations and formatted text as a message to another EMS-compatible phone

GPRS
General Packet Radio Service. A packet-switched technology that enables high-speed wireless Internet and other data communications. GPRS offers a tenfold increase in data speed over previous technologies, up to 115kbit/s (in theory). Typical real-world speeds are around 30-40 Kbps. Using a packet switching, subscribers are always connected and always on-line.
GPRS is considered a 2.5G technology.

GPS
Global Positioning System. A system of satellites, computers, and receivers that is able to determine the latitude and longitude of a receiver on Earth by calculating the time difference for signals from different satellites to reach the receiver.

GSM
Global System for Mobile communications. The international digital radio standard created by the European Telecommunications Standards Institute. GSM is currently the dominant 2G digital mobile phone standard for most of the world.

HSCSD
High Speed Circuit Switched Data. An enhancement to GSM networks that enables data speeds to be boosted from 9.6 kbps in multiples up to 57.6 kbps.

IMEI
International Mobile Equipment Identity. A unique serial number used on digital mobile phones.

Infared port (IrDA)
Allows cell phones, PDAs, and other devices to connect to each other for various purposes. Infrared is a wireless technology that uses a beam of invisible light to transmit information.

Java (J2ME)
Java 2 Micro Edition. A feature that allows the device to run specially-written applications. J2ME applications can provide specific functions such as a tip calulator, they can be games, or they can be custom-written corporate applications. Some phones allow you to download new applications directly from Internet while others require a data cable to transfer the applications from a PC.

LCD
Liquid Crystal Display. LCD displays utilize two sheets of polarizing material with a liquid crystal solution between them. An electric current passed through the liquid causes the crystals to align so that light cannot pass through them.
Monochrome LCDs in phones usually have both a backlight and a reflective backing, allowing them to be equally usable in both bright light and complete darkness.
Color LCDs come in many types. STN, TFT, and TFD are several common technologies used.

Li-Ion battery
Lithium-Ion type of battery, often used to power wireless communication devices. Considered superior to NiCd and NiMH batteries - they are lighter weight, have a relatively long cycle life and generally do not suffer from "memory" effect.

Li-Po battery
Lithium Polymer type of battery. Similar to Li-Ion batteries, but slightely lighter and the batteries can be molded to any shape.

MMS
Multimedia Messaging Service. A further extension of SMS and EMS. MMS is designed to make use of newer and quicker mobile transmission methods such as GPRS, HSCSD, EDGE and UMTS, involving the attachment of multimedia extensions to messages, such as video and sound.

OLED
Organic Light-Emitting Diode. A next-generation display technology that consists of small dots of organic polymer that emit light when charged with electricity. OLED displays are thinner, lighter, brighter, cheaper to manufacture and consume less power than the current LCD displays.

Polyphonic Ringtones
Polyphonic ringtones can create multiple tones simultaneously. This produces a more natural and realistic sound for melodies.

Predictive Text Input
A technology which allows you to enter text by pressing only one key per letter. The phone will automatically compare all of the possible letter combinations against a built-in dictionary of words. The current Predictive Text Input implementations are T9, iTAP and eZiText.

SIM
Subscriber Identity Module. The smart card used in digital phones. It carries the user's identity for accessing the network and receiving calls and also stores personal infromation, such as phone directory and received SMS messages.

SMS
Short Message Service. A service that enables subscribers to send short text messages (usually about 160 characters) to and from mobile phones.

Speakerphone
or Build-in Handsfree. Allows the phone to be used at a short distance, without the phone being held next to the face.

STN
Super Twisted Nematic. A type of LCD display technology. STN uses less power and is less costly than TFT technology, but at the expense of image quality and response time.

T9
Look at Predictive Text Input.

TFD
Thin Film Diode. A type of LCD display technology. TFD technology combines the excellent image quality and fast response times of TFT, with the low power consumption and low cost of STN.

TFT
Thin Film Transistor. A type of LCD display technology. Compared to other types of LCD technology, TFT features excellent image quality and response time, but uses more power, and is more expensive.

UMTS
Universal Mobile Telecommunications System. A third-generation (3G) wireless communications technology and the next generation of GSM. UMTS is a wireless standard approved by the International Telecommunications Union and is intended for advanced wireless communications.
UMTS uses WCDMA technology, and the two terms are often used interchangeably with each other.

Voice dial
A feature that allows a user to dial a phone number by spoken commands.

WCDMA
Wideband Code Division Multiple Access. An approved third-generation (3G) wireless standard which utilizes one 5 MHz channel for both voice and data, offering data speeds of 144 Kbps to 2 Mbps.

Source: http://www.gsmarena.com