Skip to content

Instantly share code, notes, and snippets.

View BrianARuff's full-sized avatar
:copilot:
Making the world a better place 🤪

Brian Ruff BrianARuff

:copilot:
Making the world a better place 🤪
View GitHub Profile
@BrianARuff
BrianARuff / hello_world.html.erb
Last active October 12, 2017 00:55
Hello World
<%= hello world %>
public class Loan { //declaring a public class called "Loan"
double loanAmount; //I'm declaring a variable called "loanAmount" and setting it to the double-data-type.
double yearlyRate; //I'm declaring a variable called "yearlyRate" and setting it to the double-data-type.
double totalPrice; //I'm declaring a variable called "totalPrice" and setting it to the double-data-type.
void totalCost(double newYearlyRate, double newLoanAmount) { //I'm creating a method named "totalCost" and passing in two arguments "newYearlyRate and newLoanAmount and declaring them both of type double.
totalPrice = newLoanAmount * newYearlyRate; //I created a new variable called "totalPrice" and set it equal to the product of the arguments passed into the "totalCost" method.
totalPrice = Math.round(totalPrice*100)/100.0; //Math.round(variableName) will round a number to it's nearest whole number. The number * 100 in addition to the Math.round coverts the number to an integer, and then when you divid
public class Loan { //declaring a public class called "Loan"
double loanAmount; //I'm declaring a variable called "loanAmount" and setting it to the double-data-type.
double yearlyRate; //I'm declaring a variable called "yearlyRate" and setting it to the double-data-type.
double totalPrice; //I'm declaring a variable called "totalPrice" and setting it to the double-data-type.
void totalCost(double newYearlyRate, double newLoanAmount) { //I'm creating a method named "totalCost" and passing in two arguments "newYearlyRate and newLoanAmount and declaring them both of type double.
totalPrice = newLoanAmount * newYearlyRate; //I created a new variable called "totalPrice" and set it equal to the product of the arguments passed into the "totalCost" method.
totalPrice = Math.round(totalPrice*100)/100.0; //Math.round(variableName) will round a number to it's nearest whole number. The number * 100 in addition to the Math.round coverts the number to an integer, and then when you divid
package com.company;
public class NumberManipulation {
double[] array;
double minimum = Double.MIN_VALUE;
double maximum = Double.MAX_VALUE;
public void getMaximum(double... newArray) {
array = newArray;
for (int i = 0; i < array.length; i++) {
package com.company;
public class NumberManipulation {
double[] array;
public double getMaximum(double [] newArray) {
double minimum = Double.MIN_VALUE;
array = newArray;
for (int i = 0; i < array.length; i++) {
if (array[i] > minimum) {
<% @block_busters.each_slice(3) do |slice| %>
<div class="row">
<% slice.each do |movie| %>
<div class="col-md-3">
<div class="card" style="width: 20rem;">
<img class="card-img-top" src="<%= movie.image_url %>" alt="Card image cap">
<div class="card-body">
<h4 class="card-title"><%=movie.title%></h4>
<p class="card-text"><%=movie.rating%></p>
<p class="card-text"><%=movie.description%></p>
<% @block_busters.each_slice(3) do |slice| %>
<div class="row">
<% slice.each do |movie| %>
<div class="col-md-3">
<div class="card" style="width: 20rem;">
<img class="card-img-top" src="<%= movie.image_url %>" alt="Card image cap">
<div class="card-body">
<h4 class="card-title"><%=movie.title%></h4>
<p class="card-text"><%=movie.rating%></p>
<p class="card-text"><%=movie.description%></p>
<div class="container">
<div class="row">
<% @block_busters.each_slice(3) do |slice| %>
<% slice.each do |movie| %>
<div class="card" style="width: 20rem;">
<img class="card-img-top" src="<%= movie.image_url %>" alt="Card image cap">
<div class="card-body">
<h4 class="card-title"><%=movie.title%></h4>
<p class="card-text"><%=movie.rating%></p>
<p class="card-text"><%=movie.description%></p>
// this throws a "newLatLngBounds, int) exception" error on line 14
mMap = googleMap;
ArrayList<MyPoint> points = Data.getPoints();
LatLngBounds.Builder builder = new LatLngBounds.Builder();
PolylineOptions polylineOptions = new PolylineOptions();
for (int i = 0; i < points.size(); i++) {
MyPoint point = points.get(i);
polylineOptions.add(new LatLng(point.getLat(), point.getLng()));
builder.include(new LatLng(point.getLat(),point.getLng()));
}
// this throws a "newLatLngBounds, int) exception" error on line 14
mMap = googleMap;
ArrayList<MyPoint> points = Data.getPoints();
LatLngBounds.Builder builder = new LatLngBounds.Builder();
PolylineOptions polylineOptions = new PolylineOptions();
for (int i = 0; i < points.size(); i++) {
MyPoint point = points.get(i);
polylineOptions.add(new LatLng(point.getLat(), point.getLng()));
builder.include(new LatLng(point.getLat(),point.getLng()));
}