Wednesday, August 19, 2015

Using FreeMarker to assign Agility VM properties to a PowerShell variable.

It's been about a month since I last posted. Well, I've been a little busy. I've been starting the interview process for a few companies. Since this upcoming Fall semester is my last, it is imperative that I have a software engineering job lined up for January 2016. And my week is spent full-time as a tech engineer working in the automation department at some company where I create PowerShell scripts leveraging FreeMarker that are utilized within CSC's Agility platform.


So...... to the point of this blog. I've been working on a script lately that validates the properties of an instance and then compares it to the properties listed in Agility using a Java API called FreeMarker. I just want to display an example for extracting properties from VMs in Agility and then assigning it to a variable in PowerShell.

*NOTE* Scripts leveraging FreeMarker can only be run in Agility with the extensions button enabled when adding/creating the script in Agility. They will not execute properly in PowerShell ISE, etc.. The FreeMarker aspect of the script will only be viewed as a multi-lined comment in traditional PowerShell editor settings.


Here's an example code snippet that extracts a designated VM asset property from an Agility template in agility and assigns it to a PowerShell variable...


<#assign agilityOSProperty = vmAssetProperty(this, "template.domain")>
$agilityOSProperty = '${agilityOSProperty.stringValue}'
$agilityOSProperty = $agilityOSProperty.ToUpper()



link that may be of interest ---> http://freemarker.org/


Monday, July 20, 2015

What is Python good for..


-Web and Internet Development

* Frameworks like Django and Pyramid
* Micro-frameworks like Flask and Bottle
* Advanced content management systems such as Plone and django CMS
* supports HTML and XML
* supports JSON
* supports E-mail processing
* support for FTP and IMAP as well as other internet protocols
* supports socket interface
* Requests, a powerful HTTP client library
* BeautifulSoup, an HTML parser that can handle all sorts of oddball HTML
* Feedparser for parsing RSS/Atom feeds
* Paramiko, implementing the SSH2 protocol
* Twisted Python, a framework for asynchronous network programming


-Scientific and Numeric

* SciPy is a collection of packages for mathematics, science, and engineering
* Pandas is a data analysis and modeling library
* IPython for editing and recording work sessions, supporting visualizaitons and parallel computing
* Software Carpentry Course teaches basic skills for scientific computing, running bootcamps and providing open-access teaching materials.


-Education

* python.org
* docs.python
* hundreds of videos on youtube


-Desktop GUIs

* Tk
* wxWidgets
* Kivy, for multitouch applications
* Qt via pyqt and pyside
* GTK+


-Software Development

* Build Control ---> SCons
* Automated Continuous Compilation and Testing ---> Buildbot and Apache
* Bug Tracking and Project Management ---> Roundup or Trac









This information was adapted from the Python Software Foundation self described as "The Python Software Foundation (PSF) is a 501(c)(3) non-profit corporation that holds the intellectual property rights behind the Python programming language. We manage the open source licensing for Python version 2.1 and later and own and protect the trademarks associated with Python. We also run the North American PyCon conference annually, support other Python conferences around the world, and fund Python related development with our grants program and by funding special projects". https://www.python.org/about/apps/

Hacking session in GO programming language with members from the GO team.


Wednesday, July 8, 2015

Java != JavaScript



This topic is somewhat a pet peeve of mine.. I tend to get slightly annoyed when people or job descriptions act as if Java is JavaScript, and vice versa. They are not related! Yes, they are both prevalent in our everyday lives; from the phones we use to the websites we access. A lot of software that an average person will interact with regularly, technology wise, will have been influenced entirely if not partially by one of these two languages. Everything from your mobile device, websites, to even the apps on your smart TV.. Here's one example of a line of smart TV's that are in fact populated with apps that are programmed in Java (FYI: Android apps are typically programmed with a combination of Java and Android XML) ----> http://www.theverge.com/2015/1/5/7497383/sony-new-smart-tv-run-android-tv-ces-2015


Here are some quick facts..



Java:

-Launched by Sun Microsystems in 1995.
-Developed by James Gosling.
-Object-Oriented Programming Language (objects represent instances of a class).
-Strongly-Typed language.
-Runs on the Java Virtual Machine(JVM).
-The language was originally named OAK.
-Considered a general-purpose programming language.
-Able to run on any OS where JVM is available.
-Java supports multi-threaded programming.
 (multiple processes running simultaneously)
-De facto language used to develop Android apps.
-Filename extension is .java


HELLO WORLD IN JAVA:

class helloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}






JavaScript:

-Developed at Netscape and released after Java in 1995
-Originally called LiveScript, Sun Microsystems gave Netscape
 an exclusive license to allow the switch from LiveScript to JavaScript.
-Does not use classes.
-Typically embedded in HTML.
-Interpreted and ran by the client's browser.
-Loosely-typed language (Don't have to declare a data type before using it).
-Supported by all if not most browsers.
-Prototyped scripting language with object-oriented aspects.
-Filename extension is .js




HELLO WORLD IN JAVASCRIPT:    
                            
<!DOCTYPE HTML>                                  
<html>                                                              
<body>                                                                  
                                                                           
  <p>Header...</p>                                        
                                                                       
  <script>
    alert('Hello, World!')
  </script>

  <p>...Footer</p>

</body>
</html>






Both awesome and productive languages? YES! The same? NO!

15 Sorting Algorithms in 6 Minutes





Here's a cool video I've found on YouTube that illustrates sorting algorithms with the use of visualization and audio. Pretty cool stuff


Monday, July 6, 2015

SCRUM Meetings and Agile Methodology; an Intern's perspective!

         SCRUM meetings, three times a week. What's it like? Well imagine running a marathon (26.2 miles), and every 3 miles there was a checkpoint (sprint release) with water breaks every 5 minutes(the weekly SCRUM meetings). Now picture, for explanation purposes, that you had to reach each checkpoint in about 30 minutes. The first checkpoint (sprint 1) goes fine. Then later on, as you running along on your way to the next checkpoint (sprint 2) filled with confidence and optimism, your shoe becomes undone and you trip and slam hard on to the ground scraping your knee. By the time you get up, have assessed the damage and adapted to this new obstacle (a scraped knee) you've added like 5 minutes to your sprint. Put that into context of software development, you're a week or two behind on features that should've been released by the planned sprint/ release date and now the date has to be pushed back a week to adapt to and change some things in the project........But no worries, the next checkpoint(sprint) is coming up and you'll get a band-aid, some water and be ready to go! This is what it's like developing software with Agile methodology.

       This may seem annoying, but remember that a lot of what is a part of Agile methodology is a project team continuously setting expectations, trying to adhere to them and adapt to obstacles that occur. Fixing issues when running into them and not waiting until the end of a project to realize a feature set won't work out or that you don't meet the required security specifications. In Software development there is always road bumps. Agile methodology helps to minimize the blow back by continuously addressing the problems and staying on top of them as they occur instead of letting it worsen and allowing a potential bug to be an integral part of the project that compromises most of what has been done. 
        Ultimately SCRUM allows for increased adaptive capability to change, expecting these changes, and more control of the direction of development. As well as increased quality in each release.  

Friday, July 3, 2015

First github project post !

https://github.com/MorrisLaw is where you can view my first github project commit. It's a client server application written in Java that I did in school last semester. It has some bugs because I have been making changes to the code. It's a work in progress.

The application has a client gui and a server gui. The client gui allows the user to sign in as themselves or as an anonymous user. The user can then click either yes or no and have the message sent to the server(which appears in the server gui). The server which will have a designated port number(either set by the user or left at default) is what receives the messages from the client. The server would then be started by hitting the start server button. To connect to the server the client gui has a field where the user can set the port number. The user would just need to match the port number to that of the server port number and then hit connect. The client can now send messages to the server. To disconnect the client the user would just have to select the disconnect button.

Eventually I'd like to create a web container for the application. I've been looking into Apache and such. I'll keep my blog updated on any progress regarding that.

Thursday, July 2, 2015

5 Things I Like About Python (So far..)

5 things I like about Python:


1. Spacing and Indentation

Coding blocks are defined by their spacing and indentation. And there are no semi-colons needed!

2. Dyamically-typed

Variable names are only bound to objects (whereas statically-typed languages make it so variable names are bound to both objects and types). In other words, dynamically-typed languages allow the programmer to bind the variable name to other objects of different types later on when needed.

3. Versatile

It can be used either as a scripting language (enterprise automation for example) or as an
object-oriented language (has a lot of features that support development of web applications).

4. Community

The community that supports Python is huge. There is a plethora of documentation, information and tutorials on Python. The internet is what makes it easy for me to get into the world of Python, and will make it easy for anyone else who's actively learning Python and is interested in it's progress as a community and/or a programming language.

5. Concise

As a computer science student who's gotten most of my programming experience in the object-oriented world of Java. In learning Python, it seems as if it's similar to Java, but minus all the extra stuff. In my opinion, it leads to very good looking code. As I delve more into Python I may do a side by side comparison post of the same algorithm or program in Java and then in Python. Just to illustrate the differences.

First Post

       This post will officially be my first blog post, ever. There are a few reasons why I've started this blog...

       One is to post problems and solutions to any programming related issues and other computer related problems; so that other people that may have the same issue can possibly stumble upon my solution and remedy their problem. Or at least apply the solution to a similar situation they're experiencing.

       Second reason is so that I have an outlet to just post anything regarding the development of software, random technologies and the many idiosyncrasies of different programming languages.

       Last but not least, is to allow for opportunities to discuss my passion (software development) with people who have the same passion as me; or that I can present material in my blog that will interest readers with the same passion.

Getting 60gb of Json Data into MySql

The other day I had write a 60gb Json file to a MySql database. The data was already clean and deduped, so all that had to be done was to wr...