개인정보 동의 체크박스를 클릭하면서

며칠전 가끔 사용하던 포털사이트를 들어가려니 메세지가 나온다.
고객님의 정보가 도용된 것으로 파악되었으니 ... 비번 변경해라... 로 그래서 변경하려 했더니
개인 인증 머 이런게 나오는데...
거 참 난감하다...

난 2009년 잘사용하던 주민등록번호가 바뀌었다... 오늘 안 사실인데 이글루에 있는 주민등록 번호도 예전 번호다.
해서 변경하려고 할 때 인증을 요청하면 문제가 발생한다. 왜냐면, 핸드폰이던 공인인증이던 뭐 이딴건 알아서(?)
바꾸도록 유도한다.

근데 포털은 아니다. 일일이 요청해야 하고 설명해야 하고 그렇더라.
해서 귀찮다. 뭐다 해서 미뤘다. 그랬더니 메일도 그렇고 연결된 것들이 조금 있는데.
아 사용못한다 불편하다

근데 가만히 생각해보니 난 뭘 잘못한거지? 왜 내가 피해를 봐야 하지? 난 사용한 죄밖에 없고,
몇년간 사용하면서 이런일 없었고, 가입할 때 뭐 동의해라고 하는 체크박스 다 클릭했다.
글자들은 왜 그리 많은 지 그리고 읽어도 당연히 한글이란것만 안다. 내용은 뭔말인지 도통
조금 집중해서 읽으면, 니네들 정보를 누구한테 주고 그리고 여러가지 일이 발생해도 책임없고 이런거다 사실
해서... 오늘 과감히 탈퇴신청을 했다.

그리고 궁금한 것은 이거 되나?

by aint | 2011/08/12 10:07 | 살면서 | 트랙백 | 덧글(0)

Torken구별

/* Custom String Tokenizer - by mind@metalshell.com

 *

 * This example is more of an example on predetermined strings such as

 * reading in a configuration file and splitting the variable from the value

 * in or around quotation marks or equal signs.

 *
* See below for porting this to read a configuration file or similar

 *
* http://www.metalshell.com

 */
#include <stdio.h>

#include <string.h>

int RunExample();

int main()

{

int x, i;

char tmp[]="writing:your:own:string!tokenizer:yay";

char tnp[strlen(tmp)];

/* See below

 *

 * int z;

 * char exempt[]=!@:$.,;

  * char tmp[]="writing,your!own@str.ingto$kenize:ryay";

  *

  */

 /* Uncomment the next two lines to run the second example */
 // RunExample();

// return 1;

/* zero out our temp string */
bzero(tnp, sizeof(tnp));

for (x = 0, i = 0; x < strlen(tmp); x++)
{
/* Use this if you want to parse segments from
* numerous splitters.
*
* for (z = 0; z < strlen(exempt); z++)
* {
* if (tmp[x] == exempt[z])
* {
* .....
* }
* }
*
*/


/* check for end of segment */
if (tmp[x] == ':' || tmp[x] == '!')
{
printf("Extracted segment: %s\n", tnp);

/* zero out our temp string */
bzero(tnp, sizeof(tnp));

/* reset our writing point back to the beginning */
i = 0;

/* start from the beginning of our loop
* this is needed so the loop wont finish
* and write : or ! to tnp[0] */

continue;
}

/* write our character at position tnp[i] from tmp[x] */
tnp[i] = tmp[x];

/* increase our temp string's position */
i++;
}
return 1;
}

/* Extraction method; */
void Extract(char *str)
{
int x, i, y;
char tmp[strlen(str)];

/* zero out our temp string */
bzero(tmp, sizeof(tmp));

for (x = 0, i = 0, y = 0; x < strlen(str); x++)
{
/* check to see if the last loop reached the end of
* our first segment. */

if (!y)
{
/* nope.. check to see if this loop does */
if (str[x] == '=')
{
y = 1;

/* First segment passed; continue back to a new loop
* and search for the next segment */

continue;
}

/* keep looping back until we've gone through the
* first segment (skipping) */

continue;
}

/* check to see if we have passed the first segment */
if (y == 1)
{
/* check if we are at the start of our valued segment */
if (str[x] == 34)
{
/* we are.. setup y so we can start writing our value */
y = 2;

/* continue back to the beginning so we dont write '"' */
continue;
}

/* '"' hasn't been reached yet continue looping.. */
continue;
}

/* check to see if our value is done with an ending '"' */
if (y == 2 && str[x] == 34)
{
/* Everything looks good; zero out our string and
* start writing our temp string to our real string */

bzero(str, strlen(tmp) + 1);
for (x = 0; x < strlen(tmp); x++)
str[x] = tmp[x];

/* end loop */
break;
}

/* write to our temp string */
tmp[i] = str[x];
i++;
}
}

/*
* This section will show the ways you can use this example to
* read in a confiruation file and extract what you want.
*
* user="mind"
* pass="metalshell"
*
*/

int RunExample()
{
char str1[]="user=\"mind\"";
char str2[]="pass=\"metalshell\"";

Extract(str1);
Extract(str2);

printf("User: %s\n", str1);
printf("Pass: %s\n", str2);

return 1;
}


/*
* Since this example is using predetermined strings, I strongly suggest
* if you use this code to read in a configuration file; Please add checks
* on the string your reading in before using Extract(). This example is
* safe to use and has been tested for stability but could still cause issues.
*
* If you have any question's or want help adding checks to this please visit:
* http://www.metalshell.com/forum
*
*/

by aint | 2006/11/02 15:54 | 트랙백 | 덧글(0)

threaded message queue in BCB - from http://www.ibrtses.com/bcb/messagequeue.html


threaded message queue in BCB
disclaimer
A multithreaded message queue is implemented with the help of events.
One thread is only reading and anotherone is only writing.
The aim was not preventing multiple access but suppress polling for a state.


the h file
//---------------------------------------------------------------------------
#ifndef MsgQueueH
#define MsgQueueH
//---------------------------------------------------------------------------
#include
#include
#include
#include
#include
//---------------------------------------------------------------------------
class PACKAGE TMsgNode : public TObject
{
private:
 int fsize;
 int fdata;
 TMsgNode  *fnext;
 TMsgNode  *fprev;
protected:
 char __fastcall getitem(int index);
 void __fastcall setitem(int index, char u);
public:
//__property char data[int index]={read=getitem,write=setitem};
 __fastcall TMsgNode(int newsize);
 __fastcall TMsgNode();
 __fastcall ~TMsgNode();
__published:
__property int size={read=fsize,write=fsize};
__property int data={read=fdata,write=fdata};
__property TMsgNode *next={read=fnext,write=fnext};
__property TMsgNode *prev={read=fprev,write=fprev};
};

class PACKAGE TMsgQueue : public TObject
{
private:
 int fcount;
 TEvent * fNotEmpty;
 TMsgNode *fHead;
 TMsgNode *fTail;
protected:
public:
 __fastcall TMsgQueue();
 __fastcall ~TMsgQueue();
void __fastcall QueueIn(char * data, int size);
void __fastcall QueueOut(int &data, int &size);

__published:
__property int count={read=fcount};
__property TEvent * NotEmpty ={read=fNotEmpty,write=fNotEmpty};
};
//---------------------------------------------------------------------------
#endif

the cpp file
//---------------------------------------------------------------------------
#include
#pragma hdrstop

#include "MsgQueue.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
// ValidCtrCheck is used to assure that the components created do not have
// any pure virtual functions.
//

//static inline void ValidCtrCheck(TMsgQueue *)
//{
//        new TMsgQueue(NULL);
//}
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
 __fastcall TMsgNode::TMsgNode(int newsize)
{
 fsize=newsize;
 fdata=(int)malloc(newsize);
 fnext=NULL;
 fprev=NULL;
}
//---------------------------------------------------------------------------
__fastcall TMsgNode::TMsgNode()
{
 fsize=0;
 fdata=NULL;
 fnext=NULL;
 fprev=NULL;
}
//---------------------------------------------------------------------------
 __fastcall TMsgNode::~TMsgNode()
{
// free(fdata);
}
//---------------------------------------------------------------------------

__fastcall TMsgQueue::TMsgQueue()
        : TObject()

{
 fcount=0;
 fNotEmpty= new TEvent(NULL,false,false,"");
 fHead=NULL;
 fTail=NULL;
}
//---------------------------------------------------------------------------
namespace Msgqueue
{
        void __fastcall PACKAGE Register()
        {
                 TComponentClass classes[1] = {__classid(TMsgQueue)};
                 RegisterComponents("Samples", classes, 0);
        }
}
//---------------------------------------------------------------------------
//__fastcall TMsgQueue::TMsgQueue()
//{
// fcount=0;
// fNotEmpty= new TEvent(NULL,false,false,"");
// fHead=NULL;
// fTail=NULL;
//}
//---------------------------------------------------------------------------
__fastcall TMsgQueue::~TMsgQueue()
{
 int z;
 int n;

 while (fcount>0)
 { QueueOut(z,n);
   free((void*)z);
 }
 fNotEmpty->TEvent::~TEvent();
}
//---------------------------------------------------------------------------
void __fastcall TMsgQueue::QueueIn(char * data, int size)
{
 TMsgNode *u;
 u = new TMsgNode(size);
 Move((void*)data,(void*)u->data,size);
//u.dataptr=data;
 u->size=size;
 if (fHead==NULL)
  {
   fHead=u;
   fTail=u;
   fcount++;
  }
 else {
  u->next=fHead;
  fHead->prev=u;
  fHead=u;
  fcount++;
  }
 fNotEmpty->SetEvent();
}

//---------------------------------------------------------------------------
void __fastcall TMsgQueue::QueueOut(int &data, int &size)
{
 TMsgNode * u;
 int i;
 if (fTail !=NULL) {
  u=fTail;
  fTail=u->prev;
  if (fTail==NULL){fHead=NULL;}
  fcount--;
  data=u->data;
  size=u->size;
  if (fcount !=0) {fNotEmpty->SetEvent();}
 }
}
//---------------------------------------------------------------------------

 

my BCB
home

last updated: 29.june.01

Copyright (99,2001) Ing.Buro R.Tschaggelar

by aint | 2006/10/25 08:35 | C++ Builder | 트랙백 | 덧글(0)

남생이



 
거북목 남생이과의 파충류.
학명Geoclemys(Chinemys) reevesii
분류거북목 남생이과
크기등딱지 길이 20∼25cm
진한 갈색(등딱지)
생식난생(1회에 4~6개)
서식장소민물
분포지역한국·일본·중국·타이완

등딱지 길이는 20∼25cm이며 30cm에 이르는 것도 있다. 등딱지는 진한 갈색인데, 가장자리가 매끄럽고 앞끝이 둥글게 패어 있으며, 뒤끝은 깊게 패어 있다. 각 딱지에는 누런 녹색 테두리가 쳐져 있고, 드물게 희미한 검정무늬가 있다. 등 가운데 선의 융기는 낮으며 검정색이다. 배딱지는 등딱지와 길이가 거의 같다. 머리 뒤쪽은 잔비늘로 덮여 있고, 옆면 가장자리에는 노란색의 불규칙한 세로줄이 여러 개 나 있다. 네 다리는 넓은 비늘로 덮여 있다.

민물에 살며 잡식성으로 물고기·갑각류·수생식물 따위를 먹는다. 사육할 때는 빵이나 지렁이도 잘 먹는다. 6∼8월에 물가 모래에 구멍을 파서 4∼6개의 알을 낳는다. 민간이나 한방에서는 자양·강장·보신 등에 효능이 있다고 알려져 약으로 이용하는데, 배딱지를 말려서 달여 먹거나 알 또는 가루로 만들어 복용하기도 한다. 한국·일본·중국·타이완 등지에 분포한다.

by aint | 2006/10/23 09:26 | 생활상식 | 트랙백 | 덧글(0)

dynamic_cast 예제

int n  = dynamic_cast<TButton *>(Sender)->Tag;

by aint | 2006/07/14 09:40 | C++ Builder | 트랙백 | 덧글(0)

sprintf and wsprintf

왜 이런 걸 예전에 사용하지 않았을까....
가끔 느끼는 건데 고수에겐 당연한 내공이. 초보에겐 ㅎㅎㅎ
초보검이 고수검이 되려면 매일 1000번 이상 검식 연습을 해야 하듯...

sprintf 를 사용하려면
#include <stdio.h> 가 필요합니다.
이는 보통
#include <vcl.h>
#include <stdio.h>
#pragma hdrstop
식으로 쓰이게 되죠.

그런데 왜 vcl에서는 sprintf 를 포함하지 않았는지 궁금했었는데...
wsprintf 가 있기 때문이었습니다.

wsprintf 는
#include <stdio.h>
없이 사용가능한 WIN32 API 로,
일반 앤시코드과 유니코드 사용 프로그램에 공히 사용할수 있는 문자열 합성 함수입니다.

유니코드를 사용하지 않는 프로그램이면
그냥 wsprintf 를 sprintf 대신 사용하면 됩니다.
유니코드를 사용하는 프로그램이면
역시 wsprintf 를 그냥 사용하면 됩니다.
유니코드를 사용할 경우는 문자열은 L"문자열"; 식으로 유니코드로 표현되어야 하며
char * 대신 wchat_t *  형이 사용되어야 합니다.

그래서 표준적으로 유니코드 사용프로그램과 일반 프로그램에 공히 하나의 코드로 처리하기 위해
컴파일러는 TCHAR 형과 TEXT 매크로를 제공합니다.
가령 OnCreate 이벤트에 다음과 같은 코딩이 가능합니다.
{
TCHAR  buf[100];
wsprintf(buf, TEXT("캡션 메시지: %s"), TEXT("안녕하세요. C++빌더입니다."));
Caption = buf;
}
이 코드는 앤시코드형이나 유니코드형 프로그램 양쪽에서 안전하게 동작합니다.
TEXT 매크로 와 __TEXT 매크로는 동일합니다.

Project Option->Directorys...->Conditional defines ; 에
UNICODE 또는 _UNICODE 를 넣어주면
유니코드모드로 컴파일하게 되는데,
이 경우 안전하게 유니코드모드로
컴파일되게 합니다.

프로그래밍할때 아예 습관을 char 대신 TCHAR 으로 하고
"문자열" 대신 TEXT("문자열") 을 쓰는 것도 좋을 것입니다.

전혀 유니코드를 사용할 필요가 없는 경우는 맘대로 해도 되지만.

그럼..

www.borlandforum.com에서 발췌하였으며 김태선님의 글임.

by aint | 2006/04/17 17:46 | 트랙백(1) | 덧글(0)

파일 작성된 날짜 및 시간 알아내기

AnsiString __fastcall FileTimeToDateTime(FILETIME FileTime)
{
   FILETIME TempTime;
   SYSTEMTIME SystemTime;
   TDateTime DateTime;
   FileTimeToLocalFileTime(&FileTime, &TempTime);
   FileTimeToSystemTime(&TempTime, &SystemTime);
   DateTime = SystemTimeToDateTime(SystemTime);
   return DateTime.FormatString("yy-dd-mm hh:nn:ss");
}
void __fastcall TAboutBox::FormShow(TObject *Sender)
{
///
FILETIME ftCt, ftLat, ftLwt;
AnsiString fName = Application->ExeName;
   int hFileHandle = FileOpen(fName.c_str(),fmOpenRead);
GetFileTime(reinterpret_cast <HANDLE> (hFileHandle), &ftCt, &ftLat, &ftLwt);
stVersion->Caption = VersionInfo("FileVersion");
stCopyright->Caption = VersionInfo("CompanyName");
 lbTime->Caption = FileTimeToDateTime(ftCt);
lbTime1->Caption = FileTimeToDateTime(ftLwt);

FileClose(hFileHandle);
}

by aint | 2006/03/29 07:12 | C++ Builder | 트랙백 | 덧글(0)

파일 버전 알아내기

AnsiString __fastcall VersionInfo(const AnsiString &sQuery)
{
  DWORD dwHandle = 0, dwVersionInfoSize; 

  UINT uLength;
  LPVOID pFileInfo, ptr; 


  AnsiString sOut; // 리턴될 버전 정보.

   AnsiString filename = Application->ExeName;
   dwVersionInfoSize = GetFileVersionInfoSize(filename.c_str(), &dwHandle);
   pFileInfo = (LPVOID) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwVersionInfoSize);
   GetFileVersionInfo(filename.c_str(), dwHandle, dwVersionInfoSize, pFileInfo);
  VerQueryValue(pFileInfo, TEXT("
\VarFileInfo\Translation"), &ptr, &uLength);
   WORD *id = (WORD *) ptr;
  AnsiString szString = "
\StringFileInfo\" + IntToHex(id[0], 4) + IntToHex(id[1], 4) + "\" + sQuery;
   VerQueryValue(pFileInfo, szString.c_str(), &ptr, &uLength);
  sOut = AnsiString((char *) ptr);
  HeapFree(GetProcessHeap(), 0, pFileInfo );
  return sOut;
}
//---------------------------------------------------------------------------
void __fastcall TAboutBox::FormShow(TObject *Sender)
{
///
stVersion->Caption = VersionInfo("FileVersion");
stCopyright->Caption = VersionInfo("CompanyName");
}
//---------------------------------------------------------------------------

by aint | 2006/03/28 09:15 | C++ Builder | 트랙백 | 덧글(0)

TList Help Example

typedef struct AList
{
int I;
char C;
} TAList;
typedef TAList* PAList;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
PAList AStruct;
TList *MyList = new TList;
// fill the TList
AStruct = new TAList;
AStruct->I = 100;
AStruct->C = 'Z';
MyList->Add(AStruct);
AStruct = new TAList;
AStruct->I = 100;
AStruct->C = 'X';
MyList->Add(AStruct);

// Go through the list, writing the elements to the
// canvas of a paintbox component.
int Y = 10; // position on canvas
for (int i = 0; i < MyList->Count; i++)
{
   AStruct = (PAList) MyList->Items[i];
   PaintBox1->Canvas->TextOut(10, Y, IntToStr(AStruct->I));
   Y += 30;  // Increment Y Value again
   PaintBox1->Canvas->TextOut(10, Y, AStruct->C);
   Y += 30;  //Increment Y Value
}
// Clean up ?must free memory for the items as well as the list
for (int i = 0; i < MyList->Count; i++)
{
   AStruct = (PAList) MyList->Items[i];
   delete AStruct;
}
delete MyList;
}

by aint | 2006/02/20 08:58 | C++ Builder | 트랙백 | 덧글(0)

◀ 이전 페이지다음 페이지 ▶