When Windows desktop icons seem out of sync, try changing display depth (display settings/colors). This will rebuild Windows icon cache.
Monday, January 08, 2007
Saturday, December 30, 2006
Convert Between Polygon Shape File and Arc/Info Coverage
However, when converting between a shape file and arc/info coverage, you usually lose attribute data. To preserve attribute data, follow this example:
# import as region
shapearc oxbld.shp oxr REGION
# clean poly
clean oxr oxrc # # POLY
# export region
arcshape oxrc REGIONS.REGION oxr
Friday, December 01, 2006
javascript in href
1. <a href="javascript:doSomething()">...</a>
2. <a href="#" onclick="doSomething(); return false">...</a>
When using Microsoft HTA, however, only the second approach works. The first one will pop up a new window when the link is clicked, even under IE7.
Tuesday, April 25, 2006
Request Encoding
To set request encoding, use jstl:
xmlns:fmt=http://java.sun.com/jsp/jstl/fmt
<fmt:requestencoding value="utf-8">
Paste High DPI Image from Clipboard into Photoshop
Copy to clipboard in Word.
New file in Photoshop.
When you New file from clipboard, the initial settings is 72DPI. Change the units to inch, dpi to 300. New. Paste. Result is incorrect.
Do not close the window. New file again. This time the pixel settings are much larger. Change the DPI to 300, and units to inch. The dimensions should match Word. Now paste.
cvs server on cygwin
With that bug corrected, in eclipse select extssh method.
Friday, December 02, 2005
JavaScript XmlHttp
function newXmlHttp() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
} else if (window.ActiveXObject) {
return new ActiveXObject("Msxml2.XMLHttp");
}
return null;
}
javascript Drag
It turns out not that difficult to implement your own drag and drop. Below is a very lightweight and customizable web Drag&Drop support using javascript and dhtml. Supports both IE and Firefox.
<script type="text/javascript">
function getEvent(e) {
return e ? e : window.event;
}
function moveElem(elem, left, top) {
var style = elem.style;
style.left = left;
style.top = top;
}
function Drag(elem) {
var self = this;
this.elem = elem;
elem.onmousedown = function(e) {
e = getEvent(e);
self.onBeginDrag(e.clientX, e.clientY);
saveLast(e.clientX, e.clientY);
document.onmousemove = onmousemove;
document.onmouseup = onmouseup;
return false;
}
function onmousemove(e) {
e = getEvent(e);
self.onDrag(e.clientX, e.clientY);
saveLast(e.clientX, e.clientY);
return false;
}
function onmouseup(e) {
e = getEvent(e);
document.onmousemove = null;
document.onmouseup = null;
self.onEndDrag(e.clientX, e.clientY);
return false;
}
function saveLast(x, y) {
self.x0 = x;
self.y0 = y;
}
}
Drag.prototype.move = function(dx, dy) {
var style = this.elem.style;
var x = parseInt(style.left);
var y = parseInt(style.top);
style.left = x + dx;
style.top = y + dy;
}
Drag.prototype.moveTo = function(x, y) {
moveElem(this.elem, x, y);
}
Drag.prototype.drag = function(x, y) {
this.move(x - this.x0, y - this.y0);
}
Drag.prototype.onDrag = function(x, y) {
this.drag(x, y);
}
Drag.prototype.onBeginDrag = function(x, y) {}
Drag.prototype.onEndDrag = function(x, y) {}
</script>
To make an element draggable, simply call "new Drag(elem)" for the element, e.g.,
<img id="dragimg" src="...">
<script type="text/javascript">
new Drag(document.getElementById("dragimg"));
</script>