Made vigil into a package with a setup.py file.

This commit is contained in:
Andrew Hamilton 2017-06-27 14:03:32 +01:00
parent 49f8d87659
commit 5728e5cff3
135 changed files with 76 additions and 50 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

View file

@ -0,0 +1,197 @@
/**
* Copyright (c) Rich Hickey. All rights reserved.
* The use and distribution terms for this software are covered by the
* Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
* which can be found in the file epl-v10.html at the root of this distribution.
* By using this software in any fashion, you are agreeing to be bound by
* the terms of this license.
* You must not remove this notice, or any other, from this software.
**/
/* rich Apr 19, 2008 */
package clojure.lang;
import java.lang.ref.Reference;
import java.math.BigInteger;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.lang.ref.SoftReference;
import java.lang.ref.ReferenceQueue;
public class Util{
static public boolean equiv(Object k1, Object k2){
if(k1 == k2)
return true;
if(k1 != null)
{
if(k1 instanceof Number && k2 instanceof Number)
return Numbers.equal((Number)k1, (Number)k2);
else if(k1 instanceof IPersistentCollection || k2 instanceof IPersistentCollection)
return pcequiv(k1,k2);
return k1.equals(k2);
}
return false;
}
static public boolean equiv(long k1, long k2){
return k1 == k2;
}
static public boolean equiv(Object k1, long k2){
return equiv(k1, (Object)k2);
}
static public boolean equiv(long k1, Object k2){
return equiv((Object)k1, k2);
}
static public boolean equiv(double k1, double k2){
return k1 == k2;
}
static public boolean equiv(Object k1, double k2){
return equiv(k1, (Object)k2);
}
static public boolean equiv(double k1, Object k2){
return equiv((Object)k1, k2);
}
static public boolean equiv(boolean k1, boolean k2){
return k1 == k2;
}
static public boolean equiv(Object k1, boolean k2){
return equiv(k1, (Object)k2);
}
static public boolean equiv(boolean k1, Object k2){
return equiv((Object)k1, k2);
}
static public boolean equiv(char c1, char c2) {
return c1 == c2;
}
static public boolean pcequiv(Object k1, Object k2){
if(k1 instanceof IPersistentCollection)
return ((IPersistentCollection)k1).equiv(k2);
return ((IPersistentCollection)k2).equiv(k1);
}
static public boolean equals(Object k1, Object k2){
if(k1 == k2)
return true;
return k1 != null && k1.equals(k2);
}
static public boolean identical(Object k1, Object k2){
return k1 == k2;
}
static public Class classOf(Object x){
if(x != null)
return x.getClass();
return null;
}
static public int compare(Object k1, Object k2){
if(k1 == k2)
return 0;
if(k1 != null)
{
if(k2 == null)
return 1;
if(k1 instanceof Number)
return Numbers.compare((Number) k1, (Number) k2);
return ((Comparable) k1).compareTo(k2);
}
return -1;
}
static public int hash(Object o){
if(o == null)
return 0;
return o.hashCode();
}
static public int hasheq(Object o){
if(o == null)
return 0;
if(o instanceof Number)
return Numbers.hasheq((Number)o);
else if(o instanceof IHashEq)
return ((IHashEq)o).hasheq();
return o.hashCode();
}
static public int hashCombine(int seed, int hash){
//a la boost
seed ^= hash + 0x9e3779b9 + (seed << 6) + (seed >> 2);
return seed;
}
static public boolean isPrimitive(Class c){
return c != null && c.isPrimitive() && !(c == Void.TYPE);
}
static public boolean isInteger(Object x){
return x instanceof Integer
|| x instanceof Long
|| x instanceof BigInt
|| x instanceof BigInteger;
}
static public Object ret1(Object ret, Object nil){
return ret;
}
static public ISeq ret1(ISeq ret, Object nil){
return ret;
}
static public <K,V> void clearCache(ReferenceQueue rq, ConcurrentHashMap<K, Reference<V>> cache){
//cleanup any dead entries
if(rq.poll() != null)
{
while(rq.poll() != null)
;
for(Map.Entry<K, Reference<V>> e : cache.entrySet())
{
Reference<V> val = e.getValue();
if(val != null && val.get() == null)
cache.remove(e.getKey(), val);
}
}
}
static public RuntimeException runtimeException(String s){
return new RuntimeException(s);
}
static public RuntimeException runtimeException(String s, Throwable e){
return new RuntimeException(s, e);
}
/**
* Throw even checked exceptions without being required
* to declare them or catch them. Suggested idiom:
* <p>
* <code>throw sneakyThrow( some exception );</code>
*/
static public RuntimeException sneakyThrow(Throwable t) {
// http://www.mail-archive.com/javaposse@googlegroups.com/msg05984.html
if (t == null)
throw new NullPointerException();
Util.<RuntimeException>sneakyThrow0(t);
return null;
}
@SuppressWarnings("unchecked")
static private <T extends Throwable> void sneakyThrow0(Throwable t) throws T {
throw (T) t;
}
}

View file

@ -0,0 +1,159 @@
$Id: contents.pod,v 1.3 2003/05/04 04:05:14 tower Exp $
=begin html
<style = "text/css">
code { font-family: sans-serif; font-weight:bold; }
</style>
=end html
=head1 Net::Z3950::AsyncZ
=head2 Intro
Net::Z3950::AsyncZ adds an additional layer of asynchronous support for the Z3950 module through the use
of multiple forked processes. I hope that users will also find that it provides a convenient
front end to C<Net::Z3950>. My initial idea was to write something that
would provide a convenient means of processing and formatting Z39.50 records--which I
did, using the C<Z3950> synchronous code. But I also wanted something that could
handle queries to large numbers of servers at one session. Working on this part of my
project, I found that I had trouble with the C<Z3950> asynchronous features
and so ended up with what I have here.
=begin html
I give a more detailed account in the <A href="AsyncZ.html#apologia"><B>DESCRIPTION</b></a>
section of <code>AsyncZ.html</code>.
=end html
=pod
I give a more detailed account in in the B<DESCRIPTION> section of C<AsyncZ.pod>.
=cut
=head2 Documentation
=pod
=over 4
=item AsyncZ.pod
This is the starting point--it gives an overview of the AsyncZ module,
describes the basic mechanics of its asynchronous workings, and details
the particulars of the objects and methods. But see
L</"Examples.pod> for detailed explanations of the sample
scripts which come with the C<Net::Z3950::AsyncZ> distribution.
=item Options.pod
This document details the various options that can be set to modify
the behavior of AsyncZ Index
=item Report.pod
Report.pod deals with how records are treated line by line
and how you can affect the apearance of a record's line by line output
=item Examples.pod
This document goes through the sample scripts that come with the
C<Net::Z3950::AsyncZ> distribution and annotates them
in a line-by-line fashion. It's a basic HOW-TO.
=back
=cut
=begin html
<UL>
<LI>
<A href="AsyncZ.html">AsyncZ.html</a>
<br>This is the starting point--it gives an overview of the AsyncZ module,
describes the basic mechanics of its asynchronous workings, and details
the particulars of the objects and methods. But see
<a href="#examples">Examples</a> for detailed explanations of the sample
scripts which come with the <code>Net::Z3950::AsyncZ</code> distribution.
<LI>
<A href="Options.html">Options.html</a>
<br> This document details the various options that can be set to modify
the behavior of <code>AsyncZ</code>
<LI>
<A href="Report.html">Report.html</a>
<br><Code>Report.html</code> deals with how records are treated line by line
and how you can affect the apearance of a record's line by line output
<LI><A name = "examples"></a>
<A href="Examples.html">Examples.html</a>
This document goes through the sample scripts that come with the
<code>Net::Z3950::AsyncZ</code> distribution and annotates them
in a line-by-line fashion. It's a basic HOW-TO.
</UL>
=end html
=head2 The Modules
=pod
There are more modules than there is documentation. The reason for this
is that the only module you have full and complete access to is
C<Net::Z3950::AsyncZ>. The other modules are either internal to C<Net::AsyncZ>
or accessed indirectly or in part indirectly.
=cut
=for html
There are more modules than there is documentation. The reason for this
is that the only module you have full and complete access to is
<code>Net::Z3950::AsyncZ</code>. The other modules are either internal to <code>Net::AsyncZ</code>
or accessed indirectly or in part indirectly.
=head3 Here are the modules:
=over 4
=item Net::Z3950::AsyncZ
The main module: direct access --documented in
C<AsyncZ> and C<Options> documentation
=item Net::Z3950::AsyncZ::ErrMsg
User error message handling: indirect access -- documented in
C<AsyncZ> documentation
=item Net::Z3950::AsyncZ::Errors
Error handling for debugging: limited access -- documented in
C<AsyncZ> documentation
=item Net::Z3950::AsyncZ::Report
Module reponsible for fetching and formatting records: limited access -- documented
=item Net::Z3950::AsyncZ::ZLoop
Event loop for child processes: no access -- not documented
=item Net::Z3950::AsyncZ::ZSend
Connection details for child processes: no access -- not documented
=item Net::Z3950::AsyncZ::Options::_params
Options for child processes: direct and indirect access -- documented
in C<Options> and C<AsyncZ> documentation
=back
=head1 INDEX

View file

@ -0,0 +1,7 @@
#include <stdio.h>
int main()
{
printf("Hello World\n");
return 0;
}

View file

@ -0,0 +1,8 @@
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World" << endl;
}

View file

@ -0,0 +1,6 @@
#ifndef HELLO_H
#define HELLO_H
void hello();
#endif

View file

@ -0,0 +1,4 @@
<html>
<head></head>
<body>hello</body>
</html>

View file

@ -0,0 +1,4 @@
def hi():
print "hi"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,4 @@
def hi():
print("hi")

View file

@ -0,0 +1,15 @@
import unittest
import hi3
class HiTestCase(unittest.TestCase):
def test_hi(self):
hi3.hi()
if __name__ == "__main__":
unittest.main()

View file

@ -0,0 +1,15 @@
import unittest
import hi
class HiTestCase(unittest.TestCase):
def test_hi(self):
hi.hi()
if __name__ == "__main__":
unittest.main()

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,2 @@
#!/usr/bin/perl
print "Hello, world!\n";

View file

Internal server error - Forgejo: Beyond coding. We Forge.

500

Internal server error

Forgejo version: 11.0.3+gitea-1.22.0

@ -0,0 +1,232 @@
#!/usr/bin/env perl6
use v6;
my $string = 'I look like a # comment!';
if $string eq 'foo' {
say 'hello';
}
regex http-verb {
'GET'
| 'POST'
| 'PUT'
| 'DELETE'
| 'TRACE'
| 'OPTIONS'
| 'HEAD'
}
# a sample comment
say 'Hello from Perl 6!'
#`{
multi-line comment!
}
say 'here';
#`(
multi-line comment!
)
say 'here';