<commit_before>/*
    This program provides an example of interfacing with
    libmyolinux. A packet of raw data is passed in, interpreted
    as a Myo Armband packet, and data is returned.

*/

#include <stdlib.h>
#include <stdio.h>
#include "myolinux.h"

int main(){
    
    /* Real sample packet */
    unsigned char data[30] = {0x0,0x0,0xc2,0xbd,0x0,0x0,0x48,0x3c,0x0,0x80,0x71,0x3f,0x0,0x4c,0x0d,0xbf,0x0,0x40,0xbd,0x0,0x20,0x9a,0xbd,0x0,0x6c,0x54,0x3f,0xff,0x01,0x0};

    parse_packet(data);

    return 0;
}<commit_msg>commit @ Sun Sep 28 07:59:56 EDT 2014<commit_after>/*
    This program provides an example of interfacing with
    libmyolinux. A packet of raw data is passed in, interpreted
    as a Myo Armband packet, and data is returned.

*/

#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include "myolinux.h"

int main(){
	unsigned char buffer[30];

	struct sockaddr_in server;
	memset(&server, 0, sizeof(struct sockaddr_in));
	server.sin_family = AF_INET;
	server.sin_addr.s_addr = htonl(INADDR_ANY);
	server.sin_port = htons(6969);

    int sock = socket(AF_INET, SOCK_STREAM, 0);
    bind(sock, (struct sockaddr *) &server, sizeof(server));


    int conn = accept(server, (struct sockaddr *) NULL, NULL);

    while (1) {
    	recv(conn, buffer, 30, 0);
    	parse_packet(buffer);
    }

    /* Real sample packet */
    // unsigned char data[30] = {0x0,0x0,0xc2,0xbd,0x0,0x0,0x48,0x3c,0x0,0x80,0x71,0x3f,0x0,0x4c,0x0d,0xbf,0x0,0x40,0xbd,0x0,0x20,0x9a,0xbd,0x0,0x6c,0x54,0x3f,0xff,0x01,0x0};

    // parse_packet(data);

    return 0;
}
{'fraction_non_alphanumeric': 0.1399506781750925, 'fraction_numerical': 0.09494451294697903, 'mean_word_length': 4.235483870967742, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '631883', 'n_tokens_mistral': 760, 'n_tokens_neox': 705, 'n_words': 144}