Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
#! /usr/bin/python
# Leet-Timer
# Tested with Ubuntu 8.04
# import used libraries or commands
from time import tzset
import os
from time import strftime
import time
## ## ## ##
os.environ['TZ'] = 'LEET+13:37LEETDST+11:37' # sets a new timezone and define its offset
tzset() # applys the new timezone
# displays and updates the current leet time [VERY DIRTY]
while '42' > '23':
os.system("clear") # uses the shell command "clear" to clear the command shell
print(strftime('%H:%M:%S')) # prints the current leet time
time.sleep(0.5) # sleep half a second then continue
quit
#! /usr/bin/env python
# du solltest im übrigen /usr/bin/env python verwenden anstatt /usr/bin/python
import os
import time
while True: #42 ist immer groesser als 32, also true
os.system(['clear','cls'][os.name == 'nt']) # sollte nun unter windows und linux funktionieren
print(time.strftime('%H:%M:%S'))
time.sleep(1) #wieso eine halbe sekunde wenn du nur jede sekunde eine neue uhrzeit bekommst o0
Original von mauralix
Viele Leute sind bekloppt, aber wer so eine Zeit verwendet ist wohl der König der Bekloppten.
//----------------------------------------------------------------------------------------------------------------------------------------------
// Machines bool-wrapper for C++
//----------------------------------------------------------------------------------------------------------------------------------------------
namespace useless_datatypes
{
class CBoolean
{
private:
bool m_value;
public:
CBoolean( bool value = false ) : m_value( value ) {}
virtual ~CBoolean();
operator unspecified-bool-type() const { return m_value; }
CBoolean operator!() { return Boolean( !m_value ); }
CBoolean& operator=( bool rhs ) { m_value = rhs; return *this; }
bool IsTrue() const { return m_value == true; }
bool IsNotTrue() const { return m_value != true; }
bool IsFalse() const { return m_value == false; }
bool IsNotFalse() const { return m_value != false; }
void ToggleBool() { m_bool = !m_bool; }
};
}
//----------------------------------------------------------------------------------------------------------------------------------------------
Original von mauralix
Soll der Wrapper ein Schwerz sein?
const Klasse& operator=(const Klasse& k) {
*this = k;
return *this;
}
Original von mauralix
Soll der Wrapper ein Schwerz sein?
Original von Serow
Die enthalten zusätzlich z.B. Methoden um aus einem String ein int zu parsen usw. Wie ist das in C++?
template<type T>
class Wrapper {
T m_var;
public:
const T& operator+(const T& v);
const T& operator-(const T& v);
const T& operator*(const T& v);
const T& operator/(const T& v);
// usw...
const T& operator T();
};
public interface Foo {}
public class Bar1 implements Foo {public void op1(){}}
public class Bar2 implements Foo {public void op2(){}}
Foo a = new Bar1();
Foo b = new Bar2();
if (a instanceof Bar1) ((Bar1) a).op1();
if (b instanceof Bar2) ((Bar2) a).op2();
import time
while True:
# substrates (13*60*60+37*60=49020) seconds from the local time
LeetTime = time.strftime("%H:%M:%S",time.localtime(time.time()-49020))
print "\rLeet Time:", LeetTime, # foobar
time.sleep(0.01) # it seems that this value has to be set very low if no new line is present ... or so
quit