March 9, 2010
The Grails tutorial I read said provided instructions for changing the default server port from 8080 to some other value, so that you would not need to specify an alternate server port every time you run-app. It said that you should open $GRAILS_HOME/scripts/Init.groovy and look for a line setting the value of serverPort.
The problem is that this tutorial was written in 2008, and while you wouldn’t think that much would have changed since then, apparently the Grails config files have been refactored. Init.groovy now appears to be a much higher-level file, and serverPort isn’t specified in it.
After searching the Grails directory, I found out that the new file to edit is $GRAILS_HOME/scripts/_GrailsSettings.groovy. Open it and look for the following line:
serverPort = getPropertyValue("server.port", 8080).toInteger()
I believe the getPropertyValue method checks properties sent in via the command line or configured in some other way. If it’s not set, though, it uses the second parameter as the default value. Change it from 8080 to some other port, like 9090, and the next time you run-app you’ll be running on the new port instead
Leave a Comment » |
Development | Tagged: 1.2, config, grails, groovy, java, port, server, webapp |
Permalink
Posted by Josh Justice
March 9, 2010
Either I’m behind the times, or Apple isn’t great about communicating all the options out there for iPhone development. I just found out about Dashcode, an iPhone SDK for creating web apps with all the standard awesome iPhone widgets. It even lets your web app run offline! This being the case, I thought I’d put together a summary of the options you have for creating iPhone web sites/apps. Please comment if I’ve gotten anything incorrect, and help me out by providing better links =]
|
Web Site |
iPhone Site |
Offline Site |
App Store |
| Accessible |
y |
y |
y |
y |
| Other Mobile |
y |
y |
? |
n |
| Offline |
n |
n |
y |
y |
| Zooming |
y |
n |
n |
n |
| App Store Approval |
n |
n |
n |
y |
| App Store Sales |
n |
n |
n |
y |
| iPhone Data |
n |
n |
n |
y |
| Push |
n |
n |
n |
y |
- Web Site – This refers to a regular web site, without any adjustments for the iPhone.
- iPhone Site – This refers to a web site with some changes for the iPhone. It might be as simple as a few meta tags and CSS styles, or you might have to rewrite your views to be iPhone targeted. Either way, though, it’s not much effort. More Info
- Offline Site – This refers to a webapp that’s set up to be able to run offline. If your users save your app to the home screen, everything on that page is saved as well, including JavaScript. If the app is set up to use a JavaScript-accessible local storage library, that data will be accessible as well. Apple has created an SDK called Dashcode that offers not only offline storage, but also easy drag-and-drop usage of regular iPhone UI widgets as well. More Info
- App Store – This is what most people think of when they think of iPhone apps. These are written in Objective C using the iPhone SDK. They require App Store approval to be sold. More Info
Leave a Comment » |
Development | Tagged: Development, iphone, javascript, offline, sdk, web |
Permalink
Posted by Josh Justice
February 22, 2010
For some reason, Grails decided to delete their published list of all validation constraints. This official-sounding page just sends you to the reference docs, and its validation page gives the unhelpful message that
A complete reference for the available constraints can be found on the reference guide
I’m not sure what other reference guide this could be referring to, not to mention what it would mean for this information to be found “on” the reference guide, as opposed to “in” it.
Update: @mr_paul_woods sent me to the Grails docs and told me to look in the sidebar. Turns out that I wasn’t supposed to click Validation on the right pane, but rather find “Constraints” in the unrelated left pane. There’s no way to get this list on a page by itself, so here they are to be helpful:
Leave a Comment » |
Development | Tagged: documentation, grails, java, validation |
Permalink
Posted by Josh Justice
December 4, 2009
I use PushMail to get push notifications of e-mail on my iPhone. And because I have Google Voice send all my SMS and voicemails to my e-mail address, I get notified of those too. Here are some PushMail Custom Profiles that make it an even better experience:
Custom Profile 1 – Text Messages
- Pattern: voice.google.com
- Sound: SMS Received
- Action: URL: http://voice.google.com
- Notification Format: From, Body
Custom Profile 2 – Voicemails
- Pattern: voice-noreply@google.com
- Sound: Ping (default)
- Action: URL: http://voice.google.com
- Notification Format: Subject
3 Comments |
Personal | Tagged: google voice, iphone, push, pushmail, sms, voicemail |
Permalink
Posted by Josh Justice
November 30, 2009
In approximate order of how often I use them, or how useful I find them.
Paid
- PushMail – push notifications of e-mails, including preview text (great for getting free instant notifications of Google Voice SMS and voicemails, instead of using SMS)
- Tweetie – twitter
- Outliner – outlines, especially hierarchical to-do lists
- IM+ – instant messaging
- GPS Drive – cheap GPS program with some improvements over Google Maps
- Wedding Day – now, how long we’ve been married =]
Free
- Files lite – reading text files, such as videogame walkthroughs (it saves your place!)
- AudioMemos Free – voice memos (better UI than Apple’s Voice Memos app)
- ICHC – funny images
- NetNewsWire – Google Reader / RSS
- The Weather Channel – detailed weather forecasts and radar
- Logos – free ESV, NASB, NKJV Bible – plus Greek morphology!
- Pandora – customized streaming music stations
- Pollen Lite – pollen forecast
- Loopt – for tweeting my current location
- iTweetSong – tweeting the song/podcast I’m currently listening to
- Flixster – movie showtimes
- Fandango – buy movie tickets (but smaller list of theatres and worse UI than Flixster)
- Shazam – recognize a song playing on the radio
- PS Mobile – simple photo manipulation
- WhitePages – look up a person’s address
- PhoneFlicks – view/update my Netflix queue
- ESPN ScoreCenter – for my wife to look up Broncos scores
- Dictionary
- eBay
- Amazon.com
- Facebook
- Wikipedia
Leave a Comment » |
Uncategorized | Tagged: app, iphone |
Permalink
Posted by Josh Justice
October 27, 2009
We’re in the process of converting our web site to use CSS sprites to improve frontend performance. To implement CSS sprites, I’d recommend using SmartSprites. It’s a simple build-time tool that allows you to build your CSS using regular separate background images, annotate the CSS files using CSS comments, then run the tool and have it generate the CSS sprite image files and updated CSS files. It’s an excellent tool.
Unfortunately, due to limitations in the CSS sprite concept, SmartSprites can’t work with just any background image usage you already have. Here are a few pointers to keep in mind when building your CSS, to make sure it’s as spritable as possible.
- Don’t use CSS sprites pre-SmartSprites. This may sound obvious, but there are some reasons why you might end up with some CSS sprites before you use SmartSprites. For example, our design firm implemented hover states for UI elements as CSS sprites: the same image has normal and hover states, and a hover event just changes the background alignment. Also, we use YUI widgets, and some of their default styles use CSS sprites.
The reason SmartSprites doesn’t work on existing CSS sprites is that it ignores your existing background positioning declarations. It assumes you have a single background image, includes that image in the sprite, then positions the sprite to show that one image.
The workaround I used for this was to split out the smaller CSS sprites into individual images, which are then recombined by SmartSprites into the macro sprites.
- Separate out “background“ properties into “background-image.” SmartSprites requires background-image to be on its own line. It’s not too hard to refactor later, but if you can write the styles this way to begin with, you’ll save some time.
- Make sure repeating images are as few pixels as possible in the repeating dimension – preferably 1px. In order to get repeating sprites to tile properly, SmartSprites has to find the lowest common denominator of the image size. For example, if you have a 2px repeating image and a 3px one, it can’t just sprite them together, because then the 2px one would have a 1px empty row. And it can’t just repeat the first pixel of the 2px one, because the pattern might not tile properly. So it needs to create a 6px image, repeat the 2px one 3 times, and the 3px one twice. 6px isn’t too bad, but if you add a few more images of different sizes, it can expand out of control.
- Whenever possible, make your background images cover the whole element, not just part of it. Don’t create a vertically-expandable div and style a background image to cover just the top of it – instead, create one div that’s the height of that background image, and style that. Remember, a CSS sprite is a bunch of images concatenated together, so you won’t get blank space below it: you’ll get more images. One way you can get around this is to take advantage of SmartSprites’ ability to organize the images either horizontally or vertically. If you append the images horizontally left-to-right, there won’t be anything below that header image, so you can still style it to cover just the top. One case where this won’t work, though, is in repeating sprites. If you have a horizontally-repeating sprite at the top of an element, then it’s difficult to put it in a sprite, because the only place to put other elements is above or below it, and the below ones will show up in the element.
1 Comment |
Development | Tagged: css, css sprite, image, performance, smartsprites, sprite, ui, yslow |
Permalink
Posted by Josh Justice
October 16, 2009
Just ran into a defect that came up because QA’s web browser had cached an old version of a JS file. I was hoping to find an easy way to configure caching for static assets in my webapp. Turns out that there’s a J2EE cache-filter that does it quite easily. Just add it to your pom or lib directory, then add a few filters and filter-mappings to your web.xml, and you’re good to go!
I configured 1 hr caching for JS and CSS, so they’ll be refreshed by the time I do a QA build. You could also set up your build script to make your cache settings environment-specific, so prod caches longer than QA. You can also use this to set longer caches on things like images (I set ‘em to cache for 1 day), to increase performance.
Leave a Comment » |
Development | Tagged: cache, filter, j2ee |
Permalink
Posted by Josh Justice
October 12, 2009
My app has a search screen that fetches the results via Ajax and displays them in a table. Worked fine in Firefox, but in IE there’s a slight processor jump for a second or so. Strange, but not a problem. The users of this app, however, use a remote desktop app to run IE to access it. And when they did the search, their CPU would hit 100% for 1-5 minutes, making the entire terminal completely unusable.
I agonized over different JavaScript fixes: removed a table JS widget, switched off of tables altogether, switched to innerHTML, used DocumentFragments. Nothing worked.
Then, on a whim, I disabled all the CSS files on the app, and it worked like a charm. As I narrowed it down, I discovered that some CSS I was using to emulate frames (non-scrolling header, footer, and sidebar) was the offending code.
Let’s step back and think about that one again. What caused the processor to hit 100% for 5 minutes was not JavaScript, but CSS.
Sigh. So, if you have an issue with IE hitting 100% processor load for any reason, don’t assume that JS is necessarily the problem. Try disabling your CSS and see if that fixes it.
Leave a Comment » |
Buglog, Development | Tagged: cpu, css, Development, dom, ie, javascript |
Permalink
Posted by Josh Justice
October 10, 2009
I just finally activated my Google Voice account today. I’m pretty happy with the setup right now. The bottom line is:
- I get a notification on my iPhone for all e-mails, voicemails (transcribed), text messages (free), IMs, and twitter replies and DMs
- I can e-mail, text message, IM, or tweet back from the iPhone
Here’s the setup:
- My personal e-mail address is a POP account with my ISP. I have it set up to forward to my gmail account, so I get IMAP support. But I also have a backup of the e-mails stored locally in case something goes wrong with gmail.
- My Google Voice account is set up to transcribe voicemails, and then send voicemail transcriptions and text messages to my gmail account. Gmail is set to filter these messages and automatically put them in a VM or SMS folder.
- My gmail account forwards all e-mails to my PushMail e-mail account – this is an iPhone app that will show push notifications on my iPhone with sender/subject/title/body etc. By contrast, using the iPhone mail app to do push only buzzes and updates the app’s icon – it doesn’t show a notification with the contents.
- Meanwhile, I use IM+ as an iPhone IM client. It supports most IM services, and also does push notifications when receiving IMs.
- I use Tweetie 2 as my iPhone twitter client. It’s great, but unfortunately it doesn’t support global push notifications for all mentions and DMs. So, instead, I use IM+’s Twitter push support – IM+ notifies me when I receive a mention or DM, and then I read/reply in Tweetie.
2 Comments |
Personal | Tagged: google voice, iphone, push |
Permalink
Posted by Josh Justice