Swap Characters →
Did anyone know that pressing Ctrl+T in OS X swaps the order of the last two characters you’ve typed? Just discovered it by accident.
— Matthew Guay (@maguay) June 18, 2012
Did anyone know that pressing Ctrl+T in OS X swaps the order of the last two characters you’ve typed? Just discovered it by accident.
— Matthew Guay (@maguay) June 18, 2012
Rafe Colburn:
There are a lot of tradeoffs that go into product design. When it comes to laptops, there are capabilities (display resolution, processor speed, storage space, battery life, and so on), size and weight, cost, and upgradeability. Apple seems to have gotten the impression that upgradeability is the factor that people care about the least, and I suspect that they’re right.
Just listen to your friends who are not into tech. When their notebooks are getting old and they are starting to complain how slow they become, they are always talking about buying a new notebook and never about upgrading their existing one. Apple is no longer a brand for professionals, they now are a consumer company.
Last week The Mynabirds released their new album Generals. I think I mentioned it already several times on this blog, but I am not really good at writing reviews. Therefore I will not review Generals and only recommend it to you.
(* Affiliate Links)
In 2009 I got a HP Color LaserJet CP1215. Unfortunately this printer is not compatible with OS X. Three years ago I managed to install the printer by using open source tools and drivers. However, since I got a new MacBook Pro I needed to reinstall the printer and, of course, some things changed.
In order to remember the stuff I just did I will now shortly describe the process. However, I will not provide support if you struggle installing the printer.
If you upgraded to OS X 10.8 Mountain Lion and your printer stopped working please see the update at the end of this article.
wget
and gnu-sed
.
$ brew install wget
$ brew install gnu-sed
$ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
$ tar zxf foo2zjs.tar.gz
$ cd foo2zjs
$ make
$ ./getweb 1215
$ sudo make install
$ sudo make cups
$ cupsctl WebInterface=yes
When I upgraded to OS X 10.8 Mountain Lion, the printer stopped working. However, I could easily resolve this by repeating steps 4 and 5. I did not uninstall anything, I simply downloaded the latest version of Ghostscript, Foomatic RIP, HIPJS and foo2zjs.
I am obsessed with camera apps. Pris is a new one with an innovative interface. Instead of taping on a button you can take a photo by taping on the motive. There is also a manual mode which allows to drag the focus and exposure around the screen. If held in portrait mode Pris shoots photos in 1:1 format, in landscape mode the resulting photos are in 2.35:1 format. Photos can be saved to the camera roll and shared directly on Instagram. Pris currently costs €1,59/$1,99 in the App Store.
Scott Jehl:
The point of this page is to test whether today’s browsers will download stylesheets that are referenced with media queries that would not apply on that browser or device.
With these tests in mind it is currently the best solution to put all your media queries in a single file. Since browsers would download the files anyway it only produces HTTP overhead to include multiple stylesheets for different browsers or devices in a HTML page.
Peter-Paul Koch:
My point here is that creating its own phone would be exactly the opposite of Facebook acquiring Opera. Opera gives Facebook instant access to every single smartphone OS except for Windows Phone, as well as most feature phone OSs. It will end up in people’s pockets pretty quickly, in other words.
For an university project I currently need to develop an application in Java using Spring Roo and MongoDB which should be deployed to Cloud Foundry. Spring Roo is tool for rapid development in Java and Cloud Foundry is a Platform as a Service (PaaS) provider. In order to be able to deploy applications on Cloud Foundry, you need to create an account. It will take some time until it is activated, thus you should signup now.
Since installing the required components on OS X 10.7 is not as easy as the tutorials and getting started guides suggest, I decided to write down what I did to get it all working.
I will be using Homebrew to install components. If you haven’t installed it yet, you can do that by executing the following line in Terminal.app:
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
I will be deploying my app to Could Foundry and therefore my application will not be executed on my notebook. However we need Spring Roo to generate the project, entities, packages and so on and we need the command line tools of Cloud Foundry to be able to upload our application and start, restart and stop it. I am not sure if MongoDB must be installed on the local machine, since I had it already installed. If an error pops up during the installation or configuration of Spring Roo you can easily install MongoDB using Homebrew.
brew install mongodb
sudo mkdir -p /data/db
If required, you can start MongoDB:
sudo /usr/local/Cellar/mongodb/2.0.5-x86_64/bin/mongod
Next we need to install Spring Roo:
brew install spring-roo
When the installation is finished we first need to navigate to the folder where we want to create the project in and than we can start the interactive command line tool of Roo:
mkdir -p ~./playground/roo-mongodb-cloudfoundry-howto
cd ~./playground/roo-mongodb-cloudfoundry-howto
roo
You are now using the Spring ROO CLI, which can be used to generate projects, entities, execute actions and so on. If want to return to Bash you just need to type exit
.
project --topLevelPackage playground.usermanager
The Roo CLI has autocompletion built in, so you could type proj
and then hit TAB
to complete project
. This also works for arguments.
Now we need to setup the MongoDB data store and the generation of the required MVC classes for our web interface.
mongo setup --cloudFoundry true
web mvc setup
We can now already start to create the entities:
entity mongo --class ~.domain.User
field string --fieldName name --notNull --class ~.User
field string --fieldName password --notNull --class ~.domain.User
repository mongo --interface ~.repository.UserRepository --entity ~.domain.User
service --interface ~.service.UserService --entity ~.domain.User
For this example I created an entity User
with two string fields name
and password
as well as a repository and a service class. Since I only want to explain how to set things up this will do for our example.
It is time to package our little application.
web mvc all --package ~.web
perform package
When the perform package
is executed for the first time this will take a while. It will be much faster in subsequent calls.
Since we are done with Roo for the moment we exit the Roo tool with exit
and will now deploy it to Cloud Foundry.
Spring Roo has an Cloud Foundry add-on, however it does not work with the latest version of Roo and I did not want to manually install an older version of Roo so I decided use the tools provided by Cloud Foundry.
First of all we need to install the Cloud Foundry CLI tool using RubyGems.
gem install vmc
Hopefully your account on Cloud Foundry is activated by now, since you need to login:
vmc login
You have two possibilities to deploy an application. The easier one is to directly deploy your application to Cloud Foundry, the other one is to deploy it to a virtual machine on your local computer. The later is called Micro Cloud Foundry and you will find instructions on how to set it up after you logged in on Cloud Foundry.
Next you need to define the target of the deployment. If you decide to deploy directly to the public cloud you need to do:
vmc target api.cloudfoundry.com
If you rather want to deploy to a Micro Cloud you need to do: (of course you need to insert the name you choose for your Micro Cloud in that command)
vmc target api.[--INSERT-YOUR-DOMAIN--].cloudfoundry.me
However, I did not try deploying to a Micro Cloud so I can guarantee that it will work just out of the box.
Since Roo created the package in the ./target
directory we first need to switch to that directory before we can push the application to the cloud. Before we push we need to create a new MongoDB service.
cd ./target
vmc create-service mongodb mongo-howto
vmc push
An interactive dialog pops up, which you need to complete in order to deploy your application to Cloud Foundry. It is important that you bind the service you created above (mongo-howto
) to your application. This is how it looked liked for me:
Would you like to deploy from the current directory? [Yn]:
Application Name: howto-wa
Detected a Java SpringSource Spring Application, is this correct? [Yn]:
Application Deployed URL [howto-wa.cloudfoundry.com]:
Memory reservation (128M, 256M, 512M, 1G, 2G) [512M]:
How many instances? [1]:
Bind existing services to 'howto-wa'? [yN]: y
1: mongo-howto
2: mongo-opm
Which one?: 1
Bind another? [yN]: n
Create services to bind to 'howto-wa'? [yN]:
Would you like to save this configuration? [yN]: y
Manifest written to manifest.yml.
Creating Application: OK
Binding Service [mongo-howto]: OK
Uploading Application:
Checking for available resources: OK
Processing resources: OK
Packing application: OK
Uploading (5K): OK
Push Status: OK
Staging Application 'howto-wa': OK
Starting Application 'howto-wa': OK
If everything was ok, you should now be able to open the Application Deployed URL you defined in the push dialog. Please note that I probably delete the application I deployed at some point. Therefore instead of linking to the URL I will post some screenshots of the resulting application below.
Whenever you change something in your application and want to redeploy it, you first need to regenerate the application in Roo:
web mvc all --package ~.web
perform package
Then you need to update the application on Cloud Foundry.
cd ./target
vmc update
That’s it.
I am aware that there are Eclipse plugins for both Spring Roo and Cloud Foundry. However, I abandon Eclipse, NetBeans and all other IDEs some time ago and I am currently using Sublime Text 2 and have no plan of switching back to an IDE. Therefore I decided to use the command line tools.