Skip to content

Instantly share code, notes, and snippets.

@askingalot
askingalot / BangazonWorkforceChar.jsChallenge.md
Last active November 21, 2019 00:40
Bangazon Workforce Chart.js Challenge

Well-trained Employees

HR would like to know how much training each employee is taking by department. They would like a bar chart that displays each employee in a given department and shows the number of training program that employee is enrolled in. HR wants to see the total number of training programs. This includes both past and future programs.

The Challenge

  1. The responsibility for the HomeController is to populate the dropdown list.
  2. This new method should return a view that contains a dropdown to allow the user to select a department.
  3. When the user selects a department, javascript should run to fetch the employee training data from an API. (you will need to create the API controller).
@askingalot
askingalot / Workforce SQL Exercise.md
Last active November 7, 2019 15:23
Bangazon SQL Exercise

Write the appropriate SQL to answer the following questions

NOTE: Some of these questions will require googling and/or asking for help from your instructors.

  1. List each employee first name, last name and supervisor status along with their department name. Order by department name, then by employee last name, and finally by employee first name.
  2. List each department ordered by budget amount with the highest first.
  3. List each department name along with any employees (full name) in that department who are supervisors.
  4. List each department name along with a count of employees in each department.
  5. Write a single update statement to increase each department's budget by 20%.
  6. List the employee full names for employees who are not signed up for any training programs.

blatantly stolen adapted from https://gist.github.com/AdamSheaffer/ec09a8b8a1edabbfc4d2ca7f8719abd7

Classy Electronics

You've just started working for a boutique electronic company and you've been tasked with modeling their new line of record players.

Step 1:

The company's most basic product line is simple turntables that can support rpm speeds of 33, 45, and 78

@askingalot
askingalot / Top10Files.md
Created October 7, 2019 21:41
Top 10 Files - A C# Exercise

Top 10 Files

A C# Exercise

Phase 1

Create a console application that displays the top 10 most recently downloaded files in your Downloads directory.

TIP You may find these classes/methods helpful

@askingalot
askingalot / PlanYourHeist.md
Last active February 25, 2020 21:54
Plan Your Heist - A C# Exercise
@askingalot
askingalot / GuessTheNumber.md
Last active September 23, 2020 21:36
Guess The Number C# Exercise

Guess The Number

A C# Exercise

Write a console program in C# that invites the user to guess a number.

The program should be written in increments. Each "phase" will add a little more complexity.

Phase 1

Calculator Challenge

Part One

Build a console application that presents the user with the following menu:

Welcome to Calculatron 3000!
1) Add two numbers
2) Subtract two numbers
3) Multiply two numbers
@askingalot
askingalot / APIIntegrationTestSetup.md
Last active March 29, 2019 18:19
Steps to Setup Integration Testing for ASP.NET Core Web API

Steps

  1. Open your Web API solution in Visual Studio
  2. In the Solution Explorer, right-click the Solution to open a menu.
  3. Use the menu select Add / New Project to open the Add New Project dialog.
  4. On the left panel, click the Test node under Visual C#.
  5. In the center panel, click xUnit Test Project (.NET Core).
  6. Enter a name for your project in the Name textbox at the bottom of the form. (something like "<YOUR_WEB_API_PROJECT_NAME>.Tests", ex. StudentExercisesAPI.Tests)

Now we need to setup the new Test Project with a reference to your Web API project AND with the correct Nuget packages needed to perform Integration Tests. Visual Studio offers several different ways of adding these references, however, the simplest way is to edit the test project's .csproj file.

  1. In the Solution Explorer, right-click the Test Project and select Edit .csproj in the middle of the context menu.
@askingalot
askingalot / GetAllStudents.cs
Created March 21, 2019 19:44
Repository.GetAllStudents() Method
public List<Student> GetAllStudents()
{
using (SqlConnection conn = Connection)
{
conn.Open();
using (SqlCommand cmd = conn.CreateCommand())
{
cmd.CommandText = @"select s.id as StudentId,
s.FirstName,
s.LastName,
@askingalot
askingalot / gist:8247791
Last active January 2, 2016 03:59
...haven't come across Enhancement I or II
If Request.Form("OpImpactType") <> "0" Then
Select Case Request.Form("direction")
Case "2"
opdir= "Southbound traffic is affected with "
Case "3"
opdir = "Northbound traffic is affected with "
Case "4"
opdir = "Westbound traffic is affected with "
Case "5"
opdir = "Eastbound traffic is affected with "