Sorting algorithms – An Instant Look-up

Sorting algorithms is one of the first stepping stones into computer programming. The site www.sorting-algorithms.com/ provides visual representations of different approaches for data sorting in comparison with each other.

Advertisements

PHP Design Patterns PHP Job Interview Questions

As a PHP contractor, consultant, and freelancer, Larry Truett from San Diego, CA going by the alias Fluffycat had a fair number of interviews – and sometimes he’s been asked technical questions. Here are a few to help you prepare for your next PHP job interview.

=,==,=== – what is the difference between these?

= assigns a value, == checks if value is the same, === checks if value is the same and the variables are of the exact same type.

Echo, print, printf – what is the difference between these?

Print and echo both output what is passed to them. Print acts like a function, so you can use it in complex statements. Printf is used to format the output.

Include, include once, require – what is the difference between these?

Include will includes a file each time it is called. Include_once would only include a file one time, so if a php program has a file in two include_once statements only the first will be done. Requre is like include, but if the file included is not available a fatal error occurs and processing stops.

Continue reading

Publish iCal calendars with local WebDAV server

To publish your iCal Calendar with the bundled OS X Apache web server, edit Apache’s configuration file in /etc/httpd. You must be root, so I expect you know vi and the workings of this file in general.

 % sudo vi /etc/httpd/htttpd.conf

In the Shared Library section, where modules are loaded, add these two lines in the same ordering in their repective sections:

LoadModule dav_module libexec/httpd/libdav.soAddModule mod_dav.c

Then somewhere in the global section add:

DAVLockDB /Library/WebServer/davlocks/DAVLockDB

I used this section to have a webdav folder managed by Apache:

<Directory "/Library/WebServer/Documents/dav">  DAV On  

  AuthName 'WebDAV'  

  AuthType Basic  

  AuthUserFile /etc/httpd/.htpasswd  

  AuthGroupFile /dev/null  

  <LimitExcept GET HEAD OPTIONS>  

    require valid-user  

  </LimitExcept>  

</Directory>

I want this folder protected (somewhat) by a password. To generate the password file
with MD5 passwords (not that old crypt!), please use the -m flag. The file is text. Note that http is vulnarable to sniffing attacks, so someone on your network can get at your password.

 % htpasswd -m -c /etc/httpd/.htpasswd user New password: not_safe  

 Re-type new password: not_safe  

 Adding password for user user

Then set up the folder with permissions.

 % cd /Library/WebServer/ % mkdir davlocks  

 % chown www:www davlocks  

 % cd Documents  

 % mkdir dav  

 % chown www:www dav

In iCal, choose Publish Calendar and specify http://localhost/dav/iCal. Do not FTP stuff into the dav folder; webdav uses its own locking, don’t confuse it.

Good Luck!

From http://www.macosxhints.com/article.php?story=20020912065811863

SOA and Web services

Industry experts say service-oriented architecture (SOA) will soon be the dominant enterprise IT architecture. Why? SOA has the power to transform IT from a bottleneck and cost center into a key source of business flexibility and competitive advantage. But when implemented incorrectly, SOA can disrupt the business. Instead of becoming more agile, your business could become more fragile.

What is SOA?

Service-Oriented Architecture (SOA) is an IT architectural style that supports the transformation of your business into a set of linked services, or repeatable business tasks, that can be accessed when needed over a network. This may be a local network, it may be the Internet, or it may be geographically and technologically diverse, combining services in New York, London, and Hong Kong as though they were all installed on your local desktop. These services can coalesce to accomplish a specific business task, enabling your business to quickly adapt to changing conditions and requirements

When SOA implementation is guided by strategic business goals, you ensure the positive transformation of your business and can realize the chief benefits on an SOA, as follows:

  • Alignment of IT with the business

  • Maximal reuse of IT assets

Together, these help assure that investment in expensive IT projects result in lasting value to the business.

So, how do you tap into SOA, and how does it affect your business? IBM has identified five entry points for ensuring that every SOA-based solution undertaken delivers real business value. Each entry point is coupled with a scenario, or defined approach, that implements the technologies and thus the business values defined in each entry point.

IBM has an extensive article on the subject on its DeveloperWorks web site.