Posts

JDOQL: What is the equivalent of SQL's count(*) in the JDO world?

Displaying large datasets There are often times when you need to display data in a table format and the size of the potential dataset is extremely large and so ends up being represented across many pages and displayed with the usual "previous/next" buttons. Most UI frameworks need to know upfront what is the total count of items you will be displaying so they know how many pages there are and can display some text above the table that says something like: Items 31-40 of 397 Avoiding a big database, memory and CPU hit What you don't want to do is force your JDO ORM (or an ORM using any Java persistence standard e.g. JPA) from instantiating ALL of the objects just so that your UI knows the total count of items to be displayed. To do this you need to perform some kind of 'count' query. In JDO this is done by setting the result set to 'count' but count needs a parameter. e.g. PersistenceManager pm = getPm(); Query q = pm.newQuery(MyClass.class);          /...

Upgrade from MySQL 5.7 to MySQL 8 - Do it! Do it now!

Our web hosting application platform Pagebloom has been running on MySQL 5.7 for some time now and it runs brilliantly - it's exceptionally responsive and provides great user experience. The performance of the underlying MySQL 7 has been great except... Clustered indexing: The double edged sword Part of MySQL's great read performance is due to an "under the hood" design feature that most software developers who use it are blissfully unaware of. In the automobile world it would be the equivalent of fuel injection or a turbo/super charger or in German - a Kompresser! These are features that can be added to the design of an engine to provide a significant boost in performance. For MySQL this feature is what is known as a "Clustered Index". The main concept of a clustered index is that the core data of each record is actually stored within the primary key index. Yes, you heard correctly - actual record data is embedded into the B-tree frames that make up the ind...

The case against IP 6: When scarcity can be a good thing

With IP 4's limited range of public IP addresses and free IP 4 addresses becoming scarce it makes sense that the world should migrate over to IP 6 ASAP ... or should it? What's an IP address anyway? A bit of background for those who did not know that the internet predated the world wide web by a good two decades or more: IP addresses are kind of like  a physical street address. You write a physical address of a place anywhere in the world on the front of an envelope, put an appropriate stamp on it and then one or more postal services around the world will cooperate with each other to, hopefully, get your envelope to the "TO" address you specified. A public IP address identifies a "place" (e.g. a web server) on the internet where internet "data packets" can be sent. There's a lot of different protocols that can be used to send data across the internet but at the lowest levels they are all based on a simple principle: The internet is basically on...

How to reset MySQL 8 root password on CentOS 7 and 8

Occasionally you come up with the world's most unbreakable root password for a MySQL 8 installation and you get distracted before you record it somewhere.... and you remain distracted for 3 months. Then you return to the project where this database was needed and ... whoops! What was that totally awesome password? Here's how you can reset your root password. This was based on a page that had a similar instructions except none of them worked - lots of errors and incorrect names - like referring to mysql instead of mysqld when stopping the service. Here we go: All as root user: Create a file in /var/lib/mysql called mysql-pwd with the following contents: ALTER USER 'root'@'localhost' IDENTIFIED BY 'anotherPwd28^$94'; Shutdown mysql   systemctl stop mysqld Run MySQL executing the given init file under the mysql user   mysqld --init-file=/var/lib/mysql/mysql-pwd --user=mysql & Check the MySQL log to make sure no errors occurred:   vi /var/log/mysqld.log ...

Asynchronous notifications from the server to the browser - perfect

This is why I love Wicket Java Web UI framework. It provides all the power of the latest JavaScript and browser capabilities without ever having to write any code in that crazy, non type safe, interpreted JavaScript language ;) Wicket components have all of the required JavaScript embedded within them meaning a Java developer of any skill level can simply instantiate a few components, add them to a page and bang! - too easy. So about asynchronous notifications... The 'status update' problem Often within a web app the user will invoke some operation that can take some time. The page or part of it needs to be updated to reflect the new status after the operation has completed. To do this developers, traditionally, have had to do one of these: Make a request to the server which the server delays responding to until the operation has completed. This is inviting bad karma to your web server because it ties up a connection and the number of connections in a web/app ...

I'm coming clean. I'm letting everyone know that I'm a bug addict...

The other day I added a new, rather complex feature to our Filegroove product. I did the normal planning and then analyzed the pros and cons of a few different design implementations. I then went ahead and implemented the chosen design and ... ... it was a bit of an anticlimax when it basically worked as designed, first go 🙂 Normally I have the excitement of hunting down some tricky bug that needs super detective skills because of some incorrect assumption I had made or due to some oversight but no ... the damn thing just worked! My reaction made me ponder: I think I've become addicted to the dopamine hit I get when I solve a tricky bug. I miss that when everything just works - need to get my dopamine hit from somewhere else - maybe some FB pings? LoL! Here's my official admission: I'm a bug addict. I've been using bugs for many year now. I tried to get off the bugs but its just too hard. After a few days without bugs I can't sleep at night and go ...

Git and Subversion - the working directory is fundamentally different

One of the fundamental differences between Git and Subversion that I didn't understand at first and, IMHO, doesn't really get much coverage in the documentation is the way the 'working directory' is treated. Git is all about branching and it is indeed very good at that but what happens when you switch branches in Git is completely different to when you switch branches in Subversion. You could say that you never really "switch" branches in Subversion. You can create branches and checkout a branch in subversion: In subversion if you want to use a branch you typically 'check it out' to a new clean 'working directory'. This directory is a new place in your filesystem and you perform work on that branch in this new working directory. You can't easily 'switch' a working directory from one branch to another branch. With subversion if you are working on a number of different branches then you would typically have a number of different...

Classic software engineering mistakes: To Greenfield or Refactor Legacy code?

Oh, the humanity! If we were not in the software engineering game but, rather, in the civil engineering game then the equivalent of this article would be called 'Classic Civil Engineering Mistakes' and contain graphic videos of buildings and bridges collapsing and thousands of people running for their lives. It's hard to get emotional about something you can't see Unfortunately software is a rather intangible asset that doesn't lend itself to dramatic and emotional visualizations. When it comes down to it the life work of a software engineer, when reduced to it's lowest conceptual level, is the specific arrangement of sequences of 1's and 0's on one or more hard disks (or some form of solid state storage) residing on a server or desktop computer. How those 1's and 0's get there and 'which' sequences work and which don't is not really a black art but it definitely requires some intelligence but surprisingly a lot more common sens...

As a Java UI Framework let me say Wicket Rocks!

Everybody knows that Wicket rocks as the best Java UI framework available. Sure there's people out there still using JSP (with/without struts), Spring MVC (Huh?), JSF, even raw servlets and a host of many other Java frameworks but let me repeat; "Everybody knows that Wicket rocks as the best Java UI framework available". I suppose I should clarify that a bit.... everyone who has ever used Wicket knows that it rocks.... You see, if you're a Java programmer who "gets" the whole Object Oriented paradigm and loves the reusability that comes from plug and play component architectures and from clever use of inheritance then you simply won't find ANY other framework that satisfies your need for such architectural candy at the UI level but that still allows the visual candy that expert web designers can create when they have full control over HTML and CSS. All I can say is "Get into it already". Get started. Read up on it. We've been using W...

Java package name structure and organization - best practice and conventions

When it comes to conventions regarding how to structure your packages in Java (or any other language in fact) there is a wide variety of opinion. Making the right decision can promote productivity, understandability, quality, flexibility and the construction of reusable frameworks. I've seen some people promote 'package by feature' over 'package by layer' but I've used quite a few approaches and found 'package by layer' much better than 'package by feature' but further from that I have found that a hybrid: 'package by layer then feature' strategy works extremely well in practice and here's why I think that's so. Package by layer then feature The 'package by feature' people tend to want to put all user interface, model classes, persistence classes (eg., DAO - if you're into self torture ;]) for a particular feature into the same package and according to many examples, the same directory. i.e. they don't us...

Modal X 1.3 for Wicket released

We have recently released a new version of the open source Modal window extension framework for Wicket called ModalX. We have also added an getting started guide, a live demo and an example application that demonstrates its main features. Feel free to leave any comments about the library here. Take a look at the ModalX home page here: ModalX Home Page See the live demo here: ModalX Live Demo

Wicket DateTimeField - trick for young players

If, like me, you tried to use the DateTimeField component in the Wicket extensions library and saw an extra spurious TextField appear in your form and you didn't know why... then read on: It turns out that the DateTimeField is actually rendered as a Panel by Wicket. Being a field in a Form I naturally (according to what I saw in some online example code) just entered markup within my form like this: <input type="text" id="startDate"> but of course that can't work. Wicket can't render a panel into an input element (well not with any success at least!). It turns out that as a Panel the DateTimeField is best entered as a <div> in your markup: <div id="startDate" /> That allows the DateTimeField to be rendered correctly. Yeehah! Once again I want to congratulate the Wicket team on the world's best object oriented, component based, Java User Interface framework.... a big claim I know, but try it and I think you'll a...

Feel like a Pizza?

Try Gabriel's Pizza and Ribs, using the munchopia online ordering service: Click here to: Take a look
Want to save the planet by saving on your power consumption? Then you need to install LED lighting in your home or business: EO LED

New website for Step Ahead Software Development

The software development section of Step Ahead Software now has a new website. It's at: http://develop.stepaheadsoftware.com If you need any software or web development let us know. We have been providing outsourced software development since 1994 and have a large range of satisfied companes from small businesses to large corporations like Canon and Lucent. We specialize in development in the following fields: Windows Desktop Web application development Enterprise website application development We are experts in the following languages, frameworks and databases: Java, JDO, JPA, Wicket, Echo, JSP, J2EE, DataNucleus, Hibernate C++, MFC, OWL, .Net, GDI, GDI+ MySQL, Oracle, MS SQL Server We also have 'off the shelf' modules for fast 'time to market' of a variety of projects: Entity management framework: For extremely fast implementation of websites or desktop applications that require users, people, groups, organizations, authentication, products, etc., Visual editing ...

Step Ahead: Authentication in the Matrix!

A little while back one of our customers, Matrix Education, expressed a desire to improve the security and protection of their rather sophisticated intranet based enterprise management software. To this aim we discussed integrating our entity management system into their web based intranet application. Our entity management system is a powerful role based system that allows the management and authentication of entities including users, actors, organizations etc., It comes with a powerful, intuitive web based user interface to allow easy creation and management of entities and such as users and their roles and 'access rights'. Our separate workflow management system plugs right into the entity management system for customers who want to manage processes within their organization efficiently and automatically. The customer understood that integrating our well established 'off the shelf' user management and authentication framework would provide a more reliable, high qual...

pagebloom's Media Asset Manager shines!

Image
Motivation About this time last year ago we conceived an idea to enhance our pagebloom enterprise content management system (ECMS) to help manage the media assets (images, Flash intros etc.,) for the websites that it hosts. The idea was to create an advanced and powerful auto replicating media asset management system that could serve images from the most appropriate media host chosen from a range of available media hosts located around the world. That system was implemented and integrated with the pagebloom hosting service earlier this year. How it works If a particular host goes down or is under high traffic then the media assets can be served from alternative media hosts - all without site visitors experiencing any negative affects from the loss of performance on the degraded or lost media server. Concept payback! Since the integration of the new media asset manager none of the media hosts have experienced any problems, luckily. Well that was until today! And pagebloom carried fort...

Welcome to the Step Ahead Software blog

This blog is where we'll keep you up to date with all the news and happenings, product releases and product updates of Step Ahead Software. I'm your host, Chris, so sit back, relax an enjoy the journey!