Demo Site

Thursday, March 08, 2012

Ajax requests in Chrome when loading local files

This always annoyed me trying to find, so here it is, if you're trying to load up an html page with some javascript that needs to make ajax requests, but you're doing it without running a webserver, then Chrome will block those requests unless you start Chrome with these startup flags:

--args --allow-file-access-from-files --disable-web-security
On Ubuntu this then looks like:


$ /opt/google/chrome/google-chrome --args --allow-file-access-from-files --disable-web-security
Then you look at page like:

file:///home/Documents/Workspaces/workspace-sts-2.7.0.RELEASE/myapp/src/test/webapp-test/scripts/panels/gwindow-test.html

and ajax requests will work-


Monday, December 12, 2011

Ooops! Someone deployed google search with the wrong css...

Hover over a google search result in chrome and you see this:


Notice the edges of the red and blue google plus icon. Appears even Google's testing isn't perfect-

Monday, June 20, 2011

Chrome developer tools - copy command

This apparently hasn't made it into the official documentation for the chrome dev tools, so here it is to not forget, to get the contents of a variable out of the console and onto your clipboard for pasting pleasure, use the copy(yourvariable) command :)

rest of the reference - http://code.google.com/chrome/devtools/docs/console.html

Thursday, January 06, 2011

Running Eurekastreams on windows with eclipse

  1. install egit, m2eclipse
  2. clone git repo using egit import wizard - use the url on the git site (https://github.com/lmco/eurekastreams.git) and make the clone location be in your current workspace
  3. modify the poms for windows before using  the m2eclipse/maven project wizard - saves an extra step rebuilding the app again
  4. modifications necessary for windows:
    1. comment out the maven-checkstyle-plugin in the parent pom
    2. comment out the exec-maven-plugin with the chmodder execution in parent.pom and web module.
    3. comment out the two sections refercing the lib-java folder in web module pom
    4. add build.web.host value to your maven build 
  5. import as existing maven project (with the git repo as the target directory), and make sure every module is being managed by maven 
  6. make sure you have postgres 8.4 installed, if not, get the installer here - http://www.enterprisedb.com/products/pgdownload.do#windows
  7. create a db called eurekastreams, a user called eurekastreams, and make the password whatever you want, but place the password in the eurekastreams-server.properties file under eurekastreams.db.password 
  8. run this batch file (switching in your own file paths as appropriate) on the db scripts in the generated build folder (from  rocketman -https://groups.google.com/forum/?lnk=gst&q=gwt&pli=1#!searchin/eureka-streams-dev/windows/eureka-streams-dev/jjxcGb0b66o/FXr3dDO8tt4J
    1. REM @echo off 
      setlocal 

      set PGPASSWORD=yourpassword (eg eurekastreams)
      set ES_HOME=C:\workspaces\workspace.35sr1\eurekastreams 
      cd %ES_HOME%\web\target\classes\db\schema 
      for /r . %%i in ("*.sql") do psql -U eurekastreams -f %%i 

      cd %ES_HOME%\web\target\classes\db\migration\0\8 
      for /r . %%i in ("*.sql") do psql -U eurekastreams  -f %%i 

      cd %ES_HOME%\web\target\classes\db\migration\0\9 
      for /r . %%i in ("*.sql") do psql -U eurekastreams -f %%i 

      cd %ES_HOME%\web\target\classes\db\migration\1\0 
      for /r . %%i in ("*.sql") do psql -U eurekastreams  -f %%i 

      endlocal 
    2. setting the pgpassword as an environmental variable is a bit insecure, but I don't think this will both most people setting up es for testing.
  9. run the app with jetty, and use one of the default browsers already in the ApplidationDev.gwt.xml file, or add/change it to include gwt compilation for your browser (aka chrome :)
  10. and hopefully....eureka

Saturday, November 27, 2010

multi line search and replace in eclipse (and across multiple files)

This is surprisingly more difficult that it should be. Search and replace across multiple files is covered very well here:

http://www.avajava.com/tutorials/lessons/how-do-i-do-a-find-and-replace-in-multiple-files-in-eclipse.html?page=2


but searching for things that span more than one line, wasn't covered almost anywhere, so here goes.

1. multi line search can only be accomplished by regex in eclipse (I'm using helios), so searching for something like -

 replace me
 replace me 2

would require an expressions like 'word1[\s\S]*word2' or 'word1[\s\S]*?word2' for a non-greedy expression.


to get the text back in, you'll need to also put it in one line, so a site like this can come in handy:


http://kangax.github.com/html-minifier/

Wednesday, May 12, 2010

Ibatis, Oracle and SelectKey

Another useless waste of 30 minutes, apparently if you're having problems getting Ibatis's selectkey statement to work, in order to get (and return) a generated key, it will fail with something like

com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/x/ods/dao/ibatis/sqlmaps/Entity.xml.
--- The error occurred while applying a parameter map.
--- Check the insertEntity-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: java.sql.SQLException: ORA-01400: cannot insert NULL into
("ODS"."ENTITY_SRC"."ENT_SRC_ID")

the answer? explicitly add the type attribute and set it to "pre". ugh-

Thursday, April 15, 2010

Google 2010 redesign

The site design is pleasing, the new logo is just too much. Compare them below


2009


2010

The colors are just a little too gaudy, the yellow "o" almost looks golden, now you see search results, its almost like seeing a stretch of golden rings. yuck.

Here's a way to bring back a more pleasing logo-
https://chrome.google.com/extensions/detail/nedjejdfkkjgebciefdfofjhmeogiaga

Monday, April 05, 2010

Spring @RequestMapping + Multiple Paths

I don't know why this isn't documented officially (that I could find anyways), but you can put multiple paths in the requestmapping annotation like so:

@RequestMapping({"/mapping1","/mapping2/*"})

Thursday, April 01, 2010

Nice review of javascript's call and apply, and how to manage scope

nice article, good refresher, so useful!
http://www.robertsosinski.com/2009/04/28/binding-scope-in-javascript/

Friday, November 13, 2009

Spring @RequestMapping doesn't work in Tomcat

Had to deal with "No mapping found" errors when setting up a Spring controller?

The problem here had nothing to do with Spring -- it was all about Tomcat not picking up the changes made to the @RequestMapping annotation. The instructions at the link below helped (some changes made it):

http://blog.redfin.com/devblog/2009/09/how_to_set_up_hot_code_replacement_with_tomcat_and_eclipse.html


but even then, sometimes the change was not picked up, and it would make me think that the value I put in the annotation was wrong. So apparently, make sure to do a tomcat restart before jumping to that conclusion!

Tuesday, August 11, 2009

sweet eclipse shortcuts

http://rayfd.wordpress.com/2007/05/20/10-eclipse-navigation-shortcuts-every-java-programmer-should-know/

Monday, June 22, 2009

get your game on - computing with xbox controller

this worked quite well, although I'm still figuring out the best way to get all my keyboard shortcuts mapped
http://www.instructables.com/id/Use-an-Xbox-360-controller-as-a-mouse/

Google Maps AutoComplete

*original post - http://groups.google.com/group/Google-Maps-API/browse_thread/thread/591f5de2893f5d5c/e0be21f57c4c6204?lnk=gst&q=chrismarx#e0be21f57c4c6204

finally,
no more typing out function and method names. Below is a file you can
include with your IDE (I've only tried with Eclipse Ganymede, there
you can add this to your javascript libraries). If someone wants to
get this going with the rest of the api, please post back the script
to scrape it from the api page-


/**
* Extracted from the Google Map API reference page
* http://code.google.com/apis/maps/documentation/reference.html
*
* like so:
*
var methodString = "";
$("h2").each(function(){
var id = $(this).attr("id");
//add methods and function declaration
if(id && id.indexOf(".") == -1){
methodString += ($(this).html().indexOf("namespace") ===
-1) ? "function " + id + "(){};\n" : "var " + id + " = {};\n";
$("table[summary*='"+id+"'][summary*='Methods']").each(function
(){
var tableSummary = $(this).attr("summary");
$("tr",this).each(function(){
var trId = $(this).attr("id");
if( trId && tableSummary.indexOf("Static") === -1){
methodString += id + ".prototype." + trId.split
(".")[1] + " = function(){};\n";
} else
if( trId && tableSummary.indexOf("Static") !== -1){
//handle static references
methodString += trId + " = function(){};\n";
}
});
});
}
});
//console.log(methodString);
$("#makeATextAreaForTheValueUsingFirebug").val(methodString);
* TODO add in alternate constructors, constants, etc.
*/
function GMap2(opts) {};
GMap2.prototype.enableDragging = function(){};
GMap2.prototype.disableDragging = function(){};
GMap2.prototype.draggingEnabled = function(){};
GMap2.prototype.enableInfoWindow = function(){};
GMap2.prototype.disableInfoWindow = function(){};
GMap2.prototype.infoWindowEnabled = function(){};
GMap2.prototype.enableDoubleClickZoom = function(){};
GMap2.prototype.disableDoubleClickZoom = function(){};
GMap2.prototype.doubleClickZoomEnabled = function(){};
GMap2.prototype.enableContinuousZoom = function(){};
GMap2.prototype.disableContinuousZoom = function(){};
GMap2.prototype.continuousZoomEnabled = function(){};
GMap2.prototype.enableGoogleBar = function(){};
GMap2.prototype.disableGoogleBar = function(){};
GMap2.prototype.enableScrollWheelZoom = function(){};
GMap2.prototype.disableScrollWheelZoom = function(){};
GMap2.prototype.scrollWheelZoomEnabled = function(){};
GMap2.prototype.enablePinchToZoom = function(){};
GMap2.prototype.disablePinchToZoom = function(){};
GMap2.prototype.pinchToZoomEnabled = function(){};
GMap2.prototype.getDefaultUI = function(){};
GMap2.prototype.setUIToDefault = function(){};
GMap2.prototype.setUI = function(){};
GMap2.prototype.addControl = function(){};
GMap2.prototype.removeControl = function(){};
GMap2.prototype.getContainer = function(){};
GMap2.prototype.getMapTypes = function(){};
GMap2.prototype.getCurrentMapType = function(){};
GMap2.prototype.setMapType = function(){};
GMap2.prototype.addMapType = function(){};
GMap2.prototype.removeMapType = function(){};
GMap2.prototype.isLoaded = function(){};
GMap2.prototype.getCenter = function(){};
GMap2.prototype.getBounds = function(){};
GMap2.prototype.getBoundsZoomLevel = function(){};
GMap2.prototype.getSize = function(){};
GMap2.prototype.getZoom = function(){};
GMap2.prototype.getDragObject = function(){};
GMap2.prototype.getEarthInstance = function(){};
GMap2.prototype.setCenter = function(){};
GMap2.prototype.panTo = function(){};
GMap2.prototype.panBy = function(){};
GMap2.prototype.panDirection = function(){};
GMap2.prototype.setZoom = function(){};
GMap2.prototype.zoomIn = function(){};
GMap2.prototype.zoomOut = function(){};
GMap2.prototype.savePosition = function(){};
GMap2.prototype.returnToSavedPosition = function(){};
GMap2.prototype.checkResize = function(){};
GMap2.prototype.addOverlay = function(){};
GMap2.prototype.removeOverlay = function(){};
GMap2.prototype.clearOverlays = function(){};
GMap2.prototype.getPane = function(){};
GMap2.prototype.openInfoWindow = function(){};
GMap2.prototype.openInfoWindowHtml = function(){};
GMap2.prototype.openInfoWindowTabs = function(){};
GMap2.prototype.openInfoWindowTabsHtml = function(){};
GMap2.prototype.showMapBlowup = function(){};
GMap2.prototype.updateInfoWindow = function(){};
GMap2.prototype.updateCurrentTab = function(){};
GMap2.prototype.closeInfoWindow = function(){};
GMap2.prototype.getInfoWindow = function(){};
GMap2.prototype.fromContainerPixelToLatLng = function(){};
GMap2.prototype.fromLatLngToContainerPixel = function(){};
GMap2.prototype.fromLatLngToDivPixel = function(){};
GMap2.prototype.fromDivPixelToLatLng = function(){};
function GBounds(){};
GBounds.prototype.toString = function(){};
GBounds.prototype.equals = function(){};
GBounds.prototype.mid = function(){};
GBounds.prototype.min = function(){};
GBounds.prototype.max = function(){};
GBounds.prototype.containsBounds = function(){};
GBounds.prototype.containsPoint = function(){};
GBounds.prototype.extend = function(){};
function GBrowserIsCompatible(){};
function GDraggableObject(){};
GDraggableObject.setDraggableCursor = function(){};
GDraggableObject.setDraggingCursor = function(){};
GDraggableObject.getDraggingCursor = function(){};
GDraggableObject.getDraggableCursor = function(){};
GDraggableObject.prototype.setDraggableCursor = function(){};
GDraggableObject.prototype.setDraggingCursor = function(){};
GDraggableObject.prototype.moveTo = function(){};
GDraggableObject.prototype.moveBy = function(){};
function GDraggableObjectOptions(){};
function GInfoWindow(){};
GInfoWindow.prototype.selectTab = function(){};
GInfoWindow.prototype.hide = function(){};
GInfoWindow.prototype.show = function(){};
GInfoWindow.prototype.isHidden = function(){};
GInfoWindow.prototype.reset = function(){};
GInfoWindow.prototype.getPoint = function(){};
GInfoWindow.prototype.getPixelOffset = function(){};
GInfoWindow.prototype.getSelectedTab = function(){};
GInfoWindow.prototype.getTabs = function(){};
GInfoWindow.prototype.getContentContainers = function(){};
GInfoWindow.prototype.enableMaximize = function(){};
GInfoWindow.prototype.disableMaximize = function(){};
GInfoWindow.prototype.maximize = function(){};
GInfoWindow.prototype.restore = function(){};
function GInfoWindowOptions(){};
function GInfoWindowTab(){};
function GKeyboardHandler(){};
var GLanguage = {};
GLanguage.getLanguageCode = function(){};
GLanguage.isRtl = function(){};
function GLatLng(){};
GLatLng.prototype.lat = function(){};
GLatLng.prototype.lng = function(){};
GLatLng.prototype.latRadians = function(){};
GLatLng.prototype.lngRadians = function(){};
GLatLng.prototype.equals = function(){};
GLatLng.prototype.distanceFrom = function(){};
GLatLng.prototype.distanceFrom = function(){};
GLatLng.prototype.toUrlValue = function(){};
GLatLng.prototype.toUrlValue = function(){};
GLatLng.fromUrlValue = function(){};
GLatLng.prototype.equals = function(){};
GLatLng.prototype.contains = function(){};
GLatLng.prototype.containsLatLng = function(){};
GLatLng.prototype.intersects = function(){};
GLatLng.prototype.containsBounds = function(){};
GLatLng.prototype.extend = function(){};
GLatLng.prototype.getSouthWest = function(){};
GLatLng.prototype.getNorthEast = function(){};
GLatLng.prototype.toSpan = function(){};
GLatLng.prototype.isFullLat = function(){};
GLatLng.prototype.isFullLng = function(){};
GLatLng.prototype.isEmpty = function(){};
GLatLng.prototype.getCenter = function(){};
function GLatLngBounds(){};
GLatLngBounds.prototype.equals = function(){};
GLatLngBounds.prototype.contains = function(){};
GLatLngBounds.prototype.containsLatLng = function(){};
GLatLngBounds.prototype.intersects = function(){};
GLatLngBounds.prototype.containsBounds = function(){};
GLatLngBounds.prototype.extend = function(){};
GLatLngBounds.prototype.getSouthWest = function(){};
GLatLngBounds.prototype.getNorthEast = function(){};
GLatLngBounds.prototype.toSpan = function(){};
GLatLngBounds.prototype.isFullLat = function(){};
GLatLngBounds.prototype.isFullLng = function(){};
GLatLngBounds.prototype.isEmpty = function(){};
GLatLngBounds.prototype.getCenter = function(){};
var GLog = {};
GLog.write = function(){};
GLog.writeUrl = function(){};
GLog.writeHtml = function(){};
function GMapOptions(){};
function GMapPane(){};
function GPoint(){};
GPoint.prototype.equals = function(){};
GPoint.prototype.toString = function(){};
function GSize(){};
GSize.prototype.equals = function(){};
GSize.prototype.toString = function(){};
function GUnload(){};
function G_API_VERSION(){};
var GEvent = {};
GEvent.addListener = function(){};
GEvent.addDomListener = function(){};
GEvent.removeListener = function(){};
GEvent.clearListeners = function(){};
GEvent.clearInstanceListeners = function(){};
GEvent.clearNode = function(){};
GEvent.trigger = function(){};
GEvent.bind = function(){};
GEvent.bindDom = function(){};
GEvent.callback = function(){};
GEvent.callbackArgs = function(){};
function GEventListener(){};
function GControl(){};
GControl.prototype.printable = function(){};
GControl.prototype.selectable = function(){};
GControl.prototype.initialize = function(){};
GControl.prototype.getDefaultPosition = function(){};
function GControlAnchor(){};
function GControlImpl(){};
function GControlPosition(){};
function GHierarchicalMapTypeControl(){};
GHierarchicalMapTypeControl.prototype.addRelationship = function(){};
GHierarchicalMapTypeControl.prototype.removeRelationship = function()
{};
GHierarchicalMapTypeControl.prototype.clearRelationships = function()
{};
function GMapType(){};
GMapType.prototype.getSpanZoomLevel = function(){};
GMapType.prototype.getBoundsZoomLevel = function(){};
GMapType.prototype.getName = function(){};
GMapType.prototype.getProjection = function(){};
GMapType.prototype.getTileSize = function(){};
GMapType.prototype.getTileLayers = function(){};
GMapType.prototype.getMinimumResolution = function(){};
GMapType.prototype.getMaximumResolution = function(){};
GMapType.prototype.getMaxZoomAtLatLng = function(){};
GMapType.prototype.getTextColor = function(){};
GMapType.prototype.getLinkColor = function(){};
GMapType.prototype.getErrorMessage = function(){};
GMapType.prototype.getCopyrights = function(){};
GMapType.prototype.getUrlArg = function(){};
GMapType.prototype.getAlt = function(){};
function GMapTypeControl(){};
function GMapTypeOptions(){};
function GMapUIOptions(){};
function GMenuMapTypeControl(){};
function GNavLabelControl(){};
function GCopyright(){};
GCopyright.prototype.addCopyright = function(){};
GCopyright.prototype.getCopyrights = function(){};
GCopyright.prototype.getCopyrightNotice = function(){};
function GCopyrightCollection(){};
GCopyrightCollection.prototype.addCopyright = function(){};
GCopyrightCollection.prototype.getCopyrights = function(){};
GCopyrightCollection.prototype.getCopyrightNotice = function(){};
function GGroundOverlay(){};
GGroundOverlay.prototype.hide = function(){};
GGroundOverlay.prototype.isHidden = function(){};
GGroundOverlay.prototype.show = function(){};
GGroundOverlay.prototype.supportsHide = function(){};
function GIcon(){};
function GLayer(){};
GLayer.prototype.hide = function(){};
GLayer.prototype.show = function(){};
GLayer.isHidden = function(){};
function GMarker(){};
GMarker.prototype.openInfoWindow = function(){};
GMarker.prototype.openInfoWindowHtml = function(){};
GMarker.prototype.openInfoWindowTabs = function(){};
GMarker.prototype.openInfoWindowTabsHtml = function(){};
GMarker.prototype.bindInfoWindow = function(){};
GMarker.prototype.bindInfoWindowHtml = function(){};
GMarker.prototype.bindInfoWindowTabs = function(){};
GMarker.prototype.bindInfoWindowTabsHtml = function(){};
GMarker.prototype.closeInfoWindow = function(){};
GMarker.prototype.showMapBlowup = function(){};
GMarker.prototype.getIcon = function(){};
GMarker.prototype.getTitle = function(){};
GMarker.prototype.getPoint = function(){};
GMarker.prototype.getLatLng = function(){};
GMarker.prototype.setPoint = function(){};
GMarker.prototype.setLatLng = function(){};
GMarker.prototype.enableDragging = function(){};
GMarker.prototype.disableDragging = function(){};
GMarker.prototype.draggable = function(){};
GMarker.prototype.draggingEnabled = function(){};
GMarker.prototype.setImage = function(){};
GMarker.prototype.hide = function(){};
GMarker.prototype.show = function(){};
GMarker.prototype.isHidden = function(){};
GMarker.prototype.addMarkers = function(){};
GMarker.prototype.addMarker = function(){};
GMarker.prototype.refresh = function(){};
GMarker.prototype.getMarkerCount = function(){};
function GMarkerManager(){};
GMarkerManager.prototype.addMarkers = function(){};
GMarkerManager.prototype.addMarker = function(){};
GMarkerManager.prototype.refresh = function(){};
GMarkerManager.prototype.getMarkerCount = function(){};
function GMarkerManagerOptions(){};
function GMarkerOptions(){};
function GMercatorProjection(){};
GMercatorProjection.prototype.fromLatLngToPixel = function(){};
GMercatorProjection.prototype.fromPixelToLatLng = function(){};
GMercatorProjection.prototype.tileCheckRange = function(){};
GMercatorProjection.prototype.getWrapWidth = function(){};
function GOverlay(){};
GOverlay.getZIndex = function(){};
GOverlay.prototype.initialize = function(){};
GOverlay.prototype.remove = function(){};
GOverlay.prototype.copy = function(){};
GOverlay.prototype.redraw = function(){};
function GPolyEditingOptions(){};
function GPolyStyleOptions(){};
function GPolygon(){};
GPolygon.prototype.fromEncoded = function(){};
GPolygon.prototype.deleteVertex = function(){};
GPolygon.prototype.disableEditing = function(){};
GPolygon.prototype.enableDrawing = function(){};
GPolygon.prototype.enableEditing = function(){};
GPolygon.prototype.getVertexCount = function(){};
GPolygon.prototype.getVertex = function(){};
GPolygon.prototype.getArea = function(){};
GPolygon.prototype.getBounds = function(){};
GPolygon.prototype.hide = function(){};
GPolygon.prototype.insertVertex = function(){};
GPolygon.prototype.isHidden = function(){};
GPolygon.prototype.show = function(){};
GPolygon.prototype.supportsHide = function(){};
GPolygon.prototype.setFillStyle = function(){};
GPolygon.prototype.setStrokeStyle = function(){};
function GPolygonOptions(){};
function GPolyline(){};
GPolyline.prototype.fromEncoded = function(){};
GPolyline.prototype.deleteVertex = function(){};
GPolyline.prototype.disableEditing = function(){};
GPolyline.prototype.enableDrawing = function(){};
GPolyline.prototype.enableEditing = function(){};
GPolyline.prototype.getVertexCount = function(){};
GPolyline.prototype.getVertex = function(){};
GPolyline.prototype.getLength = function(){};
GPolyline.prototype.getBounds = function(){};
GPolyline.prototype.hide = function(){};
GPolyline.prototype.insertVertex = function(){};
GPolyline.prototype.isHidden = function(){};
GPolyline.prototype.show = function(){};
GPolyline.prototype.supportsHide = function(){};
GPolyline.prototype.setStrokeStyle = function(){};
function GPolylineOptions(){};
function GProjection(){};
GProjection.prototype.fromLatLngToPixel = function(){};
GProjection.prototype.fromPixelToLatLng = function(){};
GProjection.prototype.tileCheckRange = function(){};
GProjection.prototype.getWrapWidth = function(){};
function GScreenOverlay(){};
GScreenOverlay.prototype.hide = function(){};
GScreenOverlay.prototype.isHidden = function(){};
GScreenOverlay.prototype.show = function(){};
GScreenOverlay.prototype.supportsHide = function(){};
function GScreenPoint(){};
function GScreenSize(){};
function GTileLayer(){};
GTileLayer.prototype.minResolution = function(){};
GTileLayer.prototype.maxResolution = function(){};
GTileLayer.prototype.getTileUrl = function(){};
GTileLayer.prototype.isPng = function(){};
GTileLayer.prototype.getOpacity = function(){};
GTileLayer.prototype.getCopyright = function(){};
GTileLayer.prototype.hide = function(){};
GTileLayer.prototype.isHidden = function(){};
GTileLayer.prototype.show = function(){};
GTileLayer.prototype.refresh = function(){};
GTileLayer.prototype.supportsHide = function(){};
GTileLayer.prototype.getTileLayer = function(){};
function GTileLayerOptions(){};
function GTileLayerOverlay(){};
GTileLayerOverlay.prototype.hide = function(){};
GTileLayerOverlay.prototype.isHidden = function(){};
GTileLayerOverlay.prototype.show = function(){};
GTileLayerOverlay.prototype.refresh = function(){};
GTileLayerOverlay.prototype.supportsHide = function(){};
GTileLayerOverlay.prototype.getTileLayer = function(){};
function GTileLayerOverlayOptions(){};
function GAdsManager(){};
GAdsManager.prototype.enable = function(){};
GAdsManager.prototype.disable = function(){};
function GAdsManagerOptions(){};
function GClientGeocoder(){};
GClientGeocoder.prototype.getLatLng = function(){};
GClientGeocoder.prototype.getLocations = function(){};
GClientGeocoder.prototype.getLocations = function(){};
GClientGeocoder.prototype.getCache = function(){};
GClientGeocoder.prototype.setCache = function(){};
GClientGeocoder.prototype.setViewport = function(){};
GClientGeocoder.prototype.getViewport = function(){};
GClientGeocoder.prototype.setBaseCountryCode = function(){};
GClientGeocoder.prototype.getBaseCountryCode = function(){};
GClientGeocoder.prototype.reset = function(){};
function GDirections(){};
GDirections.prototype.load = function(){};
GDirections.prototype.loadFromWaypoints = function(){};
GDirections.prototype.clear = function(){};
GDirections.prototype.getStatus = function(){};
GDirections.prototype.getBounds = function(){};
GDirections.prototype.getNumRoutes = function(){};
GDirections.prototype.getRoute = function(){};
GDirections.prototype.getNumGeocodes = function(){};
GDirections.prototype.getGeocode = function(){};
GDirections.prototype.getCopyrightsHtml = function(){};
GDirections.prototype.getSummaryHtml = function(){};
GDirections.prototype.getDistance = function(){};
GDirections.prototype.getDuration = function(){};
GDirections.prototype.getPolyline = function(){};
GDirections.prototype.getMarker = function(){};
function GDirectionsOptions(){};
function GDownloadUrl(){};
function GFactualGeocodeCache(){};
GFactualGeocodeCache.prototype.isCachable = function(){};
function GGeoAddressAccuracy(){};
function GGeoStatusCode(){};
function GGeoXml(){};
GGeoXml.prototype.getTileLayerOverlay = function(){};
GGeoXml.prototype.getDefaultCenter = function(){};
GGeoXml.prototype.getDefaultSpan = function(){};
GGeoXml.prototype.getDefaultBounds = function(){};
GGeoXml.prototype.gotoDefaultViewport = function(){};
GGeoXml.prototype.hasLoaded = function(){};
GGeoXml.prototype.hide = function(){};
GGeoXml.prototype.isHidden = function(){};
GGeoXml.prototype.loadedCorrectly = function(){};
GGeoXml.prototype.show = function(){};
GGeoXml.prototype.supportsHide = function(){};
function GGeocodeCache(){};
GGeocodeCache.prototype.get = function(){};
GGeocodeCache.prototype.isCachable = function(){};
GGeocodeCache.prototype.put = function(){};
GGeocodeCache.prototype.reset = function(){};
GGeocodeCache.prototype.toCanonical = function(){};
function GGoogleBar(){};
function GGoogleBarAdsOptions(){};
function GGoogleBarLinkTarget(){};
function GGoogleBarListingTypes(){};
function GGoogleBarOptions(){};
function GGoogleBarResultList(){};
function GPov(){};
function GRoute(){};
GRoute.prototype.getNumSteps = function(){};
GRoute.prototype.getStep = function(){};
GRoute.prototype.getStartGeocode = function(){};
GRoute.prototype.getEndGeocode = function(){};
GRoute.prototype.getEndLatLng = function(){};
GRoute.prototype.getSummaryHtml = function(){};
GRoute.prototype.getDistance = function(){};
GRoute.prototype.getDuration = function(){};
function GStep(){};
GStep.prototype.getLatLng = function(){};
GStep.prototype.getPolylineIndex = function(){};
GStep.prototype.getDescriptionHtml = function(){};
GStep.prototype.getDistance = function(){};
GStep.prototype.getDuration = function(){};
function GStreetviewClient(){};
GStreetviewClient.prototype.getNearestPanoramaLatLng = function(){};
GStreetviewClient.prototype.getNearestPanorama = function(){};
GStreetviewClient.prototype.getPanoramaById = function(){};
function GStreetviewData(){};
function GStreetviewLink(){};
function GStreetviewLocation(){};
function GStreetviewOverlay(){};
function GStreetviewPanorama(){};
GStreetviewPanorama.prototype.remove = function(){};
GStreetviewPanorama.prototype.setContainer = function(){};
GStreetviewPanorama.prototype.checkResize = function(){};
GStreetviewPanorama.prototype.hide = function(){};
GStreetviewPanorama.prototype.show = function(){};
GStreetviewPanorama.prototype.isHidden = function(){};
GStreetviewPanorama.prototype.getPOV = function(){};
GStreetviewPanorama.prototype.setPOV = function(){};
GStreetviewPanorama.prototype.panTo = function(){};
GStreetviewPanorama.prototype.setLocationAndPOV = function(){};
GStreetviewPanorama.prototype.followLink = function(){};
function GStreetviewPanoramaOptions(){};
function GTrafficOverlay(){};
GTrafficOverlay.prototype.hide = function(){};
GTrafficOverlay.prototype.show = function(){};
function GTrafficOverlayOptions(){};
function GTravelModes(){};
var GXml = {};
GXml.parse = function(){};
GXml.value = function(){};
GXmlHttp.create = function(){};
var GXmlHttp = {};
GXmlHttp.create = function(){};
function GXslt(){};
GXslt.create = function(){};
GXslt.transformToHtml = function(){}; 

this idea was posted here a while back, but the above code is in the
format I needed for Eclipse:
http://groups.google.com/group/Google-Maps-API/browse_thread/thread/b...

Wednesday, May 27, 2009

Automatic auto complete in eclipse -- how coding should be!!!!

This infuriated me for a while. When coding in eclipse you have a very useful content assist, but you have to press ctrl+space or "." to get it to show. You can add 3 additional characters to the auto activation triggers, but thats not all that helpful either.

To get around this, just export your eclipse preferences, then do a find/search in the prefs file for "auto" and you'll find the entry for auto activation. Change the value to
"abcdefghijklmnopqrstuvwxyz." and prepare to be amazed... just re-import your preferences and now you'll get content assist when you need it.. as soon as you start typing!!

Note: You won't see this entry

/instance/org.eclipse.jdt.ui/content_assist_autoactivation_triggers_java=abcdefghijklmnopqrstuvwxyz.

unless you've modified your key preferences in some way, since eclipse won't export the default settings.

This makes writing code way faster, not to mention easier on the old fingers/wrists-

Also, here's how I've got the rest of the autocomplete settings configured

Sunday, March 22, 2009

installing postgresql

1. Domain users might run into problems unless your password is ridicuously complex
2. You need to select a locale
3. And on windows, you most likely will need to fix the locale and build the db manually


Friday, March 20, 2009

Google LatLong: A look back in time

Google LatLong: A look back in time

wow, check out dubai buidling islands!!! and the amazon being deforested, disturbing-

Google Chrome Blog: Chrome Experiments: not your mother's JavaScript

Google Chrome Blog: Chrome Experiments: not your mother's JavaScript

fall in love with javascript again :)

What is BlogThis! ? - Blogger Help

What is BlogThis! ? - Blogger Help
cool, blogging right from chrome!

Sunday, July 20, 2008

Javascript Inheritance Notes

var mymaps = new ExtMyMapsControl();
function markerControl(){
var me = this;
me.a = "ere";
}
markerControl.prototype = new ExtMyMapsControl();
markerControl.prototype.constructor = markerControl;
markerControl.prototype.initialize = function(map){
var me = this;
me.container = mymaps.initialize.call(this,map);
me.container.id = "yeah!";
return me.container;
}

var mc = new markerControl();

mymaps.options.controlPosition = "changed";

console.log(map);
console.log(mymaps.initialize(map));
console.log(mc.initialize(map));

Friday, July 11, 2008

Oracle DB Build For Spring's Petclinic Sample


DROP TABLE visits;
DROP TABLE pets;
DROP TABLE owners;
DROP TABLE types;
DROP TABLE vet_specialties;
DROP TABLE specialties;
DROP TABLE vets;


CREATE TABLE vets (
"id" INTEGER NOT NULL,
first_name VARCHAR(30),
last_name VARCHAR(30),
constraint "PK_ID" primary key ("id")
);

CREATE INDEX vets_last_name ON vets(last_name);

CREATE TABLE specialties (
"id" INTEGER NOT NULL ,
name VARCHAR(80),
constraint "PK_SPECIALTIES_ID" primary key ("id")
);
CREATE INDEX specialties_name ON specialties(name);

CREATE TABLE vet_specialties (
vet_id INTEGER NOT NULL,
specialty_id INTEGER NOT NULL
);

alter table vet_specialties add constraint fk_vet_specialties_vets foreign key (vet_id) references vets("id");
alter table vet_specialties add constraint fk_vet_specialties_specialties foreign key (specialty_id) references specialties("id");

CREATE TABLE types (
"id" INTEGER NOT NULL,
name VARCHAR(80),
constraint "PK_TYPES_ID" primary key ("id")
);
CREATE INDEX types_name ON types(name);

CREATE TABLE owners (
"id" INTEGER NOT NULL,
first_name VARCHAR(30),
last_name VARCHAR(30),
address VARCHAR(255),
city VARCHAR(80),
telephone VARCHAR(20),
constraint "PK_OWNERS_ID" primary key ("id")
);
CREATE INDEX owners_last_name ON owners(last_name);

CREATE TABLE pets (
"id" INTEGER NOT NULL,
name VARCHAR(30),
birth_date DATE,
type_id INTEGER NOT NULL,
owner_id INTEGER NOT NULL,
constraint "PK_PETS_ID" primary key ("id")
);
alter table pets add constraint fk_pets_owners foreign key (owner_id) references owners("id");
alter table pets add constraint fk_pets_types foreign key (type_id) references types("id");
CREATE INDEX pets_name ON pets(name);

CREATE TABLE visits (
"id" INTEGER NOT NULL,
pet_id INTEGER NOT NULL,
visit_date DATE,
description VARCHAR(255),
constraint "PK_VISITS_ID" primary key ("id")
);
alter table visits add constraint fk_visits_pets foreign key (pet_id) references pets("id");
CREATE INDEX visits_pet_id ON visits(pet_id);



/**
* Populate
*/
INSERT INTO vets VALUES (1, 'James', 'Carter');
INSERT INTO vets VALUES (2, 'Helen', 'Leary');
INSERT INTO vets VALUES (3, 'Linda', 'Douglas');
INSERT INTO vets VALUES (4, 'Rafael', 'Ortega');
INSERT INTO vets VALUES (5, 'Henry', 'Stevens');
INSERT INTO vets VALUES (6, 'Sharon', 'Jenkins');

INSERT INTO specialties VALUES (1, 'radiology');
INSERT INTO specialties VALUES (2, 'surgery');
INSERT INTO specialties VALUES (3, 'dentistry');

INSERT INTO vet_specialties VALUES (2, 1);
INSERT INTO vet_specialties VALUES (3, 2);
INSERT INTO vet_specialties VALUES (3, 3);
INSERT INTO vet_specialties VALUES (4, 2);
INSERT INTO vet_specialties VALUES (5, 1);

INSERT INTO types VALUES (1, 'cat');
INSERT INTO types VALUES (2, 'dog');
INSERT INTO types VALUES (3, 'lizard');
INSERT INTO types VALUES (4, 'snake');
INSERT INTO types VALUES (5, 'bird');
INSERT INTO types VALUES (6, 'hamster');

INSERT INTO owners VALUES (1, 'George', 'Franklin', '110 W. Liberty St.', 'Madison', '6085551023');
INSERT INTO owners VALUES (2, 'Betty', 'Davis', '638 Cardinal Ave.', 'Sun Prairie', '6085551749');
INSERT INTO owners VALUES (3, 'Eduardo', 'Rodriquez', '2693 Commerce St.', 'McFarland', '6085558763');
INSERT INTO owners VALUES (4, 'Harold', 'Davis', '563 Friendly St.', 'Windsor', '6085553198');
INSERT INTO owners VALUES (5, 'Peter', 'McTavish', '2387 S. Fair Way', 'Madison', '6085552765');
INSERT INTO owners VALUES (6, 'Jean', 'Coleman', '105 N. Lake St.', 'Monona', '6085552654');
INSERT INTO owners VALUES (7, 'Jeff', 'Black', '1450 Oak Blvd.', 'Monona', '6085555387');
INSERT INTO owners VALUES (8, 'Maria', 'Escobito', '345 Maple St.', 'Madison', '6085557683');
INSERT INTO owners VALUES (9, 'David', 'Schroeder', '2749 Blackhawk Trail', 'Madison', '6085559435');
INSERT INTO owners VALUES (10, 'Carlos', 'Estaban', '2335 Independence La.', 'Waunakee', '6085555487');

INSERT INTO pets VALUES (1, 'Leo', to_date('2000-09-07','yyyy-mm-dd'), 1, 1);
INSERT INTO pets VALUES (2, 'Basil', to_date('2002-08-06','yyyy-mm-dd'), 6, 2);
INSERT INTO pets VALUES (3, 'Rosy', to_date('2001-04-17','yyyy-mm-dd'), 2, 3);
INSERT INTO pets VALUES (4, 'Jewel', to_date('2000-03-07','yyyy-mm-dd'), 2, 3);
INSERT INTO pets VALUES (5, 'Iggy', to_date('2000-11-30','yyyy-mm-dd'), 3, 4);
INSERT INTO pets VALUES (6, 'George', to_date('2000-01-20','yyyy-mm-dd'), 4, 5);
INSERT INTO pets VALUES (7, 'Samantha', to_date('1995-09-04','yyyy-mm-dd'), 1, 6);
INSERT INTO pets VALUES (8, 'Max', to_date('1995-09-04','yyyy-mm-dd'), 1, 6);
INSERT INTO pets VALUES (9, 'Lucky', to_date('1999-08-06','yyyy-mm-dd'), 5, 7);
INSERT INTO pets VALUES (10, 'Mulligan', to_date('1997-02-24','yyyy-mm-dd'), 2, 8);
INSERT INTO pets VALUES (11, 'Freddy', to_date('2000-03-09','yyyy-mm-dd'), 5, 9);
INSERT INTO pets VALUES (12, 'Lucky', to_date('2000-06-24','yyyy-mm-dd'), 2, 10);
INSERT INTO pets VALUES (13, 'Sly', to_date('2002-06-08','yyyy-mm-dd'), 1, 10);

INSERT INTO visits VALUES (1, 7, to_date('1996-03-04','yyyy-mm-dd'), 'rabies shot');
INSERT INTO visits VALUES (2, 8, to_date('1996-03-04','yyyy-mm-dd'), 'rabies shot');
INSERT INTO visits VALUES (3, 8, to_date('1996-06-04','yyyy-mm-dd'), 'neutered');
INSERT INTO visits VALUES (4, 7, to_date('1996-09-04','yyyy-mm-dd'), 'spayed');


Labels

Labels

Labels