Archive for the 'Tech-Crunch' Category

PHP Video Tutorials - Basic PHP & MySQL

Saturday, April 5th, 2008

SEO Tips and Tricks

Saturday, April 5th, 2008

SEO (Search Engine Optimization) is a way to get a top position in the search engines and a natural and free of cost way to get maximum traffic to your website.

Here are a few tried and tested ways to achieve the topmost position in a search engines:

1. On Page Optimization:
• After making a thorough research on the keywords, use the keywords in the metatags, titles and contents of your webpages.
• Try using about 2 keywords in the contents of a single webpage.

2. Off Page Optimization:
• You need to have a high page rank to be placed at a top position in a search engine. Linking to a website having a high page rank will serve this purpose.
• To convince a website of high page rank is the job that requires all your efforts as websites with a high page rank do not always link to websites having lower page rank than theirs.
• So you need to convince them to that extent to trade links or else you can always opt for the easy way to get a high page rank by paying the websites of higher page rank to link to your website. Of course paying to link with high page rank websites is possible only with websites who offer such a feature.
• Another simpler option is buying expired domains that already have a high page rank.

3. Beat your competitor in search engine ranking:
Don’t try to beat the search engine. Try to beat your competitor website and try to do at least one thing better than them and continue this till you see some visible changes in the search engine ranks.

4. Popular search terms are better than keywords:
Using the most popular and highly sorted out search term is better than using popular keywords.

5. More the number of pages of your website, the better is your page rank.
• Less number of pages with a high density of keywords won’t attract the search engines as much as more number of pages in a website with limited keywords.
• Eg: Wikipedia has millions of pages and so for almost any search term you find it in the top 10 search results. This wasn’t achieved in a day, the pages were added little by little and finally their count grew to millions.
• Rather than cramping everything in a single webpage, distribute it among different webpages.
• A single webpage could have 400-800 words per page.

6. To increase your webpages, you could start writing articles on a regular basis.
For this you can write it yourself or heir a Ghostwriter who may charge you around $5 per article or borrow it from an article website and publish it on your website keeping the author’s resource box intact.

7. Your website should have a newsletter feature.
• Subscribers of your newsletter will judge you by the quality of the content that you send them.
• So sit down to write some quality content for your newsletter.
• Even if you have 5-10 people who have signed up for your newsletter, you can get 80% of the sales from them.

8. On subscribing for your newsletter, provide the subscribers with some bonuses to entice them to visit your website again and again.

9. Give away reports on topics related to your website contents to your newsletter subscribers using autoresponders.

10. Submit your articles to E-zines, article directories etc., as these websites have huge traffic and your article thus can experience great exposure and the links back to your website can get huge website traffic too. These links placed here, are of great value to your website and thus placing your article in such websites gets traffic and backlink benefits.

11. Other than submitting articles in E-zines and article directories also try submitting your article to various websites that have contests similar to your article.
This article should have links back to your website, so that the traffic experienced by their website could be redirected to yours too in exchange of the articles. The articles written for your website, as well as submitted to different websites should follow certain strategies like:
• Find search terms that are searched at least 100 times per day but not more than 1 million times per day.
• Use these keywords throughout your article with a density of 3-7% per article. You could also use these keywords in the title of your article.
• Spend some time thinking of an attractive title for your article.
• Your article should have a good opening paragraph, so that people would go through your entire article with interest.

12. Make use of article announcement list which is quite similar to article directory where most of the visitors are generally webmasters in search of a quality article to be published on their website.

13. Submit your website in popular directories for increased traffic and backlinks. Submit your website only when it is fully functional to avoid rejection by the directories.

14. Join webmaster’s forum and try becoming a problem solver over there.
• Advice the forum members to find a solution to their problems.
• Ask for their opinions and comments for any of your works.
• If you have a blog of your own, then tell them about it and you could also mention about various posts that would help them find a solution to their problems and from the blog direct them to your website.
• If you direct them directly to your website they will feel as if you are there just to get traffic for your website ad not really there to advice them for solutions.

15. Beware of certain websites that provides codes, which you may be asked to place on your website to get 1000 of links to your website in minutes, but after this you website will certainly get removed from the search engines results. So beware and avoid risks.

16. Classifieds submission to get traffic for your website was once considered a very profitable deal but now due to its overcrowding, it is not so popular to attract traffic, although you do have chances of getting traffic from classified websites too. As its submission is for free might as well give it a try. Always use keywords to write your classified ads.

17. If you are a part of an affiliate network where the websites would like to refer their visitors to each other’s websites, then share posts, articles, newsletters with your website links placed on it, with such websites. You affiliates could use them for their own newsletters and finally, you are trying to help them send visitors to your website.

18. Set up your own blog at blogger.com or wordpress.com to display your website’s articles. Here your content gets maximum reviews and could thus help you improve your website content, making use of these reviews.

19. Once you blog becomes quite popular, submit your blog’s RSS to RSS directory to get more traffic.
• For Bloggers.com, it is “Yourdomain.blogspot.com/atom.xml”
• For wordpress.com, it is “yourdomain.com/feed/”

20. Write press releases.
• Press releases are the notifications that you send to media about noticeable and newsworthy information to get media attention and advertising for free.
• As press releases you can send your website poll information, latest survey information with special reports and mention that this was solely carried out by your website.
• Before writing your press release, go through some of the sample press releases already available on the website, so that you come to know about the format in which a press release has to be presented.
• Avoid presenting it as some advertising copy.

21. Newspaper press releases: When you write a press release, you can also mail the press release to the editor of a newspaper column where you want your press release to appear. The same could be done to printed magazines too.

22. The content of a single webpage should not exceed more than 400-800 words as search engines would not like to go through each and every word of your webpage. Distribute your contents over different webpages if the content is too long to be displayed in a single webpage, this will allow you to target more keywords.

23. If you want your visitors to click a particular link in your website, you could use the terms like “Not many people know about this link.”

for more information, visit blog

New Telephone Innovations in the Early 1960s

Thursday, April 3rd, 2008

Included innovations are an early pager, long-distance dialing, and push-button dialing.

Why Is YouTube More Popular Than Google Video?

Wednesday, April 2nd, 2008

Youtube
Google Video

YouTube, a video site created by three former PayPal employees in 2005, accounts for more than 60% of all videos watched online in the US. Google Video has a such a small share that it’s not worth mentioning (things will change a little now that Google Video is linked on Google.com). Why is that?

1. YouTube is perceived as a video site. Google is a search engine that also has a video section. In addition, Google Video has disappointed twice: it was first a TV shows search but without videos and then a site that required a software to play videos (a version of VideoLAN).

2. YouTube is more open: it shows the number of views, links to a video, so you can have a better perspective about a video. Google shows the number of views only to the upoaders.

3. YouTube is more focused on the community: you could post comments from the beginning, you can post video responses and replies.

4. YouTube lets you have favorite videos, so it’s easy to view the same videos again. Google lets you find the videos in the search history and bookmark it, but it’s more difficult to do it.

5. You can create playlists in YouTube, and share them. There are also channels you can subscribe to. Google Video’s playlists are only derived from search results.

6. In YouTube you can become a member of a group and discuss all sorts of topics related to videos. The videos are an excuse for discussion.

7. YouTube lets people create an online identity, so it’s closer to a social network. You can send messages to users, add to friends, subscribe to his/her favorite videos.

8. Popular doesn’t always mean great. YouTube has a list of top rated videos and controversial videos. It’s reassuring to know that a video has 500 excellent ratings from 3000 views.

9. YouTube has a better search. You can sort the results by number of views, rating, search in playlists and channels.

10. YouTube has a lot of free music videos and TV shows without having the legal right, so it attracts more people. Google is more inclined to remove copyrighted content and to sell premium videos. So YouTube has a more rebellious image.

To conclude, I’ll say that Google Video should not try to copy YouTube’s design, and let people do more with the videos, find out more about the videos and connect them in a meaningful way.

read more at googlesystem blog

Java run process and read input/output streams

Tuesday, April 1st, 2008

String command = “…your comman…”;

                      print(”processing: ‘” + command + “‘”);

Runtime rt = Runtime.getRuntime ();
Process process = rt.exec (command);

InputStream os = process.getInputStream();
int line = 0;
while((line = os.read()) != -1)
printNoNL(((char)line));

process.waitFor();

 

Managing Hierarchical Data in MySQL

Tuesday, April 1st, 2008

Introduction

Most users at one time or another have dealt with hierarchical data in a SQL database and no doubt learned that the management of hierarchical data is not what a relational database is intended for. The tables of a relational database are not hierarchical (like XML), but are simply a flat list. Hierarchical data has a parent-child relationship that is not naturally represented in a relational database table.

For our purposes, hierarchical data is a collection of data where each item has a single parent and zero or more children (with the exception of the root item, which has no parent). Hierarchical data can be found in a variety of database applications, including forum and mailing list threads, business organization charts, content management categories, and product categories. For our purposes we will use the following product category hierarchy from an fictional electronics store:
Hierarchy

go to http://dev.mysql.com/tech-resources/articles/hierarchical-data.html to read more

Dynamically Loaded (DL) Libraries

Monday, March 31st, 2008

Dynamically Loaded (DL) Libraries

Dynamically loaded (DL) libraries are libraries that are loaded at times other than
during the startup of a program. They’re particularly useful for implementing
plugins or modules, because they permit waiting to load the plugin until it’s needed.
For example, the Pluggable Authentication Modules (PAM) system uses DL libraries
to permit administrators to configure and reconfigure authentication. They’re also useful
for implementing interpreters that wish to occasionally compile their code into machine
code and use the compiled version for efficiency purposes, all without stopping.
For example, this approach can be useful in implementing a just-in-time compiler
or multi-user dungeon (MUD).

In Linux, DL libraries aren’t actually special from the point-of-view of their format;
they are built as standard object files or standard shared libraries as discussed above.
The main difference is that the libraries aren’t automatically loaded at program link
time or start-up; instead, there is an API for opening a library, looking up symbols,
handling errors, and closing the library. C users will need to include the header
file <dlfcn.h> to use this API.

The interface used by Linux is essentially the same as that used in Solaris,
which I’ll call the “dlopen()” API. However, this same interface is not
supported by all platforms; HP-UX uses the different shl_load() mechanism,
and Windows platforms use DLLs with a completely different interface.
If your goal is wide portability, you probably ought to consider using some wrapping
library that hides differences between platforms. One approach is the glib
library with its support for Dynamic Loading of Modules; it uses the underlying
dynamic loading routines of the platform to implement a portable interface to
these functions. You can learn more about glib at
http://developer.gnome.org/doc/API/glib/glib-dynamic-loading-of-modules.html.
Since the glib interface is well-explained in its documentation, I won’t discuss it
further here. Another approach is to use libltdl, which is part of GNU libtool.
If you want much more functionality than this, you might want to look into a
CORBA Object Request Broker (ORB). If you’re still interested in directly using
the interface supported by Linux and Solaris, read on.

dlopen()

The dlopen(3) function opens a library and prepares it for use. In C its prototype is:

  void * dlopen(const char *filename, int flag);

If filename begins with “/” (i.e., it’s an absolute path), dlopen() will just try to use
it (it won’t search for a library). Otherwise, dlopen() will search for the library in the following order:

 

  1. A colon-separated list of directories in the user’s LD_LIBRARY_PATH environment variable.
  2. The list of libraries specified in /etc/ld.so.cache (which is generated from /etc/ld.so.conf).
  3. /lib, followed by /usr/lib. Note the order here; this is the reverse of the order used by
    the old a.out loader. The old a.out loader, when loading a program, first searched /usr/lib,
    then /lib (see the man page ld.so(8)). This shouldn’t normally matter, since a library should
    only be in one or the other directory (never both), and different libraries with the same
    name are a disaster waiting to happen.

In dlopen(), the value of flag must be either RTLD_LAZY, meaning “resolve undefined
symbols as code from the dynamic library is executed”, or RTLD_NOW, meaning “resolve

all undefined symbols before dlopen() returns and fail if this cannot be done”. RTLD_GLOBAL

may be optionally or’ed with either value in flag, meaning that the external symbols defined

in the library will be made available to subsequently loaded libraries. While you’re debugging,

you’ll probably want to use RTLD_NOW; using RTLD_LAZY can create inscrutable errors

if there are unresolved references. Using RTLD_NOW makes opening the library take slightly

longer (but it speeds up lookups later); if this causes a user interface problem you can switch

to RTLD_LAZY later.

 

 

dlerror()

Errors can be reported by calling dlerror(), which returns a string describing the error from
the last call to dlopen(), dlsym(), or dlclose(). One oddity is that after calling dlerror(),
future calls to dlerror() will return NULL until another error has been encountered.

dlsym()

There’s no point in loading a DL library if you can’t use it. The main routine for using a DL library
is dlsym(3), which looks up the value of a symbol in a given (opened) library. This function is defined as:

 void * dlsym(void *handle, char *symbol);

the handle is the value returned from dlopen, and symbol is a NIL-terminated string. If you can
avoid it, don’t store the result of dlsym() into a void* pointer, because then you’ll have to cast it
each time you use it (and you’ll give less information to other people trying to maintain the program).

dlsym() will return a NULL result if the symbol wasn’t found. If you know that the symbol could
never have the value of NULL or zero, that may be fine, but there’s a potential ambiguity
otherwise: if you got a NULL, does that mean there is no such symbol, or that NULL is the value
of the symbol? The standard solution is to call dlerror() first (to clear any error condition that may
have existed), then call dlsym() to request a symbol, then call dlerror() again to see if an error
occurred. A code snippet would look like this:

 dlerror(); /* clear error code */

 s = (actual_type) dlsym(handle, symbol_being_searched_for);

 if ((err = dlerror()) != NULL) {

  /* handle error, the symbol wasn’t found */

 } else {

  /* symbol found, its value is in s */

 }

dlclose()

The converse of dlopen() is dlclose(), which closes a DL library. The dl library maintains link counts
for dynamic file handles, so a dynamic library is not actually deallocated until dlclose has been called
on it as many times as dlopen has succeeded on it. Thus, it’s not a problem for the same program to
load the same library multiple times. If a library is deallocated, its function _fini is called (if it exists) in
older libraries, but _fini is an obsolete mechanism and shouldn’t be relied on. Instead, libraries should
export routines using the __attribute__((constructor)) and __attribute__((destructor)) function attributes.
See Section 5.2 for more information. Note: dlclose() returns 0 on success, and non-zero on error;
some Linux manual pages don’t mention this.

DL Library Example

Here’s an example from the man page of dlopen(3). This example loads the math library and
prints the cosine of 2.0, and it checks for errors at every step (recommended):

    #include <stdlib.h>

    #include <stdio.h>

    #include <dlfcn.h>    int main(int argc, char **argv) {

        void *handle;

        double (*cosine)(double);

        char *error;

handle = dlopen ("/lib/libm.so.6", RTLD_LAZY);

        if (!handle) {

            fputs (dlerror(), stderr);

            exit(1);

        }

cosine = dlsym(handle, "cos");

        if ((error = dlerror()) != NULL)  {

            fputs(error, stderr);

            exit(1);

        }

printf ("%f\n", (*cosine)(2.0));

        dlclose(handle);

    }

If this program were in a file named “foo.c”, you would build the program with the following command:

    gcc -o foo foo.c -ldl

nm command

The nm(1) command can report the list of symbols in a given library. It works on both static
and shared libraries. For a given library nm(1) can list the symbol names defined, each symbol’s
value, and the symbol’s type. It can also identify where the symbol was defined in the source code
(by filename and line number), if that information is available in the library (see the -l option).

The symbol type requires a little more explanation. The type is displayed as a letter; lowercase
means that the symbol is local, while uppercase means that the symbol is global (external).
Typical symbol types include T (a normal definition in the code section), D (initialized data section),
B (uninitialized data section), U (undefined; the symbol is used by the library but not defined by the library),
and W (weak; if another library also defines this symbol, that definition overrides this one).

If you know the name of a function, but you truly can’t remember what library it was defined in,
you can use nm’s “-o” option (which prefixes the filename in each line) along with grep to find the
library name. From a Bourne shell, you can search all the libraries in /lib, /usr/lib,
direct subdirectories of /usr/lib, and /usr/local/lib for “cos” as follows:

nm -o /lib/* /usr/lib/* /usr/lib/*/* \

      /usr/local/lib/* 2> /dev/null | grep 'cos$'

Library constructor and destructor functions

Libraries should export initialization and cleanup routines using the gcc __attribute__((constructor))
and __attribute__((destructor)) function attributes. See the gcc info pages for information on these.
Constructor routines are executed before dlopen returns (or before main() is started if the library is
loaded at load time). Destructor routines are executed before dlclose returns (or after exit() or
completion of main() if the library is loaded at load time). The C prototypes for these functions are:

  void __attribute__ ((constructor)) my_init(void);

  void __attribute__ ((destructor)) my_fini(void);

Special functions _init and _fini (OBSOLETE/DANGEROUS)

Historically there have been two special functions, _init and _fini that can be used to control constructors
and destructors. However, they are obsolete, and their use can lead to unpredicatable results.
Your libraries should not use these; use the function attributes constructor and destructor above instead.

If you must work with old systems or code that used _init or _fini, here’s how they worked. Two special
functions were defined for initializing and finalizing a module: _init and _fini. If a function “_init” is exported
in a library, then it is called when the library is first opened (via dlopen() or simply as a shared library).
In a C program, this just means that you defined some function named _init. There is a corresponding function
called _fini, which is called whenever a client finishes using the library (via a call dlclose() that brings its
reference count to zero, or on normal exit of the program). The C prototypes for these functions are:

  void _init(void);

  void _fini(void);

read more on http://tldp.org/HOWTO/Program-Library-HOWTO/index.html

Creating a shared and static library with the gnu compiler

Sunday, March 30th, 2008

The code for the library

calc_mean.c

//#include <stdio.h>

##N(mean)
double mean(double a, double b) {
  return (a+b) / 2;
}

The header file

Of course, we need a header file.

calc_mean.h

double mean(double, double);

Creating the static library

A static library is basically a set of object files that were copied
into a single file. This single file is the static library. The static file
is created with the archiver (ar).

First, calc_mean.c is turned into an object file:

gcc -c calc_mean.c -o calc_mean.o

Then, the archiver (ar) is invoked to produce a static library
(named libmean.a) out of the object file calc_mean.o.

ar  rcs libmean.a      calc_mean.o

Note: the library must start with the three letters lib and have the suffix .a.

Creating the shared library

As with static libraries, an object file is created. The -fPIC option tells gcc to create position independant code which is necessary for shared libraries. Note also, that the object file created for the static library will be overwritten. That’s not bad, however, because we have a static library that already contains the needed object file.

gcc -c -fPIC calc_mean.c -o calc_mean.o

For some reason, gcc says:

cc1: warning: -fPIC ignored for target
(all code is position independent)

It looks like -fPIC is not necessary on x86, but all manuals say,
it’s needed, so I use it too.

Now, the shared library is created

gcc -shared -Wl,-soname,libmean.so.1 -o
libmean.so.1.0.1  calc_mean.o

Note: the library must start with the three letter lib.

The programm using the library

This is the program that uses the calc_mean library. Once, we
will link it against the static library and once against the shared library.

main.c

#include <stdio.h>
#include "calc_mean.h”

int main(int argc, char* argv[]) {

  double v1, v2, m;
  v1 = 5.2;
  v2 = 7.9;

  m  = mean(v1, v2);

  printf(”The mean of %3.2f and %3.2f
is %3.2f\n”, v1, v2, m);

  return 0;
}

Linking against static library

gcc -static main.c -L. -lmean -o statically_linked

Note: the first three letters (the lib) must not be specified,
as well as the suffix (.a)

Linking against shared library

gcc main.c -o dynamically_linked -L. -lmean

Note: the first three letters (the lib) must not be specified,
as well as the suffix (.so)

Executing the dynamically linked programm

LD_LIBRARY_PATH=.
./dynamically_linked

Interrogating libraries (`which library is sin() in?’)

nm libraryname should list all the symbols that libraryname has references to. It works on both static and shared libraries. Suppose that you want to know where tcgetattr() is defined: you might do

$ nm libncurses.so.1 |grep tcget
         U tcgetattr

The U stands for `undefined’ — it shows that the ncurses library uses but does not define it. You could also do

$ nm libc.so.5 | grep tcget
00010fe8 T __tcgetattr
00010fe8 W tcgetattr
00068718 T tcgetpgrp

The `W‘ stands for `weak’, which means that the symbol is defined, but in such a way that it can be overridden by another definition in a different library. A straightforward `normal’ definition (such as the one for tcgetpgrp) is marked by a `T

The short answer to the question in the title, by the way, is libm.(so|a). All the functions defined in <math.h> are kept in the maths library; thus you need to link with -lm when using any of them.

Finding files

ld: Output file requires shared library `libfoo.so.1`

The file search strategy of ld and friends varies according to version, but the only default you can reasonably assume is /usr/lib. If you want libraries elsewhere to be searched, specify their directories with the -L option to gcc or ld.

ELF shared libraries

To build libfoo.so as a shared library, the basic steps look like this:

$ gcc -fPIC -c *.c
$ gcc -shared -Wl,-soname,libfoo.so.1
-o libfoo.so.1.0 *.o
$ ln -s libfoo.so.1.0 libfoo.so.1
$ ln -s libfoo.so.1 libfoo.so
$ LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH ;
export LD_LIBRARY_PATH

Mosaicer 2.0 - Creates photomosaics

Thursday, March 27th, 2008

Mosaicer 2.0 - Creates photomosaics. Comes with its source code (written in VB6). Click here to see a gallery of mosaics generated with this application. Click here to download a bare bones version of Mosaicer without the setup program (note: you will need the VB6 run time files or else the generation window wont pop up when you press the generate button).

http://patorjk.com/blog/software/

Sample gallery:
The Simpsons

 Kurt Cobain

Interesting Recursive acronym

Thursday, March 27th, 2008

A recursive acronym (or occasionally recursive initialism, and sometimes recursive backronym) is an abbreviation that refers to itself in the expression for which it stands. Due to the nature of the English language, which would infinitely recurse left-recursive phrases, recursive abbreviations are circular definitions.

In computing, an early tradition in the hacker community (especially at MIT) was to choose acronyms and abbreviations that referred humorously to themselves or to other abbreviations. Perhaps the earliest example in this context, from about 1977 or 1978, is TINT (”TINT Is Not TECO”), an editor for MagicSix. This inspired the two MIT Lisp Machine editors called EINE (”EINE Is Not Emacs“) and ZWEI (”ZWEI Was EINE Initially”). These were followed by Richard Stallman’s GNU (GNU’s not UNIX.) Many examples include negatives, such as denials that the thing defined is or resembles something.

Below is some interesting self describing acronyms:

  • PHP — PHP: Hypertext Preprocessor (originally “Personal Home Page” tools, officially changed for PHP 3)[3]
  • PINE — PINE Is Not Elm, originally; PINE now officially stands for “Program for Internet News & E-mail”[4]
  • PNG — PNG’s Not GIF (graphics format, officially Portable Network Graphics)
  • NINJA - Ninja Is Not Just Air.
  • GNU — GNU’s Not Unix
  • Cygnus — Cygnus, Your GNU Support
  • RPM — RPM Package Manager (originally “Red Hat Package Manager”)
  • YAML — YAML Ain’t Markup Language (initially “Yet Another Markup Language”)
  • Zombie — Zombie-Oriented Machine-Being Interface Engine´

more at wiki

happy browsing….


Your Ad Here