Showing posts with label pc. Show all posts
Showing posts with label pc. Show all posts

Wednesday, February 27, 2013

What to install on a new machine?

What do you install when you get a new machine? As a developer you have to install a lot more things than a normal user.

For a Window box I need the following:

  • Java SDK
  • 7 Zip
  • Eclipse
  • Android SDK
  • Sublime Text
  • Chrome, FireFox, Opera to test websites (IE is preloaded)
  • SmartGit, Tortoise, TFS (what ever version control you currently use)
  • Console2 (allows you to do transparent / tabbed command lines)
  • Greenshot to get easy screen shots, annotate and crop them
  • System Internals (lots of tools, need most of them)
  • Paint.NET (so far my favorite free paint program)
  • Hoekey (run things off Win+key combinations)
  • Pencil (quick wireframes)
  • MediaMonkey (music and other files)
  • Python (for quick scripts and easy file parsing)
  • Picasa (for fast photo viewing)
  • Various USB / ADB drivers for Android phones (Motorola, Samsung, HTC)
For a Mac I need the following:
  • Java SDK
  • Eclipse
  • Android SDK
  • Xcode
  • Sublime Text
  • GIMP (for painting chores)
  • AppCode (if company will pay for it, I like it better than Xcode)
  • Source Tree (if using GIT)
  • Chrome, FireFox, Opera (Safari already there)
Both 
  • Chrome extensions, FireFox extensions or both
  • Current set of bookmarks (auto imported by Chrome)
  • Existing code snippets I have collected over the years
  • Music
  • Wireless headphones (not really an install, just plug them in)
It can take a bit of time to get it all set up but it really is not that big of a list. Most things are already on the box ready to roll. If it is a totally fresh machine you have to install the latest updates from Apple or Microsoft before you move along too far. I try to carry most of my list on a USB key so I can hit the ground running instead of eating up bandwidth trying to get the required bits on my first day.

My new job will provide a MacBook Pro. I need to get used to GIMP again. I have been using Paint.NET mainly for the past year. I have had positions where I have both a PC and a Mac and I have cheated and used the PC for a lot of my graphics work just because I am familiar with it. I have Photoshop Elements at home and I use that too. I will also have to spin my head into Linux command line usage. Not that I need the command line very often on a Mac but when you need it you need it bad and don't want to have to look up every command.

In general it is not too hard to switch between a Mac and a PC. I will have the same keyboard - a Microsoft Natural 4000, at home and work. They layout just works better for me. Some of the keystrokes on the Mac will mess me up for a bit. I used to switch between the two every few minutes as I was doing Android work on one and iOS on the other or I was testing our main Java app on both so I would be testing layout differences.

Always interesting to start on a new machine then to start realizing what you are missing. Some program that you only use so often. Of course in the old days you had to dig out a CD or a floppy disk and install it. Now as long as you remember the name you can download and install it off the internet. Physical media is not used much. 

My wife got a new laptop and I was able to set it up pretty quickly. It is a Lenovo laptop I got refurbished from Microcenter as I did not want a machine with Windows 8 and I wanted something with a lot of RAM and a good processor. Save but sturdy. Why not Win8? Am I not a tech? Yes I am a nerd but she would be the only one in family with Win8 and I just did not want to mess with it. I have not heard good things at this point. Generally skipping every other release of Windows has been a safe bet.

I was able to install things quickly. I had to dig out or Quicken CD but everything else came off the web including an install of Office 2013. She was up and running easily and does not use the machine for development so my list about was cut pretty short. She does a great job keeping her documents and what not on our home server so everything was there. Calendar, Contacts and emails are done through Google as they sync with her phone so all of that was ready too. The cloud sure has made things much easier. The home server, which is backed up Mon, Wed, Fri, also helped a lot. It serves as a printer server too.

Ready to get my new Mac going. I will add to the list if I find other things I needed to install.

Thursday, August 9, 2012

iPad development to influence my PC code

I am converting the Java WebStart JIDE CellSpanTable based appointment scheduler to the iPad. It has a slightly different purpose on the iPad but needs to display the appointments in almost an identical way. The Java desktop application was recently converted from MigCalendar to JIDE CellSpanTable by me. I was pretty happy with the results but now I am thinking of refactoring it again.

Why bother? First there are some limitations to the CellSpanTable. I am using a JXLayer to get around some of them. That allows me to paint on top of the grid to show the current time line and for Drag and Drop support. Things are a little screwy when I attempt to scroll to a starting position in the grid. When I do that some of the paint offsets are incorrect. I have made all the adjustments in the code to handle this conflict between the JScrollPane and the CellSpanTable.

I also have issues with the time margin not fully painting in sync as you scroll the grid vertically. When you stop dragging the scroll bar everything lines up, just during the drag there is a stutter. This sort to thing always bothers me.

Since I am spanning cells based on appointment durations I can only pick one background color for the full cell span. This means if the appointment starts before normal business hours the spanned cells all get the "business is closed" background color which is not accurate. I also don't get the grid lines painting across any cell that has a spanning appointment.

I have to track extra information for cell spanning and the code is a bit difficult to grasp every time I look at it. I hate code like that. It is complex because it is not an easy process but it is hard to explain why I did what I did to make it work.

When I converted the code to the iPad I did not have a 3rd party grid control to help me out. The nice thing is I was able to concentrate on doing my own grid because I already knew how to do all the other appointment painting, time margin painting etc. I knew all the limitations of the JIDE grid that annoyed me. I was not overwhelmed with the full rewrite of something that I did not fully understand so I could initially concentrate on the grid. In fact I was forced to concentrate on how to get a grid to paint, there was no easy way out. I did some searches on the web just to make sure someone did not have a workable solution but I did not find anything to fit my needs.

I have written many a custom control so I was not afraid to tackle another one. I was able to use Quartz on the iPad to manually paint the grid and all the appointments. I solved numerous issues I had with the JIDE grid while coding the new control. I am fully in control of all the painting. I don't have any scrolling sync issues. I don't have to use an overlay painter - I paint things in the Z order I need. I am not using a grid data storage system that does not completely apply to what I am attempting to do. There are no scrolling coordinate offset issues.

This is not a generic cell spanning grid control for the iPad. This is a highly optimized grid for the purpose of painting an appointment schedule. Not that I couldn't take some time to make it more generic. My goal was to get something running that was super optimized for my painting needs. I want a very responsive UI for this application. I also will convert this to the Android platform in the near future. It should be a fairly straight forward port.

Based on the painting I did on the iPad I have already improved the look of the PC Java code. Taking a second look at things and being under less time pressure I was able to come up with a nicer look to the appointments with the start / end time in a darker color to visually highlight them to the user. I also drew a pointing ball in the margin to visually enforce the location of the current time line that can get a bit lost in the grid especially the current time falls on the hour. Just adds to the professional feel of the app.

I don't have the issue with grid lines not painting as I paint them first then overlay the appointments. The proper background color is painted for the cells too since that happens independent of the appointment paint.

The appointment memory storage is much cleaner because I am not taking what I need and forcing it into the memory layout of the grid so it can ask me to paint the appointments as it is painting each cell. Using Quartz I just paint my layers - verifying that what I am painting is visible on the screen based on paint offset and component size - avoiding all sorts of callbacks and other overhead.

On the PC your scroll with the scroll bars but on the iPad you scroll via touch. I really like the way touch scrolling works on the iPad and I miss it every time I run the PC app. I keep trying to click drag the PC app just like I do on the iPad simulator. Maybe I will have to implement that on the PC too!

Other than the auto-scrolling of the grid as you drag and drop an appointment I think the conversion will be pretty easy. The JIDE CellSpanGrid did the auto-scrolling for me. Not like this is some super secret magic bit of code, just need to write it up and make sure it feels right when it is done.

I am looking forward to tackling this on the PC then again on for Android devices. I am sure I will optimize it just a bit more on each one. The first time you write code it always stinks, you have too big of a picture in your head. On the rewrite you can concentrate on the minutia. You are basically doing a code review of your own work as you convert your logic to each language / platform.

There was a lot of learning around Quartz during this project. Sure I will learn more about Graphics2D under Java too. I have used it enough to have a pretty solid grasp there but something new pop-ups with each project.

Wednesday, July 25, 2012

Sharing a keyboard and Mouse between a Mac and PC

My main development box is a beefy dual screen PC. I do a lot of Mac work too. I test all our WebStart Java based code on the Mac to make sure controls are sized correctly, accelerator keys work as intended etc. That is all done with IntelliJ. I also write all the mobile code for iOS devices via Xcode and Android devices via Eclipse meaning I switch around a lot.

I tried VNC for a few days but ran into too many short comings. I have the Mac hooked up to my second LCD and switching video inputs is easy enough but hauling over the mouse and keyboard was annoying.

Yesterday over lunch I picked up a KVM at Microcenter. Box listed it at $29.99 but it rang up at $12.99 at the register. This is the TrendNet 2-port KVM Switch Kit TK-207K. Simple piece of hardware about the size of a deck of cards, just a little thicker and wider. I plugged in my USB generic mouse and MS Natural Keyboard 4000 to the device and plugged in the included outbound VGA (not using) / USB cables to the PC and the Mac. There is a 1 and 2 button on top of the box you press to toggle between machines. If I am on the PC I can hit Scroll Lock twice to go to the Mac but it does not appear to work from Mac back to PC, instead it dims the screen. Press the button is no big deal.

Both machines seem to be happy doing the switch. I can now run everything off the one mouse and keyboard which is making life much simpler. The other big advantage - the MacBook Pro only has two USB ports. I had the mouse in one and the keyboard in the other. I only need one for the KVM switch. This allows me to plug in a USB key, the iPad or whatever without pulling the keyboard.

Here are the minor issues:

1) On the Mac the main screen in the laptop screen. Everything wants to start on that screen even if a program is on the second screen it wants to show pop-ups / associated windows on the primary screen.

2) Just put Lion on the Mac so I could upgrade to latest Xcode. By default Lion does scrolling opposite of what Snow Leopard did. This makes it act like a iOS device which is fine when using touch pad but annoying when using mouse especially when you switch between it and Windows during the day. I turned off that setting.

3) Can't double scroll lock to switch back to PC side.

4) Wish I could run both my external LCD screens of the Mac even if it meant shutting down the laptop display. If that worked I could switch to just using the Mac for email, IM, IntelliJ for Java, Eclipse for Android and Xcode for iOS. The laptop display is OK but not positioned on my desk in a good spot right now. Once you get used to two 24" displays you don't want to go back to a 15" display.

Switched text editors


I had been using PSPad on the PC for the longest time. I then switched to NotePad++ and then after reading a number of glowing reviews of Sublime Text 2 I switched to that. Seems to work out nicely on both the PC and Mac. I had been struggling to find a good text editor on the Mac and was using JEdit. Using the same editor on both machines is very handy.

I tend to leave a text editor open on my machine at all times with multiple tabs going. Right now I have 5 tabs running - Work info, Android Notes, Charge Capture Mobile, Front Office, Tablet Calendar - one for each project I am in the middle of working on. During the day if someone stops by with a suggestion I type it right into the appropriate file. Maybe I come up with some wild idea - type it in. It is my way of keeping massive to do list, future notes, things to investigate and random thoughts all where I can find them easily.

The Mac will take over my Tablet Calendar notes as that is where I will be doing that work for the time being until I start the Android conversion. I also end up opening source code from other projects to steal code snippets so having a bonus text editor open is very handy. Its other big job is grep. Any text editor must have "find in files" to be useful to me.

Monday, July 16, 2012

Using TightVNC for Mac development

My main PC machine is a nice dual screen setup with a fast process and lots of memory. All of my email and IM processing happens on that machine. When I use the MacBook Pro for iOS development I run into multiple issues:

1) Screen is smaller (nice screen but smaller)
2) MacBook Pro keyboard is missing keys I use a lot for programming such as Home / End
3) Company Global Policy times out / locks my PC after 5 minutes
4) With PC locked out I have a blank screen and don't see incoming instant messages and emails

I enabled screen sharing and set up a password for it on the Mac. I then fired up TightVNC on the PC and connected to the Mac. I now get to use my PC keyboard and mouse and have Xcode up in a window on my PC. The PC has a large screen at 24" vs. 15" and more pixels thus I can run the Mac OS in a window and not lose any of my PC context.

So far TightVNC has disconnected a couple of times but a simple click on the taskbar icon brings it right back up. The Mac seems to be happy about the whole thing. I am not seeing any issues with typing, mouse or screen lag. iPad emulator appears to work fine too. On occasion it can be a bit tough to get the Mac taskbar to appear. Since the Mac is sitting on the desk right next to me I can quick swivel my chair and pull it up there. Probably just need to find the sweet spot to let the mouse hover.

At times I think about getting a used Mac Mini to continue iOS development at home. I have not wanted to do that as I thought I would need to set up KVM switch. Did not want to buy a Mac laptop due to cost but the Mini is pretty cheap and setting it up to do VNC is simple. I would have no need for the KVM which can get pricey if you want digital monitor connections. What's a little network bandwidth between friends?

** UPDATE **

I think I am giving up on using VNC with the Mac. TightVNC was crashing a bit too often. I set up UltraVNC and I was able to get the keyboard confused too many times. UltraVNC did not crash but you can't properly use the Windows key with it either. It is just getting to be a bit too much of a headache which means my dreams of a Mac Mini sans KVM are going out the window too.