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
""" | |
In [1]: from fastecdsa.curve import P256 | |
In [2]: k = 0xdecafbad | |
In [3]: Q = k * P256.G | |
In [4]: Q | |
Out[4]: | |
X: 0x602d9279f2f00327f397a670f5fa85dc46b761ddd7f1615ab1d1be187c8ce9da |
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 Node: | |
def __init__(self, data, prev, next): | |
self.data = data | |
self.prev = prev | |
self.next = next | |
class DoubleLinkedList: | |
def __init__(self): | |
self.head = None |
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 Node: | |
def __init__(self, key, data): | |
self.next = None | |
self.prev = None | |
self.key = key | |
self.data = data | |
class LinkedList: | |
def __init__(self): |
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 <stdlib.h> | |
#include <vector> | |
class Bad { | |
public: | |
~Bad(){ throw 0; } | |
}; | |
int main() { | |
Bad b1, b2; |
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
// timeKeeper.h | |
class TimeKeeper { | |
public: | |
TimeKeeper(); | |
~TimeKeeper(); // note the virtual keyword is missing | |
}; | |
// wristWatch.h | |
class WristWatch : public TimeKeeper { | |
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
// house.h | |
class House { | |
//copying a house doesn't make much sense so disallow use of copy functions | |
private: | |
House(const House&); // copy constructor | |
House& operator=(const House&); // copy assignment | |
}; | |
// main.cpp | |
int main(int argc, char * argv[]) { |
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
// empty.h | |
class Empty { | |
// this class declares no members but still will implicitly have the | |
// below declared by the compiler (in the public scope) | |
/* | |
Empty(){...} // default constructor | |
Empty(const Empty& rhs){...} // copy constructor | |
~Empty(){...} // default destructor | |
Empty& operator=(const Empty& rhs){...} // copy assignment operator |
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 Board: | |
WIDTH = 9 | |
HEIGHT = 9 | |
def __init__(self): | |
self.squares = [ | |
[5, 3, None, None, 7, None, None, None, None], | |
[6, None, None, 1, 9, 5, None, None, None], | |
[None, 9, 8, None, None, None, None, 6, None], | |
[8, None, None, None, 6, None, None, None, 3], |
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
from random import choice | |
BOARD_SIZE = 5 | |
class Node: | |
def __init__(self): | |
self.value = 0 | |
self.children = {} |
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
from time import sleep | |
class Cell: | |
ALIVE = True | |
DEAD = False | |
def __init__(self, status): | |
self.status = status |
NewerOlder