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
#!/usr/local/bin/python | |
# a Python script for PyEphem | |
# http://rhodesmill.org/pyephem/ | |
# to find out the sunrise and sunset time | |
# in UTC | |
# (add more code for the local time by yourself) | |
# by Kenji Rikitake 6-OCT-2009 | |
from datetime import datetime, timedelta |
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
%% Power function (X ^ Y) and root function (X ^ (1/Y)) for | |
%% integers in Erlang | |
%% by Kenji Rikitake <kenji.rikitake@acm.org> 26-JAN-2010 | |
%% Distributed under MIT license at the end of the source code. | |
-module(bignum_root). | |
-export([power/2, root/2]). | |
%% significand digits for float estimation |
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
%% square root function for integers in Erlang | |
%% by Kenji Rikitake <kenji.rikitake@acm.org> 26-JAN-2010 | |
%% Distributed under MIT license at the end of the source code. | |
-module(bignum_sqrt). | |
-export([sqrt/1]). | |
%% significand digits for float estimation | |
-define(DIGITS, 10). |
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
%% Power function (X ^ Y) and root function (X ^ (1/Y)) for | |
%% integers in Erlang | |
%% by Kenji Rikitake <kenji.rikitake@acm.org> 26-JAN-2010 | |
%% modified by Hynek Vychodil <vychodil.hynek@gmail.com> 2-FEB-2010 | |
%% modified by Kenji Rikitake <kenji.rikitake@acm.org> 3-FEB-2010 | |
%% Distributed under MIT license at the end of the source code. | |
-module(bignum_root). | |
-export([power/2, root/2, sqrt/1]). |
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> | |
static unsigned int x[8]; /* Generator's state.*/ | |
/* Advances by one step and returns a number in [0,1).*/ | |
unsigned int xorshift7 (void) { | |
static int k = 0; | |
unsigned int y, t; | |
t = x[(k+7) & 0x7U]; t = t ^ (t<<13); y = t ^ (t<<9); | |
t = x[(k+4) & 0x7U]; y ^= t ^ (t<<7); |
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
%% Modified version of random module | |
%% to use Wichmann-Hill algorithm published on 2006 | |
%% which succeeds the old AS183 algorithm in 1982. | |
%% Copyright (c) 2010 Kenji Rikitake All rights reserved. | |
%% | |
%% %CopyrightBegin% | |
%% | |
%% Copyright Ericsson AB 1996-2009. All Rights Reserved. |
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
* Bluetail/Alteon/Nortel (distributed, fault tolerant email system, SSL accelerator) | |
* Cellpoint (Location-based Mobile Services) | |
* Corelatus (SS7 monitoring). | |
* dqdp.net (in Latvian) (Web Services). | |
* Facebook (Facebook chat backend) | |
* Finnish Meteorological Institute (Data acquisition and real-time monitoring) | |
* IDT corp. (Real-time least-cost routing expert systems) | |
* Kreditor (Electronic payment systems) | |
* Mobilearts (GSM and UMTS services) |
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 <stdlib.h> | |
#include <sys/time.h> | |
int main(int argc, char **argv) | |
{ | |
struct timeval t; | |
struct timezone tz; | |
if (-1 == gettimeofday(&t, &tz)) { |
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
{erl_opts, [fail_on_warning, debug_info]}. | |
{xref_checks, [undefined_function_calls]}. | |
%% {eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]}. | |
{cover_enabled, true}. | |
{clean_files, [".eunit", "ebin/*.beam"]}. | |
{dialyzer_opts, | |
[{warnings, | |
[no_return, | |
no_unused, | |
no_improper_lists, |
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
#!/bin/sh | |
# generic port permission fix script | |
# when you forget "umask 022" | |
cd /usr/ports | |
find . -type d -not -perm -001 | xargs chmod go+rx | |
find . -type f -and -not -perm -444 | xargs chmod go+r |
OlderNewer