Aneesh Garg
Portfolio:
This is my project for MIT App Inventor. For this project, my partner and I decided
to create a password generator that would randomly generate a password using numbers, letters,
and special characters (such as @,#, and &.)
In this project we used Scratch to program a diver to avoid obstacles such as a falling rock. You can move him using arrow keys.
This is the interactive fiction game we made using Python.
In this project, I programmed a Blackjack game, where the objective is to get to 21 points.
For this project, we manipulated a picture of a dog to change its color. The photo on the bottom right is the original, and the photos around it are modififed.
This is the code:
This is the pie chart project we programmed in python. We used 2019 US non-military spending for the data in this project, data credited to the Center on Budget and Policy Priorities. We chose this data to see where the US budget, excluding the military budget, went. We decided to exclude the military budget because it would make the other portions of the budget hard to read, due to the large majority of the budget it is. We chose a pie chart because it shows good proportions, which is useful in visualizing majorities. This representation where the majority of the US budget goes, by showing the larger slice.
The code:
For this project, we used NetLogo to modify a simulation about birth rates. We began by changing the icons of the two populations so that they represented turtles. Additionally, we modified the size of the screen displaying the growth of each population. The most important modification we made, however, was to the starting values of each population, so that one had a greater population than the other. By adjusting the fertility of each population, we learned that if the species with a lower initial population had a higher fertilty, even if it was only by 0.1, it would always survive the longest.
This is the original simulation model.
This is the modified simulation model:


Chocolate Pizza
PRINTPOSTED ON 15 DEC 2013 / DESSERTS
For the fig-swirl: Melt butterover medium heat in a saucepan. Add brown sugar and stir to dissolve. Halve all of the digs and toss in the saucepan with water and lemon juice. Cook over medium heat, stirring frequently, until you have a chunky-jammy mixture. Add salt with one or two stirs, set aside and let cool completely.
Ice cream: In a small pot over medium heat, combine milk, and granulated sugar until sugar is completely dissolved and the milk is just barely lukewarm. Whisk in the egg yolks. Set mixture in the fridge and wait until the dig mixture is cooled.
Using an ice cream machine, pour liquids into the frozen basin and process according to manufacturer instructions, i.e., let spin and thicken for 20 minutes before adding mascarpone, fig jam mixture, and the nuts. Continue to process for +/- 10 minutes. Pour semi-frozen mixture into a pyrex dish or glass tupperware. Freeze for at least two hours before serving.
| 1/2 cups milk | 1/2 cups heavy cream |
| 1/2 cup cascarpone | 1/3 grandulated sugar |
| 1/2 tsp pink salt | 2 egg yolks |
| 1 lb Black Mission Figs | 1 lemon, juiced |
| 1/2 cup brown sugar | 2 tbsp butter |
| 2-4 tbsp water | 1 cup honey roasted pecans, roughly chopped |


public class IBMMonitor extends AbstractMonitor
| Modifier and Type | Field and Description |
|---|---|
private java.util.HashSet<java.lang.Long> |
assigned |
private java.util.HashSet<java.lang.Long> |
dispatched |
private java.lang.String |
monitorEndpoint |
private java.lang.String |
monitorHost |
private java.lang.Integer |
monitorPort |
private java.lang.Integer |
monitorResponseTimeout |
private java.util.concurrent.ScheduledExecutorService |
periodic |
private static java.lang.Long |
STATISTICS_UPDATE_INTERVAL |
private MonitorStatistics |
stats |
| Constructor and Description |
|---|
IBMMonitor() |
| Modifier and Type | Method and Description |
|---|---|
MonitorStatistics |
getStats()
Retrieve the associated MonitorStatistics object for this Monitor
|
protected void |
handleAlarmAssessmentSet(Event e) |
protected void |
handleAlarmAssigned(Event e)
Invoked by ALARM_OPEN_EXPIRED events triggered by the EMHT system on assignment
|
protected void |
handleAlarmClosed(Event e)
Invoked by ALARM_OPEN_EXPIRED events triggered by the EMHT system on closing of alarms
|
protected void |
handleAlarmDelete(Event e) |
protected void |
handleAlarmDispatched(Event e)
Invoked by ALARM_OPEN_EXPIRED events triggered by the EMHT system on dispatching of alarms
|
protected void |
handleAlarmExternalFollowupNotify(Event e) |
protected void |
handleAlarmFieldAssessmentSet(Event e) |
protected void |
handleAlarmFinished(Event e)
Invoked by ALARM_OPEN_EXPIRED events triggered by the EMHT system on notifications from field operators
that the alarm has been finished and is ready for closing or further dispatching.
|
protected void |
handleAlarmLocationVerified(Event e) |
protected void |
handleAlarmNew(Event e)
Invoked by ALARM_OPEN_EXPIRED events triggered by the EMHT system on new alarm arrivals
|
protected void |
handleAlarmOpenExpired(Event e)
Invoked by ALARM_OPEN_EXPIRED events triggered by the IBMController
|
protected void |
handleAlarmPatientSet(Event e) |
protected void |
handleAlarmResolutionExpired(Event e)
Invoked by ALARM_RESOLUTION_EXPIRED events triggered by the IBMController
|
protected void |
handlePatientNew(Event e) |
protected void |
handleSystemShutdown(Event e) |
private com.fasterxml.jackson.databind.node.ObjectNode |
preparePayload(Alarm a)
Helper that creates a JSON Object node and fills in the required values needed by the IBM monitor.
|
private play.libs.F.Promise<play.libs.WS.Response> |
reportEvent(com.fasterxml.jackson.databind.node.ObjectNode message)
Sends a JSON encoded message to the IBM monitor reporting endpoint
|
static java.lang.String |
toIBMDateTimeFormat(java.util.Date d)
Helper that transforms a Date object into a String literal of the format required by the
IBM Monitor report endpoint
|
listenFor, newEvent
private static final java.lang.Long STATISTICS_UPDATE_INTERVAL
private MonitorStatistics stats
private java.util.HashSet<java.lang.Long> assigned
private java.util.HashSet<java.lang.Long> dispatched
private java.lang.String monitorHost
private java.lang.Integer monitorPort
private java.lang.String monitorEndpoint
private java.lang.Integer monitorResponseTimeout
private java.util.concurrent.ScheduledExecutorService periodic
private play.libs.F.Promise<play.libs.WS.Response> reportEvent(com.fasterxml.jackson.databind.node.ObjectNode message)
message
- A JSON ObjectNode containing the message and data to be sentprivate com.fasterxml.jackson.databind.node.ObjectNode preparePayload(Alarm a)
a
- The Alarm object to reportpublic static java.lang.String toIBMDateTimeFormat(java.util.Date d)
d
- A Date instancepublic MonitorStatistics getStats()
getStats
in class AbstractMonitor
protected void handleAlarmAssessmentSet(Event e)
handleAlarmAssessmentSet
in class AbstractMonitor
protected void handleAlarmAssigned(Event e)
handleAlarmAssigned
in class AbstractMonitor
e
- An Event object containing relevant data for this event typeprotected void handleAlarmNew(Event e)
handleAlarmNew
in class AbstractMonitor
e
- An Event object containing relevant data for this event typeprotected void handleAlarmDelete(Event e)
handleAlarmDelete
in class AbstractMonitor
protected void handleAlarmLocationVerified(Event e)
handleAlarmLocationVerified
in class AbstractMonitor
protected void handleAlarmPatientSet(Event e)
handleAlarmPatientSet
in class AbstractMonitor
protected void handleAlarmFieldAssessmentSet(Event e)
handleAlarmFieldAssessmentSet
in class AbstractMonitor
protected void handleAlarmExternalFollowupNotify(Event e)
handleAlarmExternalFollowupNotify
in class AbstractMonitor
protected void handleAlarmOpenExpired(Event e)
handleAlarmOpenExpired
in class AbstractMonitor
e
- An Event object containing relevant data for this event typeprotected void handleAlarmResolutionExpired(Event e)
handleAlarmResolutionExpired
in class AbstractMonitor
e
- An Event object containing relevant data for this event typeprotected void handleAlarmClosed(Event e)
handleAlarmClosed
in class AbstractMonitor
e
- An Event object containing relevant data for this event typeprotected void handleAlarmDispatched(Event e)
handleAlarmDispatched
in class AbstractMonitor
e
- An Event object containing relevant data for this event typeprotected void handleAlarmFinished(Event e)
handleAlarmFinished
in class AbstractMonitor
e
- An Event object containing relevant data for this event typeprotected void handlePatientNew(Event e)
handlePatientNew
in class AbstractMonitor
protected void handleSystemShutdown(Event e)
handleSystemShutdown
in class AbstractMonitor


{{member.id}}
| First Name | {{member.fullname}} |
|---|---|
| Partner Name | {{member.partner}} |
| Package | {{member.package}} |
| Account Number | {{member.accountnumber}} |
| Community | {{member.community}} |
| Contribution | {{member.contribution}} |
| Category | {{member.categoryId}} |
| Date Joined | {{member.created | date : 'dd/MM/yyyy'}} |
| Mobile / Phone | {{member.phone}} |
| Date Of Birth | {{member.birthday | date : 'dd/MM/yyyy'}} |
| Gender | {{member.gender}} |
| Status | {{member.status}} |
| Nationality | {{member.nationality}} |


Class SteerAlgorithm contains the methods of the Steering Algorithm.
More...
#include <SteerAlgorithm.hpp>
|
|
| SteerAlgorithm () |
| | Constructor of class SteerAlgorithm.
|
| |
|
| ~SteerAlgorithm () |
| | Destructor of class SteerAlgorithm.
|
| |
| double | getCorrRadius_ () |
| | Function to get corresponding radius in meters. More...
|
| |
| bool | setCorrRadius_ (double r) |
| | Function to set corresponding radius in meters. More...
|
| |
| double | arcLength (double diffAngle, double corrRadius) |
| | Function to calculate the length of arc in meters to be traced in order to head in target direction. More...
|
| |
| double | changeWheelAngles (double corrRadius, double shaftLength, double shaftDistance) |
| | Function to calculate the angles in degrees for left and right wheels as per ackermann model, and then feed them to corresponding servos. More...
|
| |
| bool | resetWheel () |
| | Function to set wheel angles to 0. More...
|
| |
| double | turnTime (double arclength, double newVelocity) |
| | Function to calculate time in seconds required to turn or keep wheels at the an angle. More...
|
| |
|
|
const double | shaftLength = 4 |
| |
|
const double | shaftDistance = 8 |
| |
|
const double | maxTurnVelocity = 20 |
| |
|
double | heading |
| |
|
double | targetHeading |
| |
|
int | dir |
| |
Class SteerAlgorithm contains the methods of the Steering Algorithm.
| double SteerAlgorithm::arcLength |
( |
double |
diffAngle, |
|
|
double |
corrRadius |
|
) |
| |
Function to calculate the length of arc in meters to be traced in order to head in target direction.
- Parameters
-
| double | diffAngle, difference in current and target heading |
| double | corrRadius, corresponding radius |
- Returns
- double arclength
| double SteerAlgorithm::changeWheelAngles |
( |
double |
corrRadius, |
|
|
double |
shaftLength, |
|
|
double |
shaftDistance |
|
) |
| |
Function to calculate the angles in degrees for left and right wheels as per ackermann model, and then feed them to corresponding servos.
- Parameters
-
| double | corrRadius, corresponding radius |
| double | shaftLength, length between wheels |
| double | shafDistance, distance between rear and front shaft |
- Returns
- double maxWheelAngle
| double SteerAlgorithm::getCorrRadius_ |
( |
| ) |
|
Function to get corresponding radius in meters.
- Parameters
-
- Returns
- double corresponding radius
| bool SteerAlgorithm::resetWheel |
( |
| ) |
|
Function to set wheel angles to 0.
- Parameters
-
- Returns
- bool true
| bool SteerAlgorithm::setCorrRadius_ |
( |
double |
r | ) |
|
Function to set corresponding radius in meters.
- Parameters
-
- Returns
- bool true
| double SteerAlgorithm::turnTime |
( |
double |
arclength, |
|
|
double |
newVelocity |
|
) |
| |
Function to calculate time in seconds required to turn or keep wheels at the an angle.
- Parameters
-
| double | arcLength, length of arc to be traced |
| double | newVelocity, velocity |
- Returns
- double time
The documentation for this class was generated from the following files:


|
RandomLib
|
Class to hold bit-width and unsigned type. More...
#include <RandomLib/RandomType.hpp>
Public Types | |
| typedef UIntType | type |
Static Public Member Functions | |
| template<typename IntType > | |
| static type | cast (IntType x) throw () |
| static void | Read32 (std::istream &is, bool bin, type &x) |
| static void | Write32 (std::ostream &os, bool bin, int &cnt, type x) |
| static void | CheckSum (type n, uint32_t &check) throw () |
Static Public Attributes | |
| static const unsigned | width = bits |
| static const type | mask |
| static const type | min = type(0) |
| static const type | max = mask |
Class to hold bit-width and unsigned type.
This provides a simple class to couple a bit-width and an unsigned type capable of holding all the bits. In addition is offers static methods for I/O and checksumming.
| bits | the number of significant bits. |
| UIntType | the C++ unsigned integer type capable of holding the bits. |
Definition at line 33 of file RandomType.hpp.
| typedef UIntType RandomLib::RandomType< bits, UIntType >::type |
The unsigned C++ type
Definition at line 38 of file RandomType.hpp.
| static type RandomLib::RandomType< bits, UIntType >::cast | ( | IntType | x | ) | throw () [inline, static] |
A combined masking and casting operation
| IntType | the integer type of the x. |
| [in] | x | the input integer. |
Definition at line 63 of file RandomType.hpp.
| void RandomLib::Random_u64::Read32 | ( | std::istream & | is, |
| bool | bin, | ||
| Random_u32::type & | x | ||
| ) | [static] |
Read a data value from a stream of 32-bit quantities (binary or text)
| [in,out] | is | the input stream. |
| [in] | bin | true if the stream is binary. |
| [out] | x | the data value read from the stream. |
Definition at line 123 of file Random.cpp.
| void RandomLib::Random_u64::Write32 | ( | std::ostream & | os, |
| bool | bin, | ||
| int & | cnt, | ||
| Random_u32::type | x | ||
| ) | [static] |
Write the data value to a stream of 32-bit quantities (binary or text)
| [in,out] | os | the output stream. |
| [in] | bin | true if the stream is binary. |
| [in,out] | cnt | controls the use of spaces and newlines for text output. |
| [in] | x | the data value to be written to the stream. |
cnt should be zero on the first invocation of a series of writes. This function increments it by one on each call.
Definition at line 97 of file Random.cpp.
| static void RandomLib::RandomType< bits, UIntType >::CheckSum | ( | type | n, |
| uint32_t & | check | ||
| ) | throw () [static] |
Accumulate a checksum of a integer into a 32-bit check. This implements a very simple checksum and is intended to avoid accidental corruption only.
| [in] | n | the number to be included in the checksum. |
| [in,out] | check | the running checksum. |
const unsigned RandomLib::RandomType< bits, UIntType >::width = bits [static] |
The number of significant bits
Definition at line 42 of file RandomType.hpp.
const type RandomLib::RandomType< bits, UIntType >::mask [static] |
A mask for the significant bits.
Definition at line 46 of file RandomType.hpp.
Referenced by RandomLib::RandomCanonical< Generator >::Integer(), and RandomLib::RandomCanonical< Generator >::IntegerC().
const type RandomLib::RandomType< bits, UIntType >::min = type(0) [static] |
The minimum representable value
Definition at line 51 of file RandomType.hpp.
const type RandomLib::RandomType< bits, UIntType >::max = mask [static] |
The maximum representable value
Definition at line 55 of file RandomType.hpp.


When using Width, if the alloted width is greater than device window width; The browser then adds a horizontal scrollbar to the page. Using max-width instead, in this situation, will improve the browser's handling of small windows. This is important when making a site usable on small devices
Hello


Welcome to v2
Getting Started
Add the following to your
:

<link rel="stylesheet" href="https://cdn.byu.edu/byu-theme-components/experimental/v2/byu-theme-components.min.css" media="all">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Then, add this to your page where you want the header to appear:
<byu-header>

Your Site Title Here

</byu-header>
And this where you want the footer:
<byu-footer></byu-footer>
Footer
We strongly recommend adding some code to make the footer "stick" to the bottom of the window even when there is little or no page content. A discussion of how to do this can be found on the footer docs page.
Additionaly, because the site footer is white, we suggest making the body
of your application
#FAFAFA
. You can use the following CSS to do that:
html, body {
background: #FAFAFA
}


Overview
Components and options for laying out your Bootstrap project, including wrapping containers, a powerful grid system, and responsive utility classes.
Containers
Containers are the most basic layout element in Bootstrap and are required when using our default grid system. Containers are used to contain, pad, and (sometimes) center the content within them. While containers can be nested, most layouts do not require a nested container.
Bootstrap comes with three different containers:
.container
, which sets amax-width
at each responsive breakpoint.container-fluid
, which iswidth: 100%
at all breakpoints.container-{breakpoint}
, which iswidth: 100%
until the specified breakpoint
The table below illustrates how each container's max-width
compares to the original .container
and .container-fluid
across each breakpoint.
See them in action and compare them in our Grid example.
|
Extra small <576px |
Small ≥576px |
Medium ≥768px |
Large ≥992px |
Extra large ≥1200px |
|
|---|---|---|---|---|---|
.container |
100% | 540px | 720px | 960px | 1140px |
.container-sm |
100% | 540px | 720px | 960px | 1140px |
.container-md |
100% | 100% | 720px | 960px | 1140px |
.container-lg |
100% | 100% | 100% | 960px | 1140px |
.container-xl |
100% | 100% | 100% | 100% | 1140px |
.container-fluid |
100% | 100% | 100% | 100% | 100% |
All-in-one
Our default .container
class is a responsive, fixed-width container, meaning its max-width
changes at each breakpoint.

Fluid
Use .container-fluid
for a full width container, spanning the entire width of the viewport.

...

Responsive
Responsive containers are new in Bootstrap v4.4. They allow you to specify a class that is 100% wide until the specified breakpoint is reached, after which we apply max-width
s for each of the higher breakpoints. For example, .container-sm
is 100% wide to start until the sm
breakpoint is reached, where it will scale up with md
, lg
, and xl
.

100% wide until small breakpoint

100% wide until medium breakpoint

100% wide until large breakpoint

100% wide until extra large breakpoint

Responsive breakpoints
Since Bootstrap is developed to be mobile first, we use a handful of media queries to create sensible breakpoints for our layouts and interfaces. These breakpoints are mostly based on minimum viewport widths and allow us to scale up elements as the viewport changes.
Bootstrap primarily uses the following media query ranges—or breakpoints—in our source Sass files for our layout, grid system, and components.
// Extra small devices (portrait phones, less than 576px)
// No media query for `xs` since this is the default in Bootstrap
// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) { ... }
// Medium devices (tablets, 768px and up)
@media (min-width: 768px) { ... }
// Large devices (desktops, 992px and up)
@media (min-width: 992px) { ... }
// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
Since we write our source CSS in Sass, all our media queries are available via Sass mixins:
// No media query necessary for xs breakpoint as it's effectively `@media (min-width: 0) { ... }`
@include media-breakpoint-up(sm) { ... }
@include media-breakpoint-up(md) { ... }
@include media-breakpoint-up(lg) { ... }
@include media-breakpoint-up(xl) { ... }
// Example: Hide starting at `min-width: 0`, and then show at the `sm` breakpoint
.custom-class {
display: none;
}
@include media-breakpoint-up(sm) {
.custom-class {
display: block;
}
}
We occasionally use media queries that go in the other direction (the given screen size or smaller):
// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) { ... }
// Small devices (landscape phones, less than 768px)
@media (max-width: 767.98px) { ... }
// Medium devices (tablets, less than 992px)
@media (max-width: 991.98px) { ... }
// Large devices (desktops, less than 1200px)
@media (max-width: 1199.98px) { ... }
// Extra large devices (large desktops)
// No media query since the extra-large breakpoint has no upper bound on its width
min-
and max-
prefixes and viewports with fractional widths (which can occur under certain conditions on high-dpi devices, for instance) by using values with higher precision for these comparisons.
Once again, these media queries are also available via Sass mixins:
@include media-breakpoint-down(xs) { ... }
@include media-breakpoint-down(sm) { ... }
@include media-breakpoint-down(md) { ... }
@include media-breakpoint-down(lg) { ... }
// No media query necessary for xl breakpoint as it has no upper bound on its width
// Example: Style from medium breakpoint and down
@include media-breakpoint-down(md) {
.custom-class {
display: block;
}
}
There are also media queries and mixins for targeting a single segment of screen sizes using the minimum and maximum breakpoint widths.
// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) { ... }
// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) and (max-width: 767.98px) { ... }
// Medium devices (tablets, 768px and up)
@media (min-width: 768px) and (max-width: 991.98px) { ... }
// Large devices (desktops, 992px and up)
@media (min-width: 992px) and (max-width: 1199.98px) { ... }
// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
These media queries are also available via Sass mixins:
@include media-breakpoint-only(xs) { ... }
@include media-breakpoint-only(sm) { ... }
@include media-breakpoint-only(md) { ... }
@include media-breakpoint-only(lg) { ... }
@include media-breakpoint-only(xl) { ... }
Similarly, media queries may span multiple breakpoint widths:
// Example
// Apply styles starting from medium devices and up to extra large devices
@media (min-width: 768px) and (max-width: 1199.98px) { ... }
The Sass mixin for targeting the same screen size range would be:
@include media-breakpoint-between(md, xl) { ... }
Z-index
Several Bootstrap components utilize z-index
, the CSS property that helps control layout by providing a third axis to arrange content. We utilize a default z-index scale in Bootstrap that's been designed to properly layer navigation, tooltips and popovers, modals, and more.
These higher values start at an arbitrary number, high and specific enough to ideally avoid conflicts. We need a standard set of these across our layered components—tooltips, popovers, navbars, dropdowns, modals—so we can be reasonably consistent in the behaviors. There's no reason we couldn't have used 100
+ or 500
+.
We don't encourage customization of these individual values; should you change one, you likely need to change them all.
$zindex-dropdown: 1000 !default;
$zindex-sticky: 1020 !default;
$zindex-fixed: 1030 !default;
$zindex-modal-backdrop: 1040 !default;
$zindex-modal: 1050 !default;
$zindex-popover: 1060 !default;
$zindex-tooltip: 1070 !default;
To handle overlapping borders within components (e.g., buttons and inputs in input groups), we use low single digit z-index
values of 1
, 2
, and 3
for default, hover, and active states. On hover/focus/active, we bring a particular element to the forefront with a higher z-index
value to show their border over the sibling elements.


Entity Framework Code First Migrations
Migrations (EF 4.3+)
You need to use NuGet's Package Manager Console. Get used to lots of typos.
- Install-Package EntityFramework
- Enable-Migrations [-EnableAutomaticMigrations]
Generates Migrations/Configuration.
If the database was created by EF CF (there's a __MigrationHistory table) you'll get an InitialCreate migration- -ProjectName MyProjectWithContext : You may need to set the project name, or you'll get "No classes deriving from DbContext found" and migrations in the wrong project.
- -ContextTypeName MyContext : If you have more than one context in a project
- Add-Migration name : adds a migration (if automatic migrations, scaffolds it)
If you have errorUnable to generate an explicit migration because the following explicit migrations are pending: [201202100921137_Initial]. Apply the pending explicit migrations before attempting to generate a new explicit migration.
:
- -ProjectName MyProjectWithContext : as above
- -StartUpProjectName:ProjectWithConfig : where the config file is. A UI, console or test project.
- -IgnoreChanges : from <IP_ADDRESS>, generate an empty migration. Useful for a existing database.
- -Context: Specify a content if multi-context
- EF <7: Update-Database : runs a migration
- -Verbose : show Sql
- -TargetMigration:"migrationName" -Force : migrate to named migration
- -Script : script from last migration
- -Script -SourceMigration:$InitialDatabase -TargetMigration:name script from/to.
Use this to generate a script over a number of migrations ("all migrations for version 2") - Update-Database -TargetMigration:$InitialDatabase (or 0) rolls back to the start.
- EF 7+: Apply-Migration
- For scripts, instead use Script-Migration
Migrations via Database.SetInitializer
This generated Migrations.Configuration class is internal sealed- if you have a Database.SetInitializer with a outside the data project, you can change it to public. You don't need to do it if you configure in the app.config.
The MigrateDatabaseToLatestVersion initializer requires the DbContext and Configuration.
Database.SetInitializer(new MigrateDatabaseToLatestVersion<NorthwindContext, Migrations.Configuration>());
You can also configure the initializer in the app.config. (MSDN)
<entityFramework>
<contexts>
<!--<context type="Data.Context.MyContext, Data" disableDatabaseInitialization="true" />-->
<context type="Data.Context.MyContext, Data" disableDatabaseInitialization="false">
<databaseInitializer type="System.Data.Entity.MigrateDatabaseToLatestVersion`2[[Data.Context.MyContext, Data], [Data.Migrations.Configuration, Data]], EntityFramework" />
</context>
</contexts>
</entityFramework>
Automatic Migrations
Once you have an initial migration, it tracks all changes so there are no further explicit migrations. Unless you have an existing database- you'll need to add-migration Initial -IgnoreChanges and update-migration to get the __migrationHistory table initialized. See below!
If you delete columns (=dropping a column) it throws an AutomaticDataLossException. You can suppress this in configuration (but consider it carefully...).
public Configuration()
{
AutomaticMigrationsEnabled = true;
//if you drop columns - consider this carefully...
AutomaticMigrationDataLossAllowed = true;
}
Migration Code
You can't refer to the actual entities (you must follow the naming conventions or map manually). The overuse of lambda expressions is awkward, but you can do lower-level things like naming foreign key constraints and add indexes.
Extensibility is limited. You cannot define new MigrationOperations (DbMigration.AddOperation is private), only anonymous arguments to the existing builder methods.
public override void Up()
{
CreateTable(
"Products",
cb => new
{
Id = cb.Int(nullable: false, identity: true),
ProductName = cb.String(nullable: false, maxLength: 20),
CategoryId = cb.Int(nullable: true)
})
.PrimaryKey(t => t.Id)
.ForeignKey("Categories",
t => t.CategoryId,
name: "FK_Products_Category");
}
Migrations in Code
To run an update in code, use a DbMigrator.
public void RunUpdate(string connectionName)
{
var configuration = new Configuration();
//will use app.config/connectionStrings/add[@name=connectionName]
configuration.TargetDatabase =
new System.Data.Entity.Infrastructure.DbConnectionInfo(connectionName);
var migrator = new DbMigrator(configuration);
migrator.Update();
}
Note that DbMigrator exposes three methods:
- GetLocalMigrations() -reflects what's in the Migrations folder
- GetDatabaseMigrations() - reads what's in the database (__MigrationHistory).
NB: check where it's looking- it may be looking for .\SQLEXPRESS\Mynamespace.MyContext
In the console you may have to set StartUpProjectName; in code set the TargetDatabase - GetPendingMigrations() - the difference between what's in Local but not in Database
It won't let you AddMigration if there are pending migrations ("Apply the pending explicit migrations" error quoted above).
You can control the migration SQL generation. The hook is in Migrations.Configuration:
internal sealed class Configuration : DbMigrationsConfiguration<EntitiesContext>
{
public Configuration()
{
AutomaticMigrationsEnabled = false;
SetSqlGenerator("System.Data.SqlClient", new CustomizedSqlGenerator());
}
The customized SQL generator must derive from MigrationSqlGenerator (or the SqlServer version SqlServerMigrationSqlGenerator) and then override the Generate methods.
Scripting
You can take control of the scripts as long as you use insert the __MigrationHistory row. In the console use Update-Database -Script or script as follows:
public string WriteCreateDatabaseScript(DbContext context)
{
var objectContext = ((System.Data.Entity.Infrastructure.IObjectContextAdapter)context).ObjectContext;
return objectContext.CreateDatabaseScript();
}
public string WriteMigrationScript()
{
var configuration = new Configuration();
var migrator = new DbMigrator(configuration);
var scriptor =
new System.Data.Entity.Migrations.Infrastructure.MigratorScriptingDecorator(migrator);
//source, target migration names
string script = scriptor.ScriptUpdate(null, null);
return script;
}
Code First for an existing database
DbMigrator presumes it has control of the database. Since EF 6.1, you can have multiple contexts per database with the migration ContextKey (you cannot have overlapping tables - it's not true multi-tenant).
- Make sure the OnModelCreating mappings are all correct. Or generate it by using DatabaseSchemaReader's CodeGen
- Enable migrations, create an initial migration and get the script:
PM> Enable-Migrations
Code First Migrations enabled for project Northwind.
PM> Add-Migration Initial -IgnoreChanges
Scaffolding migration 'Initial'.
The Designer Code for this migration file includes a snapshot of your current Code First model. This snapshot is used to calculate the changes to your model when you scaffold the next migration. If you make additional changes to your model that you want to include in this migration, then you can re-scaffold it by running 'Add-Migration<PHONE_NUMBER>21137_Initial' again.
PM> Update-Database
Applying explicit migrations: [201202100921137_Initial].
Applying explicit migration:<PHONE_NUMBER>21137_Initial.
To port this to a remote database, use Update-Database -Script which should just contain the __MigrationHistory DDL and INSERT. From here on, Code First thinks it owns the database.
The script may fail: "Conversion failed when converting date and/or time from character string". This is because the migrationHistory insert is in the form '2012-03-03T15:07:35.431Z' and the database is set to compatibility with SqlServer 2000. You have to fix the databse: in SqlServer Management Studio, right click database, Properties-Options-Compatibility Level set to SqlServer 2005 (90) or above.


jQuery Popup Window Plugin
Examples
Open window (with defaults)
Open window (custom size: 200x200)
Open window (close callback)
Open window (centered on screen)
Open window (centered on parent)
More Details
See
https://github.com/mkdynamic/jquery-popupwindow
for more details.


Based off HTML5 Canvas ImageData, plus animation frames
// readimage.Image
{
width: 200,
height: 200,
frames: [
{ data: frame_1_rgba_buffer, delay: 100 },
{ data: frame_2_rgba_buffer, delay: 100 }
]
}
Each frame's data property is the same as HTML5 Canvas ImageData "data" except Node.js buffers instead of Uint8ClampedArray
// A two pixel image data
Buffer([
100, // RED
100, // GREEN
100, // BLUE
255, // ALPHA
200, // RED
0, // GREEN
99, // BLUE
255 // ALPHA
])
A 50's TV Emulation
function fiftiesTv(frameData, snowFrequency) {
for (var i = 0; i < frameData.length; i+=4) {
var maxSaturation = Math.max.apply(null, [
frameData[i], frameData[i+1], frameData[i+2]
])
// Add a glitchy "snowy" effect
if (maxSaturation % snowFrequency === 0) maxSaturation = 255
frameData[i] = maxSaturation
frameData[i+1] = maxSaturation
frameData[i+2] = maxSaturation
}
}
Buffers are a Node.js primitive for dealing with binary data.
Buffers are fast, Node.js is fast... safe to assume performance issues are in the code and algorithms I wrote.
Measure to make informed decisions!
I'm going to talk about three different types of performance data.
The unfortunate reality of performance tooling with Node.js:
Y = stack depth, X = % of total cpu time spent (Instructions)
Most useful:
Caveats
Y = stack depth, X = time (v8-profiler)
chart view, some aggregation
Most useful:
Caveats
Deoptimizations and compiler output (IRHydra2)
Most useful:
Caveats
From the logs I know that one of the slowest glitches is `replaceBackground`.
When given an animated gif it calculates a "background" frame, and then for each frame replaces the background with a provided replacement function.
function replaceBackground(frames, replacer, tolerance) {
tolerance = tolerance != null ? tolerance : 50
var background = medianFrame(frames)
for (var i = 0; i < frames.length; i++) {
var dupe = copy(frames[i].data)
replacer(dupe)
var rgba = frames[i].data
for (var j = 0; j < background.length; j += 4) {
var rDiff = Math.abs(rgba[j] - background[j])
var gDiff = Math.abs(rgba[j+1] - background[j+1])
var bDiff = Math.abs(rgba[j+2] - background[j+2])
if (!(rDiff > tolerance || gDiff > tolerance || bDiff > tolerance)) {
var start = (j > dupe.length) ? 0 : j
rgba[j] = dupe[start + 0]
rgba[j+1] = dupe[start + 1]
rgba[j+2] = dupe[start + 2]
}
}
}
}
Step 1: make a test and time it
/usr/bin/time node bg_fg.js img/spaceballs.gif
3.46user 0.02system 0:03.49elapsed 99%CPU (0avgtext+0avgdata 56308maxresident)k
0inputs+3232outputs (0major+11355minor)pagefaults 0swaps
The gif format is strange... gif optimization isn't handled correctly in the reading library, hence the failed background detection here. However, we're still able to collect good data!
Tool 1: Flame Graph
Tool 2: Timeline Graph
var profiler = require("v8-profiler")
profiler.startProfiling("bg")
// ...
bg(orig, function (err, img) {
gifwriter(img, function (err, gif) {
var data = profiler.stopProfiling("bg")
fs.writeFileSync("bg.cpuprofile", JSON.stringify(data))
fs.writeFileSync("./output/bg.gif", gif)
})
})
Two main things stand out: inxsearch and medianFrame. inxsearch is in a library, so for now let's focus on medianFrame.
The timeline chart shows medianFrame is calling avg which is calling sortPixels, which is the culprit of our perf issues.
function medianPixel(pixels) {
var sorted = sortPixels(pixels)
var mid = (sorted.length / 2) - ((sorted.length / 2) % 4)
return sorted.slice(mid, mid + 4)
}
function medianFrame(frames, alg) {
return avg(frames, medianPixel)
}
function avg(frames, alg) {
var len = frames[0].data.length
if (len === 1) {
return frames[0].data
}
var avgFrame = new Buffer(len)
for (var i = 0; i < len; i += 4) {
var pixels = new Buffer(4 * frames.length)
for (var j = 0; j < frames.length; j++) {
frames[j].data.copy(pixels, j * 4, i, i + 4)
}
var avgPixel = alg(pixels)
avgPixel.copy(avgFrame, i)
}
return avgFrame
}
function sortPixels(pixels) {
var split = []
for (var i = 0; i < pixels.length; i += 4) {
split.push(pixels.slice(i, i + 4))
}
var sorted = split.sort(function (a, b) {
return (a[0] + a[1] + a[2] + a[3]) - (b[0] + b[1] + b[2] + b[3])
})
var newbuff = new Buffer(pixels.length)
for (var j = 0; j < sorted.length; j++) {
newbuff[j * 4] = sorted[j][0]
newbuff[j * 4 + 1] = sorted[j][1]
newbuff[j * 4 + 2] = sorted[j][2]
newbuff[j * 4 + 3] = sorted[j][3]
}
return newbuff
}
Our image is 480x222 pixels by 30 frames
480 * 222 = 106560 // number of sortPixels calls
each sorting an array of 30 pixels
Tool 3: IRHydra2
Unfortunately IRHydra2 isn't much help for this issue, all our functions are inlined and never deopt.
Median calculation is slow because you need to sort. Let's try the mean instead
function meanPixel(pixels) {
if (pixels.length === 0) return new Buffer(4)
if (pixels.length === 4) return pixels
var p = new Buffer(4)
var r = 0, g = 0, b = 0, a = 0
for (var i = 0; i < pixels.length; i+= 4) {
r += pixels[i]
g += pixels[i + 1]
b += pixels[i + 2]
a += pixels[i + 3]
}
p[0] = (r / (pixels.length / 4)) >>> 0
p[1] = (g / (pixels.length / 4)) >>> 0
p[2] = (b / (pixels.length / 4)) >>> 0
p[3] = (a / (pixels.length / 4)) >>> 0
return p
}
/usr/bin/time node bg_fg.js img/spaceballs.gif
1.83user 0.03system 0:01.88elapsed 99%CPU (0avgtext+0avgdata 55316maxresident)k
0inputs+3104outputs (0major+11075minor)pagefaults 0swaps
From 3.49s to 1.88s!
Vastly improved by switching to mean from median. The output is different but acceptable. I'm convinced we could make it much faster by:
Keyword-triggered glitch chat using this library, try:


Preparation time
less than 30 mins
Cooking time
10 to 30 mins
Serves
Serves 4
Cut 2.5cm/1in deep into the cutlets and trim off the excess fat, being careful to leave some fat remaining for flavour.
Dredge the cutlets in the seasoned flour, shaking off the excess flour.
Beat the eggs in a bowl.
Mix the breadcrumbs with the capers and parsley.
Dip the floured cutlets one at a time into eggs then into breadcrumb mix. Shake off the excess coating and tap gently to shape with a palette knife.
Heat oil in a frying pan. Place the cutlets into the pan, presentation side down. Add the butter and cook for two minutes on each side, until coloured nicely. Take out and drain on kitchen towels.
Meanwhile, to make the salad, cook the small potatoes skin on in boiling salted water. When just cooked take them out and drain in a colander.
Chop up the ham and mix with the rest of the salad ingredients in a bowl.
Mix the dressing ingredients. Set half aside and pour the other half onto the salad.
Cut warm potatoes in half lengthwise into bowl. Check for seasoning.
Place a portion of salad in middle of a dish with the 2 cutlets on top. Sprinkle the rest of the dressing around and serve.


-
EC2 Instances
- EC2 Instances
- Security Groups
- Elastic Load Balancers
-
EMR
- Notifications
- Forms
-
Elastic Beanstalk
- Modals

Nested Grids
Grids can be nested, too!

Full-Width Grids
You can add a full-width
class modifier to a

in order to escape any containers and margins. An example of this lives on the
transparency dashboard.
This is an example of a full-width grid (note: turn off the sidebar):
Colors
Using colors consistently brings a sense of familiarty and unity to a product. Buffer's color scheme aims to be clear, unintrusive and friendly.
The color grid below lists the hex value and CSS variable for each respective color. When writing
CSS for production code, please use the LESS variables when possible. For further reference, see the
variables.less
file.
Typography
We almost exclusively use Open Sans as the base typeface across the entire Buffer product. Maintaining typographic clarity and hierarchy is important; here is a showcase of different ways to structure content:
Heading Level One
Heading Level Two
Heading Level Three
Heading Level Four
Heading Level Five
Heading Level Six
This is a lead paragraph. It might be used as a longer-form tagline or subheading for a page or content section. It has a slightly larger font size and line-height.
This is a normal paragraph. On static pages, it's designed for readability and optimizing the number of characters per line. The font size is larger to account for longer chunks of text.
This is a blockquote. While rarely used, it's designed to stand out from the main body of content and provide hierarchical contrast on the page.
- This is an
- unordered list
- which can be used to
- ...you know, make lists
- This is a blank
- unordered list
- which can be used to
- ...you know, make lists
- This is an
- ordered list
- which has numbers in front of each item
- because counting is cool
This is an example of a code block. This style will be used for developer docs and in future
iterations of this style guide.
Buttons
Buttons are styled and controlled in buttons.less
. We aim to keep all buttons across
the app as consistent as possible. Any implementations of buttons should aim to follow a
systematic class naming system, detailed below:
Inputs
Creating forms can be tricky - this will be a toolkit to help build fast, flexible forms to be used anywhere in the product. Coming soon.
Notifications
Buttons are styled and controlled in buttons.less
. We aim to keep all buttons across
the app as consistent as possible. Any implementations of buttons should aim to follow a
systematic class naming system, detailed below:
Forms
Creating forms can be tricky - this will be a toolkit to help build fast, flexible forms to be used anywhere in the product. Coming soon.
Modals
We use modals heavily throughout the product to help users focus on single-tasks (like changing billing information or adding a team member). Modals should maintain a consistent style to provide a unified experience for users.


I'm a front-end developer and UX designer in Minneapolis, MN.
What I do
I value good design and good engineering on the web. Each relies on the other, and I have spent
a lot of time learning to both well.
Development
I use the latest web technologies to produce high-performance, responsive
websites. Here is some filler text for equivalent word counts.
I have spent time learning the prominent languages, technologies, and techniques used in front-end development. I am skilled in HTML, CSS, and JavaScript. I have also spent time learning advanced front-end web development, such as front-end template systems, client-side JavaScript applications, and CSS preprocessing. I have built custom themes with WordPress – of which this portfolio is an example.
Although I've so far had limited experience developing websites and applications with other developers, I try to have the self-discipline to use techniques in my development process that would make teamwork possible. I do my best to write clear, concise, and richly annotated code that can be understood by another developer. I've spent too much time reading JavaScript style guides. I run test suites to monitor for bugs, and I try to use version control.
User-Experience Design
Cognitive science and anthropology have taught me a lot about how to leverage
the human mind in order to create simple and memorable experiences.
I have spent time learning the prominent languages, technologies, and techniques used in front-end development. I am skilled in HTML, CSS, and JavaScript. I have also spent time learning advanced front-end web development, such as front-end template systems, client-side JavaScript applications, and CSS preprocessing. I have built custom themes with WordPress – of which this portfolio is an example.
Although I've so far had limited experience developing websites and applications with other developers, I try to have the self-discipline to use techniques in my development process that would make teamwork possible. I do my best to write clear, concise, and richly annotated code that can be understood by another developer. I've spent too much time reading JavaScript style guides. I run test suites to monitor for bugs, and I try to use version control.
Want to talk about a job opening or a new project?
This plugin goes through a collection of anchor tags and makes it so that
those with links to other portions go to those sections with a fluid scrolling
motion rather than with an abrupt jump. This can be nice if you don't want to
confuse users who may think that they had been taken to a new page
X FluidScroll.js — jQuery Plugin
This plugin goes through a collection of anchor tags and makes it so that
those with links to other portions go to those sections with a fluid scrolling
motion rather than with an abrupt jump. This can be nice if you don't want to
confuse users who may think that they had been taken to a new page
X Axelrod — Prisoner's Dilemma Simulation (Game Theory)
This plugin goes through a collection of anchor tags and makes it so that
those with links to other portions go to those sections with a fluid scrolling
motion rather than with an abrupt jump. This can be nice if you don't want to
confuse users who may think that they had been taken to a new page
Contact Information
If you have an idea for a project, or if you would like to talk about a
job, you can reach me here either by email or by phone.


Give Mom spring’s favorite florals
Buy 1, 2 or 3 Large Candles
and get the same number free!
To find a store, copy and paste:
http://links.mkt1917.com/ctt?kn=8&ms=MTI5MTc1NzcS1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzQzMTYwOTkzS0&mt=1&rt=0
into your browser
Shop all our 150+ fragrances now!
To Shop Online Now, copy and paste:
http://links.mkt1917.com/ctt?kn=13&ms=MTI5MTc1NzcS1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzQzMTYwOTkzS0&mt=1&rt=0
into your browser
Gift Tote
with lots of favorites
$25 with any $50 purchase
9-pc. Set $100 value
one per transaction
ETo find a store, copy and paste:
http://links.mkt1917.com/ctt?kn=12&ms=MTI5MTc1NzcS1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzQzMTYwOTkzS0&mt=1&rt=0
into your browser
To Print the Coupon, copy and paste:
http://links.mkt1917.com/ctt?kn=22&ms=MTI5MTc1NzcS1&r=Mzc1MTMwMDUwMTIS1&b=2&j=NzQzMTYwOTkzS0&mt=1&rt=0
into your browser


{include file="public/header" /}
{:action('common/getPosition')}
{__CONTENT__}
{include file="public/footer" /}


Notebooks
Story: Sleeping in ashes
Sleeping in ashes
Title
Sleeping in ashes
Collection
Summary
Tamme's father's heart aches so his mother tells his father to sleep in ashes. His father does as she says and becomes white from the ashes.
Comments
1) See also Customs at death and Burial, 2) This story is found in Book XI & XII-3
Contributors
Date
4 January 1879
Categories
History (personal), Custom and daily life
Keywords
death (!kun customs at) , death (of !kun) , death (and sleeping in ashes) , death (Tamme's father's heart ached and he slept in ashes) , death (and mourning) , ashes (and !kun customs at death) , ashes (sleeping in) , ashes (Tamme's father becomes white with) , ashes (and Tamme's father's aching heart) , ashes (Tamme's father slept there) , Tamme (his personal history) , Tamme (his father slept in ashes) , Tamme (his father's aching heart) , heart (Tamme's father's aching) , heart (and sleeping in ashes) , heart (and grief) , heart (and death) , sleep (!kun customs at death) , sleep (sleeping in ashes)
Story Pages
9211


The main objective of this project was to adapt the interface of a robot toy for a young girl, who has special needs. The robot itself is a dock-style base for an iOS device, called Romo, which was developed by Romotive. The interface is a suite of games that are appropriate for the user's level of development. Through these games, the interface, coupled with the Romo will aid and reinforce learning. By making the learning invisible, the user can learn and enjoy doing so.
The SoBot project is made up of two iOS applications, both built in Objective-C; the SoBotPad and the SoBotRobot. Each application is responsible for an aspect of the overall project. The two applications are able to communicate.
The SoBotRobot application is built on an iPod touch. This device then sits into the Romo base. The purpose of the SoBotRobot application is control of the Romo itself. The SoBotRobot application makes use of the Romo SDK in order to communicate with the Romo base. As well as this, the SoBotRobot application uses Multipeer Connectivity to connect to the SoBotPad application, for streaming text and video.
The SoBotPad application is the true interface of the project. While the SoBotRobot was mostly built on the Romo SDK, the SoBotPad application was built top to bottom. The SoBotPad is made up of a match the pairs game, a fill-in-the-blanks game and a remote control for the Romo. The design of the SoBotPad is the crucial element, as it was important to adhere to accessibility guidelines. The interface is controlled through a symbol-based language. The SoBotPad incorporates a wide variety of frameworks, which aid in various aspects of the application. The core technological features of the app include Multipeer Connectivity and text to speech.
| 2012 – Present | |
| Course: | BS.c (Hons) in Computer Science (Infrastructure) at DIT. |
| Year: | Fourth year. |
|   |   |
| 2010 – 2012 | |
| Course: | Leaving Certificate |
| Result: | 6 Honours, 1 Pass. |
| 2009 – 2015 | |
| Company: | News & Gifts Newsagents |
| Position: | General employee. |
|   |   |
| February 2015 - May 2016 | |
| Company: | Intuitim |
| Position | Intern Web Developer |
| See LinkedIn for more details. |
Good knowledge of Mac OSX, Android, iOS, Windows, Linux, HTML5, CSS, MongoDB, Express.js, Angular.js, Node.js, Oracle SQl. Some experience with C, Java, XML, Javascript, PHP, Bash, Python, networking concepts, Amazon Web Services, ECDL, office suites.
Get in touch with Laura!