Skip to content

Instantly share code, notes, and snippets.

View satishgoda's full-sized avatar

Satish Goda satishgoda

View GitHub Profile
@satishgoda
satishgoda / whats_the_point.cpp
Last active December 31, 2015 19:39
C++ basics : Point
#include <iostream>
struct Point {
public:
int x, y;
};
void updatePoint(Point& p, int x, int y)
{
#include <iostream>
#include <string>
int main(int argc, char* argv[])
{
std::string hello_world("Hello World");
std::cout << hello_world << std::endl;
return 0;
PVector c = new PVector();
PVector m = new PVector();
PVector v;
boolean created = false;
boolean pressed = false;
boolean dragged = false;
class MyCallable(object):
def __init__(self, urlparts, callable):
self.urlparts = urlparts
self.callable = callable
def __call__(self, **kwargs):
print kwargs
print self.urlparts
def __getattr__(self, name):
# Return a callable object of this same type so that you can just keep
# chaining together calls and just adding that missing attribute to the
'''
BEGIN GPL LICENSE BLOCK
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
import socket
if __name__ == "__main__":
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("localhost", 9000))
data = "some data"
sock.sendall(data)
result = sock.recv(1024)
print result
sock.close()
import bpy
from mathutils.geometry import interpolate_bezier
def get_points(spline, clean=True):
knots = spline.bezier_points
if len(knots) < 2:
return
import bge
controller = bge.logic.getCurrentController()
owner = controller.owner
print(type(owner))
print(owner.getPropertyNames())
import bge
controller = bge.logic.getCurrentController()
sensor = controller.sensors['up_WKEY']
if sensor.getKeyStatus(bge.events.WKEY) == bge.logic.KX_INPUT_JUST_ACTIVATED:
owner = controller.owner
actuator = controller.actuators['upkeycount']
actuator.value = str(owner.get(actuator.propName) + 1)
controller.activate(actuator)
# Create a bezier curve object
>>> bpy.ops.curve.primitive_bezier_curve_add()
{'FINISHED'}
# Get a reference to the curve object
>>> curve_object = bpy.context.active_object
# Print out its data path