Skip to main content

Posts

Showing posts from February, 2008

XML: invalid Character Was Found in Text Content

SYMPTOMS When parsing XML that contains "special characters" using the Microsoft XML parser (MSXML), the parser may report the following error message at the line and position of the first special character: An Invalid character was found in text content. Back to the top CAUSE The XML document is not marked with the proper character encoding scheme. Back to the top RESOLUTION Specify the proper encoding scheme in the XML processing instruction. - or - Re-encode the XML data as proper UTF-8. for sample: <?xml version="1.0" encoding="iso-8859-1" ?> <rootelement> ...XML data... </rootelement>

Promote your blog

give people what they want and do it consistently. commenting on other blogs. join Mybloglog.com, bloggingfusion.com, bloggerforum.com , blogcatalog.com, spicypage.com, technorati.com, blogoozle.com link exchange. Submit Blog Feed to Feed Directories: 2RSS more comming soon...

Yahoo map image api

Yahoo! Maps Web Services - Map Image API http://developer.yahoo.com/maps/rest/V1/mapImage.html here is sample http://local.yahooapis.com/MapsService/V1/mapImage?appid=L_D7A5XV34FEk1zgAt.tfXOfRgUpqt5kv6R4mA6tUX3tMXW0IwhhNkm8z__D&zip=92694&image_width=1000&image_height=1000&zoom=1 here is image result http://gws.maps.yahoo.com/mapimage?MAPDATA=C9potud6wXVzQEw_r1Mjq5iDQ_eh75FHySHFPf_9Ef0Yghz.OYd.YmJyspFS6gIX7E3ytyoVGsAjOKG9oFIyN1Cms_fxrp3I0UZPaehZDqUuTZSXG91SoVFcP_xIaEpKqb3WsygEVZDav3V3ENsYYO6uqb2g&mvt=m?cltype=onnetwork&.intl=us

restore database with backup and transection logs

USE master GO -- First determine the number and names of the files in the backup. RESTORE FILELISTONLY FROM disk = 'C:\yourfolder\yourdbbackupfile.BAK' RESTORE DATABASE yourdatabasename FROM disk = 'C:\yourfolder\yourdbbackupfile.BAK' WITH NORECOVERY, -- change location MOVE 'xxx_Data' TO 'C:\newfolder\newfile.MDF', MOVE 'xxx_Log' TO 'C:\newfolder\newfile.LDF' GO RESTORE LOG yourdatabasename FROM disk = 'C:\yourfolder\logfile1.TRN' FROM disk = 'C:\yourfolder\logfile2.TRN' WITH NORECOVERY GO -- WITH NORECOVERY need attach database, or WITH RECOVERY then dont need attach.

Public Land Survey System

The Public Land Survey System (PLSS) is a method used in the United States to survey and identify land parcels, particularly for titles and deeds of rural, wild or undeveloped land. Its basic units of area are the township and section . It is sometimes referred to as the rectangular survey system, although non rectangular methods such as meandering can also be used. The survey was "the first mathematically designed system and nationally conducted cadastrial survey in any modern country" and is "an object of study by public officials of foreign countries as a basis for land reform." [1] The detailed survey methods to be applied for the PLLS are described in a series of Instructions and Manuals issued by the General Land Office , the latest edition being the "The Manual of Instructions for the Survey of the Public Lands Of The United States, 1973" available from the U.S. Government Printing Office . The BLM announced in 2000 an updated Manual is curren...

web application frameworks

1 Client-side 1.1 ActionScript 1.2 JavaScript 2 Server-side 2.1 ASP.NET 2.2 ColdFusion 2.3 Java 2.4 JavaScript (server-side) 2.5 Perl 2.6 PHP 2.7 Python 2.8 Ruby Comparison of features Ajax MVC MVC push/pull i18n ORM Testing framework DB migration framework Security Framework Template Framework Caching Framework Form Validation Framework links: ASP Xtreme Evolution Comparison of Ajax IDE: http://ajaxpatterns.org/Ajax_Tools GWT Designer Visual AJAX IDE - AJAX WebShop XI-Community and XI-Factory Ajax Toolkit Framework for Eclipse IntelliJ Idea Morfik JSEclipse Aptana jMaki plugin for NetBeans jMaki plugin for Eclipse MX AJAX Toolbox for Dreamweaver MyEclipse Zero Kode ZK-Bench

Mobile GIS (GIS on PDA)

mobile GIS and field mapping application running on Windows Mobile/Pocket PC/Smart Phone Sql Server CE GPS: Bluetooth enabled Sync with RDA/Replication Features: Google Map supported Custom Map Processing to fit on PDA Auto GPS reading as walk Drawing polygon, polyline and point on map support shape view, map view and data view UTM grid on map data format with Geographic/UTM Geographic and UTM data converter Export to KML, CSV GPS signal indicator information from EnvironmentalStudio.net

hollow box(small box) issue in word app with Delphi

Instead of Chr(13) & Chr(10), use Chr(11) or the constant wdVerticalTab: activedocument.FormFields(1).Result = "a" & chr(11) & "b" Hope this helps, while (pos(#13#10, value) > 0) do begin value :=ReplaceString(value,#13#10, #11); end; WrdDoc.FormFields.Item(FieldName).Result := value; function ReplaceString(Dest, SubStr, Str: string): string; var Position: Integer; begin Position:=Pos(SubStr, Dest); Delete(Dest, Position, Length(SubStr)); Insert(Str, Dest, Position); Result:=Dest; end;

Regular expressions in JavaScript

JavaScript includes full support for Perl-style regular expressions, and it's extremely useful for string matching processes. Coding a script to check sensitive user data is sometimes pretty straightforward. But most of the time this process is not so easy. With current websites, we'll need to check the proper standardized format of an email address or a URL. That would be a nightmare for programmers, not to mention a confusing and inefficient error-prone process for checking data validity. A regular expression is a way of describing a pattern in a piece of text. In fact, it's an easy way of matching a string to a pattern. We could write a simple regular expression and use it to check, quickly, whether or not any given string is a properly formatted user input. Here are a few special characters that can be used for matching characters in regular expressions: \n // a newline character . // any character except a newline \r // a carriage return character \t // a tab character...

Geographic to UTM Coordinate Converter

There is a concept of a navigable "Scene". The expance of a Scene is dependent on the source of the imagery and the imagery's projection system. For data in the Geographic projection system, the expanse is the entire globe. Effectively there is one Scene. For UTM data, there are sixty Scenes, each covering approximately six longitude degrees. Projection Methods You are dealing with "Projection Systems" anytime you are dealing with a map or a globe. For our purposes within the TerraService, the earth is a sphere. Points on it are referenced by Longitude and Latitude "lines". They are not lines really, but complex curves. Maps are flat drawing of earth. Satellite or aerial imagery, in its raw state, is more-flat-than-its round. It is mathematically impossible to present a sphere on a flat surface without distorting something. Cartographers have dealt with this issue for centuries by developing different methods, known as map projections, for representing...

Unexpected call to method or property in google map

We recommend that you use standards-compliant XHTML on pages that contain maps. When browsers see the XHTML DOCTYPE at the top of the page, they render the page in "standards compliance mode," which makes layout and behaviors much more predictable across browsers. If you want to show polylines on your map (like the lines used by Google Maps to show driving directions), you need to include the VML namespace and some CSS code in your XHTML document to make everything work properly in IE.

Parse text field in sql server

Parsing TEXT field with Long String ALTER PROCEDURE [dbo].[DrawMap_KMLImport] @ProcedureID int, @ProjectID int, @Shape varchar(30) = null, @ObjName varchar(100) = null, @Notes varchar(1000) = null, @Allcoords text = null, @Fillcolor int = null, @ForeColor int = null AS declare @selectByte int declare @coords varchar(7600) declare @startI int set @selectByte = 7600 if @ProcedureID =0 begin if right(@coords,1) ' ' set @coords = @coords + ' ' declare @libID integer declare @objID varchar(40) if @shape = 'point' set @libID = 58 else if @shape = 'polyline' set @libID = 32 else set @libID = 30 set @objID = NEWID() insert into drawmap_objects (ObjID, objName, ProjectID, libID, visible, fillcolor, forecolor) values(@objID, @objName, @projectID, @libID, 1, @fillcolor, @forecolor) declare @latlong varchar(30) declare @long varchar(30) declare @lat varchar(30) declare @index int declare @pointID varchar(40) declare @i int set @i = 0 set @startI = 1 while @startI +...

merge process was unable to create a new generation at the subscriber

the merge process was unable to create a new generation at the subscriber Spent the day with MS trying to fix a similar problem. Found that they have a bug with no fix yet it is caused by generation leveling throwing sp_MSmakegeneration into a loop. The work around that I was given is to turn off generation leveling.update sysmergepublications set [generation_leveling_threshold] = 0

Check if Point in Polygon with javascript

function inPoly(poly,px,py) { var npoints = poly.length; // number of points in polygon var xnew,ynew,xold,yold,x1,y1,x2,y2,i; var inside=false; if (npoints/2 < 3) { // points don't describe a polygon return false; } xold=poly[npoints-2]; yold=poly[npoints-1]; for (i=0 ; i < npoints ; i=i+2) { xnew=poly[i]; ynew=poly[i+1]; if (xnew > xold) { x1=xold; x2=xnew; y1=yold; y2=ynew; } else { x1=xnew; x2=xold; y1=ynew; y2=yold; } if ((xnew < px) == (px <= xold) && ((py-y1)*(x2-x1) < (y2-y1)*(px-x1))) { inside=!inside; } xold=xnew; yold=ynew; } return inside; }

NLST, LIST parameter

http://www.serv-u.com/Help/serv_u_help/additional_ftp_commands_supported_by_serv_u.htm NLST, LIST These are the two FTP commands that deal with directory listings, NLST stands for "Name LiST", LIST is "LIST directory". LIST by default returns a long format directory listing with all files and directories, NLST returns a list of file names only (no directories) unless the option "NLST also lists directories" is enabled. Normally they do not have options, or rather, the only option according to RFC959 is a directory path or file, which should be listed. Serv-U抯 version of the dir listing commands supports most of the UNIX 憀s?options, just like UNIX FTP servers do. These can be convenient for retrieving custom tailored directory listings. Supported options are: -a = list all entries including those starting with '.' -b = force printing of non-printable characters in octal -c = use modification time for listing sorting -d = if argument is a dir list o...

Image downloading from remote servers in ASP

In this tutorial, we will access to a remote server, download image, rename ths image and save to our file system. We will use one function ( getImage ) and one subroutine ( saveImage ) to complete this sampel code. First part of our code, get image byte array from remote server. Second part contains a subroutine that writes byte array to file system. Lets's put our function and subroutine calls in the beginning of code. Creating variables imageUrl = "htp://www.some-domain-name.com/images/target-image.jpg" strImageName = "new-image.jpg" Function and subroutine calls saveImage getImage(imageUrl), strImageName Here is code library: Function getImage(strImageUrl) ' Set objHttp = CreateObject("Microsoft.XMLHTTP") ' Set objHttp = CreateObject("MSXML2.ServerXMLHTTP") Set objHttp = CreateObject("WinHttp.WinHttpRequest.5.1") ' Set Http = CreateObject("WinHttp.WinHttpRequest") objHttp.Open "GET", URL, False ob...

Load/Post Images to database with C#

protected void LoadImage() { try { this.openFileDialog1.ShowDialog(this); string strFn=this.openFileDialog1.FileName; this.pictureBox1.Image=Image.FromFile(strFn); FileInfo fiImage=new FileInfo(strFn); this.m_lImageFileLength=fiImage.Length; FileStream fs=new FileStream(strFn,FileMode.Open, FileAccess.Read,FileShare.Read); m_barrImg=new byte[Convert.ToInt32(this.m_lImageFileLength)]; int iBytesRead = fs.Read(m_barrImg,0, Convert.ToInt32(this.m_lImageFileLength)); fs.Close(); } catch(Exception ex) { MessageBox.Show(ex.Message); } } private void btnSave_Click(object sender, System.EventArgs e) { try { this.sqlConnection1.Open(); if (sqlCommand1.Parameters.Count ==0 ) { this.sqlCommand1.CommandText="INSERT INTO tblImgData(ID," + " Name,Picture) values(@ID,@Name,@Picture)"; this.sqlCommand1.Parameters.Add("@ID", System.Data.SqlDbType.Int,4); this.sqlCommand1.Parameters.Add("@Name", System.Data.SqlDbType.VarChar,50); this.sqlCommand1.Parameters.Add(...