SPRING :: NOTE
리스트뷰의 더보기 기능 구현입니다. 추가적으로 커스텀으로 만들었습니다. 소스를 어디서 훔쳐온건지는...기억이 안나... 링크를 못달아둡니다.ㅠ 혹시라도 자료에 문제가 있거나, 삭제를 요청 혹은 출처를 아시는 분은 댓글을 달아주시기 바랍니다. 커스텀 리스트뷰 + footer를 이용한 더보기 구현 (샘플소스 다운로드 및 스크린샷은 소스 하단부에 있습니다.) MainActivity.java package com.example.morelistview; import java.util.ArrayList; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.Dia..
#define _CRT_SECURE_NO_DEPRECATE #include "stdio.h" #include "windows.h" #include "stdafx.h" typedef struct SumInfo { int a, b, s; }SUMINFO, *PSUMINFO; void Sum(void* p); void main() { char temp[1024]; printf("sum\n"); DWORD dwThreadld; SUMINFO si = { 1, 100, 0 }; HANDLE h = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Sum, &si, NULL, &dwThreadld); CloseHandle(h); scanf_s(temp); } void Sum(void..
#define _CRT_SECURE_NO_DEPRECATE #include "windows.h" typedef struct SumInfo { int a, b, s; }SUMINFO, *PSUMINFO; DWORD WINAPI Sum(void* p); HANDLE g_hConsoleOut; void writeString(LPCTSTR lpszFormat, ...) { char str[1024] = { 0 }; va_list argList; DWORD dwNumberOfBytesWritten; va_start(argList, lpszFormat); wvsprintf(str, lpszFormat, argList); va_end(argList); WriteFile(g_hConsoleOut, str, lstrle..
#include #include #include #include typedef struct SumInfo { int a, b, s; }SUMINFO, *PSUMINFO; unsigned _stdcall Sum(void* p); void WriteString(const char* lpszFormat, ...) { char str[1024] = { 0 }; va_list argList; va_start(argList, lpszFormat); vprintf(lpszFormat, argList); // 런타임 함수 va_end(argList); } void main() { char temp[1024]; unsigned dwThreadId; printf("*** 예제 C Runtime Library를 이용한 스레..
16진수 값을 받아와 8bit 2진수로 변환해서 바이너리 파일로 저장해주는 프로그램 /* Libraries */ #include #include #include #pragma warning(disable : 4996) #define _CRT_SECURE_NO_DEPRECATE void main() { int j; char binaryNum[10], *pointer; char hexNum[10]; FILE *f; while (true) { gets(hexNum); /* From Hex convert to decimal */ j = strtol(hexNum, &pointer, 16); /* From Decimal convert to Binary */ itoa(j, binaryNum, 2); printf("H..
아주 단순한 바이너리 파일 변환기 temp에 저장해서 한방에 바이너리로 변환해준다. /* Libraries */ #include #include #include #include #pragma warning(disable : 4996) #define _CRT_SECURE_NO_DEPRECATE void main() { FILE *f; char temp[] = { 0x00, 0x00, 0x02, 0xc8, 0x00 }; f = fopen("bin.bin", "wb"); fwrite(temp, 1, 5, f); fclose(f); }
error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 해결 : It is a stressfull job moving from one version of VC++ to another without microsoft making is worse by adding: C4996: 'itoa': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _ito..
출처 : 영상털이범님 블로그 - http://dsnight.tistory.com/14 / [안드로이드] 뒤로가기(Back 버튼) 두번 눌러 앱 종료하기 요즘 많은 어플들이 뒤로가기 버튼을 두번 눌러 앱을 종료시킨다. 종료하시겠습니까? 라는 확인창이 뜨고 확인을 눌러야 되는 번거로움이 없고, 잘못 종료버튼을 눌렀을 경우에도 토스트 알림창만 뜰뿐 별다른 방해요소가 없어서 참 좋은것 같다. 요즘 대부분의 앱이 이러한 종료 방식을 선택하고 있기때문에 한번 구현을 해보자. 구현방법은 간단하다 뒤로가기 버튼 클릭시 현재시간을 저장하며 토스트 알림창을 띄워주고 한번더 눌렀을때 일정시간(예를들면 2초)가 지났는지 확인하고 일정시간이 지나지 않았을 경우 종료, 지났을 경우 알림창을 다시 띄워주면 된다. 1. 시간을 저장..