How To Get All Features in FeatureClass with ArcObjects

What Scares Me about the Tech Behind Healthcare.gov

23. October 2013 09:13 by Scott in Opinion  //  Tags:   //   Comments (0)

We are all aware of the problems with the new roll out of the healthcare.gov website.  The large amount of JS files being sent back and forth, the slow down and the inability to sign up at most hours of the day.  But thats not what worries me.

What worries me is if this thing was so POORLY designed on the UI side, what do you think it look like on the back end side?  Do you actually think they offer encryption, data protection and have taken the time to implement industry standards to protect our most important information?

Seeing that the front end is soo poorly designed, I don't really have any faith in the back end.  This is what the news should be wondering, questioning and even guessing. 

What say you?  Do you believe they did good on the back end?

Please don't bring Politics into this.  Its a purely technical talk.

Get Parameter From Url with Javascript

23. October 2013 08:11 by Scott in javascript  //  Tags:   //   Comments (0)
function getParameterByName(name){
var match = (RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}

TimeZone Import List for MSSql

4. October 2013 17:52 by Scott in MSSql, TSql  //  Tags:   //   Comments (0)

Placed here for reference.

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[TimeZone](
    [ZoneId] [int] IDENTITY(1,1) NOT NULL,
    [Location] [nvarchar](max) NULL,
    [GMT] [nvarchar](max) NULL,
    [GMTOffset] [int] NOT NULL,
    [Created] [datetime] NOT NULL,
    [LastModified] [datetime] NULL,
 CONSTRAINT [PK_TimeZone] PRIMARY KEY CLUSTERED 
(
    [ZoneId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

 

INSERT INTO TimeZone VALUES 
( 'International Date Line West', '(GMT-12:00)', -12,'10-4-2013', '10-4-2013'),
( 'Midway Island', '(GMT-11:00)', -11,'10-4-2013', '10-4-2013'),
( 'Samoa', '(GMT-11:00)', -11,'10-4-2013', '10-4-2013'),
( 'Hawaii', '(GMT-10:00)', -10,'10-4-2013', '10-4-2013'),
( 'Alaska', '(GMT-09:00)', -9,'10-4-2013', '10-4-2013'),
( 'Pacific Time (US & Canada)', '(GMT-08:00)', -8,'10-4-2013', '10-4-2013'),
( 'Tijuana', '(GMT-08:00)', -8,'10-4-2013', '10-4-2013'),
( 'Arizona', '(GMT-07:00)', -7,'10-4-2013', '10-4-2013'),
( 'Mountain Time (US & Canada)', '(GMT-07:00)', -7,'10-4-2013', '10-4-2013'),
( 'Chihuahua', '(GMT-07:00)', -7,'10-4-2013', '10-4-2013'),
( 'La Paz', '(GMT-07:00)', -7,'10-4-2013', '10-4-2013'),
( 'Mazatlan', '(GMT-07:00)', -7,'10-4-2013', '10-4-2013'),
( 'Central Time (US & Canada)', '(GMT-06:00)', -6,'10-4-2013', '10-4-2013'),
( 'Central America', '(GMT-06:00)', -6,'10-4-2013', '10-4-2013'),
( 'Guadalajara', '(GMT-06:00)', -6,'10-4-2013', '10-4-2013'),
( 'Mexico City', '(GMT-06:00)', -6,'10-4-2013', '10-4-2013'),
( 'Monterrey', '(GMT-06:00)', -6,'10-4-2013', '10-4-2013'),
( 'Saskatchewan', '(GMT-06:00)', -6,'10-4-2013', '10-4-2013'),
( 'Eastern Time (US & Canada)', '(GMT-05:00)', -5,'10-4-2013', '10-4-2013'),
( 'Indiana (East)', '(GMT-05:00)', -5,'10-4-2013', '10-4-2013'),
( 'Bogota', '(GMT-05:00)', -5,'10-4-2013', '10-4-2013'),
( 'Lima', '(GMT-05:00)', -5,'10-4-2013', '10-4-2013'),
( 'Quito', '(GMT-05:00)', -5,'10-4-2013', '10-4-2013'),
( 'Atlantic Time (Canada)', '(GMT-04:00)', -4,'10-4-2013', '10-4-2013'),
( 'Caracas', '(GMT-04:00)', -4,'10-4-2013', '10-4-2013'),
( 'La Paz', '(GMT-04:00)', -4,'10-4-2013', '10-4-2013'),
( 'Santiago', '(GMT-04:00)', -4,'10-4-2013', '10-4-2013'),
( 'Newfoundland', '(GMT-03:30)', -3,'10-4-2013', '10-4-2013'),
( 'Brasilia', '(GMT-03:00)', -3,'10-4-2013', '10-4-2013'),
( 'Buenos Aires', '(GMT-03:00)', -3,'10-4-2013', '10-4-2013'),
( 'Georgetown', '(GMT-03:00)', -3,'10-4-2013', '10-4-2013'),
( 'Greenland', '(GMT-03:00)', -3,'10-4-2013', '10-4-2013'),
( 'Mid-Atlantic', '(GMT-02:00)', -2,'10-4-2013', '10-4-2013'),
( 'Azores', '(GMT-01:00)', -1,'10-4-2013', '10-4-2013'),
( 'Cape Verde Is.', '(GMT-01:00)', -1,'10-4-2013', '10-4-2013'),
( 'Casablanca', '(GMT)', 0,'10-4-2013', '10-4-2013'),
( 'Dublin', '(GMT)', 0,'10-4-2013', '10-4-2013'),
( 'Edinburgh', '(GMT)', 0,'10-4-2013', '10-4-2013'),
( 'Lisbon', '(GMT)', 0,'10-4-2013', '10-4-2013'),
( 'London', '(GMT)', 0,'10-4-2013', '10-4-2013'),
( 'Monrovia', '(GMT)', 0,'10-4-2013', '10-4-2013'),
( 'Amsterdam', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Belgrade', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Berlin', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Bern', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Bratislava', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Brussels', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Budapest', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Copenhagen', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Ljubljana', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Madrid', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Paris', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Prague', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Rome', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Sarajevo', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Skopje', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Stockholm', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Vienna', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Warsaw', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'West Central Africa', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Zagreb', '(GMT+01:00)', 1,'10-4-2013', '10-4-2013'),
( 'Athens', '(GMT+02:00)', 2,'10-4-2013', '10-4-2013'),
( 'Bucharest', '(GMT+02:00)', 2,'10-4-2013', '10-4-2013'),
( 'Cairo', '(GMT+02:00)', 2,'10-4-2013', '10-4-2013'),
( 'Harare', '(GMT+02:00)', 2,'10-4-2013', '10-4-2013'),
( 'Helsinki', '(GMT+02:00)', 2,'10-4-2013', '10-4-2013'),
( 'Istanbul', '(GMT+02:00)', 2,'10-4-2013', '10-4-2013'),
( 'Jerusalem', '(GMT+02:00)', 2,'10-4-2013', '10-4-2013'),
( 'Kyev', '(GMT+02:00)', 2,'10-4-2013', '10-4-2013'),
( 'Minsk', '(GMT+02:00)', 2,'10-4-2013', '10-4-2013'),
( 'Pretoria', '(GMT+02:00)', 2,'10-4-2013', '10-4-2013'),
( 'Riga', '(GMT+02:00)', 2,'10-4-2013', '10-4-2013'),
( 'Sofia', '(GMT+02:00)', 2,'10-4-2013', '10-4-2013'),
( 'Tallinn', '(GMT+02:00)', 2,'10-4-2013', '10-4-2013'),
( 'Vilnius', '(GMT+02:00)', 2,'10-4-2013', '10-4-2013'),
( 'Baghdad', '(GMT+03:00)', 3,'10-4-2013', '10-4-2013'),
( 'Kuwait', '(GMT+03:00)', 3,'10-4-2013', '10-4-2013'),
( 'Moscow', '(GMT+03:00)', 3,'10-4-2013', '10-4-2013'),
( 'Nairobi', '(GMT+03:00)', 3,'10-4-2013', '10-4-2013'),
( 'Riyadh', '(GMT+03:00)', 3,'10-4-2013', '10-4-2013'),
( 'St. Petersburg', '(GMT+03:00)', 3,'10-4-2013', '10-4-2013'),
( 'Volgograd', '(GMT+03:00)', 3,'10-4-2013', '10-4-2013'),
( 'Tehran', '(GMT+03:30)', 3,'10-4-2013', '10-4-2013'),
( 'Abu Dhabi', '(GMT+04:00)', 4,'10-4-2013', '10-4-2013'),
( 'Baku', '(GMT+04:00)', 4,'10-4-2013', '10-4-2013'),
( 'Muscat', '(GMT+04:00)', 4,'10-4-2013', '10-4-2013'),
( 'Tbilisi', '(GMT+04:00)', 4,'10-4-2013', '10-4-2013'),
( 'Yerevan', '(GMT+04:00)', 4,'10-4-2013', '10-4-2013'),
( 'Kabul', '(GMT+04:30)', 4,'10-4-2013', '10-4-2013'),
( 'Ekaterinburg', '(GMT+05:00)', 5,'10-4-2013', '10-4-2013'),
( 'Islamabad', '(GMT+05:00)', 5,'10-4-2013', '10-4-2013'),
( 'Karachi', '(GMT+05:00)', 5,'10-4-2013', '10-4-2013'),
( 'Tashkent', '(GMT+05:00)', 5,'10-4-2013', '10-4-2013'),
( 'Chennai', '(GMT+05:30)', 5,'10-4-2013', '10-4-2013'),
( 'Kolkata', '(GMT+05:30)', 5,'10-4-2013', '10-4-2013'),
( 'Mumbai', '(GMT+05:30)', 5,'10-4-2013', '10-4-2013'),
( 'New Delhi', '(GMT+05:30)', 5,'10-4-2013', '10-4-2013'),
( 'Kathmandu', '(GMT+05:45)', 5,'10-4-2013', '10-4-2013'),
( 'Almaty', '(GMT+06:00)', 6,'10-4-2013', '10-4-2013'),
( 'Astana', '(GMT+06:00)', 6,'10-4-2013', '10-4-2013'),
( 'Dhaka', '(GMT+06:00)', 6,'10-4-2013', '10-4-2013'),
( 'Novosibirsk', '(GMT+06:00)', 6,'10-4-2013', '10-4-2013'),
( 'Sri Jayawardenepura', '(GMT+06:00)', 6,'10-4-2013', '10-4-2013'),
( 'Rangoon', '(GMT+06:30)', 6,'10-4-2013', '10-4-2013'),
( 'Bangkok', '(GMT+07:00)', 7,'10-4-2013', '10-4-2013'),
( 'Hanoi', '(GMT+07:00)', 7,'10-4-2013', '10-4-2013'),
( 'Jakarta', '(GMT+07:00)', 7,'10-4-2013', '10-4-2013'),
( 'Krasnoyarsk', '(GMT+07:00)', 7,'10-4-2013', '10-4-2013'),
( 'Beijing', '(GMT+08:00)', 8,'10-4-2013', '10-4-2013'),
( 'Chongqing', '(GMT+08:00)', 8,'10-4-2013', '10-4-2013'),
( 'Hong Kong', '(GMT+08:00)', 8,'10-4-2013', '10-4-2013'),
( 'Irkutsk', '(GMT+08:00)', 8,'10-4-2013', '10-4-2013'),
( 'Kuala Lumpur', '(GMT+08:00)', 8,'10-4-2013', '10-4-2013'),
( 'Perth', '(GMT+08:00)', 8,'10-4-2013', '10-4-2013'),
( 'Singapore', '(GMT+08:00)', 8,'10-4-2013', '10-4-2013'),
( 'Taipei', '(GMT+08:00)', 8,'10-4-2013', '10-4-2013'),
( 'Ulaan Bataar', '(GMT+08:00)', 8,'10-4-2013', '10-4-2013'),
( 'Urumqi', '(GMT+08:00)', 8,'10-4-2013', '10-4-2013'),
( 'Osaka', '(GMT+09:00)', 9,'10-4-2013', '10-4-2013'),
( 'Sapporo', '(GMT+09:00)', 9,'10-4-2013', '10-4-2013'),
( 'Seoul', '(GMT+09:00)', 9,'10-4-2013', '10-4-2013'),
( 'Tokyo', '(GMT+09:00)', 9,'10-4-2013', '10-4-2013'),
( 'Yakutsk', '(GMT+09:00)', 9,'10-4-2013', '10-4-2013'),
( 'Adelaide', '(GMT+09:30)', 9,'10-4-2013', '10-4-2013'),
( 'Darwin', '(GMT+09:30)', 9,'10-4-2013', '10-4-2013'),
( 'Brisbane', '(GMT+10:00)', 10,'10-4-2013', '10-4-2013'),
( 'Canberra', '(GMT+10:00)', 10,'10-4-2013', '10-4-2013'),
( 'Guam', '(GMT+10:00)', 10,'10-4-2013', '10-4-2013'),
( 'Hobart', '(GMT+10:00)', 10,'10-4-2013', '10-4-2013'),
( 'Melbourne', '(GMT+10:00)', 10,'10-4-2013', '10-4-2013'),
( 'Port Moresby', '(GMT+10:00)', 10,'10-4-2013', '10-4-2013'),
( 'Sydney', '(GMT+10:00)', 10,'10-4-2013', '10-4-2013'),
( 'Vladivostok', '(GMT+10:00)', 10,'10-4-2013', '10-4-2013'),
( 'Magadan', '(GMT+11:00)', 11,'10-4-2013', '10-4-2013'),
( 'New Caledonia', '(GMT+11:00)', 11,'10-4-2013', '10-4-2013'),
( 'Solomon Is.', '(GMT+11:00)', 11,'10-4-2013', '10-4-2013'),
( 'Auckland', '(GMT+12:00)', 12,'10-4-2013', '10-4-2013'),
( 'Fiji', '(GMT+12:00)', 12,'10-4-2013', '10-4-2013'),
( 'Kamchatka', '(GMT+12:00)', 12,'10-4-2013', '10-4-2013'),
( 'Marshall Is.', '(GMT+12:00)', 12,'10-4-2013', '10-4-2013'),
( 'Wellington', '(GMT+12:00)', 12,'10-4-2013', '10-4-2013'),
( 'Nuku''alofa', '(GMT+13:00)', 13,'10-4-2013', '10-4-2013');

Getting Attacked by 207.210.85.102

1. October 2013 11:17 by Scott in   //  Tags:   //   Comments (0)

My small software startup is being attacked right now by 207.210.85.102 using SQL Injection.  We run a small ecommerce site along with a very large Sports Portal.  They are using attacks within our variables such as

?category=31111111111111"+UNION+SELECT+CHAR(45,120,49,45,81,45),CHAR(45,120,50,45,81,45),CHAR(45,120,51,45,81,45),CHAR(45,120,52,45,81,45),CHAR(45,120,53,45,81,45),CHAR(45,120,54,45,81,45),CHAR(45,120,55,45,81,45),CHAR(45,120,56,45,81,45),CHAR(45,120,57,45,81,45)+--+/*+order+by+"as+/*

?category=31111111111111'+UNION+SELECT+CHAR(45,120,49,45,81,45),CHAR(45,120,50,45,81,45),CHAR(45,120,51,45,81,45),CHAR(45,120,52,45,81,45),CHAR(45,120,53,45,81,45),CHAR(45,120,54,45,81,45),CHAR(45,120,55,45,81,45),CHAR(45,120,56,45,81,45),CHAR(45,120,57,45,81,45),CHAR(45,120,49,48,45,81,45),CHAR(45,120,49,49,45,81,45),CHAR(45,120,49,50,45,81,45),CHAR(45,120,49,51,45,81,45),CHAR(45,120,49,52,45,81,45),CHAR(45,120,49,53,45,81,45),CHAR(45,120,49,54,45,81,45),CHAR(45,120,49,55,45,81,45),CHAR(45,120,49,56,45,81,45),CHAR(45,120,49,57,45,81,45),CHAR(45,120,50,48,45,81,45),CHAR(45,120,50,49,45,81,45),CHAR(45,120,50,50,45,81,45),CHAR(45,120,50,51,45,81,45),CHAR(45,120,50,52,45,81,45)+--+/*+order+by+'as+/*

Small Google Calendar Class To Add Events

17. September 2013 18:22 by Scott in C#  //  Tags:   //   Comments (0)

I created a small C# class to add Google calendar events to a calendar in C#.  It is quite simple, but I didn’t find it searching the internet, so here it is.  Its dead simple.

 public class GoogleCalendar
    {

        private static string GoogleUrl = "http://www.google.com/calendar/event?action=TEMPLATE";
        public string What { get; set; }
        public DateTime StartDate { get; set; }
        public DateTime EndDate { get; set; }
        public string Description { get; set; }
        public string Location { get; set; }
        public string WebsiteName { get; set; }
        public string Website { get; set; }

        public string GetGoogleUrl()
        {
            //20130918T103000Z
            return GoogleUrl + "&text=" + What + "&dates=" + StartDate.ToString("yyyyMMddTHHmmssZ") + "/" + EndDate.ToString("yyyyMMddTHHmmssZ") + "&details=" + Description + "&location=" + Location + "&trp=false" + "&sprop=" + WebsiteName + "&sprop=name:" + Website;
        }
    }

Convert Meters To Miles C#

11. September 2013 06:31 by scott in   //  Tags:   //   Comments (0)

 

 public static double ConvertMetersToMiles(double meters)
    {
        return (meters / 1609.344);
    }

So there I was, Searching for an obscure Email Address...

29. August 2013 14:05 by Scott in Facebook  //  Tags:   //   Comments (0)

So there I was searching for an obscure email address....

And there I found a CRAZY Facebook URL....

https://www.wwww.wwww.wwww.wwww.wwww.0.facebook.com/rdnation

What is that you say?  Well I have NO idea.  

Why not you tell me?  Why does Facebook need soo many subdomains?

Put Code in Head Tags of HTML with Webforms

22. August 2013 07:29 by scott in   //  Tags:   //   Comments (0)

Working on a project and I have to put version numbers for CSS and Javascript files using the OLD webforms for ASP.NET.  Since I am working with such an old framework, I need to be creative.

Here is how to do it.

   1:    <head runat="server">
   2:  <asp:PlaceHolder runat="server">
   3:            <%=  @"<link rel='stylesheet' type='text/css'  href='/css/main.css?v=" + Web.Configuration.JS_VERSION + "' />" %>
   4:            <%=  @"<script type='text/javascript' src='/scripts/default.js?v=" + Web.Configuration.JS_VERSION + "'></script>" %>
   5:        </asp:PlaceHolder>
   6:  </head>

Interview Questions

16. April 2013 12:35 by Scott in   //  Tags:   //   Comments (0)

I am starting to go on Interviews.  I was asked some questions I needed a mental refresher on.  I guess I don’t use these on a day to day basis with my current company, so I fell out of habit with them.  I also think that since I didn’t receive any formal training in CS, I don’t know much for keywords which could also be the problem.  I understand the concepts, just not the actual verbs for each concept.

1. What is a primitive data type?

Char, Int, Floating Points, boolean and pointers would all be considered primitive data types.

2. Whats relationship between objects and classes?

Objects are the actual instance of each class.  Objects can be created and destroyed, objects are living.

3. Whats an Interface?

A template of a class that needs to be implemented or inherited from, but without doing any work.

4. Whats an Abstract Class?

Same as an interface, but this class can do work within its methods.

5. Whats a static variable?

A variable that lives within the class, but it’s the same for every object of that class.  So if it changes for one object, it will change for every object.

6. Whats a Race condition?

Where an output of “mostly” multi threaded programming is dependent upon the timing of the uncontrolled events.

7. What is a deadlock?

Where two competing actions are waiting for the other to finish.

Quote of the Day

28. December 2012 17:12 by Scott in Quote  //  Tags:   //   Comments (0)

Good Coders Code, Great Coders Reuse