67 karma · joined December 20, 2011
analysis/optimize energy consumption, e.g.:
* we moved the freezer from the kitchen to the basement instead of buying a more energy efficient new one
* the pump in our (20yrs old) heating system constantly uses 60W -> the whole furnace is now due for replacement
* determine your electricity base load in order to make an informed decision about the capacity of a battery system that buffers energy demand during the times the PV system does not supply energy
I'd say the real value is in looking into long term patterns (no ML needed).
nothing to do with muslims
I x C: (3,3) and not I x C: (1,3) ?
Similarily the right-most one should be C* x I: (3,1) no?
https://bitbucket.org/ul5255/code-snippets/src/61958ee922cee...
Python 2.6:
>>> dis.dis(f)
1 0 LOAD_GLOBAL 0 (g)
3 LOAD_CONST 0 (None)
6 YIELD_VALUE
7 CALL_FUNCTION 1
10 RETURN_VALUE
Python 2.7: >>> dis.dis(f)
1 0 LOAD_GLOBAL 0 (g)
3 LOAD_CONST 0 (None)
6 YIELD_VALUE
7 CALL_FUNCTION 1
10 POP_TOP
11 LOAD_CONST 0 (None)
14 RETURN_VALUE
In essence the Python 2.7 compiler decides to throw away the result of the g() function call and replaces it with None. Does anyone understand why? >>> import dis
>>> f = lambda: g((yield))
>>> dis.dis(f)
1 0 LOAD_GLOBAL 0 (g)
3 LOAD_CONST 0 (None)
6 YIELD_VALUE
7 CALL_FUNCTION 1
10 RETURN_VALUE
>>>You can also use it inside generators:
>>> def f():
while True:
xyz = (yield)
print xyz
>>> g = f()
>>> g.next()
# nothing happens as xyz == None
>>> g.send('huhu')
huhu