Monday, November 19, 2012

Get and set with C#


You don't need to use set or get. You could write functions named setFoo or getFoo instead of using a property Foo:
  1. class Point {
  2. double x, y;
  3. public Point(double x, double y) {
  4. this.x = x;
  5. this.y = y;
  6. }
  7. public double GetX() { return x; }
  8. public void SetX(double x) { this.x = x; }
  9. public double GetY() { return y; }
  10. public void SetY(double y) { this.y = y; }
  11. }

But that's a real pain -- you'd rather write pt.Y = 3; and be able to write things like pt.Y += 5; , instead of pt.SetY(pt.GetY() + 5); .
So instead C# has properties:
  1. class Point {
  2. double x, y;
  3. public Point(double x, double y) {
  4. this.x = x;
  5. this.y = y;
  6. }
  7. public double X {
  8. get { return x; }
  9. set { x = value; }
  10. }
  11. public double Y {
  12. get { return y; }
  13. set { y = value; }
  14. }
  15. }

Inside the setter, the keyword 'value' is the variable containing the value that is getting assigned to the property Y.
The pattern of having properties directly backed by fields is so common that in C# 3, shortcut syntax was added.
  1. class Point {
  2. public Point(double x, double y) {
  3. X = x;
  4. Y = y;
  5. }
  6. public double X { get; set; }
  7. public double Y { get; set; }
  8. }

There are a few reasons to use properties, instead of public fields. One is that properties can be virtual. Another is that you can make the setters for a property private. Another is that properties have a 'special' meaning to things that inspect classes at runtime. There are frameworks for conveniently talking to databases and for reading and writing objects to and from XML and all sorts of other things -- and they automatically look at the object's properties (and not private fields or other things) to see how to do their job.

Friday, November 16, 2012

Free Javascript Obfuscator and Free PHP Obfuscator


Free Javascript Obfuscator

http://www.javascriptobfuscator.com/default.aspx



Free PHP Obfuscator

http://www.pipsomania.com/best_php_obfuscator.do
http://www.mobilefish.com/services/php_obfuscator/php_obfuscator.php

Monday, November 5, 2012

This example calls the ToInt32(String)

This example calls the ToInt32(String) method to convert an input string to an int . The program catches the two most common exceptions that can be thrown by this method, FormatException and OverflowException. If the number can be incremented without overflowing the integer storage location, the program adds 1 to the result and prints the output




static void Main(string[] args)
{
    int numVal = -1;
    bool repeat = true;

    while (repeat == true)
    {
        Console.WriteLine("Enter a number between −2,147,483,648 and +2,147,483,647 (inclusive).");

        string input = Console.ReadLine();

        // ToInt32 can throw FormatException or OverflowException. 
        try
        {
            numVal = Convert.ToInt32(input);
        }
        catch (FormatException e)
        {
            Console.WriteLine("Input string is not a sequence of digits.");
        }
        catch (OverflowException e)
        {
            Console.WriteLine("The number cannot fit in an Int32.");
        }
        finally
        {
            if (numVal < Int32.MaxValue)
            {
                Console.WriteLine("The new value is {0}", numVal + 1);
            }
            else
            {
                Console.WriteLine("numVal cannot be incremented beyond its current value");
            }
        }
        Console.WriteLine("Go again? Y/N");
        string go = Console.ReadLine();
        if (go == "Y" || go == "y")
        {
            repeat = true;
        }
        else
        {
            repeat = false;
        }
    }
    // Keep the console open in debug mode.
    Console.WriteLine("Press any key to exit.");
    Console.ReadKey();    
}
// Sample Output: 
// Enter a number between -2,147,483,648 and +2,147,483,647 (inclusive). 
// 473 
// The new value is 474 
// Go again? Y/N 
// y 
// Enter a number between -2,147,483,648 and +2,147,483,647 (inclusive). 
// 2147483647 
// numVal cannot be incremented beyond its current value 
// Go again? Y/N 
// Y 
// Enter a number between -2,147,483,648 and +2,147,483,647 (inclusive). 
// -1000 
// The new value is -999 
// Go again? Y/N 
// n 
// Press any key to exit.

C# - DataGridView - Confirmation Dialog on Row Delete

            if (!e.Row.IsNewRow)
            {
                DialogResult dialogResult = MessageBox.Show("Do you want to delete ?", "Delete", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {

                }
                else
                {
                    e.Cancel = true;
                }

            }

Sunday, November 4, 2012

How to change the height of a combobox from designer view?

Change DrawMode property to OwnerDrawVariable, and then change the ItemHeight property. You may need to change IntegralHeight property to false.

Low Level Language


Machine Code

  • A low-level language is one that is close to the fundamentals of the computer's hardware. The lowest-level language is machine code, which is understood directly by the hardware and does not require any interpretation or translation. Machine code consists entirely of strings of binary numbers: the famous zeroes and ones. While it can do anything any other language can do --- indeed, every other language must be translated into machine code by an interpreter --- it is not designed around the needs of the programmer, requires a very close understanding of a computer's processor and devices, and is almost impossible for a human to read.

Assembly Language

  • The next-"higher" programming language is assembly language, which is machine code with the instruction codes replaced by more intuitive commands. The command to put a value of 97 into a memory register called AL, for example --- which would in machine code be "10110000 01100001" --- would in assembly language be "MOV AL, 97", still a cryptic command but one much easier to learn. While it is still inefficient to write and requires a programmer to deal directly with her computer's hardware, it is a higher-level language than machine code because it is more abstract: It is closer to the writer.

High Level Language

  • Modern programmers write even in assembly language very rarely. Instead, they use one of many different higher-level languages like C, Java or Python, which programs called compilers or interpreters can translate into machine code. These languages remove the programmer from the physical realm of the hardware and into logical abstraction: Rather than moving hexadecimal values around memory registers, the programmer works with variables whose contents can be changed; loops that can be repeated until some condition is met; logical statements like IF, AND, THEN, OR and ELSE; and other tools. These languages are designed around the programmer, attentive to the ways she can be given the most power with the least difficulty.

Comparisons

  • High-level languages are not so called because they are "better" than low-level languages. Sometimes, the ability to talk more directly to a computer's processor in assembly language or even machine code can solve problems made difficult by the layers of abstraction in a higher-level language. A very high-level language may deal only with a particular operating system, like Microsoft Visual Basic; or with a particular program, like the "macros" in a word processor. These programs are very useful for someone who wants to manipulate Windows or Word without having to know the intricacies of how each works --- but such a language would be of no use to someone trying to write a program of his own, who would need something lower-level. A programmer thus chooses a language based on the job that he needs to do.

Assembly language


Assembly language
Assembly language is the most basic programming language available for any processor  With assembly language, a programmer works only with operations implemented directly on the physical CPU. Assembly language lacks high-level conveniences such as variables and functions, and it is not portable between various families of processors. Nevertheless, assembly language is the most powerful computer programming language available, and it gives programmers the insight required to write effective code in high-level languages.Machine code for displaying $ sign on lower right corner of screen.10111000, 00000000, 10111000, 10001110, 11011000, 11000110, 00000110,10011110, 00001111, 00100100, 11001101, 0001111

Difference between low level language and High level Language


High level programming languages are more structured, are closer to spoken language and are more intuitive than low level languages. Higher level languages are also easier to read and can typically sometimes work on many different computer operating systems. Some examples of higher level languages are Java, Visual Basic, COBOL, BASIC, C++, and Pascal to name only a few. Lower level languages are typically assembly languages that are machine specific.

Computers run instructions at the binary level, interpreting zeros and ones as instructions. Rather than writing programming code at this level, we've developed languages that compile into the zeros and ones that computers understand. As these languages become more robust, they get further and further way from zeros and ones, becoming higher level languages.

Today's object oriented computer languages allow developers to mimic the real world with objects in code.

To use an analogy, high level programming languages are to spoken languages as low level languages are to Morse code. Morse code is not limited in what it can communicate, but it's not as intuitive or easy to use as spoken language.

Yes and Also... High Level Programming falls in the Area of OOP/Object Oriented Programming. They were design to get much out of Programming, more complexity, flexibility, in a presentation, in Simplicity.

There was a time where all Programming was done in Machine Lanuages, which I can imagine... Gave Programmers a big Headache. Then b, was created then C, Then after awhile C++ Was created which was an adon to C, Making it High Level OOP.

All though not all High level Programming is OOP. OOP Has to have .

Polymorphism.

Encapsulation

etc etc....

Well Not all High Level Programming is OOP. PHP, PERL, RUBY, Which fall in the lines of ''Interpert'' languages, and differ from OOP. Anyway Low Levels actuially refer to The actual Memory, how the CPU Reads, and executes Data. High Levels Are powerful languages, but are presented in ''Human readable Codes'' Defining Variable Names, etc etc.

Friday, October 26, 2012

1 bit equals to how many bytes?

1 byte = 8 bits = 23 bits
1 Kilobyte = 1024 bytes = 210 bits
1 Megabyte = 1024 kilobytes = 220 bits
1 Gegabyte = 1024 megabytes = 230 bits

Friday, October 5, 2012

“Got a packet bigger than ‘max_allowed_packet’ bytes” MySQL error



Also, change the my.cnf or my.ini file under the mysqld section and set max_allowed_packet=100M or you could run these commands in a MySQL console connected to that same server:

# mysql -u admin -p

mysql> set global net_buffer_length=1000000;

Query OK, 0 rows affected (0.00 sec)



mysql> set global max_allowed_packet=1000000000;

Query OK, 0 rows affected (0.00 sec)

MSQL Restoring a Table table script


MSQL Restoring a Table table script


To restore your table, you’d run:

$ mysql -u user -ppassword mydb < /tmp/extracted_table.sql

Voila! – you’re back in business.

MYSQL GRANT ALL PRIVILEGES


MYSQL GRANT ALL PRIVILEGES

GRANT ALL PRIVILEGES ON dbname.* TO 'user'@'localhost' IDENTIFIED BY 'password';

Wednesday, October 3, 2012

Tuesday, October 2, 2012

CodeIgniter echo sql statment

CodeIgniter echo sql statment

echo $this->model_name->connectionname->last_query();

Saturday, September 22, 2012

Classification Essay Tips

Division & Classification Essay Tips



Below are classification essay techniques to remember while making classification essay outline.

  • After extensive reading and gathering data, you must underline the important points and highlight them and sort out the things with same characteristics and name it as a separate group.
  • Start the classification essay with an interesting introduction and it should be quite straightforward in such a way that only the main division and classification essay idea or topic continues to be discussed. The introduction states the division and classification essay thesis statement of classification essay titles.
  • The developing paragraphs define each type of the category of the thing or place which is being classified in the classification and division essay topics. It is advisable to discuss only one category in one paragraph. You can also go from small to big category.
  • Provide a clear description of the category through relevant examples.
  • Conclusion is to summing up the essay's main points or providing a final view point about the topic.Conclusion leaves a final impact on reader's mind and it is written in three or four convincing sentences.

Tuesday, September 4, 2012

PHP multidimensional arrays with recursive function


in_array() does not work on multidimensional arrays. You could write a recursive function to do that for you:
function in_array_r($needle, $haystack, $strict = true) {
    foreach ($haystack as $item) {
        if (($strict ? $item === $needle : $item == $needle) ||  
(is_array($item) && in_array_r($needle, $item, $strict))) {
            return true;
        }
    }

    return false;
}

Usage:

$b = array(array("Mac", "NT"), array("Irix", "Linux"));
echo in_array_r("Irix", $b) ? 'found' : 'not found';

Monday, August 27, 2012

MYSQL- Restoring Your Database From Backup


 Using phpMyAdmin

phpMyAdmin is a program used to manipulate databases remotely through a web interface. A good hosting package will have this included. For information on backing up your WordPress database, see Backing Up Your Database.
Information here has been tested using phpMyAdmin 2.8.0.2 running on Unix.

Restore Process

A visual tutorial for phpMyAdmin 2.5.3 can be found at Podz' WordPress Restore guide.
  1. Login to phpMyAdmin.
  2. Click databases, and select the database that you will be importing your data into.
  3. You will then see either a list of tables already inside that database or a screen that says no tables exist. This depends on your setup.
  4. Across the top of the screen will be a row of tabs. Click the Import tab.
  5. On the next screen will be a Location of Text File box, and next to that a button named Browse.
  6. Click Browse. Locate the backup file stored on your computer.
  7. Make sure the SQL radio button is checked.
  8. Click the Go button.
Now grab a coffee. This bit takes a while. Eventually you will see a success screen.
If you get an error message, your best bet is to post to the WordPress support forums to get help.

Using Mysql Commands

The restore process consists of unarchiving your archived database dump, and importing it into your Mysql database.
Assuming your backup is a .bz2 file, creating using instructions similar to those given for Backing up your database using Mysql commands, the following steps will guide you through restoring your database :
1. Unzip your .bz2 file:
user@linux:~/files/blog> bzip2 -d blog.bak.sql.bz2
Note: If your database backup was a .tar.gz called blog.bak.sql.tar.gz file, then, tar -zxvf blog.bak.sql.tar.gz is the command that should be used instead of the above.
2. Put the backed-up SQL back into MySQL:
user@linux:~/files/blog> mysql -h mysqlhostserver -u mysqlusername
 -p databasename < blog.bak.sql

Enter password: (enter your mysql password)
user@linux~/files/blog:> 

Connect to MS SQLServer database in putty



Connect to MS SQLServer database in putty

isql -v 192.100.100.1/database username password

Thursday, June 14, 2012

Writing Effective Comparison or Contrast Essays

Block Arrangement (four paragraphs)
I. Introduction in which you state your purpose which is to discuss the differences between vacationing in the mountains or at the beach
II. Mountain
A.  Climate
B.  Types of Activities 
C.  Location 
III. Beach
A.  Climate
B.  Types of Activities 
C.  Location 
IV. Conclusion
A second way to organize this material is to discuss a particular point about vacationing in the mountains and then immediately to discuss the same point about vacationing at the beach.  This is called point-by-point or alternating arrangement.  An outline of this organization follows.
Point-by-Point or Alternating Arrangement (five paragraphs)
I. Introduction in which you state your purpose which is to discuss differences between vacationing in the mountains or at the beach
II. First difference between mountains and beaches is climate
A.  Mountains
B.  Beach
III. Second difference between mountains and beaches are types of activities
A.  Mountains
B.  Beach
IV. Third difference between mountains and beaches is the location
A.  Mountains
B.  Beach
V. Conclusion

How to Write a Compare and Contrast Essay

1- Research and classify. In order to effectively write a compare / contrast essay, the writer must first decide what the similarities and difference between the topics are. Some research can be done over internet using Wikipedia, wikiuncle, e-journals,e-books, etc. A Venn diagram can also be of great use to visualize and organize the structure of the paper.
2-Address each argument separately. There are two distinct strategies in writing such an essay. The first is to use each paragraph to address both topics. The second is to address one topic first, then the other topic. This will then be followed by a period of analysis that addresses both topics. In either case, it is important for the writer to decide ahead of time and structure the writing and research accordingly.

3-You can use this pre-defined outline to build your compare/contrast essay on:
  • Introduction
    • Present the basic information about the topics to be compared and contrasted
    • Narrows the focus to allow the writer to easily present information on the topics
    • Provides a thesis statement that allows the reader to understand, in a general sense, the information that will be presented on the topics
  • Body Paragraphs
    • Depending on the chosen structure, either addresses both topics in the same paragraph or addresses a specific topic
    • Falling in line with the thesis, shows how the topics are similar
    • Also shows how the topics are different
    • Evidence will be provided to back up the writer’s suppositions
  • Conclusion
    • Summary of the evidence presented
    • Restatement of the thesis
    • Address the significance of the two topics being compared and contrasted

Friday, June 8, 2012

How to Write a Compare/Contrast Essay


How to Write a Compare/Contrast Essay

Compare and contrast essays are the other big essay types in academic writing. These essays will follow a specific question and are fairly easy to complete. There are several ways to write this type of essay. The most important thing to remember is structure. Many wonderful essays fall victim to the woes of bad structure, making any ingenuity to fall by the wayside. Go over the rules on how to write a general essay, and then structure your compare/contrast essay in one of the following two formats:

    Introduction

    Your introduction — like the five-paragraph-essay, should open generally (with a quotation, anecdote, generalization), and lead into the thesis statement.
    Topic 1

    This next portion of your essay (which may consist of one paragraph or several) should cover only the first topic of the comparison and contrast. Compare/Contrast essays take two topics and illustrate how they are similar and dissimilar. Do not mention topic 2 in this first portion.
    Topic 2

    This next portion of your essay (which may also consist of one or more paragraphs) should cover the second of the two topics. Do not discuss Topic 1 in this section. Since you have already gone into great detail about it, you may allude to Topic 1 briefly; however, do not analyze Topic 1 in this section. This portion of the paper is to discuss Topic 2 in great detail.
    Topics 1 and 2 Together

    Now that you have analyzed both Topic 1 and Topic 2 independently, now it is time to analyze them together. This section may also be one or several paragraphs.
    Conclusion

    The conclusion — like the introduction — should be a generalization of the thesis. This paragraph should express your certainty and absolute knowledge on the subject matter. You should reaffirm your thesis (essentially restate it in new words) and show how you've proven it.

OR

    Introduction

    Your introduction — like the five-paragraph-essay, should open generally (with a quotation, anecdote, generalization), and lead into the thesis statement.
    All Comparisons (Topics 1 and 2)

    This section — which should consists of several paragraphs — should go through all similarities you find in the two topics on which you are writing. There should be at least three comparisons (essentially three short body paragraphs) in which you give an example from both topics of comparisons in each.
    All Contrasts (Topics 1 and 2)

    This section — which should consist of several paragraphs — should go through all differences you find in the two topics on which you are writing. There should be at least three contrasts (essentially three short body paragraphs) in which you give an example from both topics of comparisons in each.
    Conclusion

    This conclusion is wrapping up everything you have just proven in your paper. It should restate the thesis in a new, more official way, and you should feel quite confident in your writing.

Here is a quick breakdown on how the Compare-Contrast Essay should appear:

    Type A:
        Paragraph 1: Introduction (with Thesis)
        Paragraph 2: Topic 1 (Comparison a)
        Paragraph 3: Topic 1 (Comparison b)
        Paragraph 4: Topic 1 (Comparison c)
        Paragraph 5: Topic 2 (Contrast a)
        Paragraph 6: Topic 2 (Contrast b)
        Paragraph 7: Topic 2 (Contrast c)
        Paragraph 8: (Optional) — Comparisons/Contrasts together (any topic)
        Paragraph 8: Conclusion
    Type B:
        Paragraph 1: Introduction (with Thesis)
        Paragraph 2: Comparison a (Topic 1&2)
        Paragraph 3: Comparison b (Topic 1&2)
        Paragraph 4: Comparison c (Topic 1&2)
        Paragraph 5: Contrast a (Topic 1&2)
        Paragraph 6: Contrast b (Topic 1&2)
        Paragraph 7: Contrast c (Topic 1&2)
        Paragraph 8: Conclusion

Thursday, June 7, 2012

Cause and Effect (Essay)


Organizing An Essay

Often student writers are taught short-term solutions to the problem of organizing an essay. The most common short-term essay is the "five-paragraph essay" format. The five-paragraph essay uses the following organization:
  1. Introduction--Background and thesis
  2. First Body Paragraph--The first reason why the thesis is true
  3. Second Body Paragraph--The second reason why the thesis is true
  4. Third Body Paragraph--The third reason why the thesis is true
  5. Conclusion--Recap of essay
It is important to understand that the five-paragraph essay is not necessarily bad. However, most student writers are led to believe or falsely believe that all essays must follow the five-paragraph essay format. Just a little thought makes clear that format is very limiting and limited and does not provide an adequate organization for many types of writing assignments. That is why I have crossed-out the description of the five-paragraph essay, so that you won't make the mistake of thinking that it is the best way to organize your essays.
Instead, student writers should see that the form of an essay (its organization) needs to match the purpose of the essay. To begin with, we should look at one of the most common tasks student writers are asked to perform and the one of the organizational strategies effective for this task.

Explaining Cause and Effect

Often writers are asked to explain how certain conditions or events are related to the occurrence of other conditions or events. When a writer argues that "one thing leads to another," he or she is making a cause-and-effect argument. For example, in an Economics class, students might be asked to explain the impact of increasing oil prices on the nation’s economy. Inherent in the question is the assumption that increasing oil prices is a cause, which produces specific effects in the rest of the economy. So, higher oil prices produce higher gasoline prices raising the cost of shipping goods. Higher oil prices produce higher jet fuel costs raising the cost of travel, and so on. "Higher oil prices" is the cause, and increased shipping costs and travel expenses are among the effects.
Writing tasks involving cause and effect analysis usually take one of two forms: explaining how a known cause produces specific effects; explaining how specific effects are produced by a previously unknown cause (which the writer has discovered). The second type of analysis is commonly referred to as root-cause analysis. The first type of analysis is what the technology and privacy topic requires.
To argue that certain conditions will lead to other conditions (that the loss of privacy will lead to something else), first the writer needs to define clearly what those conditions are, and then the writer needs to make clear how those conditions lead to other conditions. Finally, the writer needs to explain what this cause-and-effect relationship means. This type of essay then has five parts (not paragraphs!), with each part corresponding to a specific task the writer needs to perform, and each part consisting of one or more paragraphs.

Essay PartScopePurpose (not all necessary for every essay)
IntroductionGeneral
  • Background for the topic
  • Setting out the issues
  • Focusing the argument—the purpose of the essay
Description of the "Cause"Begins general; becomes increasingly specific
  • What the specific conditions are
  • Specific illustrations of these conditions
  • How these specific illustrations are representative of (can stand in for) other situations
In this first part of the analysis, the writer needs to provide enough detail for the reader so the reader can understand the present situation. In addition, the writer needs to focus the description of the situation in such a way as to prepare for the "effect" that the writer is arguing for. For example, if the writer wants to argue that the loss of privacy has led to (or will lead to) a loss of individual freedom, then the description of how technology affects our privacy should focus on technologies that affect an individual’s freedom to act.
Description of the "Effect"Begins general; becomes increasingly specific
  • What the specific effect is (or effects are)
  • How we get from the specific conditions to the specific effects
  • Specific illustrations of these effects
  • How these specific illustrations are representative of (can stand in for) others
In this second part of the analysis, the writer needs to walk the reader through the logical steps the writer has used to move from cause to effect. For example, if the writer argues that loss of privacy leads to loss of individual freedom, the writer needs to explain carefully how privacy and freedom are linked. So perhaps the writer might claim that privacy allows an individual to be free from the observation of others. With our privacy becoming increasingly limited by surveillance, we are no longer free from the observation of others. If we believe that we are always being watched, we will probably change our behavior and be less willing to take chances or act independently. If we feel we cannot act independently then we are no longer free.
Explanation of the meaning of the cause-and-effect relationshipMore General
  • Why this analysis is important
  • How we might act upon the ideas the writer has presented
In this third part of the analysis, the writer argues for the importance of the argument’s findings, often by putting in perspective the short-term or long-term consequences of the "effect." In addition, in this part the writer usually makes some sort of recommendation (what we should do). So if the writer is arguing that loss of privacy leads to loss of freedom, in this part the writer might speculate one what might happen if this trend towards further loss of privacy continues. In addition, the writer might describe some of the specific actions we can take to safeguard our existing privacy, or how legislation might provide such safeguards.
ConclusionGeneral
  • Summing up
  • How our understanding of the larger issue might be changed by the writer's analysis
  • Appeal to the reader—how this situation affects us

Wednesday, June 6, 2012

Process Essay Writing Structure



Process Essay Writing Structure


Process Essay – Introduction


First of all, introduce the process and its significance with background information. State thesis statement which normally includes the indication of the steps.

Process Essay – Body

Start with the topic sentence and further explain it with main supporting sentences followed by minor supporting sentences.

Repeat this process of first body paragraph in the rest of the body paragraphs of your process essay writing.

Process Essay – Conclusion


Restate the thesis statement in a rephrased manner.
Summarize all the major steps or instructions of the complete process

Thursday, April 26, 2012

Monday, April 16, 2012

change Joomla pagination style

Pagination.php


/**
 * @version $Id: pagination.php 14401 2010-01-26 14:10:00Z louis $
 * @package Joomla
 * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
 * @license GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

/**
 * This is a file to add template specific chrome to pagination rendering.
 *
 * pagination_list_footer
 * Input variable $list is an array with offsets:
 * $list[limit] : int
 * $list[limitstart] : int
 * $list[total] : int
 * $list[limitfield] : string
 * $list[pagescounter] : string
 * $list[pageslinks] : string
 *
 * pagination_list_render
 * Input variable $list is an array with offsets:
 * $list[all]
 * [data] : string
 * [active] : boolean
 * $list[start]
 * [data] : string
 * [active] : boolean
 * $list[previous]
 * [data] : string
 * [active] : boolean
 * $list[next]
 * [data] : string
 * [active] : boolean
 * $list[end]
 * [data] : string
 * [active] : boolean
 * $list[pages]
 * [{PAGE}][data] : string
 * [{PAGE}][active] : boolean
 *
 * pagination_item_active
 * Input variable $item is an object with fields:
 * $item->base : integer
 * $item->link : string
 * $item->text : string
 *
 * pagination_item_inactive
 * Input variable $item is an object with fields:
 * $item->base : integer
 * $item->link : string
 * $item->text : string
 *
 * This gives template designers ultimate control over how pagination is rendered.
 *
 * NOTE: If you override pagination_item_active OR pagination_item_inactive you MUST override them both
 */

function pagination_list_footer($list)
{
    // Initialize variables
    $lang =& JFactory::getLanguage();
    $html = "
\n";

    $html .= "\n
".JText::_('Display Num').$list['limitfield']."
";
    $html .= $list['pageslinks'];
    $html .= "\n
".$list['pagescounter']."
";

    $html .= "\n";
    $html .= "\n
";

    return $html;
}

function pagination_list_render($list)
{
    // Initialize variables
    $lang =& JFactory::getLanguage();
    $html = "
    ";     $html .= $list['start']['data'];     $html .= ' '.$list['previous']['data'];    foreach( $list['pages'] as $page )    {       if($page['data']['active']) {          $html .= '
  • ';
          }

       $html .= '
  • '.' '.$page['data'].'
  • ';

          if($page['data']['active']) {
             $html .= '
  • ';          }    }    $html .= " ".$list['next']['data'];    $html .= ' '.$list['end']['data'];    /*$html .= '
  • »
  • ';*/    $html .= "
";
   return $html;
   }

function pagination_item_active(&$item) {
    return "
  • link."\" title=\"".$item->text."\">" .$item->text. "

  • ";
    }

    function pagination_item_inactive(&$item) {
       return "
  • text. "\">".$item->text."

  • ";
       //return "
  • ".$item->text."

  • ";
    }
    ?>


    ----------- --CSS ----

    *paging*/
    .light {
      -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
      -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
      -o-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
     /* background: #f3f3f3 url('../img/noise-f3f3f3.png');*/
      background:url(../images/paging_bg.jpg);
      overflow: hidden;
    }

    .wrapper {
      margin: 0;
      padding: 0em;
    }

    .paginate {
      text-align: center;
    }
    .paginate ul {
      list-style: none;
      margin: 0;
      padding: 0;
      text-align: center;
    }
    .paginate li {
      display: inline;
    }
    .paginate a {
      -moz-border-radius: 3px;
      -webkit-border-radius: 3px;
      -o-border-radius: 3px;
      -ms-border-radius: 3px;
      -khtml-border-radius: 3px;
      border-radius: 3px;
      -moz-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
      -webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
      -o-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
      box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
      margin: 1px 2px;
      padding: 5px 5px;
      display: inline-block;
      border-top: 1px solid #fff;
      text-decoration: none !important;
      color: #717171 !important;
      font-size: 7x!important;
      font-family: "Helvetica Neueu", Helvetica, Arial, sans-serif;
      text-shadow: white 0 1px 0;
      background-color:red;
      background-image: -webkit-gradient(linear, left top, left bottom, from(#f9f9f9), to(#eaeaea));
      /* Saf4+, Chrome */
      background-image: -webkit-linear-gradient(top, #f9f9f9, #eaeaea);
      /* Chrome 10+, Saf5.1+ */
      background-image: -moz-linear-gradient(top, #f9f9f9, #eaeaea);
      /* FF3.6 */
      background-image: -ms-linear-gradient(top, #f9f9f9, #eaeaea);
      /* IE10 */
      background-image: -o-linear-gradient(top, #f9f9f9, #eaeaea);
      /* Opera 11.10+ */
      background-image: linear-gradient(top, #f9f9f9, #eaeaea);
      filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f9f9f9', EndColorStr='#eaeaea');
      /* IE6–IE9 */
    }
    .paginate a:first-child, .paginate a.first {
      margin-left: 0;
    }
    .paginate a:last-child, .paginate a.last {
      margin-right: 0;
    }
    .paginate a:hover, .paginate a:focus {
      border-color: #fff;
      background-color: #fdfdfd;
      background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#fafafa));
      /* Saf4+, Chrome */
      background-image: -webkit-linear-gradient(top, #fefefe, #fafafa);
      /* Chrome 10+, Saf5.1+ */
      background-image: -moz-linear-gradient(top, #fefefe, #fafafa);
      /* FF3.6 */
      background-image: -ms-linear-gradient(top, #fefefe, #fafafa);
      /* IE10 */
      background-image: -o-linear-gradient(top, #fefefe, #fafafa);
      /* Opera 11.10+ */
      background-image: linear-gradient(top, #fefefe, #fafafa);
      filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#fefefe', EndColorStr='#fafafa');
      /* IE6–IE9 */
    }
    .paginate a.more {
      -moz-box-shadow: none;
      -webkit-box-shadow: none;
      -o-box-shadow: none;
      box-shadow: none;
      border: 0 none !important;
      background: transparent !important;
      margin-left: 0;
      margin-right: 0;
    }
    .paginate a.active {
      -moz-box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.75);
      -webkit-box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.75);
      -o-box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.75);
      box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.75);
      border-color: #505050 !important;
      color: #f2f2f2 !important;
      text-shadow: black 0 1px 0;
      background-color: #676767;
      background-image: -webkit-gradient(linear, left top, left bottom, from(#5f5f5f), to(#5c5c5c));
      /* Saf4+, Chrome */
      background-image: -webkit-linear-gradient(top, #5f5f5f, #5c5c5c);
      /* Chrome 10+, Saf5.1+ */
      background-image: -moz-linear-gradient(top, #5f5f5f, #5c5c5c);
      /* FF3.6 */
      background-image: -ms-linear-gradient(top, #5f5f5f, #5c5c5c);
      /* IE10 */
      background-image: -o-linear-gradient(top, #5f5f5f, #5c5c5c);
      /* Opera 11.10+ */
      background-image: linear-gradient(top, #5f5f5f, #5c5c5c);
      filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#5f5f5f', EndColorStr='#5c5c5c');
      /* IE6–IE9 */
    }

    .paginate-dark a {
      -moz-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
      -webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
      -o-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
      box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
      border-top: 1px solid #62686d;
      text-shadow: rgba(0, 0, 0, 0.75) 0 1px 0;
      color: #fff !important;
      background-color: #4e5458;
      background-image: -webkit-gradient(linear, left top, left bottom, from(#575e63), to(#3f4347));
      /* Saf4+, Chrome */
      background-image: -webkit-linear-gradient(top, #575e63, #3f4347);
      /* Chrome 10+, Saf5.1+ */
      background-image: -moz-linear-gradient(top, #575e63, #3f4347);
      /* FF3.6 */
      background-image: -ms-linear-gradient(top, #575e63, #3f4347);
      /* IE10 */
      background-image: -o-linear-gradient(top, #575e63, #3f4347);
      /* Opera 11.10+ */
      background-image: linear-gradient(top, #575e63, #3f4347);
      filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#575e63', EndColorStr='#3f4347');
      /* IE6–IE9 */
    }
    .paginate-dark a:hover, .paginate-dark a:focus {
      border-color: #61788a;
      background-color: #4d6374;
      background-image: -webkit-gradient(linear, left top, left bottom, from(#566f82), to(#3e505e));
      /* Saf4+, Chrome */
      background-image: -webkit-linear-gradient(top, #566f82, #3e505e);
      /* Chrome 10+, Saf5.1+ */
      background-image: -moz-linear-gradient(top, #566f82, #3e505e);
      /* FF3.6 */
      background-image: -ms-linear-gradient(top, #566f82, #3e505e);
      /* IE10 */
      background-image: -o-linear-gradient(top, #566f82, #3e505e);
      /* Opera 11.10+ */
      background-image: linear-gradient(top, #566f82, #3e505e);
      filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#566f82', EndColorStr='#3e505e');
      /* IE6–IE9 */
    }
    .paginate-dark a.active {
      -moz-box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.75);
      -webkit-box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.75);
      -o-box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.75);
      box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.75);
      border-color: #2d3035 !important;
      background-color: #303338;
      background-image: -webkit-gradient(linear, left top, left bottom, from(#303338), to(#2d3034));
      /* Saf4+, Chrome */
      background-image: -webkit-linear-gradient(top, #303338, #2d3034);
      /* Chrome 10+, Saf5.1+ */
      background-image: -moz-linear-gradient(top, #303338, #2d3034);
      /* FF3.6 */
      background-image: -ms-linear-gradient(top, #303338, #2d3034);
      /* IE10 */
      background-image: -o-linear-gradient(top, #303338, #2d3034);
      /* Opera 11.10+ */
      background-image: linear-gradient(top, #303338, #2d3034);
      filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#303338', EndColorStr='#2d3034');
      /* IE6–IE9 */
    }

    iTunes Blank Screen Can’t Load App Store

    So recently I ran into an issue where iTunes couldn’t load the app store and a blank screen would just display while it endlessly searched.  I also installed Safari and the same issue would occur there as well, Safari just would have a blank screen and never load any page.
    Like most users I did a repair, uninstall / reinstall and none of the problems resolved.  Ironically I searched on Apple forums at the time and couldn’t find a solution, so I opened a case with Apple about my iTunes not loading the app store and having a blank screen.
    It turns out that resetting the Winsock on a Windows 7, Windows Vista or Windows XP SP2 or later machine was the trick.
    image thumb2 iTunes Blank Screen Can’t Load App Store
    So if you are stuck with a blank screen, and you can’t load iTunes App store or Safari has a blank screen, then try the following.

    Fix iTunes Blank Screen Issue

    Open up your Windows Command Prompt

    For Windows Vista/7 you need to open as Administrator (right click > open as administrator)
    image thumb25 iTunes Blank Screen Can’t Load App Store


    Apple support referred me to this thread after sending me the following instructions and I just wondered why I couldn’t find that thread previously, it would have saved me from opening a case:  https://discussions.apple.com/thread/3371153?start=15&tstart=30

    Reset the Winsock

    Type in “netsh winsock reset”
    image thumb26 iTunes Blank Screen Can’t Load App Store

    Reboot your computer


    Test iTunes or Safari by loading it again


    This should solve most of the blank iTunes screen or Safari not loading any site problems, if it doesn’t then try uninstalling/reinstalling iTunes or Safari and check the Apple forums for an exact match of your issue if you are given an error code.

    Sunday, April 1, 2012

    Config host VMware in window and access url from window

    Config host VMware in window and access url from window

    1) Check networking setting in VMware

    2) Select Host-only: A private network shared with host
    or select custom: specific virtual network select VMnet1(host-only)

    3) Goto network setting in window

    4) Set IP of VMware Network Adapter VMnet1(example IP: 10.50.1.1, subnetmark 255.255.255.0)

    5) Goto VWMware server change IP to 10.502.1.2 and subnetmark 255.255.255.0

    6) Then restart network service

    7) Try access web browser from window 10.502.1.2 to access WMware server.

    Tuesday, March 27, 2012

    Crontab in UNIX with PHP



    1-crontab -e (edit cron)

    2:-----------

    */5 * * * * /usr/bin/curl http://abc.com/index.php > /dev/null

    5=minutes
    /dev/null=clear email

    Thursday, March 15, 2012

    Remove index codeigniter with wamp in httpaccess

    Remove index codeigniter with wamp in httpaccess


    IfModule mod_rewrite.c


    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteBase /Test_codeigniter_plugin/
    RewriteCond $1 !^(index\.php|images|robots\.txt)
    RewriteRule ^(.*)$ index.php/$1 [L]


    IfModule

    Wednesday, January 18, 2012

    Fix for Joomla ‘JFolder::create: Could not create directory’ Error


    Unlike other Errors, the fix for this error is pretty Simple. Follow the steps below to fix it.
    #1 Goto your Hosting panel >> File Manager >> Select your Domain/Sub-Domain and then open the configuration.php file.
    #2 Find var $log_path, it will contain the Directory path of your Old Server. Just replace the whole line with the code var $log_path = './logs';
    #3 Find var $tmp_path, it will also have the Directory path of your Old Server. Replace the whole line with the code var $tmp_path = './tmp';

    Tuesday, January 10, 2012

    Convert DateTime to Month/Year(SQLServer)


    Convert DateTime to Month/Year(SQLServer)

    select convert(varchar(2),datepart(month,getdate())) + '/' +
    convert(varchar(4),datepart(year,getdate())) 

    Thursday, January 5, 2012

    DATE FORMATE OF MYSQL AND SQLSERVER

    SQLSERVER

    date>='mm-dd-yyyy' and date<='mm-dd-yyyy'

    MYSQL

    date>='yyyy-mm-dd' and date<='yyyy-mm-dd'