Posts Tagged ‘True’

Creating an HTML Status Bar Link Description

Monday, July 14th, 2008

You can display your HTML link description in the status bar of your browser. When the mouse is placed over a link, the text link description will be viewed in the status bar.

<A HREF=”http://www.blog.tryangled.com” onmouseover=”window.status=’Your text description’; return true” onmouseout=”window.status=”;return true”>Your linked text</a>

Php:Connection Handling

Tuesday, July 1st, 2008

PHP maintains a connection status bitfield with 3 bits:
0 - NORMAL

1 - ABORTED

2 - TIMEOUT
By default a PHP script is terminated when the connection to the client is broken and the ABORTED
bit is turned on. This can be changed using the ignore_user_abort() function. The TIMEOUT bit is
set when the script timelimit is exceed. This timelimit can be set using set_time_limit().

<?php
set_time_limit(0);
ignore_user_abort(true);
/* code which will always run to completion */
?>
You can call connection_status() to check on the status of a connection.

<?php
ignore_user_abort(true);
echo “some output”;
if(connection_status()==0) {
// Code that only runs when the connection is still alive
} else {
// Code that only runs on an abort
}
?>
You can also register a function which will be called at the end of the script no matter how the script
was terminated.

<?php
function foo() {
if(connection_status() & 1)
error_log(”Connection Aborted”,0);
if(connection_status() & 2)
error_log(”Connection Timed Out”,0);
if(!connection_status())
error_log(”Normal Exit”,0);
}
register_shutdown_function(’foo’);
?>

PHP:Detect Firefox browser with php script/function

Monday, June 30th, 2008

function is_firefox() {
$agent = ”;
// old php user agent can be found here
if (!empty($HTTP_USER_AGENT))
$agent = $HTTP_USER_AGENT;
// newer versions of php do have useragent here.
if (empty($agent) && !empty($_SERVER["HTTP_USER_AGENT"]))
$agent = $_SERVER["HTTP_USER_AGENT"];
if (!empty($agent) && preg_match(”/firefox/si”, $agent))
return true;
return false;
}

PHP:Validate string length

Monday, June 30th, 2008

// str len validator
function str_validator( $str, $min, $max )
{
if ( strlen( $str ) >= $min && strlen( $str ) <= $max )
{
return true;
} else
{
return false;
}
}

PHP:Validate URL using outgoing connection ( fopen )

Monday, June 30th, 2008

<?php
/**
* valid_url - validates supplied url/uri making a connection
*
* Note:
*
* 1) this method is more accurate than a validation made by a regular expression but it is much slower
* 2) administraters may restrict outgoing connections from your hosting to outside world and the function may raise a PHP Warning
*
* @param $url String
* @return true if the address is valid
*
*/
function valid_url( $url )
{
if ( @fopen( $url, ‘r’ ) )
{
return true;
} else
{
return false;
}
}
if ( valid_url( “http://blog.tryangled.com” ) )
{
echo “URL OK”;
} else
{
echo “Invalid URL.”;
}
?>

PHP:Validate URL (FTP, HTTP) using regular expression ( regex )

Monday, June 30th, 2008

<?php
/**
* valid_url - validates supplied url with a regular expression ( regex ).
*
* URL can be FTP, HTTP secure
* @param $url String
* @return true if the address is valid
* @author RAJI
*
*/
function valid_url( $url )
{
if ( !preg_match( ‘!^((ht|f)tps?://)?[a-zA-Z]{1}([w-]+.)+([w]{2,5})/?$!i’, $url ) )
{
return false;
} else
{
return true;
}
}
if ( valid_url( “http://blog.tryangled.com” ) )
{
echo “URL OK”;
} else
{
echo “Invalid URL.”;
}
?>

PHP:validate email address

Monday, June 30th, 2008

function validate_email($address)
{
if (ereg(’^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$’, $address))
return true;
else
return false;
}

7 Skills of Highly Effective Freelance Graphics and Web Designers

Saturday, June 21st, 2008

1. Adobe Photoshop - The ability to use and understand the basics of pixel based photo manipulation. The best Photoshop experts are constantly learning and experimenting through online tutorials, books and seminars. This is the grand daddy of them all. Make it a goal to spend X amount of time each week learning a new technique.

Test: Can you do complex selections via the selection tool? Are you accomplished with layers? Do you understand how to use adjustment layers, masks and channels? Can you remove blemishes, “scratches” and color correct

2. Adobe Illustrator - The ability to use and understand vector based graphics. This program is essential to creating crisp, clean artwork. You will need this program for logo/identity creation, poster work and even some print work. The program can be a bit tricky to learn but worth all and any aggravation to learn it.

Test: Do you understand the concept of bezier curves? Can you convert a bitmap image to a vector graphic? Have you mastered multi-step gradients? Do you know how to create graphic images with text?

3. Adobe InDesign or Quark Express - The ability to use a page layout program. This program is fundamental to any print work. Whether you are creating books, magazines, brochures, sell sheets or advertisements you will need to possess the skills of a high-end layout program.

Test: Do you understand the concept of Master Pages? Would you be able to set up a 32 page catalog? Do you have an understanding of how to control text with images? i.e.; how to flow text in and around images. Do you have basic knowledge of offset printing and pre-press processes? Hint: if not, schedule a visit to a fairly large local printer and ask if you can be shown their process AND bring a list of a questions.

4. Flash - The ability to use and understand this motion-based juggernaut. Flash is now the most widely deployed video platform on the Internet. Flash Player is installed on nearly twice as many desktops and devices as any other video player. As the web becomes more and more video-based having a solid knowledge of Flash, In my opinion, is one of the most important programs to learn.

Test: Can you create a simple animation? Do you understand the concept of keyframes? Do you know how to incorporate a Flash movie into a web page? Do you understand the power of interactivity and user interface design?

5. Understand Typography One of the most “overlooked” design skills today is knowledge of Typographic design. It is one of the tell-tale signs between a good and excellent designer. Our business is all about communication and if type is not clear, appropriate or well designed the design is seriously compromised.

Test: Do you have a font management system installed on your computer? Have you recently read (or revisited) some of the classic type books? Are you up-to-speed on typographic standards? Do you know the difference between True Type, PostScript and OpenType fonts? Do you have a font reference guide resource book in your studio?

6. Idea Generation In the design business it is critical to have a method of idea generation. Why? Some of the best designers in the world are paid the most money not because they know Photoshop of Flash better than you do but because they have the ability to consistently come up with new and innovative ideas that make their clients serious money.

Test: What methods do you use to generate ideas? Do you know how other innovative thinkers come up with their brilliant ideas? How often to you read (in general) so as to have myriad references and viewpoints to call upon? What do you do when your idea well has gone dry?

7. Building a Network To be successful in area of life you need the help and support of others. This is especially important for designers who need to spend much of their time in their studios/offices. Building a network of trusted confidants and friends will pay off in more ways than you know.

Test: How often do you attend networking events or seminars? Have you made a list of 5 influential people that could help your career? Do you have some sort of system for capturing and entering your new contacts information? What can you do this week to open and expand your network? Have you sought out a successful mentor?

BONUS SKILL #8. General Business Skills You do not have to be a genius at business but you DO need to know basic business skills, like; sales, marketing, accounting, tax strategies, database management, etc. This tends to be one myth that designers rather not deal with. If you are marketing your own design firm or you are a freelancer the sooner you learn your business is NOT graphic design but the advertising and marketing business you will be light years ahead of your competition.

Test: Do you know the basic outline of a sales call? What new marketing strategies have you learned/implemented? When was the last time you wrote a hand-written thank you note or sent a surprise gift to a client?