Wednesday, December 22, 2010

Basic Question : What is HTML?

If we talk about web, we could not forget about HTML. So, what is HTML?
HTML stands for Hyper Text Markup Language. It's the main markup language for the web pages.
HTML elements are consist of tags (a word surrounded by angle brackets < and >). The tags in HTML usually come in a pair (start/opening tag and end/closing tag) eg.: <html></html>, <b></b>, etc. HTML element also have properties that usually we called with attributes. For list of elements and elements attributes you can find it here or here.

Here's some of example of simple HTML document:
------------------------------------------------------
<!doctype html>
<html>
  <head>
    <title>Hello HTML</title>
  </head>
  <body>
    <p>Hello World!</p>
  </body>
</html>
---------------------------------------
I think that' is for today, I hope you'll find it helpful. 
Please leave a comment below
Thank you..

Monday, December 20, 2010

Other links to access this blog

you can access my blog for shorter using the link below:
http://adf.ly/DcJO
and if you want to shorter your website URL use this link:
http://adf.ly/?id=186197

Basic Question : What is .NET framework?

Once upon a time, someone asked me, a simple question but it will be as hard as a calculus problem if we don't know what to say :). What is .NET framework? simple but deadly, huh. I turned my brain on to think about the best answer for that simple question. But, I didn't think my answer quite made him satisfied. What a shame for me, I have been using the.NET framework & C# language for 8 months and I didn't fully understand what .NET framework is.

Here's some of what I quoted from wikipedia for .NET framework definition:
"The Microsoft .NET Framework is a software framework for Microsoft Windows operating systems. It includes a large library, and it supports several programming languages which allows language interoperability (each language can utilize code written in other languages.) The .NET library is available to all the programming languages that .NET supports."

So, The .NET framework is created by Microsoft, and it'll help programmer to develop application rapidly because it provide a huge library (collection of usable code) and it support for any developer that have different skill of programming language (such as: VB.NET, C#, J#, etc) so that they can still use their skill for develop an application without worries about language boundary, because .NET framework will allow them to utilize code written in other languages (language interoperability). And that .NET library is available to all programming language.

Further more from wikipedia :
"The framework's Base Class Library provides user interface, data access, database connectivity, cryptography, web application development, numeric algorithms, and network communications. The class library is used by programmers, who combine it with their own code to produce applications.
Programs written for the .NET Framework execute in a software (as contrasted to hardware) environment, known as the Common Language Runtime (CLR). The CLR is an application virtual machine so that programmers need not consider the capabilities of the specific CPU that will execute the program. The CLR also provides other important services such as security, memory management, and exception handling. The class library and the CLR together constitute the .NET Framework."

Oh.. that's the base class of that huge .NET library offers for the developers. that CLR sure have a great important role in this .NET framework. It acts as a virtual machine that the written programs are executed in.

I think that's enough for the simple definition of .NET framework, but if you still curious about .NET framework, please search in google or wikipedia for the reference.

thank you for today...

if you find this post help you, please leave a comment below....

Sunday, December 19, 2010

Javascript Tips : Javascript numeric only for input type text (TextBox)

How to create javascript numeric only input text (TextBox)?
I have made some script to solve this problem:
Here's a full example below:
================================================================
<html>
   <head>
   <title>
   Test Numeric Only
   </title>
   <script language=Javascript>

      function numericOnly(evt)
      {
         var key = (evt.which) ? evt.which : event.keyCode
         if (key > 31 && (key < 48 || key > 57)){
            document.getElementById("LabelValid").style.display = "block";
            return false;
        }
         document.getElementById("LabelValid").style.display = "none";
         return true;
      }
   </script>
   </head>
   <body>
      Numeric Only : <input id="TextBoxChar" onkeypress="return numericOnly(event)" type="text" name="TextBoxChar">
      <label id="LabelValid" style="display:none">(*)</label>
   </body>
</html>
================================================================
The "numericOnly" function is called by onkeypress event attribute of the input text (TextBox). The "numericOnly" function will return false if the user type a non-numeric character in the textbox. and I have added a validation label that will show "(*)" if the user type a non-numeric character, and will disappear if the user type a numeric value.

If you find my post helpful, please leave a comment...

Thank you....

Friday, December 17, 2010

SQL Tips : SQL Server System Views - Searching tables that contain several columns name

Have you ever searching for tables that contain several column names? That would be a piece of cake job if you just have to look in small database with less than 100 tables. What if that database is in a gigantic size with about thousands of tables? I guess it'll be your nightmare jobs for you, don't you?

But, don't be afraid, I had had the same experience with you back then.
This morning, I had to find all tables that contain company code and location code within more than 2 thousands of tables in the SQL Server database system. Wow... that will be a pretty tough job if you don't know the trick...
Here is the secret: Have you ever heard SYSTEM VIEWS?

Yeah, SYSTEM VIEWS will give a huge help for you. System Views contain all object that reside within the database, such list of tables, columns, primary key, etc.

For example: you can get the list of tables inside your database by calling this statement :

SELECT * FROM SYS.TABLES
pretty neat don't you think?

and now, here the way I finish my job less than 1 minute:
SELECT * FROM SYS.TABLES
WHERE OBJECT_ID IN (SELECT A.OBJECT_ID FROM 
(SELECT * FROM SYS.COLUMNS
 WHERE NAME = 'COMPANY_CODE') A,
(SELECT * FROM SYS.COLUMNS
WHERE NAME = 'LOCATION_CODE') B
WHERE A.OBJECT_ID = B.OBJECT_ID)

Happy searching then...

Thursday, December 16, 2010

SQL Tips : Converting SQL Server Date time format

This morning, one of my friend asked me "how to convert SQL Server DateTime format into other format?".
 Example: from this 2010-12-17 (yyyy-mm-dd) format  into 17-DES-2010 (dd-Mon-yyyy) format.

and here's my answer:
SELECT UPPER(REPLACE(CONVERT(VARCHAR(11), GETDATE(), 106), ' ', '-')) AS [DD-Mon-YYYY]

and its worked well

Announcement : First post for my first blog (The Alpha post) - Diary of Programmer

Hello everybody,

This is my first post in this blog. In this blog I will share my daily experience as a programmer to help all of you if you experience the same problem like I did. If you find many grammatical, spelling, or meaning error in my post, please undertand since English is not my native language.


I think it's enough for this first post. See you ...

Text Editor Tips: Some Useful Brackets Extension

Brackets  is an open source and free-to-use text editor and primarily being used by web developers and designer. I mainly use Brackets for d...