Home » Author Archives: Bear Giles (page 2)

## Getting A List of Available Cryptographic Algorithms

How do you learn what cryptographic algorithms are available to you? The Java spec names several required ciphers, digests, etc., but a provider often offers more than that. Fortunately this is easy to learn what’s available on our system.           public class ListAlgorithms { public static void main(String[] args) { // Security.addProvider(new // org.bouncycastle.jce.provider.BouncyCastleProvider()); // get ...

Read More »

## Getting an Infinite List of Primes in Java

A common problem is to determine the prime factorization of a number. The brute force approach is trial division (Wikipedia, Khan Academy) but that requires a lot of wasted effort if multiple numbers must be factored. One widely used solution is the Sieve of Eratosthenes (Wikipedia, Math World). It is easy to modify the Sieve of Eratosthenes to contain the ...

Read More »

## Fibonacci and Lucas Sequences

This posts touches on three of my favorite topics – math, transferring knowledge through experience (tutorial unit tests) and the importance of research. Most developers are aware of the Fibonacci sequence, mostly through job interviews. To briefly recap the series is defined a: F(n) = F(n-1) + F(n-2), n > 2 F(1) = F(2) = 1   There’s a variant ...

Read More »

## Do You Have Tutorial Unit Tests?

I haven’t posted much recently because I’ve been busy with my new job. This brings up an interesting question – you are busy with a new job a lot when you’ve been doing 6- and 12-month contracts. What works and what doesn’t? What is your learning style?   Depending on the source there are between four and seven learning styles. ...

Read More »

## Creating Maven Source and Javadoc Artifacts

Many people are aware of maven source and javadoc artifacts but don’t know why they would want to create them. I was definitely in this camp – I can see why people want this information but it seemed like a relatively inefficient way to get it since it requires manual navigation of the maven repository. Then I got hit by ...

Read More »

## Creating Sonarqube Projects

Sonarqube (nee Sonar) is da bomb. It’s not something you have to check daily but if you’re serious about quality you’ll check it during sprint planning if not weekly. Check out a sample project at nemo.sonarqube.com, e.g., OpenJPA, to get an idea of what information is available. You might want to focus on a specific component at first, e.g., OpenJPA ...

Read More »

## The Definitive Guide to Coding Style Standards

I’ve been rereading Jeff Atwood (Coding Horror) and Joel Spolsky (Joel on Software) and came across a discussion of coding style standards. It reminded me of the blog entry I was going to write “some day”. Today is “some day”. First I should ruin the joke by pointing it out – this is the “definitive guide” since nobody ever seems ...

Read More »

## Project Student: Maintenance Webapp (editable)

This is part of Project Student. Other posts are Webservice Client With Jersey, Webservice Server with Jersey, Business Layer, Persistence with Spring Data, Sharding Integration Test Data, Webservice Integration, JPA Criteria Queries and Maintenance Webapp (read-only). Last time we created a simple webapp that allows us to take a quick peek into the database. It had very limited functionality – ...

Read More »

## Project Student: Simplifying Code With AOP

This is part of Project Student. Many people strongly believe that methods should fit within your editor window (say, 20 lines), and some people believe that methods should be even smaller than that. The idea is that a method should do one thing and only one thing. If it does more than that it should be broken apart into multiple ...

Read More »

## Project Student: Maintenance Webapp (read-only)

This is part of Project Student. Other posts are Webservice Client With Jersey, Webservice Server with Jersey, Business Layer, Persistence with Spring Data, Sharding Integration Test Data, Webservice Integration and JPA Criteria Queries. When I started this project I had four goals. In no particular order they were to:             learn about jQuery and other ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

• Spring Interview QnA
• Multithreading & Concurrency QnA
• JPA Minibook
• JVM Troubleshooting Guide
• Advanced Java
• Java Interview QnA
• Java Design Patterns