Skip to content

Instantly share code, notes, and snippets.

View camark's full-sized avatar

Ming Gong camark

View GitHub Profile
@camark
camark / C# RightAnimateWindow.cs
Created September 7, 2016 09:01
Pop windows use c#
/// <summary>
/// 窗体动画函数 注意:要引用System.Runtime.InteropServices;
/// </summary>
/// <param name="hwnd">指定产生动画的窗口的句柄</param>
/// <param name="dwTime">指定动画持续的时间</param>
/// <param name="dwFlags">指定动画类型,可以是一个或多个标志的组合。</param>
/// <returns></returns>
[DllImport("user32")]
private static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags);
//下面是可用的常量,根据不同的动画效果声明自己需要的
@camark
camark / icba-translate.py
Created September 7, 2016 12:34
use icba openapi to translate
#/usr/bin/env python3
#coding=utf8
import urllib
from urllib import request
from xml.dom.minidom import parse, parseString, Node
# http://dict-co.iciba.com/api/dictionary.php?w=go&key=0D90F9AF76633667613F22F9137AE868
urltemplate = "http://dict-co.iciba.com/api/dictionary.php?%s"
@camark
camark / DelDuplicateZip.java
Created September 27, 2016 04:44
删除已经解压的RAR或者Zip文件
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
@camark
camark / Shutdown.pas
Created October 17, 2016 06:10
Shutdown with Delphi
function ShutDown :boolean;
const
ADJUST_PRIV = TOKEN_QUERY or TOKEN_ADJUST_PRIVILEGES;
SHTDWN_PRIV = 'SeShutdownPrivilege';
PRIV_SIZE = sizeOf(TTokenPrivileges);
var
Len: DWORD;
TokenPriv, Dummy: TTokenPrivileges;
Token: THandle;
Error: integer;
@camark
camark / main.cpp
Created October 17, 2016 06:13 — forked from chowey/main.cpp
C++ Win32 Shutdown With Privilages
#include <Windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
HANDLE hToken;
OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES |
TOKEN_QUERY,
&hToken);
#include <windows.h>
#pragma comment(lib, "advapi32.lib")
BOOL ShutdownSystem(LPTSTR lpMsg){
HANDLE hToken; // handle to process token
TOKEN_PRIVILEGES tkp; // pointer to token structure
BOOL fResult; // system shutdown flag
// Get the current process token handle so we can get shutdown
@camark
camark / ComposeFile.java
Created October 18, 2016 07:20
compose file line into str with split ","
package com.company;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;
import java.util.stream.Stream;
public class Main {
@camark
camark / cad2excel.lsp
Last active May 10, 2024 22:23
Convet CAD
(defun vk_PutXls
;;;Âåðñ³ÿ 0.10
;;;³ä 20.08.2008
(FileName SheetName
InList /
ExcelObj BooksObj
BookObj SheetObj
SheetsObj CellsObj
RowCounter ColumnCounter
IntFormat RealFormat
@camark
camark / convertrmb.cpp
Created November 23, 2016 01:38
人民币大写
using std::vector;
using std::string;
using std::cout;
using std::cin;
using std::endl;
string ConvertMoney(double dNum)
{
string strResult;//要返回的字符串
char c_Digit[20];//c风格的字符数组
@camark
camark / Kaoqin.html
Created November 25, 2016 08:42
考勤表
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- 引入 Bootstrap -->
<link href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 Shim 和 Respond.js 用于让 IE8 支持 HTML5元素和媒体查询 -->
<!-- 注意: 如果通过 file:// 引入 Respond.js 文件,则该文件无法起效果 -->