Less.js – CSS Pre-Processing to Make it Modern

Sep 13, 2014

IMG_0031.PNG

Less.js is a preprocessor extension for CSS written in JavaScript. It is used to make writing CSS more efficient and allows you to traverse multiple files more easily. Less accomplishes this by introducing many elements of conventional computer programming such as variables, mix-ins, nested rules, media query bubbling, operations, functions, and more. Essentially Less aims to bring CSS to the modern era and becomes an invaluable tool in a web development full stack. Less is, however, not for production and does best within the development environment. For deployment, it is wise to pre-compile code written using less. This will create lean, fast loading pages.

For beginners, Less does have a steep learning curve but the result is nothing short of magnificent when you are dealing with large, CSS rich pages. Once mastered, Less becomes easy to use with familiar programming paradigms.

An example for variable use:

@nice-blue: #5B83AD;
@light-blue: @nice-blue + #111;

#header {
color: @light-blue;
}

To get started you can visit LessCSS.org.



GNU GPL vs. Microsoft Excel 2013 EULA

Sep 8, 2014

Open and closed licenses are two ends of the licensing spectrum. Open licenses are intended to incite innovation by a community, fair use, and accessibility. Alternatively, closed licenses are intended to protect an intellectual property often to generate revenue and protect the identity of the product. In this investigation I use the GNU General Public License against Microsoft Excel 2013’s license. This investigation will compare and contrast differences between the two types of licenses in order to distinguish between open and closed licenses.

1. Who Can Use The Program

Microsoft licenses their software to individual buyers. This is used so that the Microsoft can maintain all rights to their software not explicitly stated in their license. This includes but isn’t limited to publishing, renting, leasing, or lending the software. The standard Microsoft Excel 2013 license purchase is solely intended for the purchaser. Even in the case of virtualization, each account is considered a separate computer. “To create one or more virtual computers on a single computer hardware system, each virtual computer, and the physical computer, is considered a separate computer for purposes of this agreement.” (A3)
In stark contrast, the GNU GPL gives access to anyone for personal use or distribution. This is unrestricted and even includes the sale of derivative works, executable, and source code. However, purchasers or users must be able to access the source code at no extra cost.

2. Warranty

Microsoft provides a limited retail warranty for it’s products which lasts one year from purchase and covers all issues that occur under proper instruction and normal use. This warranty gives the user support for the program in case of error.

The GNU GPL license provides no warranty whatsoever which means if the program encounters an error that impedes the users ability, there is no obligation from the creator to provide support of any kind.

3. Editing and Modifying

The editing of works under the Microsoft license is prohibited and source code is not accessible. This fully eliminated the ability to edit or modify unless the program is reverse engineered, which would be illegal under this license.
Under the GPL license, programs for personal use can be modified, altered, or added to. However, the programs can’t be redistributed without clearly marking the alteration in order to differentiate from the authors of previous versions.

Resources:
1. Microsoft Excel 2013 EULA
2. GNU GPL 3.0



Working with GitHub and Eclipse

Dec 2, 2013

An existing version of Eclipse exists that integrates GitHub and Eclipse together called EGit. This is a version of eclipse that easily integrates common git commands into the Eclipse development environment.

However for the sake of education in using GitHub there is a simple method of using GitHub with Eclipse and still using the console and GitHub application to use all git-related commands.

To effectively synchronize you will need to include the entire project file on your commit/push to origin and continue to push the entire project every time. This allows you to Import the project in Eclipse as “an existing project.” At this point, any merges or pulls can be done with the files closed, then in Eclipse press refresh or f5 to refresh the files within the project view. Any files will be updated to reflect what has been updated inside the project folder and your file structure in Eclipse will be up to date allowing you to start building on the code.

 

Summary: Importing your eclipse project from the github folder, then using F5 within eclipse to update the changed files within the GitHub folder will keep you up to date and let you easily code within the Eclipse IDE without needing EGit and educating yourself with how GitHub works rather than using a streamlined IDE.



Solving ASP.NET MVC4 Web Api Help Page Conflict

Nov 20, 2013

Problem:

Installing the latest version of “Web Api Help Page” to existing projects with Visual Studio 2012 with ASP.NET MVC4 can cause a version conflict like the one below in some cases.

Using the installation:

PM> Install-Package Microsoft.AspNet.WebApi.HelpPage

Gives the error upon running without debugging:

[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Users\Jordan Theriault\AppData\Local\Temp\Temporary ASP.NET Files\root\75e9b6ba\795e5734\assembly\dl3\d19f7671\00f61fd3_37e6ce01\System.Web.WebPages.Razor.dll'.

Solution:

Instead use the command

PM> Install-Package Microsoft.AspNet.WebApi.HelpPage -Version 4.0.0"

This will install the Help Page, but now it needs to be initialized.

  1. In Solution Explorer, go to:  Areas -> HelpPage -> App_Start -> HelpPageConfig.cs
  2. Uncomment “config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath(“~/App_Data/XmlDocument.xml”)));”
  3. In Solution Explorer, right click on your project name at the top and click “Properties”
  4. Click on the “Build” section on the left (Alt+Enter)
  5. Under the “Output” header, select the checkbox for “XML Documentation File”
  6. Copy “App_Data/XmlDocument.xml” into the textbox
  7. Save all files and build solution

Conclusion:

You should now have a fully operational help page, accessed by appending /help to the existing uri (ex. http://localhost:50447/help). The downside is that this page does not have a link on the home page nor formatting. This can be fixed by changing the Razor views.