Using curl to Automate WordPress Administration

I am working on automating data migration from an existing site to a new WordPress version. The following scripts can help you to login to WordPress automatically, save the WordPress session cookie, and use the cookie with subsequent curl commands to automate WordPress administration. All of this is done using the curl command with no …

[ Continue Reading... ]

SQL GROUP BY, AGGREGATE FUNCTIONS and HAVING

First, the `tl;dr‘ version: GROUP BY and HAVING work together with aggregate functions such as SUM(), AVG() etc… Here’s an example from later on in this post: Note: I used Postgresql to write this post so you may need to slightly adjust the queries if you are using another database such as Mysql. The GROUP …

[ Continue Reading... ]

Java String Literals, Construction and Comparison using ==

I recently ran across the following questions that highlight the differences in how Java String objects are constructed. My original assumption was that s1 and s2 would hold references to two different objects. Thanks to Java Prepare for the questions The documentation says that == is the object comparison operator. It compares two references to …

[ Continue Reading... ]

Java In-place String Reverse

Here’s my interpretation of how to reverse a String in Java. For entertainment value I have picked a fun string.

[ Continue Reading... ]

Spring Autowired Hibernate Configuration and SchemaExport

When configuring Hibernate in Spring, there are a few ways to get a handle on the Hibernate Configuration object in your code. I believe this way is the most concise. I wanted to get the reference to the Hibernate Configuration object so that I could use it with SchemaExport to auto-generate the ddl and save …

[ Continue Reading... ]