27 December 2015

Oracle 1-character constraint_type codes

code description
C check
not null
P primary key
U unique
Rreferential, foreign key
v view with check
o read only on view

Oracle reference documentation

10 December 2015

7 November 2015

Sequence Diagram by Charles Babbage

Charles Babbage designed the Analytical Engine, a mechanical computer, in the 19th century. Only a partial trial model was built when he died in 1871:

In his 1826 paper, On a Method of Expressing by Signs the Action of Machinery, he explains the need for a graphical modeling language in his project:
The difficulty ... induced me to seek some method by which I might at the glance of the eye select any particular part, and find at any given time its state of motion or rest, its relation to the motions of any other part of the machine, and if necessary trace back the sources of its movement through all its successive stages to the original moving power.
Babbage later stated:
Without the aid of this language I could not have invented the Analytical Engine; nor do I believe that any machinery of equal complexity can ever be contrived without the assistance of that or some other equivalent language.
In the paper he uses a clock as an example:
The diagram below shows, in the middle columns (READING OFF PART), the hands of the clock (Hour, Minute and Seconds) and to the left the parts (TIME PART) connected to them. The time parts are labeled with the letters you can also find in the drawing of the clock mechanism above.
In the ORIGIN OF MOTION rows in the diagram you find arrows indicating the interactions between the parts. The lower half of the diagram shows a vertical time line with indications of the activity (active, direction of motion, variable speed...) of each part.   
It is interesting to note how much an equivalent language UML's sequence diagram is, with its object lifelines, message exchange arrows and activation boxes.

Here's an example of a UML Sequence diagram:

27 September 2015

google anniversary doodle

Google 17th anniversary doodle showcases lego cabinet of the first google server at Stanford:

13 September 2015

Astah: fast modeling

Astah (formerly Jude) is a uml tool with a free community edition. The community edition is only for non-commercial use and lacks some important features that are in the paying (but affordable) pro edition, but it is pretty usable.
Astah works very well, I only have some minor remarks about the interface:

  • did not find a way to make an element uselectable (e.g. when you do not want to multiselect all elements in a package, but not the package itself), like you can in Enterprise Architect.
  • you easily select sub-elements when you want to select e.g. a class
Here is a page with some tips for fast modeling from Astah, and a link with keyboard shortcut.
Some more tips
  • Association classes: right click on an association, choose convert to association class 
Sequence diagram modeling does not have the same level of perfectionb in v7.0:
  • Astah is in message draw mode, even when not appropriate (if you misclick you add an unwanted message)
  • not easy to add methods from diagram to existing classes
  • no automatic generation of communication diagrams from sequence diagrams (and vice versa) 
  • unlike sequence diagrams communication diagrams do not
    • prompt to add new classes
    • support iterations

5 September 2015

model translation dictionary

Speaking in tongues: Nice translation dictionary from one modeling notation to another by Scott Ambler

3 September 2015

epf composer installation

You can find an OpenUp Wiki at the epf site. Any team member participating in the Unified Process project can use the wiki to find guidelines, templates etc to participate in the process.
Whatever process you want to use, you probably want to customise the process to the way you apply it at your company.
The epf (Eclipse Process Framework) composer is an Eclipse based standalone application, which allows you to build your own version of OpenUp or another software development process (e.g. Scrum) you use.

The Getting Started section of the epf site has a fine installation guide, though it's a tad out of sync with the site itself.
Here are the steps I  followed to get it running:

  1. Download the composer from http://www.eclipse.org/epf/downloads/tool/tool_downloads.php
    1.  I took the latest version ( at this moment), chose the download for my platform and extracted the zip to disk.
  2.  Go in to the installation directory and run epf.exe
  3. Download the epf practices from http://www.eclipse.org/epf/downloads/praclib/praclib_downloads.php
    1. For openup (or to roll your own stuff) you just take the EPF practices library. Starting libraries for Scrum and XP are also present here, while at other sites you'll find other templates (here's one for TOGAF).
    2. Follow the instructions at the bottom of  the page
      1. extract the zip file to disk
      2. In your running epf application choose File->Open->Medhod Library
      3. Browse to the directory where you unzipped the library select it and click OK, then click Finish
  4. In the Window menu, Open the Authoring or the Browsing perspective, depending on what you want to do
  6. Select your software process
  8. Customise your process
Follow the tutorial section in the manual. There's a preview to see how the generated process page will look and configuration->publish will publish the customised process site.

22 August 2015

Canon pixma mp510 ink absorber almost full / Canon pixma mp510 absorptiekussen bijna vol

IMy printer showed me this error message: Canon pixma mp510 ink absorber almost full. Please contact the service center.
Here's how I dealt with it:

What is the problem? 

Your printer performs head cleaning by forcing ink through the heads to remove dirt. This ink goes into the waste ink tank, which fills up.
Your printer does not really measure this, but when the page printing counter goes over a threshold it displays this message. You can press OK to make the message go away, but when the counter goes over a second threshold, the message will become: "ink absorber full" and you cannot print anymore.

Contacting the service center will cost you more than a new printer, so basically this message says: this printer is designed to fail, buy a new printer.

Option: replacing the print absorber

If you want to play "self-service" center, you can find the service center manual, with all instructions here. Here's the manual section on partial replacement of the main absorber:
I did not actually try this, but google says you can try to extend the life of your absorber pads by washing, drying and putting them back.

Resetting the counter

Next you need to reset the counter.
More often then not, the waste thank is not full at all, so you can risk just resetting the counter.
Here be dragons: when the tank really fills up, the printer might spill quite some ink!

I did not succeed resetting the counter with the instructions in the service manual (go into service mode, press reset four times, press power).

However I had success with this method from tricks-collections (actually for mp520):
  1. Switch printer off
  2. Press OK/BW copy/RESET simultaneously (1/2/3 in picture below)
  3. Press on/off (button 4) while keeping the above buttons pressed.
  4. When printer is on, release buttons 1/2/3
  5. This might actually be enough, but just to be sure I pressed buttons 1/2/3 while i switched the printer off again.

19 August 2015

Java 9 JShell

Jshell (developed in project Kulla) is a java shell allowing you to type java instructions at the shell prompt and have them executed.

  • if jshell detects a complete statement even without a closing semicolon
  • you can type an expression which will be evaluated 
-> 2 + 2
| Expression value is: 4
| assigned to temporary variable $1 of type int
  • you are not obliged to catch exceptions
  • you can save and load your command history
  • you can use methods and references that will only be defined later
-> double volume(double radius) {
>> return 4.0 / 3.0 * PI * cube(radius);
>> }
| Added method volume, however, it cannot be invoked until method cube(double), and variable PI
are declared
  • you can list current variables, methods...
  •  tab completion as you type
Here's a small tutorial.

9 August 2015

Windows 10 upgrade: login fails

After upgrading to windows 10 my password was not accepted !?
Issue: Windows had changed my default keyboard layout to US/Eng, which did not match my keyboard.
This is a setting you can change in the right bottom corner of the login screen, issue solved:

Some people also use their keyboard driver, the on-screen keyboard can help here:

8 June 2015

Hybris omnichannel commerce performance tips

Nice Hybris performance/design post.
Given that the original blog is inactive I'm copying and structuring some of the content below:

  • Data structure / DB
    • Indexing – Add DB indexes according to your model customization. (High priority) You would like to drop unused indexes also, so that DB should not waste it’s time. (Medium priority) 
    • Ensure your custom types defined into items xml are persisting data into its own table rather than piggy banking on generic table. (High priority) 
    • Any relation-end that does not need to be ordered should have this attribute set to false. A common mistake is that developers cut-and-paste type and relation definitions in items.xml files which may result in unintentionally setting relation ends to be ordered.(High Priority
    • If no deployment table is defined for a many-to-many relation, a generic join table is used to store relations and is not optimal for performance. So ensure you define rel table for your custom many to many relationships.
    • Avoid defining collection types. To maintain data integrity, always use a relation.
  • Front end webserver
    • Leverage web server modules for browser caching and compression. Don’t forget disabling unused apache modules. (Low priority)
    • Ensure Hybris app servers are not serving static content. (High priority) Use CDN for static media/pages delivery. This may reduce 90% load from your infrastructure. If above not possible then simply ensure web server layer fronting hybris serving static media or scale externally.
    •  Perform SSL termination at load balancer/web server. Don’t trouble hybris app servers for SSL handshake. (Medium priority)
  • Ensure only required extensions are deployed on front end hybris servers and avoid deploying any back office extension on front end. This is good for security and performance. (Medium priority)
  • Log/audit
    • Ensure loggers configuration is not too verbose in production. (Low)
    •  Cron job logs. Hmc does not have pagination and this kills your hmc when you open a job with thousands of log files. (Medium Priority)
    • Avoid creating history records if possible or purge them on regular interval. Creating a history record by using auditing service might be fancy but can become a big performance overhead very quickly. Imagine creating an audit record for each stock level change. (Medium Priority)
  • Catalogs
    • Avoid maintaining/developing catalog version aware types. If cannot then avoid making them part of catalog sync. e.g price  - Touching price daily for every product may result into full cat sync. Either maintain prices with online version only or at the time of create/update update both version. This way you can remove price item type from catalog sync.
    • If hybris is not your PIM and you have some other system where merchandising team perform preview before publishing a product then you really don’t need multiple catalog version in hybris. Here you can save lots of overhead from hybris. (High priority)
  • Stock service
    • Ensure you are not checking stock on loading of product detail page, category listing pages or add/remove event on basket page. Do this check only on add item into basket, submission of basket page and just before taking payment (i.e. you need to reserve stock here). (High priority)
    • Ensure hybris stock service is used to check stock status and no logic is written on Stock Model directly. (High priority)
  • Ensure JALO and web app session time out are configured to same value. (High priority)
  • Clustering
    • 4 load balanced hybris app servers should be more than sufficient for a decent load, if solution is designed correctly.  
    • TCP/UDP clustering configuration doesn’t matter much for 4 app server cluster. But prefer sticking with default UDP settings. Hybris works well for either case until you have some serious networking issue. Use udpsniff to validate packets (Low priority)
  • Set the minimum and maximum heap sizes for the JVM to the same value. 8GB should be more than sufficient. More memory means longer GC pause and GC pause means all threads on halt.
  • Search
    • Ensure solution is designed properly. You should be really very smart here.
    • Run Solr in standalone mode with one master server. Perform delta Index frequently 10-15 mins.  Prefer two-phase mode so that your site should not stuck while indexing happening behind the scene. Run full index update once in a week or only when you perform schema change. (High Priority)
    • Use Solr as much as you can. Because this way you can save DB calls. Hybris is very chatty with DB because of it’s cache refreshment and lazy loading concept. I really hate this part of hybris but now used to live with this and identified ways to avoid implementing DB centric solution. E.g. you can use solr to render category listing pages, you can index price and stock data and use this data as much as you can. Whole objective touch DB when it is really necessary. (High priority)
    • < Disable Quick Search in hmc on the front-end and back-end hybris application servers. (Low priority)
  • Use Out Of the Box functionality whenever possible
    • Order Invoice generation/re-generation in pdf format.
    •  Purging/archive items older than 30 days: you can configure this manually through hmc or write an impex.
  • Ensure you use hybris WCMS Navigation node design for Mega menu construction so that you should not end-up preparing nested category hierarchy with every hit. 

26 January 2015

18 January 2015

Glassfish missing DataSource: Table/View XXX does not exist

I have a little old webapp connecting to a DB using a glassfish ConnectionPool.
This used to run fine but on a more recent glassfish (4.0) I do net get a good datasource from Glassfish, resulting in a Table/View <name> does not exist error message (the message is a general symptom for a failed DB connection, which can have many other reasons).
The problem exists if I configure the DataSource in web.xml and also if I inject it using @Resource.
The solution is to explicitly map the application reference to the JNDI name in WEB-INF/glassfish-web.xml:


If you don't, Glassfish returns a ConnectionPoolDataSource. Some people corrected this by refering in their web.xml to the ConnectionPoolDataSource, but the solution above will work both for web.xml and Resource injection.

servlets / JSP links (updated)