2015. 11. 28. 14:06

Author : sunny00123

Original Source  : https://github.com/sunny00123/CitiesSkylinesLocalizationTool/tree/master/citiesskylines_en/citiesskylines

Original Release : http://steamcommunity.com/workshop/discussions/-1/613958868356242516/?appid=255710#p1


I have updated the translation tool because .po import doesn't work for me.

If this will be a problem to copyrights or other else, please leave a comment in this post.




CitiesSkylines.7z



'Developer Gom > ETC' 카테고리의 다른 글

Logparser로 로그인 실패 IP와 횟수 가져오는 쿼리  (0) 2013.02.13
Access Token Privileges  (0) 2010.09.10
NSIS 폰트 등록 스크립트  (0) 2010.08.31
Posted by 나이스곰
2015. 3. 4. 10:59

SQLite DB에다가 Adapter를 사용하여 DataTable을 Update 하려고 하니 DbType과 일치하는 실제 DB의 column type이 명확하지 않아  찾아보았더니 관련내용이 정리된 문서가 있어 공유합니다.


Since the SQLite engine is inherently typeless and ADO.NET is much more strongly typed, the ADO.NET wrapper must make certain decisions about the columns returned in any given SQL query.  One of the deciding factors is the underlying datatype declared in the CREATE TABLE statement.

The following lists the datatypes and mappings the SQLite ADO.NET wrapper understands.  If there is anything missing, wrong, or needs adding, please let me know:


COUNTERDbType.Int64
AUTOINCREMENTDbType.Int64
IDENTITYDbType.Int64
LONGDbType.Int64
TINYINTDbType.Byte
INTEGERDbType.Int64
INTDbType.Int32
VARCHARDbType.String
NVARCHARDbType.String
CHARDbType.String
TEXTDbType.String
DOUBLEDbType.Double
FLOATDbType.Double
REALDbType.Single
BITDbType.Boolean
YESNODbType.Boolean
LOGICALDbType.Boolean
BOOLDbType.Boolean
NUMERICDbType.Decimal
DECIMALDbType.Decimal
MONEYDbType.Decimal
CURRENCYDbType.Decimal
TIMEDbType.DateTime
DATEDbType.DateTime
TIMESTAMPDbType.DateTime
DATETIMEDbType.DateTime
BLOBDbType.Binary
BINARYDbType.Binary
VARBINARYDbType.Binary
IMAGEDbType.Binary
GENERALDbType.Binary
OLEOBJECTDbType.Binary
GUIDDbType.Guid
UNIQUEIDENTIFIERDbType.Guid
MEMODbType.String
NOTEDbType.String
LONGTEXTDbType.String
LONGCHARDbType.String
SMALLINTDbType.Int16
BIGINTDbType.Int64

DateTime's are stored in one of two formats.  The default datetime format is ISO8601, and you specify the format in the connection string like Finisar does.  The varying ISO8601 strings that this class uses to convert are:

"yyyy-MM-dd HH:mm:ss"

The other format is Ticks.  In the SQLiteConnection class in the helpfile is a description of all the connectionstring options.

,
"yyyyMMddHHmmss",
"yyyyMMddTHHmmssfffffff",
"yyyy-MM-dd",
"yy-MM-dd",
"yyyyMMdd",
"HH:mm:ss",
"THHmmss"


출처 : http://www.blogbus.com/hyangl-logs/2219450.html

Posted by 나이스곰
2013. 2. 13. 15:34

Logparser는 로그 기록으로 부터 원하는 데이터를 집계 해보고 싶을 때 사용하는 툴입니다.

여기서는 로그인 실패 로그로 부터 IP와 실패한 횟수 정보를 집계해 보겠습니다.


Logparser 다운로드 링크 

http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=24659


Logparser가 설치된 경로에서 다음 쿼리를 쳐보시면 Logparser 폴더에 IPDeny란 파일이 생성되는데 에디터로 열어보시면 됩니다.

이 명령은 5회이상 로그인을 실패한 IP를 모두 가져오는 쿼리입니다. 출처 링크로 가보시면 조금 더 자세한 내용을 알아보실 수 있습니다.


logparser.exe -i:EVT -o:NAT -rtp:-1 "SELECT extract_token(strings,19,'|') AS IP, count(ip) into IPDeny from security where EventID=4625 Group By ip having count(ip) > 5 order by count(ip) desc


출처 : http://cybershin.tistory.com/309



'Developer Gom > ETC' 카테고리의 다른 글

Cities : Skylines Localization Tool  (0) 2015.11.28
Access Token Privileges  (0) 2010.09.10
NSIS 폰트 등록 스크립트  (0) 2010.08.31
Posted by 나이스곰
2012. 12. 21. 18:09

학교나 학원 등에서 캐드를 배우다 보면 종종 태극기를 그려오라는 숙제를 낼 때가 있습니다.

뭐, 그리는게 어렵진 않지만 처음 캐드를 다뤄보는 입장에선 귀찮기만 하지요.

그래서 그런 분들을 위해 꼼수(?) 프로그램을 만들었습니다.


캐드 쓰시는 분들은 대부분 다 아시겠지만 APPLOAD 명령어로 링크된 ARX 프로그램을

로드하신 뒤에 DFL 명령어를 치시고 뜨는 팝업창에서 확인만 눌러주면 됩니다.


단, LT버전은 ARX를 로드 할 수 없으니 사용하실 수 없고요, 

오토캐드 2010, 2011, 2012 버전만 지원합니다.






JKArxSecond.arx


Posted by 나이스곰
2012. 1. 25. 11:17
개발한 프로젝트에서 아주 희한한 버그가 보고되었는데, 64비트 윈도우즈7에서 폼을 띄우는(new 하는) 부분에서 죽어버리는 것이었다. (Access Violation)
일주일 내내 이 버그를 해결하기 위해 지지고 볶아봤지만 도무지 원인을 알 수가 없었다. 게다가 잘 되는 곳은 잘 되고 안 되는 곳은 안되는 형태였는데 딱히 시스템을 특정할 수 없어 엄청나게 고생했다.

결국 2주가 다 되어서야 간신히 원인을 찾게 되었는데 폼에서 MDB를 사용하는데 연결 시에 OLE DB Services 를 명시적으로 All Services(-1)로 주면 되는 것이었다. 명시하지 않으면 특정 x64 윈도우즈 시스템에서 뻗어버릴 수가 있다.

우리는 MS OFFICE가 원인일 것으로 보고 있다. 실제로 OFFICE 2010이 깔린 머신에서는 문제가 재현되지 않았기 때문이다. 물론, OFFICE 2007이 깔린 곳도 서비스팩과 핫픽스를 전부 받은 곳은 문제가 없는 것으로 보인다.

수정된 연결 문자열 예제 )


String.Format("Provider={0};Data Source={1};Jet OLEDB:Database Password={2};
OLE DB Services =-1;",
MdbProvider, MdbPath, MdbPassword));
Posted by 나이스곰
2011. 8. 8. 14:56

DWORD SerialNum; 
DWORD A,B; 
TCHAR C[256] = {'\0',}; 
TCHAR Buffer[MAX_PATH] = {'\0',};
TCHAR WinBuffer[MAX_PATH] = {'\0',};
TCHAR WinDrive[128] = {'\0',};
 
GetWindowsDirectory(WinBuffer,MAX_PATH);
_tsplitpath_s(WinBuffer,WinDrive,128,NULL,NULL,NULL,NULL,NULL,NULL);
_tcscat_s(WinDrive,128,_T("\\"));
 
if(GetVolumeInformation(WinDrive, Buffer, 256, &SerialNum, &A, &B, C, sizeof(C)/sizeof(C[0])))
{
TCHAR tBuffer[MAX_FNAME_LEN] = {'\0',};
TCHAR tString[256] = {'\0',};
LPTSTR pBuffer = tBuffer;
_stprintf_s(tBuffer,MAX_FNAME_LEN,_T("%x"),SerialNum);
_tprintf(_T("%s\n"),tBuffer);
_tcsncpy_s(tString,tBuffer,8);
_tprintf(_T("tBuffer : %s\n"),tBuffer);
_tprintf(_T("tString : %s\n"),tString);
_tprintf(_T("tBuffer Size: %d\n"),_tcslen(pBuffer));
}


Posted by 나이스곰
2011. 8. 8. 14:47
MDB는 MSSQL구문처럼 Inner Join을 중첩하면
쿼리식의 연산자가... 어쩌구 저쩌구 하면서 에러를
뱉어대는데 정신차리게 해주려면,

Select *
From (YourTable a 
Inner Join JoinTable b 
On a.ID = b.ID) Inner Join NextTable c On b.Code= c.Code
Where ...

위에처럼 괄호로 묶어주면 되고 만약 Join 이 더 발생하면 그때마다 괄호로 묶어주어야 됩니다.

하여튼 MDB 완전 메롱입니다. -_-


 
Posted by 나이스곰
2011. 7. 18. 11:45

Path example
 

You will often need to extract parts of filename paths in your programs. The .NEW framework team at Microsoft has thought of this problem already and the Path class is ideal for our use. You can access it by adding "using System.IO;" at the top of your class. First here we see a short console program that shows four Path methods.
 

Program that uses Path methods [C#]

using System;
using System.IO;

class Program
{
    static void Main()
    {
	string path = "C:\\stagelist.txt";

	string extension = Path.GetExtension(path);
	string filename = Path.GetFileName(path);
	string filenameNoExtension = Path.GetFileNameWithoutExtension(path);
	string root = Path.GetPathRoot(path);

	Console.WriteLine("{0}\n{1}\n{2}\n{3}",
	    extension,
	    filename,
	    filenameNoExtension,
	    root);
    }
}

Output

.txt
stagelist.txt
stagelist
C:\

 

출처 : http://www.dotnetperls.com/path
Posted by 나이스곰
2011. 7. 12. 14:12

# include <openssl/err.h>

# include <openssl/ssl.h>


/*  AES Encrypt Process */  

int encrypt_block(unsigned char* cipherText, unsigned char* plainText, unsigned int plainTextLen, unsigned char* key)   

{   

    EVP_CIPHER_CTX *ctx = (EVP_CIPHER_CTX*)malloc(sizeof(EVP_CIPHER_CTX));   

    int addLen = 0, orgLen = 0;   

    unsigned long err = 0;  

    ERR_load_crypto_strings();   

    EVP_CIPHER_CTX_init(ctx);  

    if(EVP_EncryptInit(ctx, EVP_aes_128_cbc(), key, NULL) != 1) {   

        err = ERR_get_error();   

        printf("ERR : EVP_Encrypt() - %s\n", ERR_error_string(err, NULL));   

        return -1;   

    }  

    if(EVP_EncryptUpdate(ctx, cipherText, &orgLen, plainText, plainTextLen) != 1) {   

        err = ERR_get_error();   

        printf("ERR : EVP_EncryptUpdate() - %s\n", ERR_error_string(err, NULL));   

        return -1;   

    }  

    if (EVP_EncryptFinal(ctx, cipherText + orgLen, &addLen) != 1) {   

        err = ERR_get_error();   

        printf("ERR: EVP_EncryptFinal() - %s\n", ERR_error_string (err, NULL));   

        return -1;   

    }  

    EVP_CIPHER_CTX_cleanup(ctx);   

    ERR_free_strings();   

    return addLen + orgLen;   

}

/*  AES Decrypt Process */  

int decrypt_block(unsigned char* plainText, unsigned char* cipherText, unsigned int cipherTextLen, unsigned char* key)   

{   

    EVP_CIPHER_CTX *ctx = (EVP_CIPHER_CTX*)malloc(sizeof(EVP_CIPHER_CTX));   

    unsigned long err = 0;   

    int toLen = 0;

    int outLen = 0;

    ERR_load_crypto_strings();   

    EVP_CIPHER_CTX_init(ctx);  

    if (EVP_DecryptInit(ctx, EVP_aes_128_cbc(), key, NULL) != 1) {   

        err = ERR_get_error();   

        printf("ERR: EVP_DecryptInit() - %s\n", ERR_error_string (err, NULL));   

        return -1;   

    }   

    if (EVP_DecryptUpdate(ctx, plainText, &toLen, cipherText, cipherTextLen) != 1) {   

        err = ERR_get_error();     

        printf("ERR: EVP_DecryptUpdate() - %s\n", ERR_error_string (err, NULL));   

        return -1;   

    }  

    if (EVP_DecryptFinal(ctx, &plainText[cipherTextLen], &outLen) != 1) {   

        err = ERR_get_error();   

        printf("ERR: EVP_DecryptFinal() - %s\n", ERR_error_string (err, NULL));   

        return -1;   

    }  

    EVP_CIPHER_CTX_cleanup(ctx);   

    ERR_free_strings();  

    return toLen + outLen;   

}
 

OpenSSL 라이브러리를 이용한 암호화 예제코드입니다.
공식 홈페이지에서 배포한게 아니라 어느분이 Windows 에서 오류없이 돌아가게끔 수정해놓은건데
정리가 잘되어 있어서 사용하기가 편리합니다.

사용시,
 
ssleay32.lib, libeay32.lib

이 라이브러리를 포함해주셔야 됩니다.

Posted by 나이스곰
2011. 6. 24. 11:03
여기서 얻어지는 rowID는 zero base 가 아니기 때문에 실제 접근시에 -1 해주어야 제대로 접근이 됩니다.
 
foreach(DataRow dataRow in foundRows)
{
System.Reflection.FieldInfo fieldInfo = dataRow.GetType().GetField("rowID",System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); 
int rowID = (int)fieldInfo.GetValue(dataRow);

this.dataGrid2.Select(rowID-1);
}

여기서 사용하는 Reflection 에는 유용한 기능들이 많으니 한번쯤 msdn을 둘러보시는 것도 좋을 것 같습니다.

출처 : http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/71ed2a79-5115-45f9-9ba4-fee80cfe9908/
Posted by 나이스곰