int InspectContinuation(char* str, int len, Object* continuation){
  Continuation* cont = TakeContinuation(continuation);
  char exp[128]  = {'\0'}; Describe(exp,  128, cont->exp);
  char args[128] = {'\0'}; Describe(args, 128, cont->args);
  char env[128]  = {'\0'}; Describe(env,  128, cont->environment);
  return snprintf(str, len, "#<continuation:%lld exp=%s, args=%s, env=%s, next_id=%lld>",
		  IdToInt(continuation->id), exp, args, env, isNil(cont->next) ? 0 : IdToInt(cont->next->id));
}
static char* DescribeComponent(unsigned int i,char* buffer,char* open, char* close) // verbal or phrase or clause
{
	strcat(buffer,open);
	Describe(i,buffer);
	strcat(buffer,close);
	return buffer;
}
Exemple #3
0
/* Have the human or the computer move */
void Move(Board_Type Board, Square_Type Player, int Move_Nbr)
{
    int Square;
	int keyboardNums[9] = { 7, 8, 9, 4, 5, 6, 1, 2, 3 };

    if (Player == 'X')
	{
		Total_Nodes = 0;
		Describe(Best_Move(Board, 'X', &Square, Move_Nbr, -Infinity, Infinity));
		printf("%d nodes examined.\n", Total_Nodes);
		Play(Board, Square, 'X');
		printf("Move #%d - X moves to %d\n", Move_Nbr, Square + 1);
    }
	else
	{
		do
		{
			/*printf("Move #%d - What is O's move? ", Move_Nbr);*/
			printf("Enter the position you would like to place a move: ", Move_Nbr);
			scanf_s("%d", &Square);
			Square = keyboardNums[Square - 1];
			Square--;
		}
		while (Board[Square] != ' ');
		Play(Board, Square, 'O');
    }
}
/*---------------------------------------------------------------------------*/
void wxSQLBook::OnDescribeClick(wxCommandEvent& event)
{
    wxString item = GetCurrentItem();

    if (!item.IsEmpty())
        Describe(item);
}
bool CDbgLuaHelper::Eval(const char *szCode, char* szRet)
{
    CoverGlobals();

    int top = lua_gettop(L);
    int status = luaL_loadbuffer(L, szCode, xr_strlen(szCode), szCode);
    if ( status )
        sprintf(szRet, "%s", luaL_checkstring(L, -1));
    else
    {
        status = lua_pcall(L, 0, LUA_MULTRET, 0);  /* call main */
        if ( status )
        {
            const char* szErr = luaL_checkstring(L, -1);
            const char* szErr2 = strstr(szErr, ": ");
            sprintf(szRet, "%s", szErr2?(szErr2+2):szErr);
        }
        else
            Describe(szRet, -1);
    }

    lua_settop(L, top);

    RestoreGlobals();

    return !status;
}
bool CDbgLuaHelper::GetCalltip(const char *szWord, char *szCalltip)
{
    int nLevel = debugger()->GetStackTraceLevel();
    lua_Debug ar;
    if ( lua_getstack (L, nLevel, &ar) )
    {
        int i = 1;
        const char *name;
        while ((name = lua_getlocal(L, &ar, i++)) != NULL) {
            if ( xr_strcmp(name, szWord)==0 )
            {
                char szRet[64];
                Describe(szRet, -1);
                sprintf(szCalltip, "local %s : %s ", name, szRet);
                lua_pop(L, 1);  /* remove variable value */
                return true;
            }

            lua_pop(L, 1);  /* remove variable value */
        }
    }

    lua_pushvalue(L, LUA_GLOBALSINDEX);

    lua_pushnil(L);  /* first key */
    while (lua_next(L, -2))
    {
        const char* name = lua_tostring(L, -2);
        if ( xr_strcmp(name, szWord)==0 )
        {
            char szRet[64];
            Describe(szRet, -1);
            sprintf(szCalltip, "global %s : %s ", name, szRet);

            lua_pop(L, 3);  /* remove table, key, value */

            return true;
        }

        lua_pop(L, 1); // pop value, keep key for next iteration;
    }
    lua_pop(L, 1); // pop table of globals;

    return false;
}
int DescribeConsCell(char* str, int len, Object* cell){
  char car_buf[512] = {'\0'};
  char cdr_buf[512] = {'\0'};
  Describe(car_buf, 512, Car(cell));
  Describe(cdr_buf, 512, Cdr(cell));

  if( !isNil(cell) && isString(cell) )
    return DescribeString(str, len, cell);

  if(isConsCell(Cdr(cell)))
    return snprintf(str, len, "(%s %s", car_buf, &cdr_buf[1]);
  
  if(isNil(Cdr(cell)))
    return snprintf(str, len, "(%s)", car_buf);
  
  else
    return snprintf(str, len, "(%s . %s)", car_buf, cdr_buf);
}
Exemple #8
0
void AIChasePet::Update()
{
  AI::Update();
  Assert(m_npc);
  // Head towards target
  Vec3f aim = m_target->GetPos();
  Vec3f vel = aim - m_npc->GetPos();

  static const float MAX_DIST = ROConfig()->GetFloat("dino-chase-dist"); 
  static const float MAX_DIST_SQ = MAX_DIST * MAX_DIST;

  float sqlen = vel.SqLen();
  if (sqlen < 1.0f)
  {
std::cout << "AI chase: " << Describe(m_npc) << " has reached target " <<
  Describe(m_target) << "!\n";

    m_npc->DecideAI();
  }
  else if (sqlen < MAX_DIST_SQ) 
  {
    vel.Normalise();

    static const float SPEED = ROConfig()->GetFloat("dino-chase-speed"); 
    vel *= SPEED;
    Vec3f v = m_npc->GetVel();
    v.x = vel.x;
    v.z = vel.z;
    m_npc->SetVel(v);
    float degs = RadToDeg(atan2(vel.x, vel.z)); 

    m_npc->SetDir(degs);
    m_npc->SetIsControlled(true); 
    m_npc->SetAnim("run");
  }
  else
  {
#ifdef _DEBUG
    std::cout << m_npc->GetTypeName() << " giving up chase\n";
#endif
    m_npc->SetAI(AIIdle::NAME);
  }
}
Exemple #9
0
void main() {
    Describe("Player", []() {
        Expect(true).ToBeTruthy();
        It("should be able to play a Song", []() {
            Expect(true).ToBeTruthy();
        });
        Describe("when song has been paused", []() {
            It("should indicate that the song is currently paused", []() {
                Expect(true).ToBeTruthy();
            });
            It("should be possible to resume", []() {
                Expect(true).ToBeTruthy();
            });
        });
        It("tells the current song if the user has made it a favorite", []() {
            Expect(true).ToBeTruthy();
        });
        Describe("alway error", []() {
            Expect("always error").ToBe("error");
        });
    });
}
void CProtocolExaout::Identify(TServerProtocolDesc *aDesc) const
	/**
	* Returns description of this protocol.
	*
	* The description is required by this and also by CProtocolFamilyBase::ProtocolList,
	* which in the example enviroment gets translated into a call to the
	* Describe. Identify can use the same function.
	*/
	{
/** @code */
	Describe(*aDesc);
/** @endcode */
	}
Exemple #11
0
void main() {
    debug();
    Describe("RGBAImage<byte>", []() {
        It("should be able to read data from bmp file", []() {
            RGBAImage<byte> image("TestResources/rgbw_2x2.bmp");
            Expect(image.GetPixel(0, 0)).ToBe(RGBAColor<byte>(255, 0, 0, 255));
            Expect(image.GetPixel(1, 0)).ToBe(RGBAColor<byte>(0, 255, 0, 255));
            Expect(image.GetPixel(0, 1)).ToBe(RGBAColor<byte>(0, 0, 255, 255));
            Expect(image.GetPixel(1, 1)).ToBe(RGBAColor<byte>(255, 255, 255, 255));
        });
        Describe("when read lena.bmp finished", []() {
            RGBAImage<byte> image("TestResources/Lena.bmp");
            It("should be able to get width and height", [&image]() {
                Expect(image.Height()).ToBe(512);
                Expect(image.Width()).ToBe(512);
            });
            It("should be able to get pixel", [&image]() {
                Expect(image.GetPixel(0, 0)).ToBe(RGBAColor<byte>(225, 138, 128, 255));
            });
            It("should be able to indexof sub image", [&image]() {
                RGBAImage<byte> sub1("TestResources/IndexOf/sub1.bmp");
                RGBAImage<byte> sub2("TestResources/IndexOf/sub2.bmp");
                RGBAImage<byte> sub3("TestResources/IndexOf/sub3.bmp");
                Expect(image.IndexOf(sub1)).ToBe(Coord<short>(0, 0));
                Expect(image.IndexOf(sub2)).ToBe(Coord<short>(1, 500));
                Expect(image.IndexOf(sub3)).ToBe(Coord<short>(122, 237));
            });
        });
    });
    Benchmark("read lene.bmp", []() {
        RGBAImage<byte> image("TestResources/Lena.bmp");
    });
    Benchmark("indexof lene.bmp", []() {
        RGBAImage<byte> sub3("TestResources/IndexOf/sub3.bmp");
        RGBAImage<byte> image("TestResources/Lena.bmp");
        image.IndexOf(sub3);
    });
}
Exemple #12
0
void CProtocolExadump::Identify(TServerProtocolDesc *aDesc) const
	/**
	* Returns the protocol description.
	*
	* The socket server and other protocols use this function to
	* retrieve the basic information about the protocol.
	*
	* @retval	aDesc	The protocol description.
	*/
	{
/** @code */
	Describe(*aDesc);
/** @endcode */
	}
Exemple #13
0
/*
 *      ListDescribe
 *
 *	Author:	Christian Schafmeister (1991)
 *
 *      Fill the string with a description of the list.
 *      It is the callers responsibility to ensure that
 *      the string is long enough to store the description.
 */
void
ListDescribe( LIST lList )
{
OBJEKT          oObj;
int             iSize;
LISTLOOP        llL;

    iSize = iCollectionSize(lList);
    VP0(( "List size=%d\n", iSize ));
    llL = (LISTLOOP)PCollectionLoop( (COLLECTION)lList );
    if ( llL == NULL ) 
	return;
    while ( (oObj = oCollectionNext( (COLLECTION)lList, (GENP *)&llL )) 
								!= NULL ) {
        Describe( oObj );
    }
    VP0(( "--End of list\n" ));
}
Exemple #14
0
void DeleteDeadObjects()
{
  static Game* game = TheGame::Instance();

  GameObjects* objs = game->GetGameObjects(); // map
  for (auto it = objs->begin(); it != objs->end(); )
  {
    PGameObject obj = it->second;

    ++it;

    WWGameObject* ww = dynamic_cast<WWGameObject*>(obj.GetPtr());
    if (ww && ww->IsDead())
    {
#ifdef DEBUG_DELETE_DEAD
      std::cout << "Deleting object " << Describe(ww) << "\n";
#endif
      ww->RemoveFromGame();
    }
  }
}
Exemple #15
0
// Performs a path walk and opens a connection to another node.
void OpenAt(Vfs* vfs, fbl::RefPtr<Vnode> parent, zx::channel channel,
            fbl::StringPiece path, uint32_t flags, uint32_t mode) {
    bool describe;
    uint32_t open_flags;
    FilterFlags(flags, &open_flags, &describe);

    fbl::RefPtr<Vnode> vnode;
    zx_status_t r = vfs->Open(std::move(parent), &vnode, path, &path, open_flags, mode);

    if (r != ZX_OK) {
        FS_TRACE_DEBUG("vfs: open failure: %d\n", r);
    } else if (!(open_flags & ZX_FS_FLAG_NOREMOTE) && vnode->IsRemote()) {
        // Remote handoff to a remote filesystem node.
        vfs->ForwardOpenRemote(std::move(vnode), std::move(channel), std::move(path),
                               flags, mode);
        return;
    }

    if (describe) {
        // Regardless of the error code, in the 'describe' case, we
        // should respond to the client.
        if (r != ZX_OK) {
            WriteDescribeError(std::move(channel), r);
            return;
        }

        OnOpenMsg response;
        memset(&response, 0, sizeof(response));
        zx_handle_t extra = ZX_HANDLE_INVALID;
        Describe(vnode, flags, &response, &extra);
        uint32_t hcount = (extra != ZX_HANDLE_INVALID) ? 1 : 0;
        channel.write(0, &response, sizeof(OnOpenMsg), &extra, hcount);
    } else if (r != ZX_OK) {
        return;
    }

    VnodeServe(vfs, std::move(vnode), std::move(channel), open_flags);
}
void DescribeUnit(unsigned int i, char* buffer, char* msg,unsigned int verbal, unsigned int clause)
{
	char word[MAX_WORD_SIZE];
	if (i) // adjective object or causal infinitive
	{
		strcat(buffer,msg);
		if (verbals[i] != verbal)  
		{
			++describedVerbals;
			describeVerbal[describedVerbals] =  (unsigned char)i;
			sprintf(word,"v%d",describedVerbals);
			strcat(buffer,word);
		}
		else if (clauses[i] != clause)
		{
			++describedClauses;
			describeClause[describedClauses] =  (unsigned char)i;
			sprintf(word,"c%d",describedClauses);
			strcat(buffer,word);
		}
		else Describe(i,buffer);
		strcat(buffer," ");
	}
}
void UIpConnection::LowLevelSend(void* Data, int32 CountBytes, int32 CountBits)
{
	const uint8* DataToSend = reinterpret_cast<uint8*>(Data);

	if( ResolveInfo )
	{
		// If destination address isn't resolved yet, send nowhere.
		if( !ResolveInfo->IsComplete() )
		{
			// Host name still resolving.
			return;
		}
		else if( ResolveInfo->GetErrorCode() != SE_NO_ERROR )
		{
			// Host name resolution just now failed.
			UE_LOG(LogNet, Log,  TEXT("Host name resolution failed with %d"), ResolveInfo->GetErrorCode() );
			Driver->ServerConnection->State = USOCK_Closed;
			delete ResolveInfo;
			ResolveInfo = NULL;
			return;
		}
		else
		{
			uint32 Addr;
			// Host name resolution just now succeeded.
			ResolveInfo->GetResolvedAddress().GetIp(Addr);
			RemoteAddr->SetIp(Addr);
			UE_LOG(LogNet, Log, TEXT("Host name resolution completed"));
			delete ResolveInfo;
			ResolveInfo = NULL;
		}
	}
	 
	// Process any packet modifiers
	if (Handler.IsValid() && !Handler->GetRawSend())
	{
		const ProcessedPacket ProcessedData = Handler->Outgoing(reinterpret_cast<uint8*>(Data), CountBits);

		DataToSend = ProcessedData.Data;
		CountBytes = FMath::DivideAndRoundUp(ProcessedData.CountBits, 8);
		CountBits = ProcessedData.CountBits;
	}

	// Send to remote.
	int32 BytesSent = 0;
	CLOCK_CYCLES(Driver->SendCycles);

	if ( CountBytes > MaxPacket )
	{
		UE_LOG( LogNet, Warning, TEXT( "UIpConnection::LowLevelSend: CountBytes > MaxPacketSize! Count: %i, MaxPacket: %i %s" ), CountBytes, MaxPacket, *Describe() );
	}

	Socket->SendTo(DataToSend, CountBytes, BytesSent, *RemoteAddr);
	UNCLOCK_CYCLES(Driver->SendCycles);
	NETWORK_PROFILER(GNetworkProfiler.FlushOutgoingBunches(this));
	NETWORK_PROFILER(GNetworkProfiler.TrackSocketSendTo(Socket->GetDescription(),DataToSend,BytesSent,NumPacketIdBits,NumBunchBits,NumAckBits,NumPaddingBits,this));
}
Exemple #18
0
void HandleArgs(CommandLine &cl, int argc, char *argv[], Error *error) {
  // Arguments
  cl.add(' ',2,0);
  cl.addargname(' ',"input_matrix");
  cl.addargname(' ',"output_matrix");

  cl.add('r',1);
  cl.addargname('r',"rows");
  cl.adddescription('r',"Only output a selected set rows specified in the string.");
  cl.add('c',1);
  cl.addargname('c',"columns");
  cl.adddescription('c',"Only output a selected set of columns specified in the string.");
  cl.add('z',1);
  cl.addargname('z',"mod_num");
  cl.adddescription('z',"Reorder the matrix rows using the supplied modulus number. For a mod_num of 3, the first row in the new matrix is 0, followed by 3, 6, 9, ..., 1, 4, 7, ...");
  cl.add('s',2);
  cl.addargname('s',"rand_percent");
  cl.addargname('s',"rest_file");
  cl.adddescription('s',"Output a random subset of rows. rand_percent is the fraction of the matrix to output and must be between 0 and 1. The random selection is taken after any other slicing. If rest_file is not NO_OUTPUT, the remaining slice is output to the specified filename.");
  cl.add('t',0);
  cl.adddescription('t',"Output the matix in 'pretty' format.");
  cl.add('b',0);
  cl.adddescription('b',"Output the matix in binary format.");
  cl.add('q',0);
  cl.adddescription('q',"Transpose the matrix.");

  // Stuff for every executable
  cl.addhelp('h',0);
  cl.adddescription('h',"Print out the man page for help");
  cl.add('n',1);
  cl.addargname('n',"notice_level");
  cl.adddescription('n',"Set the degree of program output.  Use: \n\n\t-n  0\tNo output\n\t-n 10\tNormal program output\n\t-n 20\tParameters useful for reproducing the results\n\t-n 30\tAll output");

  // Short Description
  cl.addtoman_chapter("NAME","Perform matrix slicing");

  // Version
  cl.addtoman_chapter("VERSION","Version "+string(YALA_VERSION));

  // Full Description
  const string desc[4]={
    "Perform matrix slicing. The input file and output file are optional. ",
    "If only one is specified, it is assumed to be the input file. ",
    "If the input file or output file not specified, STDIN or STDOUT ",
    "is used to allow for piping."
  };
  cl.addtoman_chapter("DESCRIPTION",4,desc);

  ya_addftmanpage(cl);

  // Authors
  cl.addtoman_chapter("AUTHORS","W. Michael Brown");

  // Parse the commandline
  if (!cl.parse(argc,argv,error)) {
    Describe(cl,cout);
    error->generate_error(0,a::filenameonly(argv[0]),"Bad Command Line\n");
  }

  // Set the notice level
  if (cl['n'])
    error->note.set_notice_level(cl.argint('n',0));

  // Generate a notice with the command line for records purposes
  string cm=cl.program_name();
  for (int j=1; j<argc; j++)
    cm+=' '+string(argv[j]);
  cm+="\n";
  error->note.notice(19,"CommandLine",cm);

  // Output the help
  if (cl['h']) {
    cl.write_man_page(cout,YALA_VERSION,"YALA Utilities");
    exit(0);
  }
}
Exemple #19
0
int main( int argc, char** argv )
{
    InitTests(argc, argv);

    Describe("MeshBuffer")
        .use(dummySignalSandbox)

        .it("can be created, modified and freed.", [](){

            MeshBuffer* buffer = CreateMeshBuffer();
            AddVertexToMeshBuffer(buffer, CreateVertex(0,0,0));
            AddIndexToMeshBuffer(buffer, 0);
            FreeMeshBuffer(buffer);
        })

        .it("can be transformed.", [](){

            MeshBuffer* buffer = CreateMeshBuffer();

            AddVertexToMeshBuffer(buffer, CreateVertex(0,0,0));
            AddIndexToMeshBuffer(buffer, 0);
            AddVertexToMeshBuffer(buffer, CreateVertex(0,1,0));
            AddIndexToMeshBuffer(buffer, 1);

            const Vec3 v = {{1,0,0}};
            const Mat4 m = TranslateMat4(Mat4Identity, v);
            TransformMeshBuffer(buffer, m);

            const Vertex* vertices = GetMeshBufferVertices(buffer);
            const Vec3 v1 = {{1,0,0}};
            const Vec3 v2 = {{1,1,0}};
            Require(vertices[0].position == v1);
            Require(vertices[1].position == v2);
            // TODO: Test if normal and tangent are transformed correctly.

            FreeMeshBuffer(buffer);
        })

        .it("can be appended to another buffer.", [](){

            MeshBuffer* a = CreateMeshBuffer();

            AddVertexToMeshBuffer(a, CreateVertex(0,0,0));
            AddIndexToMeshBuffer(a, 0);
            AddVertexToMeshBuffer(a, CreateVertex(0,1,0));
            AddIndexToMeshBuffer(a, 1);

            MeshBuffer* b = CreateMeshBuffer();

            AddVertexToMeshBuffer(b, CreateVertex(2,3,4));
            AddIndexToMeshBuffer(b, 0);
            AddVertexToMeshBuffer(b, CreateVertex(5,6,7));
            AddIndexToMeshBuffer(b, 1);

            AppendMeshBuffer(a, b, NULL);

            const Vertex* vertices     = GetMeshBufferVertices(a);
            const VertexIndex* indices = GetMeshBufferIndices(a);

            Require(GetMeshBufferVertexCount(a) == 4);
            const Vec3 v2 = {{2,3,4}};
            const Vec3 v3 = {{5,6,7}};
            Require(vertices[2].position == v2);
            Require(vertices[3].position == v3);
            Require(GetMeshBufferIndexCount(a) == 4);
            Require(indices[2] == 2);
            Require(indices[3] == 3);

            FreeMeshBuffer(a);
            FreeMeshBuffer(b);
        })

        .it("can be appended to another buffer while transforming it.", [](){

            MeshBuffer* a = CreateMeshBuffer();

            AddVertexToMeshBuffer(a, CreateVertex(0,0,0));
            AddIndexToMeshBuffer(a, 0);
            AddVertexToMeshBuffer(a, CreateVertex(0,1,0));
            AddIndexToMeshBuffer(a, 1);

            MeshBuffer* b = CreateMeshBuffer();

            AddVertexToMeshBuffer(b, CreateVertex(2,3,4));
            AddIndexToMeshBuffer(b, 0);
            AddVertexToMeshBuffer(b, CreateVertex(5,6,7));
            AddIndexToMeshBuffer(b, 1);

            const Vec3 v = {{1,0,0}};
            const Mat4 m = TranslateMat4(Mat4Identity, v);

            AppendMeshBuffer(a, b, &m);

            const Vertex* vertices     = GetMeshBufferVertices(a);
            const VertexIndex* indices = GetMeshBufferIndices(a);

            Require(GetMeshBufferVertexCount(a) == 4);
            const Vec3 v2 = {{3,3,4}};
            const Vec3 v3 = {{6,6,7}};
            Require(vertices[2].position == v2);
            Require(vertices[3].position == v3);
            Require(GetMeshBufferIndexCount(a) == 4);
            Require(indices[2] == 2);
            Require(indices[3] == 3);
            // TODO: Test if normal and tangent are transformed correctly.

            FreeMeshBuffer(a);
            FreeMeshBuffer(b);
        });

    return RunTests();
}
// Move moving object away from stationary object so they do not intersect.
// Relies on knowing the old (non-intersecting) position of the moving object.
void PreventIntersection(
  GameObject* moving, const GameObject* stationary, const Vec3f& oldPos)
{
std::cout << "Moving apart: moving: " << Describe(moving) << " stnry: " << Describe(stationary) << ": ";

  /* 
  Move back so not interpenetrating:
  Boxes now intersect in all axes. Moving away by penetration depth in any
  axis will resolve the intersection. To choose which axis, use the previous
  position. E.g. if previously not intersecting in X, move away in X axis.
  */

  // Intersecton region
  AABB ir = stationary->GetAABB().Intersection(moving->GetAABB());
  Vec3f goPos = moving->GetPos();

  // Create AABB in old position
  AABB oldBox = moving->GetAABB();
  Vec3f move = oldPos - goPos;
  oldBox.Translate(move);
  // Oldbox should not be intersecting in one or more axes

  const AABB& stationaryBox = stationary->GetAABB();

  // Penetration depth in each axis
  Vec3f penDist(
    ir.GetMax(0) - ir.GetMin(0), 
    ir.GetMax(1) - ir.GetMin(1),
    ir.GetMax(2) - ir.GetMin(2));
  penDist *= 1.01f; // move away a bit more to be sure of clearing the collision

std::cout << "Pen depths: " << Describe(penDist) << ": ";

  //Vec3f vel = moving->GetVel();

  if (oldBox.GetMax(0) < stationaryBox.GetMin(0))
  {
    // Old box to left of stationary object, so move away to the left
//    Assert(penDist.x > 0);
    goPos.x -= penDist.x; 

std::cout << "x -= " << penDist.x;
  }
  else if (oldBox.GetMin(0) > stationaryBox.GetMax(0))
  {
//    Assert(penDist.x > 0);
    goPos.x += penDist.x;

std::cout << "x += " << penDist.x;
  }
  if (oldBox.GetMax(1) < stationaryBox.GetMin(1))
  {
//    Assert(penDist.y > 0);
    goPos.y -= penDist.y;
std::cout << "y -= " << penDist.y;
  }
  else if (oldBox.GetMin(1) > stationaryBox.GetMax(1))
  {
//    Assert(penDist.y > 0);
    goPos.y += penDist.y;
std::cout << "y += " << penDist.y;
  }
  if (oldBox.GetMax(2) < stationaryBox.GetMin(2))
  {
//    Assert(penDist.z > 0);
    goPos.z -= penDist.z;
std::cout << "z -= " << penDist.z;
  }
  else if (oldBox.GetMin(2) > stationaryBox.GetMax(2))
  {
//    Assert(penDist.z > 0);
    goPos.z += penDist.z;
std::cout << "z += " << penDist.z;
  }

std::cout << "\n";

  moving->SetPos(goPos);


//  moving->RecalcAABB();
  // Test that AABBs are no longer intersecting
//  if (stationary->GetAABB().Intersects(moving->GetAABB()))
//  {
//    AABB ir = stationary->GetAABB().Intersection(moving->GetAABB());
//  }
}
Exemple #21
0
void CProtocolNapt::Identify(TServerProtocolDesc* aProtocolDesc)const 
	{
	Describe(*aProtocolDesc);
	}
Exemple #22
0
//Replay movie dialog
INT_PTR CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	OPENFILENAME ofn;
	char szChoice[MAX_PATH]={0};
	char filename[MAX_PATH] = "";

	switch(uMsg)
	{
	case WM_INITDIALOG:
	{
		SendDlgItemMessage(hwndDlg, IDC_CHECK_READONLY, BM_SETCHECK, replayreadonly?BST_CHECKED:BST_UNCHECKED, 0);			
		
		//Clear fields
		SetWindowText(GetDlgItem(hwndDlg, IDC_MLENGTH), "");
		SetWindowText(GetDlgItem(hwndDlg, IDC_MFRAMES), "");
		SetWindowText(GetDlgItem(hwndDlg, IDC_MRERECORDCOUNT), "");
		SetWindowText(GetDlgItem(hwndDlg, IDC_MROM), "");

		extern char curMovieFilename[512];
		strncpy(playfilename, curMovieFilename, MAX_PATH);
		playfilename[MAX_PATH-1] = '\0';

		SetWindowText(GetDlgItem(hwndDlg, PM_FILENAME), playfilename);
		SetFocus(GetDlgItem(hwndDlg, PM_FILENAME));
		SendMessage(GetDlgItem(hwndDlg, PM_FILENAME), EM_SETSEL, 0, -1); // select all

	}	return FALSE;

	case WM_COMMAND:	
		int wID = LOWORD(wParam);
		switch(wID)
		{
			case ID_BROWSE:

				ZeroMemory(&ofn, sizeof(ofn));
				ofn.lStructSize = sizeof(ofn);
				ofn.hwndOwner = hwndDlg;
				ofn.lpstrFilter = "Desmume Movie File (*.dsm)\0*.dsm\0All files(*.*)\0*.*\0\0";
				ofn.nFilterIndex = 1;
				ofn.lpstrFile =  filename;
				ofn.lpstrTitle = "Replay Movie from File";
				ofn.nMaxFile = MAX_PATH;
				ofn.lpstrDefExt = "dsm";
				ofn.Flags = OFN_HIDEREADONLY | OFN_FILEMUSTEXIST;
				if(GetOpenFileName(&ofn))
					SetDlgItemText(hwndDlg, PM_FILENAME, filename);
				return true;
		
			case IDC_CHECK_READONLY:
				replayreadonly = IsDlgButtonChecked(hwndDlg, IDC_CHECK_READONLY) != 0;
				return true;

			case IDOK:	
				FCEUI_LoadMovie(playfilename, replayreadonly, false, 80000);
				ZeroMemory(&playfilename, sizeof(playfilename));
				EndDialog(hwndDlg, 0);
				return true;

			case IDCANCEL:
				ZeroMemory(&playfilename, sizeof(playfilename));
				EndDialog(hwndDlg, 0);
				return true;

			case PM_FILENAME:
				switch(HIWORD(wParam))
				{
					case EN_CHANGE:
					{
						FixRelativeMovieFilename(hwndDlg, PM_FILENAME);

						// disable the OK button if we can't read the file
						char filename [MAX_PATH];
						GetDlgItemText(hwndDlg,PM_FILENAME,filename,MAX_PATH);
						EnableWindow(GetDlgItem(hwndDlg, IDOK), IsFileReadable(filename));
						strcpy(playfilename, filename);
						Describe(hwndDlg);

						// force read-only to be checked if we can't write the file
						if(!IsFileWritable(filename))
						{
							CheckDlgButton(hwndDlg, IDC_CHECK_READONLY, BST_CHECKED);
							EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_READONLY), FALSE);
						}
						else
						{
							EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_READONLY), TRUE);
						}
					}
					break;
				}
				break;

		}
	}

	return false;
}
Exemple #23
0
VectorMap<String, SqlColumnInfo> DescribeSchema(const SqlId& table, Sql& cursor)
{
    return Describe(SchemaTable(table), cursor);
}
Exemple #24
0
int main( int argc, char** argv )
{
    InitTests(argc, argv);

    Describe("Config module")
        .use(dummyExceptionSandbox)

        .it("can be initialized empty.", [](){

            Require(InitConfig(0, NULL) == true);
            DestroyConfig();
        })

        .it("has a proper destructor.", [](){

            const char* argv[] = {"", "--aaa=bbb"};

            {
                Require(InitConfig(2, argv) == true);
                ConfigScope scope;
                Require(strcmp(GetConfigString("aaa",""), "bbb") == 0);
            }

            {
                Require(InitConfig(0, NULL) == true);
                ConfigScope scope;
                Require(GetConfigString("aaa",NULL) == NULL);
            }
        })

        .it("can parse arguments.", [](){

            const char* argv[] = {"", "--aaa=bbb", "--foo=bar", "--ccc=ddd"};

            Require(InitConfig(4, argv) == true);
            ConfigScope scope;

            Require(strcmp(GetConfigString("foo",""), "bar") == 0);
            Require(strcmp(GetConfigString("foo","yyy"), "bar") == 0);
            Require(strcmp(GetConfigString("foo",NULL), "bar") == 0);
            Require(strcmp(GetConfigString("xxx",""), "") == 0);
            Require(strcmp(GetConfigString("xxx","yyy"), "yyy") == 0);
            Require(GetConfigString("xxx",NULL) == NULL);
        })

        .it("can convert integer values.", [](){

            const char* argv[] = {"", "--aaa=42", "--bbb=1.1", "--ccc=1.9"};

            Require(InitConfig(4, argv) == true);
            ConfigScope scope;

            Require(GetConfigInt("aaa", 0) == 42);
            Require(GetConfigInt("bbb", 0) == 1);
            Require(GetConfigInt("ccc", 0) == 1);
            Require(GetConfigInt("xxx", 0) == 0);
        })

        .it("can convert floating point values.", [](){

            const char* argv[] = {"", "--aaa=42", "--bbb=1.1", "--ccc=1.9"};

            Require(InitConfig(4, argv) == true);
            ConfigScope scope;

            Require(GetConfigFloat("aaa", 0) == 42);
            Require(GetConfigFloat("bbb", 0) == 1.1f);
            Require(GetConfigFloat("ccc", 0) == 1.9f);
            Require(GetConfigFloat("xxx", 0.1f) == 0.1f);
        })

        .it("can convert boolean values.", [](){

            const char* argv[] = {
                "",
                "--aaa=42",
                "--bbb=1.1",
                "--ccc=1.9",
                "--ddd=0",
                "--eee=0.0",
                "--fff=true",
                "--ggg=false",
                "--hhh=yes",
                "--jjj=no"};

            Require(InitConfig(10, argv) == true);
            ConfigScope scope;

            Require(GetConfigBool("aaa", false) == true);
            Require(GetConfigBool("bbb", false) == true);
            Require(GetConfigBool("ccc", false) == true);
            Require(GetConfigBool("ddd", true) == false);
            Require(GetConfigBool("eee", true) == false);
            Require(GetConfigBool("fff", false) == true);
            Require(GetConfigBool("ggg", true) == false);
            Require(GetConfigBool("hhh", false) == true);
            Require(GetConfigBool("jjj", true) == false);

            Require(GetConfigBool("xxx", true) == true);
            Require(GetConfigBool("xxx", false) == false);
        })

        .it("can parse ini files.", [](){

            const char* argv[] = {"", "--config=config/Test.ini"};

            Require(InitConfig(2, argv) == true);
            ConfigScope scope;

            Require(GetConfigString("config", NULL) == NULL);
            Require(strcmp(GetConfigString("aaa", ""), "bbb") == 0);
            Require(strcmp(GetConfigString("foo.bar", ""), "baz") == 0);
            Require(strcmp(GetConfigString("foo.hello", ""), "Hello World") == 0);
        });

    return RunTests();
}
int DescribeLambda(char* str, int len, Object* lambda){
  //return snprintf(str, len, "#<closure>");
  char params[128]; Describe(params, 128, TakeLambda(lambda)->params);
  char body[128];   Describe(body, 128, TakeLambda(lambda)->body);
  return snprintf(str, len, "#<closure:%lld params=%s body=%s>", IdToInt(lambda->id), params, body);
}
static char* Describe(unsigned int i,char* buffer)
{
	// before
	unsigned int currentPhrase = phrases[i] & (-1 ^ phrases[i-1]); // only the new bit
	if (!currentPhrase) currentPhrase = phrases[i];
	unsigned int currentVerbal = verbals[i] & (-1 ^ verbals[i-1]); // only the new bit
	if (!currentVerbal) currentVerbal = verbals[i];
	unsigned int currentClause = clauses[i] & (-1 ^ clauses[i-1]); // only the new bit
	if (!currentClause) currentClause = clauses[i];
	bool found = false;
	char word[MAX_WORD_SIZE];
	for (unsigned int j = 1; j < i; ++j) // find things before
	{
		if (ignoreWord[j]) continue;
		if (crossReference[j] == i && posValues[j] & IDIOM)
		{
			strcat(buffer,wordStarts[j]);
			strcat(buffer,"_");
		}
		else if (crossReference[j] == i && phrases[j] ^ currentPhrase)
		{
			if (!found) strcat(buffer," [");
			else  strcat(buffer," ");
			found = true;
			++describedPhrases;
			describePhrase[describedPhrases] = (unsigned char)j;
			sprintf(word,"p%d",describedPhrases);
			strcat(buffer,word);
			strcat(buffer," ");
		}
		else if (crossReference[j] == i && verbals[j] ^ currentVerbal)
		{
			if (!found) strcat(buffer," [");
			else  strcat(buffer," ");
			found = true;
			++describedVerbals;
			describeVerbal[describedVerbals] =  (unsigned char)j;
			sprintf(word,"v%d",describedVerbals);
			strcat(buffer,word);
			strcat(buffer," ");
		}
		else if (crossReference[j] == i && clauses[j] ^ currentClause)
		{
			if (!found) strcat(buffer," [");
			else  strcat(buffer," ");
			found = true;
			++describedClauses;
			describeClause[describedClauses] =  (unsigned char)j;
			sprintf(word,"c%d",describedClauses);
			strcat(buffer,word);
			strcat(buffer," ");
		}
		else if (crossReference[j] == i && !(roles[j] & (MAINSUBJECT|MAINOBJECT|MAININDIRECTOBJECT)))
		{
			if (roles[j] & OBJECT_COMPLEMENT && posValues[j] & NOUN_BITS && !phrases[j] && !clauses[j] && !verbals[j]) continue;
			if (!found) strcat(buffer," [");
			else  strcat(buffer," ");
			found = true;
			if (posValues[j] != TO_INFINITIVE) Describe(j,buffer);
			else strcat(buffer,"to");
		}
	}
	if (found) 
	{
		char* end = buffer + strlen(buffer) - 1;
		if (*end == ' ') *end = 0;
		strcat(buffer,"]");
	}
	found = false;
	if (!(posValues[i-1] & IDIOM)) strcat(buffer," ");

	// the word
	strcat(buffer,wordStarts[i]);
	if (*wordStarts[i] == '"') strcat(buffer,"...\""); // show omitted quotation

	// after
	for (unsigned int j = i+1; j <= wordCount; ++j) // find things after
	{
		if (ignoreWord[j]) continue;
		if (crossReference[j] == i && posValues[j] & PARTICLE)
		{
			strcat(buffer,"_");
			strcat(buffer,wordStarts[j]);
		}
		else if (crossReference[j] == i && phrases[j] ^ currentPhrase)
		{
			if (!found) strcat(buffer," [");
			else  strcat(buffer," ");
			found = true;
			++describedPhrases;
			describePhrase[describedPhrases] =  (unsigned char)j;
			sprintf(word,"p%d",describedPhrases);
			strcat(buffer,word);
			strcat(buffer," ");
		}
		else if (crossReference[j] == i && verbals[j] ^ currentVerbal)
		{
			if (!found) strcat(buffer," [");
			else  strcat(buffer," ");
			found = true;
			++describedVerbals;
			describeVerbal[describedVerbals] =  (unsigned char)j;
			sprintf(word,"v%d",describedVerbals);
			strcat(buffer,word);
			strcat(buffer," ");
		}
		else if (crossReference[j] == i && clauses[j] ^ currentClause)
		{
			if (!found) strcat(buffer," [");
			else  strcat(buffer," ");
			found = true;
			++describedClauses;
			describeClause[describedClauses] =  (unsigned char)j;
			sprintf(word,"c%d",describedClauses);
			strcat(buffer,word);
			strcat(buffer," ");
		}
		else if (currentPhrase && phrases[j] == currentPhrase && roles[j] & OBJECT2 && crossReference[j] == i)
		{
			strcat(buffer," ");
			Describe(j,buffer);
		}
		else if (posValues[i] & TO_INFINITIVE && posValues[j] & (NOUN_INFINITIVE|VERB_INFINITIVE))
		{
			strcat(buffer," ");
			Describe(j,buffer);
		}
		else if (crossReference[j] == i && !(roles[j] & (MAINSUBJECT|MAINOBJECT|MAININDIRECTOBJECT)))
		{
			if (roles[j] & OBJECT_COMPLEMENT && posValues[j] & NOUN_BITS && !phrases[j] && !clauses[j] && !verbals[j]) continue;
			if (!found && !(posValues[i] & PREPOSITION)) strcat(buffer," [");
			found = true;
			Describe(j,buffer);
			strcat(buffer," ");
		}
	}
	if (found) 
	{
		char* end = buffer + strlen(buffer) - 1;
		if (*end == ' ') *end = 0;
		strcat(buffer,"] ");
	}

	if (coordinates[i] > i) // conjoined
	{
		strcat(buffer," + " );
		Describe(coordinates[i],buffer);
	}

	return buffer;
}
void PrintDesc(Object* object){
  char buf[1024] = {'\0'};
  Describe(buf, 1024, object);
  printf("%s\n", buf);
}
int InspectEnvironment(char* str, int len, Object* environment){
  char alist[512] = {'\0'}; Describe(alist, 512, TakeEnvironment(environment)->name_list);
  return snprintf(str, len, "#<environment:%lld, bound=%s>",
		  IdToInt(environment->id), alist);
}
std::list<Descriptor> Locate(const cv::Mat &capsuleImage,
                             double smoothValue,
                             double derivativeSmoothValue,
                             double curvatureThreshold) {
  cv::Size size = cv::Size(300, 300);
  cv::Mat resizedImage;
  cv::resize(capsuleImage, resizedImage, size);

  cv::Mat grayImage;
  cv::cvtColor(resizedImage, grayImage, CV_RGB2GRAY);

  cv::Mat smoothImage;
  Smooth(grayImage, &smoothImage, smoothValue);

  // ShowImage(smoothImage, "Smooth image");

  cv::Mat xDerivative, yDerivative, xxDerivative,
    xyDerivative, yyDerivative;
  cv::Mat smoothXDerivative, smoothYDerivative,
    smoothXXDerivative, smoothXYDerivative,
    smoothYYDerivative;

  int kernelType = 1;           // See opencv docs.
  cv::Sobel(smoothImage, xDerivative, 5, 1, 0, kernelType);
  Smooth(xDerivative, &smoothXDerivative, derivativeSmoothValue);
  cv::Sobel(smoothImage, yDerivative, 5, 0, 1, kernelType);
  Smooth(yDerivative, &smoothYDerivative, derivativeSmoothValue);
  cv::Sobel(smoothXDerivative, xxDerivative, 5, 1, 0, kernelType);
  cv::Sobel(smoothXDerivative, xyDerivative, 5, 0, 1, kernelType);
  cv::Sobel(smoothYDerivative, yyDerivative, 5, 0, 1, kernelType);
  Smooth(xxDerivative, &smoothXXDerivative, derivativeSmoothValue);
  Smooth(xyDerivative, &smoothXYDerivative, derivativeSmoothValue);
  Smooth(yyDerivative, &smoothYYDerivative, derivativeSmoothValue);

  // ShowHeatmap<float>(smoothXDerivative, "x derivative");
  // ShowHeatmap<float>(smoothYDerivative, "y derivative");
  // ShowHeatmap<float>(smoothXXDerivative, "xx derivative");
  // ShowHeatmap<float>(smoothXYDerivative, "xy derivative");
  // ShowHeatmap<float>(smoothYYDerivative, "yy derivative");

  cv::Mat gaussianCurvature(smoothImage.size(), CV_64FC1);
  GetGaussianCurvature(smoothXDerivative, smoothYDerivative,
                       smoothXXDerivative, smoothXYDerivative,
                       smoothYYDerivative, &gaussianCurvature);

  // ShowHeatmap<double>(gaussianCurvature, "Gaussian curvature");

  cv::Mat meanCurvature(smoothImage.size(), CV_64FC1);
  GetMeanCurvature(smoothXDerivative, smoothYDerivative,
                       smoothXXDerivative, smoothXYDerivative,
                       smoothYYDerivative, &meanCurvature);

  // ShowHeatmap<double>(meanCurvature, "Mean curvature");

  cv::Mat polypCurvature(smoothImage.size(), CV_64FC1);
  GetPolypCurvature(gaussianCurvature, meanCurvature,
                    &polypCurvature);

  // ShowHeatmap<double>(polypCurvature, "Polyp curvature");

  std::list<Descriptor> result =
    Describe(polypCurvature,
             GetMaskToDescribe(polypCurvature,
                               curvatureThreshold));
  return result;
}
void DumpSentence(unsigned int start,unsigned int end)
{
#ifndef DISCARDPARSER
	unsigned int to = end;
	unsigned int subject = 0, verb = 0, indirectobject = 0, object = 0,complement = 0;
	unsigned int i;
	bool notFound = false;
	char word[MAX_WORD_SIZE];
	describedVerbals = 0;
	describedPhrases = 0;
	describedClauses = 0;

	for ( i = start; i <= to; ++i) // main sentence
	{
		if (ignoreWord[i] && *wordStarts[i] != '"') continue;
		if (roles[i] & MAINSUBJECT && !subject) subject = i;
		if (roles[i] & MAINVERB && !verb) verb = i;
		if (roles[i] & OBJECT_COMPLEMENT && posValues[i] & NOUN_BITS && !complement) complement = i;
		if (roles[i] & OBJECT_COMPLEMENT && posValues[i] & (ADJECTIVE_BITS|VERB_INFINITIVE|NOUN_INFINITIVE) && !complement) complement = i;
		if (roles[i] & SUBJECT_COMPLEMENT && !complement) complement = i;
		if (!stricmp(wordStarts[i],"not")) notFound = true;
		if (roles[i] & SENTENCE_END) 
		{
			to = i;
			break;
		}
		if ((roles[i] & CONJUNCT_KINDS) == CONJUNCT_SENTENCE)
		{
			to = i;
			break;
		}
	}
	char* buffer = AllocateBuffer();
	strcat(buffer,"  MainSentence: ");

	for (i = start; i <= to; ++i)
	{
		if (roles[i] & ADDRESS)
		{
			Describe(i,buffer);
			strcat(buffer," :  ");
		}
	}
	
	if (subject) DescribeUnit(subject,buffer, "Subj:",0,0);
	else if (tokenFlags& IMPLIED_YOU) 	strcat(buffer,"YOU   ");
	
	if (verb) 
	{
		object = objectRef[verb];
		indirectobject = indirectObjectRef[verb];
		strcat(buffer,"  Verb:");
		if (notFound) strcat(buffer,"(NOT!) ");
		Describe(verb,buffer);
		strcat(buffer,"   ");
	}

	if (indirectobject) 
	{
		strcat(buffer,"  IndObj:");
		Describe(indirectobject,buffer);
		strcat(buffer,"   ");
	}

	DescribeUnit(object,buffer, "  Obj:",0,0);
	DescribeUnit(complement,buffer, "Compl:",0,0);

	if (clauses[start]){;}
	else if (!stricmp(wordStarts[start],"when")) strcat(buffer,"(:when) ");
	else if (!stricmp(wordStarts[start],"where")) strcat(buffer,"(:where) ");
	else if (!stricmp(wordStarts[start],"why")) strcat(buffer,"(:why) ");
	else if (!stricmp(wordStarts[start],"who") && subject != 1 && object != 1) strcat(buffer,"(:who) ");
	else if (!stricmp(wordStarts[start],"what") && subject != 1 && object != 1) strcat(buffer,"(:what) ");
	else if (!stricmp(wordStarts[start],"how")) strcat(buffer,"(:how) ");

	if (tokenFlags & QUESTIONMARK)  strcat(buffer,"? ");

	if (tokenFlags & PAST) strcat(buffer," PAST ");
	else if (tokenFlags & FUTURE) strcat(buffer," FUTURE ");
	else if (tokenFlags & PRESENT) strcat(buffer," PRESENT ");

	if (tokenFlags & PERFECT) strcat(buffer,"PERFECT ");
	if (tokenFlags & CONTINUOUS) strcat(buffer,"CONTINUOUS ");

	if (tokenFlags & PASSIVE) strcat(buffer," PASSIVE ");
	strcat(buffer,"\n");
	for (unsigned int i = 1; i <= describedPhrases; ++i)
	{
		sprintf(word,"Phrase %d :",i);
		strcat(buffer,word);
		Describe(describePhrase[i],buffer);
		strcat(buffer,"\n");
	}
	for (unsigned int i = 1; i <= describedVerbals; ++i)
	{
		sprintf(word,"Verbal %d: ",i);
		strcat(buffer,word);
		unsigned int verbal = describeVerbal[i]; 
		unsigned int verbalid = verbals[verbal] & (-1 ^ verbals[verbal-1]);
		if (!verbalid) verbalid = verbals[verbal];
		for (unsigned int j = i; j <= endSentence; ++j)
		{
			if (!(verbals[j] & verbalid)) continue;
			if (roles[j] & VERB2) 
			{
				strcat(buffer,"  Verb:");
				Describe(j,buffer); // the verb
				if (indirectObjectRef[j]) 
				{
					strcat(buffer,"  Indirect: ");
					Describe(indirectObjectRef[j],buffer);
				}
				DescribeUnit(objectRef[j],buffer, "  Direct:",verbalid,0);
				DescribeUnit(complementRef[j],buffer, " Complement:",verbalid,0);
				break;
			}
		}
		strcat(buffer,"\n");
	}
	for (unsigned int i = 1; i <= describedClauses; ++i)
	{
		sprintf(word,"Clause %d %s : ",i,wordStarts[describeClause[i]]);
		strcat(buffer,word);
		unsigned int clause = describeClause[i];
		unsigned int clauseid = clauses[clause] & (-1 ^ clauses[clause-1]);
		if (!clauseid) clauseid = clauses[clause];
		for (unsigned int j = i; j <= endSentence; ++j)
		{
			if (!(clauses[j] & clauseid)) continue;
			if (roles[j] & SUBJECT2)  
			{
				strcat(buffer,"  Subj:");
				Describe(j,buffer); // the subject
				strcat(buffer,"  ");
			}
			if (roles[j] & VERB2)  
			{
				strcat(buffer,"  Verb:");
				Describe(j,buffer); // the verb
				if (indirectObjectRef[j]) 
				{
					strcat(buffer,"  Indirect: ");
					Describe(indirectObjectRef[j],buffer);
				}
				DescribeUnit(objectRef[j],buffer, "  Direct:",0,clauseid);
				DescribeUnit(complementRef[j],buffer, "  Complement:",0,clauseid);
			}
		}
		strcat(buffer,"\n");
	}

	for (unsigned int i = start; i <= to; ++i) // show phrases
	{
		if (ignoreWord[i]) continue;
		if (i >= to) continue; // ignore
		if (coordinates[i] && posValues[i] & CONJUNCTION_COORDINATE)
		{
			strcat(buffer,"\r\n Coordinate ");
			uint64 crole = roles[i] & CONJUNCT_KINDS;
			if (crole == CONJUNCT_NOUN) strcat(buffer,"Noun: ");
			else if (crole == CONJUNCT_VERB) strcat(buffer,"Verb: ");
			else if (crole == CONJUNCT_ADJECTIVE) strcat(buffer,"Adjective: ");
			else if (crole == CONJUNCT_ADVERB) strcat(buffer,"Adverb: ");
			else if (crole == CONJUNCT_PHRASE) strcat(buffer,"Phrase: ");
			else strcat(buffer,"Sentence: ");
			strcat(buffer,wordStarts[i]);
			strcat(buffer," (");
			if (coordinates[i] && coordinates[coordinates[i]])
			{
				strcat(buffer,wordStarts[coordinates[coordinates[i]]]); // the before
				strcat(buffer,"/");
				strcat(buffer,wordStarts[coordinates[i]]); // the after
			}
			strcat(buffer,") ");
		}
	}

	for (unsigned int i = start; i <= to; ++i) // show phrases
	{
		if (ignoreWord[i]) continue;
		if ( phrases[i] && phrases[i] != phrases[i-1] && (i != wordCount || phrases[wordCount] != phrases[1])) 
		{
			if (posValues[i] & (NOUN_BITS|PRONOUN_BITS)) strcat(buffer,"\r\n  Absolute Phrase: ");
			//else if (posValues[i] & (ADJECTIVE_BITS|ADVERB)) strcat(buffer,"\r\n  Time Phrase: ");
			else continue;
			if (i == 1 && phrases[wordCount] == phrases[1]) 
			{
				DescribeComponent(wordCount,buffer,"{","}"); // wrapped?
				strcat(buffer," ");
			}
			DescribeComponent(i,buffer,"{","}"); // wrapped?
			strcat(buffer," ");
		}

		if (roles[i] & TAGQUESTION) strcat(buffer," TAGQUESTION ");
	}

	Log(STDUSERLOG,"%s\r\n",buffer);

	FreeBuffer();
	if (to < end) DumpSentence(to+1,end); // show next piece
#endif
 }