Skip to content

Instantly share code, notes, and snippets.

View Theartbug's full-sized avatar

A.Provost Theartbug

View GitHub Profile
@Theartbug
Theartbug / java_algorithms_data_structures.md
Created August 29, 2019 17:33
java algorithms and data structures

Stacks

Intro

Characteristics

  • agnostic to data it contains
  • how does data get in and out?
@Theartbug
Theartbug / java_generics.md
Last active November 1, 2020 16:37
java fundamentals generics

Advanced topics

Functional Interfaces

  • usecase for wildcards
  • lambda expressions have types
  • good for library building
// has ingoing type T and return type R
Function<T, R> -> R apply(T arg)
@Theartbug
Theartbug / java-collections.md
Last active July 25, 2019 16:22
Java fundamentals collections

Collection Operations

  • operations available on the Collections class
  • Algorithms, factories, utilities

Algorithms

  • public static void Collections.rotate(List<?> l, int distance): takes the last element of the list, moves to beginning, and shuffles all others down. Distance is the number of times to do this
  • public static void Collections.shuffle(List<?> l, Random rndm): random rearrangment of list items. Can accept a Random class object to determine the randomization
  • public static void Collections.sort(List<T> l, Comparator<? super T> c): accepts a comparator to organize the list by
@Theartbug
Theartbug / Act-W-Conference.md
Last active June 27, 2019 22:46
Act W Achieving Diversity Conference

Your “Diversity Problem” Has Nothing To Do With Recruiting

Katie Augsburger Employee Experience Strategist/Founding Partner at Future Work Design

reasons for diversified workplace

  • risk, talent pool (changing), revenue loss, products and services (are worse), creates more inequality

what we've tried

  • "how do people from marginalized communities find out about our organization"
@Theartbug
Theartbug / MySQL_fundamentals.md
Last active July 12, 2019 16:12
mysql fundamentals

Creating Database Tables

  • Data Definition Language (DDL) is a SQL subset for creating databases and tables
  • most databases will have a GUI to create
  • still good to know how to do it manually, especially for scripting

CREATE DATABASE

  • not part of SQL standard, but is supported by most implementations
  • USE DATABASE to scope future queries to a particular database
@Theartbug
Theartbug / Spring_JPA_Hibernate.md
Last active June 20, 2019 15:43
Spring Java Peristence API and Hibernate

Configure and use Spring Data JPA

Spring Data JPA

  • reduces boilerplate

Create vs Update

  • persist is just used for Creates
    • returns void, since the id is not created until after the object is saved
@Theartbug
Theartbug / Spring_MVC4.md
Last active May 31, 2019 16:14
Spring MVC 4

Spring MVC 4 REST and AJAX

RestController

  • Convenience annotation for annotating a Controller and ResponseBody at the same time
  • Assumes each RequestMapping is going to return the body of it's request
  • less verbose than having to define each method and it's response type
  • no longer need to use the ContentNegotiatingViewResolver
    • but still can for fine tuning
  • Example: EventsReportController.java
@Theartbug
Theartbug / WOSV.md
Last active May 3, 2019 20:11
Women of Silicon Valley Conference

How to work more collaboratively

  • so many different tech tools, but people are hard to work with!
    • tech tools cannot fix the human problem
    • need to understand one another on a human basis
  • "no, and" saying no is difficult, feels surrounded in negativity
  • "yes, and" is additive, more diverse, collaberative
    • creates more open atmosphere
    • less afraid of making a mistake
  • provide sense of positivity
@Theartbug
Theartbug / spring_MVC3.md
Last active May 9, 2019 15:54
Spring MVC 3

Ajax

ContentNegotiatingViewResolver

  • uses the Accepts header which is sent using http headers
    • can also look at the file extension
  • there can be multiple view resolvers
  • will need additional JARs needed for the Marshaller (used to return JSON)

setup

@Theartbug
Theartbug / spring_fundamentals.md
Last active April 22, 2019 16:36
Spring Fundamentals

Properties

  • allow certain properties / values to be availble app wide

XML config

  • app.properties:
dbUsername=mysqlusername