Working with MySQL Partitions - Part 1 - Check if it is Enabled.

Steps

Ascertain MySQL is 5.1.16 or above for proper working of partitioning.
Commands:

Show variables
Show plugins


e.g. :

SHOW VARIABLES LIKE '%partition%';

result:

+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| have_partitioning | YES |
+-------------------+-------+
1 row in set (0.00 sec)

mysql> SHOW PLUGINS;
+------------+----------+----------------+---------+---------+
| Name | Status | Type | Library | License |
+------------+----------+----------------+---------+---------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
| partition | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ARCHIVE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| BLACKHOLE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
| FEDERATED | DISABLED | STORAGE ENGINE | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| InnoDB | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ndbcluster | DISABLED | STORAGE ENGINE | NULL | GPL |
+------------+----------+----------------+---------+---------+
11 rows in set (0.00 sec)

At this point if you have partition enabled if the above result indicates the availability of the service.

if you are doing a custom build please compile you need to compile the server using the --with-partition option.

Once you have done this you be start the server and check again if the service is enabled.

End of Step on.

Creation of partitions is a relatively easy process.

PHP Goes HipHop

PHP Performance has particular point of interest for many developers and companies. All the more true for FaceBook the second largest* site on the internet.

Facebook recently released HPHP (HipHop).

Supposedly, Facebook sees about a 50% reduction in CPU usage when serving equal amounts of Web traffic when compared to Apache and PHP. Facebook’s API tier can serve twice the traffic using 30% less CPU. Not Bad Eh?

Final result : A binary with a built in web server. Note: It does not process .htaccess yet.

HipHop has been developed on CentOS and Fedora, building on other operating systems may not currently be functional. Support will be added as soon as its ready.
At the moment, HipHop can only run on 64 bits systems.

HipHop currently supports PHP version 5.2 and will be updated to support 5.3.



Should be on debian soon.


HipHop for PHP transforms PHP source code into highly optimized C++. It was developed by Facebook and was released as open source in early 2010.

You will need the following to build


* cmake 2.6 is the minimum version
* g++/gcc 4.1 is the minimum version
* Boost 1.37 is the minimum version
* flex
* bison
* re2c
* libmysql
* libxml2
* libmcrypt
* libicu 4.2 is the minimum version
* openssl
* binutils
* libcap
* gd
* zlib
* tbb Intel's Thread Building Blocks
* Oniguruma

Modifications/ Patches

* libcurl
* src/third_party/libcurl.fb-changes.diff
* libevent 1.4
* src/third_party/libevent.fb-changes.diff

Pretty Nifty and Pretty Uber Cool !!

Go HipHop!

Get Gmail ( java ) and Opera Mini to work on Samsung star or Tocco lite

This is for all those who have not been able to get the Gmail app to work on your Samsung Star Phone. Do NOT forget the read the section that is labeled "Important" especially if you use a Samsung Phone.


For starters you need to have an internet access account with your mobile service provider such as T-Mobile, Airtel or Etisalat or any provider who offers the GPRS service.


Second your set should be Java enabled

Should have enough memory.

First install the 2.0 version of Gmail

At this point you will get error that tells you that you do not have the "appropriate certificate".

Then install the 1.5 version (http://gmail.com/app/v1.5.0/L1/gmail-g.jar)

This does the tick.

What is better is , now you can install opera mini as well.

IMPORTANT ::
When you start an unsigned java app on your phone to protect your privacy it will ask you want to allow the application to connect to the internet. Choose end-call ( right soft key). If you are not using the Samsung touch screen phone choose yet / ok / enter. On the Samsung phone, This will cause the application to ask you if you want to quit , simply choose no. Remember that you will need to do this a ton of times in the initial week ( it is frustrating ) but keep at it and you will succeed. I had to do it approx 20 times.

Also note, it is ideal to remove the proxy setting on the Airtel Mobile office. It slow the request down or kills it.

Relaiable Development Companies in India

Just wanted to list down some reliable software development and companies in India.


Infosys - Banking related and SAP
Wipro - Systems related and SAP
Real Consulting - Web Site Development
Mind Tree - Telco related
NIIT - Good Co work for.

Is PMBOK against Agile ?

Development organizations work towards optimizing software development and delivery. Development teams generally use the Project Management Institute's "A Guide To The Project Management Body of Knowledge" a.k.a (PMBOK).

They may also investigate Agile development methodologies such as Scrum or XP as their popularity. To Generalize Agile is a Delivery methodology.

These clash, when it comes to earned value measurement and few other measurement parameters. PMBOK admits that the project requirement is only "Incremental clear" and will fully be clear only when nearing completion. This is in full alignment for PMBOK. So the truth is delivery is the KEY and marriage of PMBOK to agile is is what can set development process to achieve what it started out to do.

The PBMOK talks about

Initiating
Planing
Executing
Controlling
Closing


Agile process

Envision
Speculate
Explore
Adapt
Close

So if you read the above carefully. One is written with the thought of bringing in formal note the other is about working with the client. Then the question what do you need. The answer is obvious we need both.

For those who are in a relationship or are married clearly know that we need to accept the other instead of trying to get them to change. So I guess it is time for Agile and PMBOK to hug each other.

Let me tell you this is a long term thing -yes pun intended ;) !

Rolling With Rails

Hi all,
Its been a while and I want to give you some good news. The good news is this . Ruby on Rails is HOT!!. Sure Is.

  • Rails is a MVC imptementation for ruby on Windows / Linux
  • Can Run under CGI / FastCGI
  • or as Standalone server such as Mongrel / WebBrick
  • Yes they can be clustered and can be tucked behind Apache via a PROXY ( more on this later ).
  • If Properly configured, its quite comparable.
  • Yes , there is a small effort of learning a language ( but is worth it)
  • Ruby developers prefer SVN as the version control mechanism
  • Supports popular DBs such as Oracle, MySQL and DB2 and more.
In summary its a great framework for RAD based development.

Check it out at

http://rubyforge.org/

:)

Qucik MYSQL PHP Tips ( IN CLAUSE)

MYSQL 4 does not allow IN (Select ...) .
So what you do is execute a query , generate a long set of values in then execute the query .

Cavet : SQL buffer can over flow


MYSQL Supports ( Select ..... in ( .... ) )

Understanding empty fucntion in PHP

Here is a quick tip:

empty and is_blank

empty

$var = 10;

// Evaluates to true because $var is empty
if (empty($var)) {
echo
'$var is either 0, empty, or not set at all';
}
?>


PHP easter egg

add ?=PHPE9568F36-D428-11d2-A769-00AA001ACF42 to your PHP code and check it out .. should show a sweet dogie or something . This will work only if Expose PHP is on (php.ini) !

Oracle and PHP Tutorial - Easy




PHP Interview Questions Part I

I hope this would be helpful for the jobseekers.

This is "three part" article


1. What are the differences between Get and post methods in form submitting,
give the case where we can use get and we can use post methods ?

Ans:
Get- sends requset in the form of qusery string and post hides the
data, and send directly to system.out


2. Who is the father of php and explain the php versions

Ans: Rasmus Lerdorf

3. How can we submit a form without a submit button

Ans:
1. image button 2. button. 3. java script form.submit() function

4. How many ways we can retrieve the date in result set of mysql using php

Ans:
4 ways, 1. mysql_fetch_row. 2. mysql_fetch_array. 3.
mysql_fetch_object 4. mysql_fetch_assoc


5. What is the difference between mysql_fetch_object and mysql_fetch_array

Ans:
mysql_fetch_object -- Fetch a result row as an object
mysql_fetch_array -- Fetch a result row as an associative array, a
numeric array, or both.


6. What is the difference between $message and $$message

Ans:
$message- is a varibale. $$message is a variable inside varibale


7. How can we extract string 'abc.com ' from a string 'http://info@abc.com' using regular expression of php

Ans:

$line="http://info@abc.com";
if (eregi ("http://(.*)@(.*)", $line, $add))
echo $add[2];


8. How can we create a database using mysql

Ans:
mysql_create_db in php. Create database name....

9. What is the differences between require and include, include_once

Ans:
include: warning require : fatal-error
include_once should be used in cases where the same file might be
included and evaluated more than once during a particular execution of a
script.


10. can we use include("myfile.php") two times in a php age "makeit.php"

Ans:
yes we can include twice.

11. what are the different tables present in mysql , which type of table is generated when we are creating a table in the following syntax : create table employee(eno int(2),ename varchar(10))

Ans:
MYISAM, ISAM, MERGE, HEAP, INNODB, BERKLEYDB. The Default Type is
"MYISAM"

12. Functions in IMAP, POP3 AND LDAP

Ans:
Please check in the manual (some people say RTFM... no offence !)


15. Shopping cart online validation ie how can we configure the Nobel Pay

Ans:
It is done thru curlfunction card details will be sent to the page in Nobel pay site which is already given to us by them. Only we have to send the parameters which is required for calling that page.

PHP Interview Questions Part II

16. What is meant my nl2br()

Ans: like


19. What are the reasons for selecting lamp(Linux, apache, mysql, php) instead of combination of other software programmes, servers and operating system?

Ans: All are Open-Source and are related internally

20. How can we encrypt and decrypt a data present in a mysqltable using mysql

Ans: AES_ENCRYPT() AES_DECRYPT()

21. How can we encrypt the username and password using php

Ans: md5() sha1()

22. What are the features and advantages of OBJECT ORIENTED PROGRAMMING

Ans: Encapsulation and inheritence and ploymorphism

23. What are the differences between PROCEDURE ORIENTED LANGUAGES AND OBJECT ORIENTED LANGUAGES

Ans: procedural programming executes serially, and OOPS - memory is
alloted when the objects are created. no step by step execution.


24. what is the use of friend function (many say it as array)

Ans: we can use that function any where in the module not necessary to
create an instance of class.


26. What are the different types of errors in php

Ans: Fatal errors, Parse errors......

27. What is the functionality of the function strstr and stristr

Ans: strstr -- Find first occurrence of a string
stristr -- Case-insensitive strstr()


28. What are the differences between PHP 3 and PHP 4 and PHP 5

Ans: Every time they will include some new functionalities and some new
functions.....

29. How can we convert asp pages to php pages

Ans: There is a saperate tool for that

30. What is the functionality of the function htmlentities

Ans: htmlentities -- Convert all applicable characters to HTML entities

31. How can we get second of the current time using date function?

Ans: today = date("H:i:s");

33. What is meant by urlencode and urldocode

Ans: to encode urls, returns a string in which all non-alphanumeric
characters.