Skip to content

Instantly share code, notes, and snippets.

View satishgoda's full-sized avatar

Satish Goda satishgoda

View GitHub Profile
import bpy
from mathutils.geometry import interpolate_bezier
def get_points(spline, clean=True):
knots = spline.bezier_points
if len(knots) < 2:
return
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()
'''
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
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
PVector c = new PVector();
PVector m = new PVector();
PVector v;
boolean created = false;
boolean pressed = false;
boolean dragged = false;
#include <iostream>
#include <string>
int main(int argc, char* argv[])
{
std::string hello_world("Hello World");
std::cout << hello_world << std::endl;
return 0;
@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)
{
@satishgoda
satishgoda / helloWorld.c
Last active December 31, 2015 21:59
Hello World in C
#include <stdio.h>
int main(int argc, char* argv[])
{
printf("%s %s\n", "Hello", "World");
return 0;
}
@satishgoda
satishgoda / 0_pointers_basics.c
Last active January 1, 2016 00:28
Pointer Arithmetic in C
#include <stdio.h>
#include <string.h>
int main(int argc, char* argv[])
{
char *ntsp = "Hello";
// Printing null-terminated strings
{
@satishgoda
satishgoda / cmdlineargs.c
Last active January 1, 2016 10:09
Command-line arguments in C
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("argc=%d program name=[\"%s\"]\n", argc, argv[0]);
printf("%d \n", argc == ((argv + argc) - argv) );
if (argc < 2) {