aphakia/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
aphakia/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
aphakia/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
aphakia/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
aphakia/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
aphakia/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
aphakia/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
aphakia/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
aphakia/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
aphakia/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
aphakia/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
aphakia/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
aphakia/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
aphakia/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
aphakia/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
aphakia/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
aphakia/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
aphakia/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
aphakia/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
aphakia/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
aphakia/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
aphakia/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
aphakia/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
aphakia/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
aphakia/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
aphakia/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
aphakia/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
aphakia/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
aphakia/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
aphakia/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
aphakia/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
aphakia/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
aphakia/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
aphakia/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
aphakia/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
aphakia/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
aphakia/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
aphakia/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
aphakia/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
aphakia/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
aphakia/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
aphakia/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
ascian/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
ascian/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
ascian/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
ascian/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
ascian/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
ascian/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
ascian/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
ascian/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
ascian/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
ascian/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
ascian/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
ascian/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
ascian/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
ascian/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
ascian/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
ascian/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
ascian/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
ascian/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
ascian/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
ascian/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
ascian/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
ascian/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
ascian/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
ascian/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
ascian/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
ascian/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
ascian/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
ascian/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
ascian/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
ascian/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
ascian/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
ascian/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
ascian/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
ascian/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
ascian/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
ascian/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
ascian/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
ascian/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
ascian/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
ascian/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
ascian/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
ascian/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
bolognese/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
bolognese/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
bolognese/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
bolognese/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
bolognese/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
bolognese/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
bolognese/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
bolognese/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
bolognese/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
bolognese/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
bolognese/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
bolognese/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
bolognese/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
bolognese/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
bolognese/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
bolognese/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
bolognese/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
bolognese/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
bolognese/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
bolognese/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
bolognese/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
bolognese/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
bolognese/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
bolognese/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
bolognese/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
bolognese/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
bolognese/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
bolognese/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
bolognese/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
bolognese/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
bolognese/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
bolognese/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
bolognese/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
bolognese/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
bolognese/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
bolognese/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
bolognese/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
bolognese/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
bolognese/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
bolognese/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
bolognese/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
bolognese/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
breeze/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
breeze/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
breeze/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
breeze/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
breeze/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
breeze/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
breeze/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
breeze/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
breeze/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
breeze/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
breeze/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
breeze/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
breeze/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
breeze/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
breeze/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
breeze/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
breeze/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
breeze/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
breeze/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
breeze/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
breeze/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
breeze/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
breeze/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
breeze/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
breeze/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
breeze/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
breeze/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
breeze/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
breeze/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
breeze/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
breeze/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
breeze/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
breeze/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
breeze/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
breeze/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
breeze/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
breeze/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
breeze/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
breeze/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
breeze/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
breeze/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
breeze/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
celemin/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
celemin/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
celemin/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
celemin/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
celemin/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
celemin/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
celemin/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
celemin/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
celemin/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
celemin/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
celemin/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
celemin/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
celemin/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
celemin/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
celemin/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
celemin/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
celemin/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
celemin/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
celemin/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
celemin/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
celemin/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
celemin/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
celemin/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
celemin/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
celemin/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
celemin/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
celemin/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
celemin/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
celemin/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
celemin/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
celemin/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
celemin/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
celemin/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
celemin/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
celemin/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
celemin/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
celemin/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
celemin/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
celemin/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
celemin/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
celemin/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
celemin/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
coquilla/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
coquilla/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
coquilla/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
coquilla/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
coquilla/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
coquilla/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
coquilla/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
coquilla/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
coquilla/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
coquilla/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
coquilla/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
coquilla/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
coquilla/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
coquilla/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
coquilla/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
coquilla/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
coquilla/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
coquilla/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
coquilla/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
coquilla/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
coquilla/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
coquilla/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
coquilla/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
coquilla/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
coquilla/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
coquilla/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
coquilla/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
coquilla/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
coquilla/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
coquilla/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
coquilla/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
coquilla/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
coquilla/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
coquilla/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
coquilla/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
coquilla/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
coquilla/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
coquilla/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
coquilla/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
coquilla/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
coquilla/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
coquilla/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
filasse/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
filasse/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
filasse/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
filasse/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
filasse/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
filasse/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
filasse/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
filasse/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
filasse/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
filasse/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
filasse/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
filasse/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
filasse/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
filasse/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
filasse/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
filasse/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
filasse/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
filasse/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
filasse/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
filasse/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
filasse/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
filasse/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
filasse/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
filasse/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
filasse/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
filasse/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
filasse/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
filasse/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
filasse/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
filasse/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
filasse/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
filasse/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
filasse/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
filasse/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
filasse/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
filasse/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
filasse/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
filasse/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
filasse/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
filasse/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
filasse/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
filasse/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
gradable/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
gradable/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
gradable/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
gradable/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
gradable/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
gradable/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
gradable/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
gradable/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
gradable/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
gradable/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
gradable/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
gradable/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
gradable/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
gradable/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
gradable/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
gradable/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
gradable/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
gradable/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
gradable/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
gradable/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
gradable/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
gradable/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
gradable/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
gradable/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
gradable/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
gradable/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
gradable/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
gradable/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
gradable/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
gradable/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
gradable/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
gradable/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
gradable/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
gradable/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
gradable/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
gradable/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
gradable/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
gradable/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
gradable/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
gradable/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
gradable/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
gradable/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
harbinger/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
harbinger/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
harbinger/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
harbinger/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
harbinger/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
harbinger/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
harbinger/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
harbinger/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
harbinger/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
harbinger/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
harbinger/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
harbinger/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
harbinger/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
harbinger/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
harbinger/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
harbinger/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
harbinger/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
harbinger/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
harbinger/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
harbinger/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
harbinger/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
harbinger/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
harbinger/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
harbinger/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
harbinger/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
harbinger/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
harbinger/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
harbinger/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
harbinger/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
harbinger/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
harbinger/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
harbinger/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
harbinger/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
harbinger/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
harbinger/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
harbinger/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
harbinger/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
harbinger/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
harbinger/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
harbinger/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
harbinger/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
harbinger/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
kashima/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
kashima/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
kashima/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
kashima/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
kashima/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
kashima/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
kashima/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
kashima/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
kashima/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
kashima/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
kashima/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
kashima/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
kashima/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
kashima/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
kashima/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
kashima/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
kashima/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
kashima/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
kashima/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
kashima/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
kashima/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
kashima/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
kashima/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
kashima/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
kashima/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
kashima/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
kashima/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
kashima/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
kashima/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
kashima/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
kashima/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
kashima/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
kashima/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
kashima/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
kashima/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
kashima/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
kashima/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
kashima/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
kashima/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
kashima/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
kashima/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
kashima/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
knockdown/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
knockdown/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
knockdown/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
knockdown/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
knockdown/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
knockdown/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
knockdown/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
knockdown/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
knockdown/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
knockdown/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
knockdown/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
knockdown/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
knockdown/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
knockdown/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
knockdown/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
knockdown/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
knockdown/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
knockdown/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
knockdown/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
knockdown/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
knockdown/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
knockdown/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
knockdown/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
knockdown/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
knockdown/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
knockdown/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
knockdown/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
knockdown/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
knockdown/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
knockdown/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
knockdown/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
knockdown/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
knockdown/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
knockdown/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
knockdown/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
knockdown/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
knockdown/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
knockdown/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
knockdown/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
knockdown/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
knockdown/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
knockdown/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
manful/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
manful/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
manful/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
manful/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
manful/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
manful/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
manful/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
manful/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
manful/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
manful/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
manful/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
manful/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
manful/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
manful/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
manful/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
manful/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
manful/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
manful/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
manful/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
manful/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
manful/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
manful/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
manful/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
manful/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
manful/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
manful/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
manful/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
manful/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
manful/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
manful/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
manful/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
manful/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
manful/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
manful/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
manful/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
manful/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
manful/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
manful/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
manful/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
manful/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
manful/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
manful/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
maximal/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
maximal/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
maximal/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
maximal/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
maximal/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
maximal/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
maximal/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
maximal/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
maximal/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
maximal/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
maximal/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
maximal/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
maximal/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
maximal/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
maximal/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
maximal/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
maximal/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
maximal/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
maximal/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
maximal/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
maximal/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
maximal/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
maximal/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
maximal/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
maximal/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
maximal/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
maximal/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
maximal/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
maximal/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
maximal/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
maximal/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
maximal/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
maximal/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
maximal/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
maximal/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
maximal/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
maximal/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
maximal/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
maximal/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
maximal/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
maximal/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
maximal/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
periclase/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
periclase/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
periclase/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
periclase/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
periclase/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
periclase/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
periclase/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
periclase/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
periclase/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
periclase/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
periclase/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
periclase/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
periclase/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
periclase/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
periclase/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
periclase/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
periclase/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
periclase/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
periclase/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
periclase/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
periclase/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
periclase/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
periclase/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
periclase/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
periclase/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
periclase/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
periclase/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
periclase/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
periclase/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
periclase/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
periclase/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
periclase/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
periclase/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
periclase/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
periclase/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
periclase/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
periclase/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
periclase/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
periclase/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
periclase/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
periclase/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
periclase/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
poesis/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
poesis/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
poesis/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
poesis/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
poesis/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
poesis/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
poesis/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
poesis/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
poesis/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
poesis/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
poesis/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
poesis/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
poesis/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
poesis/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
poesis/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
poesis/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
poesis/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
poesis/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
poesis/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
poesis/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
poesis/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
poesis/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
poesis/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
poesis/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
poesis/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
poesis/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
poesis/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
poesis/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
poesis/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
poesis/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
poesis/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
poesis/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
poesis/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
poesis/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
poesis/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
poesis/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
poesis/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
poesis/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
poesis/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
poesis/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
poesis/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
poesis/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
proton/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
proton/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
proton/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
proton/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
proton/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
proton/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
proton/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
proton/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
proton/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
proton/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
proton/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
proton/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
proton/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
proton/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
proton/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
proton/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
proton/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
proton/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
proton/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
proton/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
proton/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
proton/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
proton/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
proton/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
proton/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
proton/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
proton/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
proton/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
proton/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
proton/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
proton/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
proton/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
proton/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
proton/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
proton/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
proton/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
proton/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
proton/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
proton/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
proton/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
proton/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
proton/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
recedence/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
recedence/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
recedence/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
recedence/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
recedence/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
recedence/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
recedence/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
recedence/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
recedence/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
recedence/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
recedence/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
recedence/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
recedence/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
recedence/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
recedence/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
recedence/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
recedence/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
recedence/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
recedence/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
recedence/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
recedence/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
recedence/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
recedence/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
recedence/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
recedence/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
recedence/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
recedence/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
recedence/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
recedence/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
recedence/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
recedence/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
recedence/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
recedence/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
recedence/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
recedence/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
recedence/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
recedence/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
recedence/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
recedence/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
recedence/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
recedence/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
recedence/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
scram/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
scram/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
scram/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
scram/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
scram/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
scram/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
scram/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
scram/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
scram/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
scram/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
scram/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
scram/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
scram/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
scram/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
scram/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
scram/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
scram/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
scram/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
scram/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
scram/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
scram/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
scram/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
scram/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
scram/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
scram/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
scram/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
scram/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
scram/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
scram/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
scram/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
scram/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
scram/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
scram/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
scram/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
scram/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
scram/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
scram/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
scram/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
scram/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
scram/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
scram/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
scram/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
server/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
server/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
server/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
server/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
server/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
server/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
server/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
server/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
server/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
server/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
server/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
server/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
server/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
server/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
server/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
server/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
server/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
server/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
server/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
server/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
server/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
server/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
server/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
server/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
server/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
server/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
server/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
server/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
server/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
server/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
server/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
server/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
server/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
server/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
server/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
server/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
server/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
server/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
server/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
server/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
server/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
server/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
shrubbish/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
shrubbish/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
shrubbish/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
shrubbish/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
shrubbish/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
shrubbish/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
shrubbish/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
shrubbish/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
shrubbish/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
shrubbish/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
shrubbish/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
shrubbish/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
shrubbish/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
shrubbish/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
shrubbish/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
shrubbish/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
shrubbish/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
shrubbish/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
shrubbish/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
shrubbish/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
shrubbish/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
shrubbish/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
shrubbish/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
shrubbish/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
shrubbish/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
shrubbish/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
shrubbish/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
shrubbish/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
shrubbish/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
shrubbish/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
shrubbish/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
shrubbish/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
shrubbish/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
shrubbish/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
shrubbish/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
shrubbish/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
shrubbish/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
shrubbish/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
shrubbish/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
shrubbish/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
shrubbish/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
shrubbish/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
sultam/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
sultam/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
sultam/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
sultam/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
sultam/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
sultam/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
sultam/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
sultam/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
sultam/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
sultam/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
sultam/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
sultam/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
sultam/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
sultam/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
sultam/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
sultam/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
sultam/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
sultam/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
sultam/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
sultam/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
sultam/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
sultam/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
sultam/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
sultam/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
sultam/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
sultam/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
sultam/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
sultam/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
sultam/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
sultam/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
sultam/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
sultam/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
sultam/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
sultam/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
sultam/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
sultam/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
sultam/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
sultam/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
sultam/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
sultam/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
sultam/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
sultam/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
virtuoso/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
virtuoso/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
virtuoso/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
virtuoso/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
virtuoso/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
virtuoso/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
virtuoso/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
virtuoso/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
virtuoso/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
virtuoso/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
virtuoso/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
virtuoso/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
virtuoso/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
virtuoso/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
virtuoso/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
virtuoso/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
virtuoso/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
virtuoso/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
virtuoso/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
virtuoso/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
virtuoso/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
virtuoso/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
virtuoso/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
virtuoso/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
virtuoso/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
virtuoso/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
virtuoso/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
virtuoso/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
virtuoso/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
virtuoso/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
virtuoso/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
virtuoso/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
virtuoso/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
virtuoso/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
virtuoso/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
virtuoso/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
virtuoso/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
virtuoso/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
virtuoso/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
virtuoso/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
virtuoso/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
virtuoso/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
wherrit/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
wherrit/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
wherrit/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
wherrit/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
wherrit/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
wherrit/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
wherrit/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
wherrit/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
wherrit/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
wherrit/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
wherrit/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
wherrit/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
wherrit/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
wherrit/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
wherrit/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
wherrit/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
wherrit/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
wherrit/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
wherrit/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
wherrit/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
wherrit/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
wherrit/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
wherrit/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
wherrit/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
wherrit/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
wherrit/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
wherrit/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
wherrit/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
wherrit/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
wherrit/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
wherrit/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
wherrit/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
wherrit/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
wherrit/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
wherrit/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
wherrit/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
wherrit/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
wherrit/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
wherrit/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
wherrit/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
wherrit/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
wherrit/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
winsome/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
winsome/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
winsome/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
winsome/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
winsome/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
winsome/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
winsome/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
winsome/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
winsome/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
winsome/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
winsome/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
winsome/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
winsome/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
winsome/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
winsome/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
winsome/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
winsome/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
winsome/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
winsome/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
winsome/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
winsome/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
winsome/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
winsome/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
winsome/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
winsome/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
winsome/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
winsome/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
winsome/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
winsome/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
winsome/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
winsome/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
winsome/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
winsome/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
winsome/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
winsome/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
winsome/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
winsome/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
winsome/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
winsome/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
winsome/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
winsome/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
winsome/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
wirelike/dark
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
wirelike/light
https://github.com/ProjectSkyfire/SkyFireEMU/tree/master/dep/acelite/ace/Typed_SV_Message_Queue.cpp
 1 // $Id: Typed_SV_Message_Queue.cpp 80826 2008-03-04 14:51:23Z wotte $
 2 
 3 #ifndef ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 4 #define ACE_TYPED_SV_MESSAGE_QUEUE_CPP
 5 
 6 #include "ace/Typed_SV_Message.h"
 7 
 8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
 9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 
12 #include "ace/Typed_SV_Message_Queue.h"
13 #include "ace/Log_Msg.h"
14 
15 #if !defined (__ACE_INLINE__)
16 #include "ace/Typed_SV_Message_Queue.inl"
17 #endif /* __ACE_INLINE__ */
18 
19 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
20 
21 ACE_ALLOC_HOOK_DEFINE(ACE_Typed_SV_Message_Queue)
22 
23 template <class T> void
24 ACE_Typed_SV_Message_Queue<T>::dump (voidconst
25 {
26 #if defined (ACE_HAS_DUMP)
27   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::dump");
28 #endif /* ACE_HAS_DUMP */
29 }
30 
31 template <class T>
32 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (void)
33 {
34   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
35 }
36 
37 template <class T>
38 ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue (key_t external_id,
39                                                            int create,
40                                                            int perms)
41 {
42   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::ACE_Typed_SV_Message_Queue");
43   if (this->open (external_id, create, perms) == -1)
44     ACE_ERROR ((LM_ERROR,
45                 "ACE_Typed_SV_Message_Queue::ACE_Typed_SV_Message_Queue"));
46 }
47 
48 template <class T>
49 ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue (void)
50 {
51   ACE_TRACE ("ACE_Typed_SV_Message_Queue<T>::~ACE_Typed_SV_Message_Queue");
52 }
53 
54 ACE_END_VERSIONED_NAMESPACE_DECL
55 
56 #endif /* ACE_TYPED_SV_MESSAGE_QUEUE_CPP */
wirelike/dark
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
wirelike/light
https://github.com/xbmc/xbmc/tree/master/lib/cximage-6.0/tiff/tif_error.c
 1 /* $Header: /cvsroot/osrs/libtiff/libtiff/tif_error.c,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $ */
 2 
 3 /*
 4  * Copyright (c) 1988-1997 Sam Leffler
 5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 6  *
 7  * Permission to use, copy, modify, distribute, and sell this software and 
 8  * its documentation for any purpose is hereby granted without fee, provided
 9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  * 
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
18  * 
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  */
30 #include "tiffiop.h"
31 
32 TIFFErrorHandler
33 TIFFSetErrorHandler(TIFFErrorHandler handler)
34 {
35     TIFFErrorHandler prev = _TIFFerrorHandler;
36     _TIFFerrorHandler = handler;
37     return (prev);
38 }
39 
40 void
41 TIFFError(const char* module, const char* fmt, ...)
42 {
43     if (_TIFFerrorHandler) {
44         va_list ap;
45         va_start(ap, fmt);
46         (*_TIFFerrorHandler)(module, fmt, ap);
47         va_end(ap);
48     }
49 }
wirelike/dark
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
wirelike/light
https://github.com/nhibernate/nhibernate-core/tree/master/src/NHibernate/Cfg/MappingSchema/AbstractDecoratable.cs
 1 using System;^M
 2 using System.Collections.Generic;^M
 3 using System.Xml.Serialization;^M
 4 using NHibernate.Mapping;^M
 5 using NHibernate.Util;^M
 6 ^M
 7 namespace NHibernate.Cfg.MappingSchema^M
 8 {^M
 9     [Serializable]^M
10     public abstract class AbstractDecoratable : IDecoratable^M
11     {^M
12         private static readonly IDictionary<string, MetaAttribute> EmptyMetaData = new CollectionHelper.EmptyMapClass<string, MetaAttribute>();^M
13 ^M
14         [NonSerialized]^M
15         [XmlIgnore]^M
16         private IDictionary<string, MetaAttribute> mappedMetaData;^M
17 ^M
18         [NonSerialized]^M
19         [XmlIgnore]^M
20         private IDictionary<string, MetaAttribute> inheritableMetaData;^M
21 ^M
22         [XmlIgnore]^M
23         public virtual IDictionary<string, MetaAttribute> MappedMetaData^M
24         {^M
25             get^M
26             {^M
27                 if (mappedMetaData == null)^M
28                 {^M
29                     CreateMappedMetadata(Metadatas);^M
30                 }^M
31                 return mappedMetaData;^M
32             }^M
33         }^M
34 ^M
35         [XmlIgnore]^M
36         public IDictionary<string, MetaAttribute> InheritableMetaData^M
37         {^M
38             get^M
39             {^M
40                 if (mappedMetaData == null)^M
41                 {^M
42                     CreateMappedMetadata(Metadatas);^M
43                 }^M
44                 return inheritableMetaData;^M
45             }^M
46         }^M
47 ^M
48         protected void CreateMappedMetadata(HbmMeta[] metadatas)^M
49         {^M
50             if (metadatas == null)^M
51             {^M
52                 mappedMetaData = EmptyMetaData;^M
53                 inheritableMetaData = EmptyMetaData;^M
54                 return;^M
55             }^M
56             mappedMetaData = new Dictionary<string, MetaAttribute>(10);^M
57             inheritableMetaData = new Dictionary<string, MetaAttribute>(10);^M
58 ^M
59             foreach (var hbmMeta in metadatas)^M
60             {^M
61                 MetaAttribute attribute;^M
62                 if (!mappedMetaData.TryGetValue(hbmMeta.attribute, out attribute))^M
63                 {^M
64                     attribute = new MetaAttribute(hbmMeta.attribute);^M
65                     mappedMetaData[hbmMeta.attribute] = attribute;^M
66                     if(hbmMeta.inherit)^M
67                     {^M
68                         inheritableMetaData[hbmMeta.attribute] = attribute;^M
69                     }^M
70                 }^M
71                 if (hbmMeta.Text != null)^M
72                 {^M
73                     attribute.AddValue(string.Concat(hbmMeta.Text));^M
74                 }^M
75             }^M
76         }^M
77 ^M
78         protected abstract HbmMeta[] Metadatas { get; }^M
79     }^M
80 }
wirelike/dark
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
wirelike/light
https://github.com/torvalds/linux/tree/master/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
 1 /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
 2  *
 3  * Copyright 2008 Openmoko, Inc.
 4  * Copyright 2008 Simtec Electronics
 5  *      http://armlinux.simtec.co.uk/
 6  *      Ben Dooks <ben@simtec.co.uk>
 7  *
 8  * S3C - USB2.0 Highspeed/OtG device PHY registers
 9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 */
14 
15 /* Note, this is a separate header file as some of the clock framework
16  * needs to touch this if the clk_48m is used as the USB OHCI or other
17  * peripheral source.
18 */
19 
20 #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21 #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22 
23 /* S3C64XX_PA_USB_HSPHY */
24 
25 #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26 
27 #define S3C_PHYPWR              S3C_HSOTG_PHYREG(0x00)
28 #define SRC_PHYPWR_OTG_DISABLE          (1 << 4)
29 #define SRC_PHYPWR_ANALOG_POWERDOWN     (1 << 3)
30 #define SRC_PHYPWR_FORCE_SUSPEND        (1 << 1)
31 
32 #define S3C_PHYCLK              S3C_HSOTG_PHYREG(0x04)
33 #define S3C_PHYCLK_MODE_USB11           (1 << 6)
34 #define S3C_PHYCLK_EXT_OSC          (1 << 5)
35 #define S3C_PHYCLK_CLK_FORCE            (1 << 4)
36 #define S3C_PHYCLK_ID_PULL          (1 << 2)
37 #define S3C_PHYCLK_CLKSEL_MASK          (0x3 << 0)
38 #define S3C_PHYCLK_CLKSEL_SHIFT         (0)
39 #define S3C_PHYCLK_CLKSEL_48M           (0x0 << 0)
40 #define S3C_PHYCLK_CLKSEL_12M           (0x2 << 0)
41 #define S3C_PHYCLK_CLKSEL_24M           (0x3 << 0)
42 
43 #define S3C_RSTCON              S3C_HSOTG_PHYREG(0x08)
44 #define S3C_RSTCON_PHYCLK           (1 << 2)
45 #define S3C_RSTCON_HCLK             (1 << 2)
46 #define S3C_RSTCON_PHY              (1 << 0)
47 
48 #define S3C_PHYTUNE             S3C_HSOTG_PHYREG(0x20)
49 
50 #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
wirelike/dark
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
wirelike/light
https://github.com/edicl/hunchentoot/tree/master/url-rewrite/packages.lisp
 1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
 2 ;;; $Header: /usr/local/cvsrep/url-rewrite/packages.lisp,v 1.9 2007/01/01 23:55:43 edi Exp $
 3 
 4 ;;; Copyright (c) 2004-2010, Dr. Edmund Weitz. All rights reserved.
 5 
 6 ;;; Redistribution and use in source and binary forms, with or without
 7 ;;; modification, are permitted provided that the following conditions
 8 ;;; are met:
 9 
10 ;;;   * Redistributions of source code must retain the above copyright
11 ;;;     notice, this list of conditions and the following disclaimer.
12 
13 ;;;   * Redistributions in binary form must reproduce the above
14 ;;;     copyright notice, this list of conditions and the following
15 ;;;     disclaimer in the documentation and/or other materials
16 ;;;     provided with the distribution.
17 
18 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
19 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 (in-package :cl-user)
31 
32 (defpackage "URL-REWRITE"
33   (:use :cl)
34   (:export "*URL-REWRITE-TAGS*"
35            "*URL-REWRITE-FILL-TAGS*"
36            "STARTS-WITH-SCHEME-P"
37            "ADD-GET-PARAM-TO-URL"
38            "REWRITE-URLS"
39            "URL-ENCODE"))
wirelike/dark
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
wirelike/light
https://github.com/bbatsov/emacs-dev-kit/tree/master/vendor/magit/contrib/magit-simple-keys.el
 1 ;;; magit-simple-keys.el --- simple keybindings for Magit
 2 
 3 ;; Copyright (C) 2011  Ramkumar Ramachandra
 4 ;;
 5 ;; Magit is free software; you can redistribute it and/or modify it
 6 ;; under the terms of the GNU General Public License as published by
 7 ;; the Free Software Foundation; either version 3, or (at your option)
 8 ;; any later version.
 9 ;;
10 ;; Magit is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
13 ;; License for more details.
14 ;;
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with Magit.  If not, see <http://www.gnu.org/licenses/>.
17 
18 ;;; Commentary:
19 
20 ;; This plug-in overrides the keybindings in magit-key-mode with
21 ;; simpler keybindings; it does this by picking the most obviously
22 ;; used command in each key group
23 
24 ;;; Code:
25 
26 (require 'magit)
27 
28 (defvar magit-key-mode-mapping
29   '((logging magit-display-log)
30     (running magit-shell-command)
31     (fetching magit-fetch-current)
32     (pushing magit-push)
33     (pulling magit-pull)
34     (branching magit-checkout)
35     (tagging magit-tag)
36     (stashing magit-stash)
37     (merging magit-merge)
38     (submodule magit-submodule-update)))
39 
40 (defun magit-key-mode-generate (term mapping-function)
41   "Generate alias for the key-group term"
42   (eval
43    `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
44     mapping-function)))
45 
46 ;; generate the aliases using the mapping in key-mode-mapping
47 (mapc (lambda (g)
48         (magit-key-mode-generate (car g) (cadr g)))
49       magit-key-mode-mapping)
50 
51 (provide 'magit-simple-keys)
52 ;;; magit-simple-keys.el ends here
wirelike/dark
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
wirelike/light
https://github.com/zotonic/zotonic/tree/master/modules/mod_admin/scomps/scomp_admin_dialog_link_add.erl
 1 %% @author Marc Worrell <marc@worrell.nl>
 2 %% @copyright 2009 Marc Worrell
 3 %% @doc Create a button for opening a dialog where the user can select an object for a new edge.
 4 
 5 %% Copyright 2009 Marc Worrell
 6 %%
 7 %% Licensed under the Apache License, Version 2.0 (the "License");
 8 %% you may not use this file except in compliance with the License.
 9 %% You may obtain a copy of the License at
10 %% 
11 %%     http://www.apache.org/licenses/LICENSE-2.0
12 %% 
13 %% Unless required by applicable law or agreed to in writing, software
14 %% distributed under the License is distributed on an "AS IS" BASIS,
15 %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 %% See the License for the specific language governing permissions and
17 %% limitations under the License.
18 
19 -module(scomp_admin_dialog_link_add).
20 -behaviour(gen_scomp).
21 
22 -export([vary/2render/3]).
23 
24 -include("zotonic.hrl").
25 
26 vary(_Params_Context-> nocache.
27 
28 render(Params_VarsContext->
29     Id        = z_ids:optid(proplists:get_value(idParams)),
30     SubjectId = z_convert:to_integer(proplists:get_value(subject_idParams)), 
31     Predicate = proplists:get_value(predicateParams), 
32     ElementId = proplists:get_value(element_idParams),
33     Anchor = z_tags:render_tag(
34                         <<"a">>,
35                         [
36                         {<<"id">>,    Id},
37                         {<<"href">>,  <<"javascript:void(0)">>},
38                         {<<"title">>"add a connection"},
39                         {<<"class">>"link-add"}
40                       ],
41                       "+ add a connection"),
42 
43     Html = [<<"<span class=\"add-connection\">">>Anchor<<"</span>">>],
44     Context1 = z_render:render(HtmlContext),
45     Context2 = z_render:wire(
46                 Id
47                 {event,[
48                         {typeclick}
49                         {action{dialog_link[{subject_idSubjectId}{predicatePredicate}{element_idElementId}]} }
50                 ]}Context1),
51     {okContext2}.
wirelike/dark
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
wirelike/light
https://github.com/erlang/otp/tree/master/lib/common_test/src/ct_util.hrl
 1 %%
 2 %% %CopyrightBegin%
 3 %%
 4 %% Copyright Ericsson AB 2003-2011. All Rights Reserved.
 5 %%
 6 %% The contents of this file are subject to the Erlang Public License,
 7 %% Version 1.1, (the "License"); you may not use this file except in
 8 %% compliance with the License. You should have received a copy of the
 9 %% Erlang Public License along with this software. If not, it can be
10 %% retrieved online at http://www.erlang.org/.
11 %%
12 %% Software distributed under the License is distributed on an "AS IS"
13 %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 %% the License for the specific language governing rights and limitations
15 %% under the License.
16 %%
17 %% %CopyrightEnd%
18 %%
19 
20 -define(attr_table,ct_attributes).
21 -define(conn_table,ct_connections).
22 -define(board_table,ct_boards).
23 -define(suite_table,ct_suite_data).
24 
25 -record(conn{handle,
26          targetref,
27          address,
28          callback}).
29 
30 -record(testspec{spec_dir,
31              nodes=[],
32        init=[],
33        label=[],
34        logdir=["."],
35        cover=[],
36        config=[],
37        userconfig=[],
38        event_handler=[],
39        ct_hooks=[],
40        include=[],
41        multiply_timetraps=[],
42        scale_timetraps=[],
43        alias=[],
44        tests=[],
45        merge_tests = true }).
46 
47 -record(cover{app=none,
48     level=details,
49     excl_mods=[],
50     incl_mods=[],
51     cross=[],
52     src=[]}).
53 
54 -define(CT_EVMGRct_event).
55 -define(CT_EVMGR_REFct_event).
56 -define(CT_MEVMGRct_master_event).
57 -define(CT_MEVMGR_REFct_master_event).
58 
59 -define(missing_suites_info"missing_suites.info").
60 -define(ct_config_txtct_config_plain).
wirelike/dark
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
wirelike/light
https://github.com/yi-editor/yi/tree/master/yi/src/library/Yi/UI/Vte.hs
 1 module Yi.UI.Vte (start) where
 2 
 3 import Prelude ()
 4 import Yi.Prelude
 5 
 6 import Graphics.UI.Gtk
 7 import Graphics.UI.Gtk.Vte.Vte
 8 import System.Environment
 9 import System.Environment.Executable
10 import System.Glib
11 
12 import Yi.Config
13 import Yi.Style
14 import qualified Yi.UI.Common as Common
15 
16 start :: UIBoot
17 start cfg ch outCh editor =
18     catchGError (initUI cfg ch outCh editor) (\(GError _dom _code msg) -> fail msg)
19 
20 initUI :: UIBoot
21 initUI cfg _ch _outCh _editor = do
22     discard unsafeInitGUIForThreadedRTS
23     setApplicationName "Yi"
24 
25     -- Setup window
26     win <- windowNew
27     discard $ win `onDestroy` mainQuit
28 
29     -- Setup vte
30     exe  <- getExecutablePath
31     term <- terminalNew
32     discard $ Graphics.UI.Gtk.on term childExited $ end False
33 
34     -- Set default colors
35     terminalSetColors term
36         (getBaseAttrColor foreground black cfg)
37         (getBaseAttrColor background brightwhite cfg)
38         (Color 0 0 0)
39         0
40 
41     -- Start running Yi
42     args <- getArgs
43     discard $ terminalForkCommand term
44         (Just exe) (Just $ exe : args ++ ["-fvty"]) Nothing Nothing False False False
45 
46     discard $ set win [ containerChild := term ]
47     widgetShowAll win
48 
49     return $ Common.dummyUI
50       { Common.main = main
51       , Common.end  = end
52       }
53 
54 main :: IO ()
55 main = mainGUI
56 
57 end :: Bool -> IO ()
58 end = const mainQuit
59 
60 getBaseAttrColor :: (Attributes -> Yi.Style.Color) -> Yi.Style.Color
61                  -> Config -> Graphics.UI.Gtk.Color
62 getBaseAttrColor p d cfg = mkCol $
63     case p $ baseAttributes $ configStyle $ configUI cfg of
64       Default -> d
65       c -> c
66 
67 mkCol :: Yi.Style.Color -> Graphics.UI.Gtk.Color
68 mkCol Default     = Color 0 0 0
69 mkCol (RGB x y z) = Color (fromIntegral x * 256)
70                           (fromIntegral y * 256)
71                           (fromIntegral z * 256)
wirelike/dark
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
wirelike/light
https://github.com/powerbot/RSBot/tree/master/src/org/rsbot/event/impl/DrawWeb.java
 1 package org.rsbot.event.impl;
 2 
 3 import org.rsbot.bot.Bot;
 4 import org.rsbot.event.listeners.PaintListener;
 5 import org.rsbot.script.methods.MethodContext;
 6 import org.rsbot.script.methods.Web;
 7 import org.rsbot.script.wrappers.RSPlayer;
 8 import org.rsbot.script.wrappers.RSTile;
 9 
10 import java.awt.*;
11 import java.util.Iterator;
12 import java.util.Map;
13 
14 /**
15  * Draws the web.
16  *
17  * @author Timer
18  */
19 public class DrawWeb implements PaintListener {
20   private final MethodContext ctx;
21 
22   /**
23    * Calculates a point to the minimap.
24    *
25    * @param tile     The tile to calculate.
26    * @param baseTile Your baseTile.
27    * @return The point of the tile.
28    */
29   private Point tileToMap(final RSTile tile, final RSTile baseTile) {
30     final double minimapAngle = -1 * Math.toRadians(ctx.camera.getAngle());
31     final int x = (tile.getX() - baseTile.getX()) * 4 - 2;
32     final int y = (baseTile.getY() - tile.getY()) * 4 - 2;
33     return new Point((int) Math.round(x * Math.cos(minimapAngle) + y * Math.sin(minimapAngle) + 628), (int) Math.round(y * Math.cos(minimapAngle) - x * Math.sin(minimapAngle) + 87));
34   }
35 
36   public DrawWeb(final Bot bot) {
37     ctx = bot.getMethodContext();
38   }
39 
40   public void onRepaint(final Graphics render) {
41     if (!ctx.game.isLoggedIn()) {
42       return;
43     }
44     final RSPlayer player = ctx.players.getMyPlayer();
45     if (player == null) {
46       return;
47     }
48     final RSTile oT = player.getLocation();
49     final int plane = ctx.game.getPlane();
50     final Iterator<Map.Entry<RSTile, Integer>> rs = Web.rs_map.entrySet().iterator();
51     while (rs.hasNext()) {
52       final Map.Entry<RSTile, Integer> e = rs.next();
53       final RSTile tile = e.getKey();
54       final int key = e.getValue();
55       if (tile.getZ() == plane && ctx.calc.distanceBetween(tile, oT) < 105) {
56         render.setColor(RSTile.Questionable(key) ? Color.yellow : RSTile.Special(key) ? Color.cyan : Color.red);
57         final Point p = tileToMap(tile, oT);
58         render.drawLine(p.x, p.y, p.x, p.y);
59       }
60     }
61   }
62 }
wirelike/dark
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
wirelike/light
https://github.com/joyent/node/tree/master/test/simple/test-event-emitter-once.js
 1 // Copyright Joyent, Inc. and other Node contributors.
 2 //
 3 // Permission is hereby granted, free of charge, to any person obtaining a
 4 // copy of this software and associated documentation files (the
 5 // "Software"), to deal in the Software without restriction, including
 6 // without limitation the rights to use, copy, modify, merge, publish,
 7 // distribute, sublicense, and/or sell copies of the Software, and to permit
 8 // persons to whom the Software is furnished to do so, subject to the
 9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 var common = require('../common');
23 var assert = require('assert');
24 var events = require('events');
25 
26 var e = new events.EventEmitter();
27 var times_hello_emited = 0;
28 
29 e.once('hello'function(a, b) {
30   times_hello_emited++;
31 });
32 
33 e.emit('hello''a''b');
34 e.emit('hello''a''b');
35 e.emit('hello''a''b');
36 e.emit('hello''a''b');
37 
38 var remove = function() {
39   assert.fail(1,0, 'once->foo should not be emitted''!');
40 };
41 
42 e.once('foo', remove);
43 e.removeListener('foo', remove);
44 e.emit('foo');
45 
46 process.addListener('exit'function() {
47   assert.equal(1, times_hello_emited);
48 });
49 
wirelike/dark
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
wirelike/light
https://github.com/tukz/Tukui/tree/master/Tukui/modules/datatext/power.lua
 1 local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2 
 3 --------------------------------------------------------------------
 4 -- player power (attackpower or power depending on what you have more of)
 5 --------------------------------------------------------------------
 6 
 7 if C["datatext"].power and C["datatext"].power > 0 then
 8   local Stat = CreateFrame("Frame")
 9   Stat:SetFrameStrata("BACKGROUND")
10   Stat:SetFrameLevel(3)
11 
12   local Text  = TukuiInfoLeft:CreateFontString(nil"OVERLAY")
13   Text:SetFont(C.media.font, C["datatext"].fontsize)
14   T.PP(C["datatext"].power, Text)
15 
16   local int = 1
17 
18   local function Update(self, t)
19     int = int - t
20     local base, posBuff, negBuff = UnitAttackPower("player")
21     local effective = base + posBuff + negBuff
22     local Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
23     local Reffective = Rbase + RposBuff + RnegBuff
24 
25 
26     healpwr = GetSpellBonusHealing()
27 
28     Rattackpwr = Reffective
29     spellpwr2 = GetSpellBonusDamage(7)
30     attackpwr = effective
31 
32     if healpwr > spellpwr2 then
33       spellpwr = healpwr
34     else
35       spellpwr = spellpwr2
36     end
37 
38     if attackpwr > spellpwr and select(2, UnitClass("Player")) ~= "HUNTER" then
39       pwr = attackpwr
40       tp_pwr = L.datatext_playerap
41     elseif select(2, UnitClass("Player")) == "HUNTER" then
42       pwr = Reffective
43       tp_pwr = L.datatext_playerap
44     else
45       pwr = spellpwr
46       tp_pwr = L.datatext_playersp
47     end
48     if int < 0 then
49       Text:SetText(pwr.." ".. tp_pwr)      
50       int = 1
51     end
52   end
53 
54   Stat:SetScript("OnUpdate", Update)
55   Update(Stat, 10)
56 end
wirelike/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
wirelike/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Sources/TTNavigatorWindow.m
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/private/TTNavigatorWindow.h"
18 
19 // UI
20 #import "Three20UI/TTNavigator.h"
21 
22 // Core
23 #import "Three20Core/TTDebug.h"
24 
25 
26 ///////////////////////////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////////////////////////////
29 @implementation TTNavigatorWindow
30 
31 
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
34   if (UIEventSubtypeMotionShake == motion
35       && [TTNavigator navigator].supportsShakeToReload) {
36     // If you're going to use a custom navigator implementation, you need to ensure that you
37     // implement the reload method. If you're inheriting from TTNavigator, then you're fine.
38     TTDASSERT([[TTNavigator navigator] respondsToSelector:@selector(reload)]);
39     [(TTNavigator*)[TTNavigator navigator] reload];
40   }
41 }
42 
43 
44 @end
wirelike/dark
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
wirelike/light
https://github.com/facebook/three20/tree/master/src/Three20UI/Headers/TTExtensionsController.h
 1 //
 2 // Copyright 2009-2011 Facebook
 3 //
 4 // Licensed under the Apache License, Version 2.0 (the "License");
 5 // you may not use this file except in compliance with the License.
 6 // You may obtain a copy of the License at
 7 //
 8 //    http://www.apache.org/licenses/LICENSE-2.0
 9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #import "Three20UI/TTTableViewController.h"
18 
19 @class TTNavigator;
20 
21 /**
22  * A list of all available, loaded, and failed extensions. This controller is used in
23  * conjunction with the TTExtensionLoader. It is intended to provide helpful information
24  * about the extensions linked in the application. It can also be used as a means of
25  * crediting the extensions whose licenses require it.
26  *
27  * @see TTExtensionLoader
28  */
29 @interface TTExtensionsController : TTTableViewController {
30 
31 }
32 
33 /**
34  * Registers two URLs with the given navigator (e.g. with a prefix of @"tt://")
35  *
36  * * @"tt://extensions"                         -> [TTExtensionsController class]
37  * * @"tt://extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
38  *
39  * You can use any prefix (e.g. @"myApp://three20/")
40  *
41  * * @"myApp://three20/extensions"                         -> [TTExtensionsController class]
42  * * @"myApp://three20/extensions/(initWithExtensionID:)"  -> [TTExtensionInfoController class]
43  */
44 (void)registerUrlPathsWithNavigator:(TTNavigator*)navigator prefix:(NSString*)prefix;
45 
46 @end
wirelike/dark
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
wirelike/light
https://github.com/mirrors/perl/tree/master/cpan/Unicode-Collate/Collate/Locale/cs.pl
 1 +{
 2    entry => <<'ENTRY', # for DUCET v6.0.0
 3 010D      ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 4 0063 030C ; [.15D2.0020.0002.010D] # LATIN SMALL LETTER C WITH CARON
 5 010C      ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 6 0043 030C ; [.15D2.0020.0008.010C] # LATIN CAPITAL LETTER C WITH CARON
 7 0063 0068 ; [.1668.0020.0002.0063] # <LATIN SMALL LETTER C, LATIN SMALL LETTER H>
 8 0063 0048 ; [.1668.0020.0007.0063][.0000.0000.0002.0000] # <LATIN SMALL LETTER C, LATIN CAPITAL LETTER H>
 9 0043 0068 ; [.1668.0020.0007.0043][.0000.0000.0008.0000] # <LATIN CAPITAL LETTER C, LATIN SMALL LETTER H>
10 0043 0048 ; [.1668.0020.0008.0043] # <LATIN CAPITAL LETTER C, LATIN CAPITAL LETTER H>
11 0159      ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
12 0072 030C ; [.1771.0020.0002.0159] # LATIN SMALL LETTER R WITH CARON
13 0158      ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
14 0052 030C ; [.1771.0020.0008.0158] # LATIN CAPITAL LETTER R WITH CARON
15 0161      ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
16 0073 030C ; [.17A7.0020.0002.0161] # LATIN SMALL LETTER S WITH CARON
17 0160      ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
18 0053 030C ; [.17A7.0020.0008.0160] # LATIN CAPITAL LETTER S WITH CARON
19 017E      ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
20 007A 030C ; [.1845.0020.0002.017E] # LATIN SMALL LETTER Z WITH CARON
21 017D      ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
22 005A 030C ; [.1845.0020.0008.017D] # LATIN CAPITAL LETTER Z WITH CARON
23 ENTRY
24 };
wirelike/dark
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
wirelike/light
https://github.com/zendframework/zf2/tree/master/library/Zend/GData/Books/Extension/BooksCategory.php
 1 <?php
 2 /**
 3  * Zend Framework
 4  *
 5  * LICENSE
 6  *
 7  * This source file is subject to the new BSD license that is bundled
 8  * with this package in the file LICENSE.txt.
 9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Gdata
17  * @subpackage Books
18  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
20  */
21 
22 /**
23  * @namespace
24  */
25 namespace Zend\GData\Books\Extension;
26 
27 /**
28  * Describes a books category
29  *
30  * @uses       \Zend\GData\App\Extension\Category
31  * @uses       \Zend\GData\Books
32  * @category   Zend
33  * @package    Zend_Gdata
34  * @subpackage Books
35  * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
36  * @license    http://framework.zend.com/license/new-bsd    ; New BSD License
37  */
38 class BooksCategory extends
39     \Zend\GData\App\Extension\Category
40 {
41 
42     /**
43      * Constructor for Zend_Gdata_Books_Extension_BooksCategory which
44      * Describes a books category
45      *
46      * @param string|null $term An identifier representing the category within
47      *        the categorization scheme.
48      * @param string|null $scheme A string containing a URI identifying the
49      *        categorization scheme.
50      * @param string|null $label A human-readable label for display in
51      *        end-user applications.
52      */
53     public function __construct($term = null$scheme = null$label = null)
54     {
55         $this->registerAllNamespaces(\Zend\GData\Books::$namespaces);
56         parent::__construct($term$scheme$label);
57     }
58 
59 }
wirelike/dark
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
wirelike/light
https://github.com/django/django/tree/master/django/contrib/staticfiles/utils.py
 1 import os
 2 import fnmatch
 3 from django.conf import settings
 4 from django.core.exceptions import ImproperlyConfigured
 5 
 6 def matches_patterns(path, patterns=None):
 7     """
 8     Return True or False depending on whether the ``path`` should be
 9     ignored (if it matches any pattern in ``ignore_patterns``).
10     """
11     if patterns is None:
12         patterns = []
13     for pattern in patterns:
14         if fnmatch.fnmatchcase(path, pattern):
15             return True
16     return False
17 
18 def get_files(storage, ignore_patterns=None, location=''):
19     """
20     Recursively walk the storage directories yielding the paths
21     of all files that should be copied.
22     """
23     if ignore_patterns is None:
24         ignore_patterns = []
25     directories, files = storage.listdir(location)
26     for fn in files:
27         if matches_patterns(fn, ignore_patterns):
28             continue
29         if location:
30             fn = os.path.join(location, fn)
31         yield fn
32     for dir in directories:
33         if matches_patterns(dir, ignore_patterns):
34             continue
35         if location:
36             dir = os.path.join(location, dir)
37         for fn in get_files(storage, ignore_patterns, dir):
38             yield fn
39 
40 def check_settings(base_url=None):
41     """
42     Checks if the staticfiles settings have sane values.
43 
44     """
45     if base_url is None:
46         base_url = settings.STATIC_URL
47     if not base_url:
48         raise ImproperlyConfigured(
49             "You're using the staticfiles app "
50             "without having set the required STATIC_URL setting.")
51     if settings.MEDIA_URL == base_url:
52         raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
53                                    "settings must have different values")
54     if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
55             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
56         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
57                                    "settings must have different values")
wirelike/dark
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
wirelike/light
https://github.com/mxcl/homebrew/tree/master/Library/Formula/clozure-cl.rb
 1 require 'formula'
 2 require 'find'
 3 
 4 class ClozureCl < Formula
 5   url 'ftp://ftp.clozure.com/pub/release/1.6/ccl-1.6-darwinx86.tar.gz'
 6   version '1.6'
 7   homepage 'http://ccl.clozure.com/'
 8   md5 '290100fdb8dab3b9967ce8b688113199'
 9 
10   def install
11     # Get rid of all the .svn dirs, that for some reason are
12     # included in the tarball
13     Find.find(Dir.pwd) do |path|
14       if File.directory?(path) && File.basename(path) == '.svn'
15         rm_rf path
16         Find.prune
17       end
18     end
19 
20     # Due to the way ClozureCL is organized, we'll put everything into
21     # a subdirectory, and then link all the necessary scripts to the
22     # locations Homebrew expects
23     ccl_install_dir = prefix + 'ccl'
24 
25     # These scripts allow the user to execute some code or get a REPL
26     ccl_scripts = Dir['./scripts/ccl{,64}']
27 
28     # ClozureCL uses the CCL_DEFAULT_DIRECTORY to find its sources. Update
29     # it so it points to the right directory (since the ccl scripts themselves
30     # won't be in the usual location)
31     ccl_scripts.map { |pathPathname.new(File.expand_path(path)) }.each do |script|
32       inreplace script do |s|
33         s.gsub! /CCL_DEFAULT_DIRECTORY=.+$/%Q{CCL_DEFAULT_DIRECTORY="#{ccl_install_dir}"}
34       end
35     end
36 
37     # Copy everything over to the cellar
38     ccl_install_dir.install Dir['*']
39 
40     # Link the wrapper scripts to prefix/bin, where Homebrew can link them properly
41     bin.mkdir
42     ccl_scripts.each do |script|
43       ln ccl_install_dir+script, bin+File.basename(script)
44     end
45   end
46 
47   def caveats
48     <<-CAVEATS
49     Run `ccl` to run a 32-bit session, and `ccl64` for a 64-bit one.
50 
51     To test if everything works correctly, run `brew test #{name}`.
52     CAVEATS
53   end
54 
55   # Generates a string to test the ccl scripts that can be passed directly to `system'
56   def test_ccl(bit = 32)
57     ccl = bin + "ccl#{'64' if bit == 64}"
58     %Q{#{ccl} -e '(progn (format t "Hello world from #{bit}-bit ClozureCL") (ccl::quit))'}
59   end
60 
61   def test
62     system test_ccl
63     system test_ccl(64)
64   end
65 end
wirelike/dark
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
wirelike/light
https://github.com/jboner/akka/tree/master/akka-stm/src/main/scala/akka/stm/package.scala
 1 /**
 2  * Copyright (C) 2009-2011 Typesafe Inc. <http://www.typesafe.com>
 3  */
 4 
 5 package akka
 6 
 7 /**
 8  * For easily importing everything needed for STM.
 9  */
10 package object stm extends akka.stm.Stm with akka.stm.StmUtil {
11 
12   // Shorter aliases for transactional map and vector
13 
14   type TMap[K, V] = akka.stm.TransactionalMap[K, V]
15   val TMap = akka.stm.TransactionalMap
16 
17   type TVector[T] = akka.stm.TransactionalVector[T]
18   val TVector = akka.stm.TransactionalVector
19 
20   // Multiverse primitive refs
21 
22   type BooleanRef = org.multiverse.transactional.refs.BooleanRef
23   type ByteRef = org.multiverse.transactional.refs.ByteRef
24   type CharRef = org.multiverse.transactional.refs.CharRef
25   type DoubleRef = org.multiverse.transactional.refs.DoubleRef
26   type FloatRef = org.multiverse.transactional.refs.FloatRef
27   type IntRef = org.multiverse.transactional.refs.IntRef
28   type LongRef = org.multiverse.transactional.refs.LongRef
29   type ShortRef = org.multiverse.transactional.refs.ShortRef
30 
31   // Multiverse transactional datastructures
32 
33   type TransactionalReferenceArray[T] = org.multiverse.transactional.arrays.TransactionalReferenceArray[T]
34   type TransactionalThreadPoolExecutor = org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
35 
36   // These won't compile:
37   // Transaction arg is added after varargs with byte code rewriting but Scala compiler doesn't allow this
38 
39   // type TransactionalArrayList[T] = org.multiverse.transactional.collections.TransactionalArrayList[T]
40   // type TransactionalLinkedList[T] = org.multiverse.transactional.collections.TransactionalLinkedList[T]
41 }
wirelike/dark
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
wirelike/light
https://github.com/jimweirich/sicp-study/tree/master/scheme/chapter2/ex2_3b.scm
 1 ;; SICP 2.3
 2 
 3 ;; Exercise 2.3.  Implement a representation for rectangles in a
 4 ;; plane. (Hint: You may want to make use of exercise 2.2.) In terms
 5 ;; of your constructors and selectors, create procedures that compute
 6 ;; the perimeter and the area of a given rectangle. Now implement a
 7 ;; different representation for rectangles. Can you design your system
 8 ;; with suitable abstraction barriers, so that the same perimeter and
 9 ;; area procedures will work using either representation?
10 
11 ;; ANSWER ------------------------------------------------------------
12 
13 (define (make-point x y)
14   (cons x y))
15 (define (x-point point)
16   (car point))
17 (define (y-point point)
18   (cdr point))
19 (define (print-point p)
20   (newline)
21   (display "(")
22   (display (x-point p))
23   (display ",")
24   (display (y-point p))
25   (display ")"))
26 
27 ;; Version B: Storing top bottom left right
28 
29 (define (make-rect origin width height)
30   (list (+ (y-point origin) height)
31         (y-point origin)
32         (x-point origin)
33         (+ (x-point origin) width)))
34 (define (top-rect rect) (car rect))
35 (define (bottom-rect rect) (cadr rect))
36 (define (left-rect rect) (caddr rect))
37 (define (right-rect rect) (cadddr rect))
38 
39 ;; Implementation independent functions
40 
41 (define (origin-rect rect)
42   (make-point (left-rect rect) (bottom-rect rect)))
43 (define (width-rect rect)
44   (- (right-rect rect) (left-rect rect)))
45 (define (height-rect rect)
46   (- (top-rect rect) (bottom-rect rect)))
47 
48 (define (perimeter-rect rect)
49   (+ (* 2 (width-rect rect))
50      (* 2 (height-rect rect))))
51 
52 (define (area-rect rect)
53   (* (width-rect rect)
54      (height-rect rect)))
wirelike/dark
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M
wirelike/light
https://github.com/higepon/mosh/tree/master/boot/runtimes/srfi-mosh/lib.rnrs/rnrs/r5rs.ss
 1 (library (rnrs r5rs (6))^M
 2   ^M
 3   (export null-environment scheme-report-environment delay force^M
 4           exact->inexact inexact->exact quotient remainder modulo)^M
 5   ^M
 6   (import (primitives exact->inexact inexact->exact quotient remainder modulo)^M
 7           (rnrs eval)^M
 8           (rnrs base)^M
 9           (rnrs control))^M
10   ^M
11   (define (scheme-report-environment n)^M
12     (unless (= n 5)^M
13       (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
14     (environment '(r5rs)))^M
15   ^M
16   (define null-environment^M
17     (let ((null-env^M
18            (environment '(only (rnrs base)^M
19                            begin if lambda quote set! and or^M
20                            define define-syntax let-syntax letrec-syntax ^M
21                            let let* letrec^M
22                            case cond else =>^M
23                            quasiquote unquote unquote-splicing^M
24                            syntax-rules ...)^M
25                         '(only (rnrs control) do))))^M
26       (lambda (n)^M
27         (unless (= n 5)^M
28           (assertion-violation 'scheme-report-environment "Argument should be 5" n))^M
29         null-env)))^M
30   ^M
31   (define force^M
32     (lambda (object)^M
33       (object)))^M
34   ^M
35   (define-syntax delay^M
36     (syntax-rules ()^M
37       ((delay expression)^M
38        (make-promise (lambda () expression)))))^M
39   ^M
40   (define make-promise^M
41     (lambda (proc)^M
42       (let ((result-ready? #f)^M
43             (result #f))^M
44         (lambda ()^M
45           (if result-ready?^M
46               result^M
47               (let (((proc)))^M
48                 (if result-ready?^M
49                     result^M
50                     (begin (set! result-ready? #t)^M
51                            (set! result x)^M
52                            result))))))))^M
53   ) ; rnrs r5rs^M