Search This Blog

Wednesday, December 31, 2008

Yahoo Maps API Summary

Maps API site http://developer.yahoo.com/maps/

Documentation
Map Image API from Yahoo! Maps
Simple API Maps
AJAX API Maps

Examples from Zamples
somewhat Related: Silverlight based mapping control DeepEarth

Tuesday, December 30, 2008

Monday, December 29, 2008

Live Traffic widgets

From FeedJit

Creating Universial Zoom levels

Creating Universial Zoom levels to use across Google/ Yahoo / and Virutal Earth APIs

From http://code.davidjanes.com/blog/2008/11/08/switching-between-mapping-apis-and-universal-map-levels/

Table of map zoom level equivalents

Google Maps and Virtual Earth the same zoom levels, excepting that Google has a level 0. Bigger numbers are closer to the ground, smaller numbers are up into space. Yahoo Maps has fewer levels to work with - it doesn’t let you drill down below the block level. Yahoo numbers its zoom levels the opposite of Google and Virtual Earth, small numbers being closer to the ground and so on and so forth.

To allow seamless switching of data between APIs, I propose here universal zoom levels, which can be used as-is on any of these mapping APIs. To avoid confusion of which type of zoom level one is using, we use the negative number range for universal zoom levels. As Google and Microsoft are using the same zoom levels, I’ve decided that the universal zoom levels should simply be the inverse of their zoom levels, bounded by (-1, -19) inclusive.

Conversion Formulae

Here’s Javascript to convert between your favorite mapping API’s zoom levels and universal zoom levels. Note that all to_native functions accept positive numbers as-is.

zoom = {
google : {
to_univeral : function(native) {
return Math.min(-1, -native);
},

to_native : function(universal) {
return universal > 0 ? universal : -universal;
}
},

virtual_earth : {
to_univeral : function(native) {
return Math.min(-1, -native);
},

to_native : function(universal) {
return universal > 0 ? universal : -universal;
}
},

yahoo : {
to_univeral : function(native) {
return Math.min(-1, native - 18);
},

to_native : function(universal) {
return universal > 0 ? universal : Math.max(universal + 18, 1);
}
}
};


End Notes

A truly universal zoom level would just use altitude; dealing with a simple integer is easier and less complication prone though. MapQuest is not included in this post as its tiles do not line up with the other APIs.

Google Maps URL basics

Documentation for Google Maps URL (not requiring API).
Google Map Parameters

Mapping APIs

Some interesting Mapping API found on stack Overflow

Geonames
The GeoNames geographical database is available for download free of charge under a creative commons attribution license. It contains over eight million geographical names and consists of 6.5 million unique features whereof 2.2 million populated places and 1.8 million alternate names. All features are categorized into one out of nine feature classes and further subcategorized into one out of 645 feature codes. (more statistics ...).
The data is accessible free of charge through a number of webservices and a daily database export. GeoNames is already serving up to over 11 million web service requests per day.

WCF example from CodeProject: GeoNames .NET WCF Client

Topocoding

This service is an extension of existing mapping APIs in Javascript. It serves for querying the altitude information
and other topological information about places on the Earth.

The topo data is a combination of SRTM and GTOPO30, its typical horizontal resolution is about 90 meters. The data includes all continents but Antarctica.

Currently the service is in the beta stage of testing, the throughput of the shared server might be limited.
For business users, we offer paid servers with dedicated capacity.

EarthTools.org

Here's a collection of webservices for finding out geographical-related information. There are currently three services available for finding the time zone or local time, the sunrise and sunset times, and the elevation/height above sea level at a given latitude and longitude.

Wednesday, December 24, 2008

LeoCad 3rd party libraries

http://www.dxtre3d.com/temp/3dsftk.zip
http://www.imagemagick.org/download/delegates/libjpeg-6b.zip

On my skydrive


Use these specific versions. Ziplib 1.1.4 is needed not 1.2.3+

Tuesday, December 16, 2008

Setup SVN server the easy way!

Cool VisualSVN
http://www.visualsvn.com/server/

Also
RapidSVN - You can use RapidSVN on a memory stick as a graphical SVN client.
http://rapidsvn.tigris.org/

Very cool stuff

Monday, December 8, 2008

Ho Ho Cake Goodness



Photographic evidence of what Brian missed last Friday at work.
Posted by Picasa

Installing Esker API Components

For Esker DeliveryWare Platform version 3.5
CD 1
  • Select Server components
  • Select Esker API Components
You will need an IP address for Installed instance of Esker Server 3.5
This is only required for a development or client machine where Esker DeliveryWare platform server is not installed.

Saturday, December 6, 2008

Use SkyDrive to add live app updates

UPDATE: 5/6/2009
SKyDrive now changes URLs to files several times a day.
I altered my design by fetching the URL of the folder containing my update file and then parsing out the file URL from there. Bit more work but I can still host updates from a Skydrive folder.


Microsoft is offering large amt of disk space with an Windows Live acount (25 GB) where you can host files or any type for in private, shared or public folders.
Uploaded files get a GUID like URL. It you re-load the file it will get a new URL! This caused me abit of grief trying to implement an live update feature in my Digital Rockhound's companion application. To solve this problem, I decided to add meta content name value pairs for current version of the application and the URL path where the update is located on SkyDrive. My application simplies downloads a specific blog entry, reads the version and path from the meta conent and then determines if the user has the latest version. A bonus of this method, is with site tracking, I can tell how many users are updating the software and when. Nice to have these stats.

As of 12/06/2008 Microsoft has not published documentation for SkyDrive API. I hope they do so soon. (Lets see how SkyDrive API searches this blog entry generates...)

Wednesday, December 3, 2008

Even through I got crystal 9 and VSS 2003 work

Crystal Reports still sucks

Change Where statment for report

Right-click on report designer
>>select reports menu
>>>> Selection Formula
>>>>>>Row

In designer type of select criteria

Add new table to report schema

use Database Export, browse to new table and click move to right
Click links table and correct table for new table

Changing cached database name in Report

In VSS.net 2003 with a crystal 9 report open.
Use Field explorer, expand to a table, right-click and select Set Datasource location

Crystal Reports sucks

For VSS.NET 2003 and crystal 9
You must apply SP1, SP2, SP3 to fix a host of issues including table alias not handled properly when crystal renders its internal report query.

Also: If table schema has changed for an existing report, connect to database with current schema and use database expert to sync cached schema in report to actual schema.

Why anyone stills uses this product is beyond me? At least editor ingration into VSS.NET makes it 2% less painful.

Crystal 9 will connect to SQL Server 2008 database.

Friday, November 28, 2008

Generate BarCode WebSite

Free Barcode Generator - Barcoding Inc.

Tuesday, November 25, 2008

Flickr Tools

http://www.estradas.biz/2007/08/flickr-tools-collection.htm

Monday, November 24, 2008

Search Flickr for User profiles

http://bighugelabs.com/flickr/dna.php?username=

Showing off Blogger Code

Test Post: Tie Bomber

(This is test was created using GData BLogger API)

Test Post: Two Seater X-Wing

Test Post using new class()

Saturday, November 22, 2008

Testing Blogger API Code

Adding MoonVille Tunnel Image

Wednesday, November 19, 2008

Wednesday, November 12, 2008

Recent Posts Widget

Add recent posts widget to blogger
URL

Tuesday, November 11, 2008

How to Debug Hydrid VB6 and C# project

Use System.Diagnostics.Debugger.Break();
in C# code in class with COM interop that is used in VB6 project.
Allow code to debug using .net 2005/2008 but not .net 2003

Used this approach to debug call center scheduler.

Monday, November 10, 2008

Friday, November 7, 2008

Setup and configuration for New Blogger Tag Cloud / Label Cloud

Steps to create Label Cloud in a Blogger Template

Microsoft Analysis Management Objects

Microsoft Analysis Management Objects Analysis Management Objects (AMO) is a .NET Framework object model that enables software developers to create client-side applications to manage and administer Analysis Services objects.

Audience(s): Customer, Partner, Developer

X86 Package(SQLSERVER2008_ASAMO10.msi) - 2659 KB
X64 Package (SQLSERVER2008_ASAMO10.msi) - 4317 KB
IA64 Package(SQLSERVER2008_ASAMO10.msi) - 6055 KB

Microsoft SQL Server 2008 Analysis Services 10.0 OLE DB Provider

Microsoft SQL Server 2008 Analysis Services 10.0 OLE DB Provider The Analysis Services 10.0 OLE DB Provider is a COM component that software developers can use to create client-side applications that browse metadata and query data stored in Microsoft SQL Server 2008 Analysis Services. This provider implements both the OLE DB specification and the specification’s extensions for online analytical processing (OLAP) and data mining.

Note: Microsoft SQL Server 2008 Analysis Services 10.0 OLE DB Provider requires Microsoft Core XML Services (MSXML) 6.0, also available on this page.

Audience(s): Customer, Partner, Developer

X86 Package(SQLServer2008_ASOLEDB10.msi) - 19490 KB
X64 Package (SQLServer2008_ASOLEDB10.msi) - 43945 KB
IA64 Package(SQLServer2008_ASOLEDB10.msi) - 50682 KB

Microsoft ADOMD.NET ADOMD.NET

Microsoft ADOMD.NET ADOMD.NET is a Microsoft .NET Framework object model that enables software developers to create client-side applications that browse metadata and query data stored in Microsoft SQL Server 2008 Analysis Services. ADOMD.NET is a Microsoft ADO.NET provider with enhancements for online analytical processing (OLAP) and data mining.

Note:The English ADOMD.NET setup package installs support for all SQL Server 2008 languages.

Audience(s): Customer, Partner, Developer

X86 Package(SQLSERVER2008_ASADOMD10.msi) - 4312 KB
X64 Package (SQLSERVER2008_ASADOMD10.msi) - 9263 KB
IA64 Package(SQLSERVER2008_ASADOMD10.msi) - 6776 KB

SQLDMO cannot connect to Anaysis Services version 10.0.1600.22

Get error cannot connect to Anaysis Services version 10.0.1600.22 when trying to connect to SQL analysis server 2008

Found this posting Need AMO update:

The C# application was written for SSAS 2005 and thus references the 2005 version of Microsoft.AnalysisServices.dll (AMO). The 2008 version of AMO was just released at this link: http://www.microsoft.com/downloads/details.aspx?FamilyID=228DE03F-3B5A-428A-923F-58A033D316E1&displaylang=en

Scroll down to "Microsoft Analysis Management Objects" and install. The 2008 version of AMO will install to ...\Program Files\Microsoft SQL Server\100\SDK\Assemblies. In the C# solution, remove the reference to the 2005 version of this DLL and replace it with the 2008 version. BTW, this should open both 2005 and 2008 cubes.

Thursday, November 6, 2008

Rebuild SQL Server 2005 Master database

Re-run setup:

start /wait setup.exe /qn INSTANCENAME=MSSQLSERVER REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=mypassword

Microsoft Suggestion:

Use of the Setup command to rebuild the master database has changed in this Microsoft SQL Server release. Run Setup.exe to rebuild, verify, and repair a SQL Server instance, and rebuild the system databases. This procedure is most often used to rebuild the master database for a corrupted installation of SQL Server.

Wednesday, November 5, 2008

Debug TimeSlotscheduler

Debug TimeSlotscheduler - COM wrapped .NET Class
In SchedulingAppForCOM project
Properities:
Configuation Properities:
Debugging:

Friday, October 31, 2008

Reduce in Flicker in Rich Text Box

From forums.microsoft.com

MSFT forgot to add the BeginUpdate and EndUpdate methods to RTB. Here's a sample workaround that uses SendMessage():

using System;
using System.Drawing;
using System.Windows.Forms;

namespace WindowsFormsApplication1 {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
this.Load += new System.EventHandler(this.Form1_Load);
this.button1.Click += new System.EventHandler(this.button1_Click);
}
private void Form1_Load(object sender, EventArgs e) {
for (int ix = 0; ix < 200; ++ix) richTextBox1.Text += "nobugz waz here\r\n";
}
[System.Runtime.InteropServices.DllImport("user32.dll")]
private extern static IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp);

private void button1_Click(object sender, EventArgs e) {
richTextBox1.Focus();
SendMessage(richTextBox1.Handle, 0xb, (IntPtr)0, IntPtr.Zero);
for (; ; ) {
int pos = richTextBox1.Find("bugz", richTextBox1.SelectionStart + 1, RichTextBoxFinds.None);
if (pos < 0) break;
richTextBox1.SelectionStart = pos;
richTextBox1.SelectionLength = 4;
richTextBox1.SelectionBackColor = Color.Aqua;
}
richTextBox1.SelectionStart = 0;
richTextBox1.SelectionLength = 0;
SendMessage(richTextBox1.Handle, 0xb, (IntPtr)1, IntPtr.Zero);
richTextBox1.Invalidate();
}
}
}

STop Form Flickr on XP and Vista

Use under documented Style from MSDN forum

Add this to form

protected override CreateParams CreateParams
{
get
{ //WS_EX_COMPOSITED XP AND Vista Only
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000;
return cp;
}
}

Saturday, October 25, 2008

FlowLayoutPanel FLickers when Controls added

Discussion Thread

Potential Solution:
Add the following code to add being added.

Add following code to Class Constructor

SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);

protected override CreateParams CreateParams {
get {
// Turn on the WS_EX_TRANSPARENT style
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x20;
return cp;
}
}

example:

public PhotoAccount(Account acct)
{ _acct = acct;
InitializeComponent();
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);

RefreshAccountSpace();
txtAccount.MouseClick += new MouseEventHandler(txtAccount_MouseClick);
txtAccount.MouseDoubleClick += new MouseEventHandler(txtAccount_MouseDoubleClick);
}

protected override CreateParams CreateParams
{
get
{
// Turn on the WS_EX_TRANSPARENT style
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x20;
return cp;
}
}

Tuesday, October 21, 2008

VB6 IDE Make/Build menu disabled

Problem:

VB6 IDE can get into a state when the Make XXXX menu option under the File Menu is disabled.

Solution:

Right click on your toolbar, goto Customize and reset toolbars.

Wednesday, October 15, 2008

FireFly Theme - Ballad of Serenity

Download from here.

C# - Create Custom Exception

How to create a custom exception message in C#

Sample from http://www.blackwasp.co.uk/CSharpThrowingExceptions.aspx


using System;

namespace BlackWasp
{
class TestApp
{
static void Main(string[] args)
{
// Check that a parameter was provided
if (args.Length == 0)
{
throw new ArgumentException("A start-up parameter is required.");
}

Console.WriteLine("{0} argument(s) provided", args.Length);
}
}
}

C# Equivalent of VB's IsNumeric()

C# calls Equivalent of VB's IsNumeric() from CodeProject

Int32.TryParse() Method

int result;
if (int.TryParse("123", out result))
{
Debug.WriteLine("Valid integer: " + result);
}
else
{
Debug.WriteLine("Not a valid integer");
}

// throws ArgumentNullExceptionint
result1 = Int32.Parse(null);

// doesn't throw an exception, returns 0
int result2 = Convert.ToInt32(null);

Tuesday, September 30, 2008

Register exe as Windows Service

From command line where the exe exists
Application.exe -install

installutil Application.exe

To remove
Application.exe -uninstall

installutil Application.exe /u

Friday, September 26, 2008

BCP and SMO for SQL 2008

These needed to have BCP DMO/SMo support in SQL 2008

When installing SS2008, if you remove your only instance of SQL 2000 or SQL 2005, DMO may disappear. Here is an article of how to reinstall it. I understand that there is an upgrade to DMO which fixes a bug so it can talk to SS2005 & SS2008. That is not referred to in this document. We may want to create this package to use in the future.

http://support.microsoft.com/kb/326613

BCP – Install the Microsoft SQL Server 2008 Command Line Utilities from net prod dev\tool\sql2008…


Tuesday, September 23, 2008

SQL Server 2000 sysindexes Table Columns

, sysSource

Column name Data type Description

id

int

ID of table (for indid = 0 or 255). Otherwise, ID of table to which the index belongs.

status

int

Internal system-status information.

first

binary(6)

Pointer to the first or root page.

indid

smallint

ID of index:

0 = Heap = Table Data (not Index)
1 = Clustered Index
2 ... 254 = Nonclustered Index
255 = Entry for tables that have text or image data

root

binary(6)

For indid >= 1 and < indid =" 0" indid =" 255,">

minlen

smallint

Minimum size of a row.

keycnt

smallint

Number of keys.

groupid

smallint

Filegroup ID on which the object was created.

dpages

int

For indid = 0 or indid = 1, dpages is the count of data pages used. For indid=255, it is set to 0. Otherwise, it is the count of index pages used.

reserved

int

For indid = 0 or indid = 1, reserved is the count of pages allocated for all indexes and table data. For indid = 255, reserved is a count of the pages allocated for text or image data. Otherwise, it is the count of pages allocated for the index.

used

int

For indid = 0 or indid = 1, used is the count of the total pages used for all index and table data. For indid = 255, used is a count of the pages used for text or image data. Otherwise, it is the count of pages used for the index.

rowcnt

bigint

Data-level rowcount based on indid = 0 and indid = 1. For indid = 255, rowcnt is set to 0.

rowmodctr

int

Counts the total number of inserted, deleted, or updated rows since the last time statistics were updated for the table.

xmaxlen

smallint

Maximum size of a row.

maxirow

smallint

Maximum size of a nonleaf index row.

OrigFillFactor

tinyint

Original fillfactor value used when the index was created. This value is not maintained; however, it can be helpful if you need to re-create an index and do not remember what fillfactor was used.

reserved1

tinyint

Reserved.

reserved2

int

Reserved.

FirstIAM

binary(6)

Reserved.

impid

smallint

Reserved. Index implementation flag.

lockflags

smallint

Used to constrain the considered lock granularities for an index. For example, a lookup table that is essentially read-only could be set up to do only table level locking to minimize locking cost.

pgmodctr

int

Reserved.

keys

varbinary(816)

List of the column IDs of the columns that make up the index key.

name

sysname

Name of table (for indid = 0 or 255). Otherwise, name of index.

statblob

image

Statistics BLOB.

maxlen

int

Reserved.

rows

int

Data-level rowcount based on indid = 0 and indid = 1, and the value is repeated for indid >1. For indid = 255, rows is set to 0. Provided for backward compatibility.

Find Primary Key in SQL 2000

In SQL Server 2000 it is difficult to see as primary key and a foreign key.

Try running this script, which will give you all primary key on all tables in the database including column information.


SELECT A.TABLE_NAME, A.CONSTRAINT_NAME, B.COLUMN_NAME
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS A, INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE B
WHERE CONSTRAINT_TYPE = 'PRIMARY KEY' AND A.CONSTRAINT_NAME = B.CONSTRAINT_NAME
ORDER BY A.TABLE_NAME

Thursday, September 18, 2008

Moonville Tunnel Photos

Moonville and Kings Tunnels circa 1850s



Front side
From Railroad Tunnel


Far Side
From Railroad Tunnel

Insert Identity ON for SQL Server

SET IDENTITY_INSERT tablename ON
SET IDENTITY_INSERT tablename OFF

How to Alter Blogger Template

This is my first attempt to alter my blogger template, I thought I would want I discover.

Increase over width of page:
/* Wrapper */

#outer-wrapper {
margin: 0 auto;
border: 0;
width: 1200px;
text-align: $startSide;
background: $mainBgColor url(http://www.blogblog.com/moto_son/innerwrap.gif) top $endSide repeat-y;
font: $bodyFont;
}

Previous value width: 692px;

Thursday, July 24, 2008

Using ListView Control

Code Snippet, creating groups and assigning items to groups:
ListView lv = listView1;
ColumnHeader colHead;

colHead = new ColumnHeader();
colHead.Text = "Filename";
lv.Columns.Add(colHead);

colHead = new ColumnHeader();
colHead.Text = "Size (KB)";
lv.Columns.Add(colHead);

colHead = new ColumnHeader();
colHead.Text = "Last accessed";
lv.Columns.Add(colHead);

FolderBrowserDialog dlg = new FolderBrowserDialog();

dlg.RootFolder = Environment.SpecialFolder.MyComputer;
dlg.SelectedPath = @"e:\";
if (dlg.ShowDialog() == DialogResult.OK)
{
DirectoryInfo di = new DirectoryInfo(dlg.SelectedPath);

foreach (DirectoryInfo subdi in di.GetDirectories())
{
ListViewGroup lvg = new ListViewGroup(subdi.Name);
lvg.Name = subdi.Name;
lv.Groups.Add(lvg);
foreach (FileInfo fi in di.GetFiles())
{
ListViewItem lvi = new ListViewItem();
lvi.Text = fi.Name;
lvi.Tag = fi.FullName;
lvi.Group = lvg;

ListViewItem.ListViewSubItem lvsi = new ListViewItem.ListViewSubItem();
lvsi.Text = string.Format("{0}", fi.Length/1024);
lvi.SubItems.Add(lvsi);

lvsi = new ListViewItem.ListViewSubItem();
lvsi.Text = fi.LastAccessTime.ToShortDateString();
lvi.SubItems.Add(lvsi);

lv.Items.Add(lvi);
}
}
lv.View = View.Details;
}

Friday, July 11, 2008

Using FolderBrowserDialog

Setting Intitial Directory:
dlg.RootFolder = Environment.SpecialFolder.MyComputer;
dlg.SelectedPath = Settings.Default.IntialFolder;


What button was pushed:
dlg.ShowDialog() == DialogResult.OK

Using:

FolderBrowserDialog dlg = new FolderBrowserDialog();
dlg.RootFolder = Environment.SpecialFolder.MyComputer;
dlg.SelectedPath = Settings.Default.IntialFolder;
if ((dlg.ShowDialog() == DialogResult.OK)
{
\\ Some code
}

Using Gimp to Create Tattoos

Found this page on details of creating tattoos on a person using gimp.
Easy to do!
Using Gimp to Create Tattoos

Friday, March 21, 2008

GetDate() with Millisecs

SELECT CONVERT(varchar, GetDate(),20), GetDate()

use Convert() with FormatOption=20

Wednesday, January 2, 2008

How to store 70 lbs of Legos