»
S
I
D
E
B
A
R
«
Setting Up an External Sheet 1
Jun 14th, 2009 by huyenttb

Creating an external CSS sheet

Advantages of an external style sheet is that as your site grows, you can make simple style changes in your style sheet and change the elements of all your pages. at once. It allows for uniformity of each page so that the user will always know they are on the same site. It hides some codes that make your html work including positioning, backgrounds, font colors and styles, and more.

To work with external style sheets you will need an HTML document to work in and a Cascading Style sheet.

1. Open your HTML document and set it in a view in your editor that you can see the source. In the head of your document place the following tag:

<link rel=”stylesheet” type=”text/css” href=”stylesheet.css”>

Example:

<html>
<head>
<title>My HTML Document</title>
<link rel=”stylesheet” type=”text/css” href=”stylesheet.css”>
</head>
<body>
</body>
</html>

2. Save your html and CSS and upload both to your web server. The reference for your CSS in your HTML is the relative or full URL link to it, so be sure they are placed in the correct locations. The above example indicated your CSS is in the same folder as the HTML doc.

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Digg
  • Diigo
  • Google Bookmarks
  • LinkedIn
  • Live
  • MySpace
  • Reddit
Export DataTable to XML to browser
Jun 10th, 2009 by huyntt

DataSet ds = new DataSet();
//fill test dataset data
ds.Tables.Add(“MyTable”);
ds.Tables[0].Columns.Add(“MyIDColumn”, typeof(int));
for (int i = 0; i < 100; i++)
ds.Tables[0].Rows.Add(i);

Response.Clear();
Response.ContentType = “text/xml”;

ds.WriteXml(Response.OutputStream);

Response.End();

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Digg
  • Diigo
  • Google Bookmarks
  • LinkedIn
  • Live
  • MySpace
  • Reddit
Who Has the Most Web Servers?
Jun 9th, 2009 by huyntt

There was a milestone buried deep within the earnings tables in this week’s first quarter results from Rackspace: the San Antonio company has become one of a select number of companies that have more than 50,000 servers. Rackspace reports that as of March 30 the company’s data centers house 50,038 servers, up from 47,518 at the end of 2008. Of the companies that publicly report their server counts, only European hosts 1&1 Internet and OVH have more than Rackspace. Here’s a look at some of the providers with high server counts, gleaned from public reports and partial data from a recent Netcraft server count report:

Of course, there are a number of providers who have at least 50,000 servers and don’t publish the information. Who else is in the club?

Read the rest of this entry »

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Digg
  • Diigo
  • Google Bookmarks
  • LinkedIn
  • Live
  • MySpace
  • Reddit
Using Microsoft IE Developer Toolbar
Jun 8th, 2009 by huyntt

Introduction

Say goodbye to Microsoft Explorer’s View Source, well almost. For those of us who do a lot of web development there has always been a need for a tool to examine the structure of documents we’re working on; introducing Microsoft IE Developer Toolbar. The IE Developer Toolbar allows web developers to examine and change website’s CSS, HTML, DOM, and JavaScript. Firefox web browser has enjoyed an excellent add-on, named Firebug, that provided this kind of functionality for some time now. This article, however, is not meant as a comparison between the two products. You may check Firebug if you’re interested. Also, check out Firebug Lite for ways to integrate Firebug with Internet Explorer.

Installing IE Developer Toolbar

  • Download the IE Developer Toolbar and run the installer.
  • Close an re-open the Internet Explorer.
  • Add the IE Developer Toolbar button to your toolbar
    introc1.gif
  • Then close the window
    introc2.jpg
  • The IE Developer Toolbar button will appear in your toolbar for easy access.
    introc3.jpg

Read the rest of this entry »

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Digg
  • Diigo
  • Google Bookmarks
  • LinkedIn
  • Live
  • MySpace
  • Reddit
PHP Cron Jobs with cPanel
Jun 6th, 2009 by huyntt

Running PHP scripts automatically can have some big benefits. You can wait to have things get done when there is less traffic on your server, or you can ensure daily tasks get done on time.

cPanel Simple Cron
Even if you do not know anything about cron jobs, and have never run a cron job before - you can get started with the simple cron tool built into cPanel. The url for it is:

https://www.yoursite.com:2083/frontend/x/cron/simplecron.html?

A few things you’ll need is the path to php and the path to the script that you’ll be running. You will need the full path to do this. If your path to PHP differs then the one below, then change it - otherwise keep it as is. Don’t know the path? This is most likely correct for you, just keep an eye out to see if the script does indeed run.

The command to run:
/usr/local/bin/php -f /home/(username)/public_html/(scriptname).php

Next you’ll want to select an option from all the select boxes. Remember to select an option in each box. If you want something to run every day at 4AM, select Minute: 0; Hour: 4; Day: Every; Month: Every; Weekday: Every;

Click save and you are all set! You’ll get an email every time the cron job runs, but if you don’t want to get it - put :blackhole: into the output email field at the top.

ChuyenTin Blog

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Digg
  • Diigo
  • Google Bookmarks
  • LinkedIn
  • Live
  • MySpace
  • Reddit
Limit a textarea to a maximum length
Jun 3rd, 2009 by huyntt

First technique, you validate on the submit the textarea length and return false if too long.

</code><SCRIPT LANGUAGE=&quot;JAVASCRIPT&quot;>
function checkLength(form){
if (form.description.value.length > 20){
alert(&quot;Text too long. Must be 20 characters or less&quot;);
return false;
}
return true;
}
</SCRIPT>

<FORM ACTION=&quot;...&quot; METHOD=&quot;...&quot; onSubmit=&quot;return checkLength(this)&quot;> 

Second technique, as you typed, the length is checked. If the input is too long then it is truncated.

<script>
function limitText(limitField, limitNum) {
if (limitField.value.length > limitNum) {
limitField.value = limitField.value.substring(0, limitNum);
}
}
</script>

<form name=&quot;myform&quot;>
textarea limit 20 chars :<br>
<textarea rows=&quot;5&quot; cols=&quot;30&quot; onKeyDown=&quot;limitText(this,20);&quot;
onKeyUp=&quot;limitText(this,20);&quot;>
</textarea><br>
</form>
Share and Enjoy:
  • Facebook
  • del.icio.us
  • Digg
  • Diigo
  • Google Bookmarks
  • LinkedIn
  • Live
  • MySpace
  • Reddit
Yahoo 360 chính thức khai tử từ 13/7
May 29th, 2009 by huyenttb

Ngay hôm nay, dù muốn nay không, các blogger cũng buộc phải dọn nhà vì từ 13/7 blog Yahoo 360 sẽ chính thức đóng cửa và được thay thế hoàn toàn bằng 360 plus.

Ông Vũ Minh Trí, Tổng giám đốc Yahoo Việt Nam cho biết: “Từ 1 năm qua, chúng tôi đã không còn đả động gì tới Yahoo 360 nên nhiều người dùng cảm thấy lỗi là đương nhiên. Trong vòng 48 tiếng nữa, các bogger sẽ nhận được thông báo trực tiếp về việc đóng cửa Yahoo 360 từ 13/7″.

Read the rest of this entry »

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Digg
  • Diigo
  • Google Bookmarks
  • LinkedIn
  • Live
  • MySpace
  • Reddit
5 Great Microsoft Web Services You Probably Don’t Use
May 29th, 2009 by huyenttb

Microsoft is so often the behemoth everyone loves to hate that people overlook the stuff it does right. We tried its newer Web services and found five gems.

Read the rest of this entry »

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Digg
  • Diigo
  • Google Bookmarks
  • LinkedIn
  • Live
  • MySpace
  • Reddit
Enum Programming with StrongEnum
May 7th, 2009 by huyntt

Introduction

Enums are great programming tools. They let you define groups of integral based constants that can be accessed elsewhere throughout your code in a strongly typed and symbolic fashion. The most obvious benefit of enums is their inherent catering to the rapid development model.

The Dilemma

The .NET library comes with a static class for enum management, System.Enum. Let’s interrogate the method declarations provided by Enum:

  • object Enum.Parse(type, string)
  • object Enum.ToObject(type, object)
  • string Enum.GetName(type, object)
  • string[] Enum.GetName(type)
  • Array Enum.GetValues(type)
  • bool Enum.IsDefined(type, object)
  • Type Enum.GetUnderlyingType(type)
  • string Enum.Format(type, value, string)

Despite the wonderful functionality System.Enum provides us, it is not without its drawbacks. The first thing you should notice is that each method requires you to pass the type of enum that you wish to reference — not the enum itself, but the type of the enum. This means you have to encase the enum name within the typeof() system method. The second thing you should notice is that the Parse and ToObject methods return a type of object — this would require us to perform an explicit cast on the returned object to transform it into the designated enum object. This explicit cast resolves into a non-type-safe expression, as well as extra processing overhead. Read the rest of this entry »

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Digg
  • Diigo
  • Google Bookmarks
  • LinkedIn
  • Live
  • MySpace
  • Reddit
TortoiseSVN source control software for Microsoft Windows
May 4th, 2009 by huyntt

TortoiseSVN is an easy to use SCM / source control software for Microsoft Windows and maybe the best standalone Subversion client there is. It is implemented as a Windows shell extension, which makes it integrate seamlessly into the Windows explorer. Since it’s not an integration for a specific IDE you can use it with whatever development tools you like.

Another advantage of this shell integration is that not only web or software developers can use it but all the people who don’t have the development tools installed, for example translators, doc writers etc.

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Digg
  • Diigo
  • Google Bookmarks
  • LinkedIn
  • Live
  • MySpace
  • Reddit
»  Substance: WordPress   »  Style: Ahren Ahimsa