Solved – Mac OSX Image Capture does not recognize iPhone anymore
This has been wrecking my nerves for weeks. I don´t like the way iPhoto or Picasa manages my Photos so I like to rely on my own way of handling them in a plain file/foldersystem. I have been using Mac OSX´s Image Capture tool for this until recently it simply stopped working.
I am quite sure it happened after an update of either the iPhone or iTunes. Anyway, I surfed the web for ways to make it work again but nothing really worked. If you are in a similar situation – here is what made it working for me again (without any warranties).
- I deleted the Image Capture .plist file in the Library folder (search for “imagecapture” and “.plist”)
- I reseted the PRAM memory which is done by
- rebooting
- pressing CMD+Option Key+P+R before the grey screen appears
- stop pressing key combination after screen goes black
After starting up again and firing up Image Capture it first said “No device found” for 5 seconds AND then showed up the iPhone under Devices again. Hope it works for you too!
64Bit Discrimation with Ruby & MySQL
In case you are having issues with your Ruby installation and MySQL (libmysql.dll is missing error), here is the solution:
In addtion to your MySQL 64Bit installation, download the 32Bit installation without the installer and copy the libmysql.dll from this download to the ruby/bin folder.
Hope it helps!
Cheap server hickups on yulaframework.com
Unfortunately GoDaddy isn´t able to shift more (virtual) memory to this machine. While we are with setting up our new company redTrac, I was trying to figure out a quick way to increase the stability of the system. That was particular tricky as I have been successfully avoiding Linux for the past years, running happily on .NET and Windows. Well, times change and I like new challenges .

What I did was SSH into the VPS and edit tomcat´s startup.sh by adding 2 lines of code right at the top of it:
JAVA_OPTS=”-Xms64m -Xmx512m”
export JAVA_OPTS
We´ll see for how long this will last but at least I can say that it runs more stable than before.
Does “Request per second” performance matter for Web apps?
If does matter, can it stand on it´s own? Shouldn´t it be coupled to the underlying software´s development agility (Time-to-Market, Maintainability, Changeability, Beautifullibility
). My view is that it doesn´t really matter if your framework can do 200 or 400 requests per second (for a given testcase on identical hardware). Usually you´ll find that the human factor is much more important. If you base your work on a framwork that is easy and consistent to use, you´ll produce more readable and less error prone software.
The second thing that I see is the rise of cloud computing offers. Microsoft is ramping up azure which is really easy to use with ASP.NET/Vs2008. There is Google´s AppEngine (which soon will hopefully support Grails and Groovy) and Value-added-service providers like mor.ph and stax. mor-ph and stax deploy and monitor apps on amazon´s widely successful elastic cloud offerings. All of this makes scalability a breeze and puts an even stronger emphazis on agile, developer-friendly frameworks like Groovy and Grails… even if they come at a cost of a lower “rpc”.
Silverlight Quirks
I am working on a 3D-asteroid-shooter for my Kids as a christmas present. They all like computer games quite a lot and I hope to impress them with a selfmade game. So far everything is going pretty well but there are some major quirks that can hold you up when going the Silverlight/Blend way.
First of all Blend crashes and leaves you with XAML that it can´t digest. If you are familar with XAML you can always roll back your last action in Code-View and Blend will be cooperative again – but if you don´t you get a very bad usage experience from it.
Second, Blend attaches attributes to your custom usercontrols-header definition that will mess up your software. It just took me half an hour to learn that a Blend named my userControl which messed instanciation of additional controls of the same type.
Apart from that, it´s a fantastic technology. Check out this little physics demo – awesome.
Webtest with Canoo
One thing that kept breaking in my attempt to conquer the GRAILS basics was webtesting. I set up a fairly standard webtest that ran through a pre-recorded set of web-actions. No matter what coding I put into the file it would always throw a null point exception: “Cannot invoke method toInteger() on null object”
Console output
…
Loading with installed plug-ins: ["webtest", "autobase"] …
[copy] Copying 1 file to C:\Users\ElmarS\.grails\1.0.4\projects\CollabToDo
Running WebTest …
Cannot invoke method toInteger() on null object
…
Solution:
Problem was, that I created the domain testfile manually (i.e. PersonTest.groovy). Webtest files need to be generated with the create-webtest command though – at least for the first run as it seems . This is because it creates an additional TestSuite.groovy in the same test directory. I would have expected this file creation to be part of the plugin-installation process. But well, it´s not a perfect world, right
Did you know -> canoo has a free Plugin for Firefox that let´s you record webtests instead coding the sequences yourself! Check it out – it can save you hours of work
A note on testing controllers
Integration tests will fail with a funny message…
grails testing Cannot send redirect – response is already committed
… if you forget to add a return statement to your controller action after you do a redirect – like so:
def handleLogin = {
def person = Person.findByPersonName(params.personName)
if(!person){
flash.message = "Person not found for Person-name: ${params.personName}"
redirect(action: "login")
return <------//-----//-----//-----//
}
session.person = person
redirect(controller: 'todo')
}
Note: This is a special case as program code that´s embeded into a control block like the above if-statement isn´t returning anything. So you need to be explicit and put in a return statement.
GRAILS with PostgreSQL Gotcha
Everyone is talking about PostgreSQL these days. Especially folks that discover that they are running MySQL illligaly because it´s libs are under the GPL
).
In case you want to check out GRAILS in conjunction with PostgreSQL (gosh – what a name) save yourself some time and don´t call your user domain model ‘user’ because it will fail on database deployment.
column notation .id applied to type “name”, which is not a composite type
That is because User is a reserved table name for PostgreSQL. So call it Person or what not and it will work just fine.
Here is the complete DataSource file to get you up and running quickly:
dataSource {
pooled = false
url = "jdbc:postgresql://localhost:5432/dbDev"
driverClassName = "org.postgresql.Driver"
dialect = org.hibernate.dialect.PostgreSQLDialect
username = "user"
password = "passwordd"
}
hibernate {
cache.use_second_level_cache=true
cache.use_query_cache=true
cache.provider_class='com.opensymphony.oscache.hibernate.OSCacheProvider'
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop','update'
url = "jdbc:postgresql://localhost:5432/dbDev"
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:postgresql://localhost:5432/dbTest"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:postgresql://localhost:5432/dbProd"
}
}
}
GRAILS Form post
I am currently digging into Groovy and Grails and “Beginning Groovy and Grails” is a nice Book to get started. In this post I will add my findings while working with the proposed demo app.
Note, although the source code is available for download, I think that you learn more from actually writing code.
First quirk in the book is the actual form building process in Chapter 5 – Handeling the Login and Logout Action. Here is a snippet of the code that doesn´t actually work:
<form>
<span class="nameClear">
<label for="login">
Sign In:
</label>
</span>
<g:select name="userName" from="${User.list()}" optionKey="userName" optionValue="userName"></g:select>
<div class="buttons">
<span class="button">
<g:actionSubmit value="Login" />
</span></div>
</form>
In order for GRAILS to accept the form post you need to tweak the code in of two ways. Either by adding the action into the actionSubmit tag like so:
<g:actionSubmit value="Login" action="handleLogin"/>
or use a normal submit button (or leave the actioSubmit Button in place) and swap the form tag for a g:form and put the action in there:
<g:form action="handleLogin">
Full source code:
<g:form action="handleLogin" method="post" >
<span class="nameClear">
<label for="login">
Sign In:
</label>
</span>
<g:select name="userName" from="${User.list()}" optionKey="userName" optionValue="userName"></g:select>
<div class="buttons">
<span class="button">
<g:actionSubmit value="Login" />
</span></div>
</g:form>
Haven´t checked wether it is possible to do something like:
<form>
<span class="nameClear">
<label for="login">
Sign In:
</label>
</span>
<g:select name="userName" from="${User.list()}" optionKey="userName" optionValue="userName"></g:select>
<div class="buttons">
<span class="button">
<g:actionSubmit value="Login" action="handleLogin" />
<g:actionSubmit value="DoSomethingElse" action="otherMethod" />
</span></div>
</form>
This would make it very easy to post data to different controller methods. Right now, can´t think of a practical use case but it´s nifty anyway.
Leave a Comment