Skip to content

Instantly share code, notes, and snippets.

View DavidGinzberg's full-sized avatar

David Ginzberg DavidGinzberg

View GitHub Profile
@DavidGinzberg
DavidGinzberg / simplifyyourcode.py
Created October 10, 2019 19:25
A set of examples of common over-complicated programs, and the simpler alternatives (Python edition)
##
# Any conditional expression evaluates to either `True` or `False`, if you want to return a boolean value
# based on a conditional expression, you can just use that expression, without an if/else block
##
# The common mistake (overly verbose and overcomplicated):
def isSameNumber(x, y):
'''
Returns True if (and only if) x and y are equivalent; false otherwise

shoutkey.com/saw
shoutkey.com/gave
http://tile.stamen.com/watercolor/{z}/{x}/{y}.jpg

@DavidGinzberg
DavidGinzberg / RobocodeChallenges.md
Created February 14, 2017 16:40
A collection of challenges for developing clever little bots in Robocode.

#Challenges to make robocode more interesting

Formations

Pack:
Build team bots that stay in formation around a common target, eg: If a squad of three bots acquires a target, they should surround it and hold in an equilateral triangle with the target in the center. Extra challenge: account for walls if that makes a formation impossible and adjust accordingly (tighten formation or pin/corner the target)

Swarm:
Bots must move in an infinite loop pattern, avoiding collisions with each other, and adjusting slightly to avoid incoming fire while continuing to maintain the formation/avoiding disrupting other bots. Examples include figure 8, circular helix, and other complex geometric patterns. more examples can be found in this video

Console Lab Level 1

Objectives

  1. In this lab students will learn to navigate their file system using only the terminal
  2. Students will practice using the following commands to traverse directories and investigate their contents: pwd, ls, cd, cat, less, grep

Overview

Recommended Reading

A collection of reading resources I recommend, organized loosley by topic.

Notes:

  • If a link is dead leave me a comment and I will fix it or find it on the wayback machine.
  • Links to Amazon.com and other online stores are Not Currently affiliate links (I do not get any money if you purchase something I linked to). This may change in the future (and this note will be updated accordingly).

Programming

@DavidGinzberg
DavidGinzberg / Week1.md
Created December 21, 2016 21:09
ToDo Bootcamp - A series of exercises around building a mundane todo list application from the underground up.

ToDo Bootcamp Week 1

Basic CLI Todo List

Description

Let's create a todo list. this first exercise is for when you have just started learning a language and will start out super simple. The whole "application" will be entirely text-based and run on a command line -- no fancy GUIs or databases here.

Part 1

// Each of these functions has something wrong with it. Why won't it work and how can it be fixed?
//Produces the product of all numbers in an array
function product(numbers){
var result = 0;
for(var i = 0; i < numbers.length; i++){
result *= numbers[i];
}
return result;
}

Planning real-world projects

OR

What does "Actually Try" mean?

In the classroom, things like "actually try", "think about this seriously" "treat it like a real world project", "think like an engineer" are all shortcuts for "This is not just a thought exercise. The end product should be something that could actually be sold to client companies for them to use without having to write any of their own code" (except perhaps some CSS to apply their own branding).

Considerations:

@DavidGinzberg
DavidGinzberg / PersistenceChallenge.md
Created November 21, 2016 07:32
A persistence challenge focusing on DB implementation concerns

Persistence Challenge - Database Implementation

Unlike most assignments, this is not structured as a lab or project. This is a challenge, with components that range in difficulty from the very simple to the extremely difficult. You can pick and choose which elements to implement, and should consider returning to this challenge from time to time throughout your career to continue expanding your knowlege and skills.

This GitHub repository is provided as a starting point. As long as you are familiar with Spring Boot and Maven projects it should be easy to start here.

Tasks

Basic

Interview Questions

General Knowledge

  • Can Java run on Windows? On mobile devices? On IoT Devices?
  • Is Java related to JavaScript? What are some ways they are similar or different

Vocabulary

  • What is an effectively final variable? Why is it significant?