Friday, December 23, 2011

Raspberry Pi


I'v been following the Raspberry Pi for a while now and there almost ready for production!
Here is a picture of a test board.
 
Its the size of a credit card! 


Here are the specs for people that aren't familiar with the project.
 


The point of this project is too provide a cheap computer for kids to learn programming. 


They will have 2 versions, Model A(128mb ram) will cost $25 and the Model B(256mb ram) $35. There scheduled to start selling them early 2012.

Friday, March 26, 2010

2010 ESRI Developer Summit

Unfortunately this year I didn't get to go to the ESRI DevSummit but I have been
keeping a close eye on the plenary videos and tweets from everyone that were there.
Following is a list major going ons at the dev summit.

ArcGIS Desktop 10
- New icons....yeah!!??
- Total new modern UI + dockable windows (very visual studio like)
- Python = AML, Python editor with intellisense built right into ArcMap. Python is fully integrated map production, analysis, scripts, reports, etc . (not sure how non-developers are going to like this, they already think ArcMap is too complicated.)
- ArcCatalog built right into ArcMap
- Search engine built into ArcMap
- Seamless panning
- Background geoprocessing....FINALLY!!!!
- New sketch tool with template based design
- New Add-Ins framework...no need for admin privilege to install an add-in. Available in for .NET & Java.
- Share Add-Ins using ArcGIS Online and install right from the web browser.
- Fast map display
- Full integration with ArcGIS Online
- Drag toolbox tools onto toolbars
- Will support .NET 4.0 and VS2010
- They want us developers to throw a way old arcobjects code and replace it with Python....yeah that should go over real well.
The new development platform for 10 is suppose to be streamlined, so they rather you use that. (I get the feeling arcobjects as we know it is on its way out. ;-) )
- Ships in June!

ArcGIS Engine 10
- Engine inherits all new features of Desktop.
- Simpler API
- License options, concurrent and borrowing

- I wonder how long before ArcGIS.com snuffs out GISCloud.com, WeoGeo.com, Fortiusone.com, Cloudmade.com and anyone else with a cloud offering.

ArcGIS Server 10
- Web editing on all client platforms JSAPI, Silverlight, Flex, iPhone SDK
- New Feature service
- Ability to make a custom REST services based on ArcGIS Server REST API
- Time data is supported
- Mosaic feature to publish imagery tiles without any preprocessing...very FAST!

ArcGIS Mobile
- sdk support for iPhone, iPad, Windows Phone 7, Android
- Mobile manager to publish maps for mobile apps

ArcGIS Online + Explorer
- Explorer has been ported to silverlight and now can be accessed in all major browsers.

Misc
- Working on a full 64bit version of ArcGIS Server
- File Geodatabase API...get more here
- Scott Morehouse, Director of Software Development says there pivoting all apps to web/cloud concept.

The major point you get from this years dev-summit is that ESRI is taking
gis web applications and platforms very seriously. How long will it be before you see ArcMap and all there desktop apps running in the ArcGIS Cloud? Probably once they sort out a good license model and scale ArcGIS Server. The question is will they take it that far? If they do I can see a lot of partners that spent good money building web apps investing in ESRI server technology being very ticked. Plus that would push a lot of the new up and comers of the gis cloud party out.

I guess time will tell if ESRI will dominate the cloud like they dominate the desktop and server space.... I'm betting yes.

Monday, November 23, 2009

TweetGIS

I just wanted to talk about a little project I did early in the year for ESRI's 2009 Developer Summit's Dev Challenge contest. At the time people were just starting to understand what Twitter was and how to use it. So I thought it would be a really neat way to use Twitter as an editing status feed on parcel data. It would tweet when someone edited the attributes of a parcel and include a link to the parcel that was edited. It would also tweet when a new user was created and when one returned.

Since ESRI's Javascript framework doesn't support attribute editing I separated the data from the features. I put the attribute data inside Google Spreadsheets, which I found out does not have a record limit.

The project is made up of 2 apps. The front end which consist of html, jQuery and ESRI's JSAPI Framework. Then the server side piece which I used ASP.NET MVC, TweetSharp library and Google's Spreedsheet API.

The project came together really well and took 2 weeks of late nights.

Here is a presentation I did on it

Demo

Source Code

Thursday, August 27, 2009

ComicsInventory.com

I just wanted to share a little project I've been working on called ComicsInventory.com.

I have been a big fan of comic books for years and have over the years accumulated a very large collection. Sometime ago I decided to start organizing my collection and finding out how much each issue was worth. I looked around the net for a solution but found very over priced solutions or free solutions that had very bad interface designs or poorly written code. This gave me the opportunity to merge my love of comics with my love of code. Plus I figured I could use the site as a testing ground for anything new that comes out in the coding world ;-)

For my framework I decided to use (at the time) the beta of Asp.net MVC. I liked the freedom it gave you and its minimalistic design. It's faster, lighter and gets you back to html and http. No server controls or viewstate! But I've already talked about this before.

Since theres so many different ways to organize comics. I decided to build the site around a labeling system. This gave me the flexibility to assign multiple labels to comics and group them in different categories. A side benefit that came about was when I added the "total price" feature. This made it very convenient when getting values for all your spider-man comics. But also if some of those spider-man comics were CGC'd. I could create a CGC label and see how much all my CGC comics were worth.

Another big feature is the Image Viewer and Image Upload. This was tricky because I had to reliably upload an image, create 2 copies (1 large & 1 thumbnail) and upload those images to Amazon's S3 service. All in 1 step. I used the awesome flash plugin Uploadify to constrain the image sizes and handle the image upload to the site. I then used the .NET image classes to copy and resize the images. Instead of making my own Amazon S3 library I decided to use ThreeSharp. This library was fantastic and had an active discussion section.

Designing the interface and the look of the site was very important to me. I wanted the site to be very clear, easy to use, but also minimalistic. I spent time at 37signals, studying there site but also there philosophy on feature creep and really focusing in on what features are important to ship with first. It helped a lot with designing the Home page where I wanted to show what the site was about.

I learned a lot about the MVC architectural pattern, designing and using third party services to extend your site. But the best thing is I now have a place to inventory my comics and in the process created a service that others can benefit from.

Site Architecture

Core
  1. OS: Windows Server 2008
  2. Web: IIS 7.0
  3. Database: SQL Server 2008
  4. Language: C#

Dev Tools
  1. IDE: Visual Studio 2008 Team
  2. Framework: ASP.NET MVC
  3. Data Access helper: Microsoft Enterprise Library
  4. Browser Framework: jQuery
  5. Source Control: Subversion
  6. Subversion Client: AnkhSVN
  7. Compare Tool: WinMerge

Third party libraries
  1. Uploadify - flash plugin to handle uploads & constraints
  2. ThreeSharp - Amazon S3 library
  3. Json.NET - JSON Serializer/Deserializer
  4. Google Analytics - web site statistics
  5. UserVoice - feed back system

Tuesday, May 26, 2009

Using jQuery Plugin Uploadify with Asp.net MVC

Just started using this great jQuery plugin called Uploadify, that lets you upload multiple files to the server. It uses flash to queue the files and send them one by one to the server. Plus provides feedback and all other types of goodies. The implementation is pretty straight foward.

Just add this client side code.

<script type="text/javascript" src="/Content/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/Content/js/jquery.uploadify.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#fileInput").uploadify({
uploader: "/Content/swf/uploadify.swf",
script: "/UIImageViewer/Upload",
cancelImg: "/Content/imgs/cancel.png",
auto: true,
folder: "/uploads",
onError: function (a, b, c, d) {
if (d.status == 404)
alert("Could not find upload script. Use a path relative to: "+"<?= getcwd() ?>");
else if (d.type === "HTTP")
alert("error "+d.type+": "+d.status);
else if (d.type ==="File Size")
alert(c.name+" "+d.type+" Limit: "+Math.round(d.sizeLimit/1024)+"KB");
else
alert("error "+d.type+": "+d.text);
}
});
});
</script>
<body>
<input type="file" name="fileInput" id="fileInput" />
</body>


Then create a controller with a "Upload" action.
  public string Upload(HttpPostedFileBase FileData)
{
/*
*
* Do something with the FileData
*
*/
return "Upload OK!";
}


The tricky part, which drove me crazy, is that you need to use the "HttpPostedFileBase" class NOT the "HttpPostedFile" class. If you use the other class the script will return a "IO Error #2038" error message.

Saturday, March 28, 2009

2009 ESRI Developer Summit

ArcGIS 9.3.1 Server (ships after U.C.)
- New Optimized Map Service that is as fast as ArcIMS or sometimes faster.

- New Map publish toolbar in ArcMap that helps optimize mxds and rendering speeds, using the analyze tool. The analyze tool produces errors, warnings and messages to help you see what's slowing down your map service. It also creates a new optimized mxd file with a .msd extension, that is used for the new Optimized Map Service. During one of the sessions it took a map that rendered in 12sec and optimized it to .8 secs.

- New Silverlight API beta is released with some custom controls like automatic point clustering and rendering. The demos were really slick and fast. At one of the sessions someone asked what the limitations of the Silverlight API was. Art Haddad said he tested rendering 10,000 points with no problem. He says your bandwidth is now your bottleneck. For you JavaScript API folks out there, you know the pain and limitation of only showing 100 points before it brings your browser to a crawl. Also map rotation will be supported. I believe this will be ESRI's default web client.


ArcGIS 9.4 Desktop (ships late fall or early next year)
- New UI with dock able controls like Visual Studio

- Catalog has been added right into ArcMap

- Asynchronous geoprocessing (basically when running a toolbox tool it will not lock up your whole ArcMap session anymore)

- Side by side deployment (9.3.1 & 9.4 versions will be able to run on the same machine)

- High performance graphics

- Full python integration with script console

- Enhanced editing in 2D & 3D

- No support for IE6, VB6, VS2005, Oracle 9i, SQL2000, Win2000 & Win Server 2000

- VBA only available for legacy

- Python is now the default custom tool language

- New layers tab in ArcMap that groups the layers by there state. Groupings like Visible, Out of Scale Range, Hidden layers, and Selectable layers.

- New editing tools for ArcEngine that match the tools in ArcMap

- Search integration in all products

- New layer type called "Query layers" that limits displayed features using SQL syntax.


ArcGIS 9.4 Server (ships late fall or early next year)
- Web editing service provided in all web APIs.

- Support for native SQL, no ArcSDE required.

- Faster map tile retrieval.

- Query Layer support

- Access to standalone tables

- Improve map cache update workflow

- Full support for domains

- Support for native SQL



ArcGIS Explorer 900
- New feature lets you create presentations with fly over animations using your data. It also lets you import you PowerPoint slides.

- Virtual Earth data will be available.

- New ribbon interface and a custom settings file can be created to limit what tools are shown for custom user installs.



Other random items
ArcGIS Online (ships after 9.3.1) - Using your global account you can log in and share your data by uploading it. You can even create groups and secure them so that only certain people have access to the data. You can even create hosted maps from your uploaded data. No mention was said if this would be a free site or some type of paid service.

Layer Packages - These are basically compressed files that will include the layer symbology and data in one file. This will be used to upload data to the new ArcGIS Online.

Using Open Layers with the REST API - James Fee gave an interesting user session about modifying the open source project Open Layers to use the ArcGIS Server REST API. Right now it supports a subset of the REST API features but will support all functions possibly by Fall of '09.

ArcGIS Mobile 9.4 - Mobile will be supported on tablets and the SDK has been made easier for task based programs. The same program should work on handheld and tablet with no modification.


This year I would say the key jargon phrases for the summit are "Web Maps" and "Story". "Story" is taken from Microsoft and basically its a way to assign emotion to a product. It also describes the user experience. It was used in almost every session I went too. "Web Maps" is ESRIs way of saying "stop creating sites that mimic ArcMap on the web" and create more focused web map applications with the least amount of layers. I'm not really sure this is cost effective. Since most clients want to get the most bang for there buck and don't really want to pay you to create 5 focused sites when 1 light web gis viewer could do the same thing. I understand there shooting for the Google simple map app, but I don't believe in these financially
sensitive times that this makes sense.

Overall I think the Dev Summit was good and I'm really looking forward to playing with the Silverlight API and the Optimized Services.

Tuesday, February 3, 2009

Sending email in C# using GMail!



Here is some code I put together to send email using your Gmail account.
This can come in handy if you want your app to send notifications and you don't have access to an SMTP server.

Remember there is a limit that Gmail puts on mass emails. They will punish you if you go over it.

Gmail Sending Limits
In an effort to fight spam and prevent abuse, Google will temporarily disable your account if you send a message to more than 500 recipients or if you send a large number of undeliverable messages. If you use a POP or IMAP client (Microsoft Outlook or Apple Mail, e.g.), you may only send a message to 100 people at a time. Your account should be re-enabled within 24 hours.



Remember to set "DeliveryMethod = SmtpDeliveryMethod.Network". If this is not set then Gmail will come back with a "client was not authenticated" error.

Code
using System.Net.Mail;
using System.Net;

var fromAddress = new MailAddress("from@gmail.com", "From Name");
var toAddress = new MailAddress("to@yahoo.com", "To Name");
const string fromPassword = "password";
const string subject = "test";
const string body = "Hey now!!";

var smtp = new SmtpClient
{
Host = "smtp.gmail.com",
Port = 587,
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
Credentials = new NetworkCredential(fromAddress.Address, fromPassword),
Timeout = 20000
};
using (var message = new MailMessage(fromAddress, toAddress)
{
Subject = subject,
Body = body
})
{
smtp.Send(message);
}