Pete On Software

RSS Feed

Archive for March, 2014

Sql Power Architect Java Heap Space Error

Sql Power ArchitectThis is definitely going to be one of those posts where I’m posting this not only for others to find while they are Binging and Googling, but for future Pete to come back and re-figure out how to do something that took him some time to figure out in the first place. I’ve had several posts like that (this gem chief among them), and this sort of situation is a very good reason to have a blog. Blogs are good places for a brain dump.

My issue this time was with a tool called Sql Power Architect. Sql Power Architect is a data modeling tool that I was using kind of as an Erwin-lite due to Erwin’s super high price tag and Architect’s free community edition.

I was trying to make a diagram of a database that I was being asked to examine for issues. I was able to reverse engineer the database and lay it out like so:

Sql Power Architect Test Database Diagram

However, when I tried to generate the PDF of this diagram, I got this error:

Sql Power Architect Java Heapspace Error

So, I did some searching and I wanted to increase the Java heap size, but only for that application if possible. I don’t run that many Java programs on my machine and I definitely didn’t want to upset the delicate balance of the Android environment that I have set up on the Windows side (which, incidentally is way more “picky” that the Android environment on the Mac side).

What I found is the Xmx switch for the java command line. I navigated to the Sql Power Architect install folder and figured out that architect.exe probably just called architect.java under the covers, so I executed this command below:

Sql Power Architect With Xmx Switch

That fired up the program with a 1 gig heap size. After that, I loaded my diagram and was able to export it to PDF without any issues.

The finished PDF:
Sql Power Architect Pdf Success

As I said, hopefully this post can be helpful to some poor soul in the future (even if that soul is me).

Podcast Episode 11 – Ron Carter on Being a CIO

Ron CarterThis week’s podcast was pretty fun. I interviewed someone that I know very well, someone who has taught me more about business and the business of software than any other person, Mr. Ron Carter. Ron is a CIO of a healthcare services company and held many roles in the past: consultant with major firms, developer, DBA, and architect, among others.

Ron has a track record of successfully delivering product after product, across many verticals in both the public and private sectors, for a tech industry where the failure of large product projects has become a punchline. Needless to say, Ron has a wealth of experience to share and I’m excited to have him on the show.

We talk about what it takes to be a CIO of an organization. Looking forward as a career path, we cover the role of CIO and the skills and knowledge that developers would need to reach the role. Other topics include team building, building trust, advice for new CIOs, and remote work.

It was a great interview, definitely give it a listen!

An Intro to CocoaPods

CocoaPods LogoIn today’s development landscape, dependency management is becoming an increasingly important problem to solve. As applications incorporate more and more external libraries (especially very active open source libraries), making sure that your application has the most up-to-date versions of those libraries becomes more tedious. Add in the necessity to make sure that every one of your dependencies has its dependencies met, you are definitely facing a headache.

If you come to Objective-C and iOS development from other languages, you might already be familiar with the solutions that those ecosystems provide. In .Net there is NuGet, Ruby has Gems, Node has NPM, etc. In Objective-C, the most popular dependency management system is CocoaPods.

CocoaPods is made with Ruby and you can get started with it with the version of Ruby that is on the Mac by default. All you have to do is type “sudo gem install cocoapods” (without quotes) in the terminal, enter your password, and you are off and running.

CocoaPods Install

The terminal will just sit and wait for awhile during the install. Unlike Homebrew, you don’t get any feedback during the installation. When it is finished, you will get a bunch of text for the change log for the version that you just installed and – if all went well – it will conclude with this message (the version could vary based on what is current when you are doing your install):

After that, CocoaPods is ready to use.

For the first step, we need to have to make a new project (or use an existing project). Since we are starting fresh and new, I’ll just make a new project. I’m going to open Xcode and make a new project:

Xcode New Project

Then, I’m going to choose “Empty Application” and click next. (Note: you might see different options here based on what you configurations or installations you have on your machine.

Choose a Template

Then, we can fill out a little information about our application and click Next again. After that, choose somewhere to save it and finish up:

Set Project Options

After your project opens, go ahead and shut down Xcode. You are never going to intentionally directly open that .xcodeproj file again.

Open the terminal and navigate to the directory where you saved your project. First, we’ll create a podfile. A podfile is just a text file that keeps track of what dependencies you are taking and a list of the versions that you are willing to accept. We are just going to make a very simple podfile and take a dependency on AFNetworking, a very popular Objective-C networking client.

With your terminal active in your project’s directory, just type “touch Podfile”. That will make a podfile (no extension) in your directory. Then, you can edit that file in your favorite text editor. If you want to stay in the command line, you can type “vim Podfile” and then press i to go into insert mode. Then add the following text, followed by the key combination of Esc, then colon, then wq then . This will take you back to your terminal.

The file contents:

Here are those steps visually:

Touch Podfile

Podfile Contents

Type pod install and your pods will be installed and configured*
pod install

If you look at the project directory in Finder, you will now see that files and folders have been added.

After the Pod Install

The file that you care the most about now is the .xcworkspace file. If you are familiar with .Net, the .xcworkspace file is like the .sln file and the .xcodeproj file is like the .csproj or .vbproj files. The way that CocoaPods works, it makes your Pods code its own project and your existing code stays its own project and the .xcworkspace encompasses them both. As I mentioned earlier, from now on, don’t open your .xcodeproj file, but instead have Xcode open the .xcworkspace.

I find it handy to go File -> Open Recent -> Clear Menu from the Xcode menu so that my .xcodeproj file is removed from recent files and I don’t accidentally open it. Then, I can either double click on the .xcworkspace or choose “Open Other…” from the Xcode launch screen.

Now that the workspace is launched, you can see that the CocoaPods have been added to your code. Now you are able to import the header files into your code files and use your imported libraries as if they had always been there.

Podified Workspace

It might seem like we did a lot of steps to get to this point, but that was only because we had to include the initial CocoaPods gem installation. From now on, you just need to add a completed Podfile to your project directory, run pod install and then use the workspace from then on.

If you are the kind of person who likes to watch to learn rather than just read, you can check out a FREE video available over at NSScreencast about CocoaPods. Happy Podding!

* If you have an error when you run pod install, check out this StackOverflow, it solved my issue caused by a bad update to Cocoapods.

Podcast Episode 10 – Interview With Dustin Rogers

Dustin RogersFor Episode 10 (double digits!) of the Pete on Software Podcast, my special guest was Dustin Rogers. Dustin is an extremely skilled interactive designer based in Columbus, Ohio.

I know Dustin from a few projects that we collaborated on in the mobile space and I can vouch for the fact that he is very talented. He is also very practical and his designs not only look visually appealing, but they are also eminently usable and intuitive.

During this episode of the podcast, we talk about the tension between developers and designers, how to get through creative roadblocks, the importance of communication, the nature of inspiration, why infographics are awesome, and the exciting promise of mobile.

Dustin also recently did me a solid and created cover art for my Pete on Software Facebook Fan Page. He took my cartoon avatar from the podcast art and put him in a studio with a microphone and some headphones with the Columbus skyline. Very cool and something I never could have put together.

Dustin is also a very talented sketch artist and you can see some of his work at his site. And when you are done there, why not check out his interview?

Podcast Episode 09 – My Interview With Craig Schwartz

Craig SchwartzIn episode 9 of the Pete on Software Podcast, I interviewed Craig Schwartz. Craig is the owner and principal at Gecko Jones, a marketing and product management company whose main goal is helping your organization to reach the next level.

It was kind of interesting how I even got the interview. In Episode 6 of the podcast, I reviewed the Choose Yourself book by James Altucher. I tweeted out the podcast and James was kind enough to RT me. On that show, I put out a call for ideas or volunteers for interviews and Craig stepped up. That is the power of social media at work right there!

In the episode, I talk to Craig about product planning and marketing. We not only talk about how to know if you have a viable product and how to promote it, but we also talk about self-promotion and how to get along better with the “creatives” over in marketing.

If you haven’t already listened, check it out. It will definitely help you be a more well-rounded developer!

« Older Entries