This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdafx.h" | |
#include <regex> | |
#include <iostream> | |
#include <exception> | |
int _tmain(int argc, _TCHAR* argv[]) | |
{ | |
std::string source = "{pa,tt}, {e, rn}"; | |
try | |
{ | |
std::regex pattern("\\{.*?\\}", std::regex_constants::ECMAScript); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
files = glob.glob("C:\\path\\*.exe") | |
for file in files: | |
os.rename(file, file.replace(".exe", ".com")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--package.cpath = package.cpath..';'..'C:\\devel\\luaexpat-1.2.0\\luaexpat-1.1.win32-lua51' | |
require("lxp") | |
sample_text = "<elem1>text<elem2>inside text</elem2>more text</elem1>" | |
local count = 0 | |
callbacks = { | |
StartElement = function(parser, name) | |
io.write( string.rep(" ", count), "+", name, "\n" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdafx.h" | |
#include <WinSock2.h> | |
#include <ws2tcpip.h> | |
#pragma comment(lib, "Ws2_32.lib") | |
void run_client() | |
{ | |
WSADATA wsaData; | |
WSAStartup( MAKEWORD(2,2), &wsaData ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <map> | |
#include <string> | |
#include <functional> | |
#include <iostream> | |
using namespace std; | |
template <class T> | |
class Delegator | |
{ | |
public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string json_text = @" | |
{ | |
""album"" : { | |
""name"" : ""The Dark Side of the Moon"", | |
""artist"" : ""Pink Floyd"", | |
""year"" : 1973, | |
""tracks"" : [ | |
""Speak To Me"", | |
""Breathe"", | |
""On The Run"" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
classTemplate = { | |
new = function(self, func, o) | |
o = o or {} | |
setmetatable(o, self) | |
self.__index = self | |
return o; | |
end | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tuple(arg) -- arg is table. | |
local n_arg = #arg | |
if n_arg == 0 then | |
return nil; | |
end | |
if n_arg == 1 then | |
return arg[1]; | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float value = 100.001f; | |
byte[] FloatToByte = System.BitConverter.GetBytes(value); | |
float ByteToFloat = BitConverter.ToSingle(FloatToByte, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System; | |
public class CanvasWindow : EditorWindow { | |
[MenuItem("Canvas/Show")] | |
public static void ShowWindow() | |
{ | |
CanvasWindow window = (CanvasWindow)EditorWindow.GetWindow(typeof(CanvasWindow)); |