Skip to content

Instantly share code, notes, and snippets.

View j2doll's full-sized avatar
💭
1️⃣ 😄 2️⃣ 😭

Jay Two j2doll

💭
1️⃣ 😄 2️⃣ 😭
View GitHub Profile
@j2doll
j2doll / shift.cpp
Last active August 12, 2017 08:59
Demonstrate shift operators
// shift.cpp
// code from MSDN
// Demonstrate shift operators
#include <iostream>
using namespace std;
int _tmain() {
 cout << "5 times 2 is " << (5 << 1) << endl; // 5 × 2 = 10
@j2doll
j2doll / SimpleClient.cpp
Created August 12, 2017 09:11
SimpleClient
// SimpleClient.cpp
#include "ace/ACE.h"
#include "ace/INET_Addr.h"
#include "ace/SOCK_Connector.h"
#include "ace/SOCK_Stream.h"
int main()
{
const char* pathname = "index.html";
@j2doll
j2doll / MinMax.cpp
Last active August 12, 2017 09:16
min max value using STL
// MinMax.cpp
// min/max value of C++
// code from : http://www.cppreference.com/wiki/data_types
#include <limits>
std::cout << "Maximum short value: " << std::numeric_limits<short>::max() << std::endl;
std::cout << "Minimum short value: " << std::numeric_limits<short>::min() << std::endl;
@j2doll
j2doll / get_libc_ver.cpp
Created August 20, 2017 08:15
Get the version of GNU C Library
// get_libc_ver.cpp
// http://j2doll.tistory.com/467
#include <stdio.h>
#include <gnu/libc-version.h>
int main (int argc, char* argv[])
{
puts (gnu_get_libc_version ());
return 0;
@j2doll
j2doll / Project1.cpp
Last active September 2, 2017 04:43
Hello VCL
// Project1.cpp
//---------------------------------------------------------------------------
#include <vcl.h> // VCL 사용 시, 기본은 이거...
#pragma hdrstop // 프리컴파일러 최적화 ; #include 처리 후에 써 준다...
USEFORM("Unit1.cpp", Form1); // 매크로 ; 폼을 사용한다는 매크로이겄슴...
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) // entry point
{
@j2doll
j2doll / which32-64.cpp
Last active May 29, 2018 01:58
Determining 32 vs 64 bit in C++
// which32-64.cpp
// check 32/64bit for Microsoft Visual C++(Visual Studio) (or, C++ Builer, etc)
#if ((ULONG_MAX) == (UINT_MAX))
# define IS32BIT // 32bit Windows(x32)
#else
# define IS64BIT // 64bit Windows(x64)
#endif
// check 32/64bit for gcc(g++)
@j2doll
j2doll / qt.single.instance.cpp
Created September 8, 2017 12:12
single instance process for Qt
// qt.single.instance.cpp
//
// code from http://blog.naver.com/PostView.nhn?blogId=browniz1004&logNo=220957590867&categoryNo=15&parentCategoryNo=0&viewDate=&currentPage=8&postListTopCurrentPage=&from=postList&userTopListOpen=true&userTopListCount=5&userTopListManageOpen=false&userTopListCurrentPage=8
#include "mainwindow.h"
#include <QApplication>
#include <QSharedMemory>
int main(int argc, char *argv[])
{
@j2doll
j2doll / UNREFERENCED_PARAMETER.cpp
Created September 9, 2017 05:17
UNREFERENCED PARAMETER
#include <windows.h>
int APIENTRY _tWinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPTSTR lpCmdLine,int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine); // warning is not displayed
// ...
@j2doll
j2doll / hello-xlnt.cpp
Created October 17, 2017 05:16
Hello Xlnt
#include <iostream>
#include <xlnt/xlnt.hpp>
int main()
{
    xlnt::workbook wb;
    wb.load("/home/timothymccallum/test.xlsx");
    auto ws = wb.active_sheet();
    std::clog << "Processing spread sheet" << std::endl;
    for (auto row : ws.rows(false))
@j2doll
j2doll / vector-xlnt.cpp
Created October 17, 2017 05:20
Vector Xlnt
#include <iostream>
#include <xlnt/xlnt.hpp>
#include <vector>
int main()
{
xlnt::workbook wb;
wb.load("/home/timothymccallum/test.xlsx");
auto ws = wb.active_sheet();
std::clog << "Processing spread sheet" << std::endl;