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
n=$1 | |
[ "$n" == "" ] && n=100 | |
echo "#include <stdio.h>" | |
echo "int main() {" | |
echo " int i;" | |
echo -n " for (i = 0; i < $n; i++) printf(\"%d\\n\", i==0?" | |
for i in $(seq 1 $n); do | |
printf "$n:i==$i?" | |
let n=$n-1 |
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
//* The Ros object, wrapping a web socket connection to rosbridge. | |
var ros = new ROSLIB.Ros({ | |
url: 'ws://localhost:9090' // url to your rosbridge server | |
}); | |
//* A topic for messaging. | |
var exampleTopic = new ROSLIB.Topic({ | |
ros: ros, | |
name: '/com/endpoint/example', // use a sensible namespace | |
messageType: 'std_msgs/String' |
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
default: all | |
CFLAGS += -I/home/jacob/dev/libgit2/include | |
LDFLAGS += -L/home/jacob/dev/libgit2/build | |
LIBRARIES += -lgit2 | |
OBJECTS = sample.o | |
all: $(OBJECTS) | |
gcc $(CFLAGS) $(LDFLAGS) -o out.out $(OBJECTS) $(LIBRARIES) |
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
struct stuff { | |
int arr[4]; | |
int i; | |
}; | |
int main() { | |
struct stuff s; | |
for (s.i = 0; s.i <= 4; s.i++) | |
s.arr[s.i] = 0; |
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
int main() { | |
int i; | |
int arr[4]; | |
for (i = 0; i <= 4; i++) | |
arr[i] = 0; | |
return i; | |
} |
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
#python program | |
class guy: | |
def __init__(self, param): | |
self.name = param | |
print("My name is", self.name) | |
def my_guy_func(self, the_range): | |
total = 0 | |
count = 1 |