Skip to content

Instantly share code, notes, and snippets.

I have a console based Java application. In it, I print a rectangular array of characters. Something like the following.

.....
.....
.....
.....
.....

Essentially, a 5x5 grid.

// Scene view setup
sceneView.autoenablesDefaultLighting = true
sceneView.allowsCameraControl = true
let scene = SCNScene()
let rootNode = scene.rootNode
// Box
let boxGeometry = SCNBox(width: 1, height: 1, length: 1, chamferRadius: 0)
let boxMaterial1 = SCNMaterial()
#include <stdio.h>
#include <stdlib.h>
typedef struct Grid {
char *grid;
int width;
int height;
} Grid;
Grid *createGrid(int length)
let components = UnsafeMutablePointer<CGFloat>.alloc(4)
UIColor.redColor().getRed(&components[0], green: &components[1], blue: &components[2], alpha: &components[3])
CGContextSetFillColor(ctx, components)
package co.developertime.android.recon;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="co.developertime.android.recon" >
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
10-17 12:15:58.717 14509-14509/co.developertime.android.recon E/AndroidRuntime: FATAL EXCEPTION: main
10-17 12:15:58.717 14509-14509/co.developertime.android.recon E/AndroidRuntime: Process: co.developertime.android.recon, PID: 14509
10-17 12:15:58.717 14509-14509/co.developertime.android.recon E/AndroidRuntime: java.lang.SecurityException: Client must have ACCESS_FINE_LOCATION permission to request PRIORITY_HIGH_ACCURACY locations.
10-17 12:15:58.717 14509-14509/co.developertime.android.recon E/AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1599)
10-17 12:15:58.717 14509-14509/co.developertime.android.recon E/AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1552)
10-17 12:15:58.717 14509-14509/co.developertime.android.recon E/AndroidRuntime: at com.google.android.gms.location.internal.zzi$zza$zza.zza(Unknown Source)
10-17 12:15:58.717 14509-14509/co.developertime.android.recon E/AndroidRuntime: at com.google.android.gms.location.internal.zzk.zza(Unknown Source)
1
@morganwilde
morganwilde / family.js
Created November 20, 2015 04:38
family.js
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
margin: 0px;
}
</style>
</head>
<body>
@morganwilde
morganwilde / classes.js
Created January 5, 2016 18:55
ECMA 6 - Classes
"use strict";
class Point
{
constructor (coordinates) {
if (!(coordinates instanceof Array)) {
throw 'Error: Point constructor requires an array of coordinates.';
}
this._coordinates = coordinates;
}
def testFooter(self):
"""
Testing if footer contains a valid phone number.
"""
footer = driver.find_element(By.ID, 'footer-content')
paragraph = footer.find_element_by_css_selector('p')
phone = re.findall(r'phone \d{3}-\d{3}-\d{4}', paragraph.text)
self.assertEquals(len(phone), 1)
self.assertEquals('phone 510-885-3000', phone[0])