This is a collection of familiarization exercises in Swift. They'll suffer from ignorance of writing idiomatic code. My goal is to iterate on these as fluency develops and leave them up for the brave.
In short:
- Caveat Lector
- Don't Be A Jerk
Source | Target | Type | Id | Weight | Average Degree | |
---|---|---|---|---|---|---|
1 | 3 | Undirected | 1 | 1.0 | 1.0 | |
2 | 10 | Undirected | 8 | 1.0 | 1.0 | |
3 | 4 | Undirected | 2 | 1.0 | 1.0 | |
4 | 5 | Undirected | 3 | 1.0 | 1.0 | |
5 | 10 | Undirected | 4 | 1.0 | 1.0 | |
8 | 2 | Undirected | 7 | 1.0 | 1.0 | |
8 | 9 | Undirected | 11 | 1.0 | 1.0 | |
10 | 1 | Undirected | 5 | 1.0 | 1.0 | |
10 | 6 | Undirected | 10 | 1.0 | 1.0 |
Hey, | |
This is collection of small, interesting interview practice problems. | |
Hope you get some utility out of this. | |
Erik |
py4j.protocol.Py4JJavaError: An error occurred while calling o90.save. | |
: java.io.IOException: Failed to open native connection to Cassandra at {<Redacted>}:<Redacted port> | |
at com.datastax.spark.connector.cql.CassandraConnector$.com$datastax$spark$connector$cql$CassandraConnector$$createSession(CassandraConnector.scala:168) | |
at com.datastax.spark.connector.cql.CassandraConnector$$anonfun$8.apply(CassandraConnector.scala:154) | |
at com.datastax.spark.connector.cql.CassandraConnector$$anonfun$8.apply(CassandraConnector.scala:154) | |
at com.datastax.spark.connector.cql.RefCountedCache.createNewValueAndKeys(RefCountedCache.scala:32) | |
at com.datastax.spark.connector.cql.RefCountedCache.syncAcquire(RefCountedCache.scala:69) | |
at com.datastax.spark.connector.cql.RefCountedCache.acquire(RefCountedCache.scala:57) | |
at com.datastax.spark.connector.cql.CassandraConnector.openSession(CassandraConnector.scala:79) | |
at com.datastax.spark.connector.cql.CassandraConnector.withSessionDo(CassandraConnector.scala:111) |
Alan Kay's talk at Creative Think seminar, July 20, 1982 | |
Outline of talk: Metaphors, Magnetic Fields, Snobbery and Slogans | |
The best way to predict the future is to invent it. | |
Humans like fantasy and sharing: | |
Fantasy fulfills a need for a simpler, more controllable world. | |
Sharing is important - we're all communication junkies. We have an incredible bandwidth |
pico-8 cartridge // http://www.pico-8.com | |
version 16 | |
__lua__ | |
-- move an ball on-screen | |
-- by erik hollembeak | |
SCREEN_WIDTH = 128 | |
SCREEN_HEIGHT = 128 | |
-- Ball definition |
/* Write a program that opens a file (with the open() system call) and then | |
* calls fork() to create a new process. Can both the child and parent access | |
* the file descriptor returned by open()? What happens when they are writing to | |
* the file concurrently, i.e., at the same time? */ | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> |
# What methods does a class implement? | |
> Time.methods | |
=> [:!, :!=, :!~, :<, :<=, :<=>, :==, :===, :=~, :>, :>=, :__id__, :__send__, :allocate, :ancestors, :at, :autoload, :autoload?, :class, :class_eval, :class_exec, :class_variable_defined?, :class_variable_get, :class_variable_set, :class_variables, :clone, :const_defined?, :const_get, :const_missing, :const_set, :constants, :define_singleton_method, :deprecate_constant, :display, :dup, :enum_for, :eql?, :equal?, :extend, :freeze, :frozen?, :gm, :hash, :include, :include?, :included_modules, :inspect, :instance_eval, :instance_exec, :instance_method, :instance_methods, :instance_of?, :instance_variable_defined?, :instance_variable_get, :instance_variable_set, :instance_variables, :is_a?, :itself, :kind_of?, :local, :method, :method_defined?, :methods, :mktime, :module_eval, :module_exec, :name, :new, :nil?, :now, :object_id, :prepend, :private_class_method, :private_constant, :private_instance_methods, :private_method_defined?, :private_methods, :protected_ |
// https://tour.golang.org/methods/22 | |
package main | |
import "golang.org/x/tour/reader" | |
type MyReader struct{} | |
func (reader MyReader) Read(b []byte) (int, error) { | |
count := 0 | |
for i, _ := range b { |
2.4.2 |