Showing posts with label ProNetwork. Show all posts
Showing posts with label ProNetwork. Show all posts

Tuesday, May 31, 2011

Just The Basics

If you read the post that leads into this For Your Career, Start Here, you should now be a member of my online group on LinkedIn. If not, go check it out, and then come back here when you are done.

This post will start you in helping set up your environment for development.


Well that guy just above is enthusiastic about getting started, but if we don't get organized first, we will all have a tough time following along.

Let's begin. The first tool I want to share with you is a tool called dropbox. You won't need it for what I am about to share, but you might want it for your own personal use. If you want to get involved or actively participate, you will need to do just a couple of things so that we can collaborate. In the following screen recording, I will tell you about what those steps are. So, take a look at the video, get connected and then I will take you on a tour.



Now, that we have access to dropbox, we can get to some files that we will be using for development.

Don't worry if you are waiting for code. We are setting up a solid foundation for sharing with one another. Get ready to share and find out in my next post: Why We Share.

Thursday, December 2, 2010

Knowledge Sharing

I am getting some rest right now battling a sinus infection, but there are others hard at work, so let me share with you, because it doesn't have to come from me. And this may be the shortest blog post, but still offering up a great deal of content. Check out Chris Bogan's List of Interesting Blogs. You can find out more of what Chris has to say on twitter at  http://twitter.com/chrisbrogan.

I can share more with you if you enjoy content of online professionals that are not part of the social network, but in a more work related area of which I call the professional network or #ProNetwork as I call it on twitter.

What do you think?

Tuesday, November 23, 2010

Functional Code is Nice, But Nice Code is Better

The ability to print my map to pdf in ESRI ArcGIS Server is something I have wanted for a while. There are several examples available on ESRI's website from ESRI and others developers have shared their examples as well. But I haven't found the print examples easy to follow or to apply. So I made one "Chris" simple. Feel free to read about my PrintTask if you haven't. It uses iTextSharp, but one thing I did not mention is that you can use the same code to print any image that iTextSharp supports and everything I did can be done at no cost to you. Having a job in GIS isn't even required.

Now for the topic at hand; clean code. I thought it was more important for my fellow developers to have the knowledge of how to print a map to pdf. If I were in their shoes, I would not want to wait to learn the functionality that could be added to my application, so I did not want you to have to wait either.

And now you have a PrintTask in which you can integrate into your ESRI ArcGIS Server applications using the JavaScript API 2.1. However, if you know how to export the map in Flex or Silverlight, you can apply this same example in those API's as well as the page that displays the pdf uses no GIS API's of any kind; it just references the location of the image.

But why am I still talking about the PrintTask? I did not separate presentation, functionality and content. If you are not familiar with this, you are not alone. Now you need to know, I am not "the authority" on website design, but I do the best I can to apply what I learn from other professionals and programming books.

I listed three books that I have bought below from SitePoint. They are easy to read books and a good starting point. You can check your local library first. The first one I mention is quite possibly available there and the best one of the three. Build Your Own Website the Right Way will help with basic CSS, but I would skip the chapter on HTML forms. I did. I want to build .NET pages, so HTML forms is not an area I was too concerned about. Concepts of this book are applied to my examples, but where the book takes you on a learning tour of creating well-formed websites with HTML; I will extend the information and show you how to apply those same well-formed techniques in .NET. That's not in the book. Simply JavaScript is a lot to take in, but it does drive home the importance of separation of content, display and functionality. jQuery is there because I just like it. However, if you don't want or need a book, don't worry. I plan on taking you through the steps that these books use and plan on showing you how to take that information further, by integrating  the topics with .NET, JavaScript Framework, and mapping API's. But, you do need to be aware that I will be starting with .NET, not HTML. It will be easier than you think, just follow along and if you get lost, just speak up and I will give you directions.




Before sharing how to build a well-formed site template, I want to share with you some basics that I think are important, commenting and documenting your work by showing you how to write code that creates an XML file for you.


If you want to become more involved with the developer community collaborating, live, online and even in person, I would like to invite you to join the Web Dev Network on LinkedIn. Just click the link below and request to join. If you do not already have a LinkedIn account, you will need to create it first. But it's free and we have live online meetings. There is no video yet, but you can talk, watch, and even present.
Join

Monday, September 27, 2010

Web Dev Network Growth, XML and Road to GeoRSS



Join
The Web Dev Network is growing fast. I created this group on July 1, 2010 and we have members on six continents in eight countries. The Web Dev Network's most recent online meeting's topic was about XML. I am starting a companion post to the last meeting which will lead up to October's meeting about GeoRSS. The companion post will be a re-cap of the online meeting that we had on September 24, 2010.


First we are goinng to start with a very basic block of XML. This block of XML code has three items that make it so that it does have some value.

<?xml version="1.0" encoding="utf-8"?>
<rootElement>
<docElement>Add your content here.</docElement>
</rootElement>

The first line is the XML declaration. It is the first required piece of a well-formed XML document. The second line displays a tag named rootElement. This is the root element of the XML document. All XML documents must have a root element. The root element is basically a container for the rest of your document. The third line is a child element. The child element is where your content of your XML document will. That's if for this now. We will build extend this example in my next post as we continue to build our way to GeoRSS.

Now, as I said, here is a basic example to automate the creation of this document using HTA for a graphical user interface and VBScript.

All you have to do is copy the code into a text editor and save the file as createXml.hta.
Now, if you are not sure how to do this, please comment. My postings will be geared to providing working code and I won't provide step by step instructions, but if the need is there I can back up and help out.

Copy on next line:

<!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
'********************************************************************************
'*                                                             
'* HTA Name:    createXml.hta                                    
'* Author:         Chris Sergent                                        
'* Created:        10/5/2010                                        
'* Description:    This HTA dynamically creates an xml skeleton document.
'*                                                    
'********************************************************************************
'*                    HTA DOCUMENTATION                        
'*                                                    
'* Any HTA changes will be documented here with date, change and author.    
'*                                                    
'********************************************************************************
'*Graphical User Interface Section                                
'********************************************************************************
-->        
<head>
<!-- Application Name is the name of the HTA application that would appear in
Windows Task Manager. -->


<!-- Properties that can be set.
    - Border    Type of window borders
                Define the border as thick for a resizable border
                Define the border as thin for a non-resizable window
                
    -WindowState    Default state is normal out of the three possible,
     (Normal, Minimize, Maximize)
    
    For the following properties, use the value yes to display and the value no,
    to not display. All defaults for these properties are yes.
    -Caption
    -MaximizeButton
    -MinimizeButton
    -Scroll
    -ShowInTaskbar
    -SingleInstance    Specifies if multiple instances are allowed to run
    -SysMenu        Determines if the application will display the System menu
    -->


        <meta http-equiv="content-type" content="text/html;charset=utf-8" />
        
        <title>HTA XML Skeleton Creator</title><!-- Caption To display On title bar -->
<!--
'********************************************************************************
'*                                                            
'*                        SETTINGS FOR HTA                        
'*                                                            
'********************************************************************************
-->
<!-- Although HTA has defaults, I have entered the defaults in manually, so you
can see the    syntax and change them as you see fit. The settings are divided
into two groups, required or optional. The required information is either a
must have or something that    might be very noticeable if you ignore.
-->
<HTA:APPLICATION>
        <!-- Required -->
        APPLICATIONNAME="Resume Creator"
        SCROLL="yes"
        SINGLEINSTANCE="yes"
        WINDOWSTATE="maximize"
        
        <!-- Optional -->
        Border = "thick" <!-- No default -->
        Caption = "yes"
        MaximizeButton = "yes"
        MinimizeButton = "yes"
        ShowInTaskbar = "yes"
        SysMenu = "yes"
        
</HTA:APPLICATION>
        
    </head>


    
    <script language="VBScript">
'************************************************************************************
'*                                                         
'* Script Name:    Scripts are Object Oriented and are named in each sub.
'* Author:         Chris Sergent                                    
'* Created:        11/8/2007                                        
'* Description:    This script is a starter template for writing scripts in HTA.     
'*                As usual, I have added information that appears to be found
'*                frequently in various authored scripts eliminating the need to
'*                re-type this.    
'*                                                        
'************************************************************************************
'*                    DOCUMENTATION                            
'*                                                        
'* Any script changes will be documented here with date, change and author.
'*
'*    1/23/2009
'*    This script now generates a complete web page with head, title, meta, paragraph,
'*     and body elements.         
'*                                                        
'************************************************************************************
'* Initialization Section                                        
'************************************************************************************
    Option Explicit
'************************************************************************************
'* Declare Constants                                            
'************************************************************************************
    Const ForAppending = 8    'Allows for adding information to a file
    Const ForWriting = 2    'Writes to a file(writes over existing file as well)
    Const ForReading = 1    'Reads a file
    
'************************************************************************************
'* Define Variables                                            
'************************************************************************************
    'Path Variables
    Dim strTemplate    'Template File Location
    Dim strDocument    'Documenting the Log File
    
    'WMI Variables
    Dim objWMIService, objOSItem, objCSItem
    Dim colCSItems
    Dim strComputer
    strComputer = "."
    Dim strUserName
    strUserName = "HKCU\Software\Microsoft\Windows\" &_
                "CurrentVersion\Explorer\Logon User Name"


    
    'FSO Variables
    Dim objFSO        'File System Object
    Dim objFile        'File Object
    Dim objTSO        'Temporary System Object
    Dim objFolder 'Folder Object
    objFolder = "C:\Templates\"
    
    'Window Variables
    Dim intLeft, intTop, inthorizontal, intVertical
    
    'GUI Objects
    Dim strTemplateName 'Path of Template
    Dim txtTemplateName
    Dim txtTitle
    Dim txtHead


        
    
'************************************************************************************
'* Set the Values for the Variables                                    
'************************************************************************************
    'Set up an instance of the WshShell object
    'Common Variable Values


    'WMI Values
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" _
        & strComputer & "\root\cimv2")
    


    Set colCSItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
                                        
    'FSO Values
    Set objFSO = CreateObject("Scripting.FileSystemObject")




    
'************************************************************************************
'* Main Processing Section                                        
'************************************************************************************
'Events


Sub Window_Onload
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colCSItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
For Each objOSItem in colCSItems
intHorizontal = objOSItem.ScreenWidth
intVertical = objOSItem.ScreenHeight
Next
intLeft = (intHorizontal - 800) / 2
intTop = (intVertical - 600) / 2
    



End Sub


    'Check to see if a template already exists. The application will not overwrite
    'an existing template with the same name.
    Sub CreateTemplate
         TemplateCheck()
    End Sub
    
'************************************************************************************
'* Procedure Section                                            
'************************************************************************************
    Function TemplateCheck()
strTemplate = objFolder & txtTemplateOutput.value
        

Msgbox strTemplate
If objFSO.FileExists(strTemplate) Then
Msgbox "Document Exists"
         Exit Function
    

        


        Else
         If Not objFSO.FolderExists(objFolder) Then
         objFSO.CreateFolder(objFolder)
         End If
         strTemplate = objFolder & txtTemplateOutput.value
                objFSO.CreateTextFile(strTemplate)
             Set objFile = objFSO.OpenTextFile(strTemplate, ForWriting)
                
                 objFile.WriteLine "<?xml version=" & """1.0""" & " encoding=" & """utf-8""" & "?>" & vbcrlf & _
                                        "<rootElement>" & vbcrlf & _
                                        "<docElement>" & vbcrlf & _
                                        "Add your content here." & vbcrlf & _
                                        "</" & "docElement>" & vbcrlf & _
                                        "</rootElement>"
                 objFile.Close()
         MsgBox strTemplate & " Created"
        End If
    End Function
    
    
</script>
<!--
'************************************************************************************
'* HTA GUI Section
'************************************************************************************
-->
<body>
Enter a title (Example:skeleton.xml)<br />
<input id="txtTemplateName" type="text" value="skeleton.xml" name="txtTemplateOutput" style="width: 336px"/><br />


    <br />
    
    <input type="button" value="Create Template" name="run_button" onClick="CreateTemplate">
<p>


<span id = "DataArea"></span>
</p>
</body>
</html>
<!--
'************************************************************************************
'* Nothing To See Here - Please Move Along
'************************************************************************************
-->

Don't copy this line or any after this one.

Later this week, we will finish the XML document and start an XSD. Next up, I will add a Python example that creates the same XML file. This may seem simple now, but we will be building on this in multiple languages, scripting and code.
Do you have any cool code you would like to share with us?

Wednesday, September 8, 2010

Web Dev Network - My Accidental International Group


Before reading this, you should be aware terms may be used that will not be explained, but the group I reference will do just that. If you want to know more about the Dev Meet Up hosted by ESRI coming to Decatur, you should read Part I.

With so many resources online, in an effort to tame the beast of information; resources have been created such as twitter, LinkedIn, Facebook and more. There have even tools to bring those resources together like Tweetdeck. But with all of the resources and integration tools that highway of information can still become a blur.

The benefit of connecting to the world allows for access to a great deal of information. Unfortunately there is a lot of bad, outdated, incorrect, and copied or you pick problems that you have run into. The negatives of increased information access will quickly become visible if you are a programmer like me. But there are other options.

Sign up for a social network account; I like to call them Pro Networks as it relates to the main purpose as to why I use them. My twitter account is basically made up of people that I follow in the field of GIS and programmers. When you want to interact with your peers, your tweet can be swept away by the tweet fleet. These are people that post so much you may miss most of the posts that you follow. Again, we narrowed the internet information, but it is still not effective. What is the best way to share information that is quality? There is a way to do that too.

People. Meet the people behind the icon. At conferences, training, and professional meetings; we have the chance to talk to our peers. There is also a chance for us to present to many at one location. So, we have a solution for acquiring good information. But where are the people in your own area and professional field. So, here we are good information without the ease of locating our peers or mass information that may be bad that makes our peers more visible. Which do you pick? By accident, it has become very clear. The one you pick is - both. We will look at that in just a moment as I will bring all of this together, but I have to add one more piece.
I am a web developer, programmer, gadget geek. If it's tech, I want to learn. But as a web developer in GIS, there is another dynamic. GIS is not all I use for my development. What happens when you go outside the scope of support for any organization? And welcome to the gray area of programming, the neutral zone of support. When support steps back, it's time for us to step up. Remember how you are told to write efficient code. How valuable is efficient support?

As a web developer and I am including mobile, we all have to resolve the issue of finding the starting line. The more you integrate, new starting lines pop up and then you stop in the middle of the race and ask; what am I supposed to do now? In web development, there is something call the separation of content, presentation and functionality. Now these three areas can actually be broken down even further. So we are now in a new area, but a very similar concept. Now we need to know all of the pieces of web development, but we also need to know the details. If you try combining this with professional interaction and are either confused or frustrated and want to stop reading - WAIT! What if there was a way to resolve these issues and someone was attempting to offer genuine help. Well I am. Now that I have gone through a few issues that you may have run into, I know there are more. But I think we can work together and knock these barriers down. Let me tell you about the Web Dev Network - My Accidental International Group.

The Web Dev Network is nothing I ever considered starting. I have a lot of ideas, good and bad alike, but this one came to me out of a series of events. And yes, Needs - Mother of Invention.

All I really wanted to do was Meet Up with my peers to discuss programming and there is one happening in the city I work. We are having a GIS Dev Meet Up. The great part about this is that it has a narrow focus to maximize content quality for GIS development and it's in my geographic areas. But there is the other issue; I think there should be more events like this in other areas. For this to ever happen, I depend on the developer community. As far as the meeting for brainstorming on code that I wanted to have, I posted it on Twitter so others in Illinois could come to the meeting. After posting, I was asked if the meeting could be online. With the idea that it could be accomplished and not necessarily having the resources, I said yes. Fortunately, USGS came to my rescue and with the help of Shelley Silch of the Geospatial Liaison for Illinois in Urbana; we had our first online meeting in May 2010. Shelley connected us from Urbana and I presented from Decatur. The meeting was live with screen sharing and "hot screen" sharing and the opportunity for the group to communicate just like you would at any meeting. Not only that. Audio and screen recordings were made for others that may not have had a chance to attend.

To announce meetings, I initially started announcing on twitter and Lone GIS Pro; a group on Google and e-mailing. If you don't have a GIS team and you want to be connected to your peers, you may be interested in Lone GIS Pro. Please let me know if you are. But as far as notifying others of meetings, I needed a better way for sharing. I joined several groups with areas of focus that I am interested in individually, but to get the word out, I started the group Web Dev Network. This would help me get the word to the attendees from several states. But I received requests to join the group from Canada and countries in Europe and Asia. With the opportunity to remove one barrier, the Web Dev Network became international. Wait a second. Now this will just become one of those groups that as it grows individuals will disappear and activity will do the same.

My goal is for the Web Dev Network to be the largest small group that facilitates sharing knowledge among professionals. This way we can become part of a group and work together to make it grow, and this should facilitate the visibility of our peers in our own geographical regions. As the group grows, it would help to have volunteers to take the lead at the various levels to maintain the local level person to person interaction. Please let me know if you are a member of the Web Dev Network and you are interested in helping. Together we can grow as small team of professionals while filling a need in the pool of knowledge with integrity.

With that, I know where I want to grow with this group. If you would like to grow this way too, please join us and we will grow together.

Thanks.

Hope to share with you soon.

Chris

Thursday, August 26, 2010

From Novice to Network - The Team Behind My Knowledge And How You Can Build One Too

It has been a busy week and I have had the pleasure of enjoying some intrinsic rewards that one can only enjoy if you are in a career in which fits your professional abilities and ambitions. There was a time that I placed a priority in choosing a career based on how much money I could make, but I decided that it was more important to pursue a career that could I could enjoy. I don't want to spend the work week looking forward to the weekend. The path to becoming a GIS Web Developer was unexpected to say the least as well as the help that I have received along the way. Without the willingness to provide genuine help by others, I would not be GIS Web Developer.

But this week, everything has come full circle, from where I used to be to interacting with some developers that are in a situation with limited opportunities for growth as a professional.

It's important that your realize that this will be a series of posts leading up to an event that I can't put into the right words, that has the kind of meaning for me where a milestone would be a minor accomplishment in comparison to what this upcoming event means to me. It's not just the event itself, there is a bigger picture that I want to share with my fellow developers and programmers starting out. There are methods I have learned that I think is not only of value to me as a GIS Web Developer, but any professional.

In recent years, I have had the opportunity to have the financial backing to enhance my knowledge and have done my best to give back for such an opportunity. Now I am working on giving back to the development community and to those that may be in a situation that I used to be in; where barriers to knowledge, resources, or funds may have made growth difficult.

My objective is simple, but not necessarily easy. I want to eliminate the costs to gain basic knowledge, eliminate ignorance of who could help; this can be a major hurdle in itself, and last I want to eliminate the barrier of geography.

If you haven't had the chance to attend conferences, training, seminars and other events. You might not be able to travel the world, but with the help of USGS and other professionals, we will bring the world to you in respect to professional development. This isn't a chat, forum, or a one way live event where presenters talk and you type. I have created a group on LinkedIn called Web Dev Network. With the help of USGS, we meet once a month online, live and use screen sharing. You will be able to speak with other web developers and an added dynamic is members using "hot screen" sharing, meaning you can share with the group using your own resources, provide a presentation to the group. If it's related to professional growth as a developer, this group is for you. It is a group that is meant to give you an opportunity to interact with your peers. Novices to professional are welcome.

I am looking forward to sharing more with you, but as I post, if you have stories about what or who might have helped you grow as a professional, please share with my readers and my peers as we are very interested in what you have to say.

See you at the next post.

Chris