This file contains 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
-module(flashpolicy). | |
-vsn("0.9.01"). | |
-export([ start/0, stop/0 ]). | |
-export([ init/3 ]). | |
-export([ wait/2 ]). | |
-define(POLICY_FILE, "/path/to/policyfile.xml"). | |
start() -> | |
start(?POLICY_FILE, 843, 3 ). |
This file contains 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 org.mitsuji | |
import java.net._ | |
import java.io._ | |
import java.util.Date | |
import java.util.concurrent._ | |
object FlashPolicyServer { | |
val server = new FlashPolicyServer() |
This file contains 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 <iostream> | |
#include <iomanip> | |
// int version | |
void memdumpi(void* vptr, size_t len) | |
{ | |
std::cout << ">>>> memdump(int) ---------------------------" << std::endl; | |
unsigned int* cptr = reinterpret_cast<unsigned int*>( vptr ); | |
for (size_t i=0; i<(len/sizeof(int)); ++i ) |
This file contains 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
#pragma comment(lib, "crypt32.lib") | |
#include <cstddef> | |
#include <string> | |
#include <windows.h> | |
#include <Wincrypt.h> | |
bool encrypt(const std::string& key, const std::string& plain, void* crypt, size_t* crypt_len ) | |
{ | |
DATA_BLOB key_bolb; |
This file contains 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
module HDaemon.Server where | |
import Control.Concurrent | |
import System.IO | |
data SStatus = Run | Shutdown | Stop deriving( Eq ) | |
type SHandle = MVar SStatus | |
start :: String -> IO(SHandle) | |
start confPath = do |
This file contains 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
module HDaemon.Foreign where | |
import System.Environment | |
import Foreign | |
import HDaemon.Server | |
foreignStart :: IO(StablePtr(SHandle)) | |
foreignStart = do | |
logPath <- getLogPath |
This file contains 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
module HDaemon.Daemon where | |
import Control.Concurrent | |
import System.Environment | |
import System.Posix.Signals | |
import Foreign | |
import HDaemon.Server | |
termHandler :: MVar Bool -> SHandle -> IO() |
This file contains 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 <stdio.h> | |
#include <unistd.h> | |
#include <signal.h> | |
#include <HsFFI.h> | |
#include "HDaemon/Daemon_stub.h" | |
extern void __stginit_HDaemonziDaemon(void); | |
int save_pid() |
This file contains 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 GetPosixTimeStr() | |
Dim nMinutesInDay | |
nMinutesInDay = 60 * 60 * 24 | |
Dim nMinutesNow | |
nMinutesNow = CDbl(Now) * nMinutesInDay | |
nMinutesNow = nMinutesNow -( 9 * 60 * 60 ) '' UTC | |
Dim nMinutesEpoch |
This file contains 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
// file: identon2.cpp | |
// | |
// gcc -xc++ -lstdc++ identon2.cpp | |
// CL /TP /EHsc identon2.cpp | |
#include <limits.h> | |
#include <sstream> | |
#include <iostream> |
OlderNewer