I’ve been working on a Spring Roo application and needed to add a domain class used to model application users. I tried using the default Roo command for adding the User domain class “entity jpa –class ~.domain.User –testAutomatically”, but Roo does not like that method because the name “User” is a reserved word in SQL. However, you can overwrite the command and force Roo to create a User class by adding –permitReservedWords to the command (entity jpa –class ~.domain.User –permitReservedWords –testAutomatically). I’m not sure if this is the most secure way to do things, but it is an option.
Here is a maven command to list all of the jar files that project is dependent on:
The following code example retrieves the current ip address. I know this works for Python 2.7.
ip_addr = socket.gethostbyname(socket.gethostname())
I’m a fan of cygwin. I needed a command alias for listing only directories using the ls command, so here is what I came up with:
ls -l | grep “^d”
I then added an alias to my .bashrc file like so:
alias ld=’ls -l | grep “^d”‘
Today I was working on a function to convert a map coordinate from degrees-minutes-second format (e.g., 125° 23′ 42” W) to decimal degrees (e.g., -125.395) and I came across the word Sexagesimal. It is not profanity.
I do quite a bit of work with the Python based Django framework. Django is a flexible framework that leverages the Python programming language. A typical development scenario for development using Django involves writing models and/or views then running unit tests to see if these changes break the application. If you create test data for the unit tests using Django’s fixtures then you might have used Django’s “manage.py dumpdata” to export test and development data to one of your application’s fixtures. If you have used the dumpdata command then you may be experience an error message when running the unit tests that indicates a primary key error when loading “contenttypes”. The unit tests will run, but this warning can be troublesome. There is a simple solution. When using dumpdata specify the “-e contenttypes” switch to exclude the “contenttypes” model. I also suggest specifying “-e contenttypes -e auth”. This should eliminate the primary key error or warning message when you run the unit test.
Refer to this link for more information.