Matt RaibleMatt Raible is a writer with a passion for software. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.
You searched this site for "young russian teenboy model pre teen". 788 entries found.

You can also try this same search on Google.

Hypersonic PC Sucks!

Hypersonic PC Sucks - they charged me $165 for returning the POS Aviator ZX7. I returned it because the following items did not work: power cord, bluetooth card, wireless card. Otherwise, it was a nice machine. Hypersonic PC Sucks because they didn't refund my money until I filed an investigation with my credit card. And then they claimed there was a $100 charge for scratches on the box, and the shipping costs are non-refundable ($65). After this, they warned me:

We also reserve the right to charge a restocking fee of 15%.

Maybe this post will cause them to up-the-ante. In the meantime, I hope Amex gets me a full refund.

Posted in General at Sep 15 2003, 09:02:42 AM MDT 6 Comments

Persistence Options with existing SQL

At my new gig, it's not an option to use Hibernate. Their data model is too complex, and they've already written a bunch of code and it's corresponding SQL to get the information they need (think lots of inner joins, stored procedures and selects in where clauses). It was my task last week to port all the JDBC from one project to a more general framework to be used by all the websites we're building. The existing code is in the following form:

PreparedStatement pstmt = 
    conn.prepareStatement("select * from table where id=?");
pstmt.setInt(1, id);
ResultSet rs = pstmt.executeQuery();
MyBean bean = new MyBean();
if (rs.next) {
    bean.set(...);
    ...
    bean.set(...);
}

After doing all my persistence with Hibernate for the last year, it made me cringe to have to resort to this archaic (though tried and true) way of populating my objects. So I pinged the struts-user mailing list and asked what my options where for populating an object from a ResultSet. Basically, I was looking for a 1-2 line solution that didn't affect performance too much. After jossling back and forth for a while, I came up with 2 options:

I did some performance testing and the ResultSetUtils class had the same performance numbers as rs.next() { set, set, set }, so it was definitely a viable solution. The downside? You have to name your resultset columns the same as your object's properties - and it's case sensitive. iBATIS was also a slick solution - as soon as I added <settings useBeansMetaClasses="false"/> to my sql-map-config.xml file, the performance was comparable to the ResultSet options (I turn it on when deploying, off for unit tests).

My Point: We're using iBATIS for our Persistence framework, and I dig it. It allows us to keep the complex SQL (externalized in XML files) that has already been written and it took me about a 1/2 hour to setup. I'd recommend Hibernate if you're starting a DB from scratch, but iBATIS seems to be a great solution when the SQL is already in place.

Will I add an iBATIS option to any of projects? Naahhh, then I'd have to work with Hibernate to export the SQL for each call, and I'd have to update my XML file's SQL everytime I change something in the DDL (currenly Hibernate and XDoclet perform this magic).

Posted in Java at Sep 15 2003, 07:17:30 AM MDT 1 Comment

HowTo: Check for JUnit in $ANT_HOME/lib

One of the most common problems with my sample apps is that developers (when compiling from source) forget to put junit.jar in their $ANT_HOME/lib directory. I put it in the README, but I guess no one reads that sucker. So now I have a new strategy - stop the build if it's not there:

<!-- Check that junit.jar is in $ANT_HOME/lib -->
<available classname="junit.framework.TestCase" 
    property="junit.present"/>
<fail unless="junit.present" 
    message="Please copy junit.jar into ${env.ANT_HOME}/lib"/>

Posted in Java at Sep 12 2003, 01:25:18 PM MDT 1 Comment

OS X: Can't get rid of Microsoft

In an effort to free up some space on my PowerBook, I attempted to delete OS 9. To my knowledge, this is possible by deleting the "/Applications (Mac OS 9)" folder and the "/System Folder." Sure sounds good, but I can't get rid of the Microsoft Excel program in my Applications folder. When I try to delete it, the whole OS freezes up and the only thing I can do is reboot (by holding down the power button).

I took Mimi-Me into the Apple Store last weekend to see if they could help. They ran "Repair Permissions" and then ran Disk Warrior on it - which took several hours. They assured me that running Disk Warrior would fix it, but no dice. Any ideas?

Posted in Mac OS X at Sep 11 2003, 09:05:47 PM MDT 4 Comments

Setting up CVS Spam

I think Mike turned me on to CVS Spam. CVS Spam is basically some scripts that send you HTML-formatted e-mails of diffs from CVS commits (example). I got motivated today and installed it on Raible Designs' CVS server and the one at my new gig. Works awesome! Here's the steps I had to take (outside of the documentation):

  • Download and install (./configure, make, make install) ruby. By default, this goes into /usr/local/bin/ruby.
  • Create a symlink in /usr/bin (ln -s /usr/local/bin/ruby) So the .rb files you added in CVSROOT will work. They're pointing to /usr/bin/ruby by default.
  • Edit cvsspam.rb, line 850, to be an absolute path to your CVS repository. It's currently getting "CVSROOT" as an environment variable, and I have my $CVSROOT set to my default CVS server (so I can type cvs co project, etc.).

Now the question is, does SourceForge have ruby installed on their servers? Or maybe I should just install it in my home directory and configure some projects (i.e. Roller) to use CVS Spam.

Update: I discovered that with new versions of Ruby, you need to apply a patch to CVS Spam (v0.2.7):

Index: cvsspam.rb
===================================================================
RCS file: /var/lib/cvs/cvsspam/cvsspam.rb,v
retrieving revision 1.37
diff -u -r1.37 cvsspam.rb
--- cvsspam.rb	7 Sep 2003 18:10:50 -0000	1.37
+++ cvsspam.rb	11 Sep 2003 20:41:50 -0000
@@ -878,6 +878,9 @@
 $bugzillaURL = nil
 $jiraURL = nil
 $ticketURL = nil
+$viewcvsURL = nil
+$choraURL = nil
+$cvswebURL = nil
 $from_address = nil
 $subjectPrefix = nil
 $files_in_subject = false;

Posted in Java at Sep 10 2003, 05:04:25 PM MDT 2 Comments

My tips o' the day

I found an easy way to update a MySQL database with new columns this morning. The traditional way is to create an ALTER_TABLE script and run it. However, I had added more than 30 columns, and creating this script sounded like a pain in the ass. Keep in mind that I use Hibernate to create my database from scratch - tables, and all. If you're familiar with appfuse, you might be able to use this stuff.

  • Dump the existing (production) database using "mysqldump -c database > database.sql". Edit this file, replacing CREATE TABLE with CREATE TABLE IF NOT EXISTS. The "-c" option includes column names in the insert statement.
  • Create an empty database (appfuse: ant db-init) and export (mysqldump database > create-tables.sql) it.
  • Drop all the tables in the production database (backup first!), mysql < create-tables.sql followed by mysql < database.sql.

Of course, other suggestions are welcome - I'd love to see a mysql diff tool that generates the ALTER script for me!

My other tip is how to start/stop Windows services from the command line - don't know why I haven't used this sooner.

net start "$serviceName"

Where $serviceName is something like "Apache Tomcat 4.1" - use "net start" to see all currently started services.

Posted in General at Sep 09 2003, 02:07:31 PM MDT 2 Comments

JSTL, XPath and the State Tag Library

One of the projects I'm working on has a requirement to assign a user's permissions by state. I'm using the state tag library, which makes it very easy to make a drop-down of states. So, rather than creating a "states" table in the database, I wanted the ability to lookup state's abbreviations and full names in the tag library (since only abbreviations are stored in the database, as a comma-delimited list). So I used JSTL's XML tag to capture the output of this tag and then filter the states with XPath for the user's assigned states. Pretty slick IMO.

<label>Viewable States</label>
<%-- Sets the available states so they can be parsed with XPath --%>

<c:set var="statesHTML">
    <state:state name="state"/>
</c:set>

<% 
    // fake it for demo - real version has these as a bean property
    String[] states = {"CO", "AZ"};
    pageContext.setAttribute("userStates", states);
%>

<x:parse var="states" xml="${statesHTML}"/>
<%-- Loop through and parse the list of states --%>
<x:forEach var="option" select="$states/select/option">
    <c:forEach var="current" items="${userStates}" 
        varStatus="status" >
        <x:if select="$option/@value[. = $current]">
            <x:out select="$option/text()"/>
            <c:if test="${!status.last}">,</c:if>
        </x:if>
    </c:forEach>
</x:forEach>

Posted in Java at Sep 06 2003, 11:43:57 AM MDT Add a Comment

Log4J: 2 Appenders - one gets errors, other gets all (doesn't work)

I sent a message to the log4j-user mailing list this afternoon, but have not received a response - so hopefully someone can help me out. Here's the problem I'm having:

I have two appenders - a console and a file.  I want all messages to 
go to the console and only <= error to go to the file.

In my file appender, I have a filter to only get the error messages:

<filter class="org.apache.log4j.varia.LevelRangeFilter">
  <param name="LevelMax" value="ERROR" />
</filter>

Then in <root> I have:

  <root>
    <level value="DEBUG"/>
    <appender-ref ref="CONSOLE"/>
    <appender-ref ref="FILE"/>
  </root>

From the documentation I've read (i.e. http://tinyurl.com/meef), this
*should* work.  However, all messages get logged to both the console
appender and the file appender.

Any advice is appreciated.

Posted in Java at Sep 05 2003, 10:11:38 PM MDT 6 Comments

I dig Dave's New Look

Dave, I dig your new Bluebar Theme. Very nicely done - now if I could just get you to make "Blogging Roller" into a link with the same href as "Home." I constantly click on it with no results. That goes for all Roller users - please make the title text or image of your blog into a link. Here's how:

<a href="$ctxPath/page/$userName" title="Home">Your Title Here</a>

Posted in Roller at Sep 05 2003, 05:18:13 PM MDT Add a Comment

How to run Tomcat on Port 80

I've had people ask me how to run Tomcat on Port 80 before (as a non-root user). I've never had an answer until now. Today I found that Holger Klawitter has a solution using Kernel space port forwarding. I don't have a need to try this at the moment, but if someone is using it - please share your experiences.

As an FYI, Tomcat 5 will use commons-daemon making this much easier to do. Also, the first Beta of Tomcat 5 (5.0.9) has been released.

Posted in Java at Sep 04 2003, 09:45:16 AM MDT 8 Comments