Dominant in many ways, Java offers a lot for developers: strict object-oriented paradigm, architecturally agnostic virtual machine, garbage collection – all are there to aid developers. However, like any other programming language, it is still susceptible to developer mistakes.In this article Toptal freelance software engineer Mikhail Selivanov discusses ten common mistakes that Java developers make and how to avoid them.
The single-file script can be placed in a web directory and loaded in a browser. It uses scandir to locate all the contents recursively, then filesize to get the properties of each item.
Responsive, Dynamic, Modern
The script also displays a nice icon for each type of file, and the last modified timestamp.
Folders are shown initially closed but a simple click expands them dynamically to reveal the contents.
Putting the Customer in Control
The script is used as a report for our web hosting customers, to give them more information about their accounts.
Most hosting control panels show disk quota and usage, but we were asked by customers to break down the usage in detail, so that they could get an idea where the space was being used. From personal experience we know webspace gets used over time for all sorts of random things – obsolete projects, testing space, a handy spot to dump that file you need to transfer one time only….
We had been providing this information manually, using the linux ‘du‘ command. This has useful parameters such as –human-readable and –max-depth which made it ideal. However translating this function into a customer-facing tool in a safe and secure way meant a different approach – in our case using PHP.
We continue to use ‘du’ “under the hood” to provide a daily report to customers via our customer portal. Automatic warnings are generated in case a customers is getting close to their quota.
How big is that Folder in the Window?
One interesting thing we found is the different ways that file and folder sizes are calculated. There is also some differences in parameters for du (apparent sizes, rather than disk usage) that had to be taken into account when comparing PHP’s method of calculating file space usage with Linux’s (and our FTP server software).
We display the results in human-friendly units based on one Kilobyte being 1024 bytes.
Remove the .txt extension and upload to your webserver.
Caution: This script will display the names (at least) of all files in your site. Therefore caution should be used before putting it in a public location. Our use of this script is tightly locked down so that it is safe and secure to use.
We would not recommend this script is used at all where register_globals is active (e.g. older php versions).
With thanks to the original creator, Hal Gatewood and user khanvani on fiverr.com
Form Builder – First phase implementation of a new forms framework which will be designed to allow for easy customization of core forms.
Administrator Status Page – Provide CiviCRM site administrators with a single place to check for configuration problems including cron status, file permissions, MySQL permissions, invalid or sub-optimal PHP settings, etc. These statuses can also be queried via API to allow for automated status checks.
Administer Settings improvements – Provides a unified and searchable administrative interface for all configurable settings. Makes it easier for extensions to add settings to this interface.
Installer improvements – Streamlined install process for WordPress sites. Initialize newly installed sites with localization settings (language, currency, etc.) based on the users locale. 2020Media provide pre-installed CiviCRM so we’ll take care of this for you!
Payment processing improvements
Webform CiviCase integration enhancements (sponsored by Compucorp Ltd.) – Add case roles to a case in webforms and allow users to specify a case when creating an activity.
CiviMail Inline (pending code contribution from Veda Consulting) – Improves usability when composing and editing mailings based on templates by allowing the designer to create editable and non-editable regions.
Offline recurring payments (pending code contribution from Veda Consulting and API from JMA Consulting) – Manage recurring contributions that are initiated outside of CiviCRM. Ensures that these Direct Debit or Standing Order payments are allocated to the correct contacts, and that the recurring details are fully accessible to CRM administrators.
Navigation / Menu Improvements (pending collaboration with Compucorp Ltd.) – Modernize the main navigation menu, provide vertical side-bar display options, include icons.
The target date for a stable release is Early October 2015.