<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Assist Programming</title>
	<link>http://www.assistprogramming.com</link>
	<description>Codding World</description>
	<pubDate>Mon, 16 Mar 2009 10:35:01 +0000</pubDate>
	<language>en</language>
			<item>
		<title>Password protecting pages with CodeIgniter</title>
		<link>http://php.AssistProgramming.com/password-protecting-pages-with-codeigniter.html</link>
		<pubDate>Mon, 16 Mar 2009 10:35:01 +0000</pubDate>
		<description><![CDATA[Recently, I was working on a CodeIgniter site for a customer. They wanted to go live with the site’s domain, but they wanted to hide everything on the site behind a very simple password that only the site owners would know. That way only the development team and a few internal stakeholders would have access.
Adding [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I was working on a CodeIgniter site for a customer. They wanted to go live with the site’s domain, but they wanted to hide everything on the site behind a very simple password that only the site owners would know. That way only the development team and a few internal stakeholders would have access.</p>
<p>Adding this kind of password protection is pretty easy in CodeIgniter. All you have to do is add a quick check in your main controller’s constructor to see if a session variable has been set. For example:</p>
<pre>class Welcome extends Controller {  function __construct(){

    parent::Controller();

    session_start();

<strong>if ($_SESSION[’loggedin’] != true){

      redirect(’protect/preview’,&#8217;refresh’);

    }</strong>

  }//end controller init

//rest of controller excised

}</pre>
<p>Create a second controller called protect.php and set up a preview() function inside of it. The preview() function checks to see if a POST has been passed to it. If it has, simply check to see if the string from the password field matches the secret password. In this case, we are hard-coding the password right in the controller, but you could just as easily grab it from an <acronym title='eXtensible Markup Language'><span class='caps'>XML</span></acronym> file or database table.</p>
<p>If the password matches, set the session value for loggedin to true, then send them back to the original welcome controller. Otherwise, show the view.</p>
<p>Here’s the protect controller:</p>
<pre>class Protect extends Controller {

  function __construct(){

    parent::Controller();

    session_start();

  }//end controller init  function preview(){

    if ($_POST){

      if (strtolower($this-&gt;input-&gt;post('pw')) == "mypassword"){

          $_SESSION['loggedin'] = true;

          redirect('welcome/index','refresh');

      }else{

        $this-&gt;session-&gt;set_flashdata('warning',"Wrong Password!");

        redirect('protect/preview','refresh');

      }

    }else{

      $data['title'] = "No sneak peeks allowed!";

      $this-&gt;load-&gt;vars($data);

      $this-&gt;load-&gt;view('preview_template');

    }

}

}//end class</pre>
<p>Finally, create a very simple preview_template view to hold the form and display any warning messages that are stored in CodeIgniter 1.6’s new flashdata component:</p>
<pre>  &lt;h1&gt;&lt;?php echo $title;?&gt;&lt;/h1&gt;

  &lt;p&gt;You have to login to see the site! Sorry about that.

  &lt;b style='color:red'&gt;

  &lt;?php echo $this-&gt;session-&gt;flashdata('warning');?&gt;

  &lt;/b&gt;&lt;/p&gt;  &lt;?php

  echo form_open('protect/preview');

  echo form_password('pw');

  echo form_submit('submit','get sneak peek');

?&gt;</pre>
<p>Source: blog.tripledogs.com/post/216</p>
]]></content:encoded>
			</item>
		<item>
		<title>Sending email using perl and sendmail.</title>
		<link>http://general-tips.AssistProgramming.com/sending-email-using-perl-and-sendmail.html</link>
		<pubDate>Thu, 12 Mar 2009 09:11:31 +0000</pubDate>
		<description><![CDATA[A very common task for a cgi script is to be able to inform a set of users with data generated by itself or other programs, cgi&#8217;s or not. For example, you might be one of the web designers who have joined one of the myriad of free counter programs on the internet that email [...]]]></description>
			<content:encoded><![CDATA[<p>A very common task for a cgi script is to be able to inform a set of users with data generated by itself or other programs, cgi&#8217;s or not. For example, you might be one of the web designers who have joined one of the myriad of free counter programs on the internet that email you with nice statistics and reports about your web pages&#8217; traffic. Systems like that are responsible for informing such a large number subscribers that sending the reports manually would require a full-time employee devoted to this task only. Obviously this wouldn&#8217;t be a sensible option even for a relatively large organization.</p>
<p>The way to automate this task is to let a perl program do those tedious bits of work for you. In this article we will build a perl script which does exactly that. We are going to go step by step giving explanations and analyzing the tricky parts.</p>
<p>Perl, being perl, provides the programmer with more than one ways to do same thing, sending email included. In this script we are going to use sendmail. Sendmail, is an open source program used on most unix computers and some nt workstations as well. Sendmail as its name implies has the ability to send email! We are going to use perl&#8217;s ability to open pipes to programs to run sendmail and feed it with input. If you are not familiar with sendmail it doesn&#8217;t really matter though; you should just understand that sendmail is able to send an email, with its headers and content, to your mail gateway which will in turn forward it to its recipient(s).</p>
<p>Here is a very simple program that emails a confirmation to a user that his/her request to subscribe to a newsletter has been accepted:</p>
<pre>
#!/usr/bin/perl -wuse strict;use <acronym title='Common Gateway Interface'><span class='caps'>CGI</span></acronym>;use Email::Valid;my $query    = new <acronym title='Common Gateway Interface'><span class='caps'>CGI</span></acronym>;# it is important to check the validity of the email address# supplied by the user both to catch genuine (mis-)typing errors 

# but also to avoid exploitation by malicious users who could 

# pass arbitrary strings to sendmail through the "send_to" 

# <acronym title='Common Gateway Interface'><span class='caps'>CGI</span></acronym> parameter - including whole email messages 

unless (Email::Valid-&gt;address($query-&gt;param('send_to'))) { 

  print $query-&gt;header; 

  print "You supplied an invalid email address."; 

  exit; 

} 

my $sendmail = "/usr/sbin/sendmail -t"; 

my $reply_to = "Reply-to: foo@bar.orgn"; 

my $subject  = "Subject: Confirmation of your submissionn"; 

my $content  = "Thanks for your submission."; 

my $to       = $query-&gt;param('send_to')."n"; 

my $file     = "subscribers.txt"; 

unless ($to) { 

  print $query-&gt;header; 

  print "Please fill in your email and try again"; 

} 

open (FILE, "&gt;&gt;$file") or die "Cannot open $file: $!"; 

print $to,"n"; 

close(FILE); 

my $send_to  = "To: ".$query-&gt;param('send_to'); 

open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!"; 

print SENDMAIL $reply_to; 

print SENDMAIL $subject; 

print SENDMAIL $send_to; 

print SENDMAIL "Content-type: text/plainnn"; 

print SENDMAIL $content; 

close(SENDMAIL); 

print $query-&gt;header; 

print "Confirmation of your submission will be emailed to you.";</pre>
<p><strong>A note about security</strong><br />
Before attempting to explain how the script works here is an important security note: always validate user supplied input. In the case of our <acronym title='Common Gateway Interface'><span class='caps'>CGI</span></acronym> mailer the &#8220;send_to&#8221; parameter comes from a user submitted form and hence could be exploited by a malicious party to pass arbitrary arguments to the sendmail program. To avoid this hazard we utilize the Email::Address module from CPAN to check the conformance of the supplied email address. If the address is invalid - because of a genuine typing error or an exploitation attempt - we return an error message. Otherwise, we proceed with emailing the confirmation using the technique described in the rest of this article.<br />
<strong>How the script works<br />
</strong>At first glance you can notice that this a relatively small program which if it wasn&#8217;t that verbose would be even smaller. Looking through it you will also see that it is very simple to understand even for the Perl beginner; however it more than fullfils the task of sending email.</p>
<p>Let&#8217;s have a look at it line by line&#8230; The cgi script takes its input from a web form. This hypothetical form consists one text input field:</p>
<pre>
&lt;FORM method="POST" action=<a href="http://assistprogramming.com/">http://assistprogramming.com</a>&gt;&lt;INPUT type=&#8221;text&#8221; name=&#8221;send_to&#8221;&gt;&lt;INPUT type=&#8221;submit&#8221;&gt; 

&lt;/FORM&gt;</pre>
<p>The script uses the <acronym title='Common Gateway Interface'><span class='caps'>CGI</span></acronym>.pm module to parse the form data. If you are not familiar with that module I suggest that you read and learn about it as it will make you life as a scripter a lot happier. The param() function provided by <acronym title='Common Gateway Interface'><span class='caps'>CGI</span></acronym>.pm returns the value of a form field given its name as an argument and that&#8217;s all you need to know for now; hence we use it in our script to find out what the user has entered in the text box. If the user has not entered anything the script returns an error message prompting the user to try again after filling in the appropriate text field.</p>
<p>If the user has entered an email address this is appended to a text file for later use by another program and then the script procedes to return a confirmation email to the user.</p>
<p>An email message consists of some headers and the content. There are many standard headers but the ones you will most commonly encounter and the one we use here are:</p>
<p><strong>To:</strong> A comma separated list of recipient addresses.<br />
<strong>From:</strong> The email address of the sender.<br />
<strong>Reply-to:</strong> The email address to whic replies should be sent.<br />
<strong>Subject:</strong> The subject of the message.<br />
<strong>Content-type:</strong> The MIME type of the content.</p>
<p>The headers precede the content of the message. The content type header is written just before the content and is followed by two newline characters.</p>
<p>Sendmail has the ability, as most unix programs, to read from standard input hence all we need to do is a open a pipe to it and provide it with the input we want it to process. You will notice that we have given the -t option to sendmail. This merely tells sendmail to scan the message for a To:, Cc: or Bcc: header and extract the list of recipients from there. Having opened the pipe succesfully we print the message to it. First the headers, each one followed by a newline character, the a newline by itself and finally the content of the message. Finally we close the pipe. The email has been succesfully sent!</p>
<p>Here is a list of useful things you can do by using sendmail and perl:</p>
<ul>
<li>Inform visitors of your site that have asked, that your site has been updated. The script used as an example here would be a good way to collect the addresses of the people you want to email.</li>
<li>Inform yourself of the way your scripts are running. For example you can write a few lines of code that email you when something goes wrong in a script that you &#8216;ve written.</li>
<li>Create an online mailing list.</li>
</ul>
<p>These are only some of the things you can do, but there is one thing you shouldn&#8217;t do, except if you are really nasty. That is, do not spam people. Never email people that have not asked for the information you are providing as it will probably make them angry and in the future they will ignore any that corespondence from you. Have fun and be polite!</p>
<p>Source <a rel="nofollow" href="http://www.perlfect.com/articles/sendmail.shtml">http://www.perlfect.com/articles/sendmail.shtml</a></p>
]]></content:encoded>
			</item>
		<item>
		<title>TierDeveloper 6.1 becomes Free Software</title>
		<link>http://asp-dot-net.AssistProgramming.com/tierdeveloper-61-becomes-free-software.html</link>
		<pubDate>Tue, 10 Mar 2009 20:38:25 +0000</pubDate>
		<description><![CDATA[SUMMARY:
Alachisoft has released TierDeveloper 6.1 as free software (previous version priced at $1495/developer). TierDeveloper is a leading Object-Relational Mapping (ORM) Code Generator for .NET. It lets you develop complex object oriented applications in no time without compromising on code quality.
DESCRIPTION:
Alachisoft has released TierDeveloper 6.1 as free software (previous version priced at $1495/developer). TierDeveloper is a [...]]]></description>
			<content:encoded><![CDATA[<p>SUMMARY:<br />
Alachisoft has released TierDeveloper 6.1 as free software (previous version priced at $1495/developer). TierDeveloper is a leading Object-Relational Mapping (ORM) Code Generator for .NET. It lets you develop complex object oriented applications in no time without compromising on code quality.<br />
DESCRIPTION:<br />
Alachisoft has released TierDeveloper 6.1 as free software (previous version priced at $1495/developer). TierDeveloper is a leading Object-Relational Mapping (ORM) Code Generator for .NET. It lets you develop complex object oriented applications in no time without compromising on code quality.</p>
<p>TierDeveloper lets you develop major chunks of your .NET applications in matter of hours and days instead of weeks and months. And, the unlike ORM engines (e.g. NHibernate) that do mapping at runtime, TierDeveloper does mapping at compile time and therefore the generated code runs very fast.<br />
TierDeveloper is one of the most feature-rich ORM code generators in the market. It provides you the following:</p>
<p>- Map and generate well designed .NET persistence and domain objects in C# and VB.NET - Generate web services and WCF server layers and proxy client objects - Design and generate custom ASP.NET and Windows Forms GUI seamlessly - Generate code that is integrated with NCache (a leading distributed cache for .NET) - Powerful Template IDE to let you customize existing or write new code generation templates - Support for iterative round-trip development without losing any code changes - Full support for .NET 2.0/3.5 and Visual Studio 2005/2008</p>
<p>TierDeveloper is free software (not a trial).</p>
<p>Download TierDeveloper 6.1 Free Edition http://www.alachisoft.com/rp.php?dest=/download.html</p>
<p>TierDeveloper 6.1 Free Edition Information http://www.alachisoft.com/rp.php?dest=/tdev/index.html</p>
]]></content:encoded>
			</item>
		<item>
		<title>Javascript broken in Firefox</title>
		<link>http://general-tips.AssistProgramming.com/javascript-broken-in-firefox.html</link>
		<pubDate>Sat, 23 Aug 2008 05:10:57 +0000</pubDate>
		<description><![CDATA[I&#8217;ve struggled quite much time to find out why my Firefox was giving errors in CMS, where the rich editor was working before I do any mods to it. Was pretty strange but hard to fix because I&#8217;ve tried to Google on solutions related to that specific CMS ( Drupal, we love Drupal here as [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve struggled quite much time to find out why my Firefox was giving errors in <acronym title='Content Management System'><span class='caps'>CMS</span></acronym>, where the rich editor was working before I do any mods to it. Was pretty strange but hard to fix because I&#8217;ve tried to Google on solutions related to that specific <acronym title='Content Management System'><span class='caps'>CMS</span></acronym> ( Drupal, we love Drupal here as well as Wordpress).</p>
<p>My JS console was showing the above errors</p>
<pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 50px; text-align: left">replace_element.insertAdjacentHTML is not a function       tiny_mce.js (line 1)

this.contentWindow has no properties            tiny_mce.js (line 1)</pre>
<p>So it was something related to tinymce. Well that was my problem but for the same reason you might encounter another error&#8230;So, what&#8217;s the fix for this problem?</p>
<p>Since last time this tinymce worked I did one change to Firefox indeed. I&#8217;ve changed the user agent and looks like that broke the JavaScript.</p>
<p>So, if you have this problem, type <strong>about:config</strong> in your Firefox and search for <strong>general.useragent.extra.firefox. </strong>Make sure this has a value something like this <strong>Firefox/2.0.0.1. </strong>Also, lookup for <strong>general.useragent.override </strong>and make sure it has an empty value. If you can&#8217;t find this last one than there&#8217;s no problem.</p>
<p>Hope this helped somebody out there!</p>
<p>Thanks for reading <img src='http://www.assistprogramming.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
			</item>
		<item>
		<title>Simple Mail Transfer Protocol(SMTP)</title>
		<link>http://protocol-tips.AssistProgramming.com/simple-mail-transfer-protocolsmtp.html</link>
		<pubDate>Sat, 23 Aug 2008 05:02:09 +0000</pubDate>
		<description><![CDATA[About SMTP
SMTP it&#8217;s a simple protocol used for sending electronic messages on internet.SMTP use the 25 TCP port and obtain  the address of a SMTP sever using a MX(Mail Exchange) record from the DNS server configuration.
The SMTP protocol specify the way that a electronic message is transfered between SMTP process that are on different [...]]]></description>
			<content:encoded><![CDATA[<h2>About SMTP</h2>
<p>SMTP it&#8217;s a simple protocol used for sending electronic messages on internet.SMTP use the 25 <acronym title='Transmission Control Protocol'><span class='caps'>TCP</span></acronym> port and obtain  the address of a SMTP sever using a MX(Mail Exchange) record from the <acronym title='Domain Name System'><span class='caps'>DNS</span></acronym> server configuration.</p>
<p>The SMTP protocol specify the way that a electronic message is transfered between SMTP process that are on different systems.The SMTP process that initiate the transfer is called client and the SMTP process that receive that process is called SMTP server. It&#8217;s not so important here the way that the message is sent from the client to the server or the way that the server send the message to destination.</p>
<h2>History</h2>
<p>SMTP protocol was used especially at the begin of &#8216;80 years. That tine it was used less than UUCP(Unix to Unix CoPy) because that was just perfect for sending messages between systems permanently connected. Anyway SMTP works better for sending electronic messages when the client and the server are permanently connected to a network. First program that implemented the SMTP protocol was Sendmail. From 2001 on there was other programs that implemented that protocol: Postfix, Qmail, Novell, GroupWise, Exim, NetMail and Microsoft_Exchange_Server.</p>
<h2>How it works&#8230;</h2>
<p>Communications between client and server is done using ASCII texts.Initially the client establish the connection with the server and wait for server responding with “220 Service Ready”. From any reasons the server can send this message lately.When the client receive that 220 message he sent a HELLO command and that way he is unfolding his identity.When the connection was establish the client can send one or more messages, can close the connection or can user other services like verifying the mail adress. The server must respond after each command indicating this way that the command was accepted or if there are errors.</p>
<p>For sending a message the client use the MAIL command for specifying the client address. If this command is ok the server respond with &#8220;250 ok&#8221; message. Then the client send RCPT command for specifying the receiver address. The server respond with “550 No such user here”, or “250 OK”, depending by command validity.When the server accept the command the client send DATA command and that means that the client is starting sending the message content.In this moment server can respond with &#8220;503 Command out of sequence&#8221; or &#8220;554 No valid recipients&#8221; message. If server respond with “354 Start mail input” message then the client can start sending the message content. The end of the message will be tagged by &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;.</p>
<p>A SMTP sever must know:</p>
<p>- HELO - the client identity</p>
<p>- EHLO - client identity by large request</p>
<p>- MAIL FROM - client specification</p>
<p>- RCPT TO - receiver specification</p>
<p>- DATA -  message content</p>
<p>- RSET - reset</p>
<p>- QUIT  -finish the session</p>
<p>- HELP - help for command</p>
<p>- VRFY - verifying an address</p>
<p>- EXPN - expanding an address</p>
<p>- VERB - detailed informations</p>
<p>The function of the SMTP protocol can be tested by initiating a <acronym title='Transmission Control Protocol'><span class='caps'>TCP</span></acronym> connection using a telnet client:</p>
<pre>telnet mailhost.domeniu.ro 25
Server: 220 mailhost.domeniu.ro ESMTP
Client: HELO host.domeniu.ro
Server: 250 Hello host.domeniu.ro
Client: MAIL FROM: user@domeniu.ro
Server: 250 Ok
Client: RCPT TO: user@altdomeniu.ro
Server: 250 Ok
Client: DATA
Server: 354 End data with &lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;
Client: Subject: test
Client: un mesaj test
Client: .
Server: Mail queued for delivery.
Client: QUIT
Server: 221 Closing connection. Bye.</pre>
]]></content:encoded>
			</item>
		<item>
		<title>How to connect to an SQL database with JDBC</title>
		<link>http://java.AssistProgramming.com/how-to-connect-to-an-sql-database-with-jdbc.html</link>
		<pubDate>Fri, 20 Jun 2008 15:42:38 +0000</pubDate>
		<description><![CDATA[About JDBC
If you have java applets or other java applications and you want to connect them with standard SQL  databases like SLQ Server, Oracle, Informix, Sybase and others JDBC is the one who can help you to do that.The combination of Java&#8217;s JDBC and standard SQL makes a simple and powerful database solution. Using [...]]]></description>
			<content:encoded><![CDATA[<h2>About <acronym title='Java DataBase Connectivity'><span class='caps'>JDBC</span></acronym></h2>
<p>If you have java applets or other java applications and you want to connect them with standard <acronym title='Structured Query Language'><span class='caps'>SQL</span></acronym>  databases like SLQ Server, Oracle, Informix, Sybase and others <acronym title='Java DataBase Connectivity'><span class='caps'>JDBC</span></acronym> is the one who can help you to do that.The combination of Java&#8217;s <acronym title='Java DataBase Connectivity'><span class='caps'>JDBC</span></acronym> and standard <acronym title='Structured Query Language'><span class='caps'>SQL</span></acronym> makes a simple and powerful database solution. Using <acronym title='Java DataBase Connectivity'><span class='caps'>JDBC</span></acronym> things are easy without making the complex tasks too difficult either.</p>
<p>During this article we&#8217;ll teach you haw to establish a connection between your java applications and <acronym title='Structured Query Language'><span class='caps'>SQL</span></acronym> data base and we&#8217;ll do that step-by-step to understand better.</p>
<h2>Obtaining the <acronym title='Java DataBase Connectivity'><span class='caps'>JDBC</span></acronym> driver</h2>
<p>For using <acronym title='Java DataBase Connectivity'><span class='caps'>JDBC</span></acronym> you need to install the JAVA JDK. If you don&#8217;t have it already installed you  can download it(free)  at  <a rel="nofollow" href="http://java.sun.com/">Sun&#8217;s Java web site </a>.Also many IDE&#8217;s have already integrated it so you have nothing more to do just to use.Next thing you have to do is to obtain correctly the <acronym title='Java DataBase Connectivity'><span class='caps'>JDBC</span></acronym> driver.In most cases the <acronym title='Java DataBase Connectivity'><span class='caps'>JDBC</span></acronym> driver will be provided by your database vendor.Once you have this driver you have to install it.</p>
<h2>Establishing a connection is a two-step process</h2>
<p>If you installed the <acronym title='Java DataBase Connectivity'><span class='caps'>JDBC</span></acronym> driver correctly it&#8217;s very easy to establish the connection between java application and the <acronym title='Structured Query Language'><span class='caps'>SQL</span></acronym> database. So for establishing that connection you have to follow the next two steps:</p>
<p>- Load the <acronym title='Java DataBase Connectivity'><span class='caps'>JDBC</span></acronym> driver.</p>
<p>- Establish the connection.</p>
<p>For undestanding better what you have to do we give you an example:</p>
<pre>
<ul><tt>//  Establish a connection to a <font color="#000099">mSQL</font> database using <acronym title='Java DataBase Connectivity'><span class='caps'>JDBC</span></acronym>.</tt><tt>import java.sql.*;</tt><tt>class JdbcTest1 {</tt><tt>    </tt><tt>    public static void main (String[] args) {</tt><tt>        try {</tt><tt>            // <strong>Step 1: Load the <acronym title='Java DataBase Connectivity'><span class='caps'>JDBC</span></acronym> driver.</strong></tt>

<tt>            Class.forName(&#8221;<font color="#000099">com.imaginary.sql.msql.MsqlDriver</font>&#8220;);</tt>

<tt>            // <strong>Step 2: Establish the connection to the database.</strong></tt>

<tt>            String url = &#8220;<font color="#000099">jdbc:msql://www.myserver.com:1114/contact_mgr</font>&#8220;;</tt>

<tt>            Connection conn = DriverManager.getConnection(url,&#8221;user1&#8243;,&#8221;password&#8221;);</tt>

<tt>        } catch (Exception e) {</tt>

<tt>            System.err.println(&#8221;Got an exception! &#8220;);</tt>

<tt>            System.err.println(e.getMessage());</tt>

<tt>        }</tt>

<tt>    }</tt>

<tt>}</tt></ul>
</pre>
<h4>The <acronym title='Java DataBase Connectivity'><span class='caps'>JDBC</span></acronym> Driver</h4>
<p>The name of the <acronym title='Java DataBase Connectivity'><span class='caps'>JDBC</span></acronym> driver will be supplied to you by your database<br />
vendor. As you can see in the <code>class.forName()</code> statements, these<br />
names will vary.</p>
<h4>The <acronym title='Uniform Resource Locator'><span class='caps'>URL</span></acronym></h4>
<p>The syntax of the DriverManager.getConection() method is: DriverManager.getConnection(String url, String username, String password);</p>
<p>Username and password are used for login to the data base.</p>
]]></content:encoded>
			</item>
		<item>
		<title>How to upload files in .NET programing?</title>
		<link>http://asp-dot-net.AssistProgramming.com/how-to-upload-files-in-net-programing.html</link>
		<pubDate>Thu, 12 Jun 2008 04:28:28 +0000</pubDate>
		<description><![CDATA[General things
The first version of Microsoft ASP.NET was 1.0. Since then the team worked for introducing possibilities to create web applications that had the ability to upload files to the hosting server. This was done through the use of the FileField HTML server control. Now we refer to the 2.0 version of ASP.NET.This article try [...]]]></description>
			<content:encoded><![CDATA[<h2>General things</h2>
<p>The first version of Microsoft ASP.NET was 1.0. Since then the team worked for introducing possibilities to create web applications that had the ability to upload files to the hosting server. This was done through the use of the <strong>FileField</strong> <acronym title='HyperText Markup Language'><span class='caps'>HTML</span></acronym> server control. Now we refer to the 2.0 version of ASP.NET.This article try to introduce you to the new <strong>FileUpload</strong> server control.</p>
<h2>FileUpload Server Control Example</h2>
<p>If  you want to use the FileField control in ASP.NET 1.<em>x</em> version you must know that you had to take a few extra steps to get everything in line and working. In ASP .NET 2.0 version things are ease to be done. The new version of FileUpload  server control makes the process of uploading files to the hosting server as simple as possible.</p>
<p>I will show you how to use the FileUpload control to upload files to the server. Here are two examples of using FileUploade: one of them is wrote in Microsoft Visual Basic and the other one in Microsoft Visual C#:</p>
<p><strong>Visual Basic Example:</strong></p>
<pre>&lt;%@ Page Language="VB" %&gt;

&lt;script runat="server"&gt;
    Protected Sub Button1_Click(ByVal sender As Object, _
      ByVal e As System.EventArgs)
        If FileUpload1.HasFile Then
            Try
                FileUpload1.SaveAs("C:Uploads\" &amp; _
                   FileUpload1.FileName)
                Label1.Text = "File name: " &amp; _
                   FileUpload1.PostedFile.FileName &amp; "&lt;br&gt;" &amp; _
                   "File Size: " &amp; _
                   FileUpload1.PostedFile.ContentLength &amp; " kb&lt;br&gt;" &amp; _
                   "Content type: " &amp; _
                   FileUpload1.PostedFile.ContentType
            Catch ex As Exception
                Label1.Text = "ERROR: " &amp; ex.Message.ToString()
            End Try
        Else
            Label1.Text = "You have not specified a file."
        End If
    End Sub
&lt;/script&gt;

&lt;html  &gt;
&lt;head runat="server"&gt;
    &lt;title&gt;Upload Files&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
        &lt;asp:FileUpload ID="FileUpload1" runat="server" /&gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;asp:Button ID="Button1" runat="server" OnClick="Button1_Click"
         Text="Upload File" /&gt; &lt;br /&gt;
        &lt;br /&gt;
        &lt;asp:Label ID="Label1" runat="server"&gt;&lt;/asp:Label&gt;&lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong>Visual C# Example:</strong></p>
<pre>&lt;%@ Page Language="C#" %&gt;

&lt;script runat="server"&gt;
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile)
            try
            {
                FileUpload1.SaveAs("C:Uploads\" +
                     FileUpload1.FileName);
                Label1.Text = "File name: " +
                     FileUpload1.PostedFile.FileName + "&lt;br&gt;" +
                     FileUpload1.PostedFile.ContentLength + " kb&lt;br&gt;" +
                     "Content type: " +
                     FileUpload1.PostedFile.ContentType;
            }
            catch (Exception ex)
            {
                Label1.Text = "ERROR: " + ex.Message.ToString();
            }
        else
        {
            Label1.Text = "You have not specified a file.";
        }
    }
&lt;/script&gt;

&lt;html  &gt;
&lt;head runat="server"&gt;
    &lt;title&gt;Upload Files&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
        &lt;asp:FileUpload ID="FileUpload1" runat="server" /&gt;&lt;br /&gt;
        &lt;br /&gt;
&lt;asp:Button ID="Button1" runat="server" OnClick="Button1_Click"
Text="Upload File" /&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;asp:Label ID="Label1" runat="server"&gt;&lt;/asp:Label&gt;&lt;/div&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Running this you will obtain the source code generated from the FileUpload control:</p>
<pre>&lt;html  &gt;
&lt;head&gt;&lt;title&gt;
   Upload Files
&lt;/title&gt;&lt;/head&gt;
&lt;body&gt;
    &lt;form name="form1" method="post" action="MyFileUpload.aspx"
     id="form1" enctype="multipart/form-data"&gt;
&lt;div&gt;
&lt;input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNDcxNTg5NDg3D2QWAgIEDxYCHgdlbmN0eXBlBRNtdWx0aXBhcnQvZm9yb
       S1kYXRhZGQUQEUFMY1+/fp1mnrkbqmVNQIzFA==" /&gt;
&lt;/div&gt;

    &lt;div&gt;
        &lt;input type="file" name="FileUpload1" id="FileUpload1" /&gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;input type="submit" name="Button1" value="Upload File"
         id="Button1" /&gt; &lt;br /&gt;
        &lt;br /&gt;
        &lt;span id="Label1"&gt;&lt;/span&gt;
    &lt;/div&gt;

&lt;div&gt;

   &lt;input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION"
    value="/wEWAgLB+7jIAwKM54rGBv2Iz6LxVY7jWec0gZMxnuaK2ufq" /&gt;
&lt;/div&gt;&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>As you can see ASP.NET 2.0 modified the page&#8217;s<code>&lt;form &gt;</code> element on your behalf by adding the appropriate enctype attribute. Another important thing to remark here is that the FileUpload control was converted to an <acronym title='HyperText Markup Language'><span class='caps'>HTML</span></acronym>  <code>&lt;input type="file" &gt;</code> element.<br />
If you run the file from the examples you can upload files to the server by clicking on the Upload File button and selecting the file that you want to upload and that’s a very ease job.</p>
]]></content:encoded>
			</item>
		<item>
		<title>Optimizing Paid Search Advertising</title>
		<link>http://general-tips.AssistProgramming.com/optimizing-paid-search-advertising.html</link>
		<pubDate>Tue, 10 Jun 2008 12:58:28 +0000</pubDate>
		<description><![CDATA[Is Your Paid Search Advertising Generating Positive Financial Results?
As an online business, the people may be familiar with the available utilize “pay for performance”. Also known as pay-per-click,  PPC  or paid search, it has faithful taken the online marketing world flood  especially the two largest player, Overture and Google Adwords.  A [...]]]></description>
			<content:encoded><![CDATA[<h2><strong>Is Your Paid Search Advertising Generating Positive Financial Results?</strong></h2>
<p>As an online business, the people may be familiar with the available utilize “pay for performance”. Also known as pay-per-click,  PPC  or paid search, it has faithful taken the online marketing world flood  especially the two largest player, Overture and Google Adwords.  A study by   Piper Jaffray tell that paid search constitutes more than 87% of U.S. search market revenues. This wonderful statistic demand the question:”Are    advertisers  achieving a positive  return on their paid  search investment?”</p>
<p>The answer to this question may forbid  from understanding the role of the two critical performance metrics.</p>
<p><strong>Click-through Rate</strong> (a.k.a. CTR) = Click-throughs (i.e. Total Visitors) / Impressions</p>
<p>For example, if your paid search ad is seen by 10 users and one user clicks on your ad.Website conversion is defined of users who want to visit your website and complete your primary objective.</p>
<p><strong>Website Conversion</strong> (a.k.a. sales conversion) = Sales / Click-throughs (i.e. Total Visitors)</p>
<p>So what role does each play in understanding the effectiveness of a paid search campaign?<br />
Standard practice between advertisers is to concentrate a high click-through rate to send more visitor traffic to their website.</p>
]]></content:encoded>
			</item>
		<item>
		<title>Create SQL Trigger</title>
		<link>http://databases.AssistProgramming.com/create-sql-trigger.html</link>
		<pubDate>Sun, 08 Jun 2008 16:18:20 +0000</pubDate>
		<description><![CDATA[General
A trigger is a stored procedure that automatically executes when an event occurs in the database server.Triggers execute when  users  try to modify something or  behind an event that generate  changes on the data base.There are three kind of triggers: for insert , update , and delete.The most important  events [...]]]></description>
			<content:encoded><![CDATA[<h2><strong>General</strong></h2>
<p>A trigger is a stored procedure that automatically executes when an event occurs in the database server.Triggers execute when  users  try to modify something or  behind an event that generate  changes on the data base.There are three kind of triggers: for <strong>insert , update ,</strong> and <strong>delete</strong>.The most important  events  correspond to Transact-<acronym title='Structured Query Language'><span class='caps'>SQL</span></acronym> CREATE, ALTER, and DROP statements, and certain system stored procedures that perform DDL-like(data definition language) operations.Triggers can be created in the <acronym title='Structured Query Language'><span class='caps'>SQL</span></acronym> Server 2005 Database Engine directly from Transact-<acronym title='Structured Query Language'><span class='caps'>SQL</span></acronym> statements or from methods of assemblies that are created in the Microsoft .NET Framework common language runtime (CLR) and uploaded to an instance of <acronym title='Structured Query Language'><span class='caps'>SQL</span></acronym> Server.Using <acronym title='Structured Query Language'><span class='caps'>SQL</span></acronym> Server you can create lots of triggers for any specific statement.</p>
<h2>Syntax:</h2>
<pre>CREATE TRIGGER trigger_nameON { ALL SERVER | DATABASE }

[ WITH &lt;ddl_trigger_option&gt; [ ,...n ] ]

{ FOR | AFTER } { event_type | event_group } [ ,...n ]
AS { sql_statement  [ ; ] [ ,...n ] | EXTERNAL NAME</pre>
<pre>&lt; method specifier &gt;  [ ; ] }&lt;ddl_trigger_option&gt; ::=

[ ENCRYPTION ]

[ EXECUTE AS Clause ]

&lt;method_specifier&gt; ::=

assembly_name.class_name.method_name</pre>
<h3><em>schema_name</em></h3>
<p>Is the name of the schema to which a DML trigger belongs. DML triggers are scoped to the schema of the table or view on which they are created. <em>schema_name</em> cannot be specified for DDL or logon triggers.</p>
<h3><em>trigger_name</em></h3>
<p>Trigger name is the name of the trigger. Is not allowed to start the trigger name with # or ##.</p>
<h3><em>table/view</em></h3>
<p>Table or view are the table or view where trigger is executing on.Triggers cannot be defined on local or global temporary tables.</p>
<p><strong>DATABASE</strong></p>
<p>Current data base where changes are making on.</p>
<p><strong>ALL SERVER</strong></p>
<p>Is the current server where are the tables or views that we make changes.If specified, the trigger fires whenever <em>event_type</em> or <em>event_group</em> occurs anywhere in the current server.</p>
<p><strong>WITH ENCRYPTION</strong></p>
<p>Using WITH ENCRYPTION prevents the trigger from being published as part of <acronym title='Structured Query Language'><span class='caps'>SQL</span></acronym> Server replication.</p>
<p><strong>EXECUTE AS</strong></p>
<p>Specifies the way is executed the trigger.This way users validate permissions on any database objects that are referenced by the trigger.</p>
<p><strong>FOR | AFTER</strong></p>
<p>After - means that trigger can be executed only after all operations  specified in the triggering <acronym title='Structured Query Language'><span class='caps'>SQL</span></acronym> statement have executed successfully.</p>
<h3><em>event_type</em></h3>
<p>Is the type of event that release the trigger for executing.</p>
<h3><em>sql_statement</em></h3>
<p>Is the trigger conditions and actions. Trigger conditions specify additional criteria that determine whether the tried DML, DDL, or logon events cause the trigger actions to be performed.The trigger actions specified in the Transact-<acronym title='Structured Query Language'><span class='caps'>SQL</span></acronym> statements go into effect when the operation is tried.</p>
<h3><em> method_specifier </em></h3>
<p>The method must take no arguments and return void. <em>class_name</em> must be a valid <acronym title='Structured Query Language'><span class='caps'>SQL</span></acronym> Server identifier and must exist as a class in the assembly with assembly visibility. If the class has a namespace-qualified name that uses &#8216;.&#8217; to separate namespace parts, the class name must be delimited by using [ ] or &#8221; &#8221; delimiters. The class cannot be a nested class.</p>
]]></content:encoded>
			</item>
		<item>
		<title>Good site layout importance</title>
		<link>http://general-tips.AssistProgramming.com/good-site-layout-importance.html</link>
		<pubDate>Fri, 06 Jun 2008 19:34:32 +0000</pubDate>
		<description><![CDATA[        When you create a website you must think first to the content and layout. All those things are very important for you content and are the most important things that make visitors to came back and visit again. Everyone is not born with a quality of creating [...]]]></description>
			<content:encoded><![CDATA[<p>        When you create a website you must think first to the content and layout. All those things are very important for you content and are the most important things that make visitors to came back and visit again. Everyone is not born with a quality of creating layouts that are pleasing to the eye. In order to keep you visitors is important to carefully chose the colors and to create all the possible combination offering to your website a special design.</p>
<h2><strong>        Points to consider while designing a website layout</strong></h2>
<p>When you create a website is very important to consider that you may change something on the site and that must be an easy job. That’s why:</p>
<h3><strong>Keep it simple:</strong></h3>
<p>In major situations a simple website layout is user friendly. It’s better to not create complex navigational links using complex scripts or images that may not be viewable correctly in different browsers. It’s also very possible that search engine to not index the site properly if complex navigation is involved. You should use small icons to attract visitor’s attentions because using larges images cam make your website difficult, laborious.</p>
<h3><strong>        Readable font size and face:</strong></h3>
<p>We recomand you to use standard font size of  “-1” (11 or 12 pixels if using styles) because that way visitors can read the content easily. Select a professional looking font face (Verdana, Arial, Helvetica, sans-serif are very common). Avoid using fancy fonts like Comic Sans (unless it is a personal website). Use appropriate spacing between lines (12 or more pixels) to avoid clumsiness.</p>
<h3><strong>        Use web safe eye pleasing colors:</strong></h3>
<p>You must select that color you feel are best for you website subject. However, it is a wise decision to get feedback from users or friends about what they feel about the color combination of the website.</p>
<h3><strong>         Web pageDimensions:</strong></h3>
<p>Here, an important thing is to keep track of dimensions of a web page. Most successful commercial websites limit the width and height of the web page so that the important content of the web page lies within the top 600&#215;600 viewable area without scrolling. The best choice is to limit the width by placing a table with a fixed width of 750 or 775 pixels and to work in this table. The page height should not be any more than 4 scroll lengths. Limit the content of the page and if more content needs to be added, move it to a new web page. Provide a navigational link to the next page and a link back from the second page. This will also increase your web site&#8217;s page views.</p>
<h3><strong>        Tips &amp; tricks</strong></h3>
<p>Extract JavaScript code and styles from within the <acronym title='HyperText Markup Language'><span class='caps'>HTML</span></acronym> page to external .JS and .<acronym title='Cascading Style Sheets'><span class='caps'>CSS</span></acronym> files. To decrease you individual <acronym title='HyperText Markup Language'><span class='caps'>HTML</span></acronym> page size create a link from each <acronym title='HyperText Markup Language'><span class='caps'>HTML</span></acronym> page to these external files because browsers download these files only once and caches them on the user&#8217;s computer. Use server side includes for centralizing common content, use a background which creates a contrast to the font colors and graphics and why not look at media sites to inspire.</p>
]]></content:encoded>
			</item>
	</channel>
</rss>
