Java Code Geeks » Bear Giles http://www.javacodegeeks.com/ Java 2 Java Developers Resource Center Thu, 26 Mar 2015 23:00:43 +0000 en-US hourly 1 http://wordpress.org/?v=4.1.1 Tips for Importing Datahttp://www.javacodegeeks.com/2015/01/tips-for-importing-data.html http://www.javacodegeeks.com/2015/01/tips-for-importing-data.html#comments Wed, 28 Jan 2015 14:00:13 +0000 http://www.javacodegeeks.com/?p=36229 I’m currently importing a large amount of spatial data into a PostgreSQL/PostGIS database and realized others could learn from my experience. Most of the advice is not specific to PostgreSQL or PostGIS. Know the basic techniques Know the basic techniques for loading bulk data. Use COPY if possible. If not use batch processing if possible. ...

 

]]>
http://www.javacodegeeks.com/2015/01/tips-for-importing-data.html/feed/ 0
Signing Digital Certificates with OpenSSL Libraryhttp://www.javacodegeeks.com/2015/01/signing-digital-certificates-with-openssl-library.html http://www.javacodegeeks.com/2015/01/signing-digital-certificates-with-openssl-library.html#comments Fri, 02 Jan 2015 11:00:11 +0000 http://www.javacodegeeks.com/?p=35135 While working on the pgopenssltypes extension I realized that I haven’t discussed how to sign digital certificates using the OpenSSL library. (At least I don’t recall doing so – I might have discussed this in the early days of the blog. I’m pretty sure I’ve already discussed signing digital certificates with the BouncyCastle (java) library.) ...

 

]]>
http://www.javacodegeeks.com/2015/01/signing-digital-certificates-with-openssl-library.html/feed/ 0
Adding OpenSSL User-Defined Types to PostgreSQLhttp://www.javacodegeeks.com/2014/12/adding-openssl-user-defined-types-to-postgresql.html http://www.javacodegeeks.com/2014/12/adding-openssl-user-defined-types-to-postgresql.html#comments Tue, 30 Dec 2014 08:00:28 +0000 http://www.javacodegeeks.com/?p=35053 PostgreSQL supports user-defined types (UDT). These types can be used to provide type-safety on user-defined functions when we would otherwise be forced to use simple BLOB objects. This comes at a significant cost. Many databases support UDT but implementation details vary widely so there’s a significant amount of vendor lock-in. In addition C language UDT ...

 

]]>
http://www.javacodegeeks.com/2014/12/adding-openssl-user-defined-types-to-postgresql.html/feed/ 0
Database Threat Modelshttp://www.javacodegeeks.com/2014/12/database-threat-models.html http://www.javacodegeeks.com/2014/12/database-threat-models.html#comments Sun, 28 Dec 2014 13:00:39 +0000 http://www.javacodegeeks.com/?p=35001 I finally have a breather and can start working through my backlog of ideas. I start with some background that will make the motivation for subsequent posts clearer. What are the threat models for the persistence layer of an application, specificially the threats against the database itself? Remember that a ‘threat’ is an adverse act, ...

 

]]>
http://www.javacodegeeks.com/2014/12/database-threat-models.html/feed/ 0
Using rlimit (And Why You Should)http://www.javacodegeeks.com/2014/09/using-rlimit-and-why-you-should.html http://www.javacodegeeks.com/2014/09/using-rlimit-and-why-you-should.html#comments Wed, 17 Sep 2014 19:00:20 +0000 http://www.javacodegeeks.com/?p=30227 I’ve been going through some old notes and came across a reminder of setrlimit(2). This is a C system call that allows an application to specify resource limitations on a number of important parameters:               RLIMIT_AS – The maximum size of the process’s virtual memory (address space) in bytes. ...

 

]]>
http://www.javacodegeeks.com/2014/09/using-rlimit-and-why-you-should.html/feed/ 0
Getting A List of Available Cryptographic Algorithmshttp://www.javacodegeeks.com/2014/08/getting-a-list-of-available-cryptographic-algorithms.html http://www.javacodegeeks.com/2014/08/getting-a-list-of-available-cryptographic-algorithms.html#comments Fri, 08 Aug 2014 07:00:47 +0000 http://www.javacodegeeks.com/?p=28739 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) { // ...

 

]]>
http://www.javacodegeeks.com/2014/08/getting-a-list-of-available-cryptographic-algorithms.html/feed/ 0
Getting an Infinite List of Primes in Javahttp://www.javacodegeeks.com/2014/07/getting-an-infinite-list-of-primes-in-java.html http://www.javacodegeeks.com/2014/07/getting-an-infinite-list-of-primes-in-java.html#comments Tue, 01 Jul 2014 22:00:52 +0000 http://www.javacodegeeks.com/?p=27224 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 ...

 

]]>
http://www.javacodegeeks.com/2014/07/getting-an-infinite-list-of-primes-in-java.html/feed/ 1
Fibonacci and Lucas Sequenceshttp://www.javacodegeeks.com/2014/06/fibonacci-and-lucas-sequences.html http://www.javacodegeeks.com/2014/06/fibonacci-and-lucas-sequences.html#comments Mon, 30 Jun 2014 10:00:33 +0000 http://www.javacodegeeks.com/?p=27070 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) = ...

 

]]>
http://www.javacodegeeks.com/2014/06/fibonacci-and-lucas-sequences.html/feed/ 0
Do You Have Tutorial Unit Tests?http://www.javacodegeeks.com/2014/05/do-you-have-tutorial-unit-tests.html http://www.javacodegeeks.com/2014/05/do-you-have-tutorial-unit-tests.html#comments Sun, 18 May 2014 22:00:34 +0000 http://www.javacodegeeks.com/?p=25482 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 ...

 

]]>
http://www.javacodegeeks.com/2014/05/do-you-have-tutorial-unit-tests.html/feed/ 0
Creating Maven Source and Javadoc Artifactshttp://www.javacodegeeks.com/2014/02/creating-maven-source-and-javadoc-artifacts.html http://www.javacodegeeks.com/2014/02/creating-maven-source-and-javadoc-artifacts.html#comments Tue, 18 Feb 2014 08:00:27 +0000 http://www.javacodegeeks.com/?p=21278 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. ...

 

]]>
http://www.javacodegeeks.com/2014/02/creating-maven-source-and-javadoc-artifacts.html/feed/ 0