Skip to content

Instantly share code, notes, and snippets.

fmtsdk =: ((;/"3)&(3 3 3 3&$))
bare =: (,/,/ (i. 3) |."1"0 _ ((3 * i. 3) |."0 _ (1 + i.9)))
fmtsdk bare
┌─────┬─────┬─────┐
│1 2 3│4 5 6│7 8 9│
│4 5 6│7 8 9│1 2 3│
│7 8 9│1 2 3│4 5 6│
├─────┼─────┼─────┤
│2 3 4│5 6 7│8 9 1│
│5 6 7│8 9 1│2 3 4│
diff ./state.cpp ../state.cpp
42,43c42,43
< unordered_map<string, string::size_type>& visitedWords,
< priority_queue<state>& states) {
---
> unordered_map<string, string::size_type>* visitedWords,
> priority_queue<state>* states) {
53,54c53,54
< && (visitedWords.count(s) == 0
< || visitedWords[s] == 1 + this->visited.size())
@canoon
canoon / q9+
Created May 1, 2012 08:55
Unicode HQ9+ Implementation
#!/usr/bin/env ruby
# coding: utf-8
##
# In HQ9+ Hello world programs were unnecessarily long which caused a
# dramatic waste in space. It is estimated that a massive 4 PB of
# storage space worldwide is used to store "Hello, World!" programs a
# further 2 PB of space is used to store "Hello, World" programs. Q9+
# attempts to solve this problem this problem by making the empty file a
# "Hello World" program. As a result of this a standard 2 TB harddrive
module ExerciseSeven where
data ℕ : Set where
zero : ℕ
succ : ℕ → ℕ
_+_ : ℕ → ℕ → ℕ
zero + n = n
(succ m) + n = succ (m + n)
function synchronized update() {
display_update();
if ($("#num_tickets")[0].value != tickets.length) {
// number of tickets is off
while ($("#num_tickets")[0].value > tickets.length) {
data = $.ajax({ url: '#{dashboard_order_tickets_path(@order)}',
type: 'POST',
dataType: 'json',
data: {ticket: {event_id: #{@event.id}}}});
console.log("new ticket");
#include <stdio.h>
int *p;
void foo(int *n) {
p = ((void **)n)[0];
((int (*)(void))((void**)n)[1])();
}
void bar() {
#include <stdio.h>
int *p;
void foo(int *n) {
p = ((void **)n)[0];
((int (*)(void))((void**)n)[1])();
}
void bar() {
import java.util.*;
import java.io.*;
import java.lang.*;
public class test1
{
public static void main(String[] args)
{
Scanner numbersRead=new Scanner(System.in).useDelimiter(" ");