A few months ago, I introduced Balsamiq mockups into my project because using Excel spreadsheets to design my screens was just stupid. I couldn't really 'communicate' with the rest of the team in India.
I still remember the night when I pulled this out. I remember Amit from Intelligrape in India happily exclaimed, with hope in his timbre, "Oh Brent, this is going to be so much better for us. Thank you."
He was right. It has increased the team velocity tremendously. We are able to work through the screens in realtime over YuuGuu, drilling down to the finest points of the design.
Here are a couple of the screen shots. We even use it for some class diagrams and sequence diagrams.
Saturday, December 5, 2009
Design Mockups, realtime, real easy
Getting a signed in user in Grails tests
I found this to be helpful. I just needed one more piece of information.
def subject = [
isAuthenticated: true,
principal: "admin"
] as Subject
SecurityUtils.metaClass.
Subject.metaClass.getPrincipal = {-> return "admin" }
This way, when I needed the user later on in the code, when I called getPrincipal, I got it. E.g.
JsecUser currentUser = JsecUser.findByUsername(
"void setUp() { def subject = [ isAuthenticated: false, ... ] as Subject SecurityUtils.metaClass.static.getSubject = {-> return subject } ... }"
- Nabble - grails - user - JSecurity-Plugin and Integration-Tests (view on Google Sidewiki)
Thursday, December 3, 2009
Seems pretty cool.
I think I like this Side Wiki. Now, if it would only let me highlight stuff for context, etc, I would love that.
in reference to: Google Sidewiki (view on Google Sidewiki)Friday, February 22, 2008
subversion troubles...
Symptom: Database has become corrupted...
Solution:
kill svnserve
svnadmin recover /path/to/repos
then:
chgrp -R subversion /home/svn
chmod -R 770 /home/svn
chmod g+s /home/svn/db
restart svnserve: svnserve --daemon --root /home/svn
Thursday, February 21, 2008
Sorting and filtering...
For now, you should open the rails plugins view, select sortable_column_headers and check svn:externals and svn:checkout install and then click GO.
But the searching works just fine. Next, I would like it to filter the results as you type. That would be much more useful.
Wednesday, February 13, 2008
Finished deployment to VPS
I had to combine the strengths of Dave Stevenson (SilverRack) and the Agile Web Development with Rails book. There were a few gotchas along the way that I will attempt to address here. In the meantime though, you should be able to access the website here:
http://216.194.127.249/company/list
I'm gonna list the gotchas now, but they may not be in any particular order.
- An SVN client must be installed on my windows box
- mongrel_rails cluster::configure command produces a mongrel_cluster.yml file that tells capistrano to look for files in the 'conf' directory instead of the config directory, so after executing that step, it is very important to edit the file appropriately.
- replace cap --apply-to .... with 'capify .' This was no doubt a new command that didn't exist at the time of publishing
- In the deploy.rb file, you can add the following entries to make it connect correctly (asterisks added for security):
- set :user, "root"
set :svn_username, "*****"
set :svn_password, "******" - cap setup has changed to cap deploy:setup. This only has to be run one time to get all of th right directories in place
- The /var/www/apg/current directory is actually a symlink that points to another directory under releases. This allows capistrano to maintain several versions of the product, and switch between them with ease.
- cap cold_deploy changed to cap deploy:cold
- I had missed the right port numbers in the vhost.conf file. Since the mongrel_cluster.yml file specifies two mongrel threads listening on 8000, and 8001, then the vhost.conf file must also point to 8000 and 8001
- I found that apache on linux has multiple configuration files all under /etc/httpd/conf.d
- Only Apache 2.2 supports the mongrel mod and the subversion dav_svn_module. So Apache 2.2 is essential
- When running capistrano, it starts up the mongrel servers in production mode with a -e production parameter to specify the rails app should use the production server
- I had to manually run the 'rake db:dbdata:load' command on the application because the rake db:migrate tool didn't have that as part of it.
- In order to allow http access to SVN, I had to change the ownership on the subversion directories /home/svn. I used the command 'chown -R apache.subversion /home/svn'
- Centos 4 didn't have the yum repository that includes mysql5 or apache 2.2 so I had to integrate with a repository that Dave Stevenson sent me:
(need to add the exact yum line here)
yum --disablerepo=update --disablerepo=base -y install gcc openssl-devel> mod_perl-devel mod_python mod_ssl mod_dav_svn mysql-server mysql-devel> libpng-devel libjpeg-devel libtiff-devel freetype-devel ghostscript-devel> which>> yum --disablerepo=update --disablerepo=base -y update
- I still need to configure the database passwords to be taken from a shared location, instead of checked into the database. For now then, I have changed the passwords for the database and modified the file on the server for security.
Saturday, February 9, 2008
new info from Dave
Hi Brent -That message is because Apache 2.2 isn't installed.The yum update from the utterramblings repo should've done it. But - I checked your system and it wasn't working. I tried a few things and finally got some stuff to work.Rerun the 2 yum commands like this (notice the disabling of the update and base repositories)yum --disablerepo=update --disablerepo=base -y install gcc openssl-devel mod_perl-devel mod_python mod_ssl mod_dav_svn mysql-server mysql-devel libpng-devel libjpeg-devel libtiff-devel freetype-devel ghostscript-devel whichyum --disablerepo=update --disablerepo=base -y updateYou should notice that all of the files are coming from the utterramblings repository - and that apache will be version 2.2, mysql will be 5x,etc. Dave
On Feb 9, 2008 10:07 AM, Brent Fisher <bc.fisher@yahoo.com> wrote:
I went through the steps, but when I try to start, it says this:
login as: rootroot@216.194.127.249's password:Last login: Fri Feb 8 22:16:39 2008 from 71-213-85-69.slkc.qwest.net[root@apgtest ~]# httpd -k startSyntax error on line 2 of /etc/httpd/conf.d/httpd-vhosts.conf:Invalid command 'BalancerMember', perhaps mis-spelled or defined by a module not included in the server configuration[root@apgtest ~]#
perhaps the load balancer mod isn't installed still? It did have a little bit of trouble with some of the mirror sites when I executed the yum update command. Could that have been the problem?
Brent Fisher
I can help
bc.fisher@yahoo.com
highlandfishers.com
801.842.1114
This seemed to work
Friday, February 8, 2008
Installing in production continued...
vi /etc/https/conf/httpd.conf, comment out mod_ssl, change DocumentRoot to valid folder)
I talked to Dave at silverrack, he recommended that I could use /tmp or /var/www/html. it isn't used with rails apps, but if it isn't valid, then apache will complain...
Turns out, I didn't have to do anything on this step.
vi /etc/httpd/conf/httpd.conf - uncomments the reference to /extra/httpd-vhosts.conf no-op. its enabled by default...(says Dave from silverrack)
Thursday, February 7, 2008
Installing instant rails
http://rubyforge.org/frs/?group_id=904
download 1.7
InstantRails-1.7-win.zip
copy the file to your root directory and unzip it there. It won't work otherwise. Then just run instant rails setup.
Installing in production - rails install.
https://silverrack.com/posts/1
It seems to be ok, but you should know that you will have to compile some stuff, so it is missing the part where you do that. You can do that using:
yum install gcc*The ftp sit he listed doesn't have that file anymore, so I had to just 1.8.5 without the p12.
I also didn't know how to get the file from the http protocol, but I'm trying to use wget instead.
wget worked perfect. so did the gems install. so far, so good!
when I attempted
gem install rmagickIt didn't work. It complained: Can't find libMagick or one of the dependent libraries. Check the mkmf.log file for more detailed information.
I'm gonna try skipping that. I'm not sure I need RMagick (what is it...)
Everything worked fine until:
make && make install from gem directory
it gave me:
[root@apgtest mysql-2.7]# make && make install from gem directorygcc -I. -I. -I/usr/local/lib/ruby/1.8/i686-linux -I. -DHAVE_MYSQL_SSL_SET -DHAVE_MYSQL_H -I/usr/include/mysql -g -pipe -m32 -march=i386 -mtune=pentium4 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fPIC -g -O2 -c mysql.cgcc -shared -L'/usr/local/lib' -Wl,-R'/usr/local/lib' -o mysql.so mysql.o -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib -lssl -lcrypto -ldl -lcrypt -lm -lc/usr/bin/install -c -m 0755 mysql.so /usr/local/lib/ruby/site_ruby/1.8/i686-linuxmake: *** No rule to make target `from'. Stop.
I realized I was kind of stupid. I should have left off the 'from gem directory'. I think it probably worked just fine.
It's late: 12:58 AM. I just started on this line:
vi /etc/httpd/conf/httpd.conf (comment out mod_ssl, change DocumentRoot to valid folder)
I'll work on it a bit more another day...
Wednesday, February 6, 2008
using aptana to get your code from svn.
I had to install the subclipse plugin. To do this, look for it in the aptana plugin manager. Right click, select install.
After installation:
Select Windows->Preferences->Team->SVN: Check SVNKit (Pure Java)
Then switch to the SVN Repository Exploring Perspective. In the SVN Repository View, click the add location button. Type this in, but replace your name and password...
svn+ssh://brent@216.194.127.249/home/svn
After it is added, navigate to /home/svn/apg/trunk. right-click, select checkout. choose the name as apg. click next, choose the location as your instant rails installation, rails-apps directory.
Now from the config/database.example file, make a copy called config/database.yml. Edit the file as necessary to make it point to your database. If you haven't already, from Instant Rails, open a ruby console and execute the following:
C:\InstantRails\rails_apps\apg>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 1 to server version: 5.0.27-community
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database apg_development
-> ;Query OK, 1 row affected (0.77 sec)
mysql> exit
Bye
C:\InstantRails\rails_apps\apg>rake db:dbdata:load
(in C:/InstantRails/rails_apps/apg) -- msg: retrieving db info -- msg: Loading data into DBmysql -uroot ... [password filtered]
C:\InstantRails\rails_apps\apg>
Now your database is ready to go!
database dump
rake db:dbdata:load RAILS_ENV=production
Tuesday, February 5, 2008
svn accounts created...
doug:
david:
brent:
for the password, please call me.
You can checkout by hitting the server (216.194.127.249) with tortoiseSVN (google it, download it). Go to the directory where you want to work.
E.g. C:\Rails-1.7\InstantRails\rails_apps Right click, select SVN-checkout. For the URL, put in:
svn+ssh://doug@216.194.127.249/home/svn/apg/trunk
this will check out the repository to your local directory called apg. This is using a secure encrypted shell to do the work. No worries.
Redadcting the database...
companies.CO_ID.
I'm thinking of redacting them by adding a random digit to each digit in the string. This will create a number that is impossible to trace back to the original number, but will still look like the original number.
Here are the queries I performed:
SELECT C.BANK_ACCOUNT_NUMBER, CEIL(C.BANK_ACCOUNT_NUMBER + (C.BANK_ACCOUNT_NUMBER/10 - C.BANK_ACCOUNT_NUMBER/10 * RAND())) AS GEN FROM CUSTOMERS C;
UPDATE CUSTOMERS SET BANK_ROUTE_TRANSIT = CEIL(BANK_ROUTE_TRANSIT + (BANK_ROUTE_TRANSIT/10 - BANK_ROUTE_TRANSIT/10 * RAND()));
UPDATE CUSTOMERS SET BANK_ACCOUNT_NUMBER = CEIL(BANK_ACCOUNT_NUMBER + (BANK_ACCOUNT_NUMBER/10 - BANK_ACCOUNT_NUMBER/10 * RAND()));
This gave us numbers that still looked real, but weren't. :D
Friday, February 1, 2008
The mysql of choice
Is there a program that will do both for me?
Monday, January 21, 2008
Agile Web Development with Rails
This sentiment was confirmed on my ride home today with a fellow named David. He has been using Ruby on Rails for the last two years and he says he never uses the scaffolding. At first I was taken a back a little bit, but I can see that he is right.
A scaffolding view and controller is just a page that will put functionality in dynamically, but it doesn't care how it looks, just that you can operate the application until you get your real stuff in there.
Data Model: Customer and Customer Payment
Sunday, January 20, 2008
The ID field, and its relationship to show/edit from lists
I practiced with the companies table first, when I would try it out before making the ID and id, the show and edit links from the companies table always failed to work. After changing them, the show and edit work fine now.
Saturday, January 19, 2008
Should the company number be a foreign key?
- companies
- co_billings
- company_fees
- company_gen_fees
- customers
- customer_payments (ap_co_number)
- notepads
It seems like this should be a foreign key, pointing to a primary key in the companies table.
Does this seem right?
Database Changes
In doing this, mostly I added a new ID field, but for some of them, I changed the existing primary key.
I had to execute:
SQL:
SET @maxId= 0;
UPDATE mytable SET id = ( SELECT @maxId := @maxId+1 ) WHERE 1 ;
to put the ID
I found at:
http://www.rafaeldohms.com.br/2006/09/28/creating-a-primary-key-in-a-populated-table/en/
It also creates UI for the whole database, the result of this is that we get UI with fields like CO RESERVE AMT. I could either change the database, or go into each of the UI files and alter it there. It seems to make more sense to change the database, but I'm gonna hold off for now.
