Skip to content

Instantly share code, notes, and snippets.

View andsve's full-sized avatar
🍎
Coding

Sven Andersson andsve

🍎
Coding
View GitHub Profile
module("modules/testmod/testmod")
function parse_message(bot, msg)
local i,j,s,c = string.find(msg, ":(.-)!.- PRIVMSG (.-) :poopshoot")
if not (i == nil) then
bot:say(c, "Hey, " .. tostring(s) .. ", watch your language!!")
end
end
local socket = require("socket")
function create_bot(nick, channels)
local bot = {nick = nick, -- nickname of bot
firstresponse = false, -- got any data?
connection_ok = false,
channels = channels
}
function bot:connect(serv, port)
local socket = require("socket")
function create_bot(nick, channels)
local bot = {nick = nick, -- nickname of bot
firstresponse = false, -- got any data?
connection_ok = false,
channels = channels
}
function bot:connect(serv, port)
local socket = require("socket")
function create_bot(nick, channels)
local bot = {nick = nick, -- nickname of bot
firstresponse = false, -- got any data?
connection_ok = false,
channels = channels
}
function bot:connect(serv, port)
@andsve
andsve / bot.lua
Created August 16, 2010 21:58
Auto updating IRC Bot written in Lua (using luasockets)
local socket = require("socket")
function create_bot(nick, channels)
local bot = {nick = nick, -- nickname of bot
firstresponse = false, -- got any data?
connection_ok = false,
channels = channels
}
function bot:connect(serv, port)
def read_file(filename):
v = []
w = []
capacity = 0
f = open(filename)
for line in f:
if line.startswith("capacity="):
capacity = int(line[9:])
else:
v_, w_ = (eval(line))
void draw_geometry_pass(void)
{
glViewport(0,0,window_width,window_hight);
camera->updateProjection();
camera->updateModelview();
// Get projection matrix, and create inverse for DF pass 2.
glGetFloatv(GL_MODELVIEW_MATRIX, matrix_modelview);
glGetFloatv(GL_PROJECTION_MATRIX, matrix_projection);
void main (void)
{
float depth = texture2D(tex_depth, gl_TexCoord[0].st).r * 2.0 - 1.0;
vec3 norm = texture2D(tex_norm, gl_TexCoord[0].st).xyz * 2.0 - 1.0;
//norm = normalize(norm); // no need?
vec4 ambient = texture2D(tex_motion, gl_TexCoord[0].st); // currently holds ambient colors
// will be used for velocity in future
// Viewport position at this pixel in the range -1 to 1.
vec4 projection_pos = vec4(gl_TexCoord[0].st * 2.0 - 1.0, depth, 1.0);
Task 2A:
X = 12
x = 9
Since: 18^9 % 23 = 12
Task 2B:
m = 16
X = 12
k = 5
# >> iser o so ei a e o rinrah e titnorthnoa satr o areahehns itainth o r theo nso snt er et eitraita th theiat seto ier e ro o r ore th ernsan o a e o ro h t arenneisa ehoseitnantohth t snth ohense ah re o n a erah no a oah n tr e nseohe thnseonser tnsi r rtith e nertn