code string | repo_name string | path string | language string | license string | size int64 |
|---|---|---|---|---|---|
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sampleteam/MyFirstLeader.java | Java | gpl3 | 2,643 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/MyFirstRobot.java | Java | gpl3 | 1,463 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/Interactive.java | Java | gpl3 | 6,916 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/TrackFire.java | Java | gpl3 | 2,490 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this d... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/VelociRobot.java | Java | gpl3 | 1,589 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/SpinBot.java | Java | gpl3 | 1,890 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/Walls.java | Java | gpl3 | 2,682 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this d... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/Interactive_v2.java | Java | gpl3 | 7,304 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/MyFirstJuniorRobot.java | Java | gpl3 | 1,815 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/Fire.java | Java | gpl3 | 2,304 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/Corners.java | Java | gpl3 | 4,147 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/Tracker.java | Java | gpl3 | 4,410 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/Crazy.java | Java | gpl3 | 3,079 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/PaintingRobot.java | Java | gpl3 | 2,990 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/Target.java | Java | gpl3 | 1,926 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/RamFire.java | Java | gpl3 | 2,254 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/ZionGroup/robocode/robots/sample/SittingDuck.java | Java | gpl3 | 2,965 |
package fcac;
import robocode.*;
import java.awt.Color;
// API help : http://robocode.sourceforge.net/docs/robocode/robocode/Robot.html
/**
* FirstRobot - a robot by (your name here)
*/
public class FirstRobot extends Robot
{
/**
* run: FirstRobot's default behavior
*/
public void run() {
// ... | zyon-group-pe | trunk/ZionGroup/robocode/robots/fcac/FirstRobot.java | Java | gpl3 | 1,321 |
/* Javadoc style sheet */
/* Define colors, fonts and other style attributes here to override the defaults */
/* Page background color */
body { background-color: #FFFFFF }
/* Headings */
h1 { font-size: 145% }
/* Table colors */
.TableHeadingColor { background: #CCCCFF } /* Dark mauve */
.TableSubH... | zyon-group-pe | trunk/ZionGroup/robocode/javadoc/stylesheet.css | CSS | gpl3 | 1,231 |
#!/bin/sh
pwd=`pwd`
cd ${0%/*}
java -Xmx1024M -cp libs/robocode.jar:libs/roborumble.jar:libs/codesize-1.1.jar roborumble.RoboRumbleAtHome ./roborumble/meleerumble.txt
cd $pwd
| zyon-group-pe | trunk/ZionGroup/robocode/meleerumble.command | Shell | gpl3 | 175 |
#!/bin/sh
pwd=`pwd`
cd ${0%/*}
java -Xmx1024M -cp libs/robocode.jar:libs/roborumble.jar:libs/codesize-1.1.jar roborumble.RoboRumbleAtHome ./roborumble/meleerumble.txt
cd $pwd
| zyon-group-pe | trunk/ZionGroup/robocode/meleerumble.sh | Shell | gpl3 | 175 |
#!/bin/sh
pwd=`pwd`
cd ${0%/*}
java -Xmx512M -cp libs/robocode.jar:libs/roborumble.jar:libs/codesize-1.1.jar roborumble.RoboRumbleAtHome ./roborumble/teamrumble.txt
cd $pwd
| zyon-group-pe | trunk/ZionGroup/robocode/teamrumble.sh | Shell | gpl3 | 173 |
public class CompilerTest {
public static void main(String args[]) {
System.out.println("Compiler operational");
}
}
| zyon-group-pe | trunk/ZionGroup/robocode/compilers/CompilerTest.java | Java | gpl3 | 126 |
#!/bin/sh
pwd=`pwd`
cd ${0%/*}
java -Xmx512M -cp libs/robocode.jar robocode.Robocode $*
cd $pwd
| zyon-group-pe | trunk/ZionGroup/robocode/robocode.sh | Shell | gpl3 | 96 |
package zion;
import java.util.List;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.rule.FactHandle;
import zion.Accion;
public final class DEBUG {
public static boolean modoDebugHabilitado = false;
public static void habilitarModoDebug(boolean b) {
modoDebugHabilitado = b;
}
... | zyon-group-pe | trunk/DroolsRobocode/src/zion/DEBUG.java | Java | gpl3 | 848 |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package zion;
import robocode.AdvancedRobot;
/**
*
* @author ribadas
*/
public class EstadoRobot {
private final double distanceRemaining;
private final double energy;
private final double gunHeading;
... | zyon-group-pe | trunk/DroolsRobocode/src/zion/EstadoRobot.java | Java | gpl3 | 2,810 |
package zion;
public class LeaderFound {
private String name;
public LeaderFound(String name) {
super();
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| zyon-group-pe | trunk/DroolsRobocode/src/zion/LeaderFound.java | Java | gpl3 | 249 |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package zion;
/**
*
* @author ribadas
*/
public class EstadoBatalla {
private double anchoCampo;
private double altoCampo;
private int numeroRondas;
private int rondaActual;
private long tiempo;
... | zyon-group-pe | trunk/DroolsRobocode/src/zion/EstadoBatalla.java | Java | gpl3 | 1,721 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/DroolsRobocode/src/zion/Xitaozinho.java | Java | gpl3 | 5,951 |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package zion;
/**
* Funciones auxiliares para menejar angulos, distancias, puntos, etc.
* Extraidas de <a href="http://www.robocode-argentina.com.ar/descargas/trig.doc">Robocode Argentina</a>
* @author ribadas
*/
pu... | zyon-group-pe | trunk/DroolsRobocode/src/zion/Auxiliar.java | Java | gpl3 | 2,983 |
package zion;
import java.io.Serializable;
public class EnemySpotted implements Serializable{
private String enemyName;
private double x;
private double y;
public EnemySpotted(String enemyName, double x, double y) {
this.enemyName = enemyName;
this.x = x;
this.y = y;
}
public String getEnemyName() {... | zyon-group-pe | trunk/DroolsRobocode/src/zion/EnemySpotted.java | Java | gpl3 | 1,036 |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package zion;
import java.util.List;
import java.util.Vector;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuild... | zyon-group-pe | trunk/DroolsRobocode/src/zion/CheckRules.java | Java | gpl3 | 3,326 |
package zion;
import java.io.Serializable;
import robocode.ScannedRobotEvent;
public class EnemyData implements Serializable {
Point p;
double enemyVelocity;
double enemyHeading;
public EnemyData(Point p, double enemyVelocity, double enemyHeading) {
super();
this.p = p;
this.enemyVelocity = enemyVeloc... | zyon-group-pe | trunk/DroolsRobocode/src/zion/EnemyData.java | Java | gpl3 | 371 |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package zion;
import java.awt.Color;
import java.awt.Graphics2D;
import java.util.Vector;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
import org.drools.builder.KnowledgeBuilder;
import org.... | zyon-group-pe | trunk/DroolsRobocode/src/zion/Djah.java | Java | gpl3 | 8,546 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/DroolsRobocode/src/zion/Point.java | Java | gpl3 | 971 |
/*******************************************************************************
* Copyright (c) 2001, 2010 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies th... | zyon-group-pe | trunk/DroolsRobocode/src/zion/RobotColors.java | Java | gpl3 | 998 |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package zion;
import java.io.IOException;
import java.io.Serializable;
import robocode.AdvancedRobot;
import robocode.TeamRobot;
/**
*
* @author ribadas
*/
public class Accion {
private int tipo;
pr... | zyon-group-pe | trunk/DroolsRobocode/src/zion/Accion.java | Java | gpl3 | 3,934 |
package droolsIntegration;
import java.awt.Color;
import java.awt.Graphics2D;
import java.util.Vector;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import ... | zyon-group-pe | trunk/DroolsRobocode/src/droolsIntegration/DroolsRobot.java | Java | gpl3 | 6,508 |
package droolsIntegration;
import robocode.AdvancedRobot;
public class Action {
private ActionType type;
private double parameter;
private int priority;
private AdvancedRobot robot;
public Action(ActionType type, double parameter, int priority) {
super();
this.type = type;
this.parameter = parameter;
... | zyon-group-pe | trunk/DroolsRobocode/src/droolsIntegration/Action.java | Java | gpl3 | 1,736 |
package droolsIntegration;
public enum ActionType {
AHEAD,
FIRE,
BACK,
STOP,
TURN_GUN_RIGHT,
TURN_GUN_LEFT,
TURN_RADAR_RIGHT,
TURN_RADAR_LEFT,
TURN_RIGHT,
TURN_LEFT
}
| zyon-group-pe | trunk/DroolsRobocode/src/droolsIntegration/ActionType.java | Java | gpl3 | 181 |
package droolsIntegration;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import java.util.Vector;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools... | zyon-group-pe | trunk/DroolsRobocode/src/droolsIntegration/RulesBasedRobot.java | Java | gpl3 | 4,404 |
package droolsIntegration;
import java.awt.Color;
import java.awt.Graphics2D;
public class DjahOMatador extends RulesBasedRobot {
@Override
public void run() {
setAdjustGunForRobotTurn(true);
setAdjustRadarForGunTurn(true);
setAdjustRadarForRobotTurn(true);
super.run();
}
@Override
public void defineRu... | zyon-group-pe | trunk/DroolsRobocode/src/droolsIntegration/DjahOMatador.java | Java | gpl3 | 926 |
package droolsIntegration;
public class BattleState {
private double arenaWidth;
private double arenaHeight;
private int roundsNumber;
private int currentRound;
private long timestamp;
private int enemyQuantity;
public BattleState(double arenaWidth, double arenaHeight, int roundsNumber,
int currentRoun... | zyon-group-pe | trunk/DroolsRobocode/src/droolsIntegration/BattleState.java | Java | gpl3 | 1,469 |
package droolsIntegration;
import robocode.AdvancedRobot;
public class RobotState {
private final double distanceRemaining;
private final double energy;
private final double gunHeading;
private final double gunHeat;
private final double gunTurnRemaining;
private final double heading;
private final int numRoun... | zyon-group-pe | trunk/DroolsRobocode/src/droolsIntegration/RobotState.java | Java | gpl3 | 2,353 |
10 CLEAR VAL "32767": LOAD ""SCREEN$: LOAD ""CODE: RANDOMIZE USR VAL "32768"
| zxquiz | zxkviz.bas | BASIC | gpl3 | 78 |
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#define BR_PIT 20 // Ukupan broj pitanja u bazi
#define BR_ODG 4 // Broj odgovora po pitanju
#define BR_KVPIT 10 // Broj pitanja u kvizu
#define VREME_PIT 60 //Vreme po pitanju (sek.)
char *pitanja[BR_PIT]={
"Koje godine se 'ZX Spectrum' pojavio na trzistu?"... | zxquiz | zxquiz.c | C | gpl3 | 5,291 |
org 32768
incbin "zxq"
| zxquiz | zxq-inc.asm | Motorola 68K Assembly | gpl3 | 23 |
zxkviz.tap: zxkvizbas.tap zxq-scr.tap zxq-bin.tap
cat zxkvizbas.tap zxq-scr.tap zxq-bin.tap > zxkviz.tap
zxq: zxquiz.c
zcc +zx -lndos -create-app -o zxq zxquiz.c
zxkvizbas.tap: zxkviz.bas
zmakebas -a10 -n "ZX Kviz" -o zxkvizbas.tap zxkviz.bas
zxq-scr.tap: zx_Kvizscr-inc.asm ZXKviz-oupb256192-4bit.png.scr
pasmo --t... | zxquiz | Makefile | Makefile | gpl3 | 446 |
org 16384
incbin "ZXKviz-oupb256192-4bit.png.scr"
| zxquiz | zx_Kvizscr-inc.asm | Motorola 68K Assembly | gpl3 | 50 |
#include "ngx_ngim.h"
static u_char *
ngx_ngim_curl_connection_log_error(ngx_log_t *log, u_char *buf, size_t len);
void
ngx_ngim_init_connection(ngx_connection_t *c)
{
ngx_uint_t i;
ngx_ngim_port_t *port;
struct sockaddr *sa;
struct sockaddr_in *sin;
ngx_ngim_in_addr_t ... | zy-code-unp | trunk/nginm/ngx_ngim_connection.c | C | bsd | 9,171 |
#include "ngx_ngim.h"
#include "ngx_ngim_util.h"
#include "ngx_ngim_curl.h"
/*static method */
static u_char *ngx_ngim_log_error(ngx_log_t *log, u_char *buf, size_t len);
static void ngx_ngim_close_session_handler(ngx_event_t *e);
static void ngx_ngim_detect_protocol(ngx_ngim_session_t *s);
static void ... | zy-code-unp | trunk/nginm/ngx_ngim_session.c | C | bsd | 7,775 |
#include "ngx_ngim_http.h"
#include "ngx_ngim_curl.h"
#include "ngx_ngim_http_module.h"
static ngx_int_t
ngx_ngim_http_alloc_large_header_buffer(ngx_http_request_t *r, ngx_uint_t request_line);
static ssize_t
ngx_ngim_http_read_request_header(ngx_http_request_t *r,ngx_msec_t client_header_timeout);
static void
ngx... | zy-code-unp | trunk/nginm/ngx_ngim_http.c | C | bsd | 25,641 |
#include "ngx_ngim_curl.h"
#include "ngx_ngim_util.h"
#define CURL_MAX_REDIRECT_NUM 50
static void ngx_ngim_curl_set_common_opt(ngx_ngim_easyinfo_t *easyinfo);
static int ngx_ngim_curl_close_socket(void *clientp, curl_socket_t item);
static int ngx_ngim_multi_timer_cb(CURLM *multi, long timeout_ms, ngx_ngim_core_... | zy-code-unp | trunk/nginm/ngx_ngim_curl.c | C | bsd | 22,516 |
#!/bin/bash
test $# == 0 && CNT=10 || CNT=$1
echo "cnt:;;;;"$CNT
for (( i=0 ;i < CNT ; i++ ))
do
echo "cnt:$i"
curl "http://127.0.0.1:1982/x"
done
| zy-code-unp | trunk/nginm/test/.svn/text-base/check.sh.svn-base | Shell | bsd | 159 |
#!/bin/bash
test $# == 0 && CNT=10 || CNT=$1
echo "cnt:;;;;"$CNT
for (( i=0 ;i < CNT ; i++ ))
do
echo "cnt:$i"
curl "http://127.0.0.1:1982/x"
done
| zy-code-unp | trunk/nginm/test/check.sh | Shell | bsd | 159 |
#include "ngx_ngim_tcp.h"
void ngx_ngim_tcp_send(ngx_event_t *wev)
{
}
void ngx_ngim_tcp_recv(ngx_event_t *rev)
{
ngx_connection_t *c;
ngx_ngim_session_t *s;
c = rev->data;
s = c->data;
ngx_log_debug0(NGX_LOG_DEBUG_NGIM, s->connection->log, 0,
"ngx_ngim_http_recv b... | zy-code-unp | trunk/nginm/ngx_ngim_tcp.c | C | bsd | 381 |
/*
Copyright (c) 2009 Dave Gamble
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, dist... | zy-code-unp | trunk/nginm/cjson/cJSON.h | C | bsd | 5,778 |
/*
Copyright (c) 2009 Dave Gamble
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distr... | zy-code-unp | trunk/nginm/cjson/cJSON.c | C | bsd | 19,526 |
#include "ngx_ngim_util.h"
ssize_t
ngx_ngim_recv_peek(ngx_connection_t *c, u_char *buf, size_t size)
{
ssize_t n;
ngx_err_t err;
ngx_event_t *rev;
rev = c->read;
do {
n = recv(c->fd, buf, size, MSG_PEEK);
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
"re... | zy-code-unp | trunk/nginm/ngx_ngim_util.c | C | bsd | 1,154 |
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
#include "ngx_ngim.h"
#include "ngx_ngim_curl.h"
static u_char *ngx_ngim_main_log_error(ngx_log_t *log, u_char *buf, size_t len);
static ngx_int_t ngx_ngim_core_postconfiguration(ngx_conf_t *cf);
static void *ngx_ngim_core_create_main_conf(ngx_conf_... | zy-code-unp | trunk/nginm/ngx_ngim_core_module.c | C | bsd | 21,289 |
#ifndef _NGX_NGIM_UTIL_H_INCLUDED_
#define _NGX_NGIM_UTIL_H_INCLUDED_
#include "ngx_ngim.h"
ssize_t ngx_ngim_recv_peek(ngx_connection_t *c, u_char *buf, size_t size);
#endif //_NGX_NGIM_UTIL_H_INCLUDED_
| zy-code-unp | trunk/nginm/ngx_ngim_util.h | C | bsd | 207 |
#include "ngx_ngim.h"
#include "ngx_ngim_http.h"
static ngx_int_t ngx_ngim_http_header_filter_init(ngx_conf_t *cf);
static ngx_int_t ngx_ngim_http_header_filter(ngx_http_request_t *r);
static ngx_ngim_module_t ngx_ngim_http_header_filter_module_ctx = {
NULL, /* preconfiguration... | zy-code-unp | trunk/nginm/ngx_ngim_http_header_filter_module.c | C | bsd | 18,302 |
#include "ngx_ngim_http_module.h"
#include "ngx_ngim_curl.h"
#define ngx_ngim_prepare_response_has_done(s,proto) ngx_ngim_request_has_done((s),(proto),NGX_NGIM_HTTP_CTX_PREPARE_RESPONSE_FINISH)
static ngx_conf_bitmask_t ngx_ngim_task_http_which_mask[] = {
{ ngx_string("all"), NGX_NGIM_WHICH_ALL ... | zy-code-unp | trunk/nginm/ngx_ngim_http_module.c | C | bsd | 19,428 |
#ifndef _NGX_NGIM_TCP_H_INCLUDED_
#define _NGX_NGIM_TCP_H_INCLUDED_
#include "ngx_ngim.h"
void ngx_ngim_tcp_send(ngx_event_t *wev);
void ngx_ngim_tcp_recv(ngx_event_t *rev);
void ngx_ngim_tcp_done(ngx_ngim_session_t *s);
#endif //_NGX_NGIM_TCP_H_INCLUDED_
| zy-code-unp | trunk/nginm/ngx_ngim_tcp.h | C | bsd | 261 |
#ifndef _NGX_NGIM_CURL_H_INCLUDED_
#define _NGX_NGIM_CURL_H_INCLUDED_
#include "ngx_ngim.h"
#include "ngx_ngim_http_module.h"
typedef enum {
easyinfo_init=0,
easyinfo_running,
easyinfo_remove_sock,
easyinfo_done,
easyinfo_reset,
easyinfo_cleanuped
} ngi_ngim_easyinfo_stat_t;
/* Information associa... | zy-code-unp | trunk/nginm/ngx_ngim_curl.h | C | bsd | 1,483 |
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
#include "ngx_ngim.h"
static char *ngx_ngim_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
static ngx_int_t ngx_ngim_add_ports(ngx_conf_t *cf, ngx_array_t *ports,
ngx_ngim_listen_t *listen);
static char *ngx_ngim_optimize_servers(ngx_con... | zy-code-unp | trunk/nginm/ngx_ngim.c | C | bsd | 21,949 |
#ifndef _NGX_NGIM_HTTP_MODULE_H_INCLUDED_
#define _NGX_NGIM_HTTP_MODULE_H_INCLUDED_
#include "ngx_ngim.h"
#include "ngx_ngim_http.h"
/* define */
#define PROTO_TAG "GPDH"
/* enum */
enum {
NGX_NGIM_HTTP_CTX_INIT,
NGX_NGIM_HTTP_CTX_DO_REQUEST_FINISH,
NGX_NGIM_HTTP_CTX_PREPARE_RESPONSE_FINISH,
NGX_NGIM_HTTP_CT... | zy-code-unp | trunk/nginm/ngx_ngim_http_module.h | C | bsd | 1,419 |
#ifndef _NGX_NGIM_HTTP_H_INCLUDED_
#define _NGX_NGIM_HTTP_H_INCLUDED_
#include "ngx_ngim.h"
extern ngx_uint_t ngx_ngim_http_process_request(ngx_http_request_t *r);
ngx_int_t (*ngx_ngim_http_top_header_filter) (ngx_http_request_t *r);
ngx_uint_t ngx_ngim_http_send_header(ngx_http_request_t *r);
ngx_int_t ngx_ngim... | zy-code-unp | trunk/nginm/ngx_ngim_http.h | C | bsd | 478 |
#include "ngx_ngim.h"
static ngx_uint_t postpone_output = 1460;
static ngx_uint_t limit_rate_after = 0;
static ngx_uint_t sendfile_max_chunk = 0;
static ngx_int_t ngx_ngim_write_filter_init(ngx_conf_t *cf);
static ngx_int_t ngx_ngim_body_write_filter(ngx_ngim_session_t *s, ngx_chain_t *in);
static ngx_ngim_module_t ... | zy-code-unp | trunk/nginm/ngx_ngim_write_filter_module.c | C | bsd | 8,612 |
#ifndef _NGX_NGIM_H_INCLUDED_
#define _NGX_NGIM_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
#include <ngx_event_connect.h>
#include <ngx_http.h>
#include <curl/curl.h>
#include "cjson/cJSON.h"
/* define */
#define NGX_NGIM_VERSION 1
#define NGX_LOG_DEBUG_NGIM ... | zy-code-unp | trunk/nginm/ngx_ngim.h | C | bsd | 10,264 |
#include "unp.h"
int main(int argc , char * argv[])
{
pool_t *pool;
mqd_t mqd;
struct mq_attr attr;
unsigned int prio = 0;
int ret,len;
/*,len;
while( (ret=getopt(argc,argv,":l:p:")) != -1){
switch(ret){
case 'l':
len = atoi(optarg);
break;
case 'p':
... | zy-code-unp | trunk/test/mq_receive.c | C | bsd | 1,308 |
#include "unp.h"
typedef void (*Sigfunc_rt) (int,siginfo_t *,void *);
static Sigfunc_rt Signal_rt(int signo,Sigfunc_rt func,sigset_t *mask);
static void sig_rt(int signo,siginfo_t *info,void *context);
int main(int argc,char *argv[])
{
int i,j;
pid_t pid;
sigset_t newset;
union sigval val;
printf("SIGR... | zy-code-unp | trunk/test/realtime_sig.c | C | bsd | 1,629 |
#include "unp.h"
mqd_t mqd;
void *buff;
struct mq_attr attr;
struct sigevent sigev;
static void notify_thread(union sigval);
int main(int argc,char *argv[])
{
//int rc = -1;
mqd = mq_open(argv[1],O_RDONLY | O_NONBLOCK);
if(mqd == -1)
err_sys("mq_open error");
if(mq_getattr(mqd,&attr) == -1)
... | zy-code-unp | trunk/test/mq_notifysig_pthread.c | C | bsd | 1,072 |
#include "unp.h"
#define read_lock(fd,offset,whence,len) \
flock_reg(fd,F_SETLK,F_RDLCK,offset,whence,len)
#define readw_lock(fd,offset,whence,len) \
flock_reg(fd,F_SETLKW,F_RDLCK,offset,whence,len);
#define write_lock(fd,offset,whence,len) \
flock_reg(fd,F_SETLK,F_WRLCK,offset,whence,len... | zy-code-unp | trunk/test/flock/flock.c | C | bsd | 2,079 |
flock.o flock.d : flock.c ../include/unp.h ../include/my_error.h \
../include/mem_pool.h ../include/inet.h ../include/event.h \
../include/thread_pool.h
| zy-code-unp | trunk/test/flock/flock.d | Makefile | bsd | 157 |
VPATH=.:../lib
CC=gcc
CXX=g++
INCLUDES=-I../include/
CFLAGS=-Wall -g -o2 $(INCLUDES)
LDFLAGS=
DEPLIBS=-lrt
TARGET = flock
TARGET_g:=$(foreach t,$(TARGET),$(t)_g)
SOURCES=$(foreach t,$(TARGET),$(t).c)
COMMON_OBJS=my_error.o mem_pool.o inet.o event.o thread_pool.o block_queue.o
OBJS = $(foreach t,$(TARGET),$(t).o) ... | zy-code-unp | trunk/test/flock/Makefile | Makefile | bsd | 796 |
define fun
echo $(firstword $@)
endef
all a:
@echo "show"
@echo $@
echo $(fun)
.PHONY:all
| zy-code-unp | trunk/test/subdir/Makefile | Makefile | bsd | 95 |
#!/bin/bash
urls=( "http://127.0.0.1/crossdomain.xml" "http://127.0.0.1/index.xml" "http://127.0.0.1/Company/ContactUs.html" "http://127.0.0.1/Company/symbiosis.html" )
size=${#urls[@]}
for ((i=0;i<$1;i++ )) do
echo "${urls[$i%$size]}"
curl "${urls[$i%$size]}" -o ./html/idx_$i.html
done
| zy-code-unp | trunk/test/shell/.svn/text-base/bench.sh.svn-base | Shell | bsd | 294 |
#!/bin/bash
cnt=1000000
for ((i=0;i<$cnt;i++))
do
./a.out
done
| zy-code-unp | trunk/test/shell/.svn/text-base/shorturl.sh.svn-base | Shell | bsd | 65 |
#!/bin/bash
expire_minute=10
sleep_sec=8
media_file_home="/data34/"
manifile="/data/proxy_cache_dir/cuclive/livestream/manifest.f4m"
urlbase="http://l2.cuctv.com/cuclive/livestream"
parse_urlbase="http://192.168.233.128:8383/cuclive/livestream"
echo "starting `date +"%F %T"`"
if [ ! -e $media_file_home ] ; then
mk... | zy-code-unp | trunk/test/shell/.svn/text-base/liverobot.sh.svn-base | Shell | bsd | 1,860 |
#!/bin/bash
urls=( "http://127.0.0.1/crossdomain.xml" "http://127.0.0.1/index.xml" "http://127.0.0.1/Company/ContactUs.html" "http://127.0.0.1/Company/symbiosis.html" )
size=${#urls[@]}
for ((i=0;i<$1;i++ )) do
echo "${urls[$i%$size]}"
curl "${urls[$i%$size]}" -o ./html/idx_$i.html
done
| zy-code-unp | trunk/test/shell/bench.sh | Shell | bsd | 294 |
#!/bin/bash
cnt=1000000
for ((i=0;i<$cnt;i++))
do
./a.out
done
| zy-code-unp | trunk/test/shell/shorturl.sh | Shell | bsd | 65 |
#!/bin/bash
expire_minute=10
sleep_sec=8
media_file_home="/data34/"
manifile="/data/proxy_cache_dir/cuclive/livestream/manifest.f4m"
urlbase="http://l2.cuctv.com/cuclive/livestream"
parse_urlbase="http://192.168.233.128:8383/cuclive/livestream"
echo "starting `date +"%F %T"`"
if [ ! -e $media_file_home ] ; then
mk... | zy-code-unp | trunk/test/shell/liverobot.sh | Shell | bsd | 1,860 |
gcc -g -Iinclude/ lib/fileutil.c lib/my_error.c -L /usr/local/lib/ lib/mem_pool.c testfile.c -ljson
| zy-code-unp | trunk/test/shell/testfile.sh | Shell | bsd | 111 |
VPATH=.:lib
CC=gcc
CXX=g++
INCLUDES=-Iinclude/
CFLAGS=-Wall -g -o2 $(INCLUDES)
LDFLAGS=
DEPLIBS=-lrt
TARGET = mq_create mq_unlink mq_attr mq_send mq_receive mq_notifysig mq_notifysig2 mq_notifysig3 mq_notifysig_pipe mq_notifysig_pthread realtime_sig msg
TARGET_g:=$(foreach t,$(TARGET),$(t)_g)
SOURCES=$(foreach t,$(TA... | zy-code-unp | trunk/test/Makefile | Makefile | bsd | 927 |
#include "unp.h"
int main(int argc , char *argv[])
{
pool_t *pool;
mqd_t mqd;
int ret , len , pro;
while( (ret = getopt(argc,argv,":l:p:")) != -1){
switch(ret){
case 'l':
len = atoi(optarg);
break;
case 'p':
pro = atoi(optarg);
break;
... | zy-code-unp | trunk/test/mq_send.c | C | bsd | 1,046 |
#include "sysv_msg.h"
#define MAX_LEN 1024
int main(int argc,char *argv[])
{
int mqid,c,oflag,size;
long type;
size_t len;
struct msgbuf *buf;
type = oflag = 0;
while((c=getopt(argc,argv,"nt:")) !=-1){
switch(c){
case 'n':
oflag |= IPC_NOWAIT;
break;
case 't':
ty... | zy-code-unp | trunk/test/sysv_msg/msgrcv.c | C | bsd | 780 |
VPATH=.:../lib
CC=gcc
CXX=g++
INCLUDES=-I../include/
CFLAGS=-Wall -g -o2 $(INCLUDES)
LDFLAGS=
DEPLIBS=-lrt
TARGET = ctl msgget msgsnd msgrcv msgrmid
TARGET_g:=$(foreach t,$(TARGET),$(t)_g)
SOURCES=$(foreach t,$(TARGET),$(t).c)
COMMON_OBJS=my_error.o mem_pool.o inet.o event.o thread_pool.o block_queue.o
OBJS = $(fo... | zy-code-unp | trunk/test/sysv_msg/Makefile | Makefile | bsd | 822 |
#include "sysv_msg.h"
int main(int argc,char *argv[])
{
int mqid;
long type;
size_t len;
struct msgbuf *buf;
if(argc != 4)
err_quit("Usage: msgsnd <pathname> bytes type");
len = atoi(argv[2]);
type = atoi(argv[3]);
mqid = msgget(ftok(argv[1],0),MSG_W);
if(mqid ==-1)
err_sys("msgget er... | zy-code-unp | trunk/test/sysv_msg/msgsnd.c | C | bsd | 532 |
#include "sysv_msg.h"
int main(int argc,char *argv[])
{
int msqid;
struct msqid_ds info;
struct msgbuf buf;
msqid = msgget(IPC_PRIVATE,MSG_MODE | IPC_CREAT);
if(msqid == -1)
err_sys("msgget error");
buf.mtype = 1;
buf.mtext[0] = 1;
if(msgsnd(msqid,&buf,1,0) ==-1)
err_sys("msgsnd error"); ... | zy-code-unp | trunk/test/sysv_msg/ctl.c | C | bsd | 687 |
#include "sysv_msg.h"
int main(int argc ,char *argv[])
{
if(argc != 2)
err_sys("Usage: msgrmid <pathname>");
int mqid;
mqid = msgget(ftok(argv[1],0),0);
if(mqid == -1)
err_sys("msgget error");
if(msgctl(mqid,IPC_RMID,NULL) ==-1)
err_sys("msgctl rmid error");
return 0;
}
| zy-code-unp | trunk/test/sysv_msg/msgrmid.c | C | bsd | 313 |
#include "sysv_msg.h"
int main(int argc,char *argv[])
{
int c , flag , mqid;
flag = MSG_MODE | IPC_CREAT;
while((c=getopt(argc,argv,"e")) !=-1){
switch(c){
case 'e':
flag |= IPC_EXCL;
break;
}
}
if(optind != (argc-1))
err_sys("Usage: msgget [-e] <pathname>");
m... | zy-code-unp | trunk/test/sysv_msg/msgget.c | C | bsd | 421 |
#include "unp.h"
#include <sys/msg.h>
typedef unsigned long ulong_t;
struct msgbuf {
long mtype;
char mtext[1];
};
| zy-code-unp | trunk/test/sysv_msg/sysv_msg.h | C | bsd | 125 |
#include "unp.h"
int main(int argc , char *argv[])
{
mqd_t mqd;
struct mq_attr attr;
int ret;
if(argc < 2 )
err_quit("Usage: mq_attr <name>");
mqd = mq_open(argv[1],O_RDONLY);
if(mqd == -1)
err_sys("mq_open error!");
ret = mq_getattr(mqd,&attr);
if( ret == -1)
err_sys("mq_get... | zy-code-unp | trunk/test/mq_attr.c | C | bsd | 527 |
#include "unp.h"
int main(int argc , char * argv[])
{
if(argc < 2)
err_quit("usage: mq_unlink <name>");
int ret = mq_unlink(argv[1]);
if(ret != 0)
err_sys("mq_unlink error :%s",argv[1]);
return 0;
}
| zy-code-unp | trunk/test/mq_unlink.c | C | bsd | 225 |
#include "unp.h"
int main(int argc ,char *argv[])
{
size_t n;
char buf[MAXLINE],command[MAXLINE+1];
FILE *fp;
if(fgets(buf,MAXLINE,stdin) == NULL){
err_sys("fgets");
}
n = strlen(buf);
if(buf[n-1] == '\n')
n--;
snprintf(command,MAXLINE,"cat %s",buf);
fp = popen(command,"r");
... | zy-code-unp | trunk/test/pipe/mainpopen.c | C | bsd | 466 |
#include "unp.h"
#define fifo1 "/tmp/fifo1"
#define fifo2 "/tmp/fifo2"
void client(int,int) , server(int,int);
int main(int argc ,char *argv[])
{
int in,out;
pid_t childpid;
if((mkfifo(fifo1,FILE_MODE)) ==-1 && errno != EEXIST) {
err_sys("mkfifo errror");
}
if((mkfifo(fifo2,FILE_MODE)... | zy-code-unp | trunk/test/pipe/mainfifo.c | C | bsd | 987 |
#include "unp.h"
void client(int in,int out)
{
size_t len;
ssize_t n;
char buf[MAXLINE];
if(fgets(buf,MAXLINE,stdin) == NULL)
{
err_sys("fgets error");
}
len = strlen(buf);
if(buf[len-1] == '\n'){
len--;
}
n = write(out,buf,len);
if(n != len){
err_sys("write error");
}
w... | zy-code-unp | trunk/test/pipe/client.c | C | bsd | 436 |
VPATH=.:lib
CC=gcc
CXX=g++
INCLUDES=-Iinclude/
CFLAGS=-Wall -g -o2 $(INCLUDES)
LDFLAGS=
DEPLIBS=-lrt
TARGET = mq_create mq_unlink mq_attr mq_send mq_receive msg
TARGET_g:=$(foreach t,$(TARGET),$(t)_g)
SOURCES=$(foreach t,$(TARGET),$(t).c)
COMMON_OBJS=my_error.o mem_pool.o inet.o event.o thread_pool.o block_queue.o... | zy-code-unp | trunk/test/pipe/Makefile | Makefile | bsd | 834 |
#include "unp.h"
void client(int,int) , server(int,int);
int main(int argc ,char *argv[])
{
int pipe1[2],pipe2[2];
pid_t childpid;
if(pipe(pipe1) == -1 || pipe(pipe2) == -1) {
err_sys("pipe1 errror");
}
if((childpid=fork()) ==-1)
{
err_sys("fork error");
}else if(childpi... | zy-code-unp | trunk/test/pipe/mainpipe.c | C | bsd | 687 |