Adding Widgets to WordPress

I wanted to flesh out the blog itself a little bit and experiment with WordPress. So, I decided to add some Widgets to the sidebar. These are configurable items that you can arrange alongside other WordPress content like menu and category links. They can be based on plug-ins or can be iFrames or just straight HTML so I’ve added a few examples. Once created, they can be arranged or reordered at will or shown/hidden based on certain conditions such as page or WordPress user properties.

ArrangeWidgets

First off, I wanted to brand the blog using the logo from Simple Programmer that I earned by completing the course that launched this blog in the first place. This is a simple hyperlink tag sourcing an image file as the element. To add this, I created a Text widget which allows you to add arbitrary text or html.

CreateText

spwidget

Next, I wanted to add a link back to the Github repository I created for a previous entry here. I accomplished this by installing a plug-in called WP Github from the WordPress marketplace. This allows you to add widgets for various GitHub categories such as repos, commits or issues. I’ve added the top level profile widget for now, but you can insert various other widgets specifically for repos or commit history.

wpgithub

Just for fun, I included a link to my Myers-Briggs personality type from 16 Personalities. This quiz and personality typing has been popular at some of the organizations and businesses I’ve worked with, some even going to far as to require employees to post them beside their nameplates. Adding this involved another Text widget. This one is a simple anchor tag referencing an image from the site and linking back to the 16 Personalities website.

Code:  <a href=”https://www.16personalities.com/intj-personality”><img src=”https://www.16personalities.com/images/types/intj.png”></a>

My last widget is a bit of personal accountability for me. I’ve struggled with weight for most of my life and have been tracking my weight and eating habits at Livestrong. This is a free service and they also provide a code snippet that points back to your progress on their website. This was accomplished by pasting in the code snippet into another Text widget.

lswidget

Pretty straightforward stuff, right? As always, if you have any questions or comments, please feel free to add them here or address them to john@benedettitech.com.

Thanks for looking in!

GameCareerGuide – Unity Platformer Tutorial

So, in keeping with the C# theme, I decided to take a stab at creating a small project in Unity and publishing it to Azure. To do this, I followed a tutorial provided by GameCareerGuide to create a simple platformer.

What is Unity? Unity is a popular game development platform that is free for individual developers contingent on revenue reaching a certain benchmark. (Currently $100K). You also have the option to buy a Pro subscription for $75 a month. I’m only at a stage where I’m tinkering around with the IDE and learning, so I’m not interested in paying for a sub if it’s not necessary.

unity

What is Game Career Guide?  GameCareerGuide is a site aimed at helping individuals who want to pursue a career in Game Development. There are various news items as well as links to resources and communities to help people launch or grow their careers. I came across the 2014 edition of their publication here and the tutorial I’m using begins on page 36.

gamecareer

Creating this was pretty straight forward. I had a copy of the 5.x version of Unity already installed and went through the steps in the tutorial creating various assets/objects to use in the game. One hurdle I ran into was needing to update the code as one of the base classes it relied on had been deprecated since the release of the guide. I was able to solve it using some simple cut & paste outlined in this article

deprecated

Next, I was having some issues committing the completed project to a Github repository. Something to do with how Github handles line breaks that can cause code corruption in some cases. Fortunately, updating the Github configuration for the new repo did the trick. I was able to use the Github CLI with the assistance of this article here to allow my code to commit. Even with the config change, my code built smoothly so I’m pretty sure there’s no risk.

After that, I created a new Web App node on my Azure account and used FileZilla to load my build via FTP. At first, the game was erroring out in both Firefox and IE so again I had to make a stop at the Googleverse. It seems that the site needed to provide a configuration item to allow the proprietary .unity3d file to download when you load the site. I was able to add the web.config file based on the following article

config

Finally, it was time to test out the game. Quite honestly, I’m a bit overly proud of taking these disparate platforms and making them work together. Plus it’s just neat to get something new to work, even if it’s trivial.

platformer

If you’re curious about the game, you can find it here . The controls are Left and Right Arrow and the spacebar and the object is to reach the yellow ‘exit’ square at which point the level resets. My son suggested that I might add some more levels and make it grow more difficult at each new level. Additionally, if you want to see the source code, you can find the repo on my Github account here.

If any of you are curious about or have used Unity or have any questions or comments, please feel free to add them here or address them to john@benedettitech.com.

Thanks for looking in!

My Experience @ Hack.summit() 2016

And now for something completely different….
 
HackSummitHome
 
I wanted to share some details about a vitural conference I attended this past week called hack.summit(). https://hacksummit.org/  This wholly online conference is in its second year and is a good resource for people who would like to attend a conference and take advantage of some Q&A and workshops with leaders in our field.  The cost for registration is mostly free, either a share on social media or a small donation
 
I attended the debut session of hack.summit() in 2014.   The format is a combination of talks, Q&As and short workshops.  One of the more memorable ones for me last year was an hour long session building a coffee shop locator from scratch in about an hour.  Link
 
Here’s a short summary of the sessions I attended this year:
 
Floyd Marinescu – CEO of InfoQ.com – This session consisted mainly about how to establish suitable cultures for virtual teams, meaning teams that aren’t necessarily bound to the same office but must collaborate on projects from separate physical locations.  There are suggestions around patterns and the myriad of tools that are available to virtual teams.  This was interesting as I’m already working on a virtual team covering at least four separate locations.  Additionally, there was mention of InfoQ and a recommendation to spend some time there to read up on current issues and have an opportunity to collaborate with others.
 
Kent Beck – Created Extreme Programming, created TDD, co-created Agile, authored 9 books – It’s ironic that this talk was the day before a half-day lunch and learn my team had on TDD and Dependency Injection.  TDD is not a new paradigm but understanding the need for unit tests and structuring your code so that it’s testable on a granular level is vital for long term supportability of your codebase, especially if you’ve got multiple individuals working in that code base and for any inheritors of your code.  I’m sure we’ve all inherited examples of stale (yet production) code with documentation with multiple birthdays and wish we had at least some insight as to why certain sections of code even exist.
 
Gregg Pollack – CEO, Codeschool – This was another ‘soft skills’ session presented by the CEO of Codeschool (recently acquired by Pluralsight) titled ‘ The Developers Path to Success and Winning’.  This was a general discussion of components that would help you build a successful career as a developer, including  how to seek out a mentor, attending meetups and conferences, knowing what’s important enough to demand your attention (being deliberate about your work and learning), how to seek out work to stretch yourself, etc.
 
Janet Weiner – Engineering at Facebook, big data expert – Open Data Challenges at Facebook – I’ll admit that the bulk of this talk was way over my head.  Overall, it was a case study on how data availability presents problems as it scales to unprecedented quantities, using Facebook’s architecture as an example.  While I’m not very familiar with ‘Big Data’ yet, it’s definitely on my radar as something to become familiar with in the near future.  This was a good example of a presentation showing me exactly how much I don’t know!
 
Mostly I enjoyed the ability to attend virtually and the ability to go back as needed to cover things I might have missed.  If you’d like to register and access the content, it’s not too late!   All you’ll need to is go through the registration process at the hack.summit() website and you’ll have access to all of the talks and reference materials.
 
If any of you is curious about (or may have attended) hack.summit() 2016 or have any questions or comments, please feel free to add them here or address them to john@benedettitech.com.
 
Thanks for looking in!

Creating a Github Repo

So, this week I created a Github account for Benedetti Tech. For those of you that are not familiar, Github is a web based repository for open source projects with tools for source control, issue tracking and collaboration with other open source developers.  It’s become popular enough that you might count on potential employers to look for any accounts associated with your name in order to evaluate you for work, whether you invite them to or not.  This isn’t to say that you MUST have an account to be taken seriously for employment, only that it’s another option and opportunity to grow and showcase your skills with others in the industry.  Full disclosure: I barely use my personal Github account and yet have somehow managed to remain gainfully employed.

As part of creating a new Github account, there’s an invitation to a simple ‘Hello World’ walkthrough located at https://guides.github.com/activities/hello-world/ This article will focus on a walkthrough of that guide.

HelloWorldHome

Step 1 is to create a new repository using your Github account.  Although reasonable people may differ as to what a repository should equate to, I use the term ‘single codebase’ to refer to a single repository.  A codebase can consist of multiple apps, integrations or services.  The idea here is to have a single logical grouping of code (and hopefully tests and documentation) with which to associate with a history of issues/stories and commit history. This can help users or inheritors of your code to gain insight into the history of an application that might prove helpful when trying to understand the intent of said codebase.

It’s a pretty simple step, from the Github console, click the + then New Repository link.

CreateRepo

Now that we have our newly minted repository, the next step is to create a branch.  Usually you’ll have a master or main line codebase that should be a representation of what’s in production.  Branches represent code in development may eventually make it into the production code.  Each branch will have its own history of commits and the capability to annotate them or roll them back as needed.

To create a branch, click on the branch dropdown.  A dialog will appear where you can type in a new branch name and then you can click Create.  Once you’ve created the branch, the console will automatically switch to your new branch as your current branch.

CreateBranch

Now that you have your new branch, it’s time to make some changes and commit them.  The way the Github orientation suggests doing this is by editing the Readme file via the console.  I’m going to take this outside the box a little bit and install Github Desktop.  This is a GUI console you can keep on your desktop with which to manage local copies of your repositories (that you will eventually be developing on locally).  The link to download is https://desktop.github.com/ and the app is available for Windows or Mac.  I’ll be installing the Windows version.

GithubDesktopHome

After I’ve installed Github Desktop, I can clone the repository I’ve just created by clicking the + sign and Clone.

CloneRepo

First, I’ll select a directory where the local clone will reside.  Then, I’ll open the Readme.md file and make some changes as the walkthrough suggests.

MakingEdits

After saving my changes, I’ll go back to Github Desktop and see if it’s detected my changes. And it has!  Now I’ll add a Summary to the changes (Always try to make these detailed!) and then commit the changes to the branch.

CommitChanges

The next step in the walkthrough is to create a Pull Request to merge the branch back into the master. You’ll have to excuse the additional merge commit as I initially made my changes to the Readme in the master instead of the branch. Let this be a lesson to always ensure you’re working in the correct branch!

PullRequest

After I’ve reviewed the commits, I’m ready to create the Pull Request itself.  Give it a title and some decent notes and then click the Create Pull Request button.

CreatePullRequest

Now that I’ve created the Pull Request, the request will need to be reviewed and either merged to master, or possibly denied and returned with comment.  Ideally, this should be done by someone who is reviewing the code and evaluating its possible benefit or impact to the codebase.  Think of it as an in-line code review. Either way, this process is at the heart of collaboration around these projects whether working with a team at the same business or hacking in your own free time.

MergePullRequestComments

Once it’s been reviewed, I’ll comment and click Merge Pull Request.  If there are no conflicts, you should get a confirmation message.  That’s it!  I’ve created my first repo and walked through the basic steps of branching, committing and merging.

MergeBranchComplete

I’m interested in hearing about your opinions and experiences with Github and I would invite you to follow my account there.  Additionally, I’d be happy to hear about what you’re working on and see if there are any opportunities for collaboration or even just sharing knowledge.  Please do feel free to follow Benedetti Tech on Github and invite me to do the same!

If any of you have suggestions around Github or have any other questions or comments, please feel free to add them here or address them to john@benedettitech.com.

Thanks for looking in!

Deploying a project to Azure

So, now that I’ve got all the Azure resources I need for the project, it’s time to actually deploy.  Again, following the instructions at Useful Development Blog, I’ll create the necessary objects in Visual Studio and then publish them to my Azure environment.

 
First, I’ll create the Web API project.  Since the article actually called for creating the resources inline with the project creation, I’ll actually skip the step where we create the Azure app itself.  Instead, I’ll just connect to the resources that are already there once the project is created.

CreateWebAPI

 
Second, I’ll install the Angular SPA package outlined in the article.  I am a complete Angular noob but am looking forward to tinkering with the framework as a lot of developers I know make great use of it.  Angular will install several dependencies such as jQuery.  Once this is installed, you can move on to the publishing step.

InstallAngular
Lastly, we’ll actually publish the newly created app ‘To The Cloud’.  You’ll go to the Publish dialog for your project and select Azure App Service to create a publishing profile.  I’ll look for the web app node previously created and ensure that it’s available for publishing.

PublishtoWebApp

WebAppValidation

 
Then I’ll add the connection criteria for the SQL database.  Please note, you will need to go into the Firewall settings for your Azure SQL Server and add your client IP in order to use SSMS or another tool to connect directly to the DB.  This includes the dialog for setting up the connection string for the app.  Once all your settings are in place, you can click Publish.

SQLConnection

PublishPreview

The publish may take a short while but once it’s complete, you can then navigate to the site and see the results.  If you’d like to take a look at mine, you can find it at http://jkbtestapp.azurewebsites.net/welcome

Finished

As you can see, once you get the hang of standing up the basic PaaS components, it’s very easy to deploy to an Azure environment. If any of you have suggestions around deploying to Azure or have any questions or comments, please feel free to add them here or address them to john@benedettitech.com.

Thanks for looking in!

How to Provision an Environment in Azure

It’s been a while since I’ve posted so I do apologize for the lag.  I’ve been doing some experimenting with Azure in my RL job and I’d like to share a couple of lessons learned with provisioning and deploying to Azure.

I was looking for an outline on simple deployments and found a quick walk-through at Useful Development Blog. Using this outline, I’m going to provision an environment and deploy a simple web app to Azure.

The prerequisites noted in the article are as follows:

* Visual Studio 2013 (Update 3+)
* The Azure SDK (you can get that here or use the Web Platform Installer)
* an account with Azure

I’m going to use the tools deployed previously to accomplish the same tasks. The only difference should be that I’m using Visual Studio 2015 Community rather than 2013.  Also, i’m going to provision my environment FIRST prior to deployment.  While you can automatically let Visual Studio create the necessary Azure nodes automatically in order to host your app, I feel that it will be necessary to know exactly what I’m provisioning and how much it will cost.

After reviewing the article, it looks like I’ll need a Web App node as well as a SQL database for the backend. In order to put all of this together, I’ll want to create the following resources:

* Azure Resource Group – This is a logical grouping of managed resources. It makes it easier to organize your nodes and identify which are related and dependent on each other. Also, in the event of any relevant notifications from Microsoft about impacts or changes to a region, you’ll want to know which one your resources are in.
* Azure Storage Group – This is a shared storage pool that can be used by any of your Azure nodes that require it.
* Azure Virtual Network – This isn’t truly required since we won’t be doing any network design or provisioning, but some of the nodes will require that one be set.
* SQL DB + DB Server – These will be PaaS (Platform as a Service) nodes to host my database.
* Web App – This will be another PaaS node to host the actual app.

I’ll begin by logging into the Azure portal and creating the Resource Group. You do this from your portal dashboard and clicking Resources Groups in the left sidebar then Add.  Choose an appropriate name, which subscription you want it to belong to, and where you want the Resource Group to be located.  The location may be relevant depending on where your customer base is for purposes of latency, etc.

RGCreation

Once the resource group is created, I’ll want to create a Storage Group. It can be more economical to use a shared storage group rather than many individual storage groups for each node. Additionally, you have more options for selecting the redundancy/fault tolerance of the storage as well as options for speed, etc.

To create the storage group, navigate to the Resource Group and click Add. A search window will pop-up where you can search for any of the myriad of nodes available in the Azure catalog. Select Storage Account and when prompted select Resource Manager for your deployment model and click Create.

CreateFromRG

StorageCreate

You’ll be prompted for the parameters to be used for your storage account. I will pick Locally Redundant and disable Diagnostics. Also, I’ll be selecting the Resource Group created in previous steps. When selecting your storage parameters, the amount listed for pricing is per month/100GB. You should only be charged for what you actually use so the cost should be pro-rated for the month.

StorageAccountParams

Next, I’ll create the Virtual Network. Follow the previous steps of navigating to your Resource Group and clicking Add. This time, type Network for your search criteria and select Virtual Network. As before, select the Resource Manager option and click Create.

For my parameters, I’ll be choosing an appropriate name and selecting my existing Resource Group and Location. Once this is selected, click Create.

NetworkParams

The next step, creating the SQL Server and DB, will be a bit more complicated but will follow the same basic pattern. As before, go to your Resource Group and click Add, then use SQL as your search criteria. The type of node you’ll select to create will be SQL Database. Once you’ve selected that option, click Create.

SQL DB Create

Inside of the SQL Database create panel, you’ll have an option to select your Server. Since we don’t have a server yet, our first step will be to create one. Click in the Server panel and then select Create a New Server. When creating a new server, you’ll choose an appropriate SQL Server name as well as creating your SA Account and password.  You’ll also select a location for the node.

SQL DB Params

SQL Server Params

Now that we have our Server, we can finish creating our DB. You can select an existing DB backup to map from or even use the sample Northwinds database. I’ll be selecting Blank DB for this example. There are a large number of pricing options to choose from for your DB performance and sizing options. Select the one that’s most appropriate for your app. Your subscription and Resource Group options should auto-populate. Once you’ve selected your options, click Create. The SQL DB creation takes a few minutes.

SQL DB Params 2

Lastly, we’ll need to provision a Web App node to host the actual app. Again, from your Resource Group, click Add and use Web App for your search criteria. Select the Web App option and click Create.

Web App Create

Once inside the creation dialog, you’ll choose an appropriate name for your app as well as confirm that your subscription info and Resource Group is correct. The last thing you’ll do is select a Service Plan. This is a configuration that can help you standardize your pricing and performance expectations for multiple apps. If you’re doing large scale or automated deployments, these can be useful to have for future tasks.

Under App Service Plan, click Create New.  Inside of the App Service plan creation panel, choose an appropriate name for the plan.  Under pricing options, you have various levels of availability and performance. Select the one most appropriate for you.  Again, rates are for the month and pro-rated for actual usage.  So, if you take your app down periodically or only need the services available at certain times, you can bring them down in the Azure portal and you should save that cost.

Web App Params

If you’ve completed all the above steps, then congratulations!  You’ve successfully provisioned your first Azure environment and are ready to deploy an app!

My next post will cover the creation of the project as well as the deployment steps.  If any of you have suggestions around provisioning in Azure or have any questions or comments, please feel free to add them here or address them to john@benedettitech.com.

Thanks for looking in!

Registering for an MSDN/Live Account and installing Visual Studio Community

In order to use my Azure trial, I’ll probably want a local copy of Visual Studio to build and publish content. In order to download Visual Studio Community (formerly Professional), I’ll need a Microsoft Live account eligible for the IDE. The good news is that in order to start my Azure account, I had to register a Microsoft Live account anyway. So, I’m halfway there.

Next step will be to log into Visual Studio with my live account: Link  Then click the Free Visual Studio option in the upper right and elect to join Visual Studio Dev Essentials.

VSDE

This brings up a page full of Microsoft tools. While I might have to come back to some of these later, right now I want to click the Download button under Visual Studio Community. This brings me to a download screen for the installer. Once that’s downloaded, I’ll run the setup.

DEHome

VSCdl

The setup wizard is pretty standard Microsoft boilerplate. Accept the defaults and next through. The wizard will install any dependencies your platform is missing, so you might be in for a bit of a wait and maybe a reboot or two. Once it’s finished, you’ll have the IDE installed and ready to go!

installwizard

Done

Another thing you’ll want for Azure is the Azure SDK. This has template for projects that are Azure specific as well as other useful plug-ins for Visual Studio. It can be installed at this link : Link  Select the SDK most appropriate to your installation. (VS 2015 for me)

SDKdl

One dependency that was required for my install was SQL Server Data Tools 2015.  This can be installed either by selecting custom options during your installation or by going back into the install wizard (Control Panel -> Programs & Features) and selecting the option.  As with all things, your mileage may vary depending on your environment.

SSDT

Once you have the IDE installed and are authenticated inside of Visual Studio, you will be able to publish content to Azure resources or nodes associated with your subscription.

If any of you have any questions or comments, please feel free to add them here or address them to john@benedettitech.com.

 
Thanks for looking in!