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
def decorator(decorator): | |
def decorate(func): | |
def decorated(*args, **kw): | |
return decorator(func, *args, **kw) | |
return decorated | |
return decorate | |
@decorator | |
def decor1(func, *args, **kw): |
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
// YSTableViewCells.h | |
// | |
// A set of cells for implementing Preferences-like tables. | |
// | |
// Copyright (c) 2009, Andrey Tarantsov <[email protected]> | |
// | |
// Permission to use, copy, modify, and/or distribute this software for any | |
// purpose with or without fee is hereby granted, provided that the above | |
// copyright notice and this permission notice appear in all copies. | |
// |
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 com.yoursway.common.ui.animatedimage; | |
import java.io.InputStream; | |
import org.eclipse.swt.SWT; | |
import org.eclipse.swt.SWTException; | |
import org.eclipse.swt.graphics.Color; | |
import org.eclipse.swt.graphics.GC; | |
import org.eclipse.swt.graphics.Image; | |
import org.eclipse.swt.graphics.ImageData; |
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
diff -r 3d6ddf4fd6b0 fixture/util.py | |
--- a/fixture/util.py Fri Oct 02 10:20:09 2009 -0500 | |
+++ b/fixture/util.py Mon Jan 25 05:01:47 2010 +0600 | |
@@ -33,6 +33,7 @@ | |
data = None | |
datasets = [] | |
def setUp(self): | |
+ super(DataTestCase, self).setUp() | |
if self.fixture is None: | |
raise NotImplementedError("no concrete fixture to load data with") |
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
diff -r 3d6ddf4fd6b0 fixture/loadable/loadable.py | |
--- a/fixture/loadable/loadable.py Fri Oct 02 10:20:09 2009 -0500 | |
+++ b/fixture/loadable/loadable.py Mon Jan 25 05:01:47 2010 +0600 | |
@@ -236,6 +236,8 @@ | |
ds.meta._stored_objects.store(key, obj) | |
# save the instance in place of the class... | |
ds._setdata(key, row) | |
+ # allow to reference the real object via MyData.somekey_obj (non-threadsafe!) | |
+ setattr(type(ds), key + '_obj', obj) | |
if not registered: |
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
import os | |
def set_logged_in_user(email, admin=False): | |
if email is None or email == '': | |
email, domain = '', 'example.com' | |
admin = False | |
else: | |
domain = email[email.index('@')+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
3 int | |
<3 X N......A | |
Dec |
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 com.yoursway.fsmonitor; | |
import static com.yoursway.utils.YsCollections.addIfNotNull; | |
import static com.yoursway.utils.YsPathUtils.isChildOrParent; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.HashSet; |
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
# Tap as a language operator approach (say we call it ^, though it's a bad one) | |
# name ^ | |
# or expr ^ ( argname ) | |
# solves the "returning" problem | |
updateSize: (comp) -> | |
return null unless comp.isInDocument | |
size^: computeSize comp | |
$(comp.node).css { width: size.w; height: size.h } |
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
updateSize: (comp) -> | |
return unless comp.isInDocument | |
computeSize comp >- (size) | |
$(comp.node).css { width: size.w; height: size.h |