Skip to content

Instantly share code, notes, and snippets.

index e227f9f..d24acc5 100644
--- a/patternmatching/__init__.py
+++ b/patternmatching/__init__.py
@@ -8,7 +8,8 @@ class _Values(list):
def match(pattern, data, flatten=True):
def _match(pattern, data, success):
def _is_ignore(pattern):
- return not (isinstance(pattern, _Matcher) and not pattern.ignore)
+ #return isinstance(pattern, IGNORE)
+ return False
OST /stream?after=1337604934980 HTTP/1.1
Host: localhost:8080
X-Requested-With: XMLHttpRequest
["/machines/3c17035c-a9b5-5660-9f3d-a41e98280ef5/interfaces/vnet0/","/machines/3c17035c-a9b5-5660-9f3d-a41e98280ef5/interfaces/vnet1/","/machines/3c17035c-a9b5-5660-9f3d-a41e98280ef5/i
nterfaces/lxcbr0/","/machines/3c17035c-a9b5-5660-9f3d-a41e98280ef5/interfaces/wlan0/","/machines/3c17035c-a9b5-5660-9f3d-a41e98280ef5/interfaces/lo/","/machines/3c17035c-a9b5-5660-9f3d-a41e98280ef5/interfaces/virbr0/","/machines/3c17035c-
a9b5-5660-9f3d-a41e98280ef5/interfaces/eth0/","/machines/3c17035c-a9b5-5660-9f3d-a41e98280ef5/vms/82e8bf80-98de-4a41-a470-f2ebadc3069e/","/machines/dec05233-cc7c-5a8c-8919-d8454bf894ae/","/machines/3c17035c-a9b5-5660-9f3d-a41e98280ef5/vms
/ba9b5f90-d25e-e3da-5a13-dfe96ba42c79/","/machines/3c17035c-a9b5-5660-9f3d-a41e98280ef5/vms/cfb5b174-b86b-867c-90ed-a05ee4e7ecbf/","/machines/3c17035c-a9b5-5660-9f3d-a41e98280ef5/vms/93071a3f-eac1-1f58-53a4-0e2308d48109/","/machines/3c170
35c-a9b5-5660-9f3d-a41e982
# ...
def setup_environ():
from grokcore.component.testing import grok
grok('opennode.oms.endpoint.ssh.cmd.grokkers') # XXX: Not sure why this needs to be explicit--an ordering issue?
grok('opennode.oms.security.grokkers') # XXX: Not sure why this needs to be explicit--an ordering issue?
grok('grokcore.security.meta') # invoke the PermissionGrokker which will register groksecurity permissions.
grok('opennode.oms')
def providesSubscriptionAdapter(cls):
provideSubscriptionAdapter(cls, adapts=[cls])
return cls
@providesSubscriptionAdapter
class cmd_ls(Cmd):
implements(ICmdArgumentsSyntax)
assert invocation == [('write', ("usage: nosetests [-h] N [N ...]\n\npositional arguments:\n N an integer for the accumulator\n\noptional arguments:\n -h, --help show this help message and exitX\n",),{})]
"""
======================================================================
FAIL: test_help (opennode.oms.tests.test_cmdline.CmdLineTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/marko/Projects/opennode/opennode-management/opennode/oms/tests/test_cmdline.py", line 20, in test_help
assert invocation == [('write', ("usage: nosetests [-h] N [N ...]\n\npositional arguments:\n N an integer for the accumulator\n\noptional arguments:\n -h, --help show this help message and exitX\n",),{})]
AssertionError:
class CSquareSerializer extends CSquareHelpers {
case class RelativePoint(val x: Int, val y: Int)
implicit def tuple2relpoint(t: (Int, Int)) = RelativePoint(t._1, t._2)
sealed trait Component
case class CoarseComponent(val q: Int) extends Component
case class FineComponent(val q: Int, val x: Int, val y: Int) extends Component
case class TopComponent(val q: Int, val x: Int, val y: Int) extends Component
def serialize(square: CSquare) = {
{{{
#!diff
--- /var/lib/dnet/solr/conf/solrconfig.xml 2011-07-11 18:10:50.970025626 +0200
+++ /home/claudio/app/openaire_solr/var/lib/dnet/solr/conf/solrconfig.xml 2011-05-27 12:58:59.000000000 +0200
@@ -31,14 +31,6 @@
-Dsolr.abortOnConfigurationError=false
-->
<abortOnConfigurationError>true</abortOnConfigurationError>
-
/*
Hash - Guillermo Estrada
Simple utility to obtain the MD5 and/or SHA-1
of a file from the command line.
2011
Edited: Marko Mikulicic 2011
*/
/*
Hash - Guillermo Estrada
Simple utility to obtain the MD5 and/or SHA-1
of a file from the command line.
2011
Edited: Marko Mikulicic 2011
*/
@mkmik
mkmik / demo
Created June 10, 2011 21:31
go md5/sha1 example
$ for a in md5 sha1 ; do ./hash -$a /bin/ls; ${a}sum /bin/ls; echo; done
a3f812b9fe329322a3d6b00722694e84 /bin/ls
a3f812b9fe329322a3d6b00722694e84 /bin/ls
9eb997f16adb828cd0273f24b0ae94d32c5a3b3f /bin/ls
9eb997f16adb828cd0273f24b0ae94d32c5a3b3f /bin/ls