Skip to main content

programming

2015


Loading Indicators for AngularJS

Modern web application should be user friendly and notify the User when time consuming operation is on the way, e.g. uploading file or downloading data. There are a some solutions for AngularJS which are fairy easy to integrate. First one is Angular Loading Bar. It can be attached to your application with almost zero configuration and does not affect application design. It attaches the interceptor to $http service and displays a thin progressbar on the top edge of the page.

Tags Input Control for AngularJS

Stay DRY! Don’t waste your time implementing tags input control for AngularJS yourself! There is an excellent AngularJS module for that called “ngTagsInput”. It’s also supports autocomptetion, validations,custom styles and templates. See the demos. It took me just 10 minutes to add that type of control to my application. All you need to do is: Add NPM or Bower dependency npm install ng-tags-input --save bower install ng-tags-input --save Include script and CSS to your html page.

API Authentication: Generating HMAC digest in PHP and Java

User authentication is an important part of the web service API design. One of the common approach is the Hash-based Message Authentication Code – HMAC. Used together with transport level security it provides reliable mechanizm of user authentication and message integrity validation.

One More Grid for AngularJS

After playing with ui.grid I found one more library to impmenent grids in AngularJS - angularGrid. It’s quite easy to integrate and faster than ui.grid. You may find other reasons of using this grid on the author’s post.

Web Security Resources

Here are some useful links to security resources: OWASP to 10 v.2013– A list of the 10 Most Critical Web Application Security Risks. OWASP: list of website security attacks OWASP: list of website vulnerabilities OWASP Development Guide – The OWASP Developer Guide 2014 is a dramatic re-write of one of OWASP’s first and most downloaded projects. The focus moves from countermeasures and weaknesses to secure software engineering. The Developer Guide 2014 is a “first principles” book - it’s not specific to any one language or framework, as they all borrow ideas and syntax from each other.

Booting Spring Webapp

Spring Boot is an excellent tool to bootstrap java application. Most of the references mention how to create a standalone java application, optionally with embedded web server (tomcat or jetty). But Spring Boot supports also creating web applications intended to run within servlet container.

Recalling Testing Principles

If you are involved in software development then recalling a basic testing principles once again is not a waste of time. So here are the principles: A necessary part of a test case is a definition of the expected output or result. A programmer should avoid attempting to test his or her own program. A programming organization should not test its own programs. Any testing process should include a thorough inspection of the results of each test.

Base64 Variants in Java 8

You most likely used Base64 encoding. It’s about encoding any sequence of data as a printable string (digits, lower case and upper case letters). But Base64 has variations. E.g., not every Base64 variant allows safe transfer of any data as URL parameters. For that purpose there is a special dialect of Base64: Url-safe encoding.

The Essential Plugins for JetBrains Idea

JetBrains Idea is my favorite IDE and I love it! It has allthe necessary features for java/kotlin developer out-of-the-box. Even in Community Edition you’ll find a lot of them! Difference between Community and Ultimate editions is with a set of plugins from JetBrains available. Native plugins are well tested and work like a charm, in contrast with Eclipse, where you have to do install/configure some extra plugins before you can start coding.

2014


Conditional Java Configurations in Spring Framework

Spring Framework offers very flexible means for binding application components. Externalizable properties, composite configuration, nested application contexts and profiles.

Sometimes, it is necessary to control whether particular beans or @Configuration will be loaded or not. Spring Framework v.4.1.x does not provide that feature out of the box. But, hopefully, Spring allows conditional bean initialization (see @Profile implementation and @Configurable). So, I created the annotation @Enabled which allows me to control bean instantiation via properties.

@Enabled indicates that a component is eligible for registration when evaluated expression is true. This annotation should be used in conjunction with Configuration and Bean annotations.