Skip to content

Instantly share code, notes, and snippets.

View 0xlitf's full-sized avatar

0xlitf 0xlitf

  • 10:48 (UTC +08:00)
View GitHub Profile
@0xlitf
0xlitf / C++ 取得系统当前时间
Last active March 8, 2016 03:55
C++ 取得系统当前时间
C++ 取得系统当前时间
#include <sysinfoapi.h>
void logSysTime(const char* c)
{
char str[1024] = { 0 };
SYSTEMTIME sys;
GetLocalTime(&sys);
sprintf(str, "%s\tcurrent time:%02d:%02d:%02d.%03d", c, sys.wHour, sys.wMinute, sys.wSecond, sys.wMilliseconds);
LOG4CPLUS_DEBUG(g_loger, str);
@0xlitf
0xlitf / 窗口鼠标丢失问题
Last active February 2, 2016 14:24
窗口鼠标丢失问题
//以下两行代码解决修改座位号窗口鼠标丢失问题
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0);
@0xlitf
0xlitf / svn图标不显示的解决方案
Created January 26, 2016 07:18
svn图标不显示的解决方案
svn图标不显示的解决方案
最近发现svn图标莫名其妙的不显示,其他操作都正常。在网上搜了一些方法。
解决方法一(失败):
升级最新版本,我的本来就是最新版本
解决方法二(失败):
@0xlitf
0xlitf / std::contains
Created January 26, 2016 01:35
std::contains
template <typename T>
const bool contains( std::vector<T>& Vec, const T& Element )
{
if (std::find(Vec.begin(), Vec.end(), Element) != Vec.end())
return true;
return false;
}
@0xlitf
0xlitf / eric安装
Created January 25, 2016 09:11
eric安装
http://m.todgo.com/jingyan/shuma/2164046nca.html
@0xlitf
0xlitf / Git already installed, it's just not linked
Created January 22, 2016 05:03
Git already installed, it's just not linked
sudo chown -R Calcifer: /usr/local
@0xlitf
0xlitf / curl download
Last active January 22, 2016 04:01
curl download
//采用CURLOPT_RESUME_FROM_LARGE 实现文件断点续传功能
#include <QtCore/QCoreApplication>
#include <stdlib.h>
#include <stdio.h>
#include <sys/stat.h>
#include <include/curl/curl.h>
#pragma comment(lib,"libcurl.lib")
//这个函数为CURLOPT_HEADERFUNCTION参数构造
@0xlitf
0xlitf / mac ftp
Created January 21, 2016 14:03
mac ftp
mac下一般用smb服务来进行远程文件访问,但要用FTP的话,高版本的mac os默认关掉了,可以用如下命令打开:
sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
相应的,要关闭则:
sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist
@0xlitf
0xlitf / vsconfig
Created January 20, 2016 09:38
VS2013同时安装VA和Resharper,智能提示使用VA
VA Options:
Suggestions-Include suggestions in listboxes
-Include VA Snippets in listboxes
Resharper Options:
Environment-IntelliSense-General-Custon IntelliSense
@0xlitf
0xlitf / sqltable.cpp
Created January 20, 2016 08:48
sqltable.cpp
#include "mysqltable.h"
#include <QtGui>
#include <QtSql>
#include <QTableView>
#include <QMessageBox>
#include <iostream>
#include <QFileDialog>
MysqlTable::MysqlTable(QWidget *parent)
: QMainWindow(parent)