Archive for July, 2009


Detecting domain names in php ..

Jul 14, 2009 in php, Web


if (strpos(getenv('SERVER_name'), '')!==false) { 
  echo "<img src='1.jpg'>"; 
} elseif (strpos(getenv('SERVER_name'), '')!==false) { 
  echo "<img src='2.jpg'>"; 

Joomla templates design tutorial ..

Jul 10, 2009 in Joomla

Good article on creating templates for Joomla

Joomla Template Tutorial

UML2 Diagrams Notes ..

Jul 02, 2009 in Uncategorized

— See

  • Activity Diagram
    — typically used for business process modeling, for modeling the logic
    captured by a single use case or usage scenario, or for modeling the
    detailed logic of a business rule.
    — See
  • Class D..
  • Component D..
  • Composite Structures D..
  • Deployment D..
  • Profile Definition D..
  • State Machine D..
  • Use Case D..

Notes on “Java Web Services” ..

Jul 02, 2009 in Books, Java, Software, WebServices

This book is a bit old.. 2002..

  • — SOA – Service Oriented Architecture
    — 3 major roles: Provider, Registry (Broker) and Requester.
    — SOA is based on web services.
  • — SOAP – Simple Object Access Protocol
    — 2 major methods: Message-based Document Exchange AND RPC
    (Remote Procedure Calls).
    — All structures based on XML.
    — A SOAP message contains an Envelope and a Header.
    — A SOAP message may contain (MIME) attachments.
    — Main transport protocol is HTTP(S).
    — Providers (Receivers) are usually based on Servlets.
  • — SOAP-RPC
    — Method signatures contain a single SOAP structure.
    — SOAP service methods must match info in deployment descriptor.
    — Errors and Faults: VersionMismatch, MustUnderstand, DTDNotSupported, etc..
  • — WSDL – Web Services Description Language
    — WSDL is an XML grammar for describing a web service
    as a collection of access end-points capable of exchanging
    messages in a procedure- or document-oriented fashion (p. 72)
    — The reasonable flow is to create service methods and
    than generate WSDL from code using tools.
    — Best practices: web service is (functionally) coarse-grained
    and messages are more business-oriented than programmatic.
  • — UDDI – Universal Description, Discovery and Integration
    — Similar to an Internet search engine for businesses.
    — UBR – UDDI Business Registry (the Public Cloud).
    — Designed for B2B mostly.
    — 2 APIs: inquiry and publishing API.
    — JAXR = Java API for XML Registries.
    — Some details: Categorization (NAICS, ISO, etc..),
    Identifier (DUNS, Thomas Reg, etc),
    tModel (web service metadata)
  • — JAX-RPC and JAXM
    — JAXM = Java API for XML Messaging.
    — JAX-RPC = Java API for XML-based RPC.
    — JAXM may be used as a frontend to SOAP-based messaging
    frameworks through the use of “profiles”.
    — JAX-RPC covers code generation for client and server parts,
    dynamic SOAP, creating services within J2EE and J2SE environments,
    bindings, serialization, mapping of datatypes between WSDL and Java,
  • — The Java Web Service (JWS) Standard
    — Proposed by BEA, using templates to create simple web services.
    — Example (HelloWorld.jws <- note the .jws extension)
    Note the annotations @operation, @conversation ..

    import com.bea.jws.*
    public class HelloWorld extends Service {
      * @operation
      * @conversation stateless
      public String getHelloWorld() {
        return "Hello, World!";

    Other values for @conversation are ‘start’, ‘continue’ or
    ‘finish’. The ‘start’ directive, for example, starts a session.

  • — Security notes
    — Use of SSL (HTTPS), encryption, signing and secure hashing.
    — Security Assertion Markup Language (SAML) – used with Single Sign-On (SSO).
  • — Resources

Colophon – European (Alpine) Ibex – a wild goat.

Eclipse UML2 Tools notes..

Jul 01, 2009 in UML, Uncategorized

Great introductory article on Eclipse UML Tools

Table of Contents

1. UML

    1.1. Overview
    1.2. Definition
    1.3. UML Profiles

2. Installation of Eclipse UML2 Tools
3. Eclipse UML2 Tools

    3.1. Creating UML Diagrams
    3.2. Multiplicity
    3.3. Interfaces
    3.4. Viewing the .uml file

4. Thank you
5. Questions and Discussion
6. Appendix: Class diagrams

    6.1. Overview
    6.2. Classes
    6.3. Attributes
    6.4. Interfaces
    6.5. Relationships

7. Appendix: Model-Driven Architecture (MDA)

    7.1. Overview
    7.2. Platform Independent Model (PIM)
    7.3. Platform Specific Model (PSM)
    7.4. Code Mode

8. Links and Literature

For reverse engineering, see “MoDisco” (Model Discovery)

For building UML models from legacy packages, here are some

- the first one builds a Java Abstract Syntax model (based on the JDT Java API) from a Java 
compilation unit, this Java model may be then transformed into a UML2 model using an ATL 
model-to-model transformation (;
- the second one builds a UML2 model from a Jar file.

Linux DNS configuration notes..

Jul 01, 2009 in Linux

  • — The DNS server is ‘named’
    — $ ps -ef | egrep named
    — $ /etc/init.d/named status
    — Config file is /etc/named.conf (see example below)
  • — Configuration examples in /etc/named.conf file
    -- // Reverse DNS map
    zone "" {
            type master;
            file "/var/named/192.168.10.rev";
    -- // Forward DNS map
    zone "" {
            type master;
            file "/var/named/";
  • — file “/var/named/”
    $ttl 38400
    @       IN      SOA root (
                            38400 )
                    IN      NS
                    IN      MX      10
    dns             IN      A
    mach01          IN      A
    ;; .. other machines..
    machdbs01       IN      A
    ecnfs02         IN      CNAME   machdbs01
    ecnapp02        IN      CNAME   machdbs01
    ;; External machines
    machext01       IN      A
    ecnpart02       IN      A