Nokia: going, going, …

Just when you thought Nokia couldn’t make any more mistakes, today they decided to dump Symbian and MeeGo and go with Microsoft’s Windows Phone 7. You have got to be kidding me! At first I thought it was a joke but it isn’t:
http://www.infoworld.com/t/mobile-platforms/nokia-jumps-the-windows-phone-abyss-250

And the cherry on top: Nokia will not support Qt on Windows Phone 7. You must use the Microsoft Windows Phone 7 developer kit.

I have been a long, long time Nokia smartphone user. I guess it is time for me to look at other smartphones.

Speaking of truly stupid ideas, I also just read that RIM’s Playbook will get Android apps support.
http://www.theinquirer.net/inquirer/news/2025857/rim-s-playbook-android-apps-support

Don’t people take history anymore at school, college or university? What was one of the top reasons why OS/2 died? OS/2 could run Windows applications in a Windows VM under OS/2. Why did this lead to the death of OS/2? Developers decided that there was no point in porting their Windows applications to OS/2 because OS/2 could run them under the Windows VM.

If the Playbook will be able to run Android apps then developers will not port their apps to the Playbook. Hence, this will definitely be a nail in Playbook’s coffin.

Regards,
Roger Lacroix
Capitalware Inc.

Mobile Comments Off on Nokia: going, going, …

New: MQ Auditor v1.2.0

Capitalware Inc. would like to announce the official release of MQ Auditor v1.2.0. This is a FREE upgrade for ALL licensed users of MQ Auditor. MQ Auditor is a solution that allows a company to audit/track all MQ API calls performed by MQ applications that are connected to a queue manager.

For more information about MQ Auditor go to:
https://www.capitalware.com/mqa_overview.html

    Changes for MQ Auditor v1.2.0:

  • Fixed an issue with vsnprintf/vfprintf on Linux 64-bit servers.
  • Enhanced the PCF message handling process
  • Improved the speed of the writing the Audit record to a file or queue

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware, IBM i (OS/400), IBM MQ, Linux, MQ Auditor, Unix, Windows Comments Off on New: MQ Auditor v1.2.0

WebSphere MQ v7.0.1.4 Fix Pack

IBM has released WebSphere MQ Fix Pack 7.0.1.4 for AIX, HP-UX, Linux, Solaris and Windows:
http://www.ibm.com/support/docview.wss?rs=171&uid=swg24028106

IBM has released WebSphere MQ Fix Pack 7.0.1.4 for IBM i (OS/400):
http://www.ibm.com/support/docview.wss?rs=171&uid=swg24028106

Regards,
Roger Lacroix
Capitalware Inc.

IBM i (OS/400), IBM MQ, Linux, Unix, Windows Comments Off on WebSphere MQ v7.0.1.4 Fix Pack

LibreOffice 3.3 Released

LibreOffice has just released LibreOffice v3.3.
http://www.libreoffice.org

LibreOffice is a comprehensive, professional-quality productivity suite that you can download and install for free. There is a large base of satisfied LibreOffice users worldwide, and it’s available in more than 30 languages and for all major operating systems, including Microsoft Windows, Mac OS X and Linux (Debian, Ubuntu, Fedora, Mandriva, Suse, …).

Regards,
Roger Lacroix
Capitalware Inc.

Linux, macOS (Mac OS X), Open Source, Windows Comments Off on LibreOffice 3.3 Released

New: MQ File Mover v3.2.1.1

Capitalware is pleased to announce that starting with v3.2.1.1 MQ File Mover is now supported on IBM i (OS/400).

MQ File Mover is a software package that is designed to move files using WebSphere MQ (aka MQSeries). MQFM processes “Action” commands which are controlled through an MQFM Workflow XML file. The user combines a series of Action commands to create the MQFM Workflow XML file.

For more information on MQ File Mover, please go to:
http://www.capitalware.biz/mqfm_overview.html

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware, IBM i (OS/400), IBM MQ, Java, Linux, macOS (Mac OS X), MQ File Mover, Open Source, Unix, Windows 4 Comments

Apache Tomcat 7.0.6 Released

The Apache Tomcat Project has announced the release of version 7.0.6 of Apache Tomcat. This is the first stable release of the Tomcat 7 branch. For more information about Tomcat v7, go to http://tomcat.apache.org/index.html

Regards,
Roger Lacroix
Capitalware Inc.

Java, JMS, Open Source Comments Off on Apache Tomcat 7.0.6 Released

MQ Exit Programming Tips

Here are some things that MQ Exit developers need to be aware of:

1. Most people have never developed and will never develop an MQ Exit. Developing a MQ Exit is an ‘advanced topic’ – hence, you SHOULD have experience developing Windows DLLs or Unix shared Libraries and understand the concept of parallel processing (i.e. threading). Test, search, test again, search again. Google is now man’s best friend. USE IT.

2. Windows XP, 7, 2003 and 2008 have restrictions on system accounts (MUSR_MQADMIN is a system account!!!) for what files or directories that account can access ( i.e. On WinXP, the Exit cannot write to C:\ ) So, if in your exit, the code is writing to C:\myexit.log, and you have a problem then TRY ANOTHER DIRECTORY (even try another file name).

3. MQ Exit Library names are CASE SENSITIVE.

    e.g.
    C:\Program Files\IBM\MQ\Exits64\testexit(SECEXIT)
    is NOT the same as
    C:\Program Files\IBM\MQ\Exits64\testexit(SecExit)

4. Do NOT write a large convoluted exit before testing it. Start with a VERY SIMPLE EXIT and then move to a more complex exit.

5. Before you post a question (on MQ ListServer or mqseries.net) about your MQ security exit, make sure you have tested the following VERY, VERY BASIC MQ security exit. Note: If you cannot get this to work, you should give your MQ exit development project to someone else (Do not post why or complain!!).

You can download the source code from here. Copy the following code to a file and call the file: testexit.c

/**
 *  TestExit for debugging MQ exit issue.
 *
 *  Location of:
 *  Unix/Linux:   /var/mqm/exits64/testexit(SecExit)
 *
 *  Windows DLL:  C:\Program Files\IBM\MQ\Exits64\testexit(SecExit)
 *
 *  MQSC command for Unix/Linux queue manager:
 *  DEFINE CHANNEL ('APP.CH01') CHLTYPE(SVRCONN) +
 *         TRPTYPE(TCP) +
 *         SENDEXIT('/var/mqm/exits64/testexit(SecExit)') +
 *         SENDDATA(' ') +
 *         REPLACE
 *
 *  MQSC command for Windows queue manager:
 *  DEFINE CHANNEL ('APP.CH01') CHLTYPE(SVRCONN) +
 *         TRPTYPE(TCP) +
 *         SENDEXIT('C:\Program Files\IBM\MQ\Exits64\testexit(SecExit)') +
 *         SENDDATA(' ') +
 *         REPLACE
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#if defined (_WIN32)
#include <windows.h>
#include <lm.h>
#endif

#include <cmqc.h>
#include <cmqxc.h>

#if defined (_WIN32)
__declspec (dllexport) void MQENTRY SecExit(PMQCXP  pChannelExitParms,
                                   PMQCD   pChannelDefinition,
                                   PMQLONG pDataLength,
                                   PMQLONG pAgentBufferLength,
                                   PMQBYTE pAgentBuffer,
                                   PMQLONG pExitBufferLength,
                                   PMQPTR  pExitBufferAddr);
#else
extern void MQENTRY MQStart(void) {;}
#endif

void MQENTRY SecExit( PMQCXP  pChannelExitParms,
                  PMQCD   pChannelDefinition,
                  PMQLONG pDataLength,
                  PMQLONG pAgentBufferLength,
                  PMQVOID pAgentBuffer,
                  PMQLONG pExitBufferLength,
                  PMQPTR  pExitBufferAddr)
{
   char       outBuff[512];
   char       tempChl[ MQ_CHANNEL_NAME_LENGTH + 1];
   FILE*      fh;
   struct tm  *newtime;
   time_t     tclock;
   char       *timeBuff;
   PMQCXP     pParms = pChannelExitParms;
   PMQCD      pChDef = pChannelDefinition;

   // Attention newbie user: Make sure you select a valid directory and filename!!!

//   fh = fopen("C:\\Program Files\\IBM\\MQ\\Exits64\\testexit.log", "a+");
   fh = fopen("C:\\Temp\\testexit.log", "a+");

   time( &tclock );
   newtime = localtime( &tclock );
   timeBuff = asctime(newtime);
   timeBuff[strlen(timeBuff) - 1] = 0x00;

   fprintf(fh, "%s : Now entering the security exit.\n", timeBuff);

   memcpy(tempChl, pChannelDefinition->ChannelName, MQ_CHANNEL_NAME_LENGTH);
   tempChl[MQ_CHANNEL_NAME_LENGTH] = 0x00;
   fprintf(fh, "%s : Channel name is %s\n", timeBuff, tempChl);

   if (pParms->ExitId == MQXT_CHANNEL_SEC_EXIT)
   {
      switch (pParms->ExitReason)
      {
         case MQXR_INIT:
              pParms->ExitResponse = MQXCC_OK;
              fprintf(fh, "%s : MQXR_INIT - Channel Initialization\n", timeBuff);
              break;
         case MQXR_INIT_SEC:
              pParms->ExitResponse = MQXCC_OK;
              fprintf(fh, "%s : MQXR_INIT_SEC  - Initialize Security\n", timeBuff);
              break;
         case MQXR_SEC_MSG:
              pParms->ExitResponse = MQXCC_OK;
              fprintf(fh, "%s : MQXR_SEC_MSG - Security Message\n", timeBuff);
              break;
         case MQXR_SEC_PARMS:
              pParms->ExitResponse = MQXCC_OK;
              fprintf(fh, "%s : MQXR_SEC_PARMS - Security Parameters\n", timeBuff);
              break;
         case MQXR_TERM:
              pParms->ExitResponse = MQXCC_OK;
              fprintf(fh, "%s : MQXR_TERM - Channel Terminating\n", timeBuff);
              break;
         default:
              pParms->ExitResponse = MQXCC_SUPPRESS_FUNCTION;
              fprintf(fh, "%s : ERROR - Unknown Exit Reason\n", timeBuff);
              break;
      }
   }
   else
   {
      pParms->ExitResponse = MQXCC_SUPPRESS_FUNCTION;
      fprintf(fh, "%s : ERROR - Not invoked by a security exit.\n", timeBuff);
      return;
   }

   fprintf(fh, "%s : Now exiting the security exit.\n\n", timeBuff);
   fclose(fh);

   return;
}

6. Read the IBM MQ Intercommunication manual for how to compile the security exit (e.g. testexit.c) for your particular platform.

7. Here is the channel definition for this MQ security exit to run on Windows:

DEFINE CHANNEL ('TEST.EXIT') CHLTYPE(SVRCONN) +
      TRPTYPE(TCP) +
      SCYEXIT('C:\Program Files\IBM\MQ\Exits64\testexit(SecExit)') +
      SCYDATA(' ') +
      REPLACE

8. Consult the following web page that contains several security exits that may help you out:
https://www.capitalware.com/mq_code_c.html#exitcode

9. Buy vs Build: You and your management should seriously review the costs associated with building your own security exit / solution. A company can easily spend $50,000 to $100,000 or more building an MQ security solution but they could have spent a fraction of the money if they would have purchased Capitalware’s MQ Authenticate User Security Exit or MQ Standard Security Exit. Also, who will support the internally build custom solution in years to come? Food for thought.

10. Last but not least: Read The Manual (RTM). In particular read IBM MQ Programming Guide, IBM MQ Programming Reference, IBM MQ Intercommunication and IBM MQ Messages and Codes manuals

Regards,
Roger Lacroix
Capitalware Inc.

C, IBM MQ, Programming Comments Off on MQ Exit Programming Tips

Java Programming Tips

The following Java programming tips should help developers write Java programs that will have fewer bugs / problems and run faster:

1. Avoid “equals” conditional statements where the variable is checked against a constant. Always check the constant against the variable.

If myStr (String) is ever null then the following conditional statement will throw an exception

if (myStr.equals(""))
{
   //  blah, blah, blah
}

Whereas if myStr is null then doing the conditional statement as follows will not generate an exception

if ("".equals(myStr))
{
   //  blah, blah, blah
}

2. Avoid “==” (equal to operator) conditional statements where the variable is on the left of the “==” operator. It is best to have the variable on the right of the “==” operator.

Example: You meant to type “==” but you accidentally typed “=”.

if (myInt = 7)
{
   //  blah, blah, blah
}

“myInt” will be set to 7 and the conditional statement will return true but this is not what you wanted to happen.

The safest way to handle this potential problem from ever happening is to flip around the test:

If (7 == myInt)
{
   //  blah, blah, blah
}

The Java compiler will not allow you to have “7 = myInt”. So, these types of typos will be immediately caught by the developer.

3. Use the following simple method to safely test if a string is blank or null:

public static boolean isNullOrBlank(String myStr)
{
   if (null == myStr)
      return true;
   else
      return ("".equals(myStr));
}

4. Avoid using string concatenation operator (+) since it is extremely slow. Use StringBuffer instead.

Use StringBuffer rather than the string concatenation operator (+). String concatenation is extremely slow.

5. Use compound operators with integers as they are faster.

Compound operators such as n += 4; are faster than n = n + 4; because less bytecode is generated by the Java compiler.

6. Use shifting by powers instead of multiplying since shifting is faster.

Shifting by powers of two is faster than multiplying.

7. Limit the number of temporary objects especially in methods and loops. The creation and deletion of objects is time consuming.

8. Reuse objects where possible.

This is easy to implement.

9. Us Double.toString instead of java.text.DecimalFormat for converting Doubles to Strings.

Note: Double.toString is not very fast, so you may want to search the internet for a faster routine.

10. Follow the KISS principle (i.e. Keep It Short and Simple or Keep It Simple Stupid!)

A method should do one thing and do that one thing well.

11. Use static variables for fields that only need to be assigned once.

Static variables will help to speed up your code.

12. Use ArrayList instead of Vector when possible since ArrayList is faster.

13. Use char[] rather than StringBuffer to convert to Strings when possible, since converting from char[] to a String is faster than StringBuffer to String.

14. Use local variables rather than class variables since it is easier to understand the scope of the (local) variables. Also, the JVM can access local variables faster than class variables.

15. Use logical (meaningful) names for your variables and methods in your Java programs. It will be easier for other people to follow (read) your programs. Also, in 6 months, it will be easier for you to recall what you were doing in the code.

Summary:

If you follow the above 15 Java programming tips, you will have fewer ‘strange bugs’ in your code and your Java code will be faster.

Regards,
Roger Lacroix
Capitalware Inc.

Java, Programming Comments Off on Java Programming Tips

Lotus Symphony 3.0 FixPack 1 Now Available

IBM has just released the first FixPack for Lotus Symphony 3.0. It contains a number of small fixes. You can find more detail on what is included and how to install the Fixpack from the following link:
http://symphony.lotus.com/software/lotus/symphony/help.nsf/ReleaseNotes?OpenForm&version=3 fix pack 1

IBM® Lotus® Symphony™ is a richly-featured set of productivity tools that are intuitive and easy to use and provided at no charge. There are three applications that make up Lotus Symphony: Lotus Symphony Documents, Lotus Symphony Spreadsheets, Lotus Symphony Presentations.

In other words, Lotus Symphony is a free alternative to Microsoft Office. 🙂 Lotus Symphony runs on Linux, Mac OS X and Windows.

Regards,
Roger Lacroix
Capitalware Inc.

Linux, macOS (Mac OS X), Windows Comments Off on Lotus Symphony 3.0 FixPack 1 Now Available

Why a Default Transmit Queue is a Bad Idea

A default Transmit Queue (DEFXMITQ) is a bad idea since an endless loop can potentially be created between queue managers or a group of queue managers when a poor configuration is implemented.

Queue Manager Names:
• QMA is the name of a queue manager (shown above)
• QMB is the name of a queue manager (shown above)
• QMC is the name of a queue manager (not shown)

Queue Names:
• A1 is the name of queue in QMA (shown above)
• B1 is the name of queue in QMB (shown above)
• C1 is the name of queue in QMC (not shown)

The loop:
• The MQ application connects to QMA and opens queue C1 that resides on queue manager QMC
• The application puts a message to the opened queue
• Since queue manager MQA does not have a resolution entry for queue C1 or queue manager QMC, queue manager QMA puts the message on its default transmit queue (i.e. queue QMB)
• Queue manager QMB receives the message but since queue manager QMB does not have a resolution entry for queue C1 or queue manager QMC, it puts the message on its default transmit queue (i.e. queue QMA)
• Hence, the message arrives back at queue manager QMA and the loop begins again. The message(s) will loop forever. 🙁

I strongly suggest that companies not use a default transmit queue.

Regards,
Roger Lacroix
Capitalware Inc.

IBM MQ 4 Comments