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
// Created on Thu Sep 25 00:23:24 2014 | |
// @author: Danilo de Jesus da Silva Bellini | |
// Inline and function pointer example (C++ but that's almost C) | |
// | |
// g++ inline_or_funcptr.cpp | |
// | |
#include <iostream> | |
using namespace std; | |
typedef int (*IntOpPtr)(int, int); |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Sep 11 20:48:25 2012 | |
T9 Message to cell phone numbers to be pressed | |
Problem description: | |
http://dojopuzzles.com/problemas/exibe/escrevendo-no-celular/ |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Sep 19 05:54:37 2012 | |
Eruption explosive doomsday calculation. | |
Copyright (C) 2012 Danilo de Jesus da Silva Bellini | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by |
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
#!/usr/bin/env python | |
import sys | |
from PyQt4 import QtGui, QtCore | |
app = QtGui.QApplication(sys.argv) | |
# Main window, sizers and widgets | |
win = QtGui.QMainWindow() | |
wd = QtGui.QWidget() | |
vb = QtGui.QVBoxLayout() |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Created on Sat Oct 13 by Danilo de Jesus da Silva Bellini | |
# | |
# This code raises: | |
# TypeError: Can't instantiate abstract class A with abstract methods blablah | |
# However, it does not when class A inherits from "type" or "ABCMeta". | |
from abc import ABCMeta, abstractproperty | |
class A(object): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Nov 14 01:39:53 2012 | |
@author: Danilo J. S. Bellini | |
""" | |
from warnings import warn, catch_warnings | |
import pytest |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Jan 16 01:17:27 2013 | |
Copyright (C) 2012 Danilo de Jesus da Silva Bellini | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. |
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
# -*- coding: utf-8 -*- | |
# Gram-Schmidt orthonormalization with itertools. | |
# Copyright (C) 2012 Danilo de Jesus da Silva Bellini | |
# | |
# This is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, version 3 of the License. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Mar 27 23:36:30 2013 | |
Descriptor use case example | |
@author: Danilo J. S. Bellini | |
""" | |
class Quantity(object): |
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
#!/usr/bin/env py.test | |
# -*- coding: utf-8 -*- | |
# Mastermind guess description | |
# Created on Thu Mar 14 2013 | |
# Danilo de Jesus da Silva Bellini | |
def mastermind(guess, secret): | |
""" |
OlderNewer