Random Thoughts on software related topics such as web, web 2.0, mobile, servers, networks, programming, social networks, engineering, science, and more...
Showing posts with label php. Show all posts
Showing posts with label php. Show all posts
Sunday, May 10, 2009
Saturday, May 9, 2009
All 3 Letter Combinations - PHP Script
View Output
<?PHP
$arr = Array();
array_push($arr, "a");
array_push($arr, "b");
array_push($arr, "c");
array_push($arr, "d");
array_push($arr, "e");
array_push($arr, "f");
array_push($arr, "g");
array_push($arr, "h");
array_push($arr, "i");
array_push($arr, "j");
array_push($arr, "k");
array_push($arr, "l");
array_push($arr, "m");
array_push($arr, "n");
array_push($arr, "o");
array_push($arr, "p");
array_push($arr, "q");
array_push($arr, "r");
array_push($arr, "s");
array_push($arr, "t");
array_push($arr, "u");
array_push($arr, "v");
array_push($arr, "w");
array_push($arr, "x");
array_push($arr, "y");
array_push($arr, "z");
$results = Array();
foreach ( $arr as $three ) {
foreach ( $arr as $two ) {
foreach ( $arr as $one ) {
array_push($results, $three.$two.$one);
}
}
}
foreach( $results as $result ) {
echo " $result";
}
?>
<?PHP
$arr = Array();
array_push($arr, "a");
array_push($arr, "b");
array_push($arr, "c");
array_push($arr, "d");
array_push($arr, "e");
array_push($arr, "f");
array_push($arr, "g");
array_push($arr, "h");
array_push($arr, "i");
array_push($arr, "j");
array_push($arr, "k");
array_push($arr, "l");
array_push($arr, "m");
array_push($arr, "n");
array_push($arr, "o");
array_push($arr, "p");
array_push($arr, "q");
array_push($arr, "r");
array_push($arr, "s");
array_push($arr, "t");
array_push($arr, "u");
array_push($arr, "v");
array_push($arr, "w");
array_push($arr, "x");
array_push($arr, "y");
array_push($arr, "z");
$results = Array();
foreach ( $arr as $three ) {
foreach ( $arr as $two ) {
foreach ( $arr as $one ) {
array_push($results, $three.$two.$one);
}
}
}
foreach( $results as $result ) {
echo " $result";
}
?>
Thursday, March 19, 2009
Boston PHP
This is a website supporting the PHP/OSS community in the Boston, MA area.
You can find my listing here at:
Sunday, January 4, 2009
Saturday, January 3, 2009
Sunday, October 5, 2008
PHP and MySQL with Apache on Mac OS X
The process of installing the *AMP (Apache, MySQL, PHP) on Mac OS X is basically like the typical install of LAMP.
First, to start the web server, go to system preferences, turn sharing on, and check the Web Server check box. This enables the /Library/WebServer directory to be open on the web. The web address will be displayed within the system preferences pane for the sharing. The /Library/WebServer/Documents folder will now host the files for your web server. An HTML file can be held here.
To add PHP, go to the http.conf file and uncomment the LoadModule directive for PHP. A default install of PHP is already installed on Mac OS X. Restart Apache and now a PHP file can be place in the /Library/WebServer/Documents folder and it will process as usual.
To add MySQL, the MySQL package for Mac OS X must be downloaded from MySQL for Mac OS X
website. It is necessary to make some configurations for your system to run MySQL. The configuration of MySQL on Mac OS X can be accomplished by following the directions on that website.
Tuesday, July 29, 2008
Clarification of Encapsulation in PHP - OOP
PHP Developer - Boston, MA | Object Oriented Programming
Here is a demonstration of what is happening to an object member while changing it. This should help you clarify how PHP handles pointers:
class A {
public $val;
public function __construct( $val ) {
$this->val = $val;
}
}
class B {
public $val;
public function __construct( $val ) {
$this->val = $val;
}
}
$a = new A(5);
echo $a->val; // 5
echo "
";
$b = $a;
$b->val = 10;
echo $a->val; // 10
$c = clone( $a );
$c->val = 15;
echo "
";
echo $c->val; // 15
echo "
";
echo $a->val; // 15
echo "
";
$z = 1;
echo ++$z * $z++ + $z; // 7
echo "
";
echo $z; // 3
echo "
";
$m = 0;
do {
echo $m;
} while ( ++$m < 10 );
Here is a demonstration of what is happening to an object member while changing it. This should help you clarify how PHP handles pointers:
class A {
public $val;
public function __construct( $val ) {
$this->val = $val;
}
}
class B {
public $val;
public function __construct( $val ) {
$this->val = $val;
}
}
$a = new A(5);
echo $a->val; // 5
echo "
";
$b = $a;
$b->val = 10;
echo $a->val; // 10
$c = clone( $a );
$c->val = 15;
echo "
";
echo $c->val; // 15
echo "
";
echo $a->val; // 15
echo "
";
$z = 1;
echo ++$z * $z++ + $z; // 7
echo "
";
echo $z; // 3
echo "
";
$m = 0;
do {
echo $m;
} while ( ++$m < 10 );
Labels:
clarification,
classes,
documentation,
echo,
encapsulation,
funcition,
object-oriented,
php,
public,
val,
while
Monday, July 7, 2008
Memory Leaks in PHP
There is a huge memory leak in PHP 5.2 and earlier. When objects nest other objects within it with circular reference, the nested object is never unset when un-setting the object that is instantiating the other objects. The solution would be to upgrade to latest version of PHP 5.3 when it is stable, or un-setting all the objects that get instantiated within an object. Some more solutions are proposed at Memory Leaks in PHP. Another author looks at this problem at Memory Leaks in PHP. The author also tries to propose a solution by modifying the PHP internals and decrement the reference count. This is beyond my scope and time constraints me to do this.
PHP user's aborting scripts
ignore_user_abort() ignores user's aborting the execution of a script. This can prevent a system from coming to an unstable state. If a script executes and has two critical operations which depend on each other, then both of these should be executed and not just one of these operations. Use ignore_user_abort(TRUE); to prevent this occurrence.
Labels:
abort,
administration,
executes,
ignore,
ignore_user_abort,
operations,
php,
script,
server,
state,
system,
true,
unstable,
user,
web,
web 2.0,
web developer
Friday, July 4, 2008
PHP
PHP is a scripting language particularly designed for web development. It can be used for some server administration as well. There are many pros and, unfortunately, many cons for using PHP. Some of the pros are that it is free, open-source, easy-to-use, powerful, easy to find code samples, tutorials, and documentation, and many others. Some of the cons are that it is easy to write "bad" code with, it is slow, it is hard to find out what your code is doing internally, and bugs can potentially exist. PHP is widely used and respected amongst the development community. PHP 5 has the power to be object-oriented and PHP 6 is even heading further in that direction. It is easy to set PHP up on a Linux, Mac, or Windows machine. It works seamlessly with Apache, MySQL, and PostgreSQL.
PHP Developer - Boston, MA
PHP Developer - Boston, MA
Wednesday, July 2, 2008
Drupal 5.8-dev CMS
Drupaul is a CMS (Content Management System) that is very powerful and easy to use. It can save a lot of time with all the core system and third-party modules. A large Web 2.0 website can be built fairly quickly with Drupal. Some of the cons are that it is a large platform and can be slow if not used properly. Any custom PHP, MySQL, third-party modules/themes can easily turn into an issue for the entire system. The environment for developing modules allows easy and deep integration of the system, but can limit your reach. The system is easy to set-up and build a basic website and it allows much more advanced development. It is overall a great free and open-source system!
Labels:
cms,
content,
content management system,
custom,
developer,
drupal,
management,
modules,
mysql,
php,
system,
themes,
third-party
Saturday, May 31, 2008
Random Thoughts Google Gadget
Porting Applications on Web 2.0 can happen so seamlessly. It is easy and quick. If you are a developer, it is free. If not, you will probably have to hire a developer. This is Binding Designs, LLC's Random Thoughts Google Gadget:
Learn more about the Random Thoughts Web Application.
Contact a Web Developer in Boston, MA to discuss social networking applications.
Learn more about the Random Thoughts Web Application.
Contact a Web Developer in Boston, MA to discuss social networking applications.
Labels:
apps,
boston,
gadgets,
opensocial,
php,
random thoughts,
web developer,
xml
Tuesday, May 27, 2008
PHP Developer - Boston, MA
PHP Developer - Boston, MA is a website that offers PHP Developer offers in the Boston, MA area. The public can find out more about the PHP Developer scene in Boston, MA. There is a PHP Developer - Boston, MA Forum set up to offer features such as PHP, Boston, MA, Jobs, and Other. A Portfolio of projects since the year 2000 are available at the website.
Subscribe to:
Posts (Atom)