This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Kaminari | |
module PageScopeMethods | |
def total_count | |
@_hacked_total_count || (@_hacked_total_count = self.connection.execute("SELECT (reltuples)::integer FROM pg_class r WHERE relkind = 'r' AND relname ='#{table_name}'").first["reltuples"].to_i) | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: detrand | |
detrand: main.c | |
cc -o detrand main.c -lssl -lcrypto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Standard things | |
sp := $(sp).x | |
dirstack_$(sp) := $(d) | |
d := $(dir) | |
BUILDDIRS += $(BUILD_PATH)/$(d) | |
# Local flags | |
CXXFLAGS_$(d) := $(WIRISH_INCLUDES) $(LIBMAPLE_INCLUDES) | |
# Local rules and targets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mytree | |
attr_accessor :left, :right | |
attr_accessor :value | |
def initialize(v) | |
self.value = v | |
end | |
def print_preorder | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
typedef struct _Tree { | |
char value; | |
struct _Tree* left; | |
struct _Tree* right; | |
} Tree; | |
Tree * newTree(char v) { |