This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IPoint SetDistance (IPoint point, double newDistance) { | |
return Dispatcher.Instance.CreatePoint (point.X, point.Y, point.Z, (float)newDistance, point.Heading); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Model is interface; | |
type Model_Reference is access all Model'Class; | |
type Container is tagged record | |
Contents : Model_Reference; | |
end record; | |
procedure Set_Model (Object : in out Container; Value : Model'Class) is | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename TValue, typename TPred> | |
BinarySearchTree<TValue, TPred>::BinarySearchTree() { | |
//... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rec_permutations(prefix, remaining): | |
if len(remaining) == 1: | |
yield prefix + remaining | |
else: | |
for e in remaining: | |
new_remaining = remaining[:] # copy | |
new_remaining.remove(e) | |
for p in rec_permutations(prefix + [e], new_remaining): | |
yield p | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
struct A { | |
void put() { | |
cout << "A" << endl; | |
} | |
virtual void vPut() { | |
cout << "A" << endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- compilation unit 1: | |
generic | |
type T is private; | |
package Unit is | |
-- ... | |
end Unit; | |
-- compilation unit 2: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Ada.Containers.Vectors; | |
with Ada.Containers.Hashed_Maps; | |
generic | |
type Key_Type is private; | |
with package Element_Vectors is new Ada.Containers.Vectors (<>); | |
with function Hash (Key : Key_Type) return Ada.Containers.Hash_Type; | |
with function Equivalent_Keys (Left, Right : Key_Type) return Boolean; | |
package Multimaps is | |
package Parent is new Ada.Containers.Hashed_Maps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
passdb passwd-file { | |
args = /home/vmail/%d/passwd | |
} | |
passdb pam { | |
args = session=yes dovecot | |
} | |
userdb static { | |
args = uid=vmail gid=dovecot home=/home/vmail/%d/%u |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$debDir = "/some/path" | |
define localPackage ($packageName = $title) { | |
package {$packageName : | |
ensure => installed, | |
provider => dpkg, | |
source => "${debDir}/${packageName}.deb" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo { | |
std::move_iterator move_it; | |
int I; | |
public: | |
Foo(const int like_to, const std::move_iterator& move_it) : | |
I(like_to), move_it(move_it) {} | |
}; |