Khan Academy: Back to School

Advanced Placement & college prep
AP Calculus AB AP US history
AP Calculus BC AP Art history
AP Physics 1 SAT
AP Physics 2 College admissions
AP Chemistry
Math
K-2nd grade Algebra I
3rd grade Geometry
4th grade Algebra II
5th grade Trigonometry
6th grade Statistics & probability
7th grade Calculus
8th grade Differential equations
Arithmetic Linear algebra
Pre-algebra
Science & engineering
Biology Health & medicine
Physics Electrical engineering
Chemistry Cosmology & astronomy
Organic chemistry
Computing
Computer programming Computer animation
Computer science
Arts & humanities
Art history US history
Grammar World history
Music
Economics & finance
Microeconomics Finance & capital markets
Macroeconomics Entrepreneurship

Minecraft: PI – Place Blocks Under the Player

This script will place blocks under the player while walking around.

# Import the minecraft library
import mcpi.minecraft import Minecraft
import time

# connect to the minecraft client
mc = Minecraft.create()

# cobblestone
blockType = 4

# place blocks under the player
while True:
  pos = mc.player.getTilePos()
  height = mc.getHeight(pos.x, pos.y)
  mc.setBlock(pos.x, pos.y - 1, pos.z, blockType)
  time.sleep(0)

Minecraft: PI – Create Blocks

Devin picked up “Learn to Program with Minecraft” at the Pacific Science Center in Seattle.

After the first 3 chapters, Devin has the player teleporting and spawning a grid of melons.

# Import the minecraft library and refer with an easy alias
import mcpi.minecraft as minecraft

# connect to the minecraft client
mc = minecraft.Minecraft.create()

# example of using variables
x = 0
y = 0
z = 0
width = 3
height = 3
length = 3

# use the minecraft variable to interact with the player and set the position of the player
mc.player.setTilePos(x, y + 2 * height, z)

# assign the mellon to the blockType variable
blockType = 103

# set a specific type of block at a single location
#mc.setBlock(x, y, z, blockType)

# set a range of tiles
mc.setBlocks(x, y, z, x + width - 1, y + height - 1, z + length - 1, blockType)

# post to the minecraft chat window
msg = "melons boom!!!!!!!!!!!!!!!"
mc.postToChat(msg)

OUYA Plugin With Turret Mouse Support

I made some changes to the OUYA Unity Plugin and placed the updates into a new repository. I moved the Java source into an Android Studio project and removed the Java/NDK compile options from the editor. And then I added support for the Razer Turret Mouse service with an API to access the mouse position and button information on the Forge TV.

https://github.com/ouya/ouya-unity-plugin

Xamarin: Bypass JAR Binding

Xamarin has a nice C# binding process that automatically wraps Java so that it can be called from C#. In my case the binding was causing an Input ANR (activity-not-responding) crash during startup. [This post] provided enough detail to be able to bypass the binding process so that I could use a raw Java activity to bypass the crash that was happening.

org.apache.http.legacy

There’s a handy Gradle setting if you are using `Google Play` and try to target API `23` you’ll see `org.apache.http` went missing. This handy Gradle setting brings the legacy packages back.

apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion '24.0.1'
    useLibrary 'org.apache.http.legacy'