Showing posts with label Open Source. Show all posts
Showing posts with label Open Source. Show all posts

Get column names from MSSQL

                            SELECT table_name=sysobjects.name,
                            column_name=syscolumns.name,
                            datatype=systypes.name,
                            length=syscolumns.length
                            FROM sysobjects
                            JOIN syscolumns ON sysobjects.id = syscolumns.id
                            JOIN systypes ON syscolumns.xtype=systypes.xtype
                            WHERE sysobjects.xtype='U'
                            ORDER BY sysobjects.name,syscolumns.colid

credits go to http://codesnippets.joyent.com
[...]

Fill Color and Change style of Polygon on OpenLayers Opensource Map

Following code snippets show how to change the filled color and style of polygon on OpenLayers Map. It is tested and working example. :) Thanks.



           //define style for polygon
            var style_poly =
           {
               strokeColor: "#000000",
               strokeOpacity: 1,
               strokeWidth: 2,
               fillColor: "#00FF00",
               fillOpacity: 0.6
            };
            var polygonLayer = new OpenLayers.Layer.Vector("Polygon Layer");
             //------------set style on layer
             polygonLayer.style=style_green;
--------------------------------------------------------------------------------------------------------------
[...]

Enable Tomcat Web server on XAMPP (Enabling JSP on XAMPP)

By default, you can’t directly run JSP files on XAMPP. In order to do so, you have to add Tomcat for XAMPP.
You can enable Tomcat on XAMPP by downloading tomcat add-on at 
http://www.apachefriends.org/en/xampp-windows.html#644 and running the installer executable file.

There’s always usually a conflict with port numbers if you are running more than one web server on your work station. In this case, you can change and configure tomcat web server to run on other port numbers.
Below notes are to show you where to change the port number for tomcat server.





Configure Port number on Tomcat Server
Please find following find in your tomcat installation directory.

C:\xampp\tomcat\conf\server.xml
<Connector port="9000" protocol="org.apache.coyote.http11.Http11AprProtocol"
connectionTimeout="20000"
redirectPort="8443" />
Change the port number from its default “8080” to “9000” (You can change to other available port number as well)
Check User Name and Password for Tomcat

C:\xampp\tomcat\conf\tomcat-users.xml
<tomcat-users>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="xampp" password="xampp" roles="admin,manager"/>
</tomcat-users>
[...]