-
hareware: GCE g1-small instance (1 vCPU, 1.7 GB memory), about $15/mo
-
software (Archlinux):
sudo pacman -Sy nginx certbot docker docker-compose
# optional tools
// 可能可以改寫成這樣: | |
LocationsFetcher.fetchLastResult = null; | |
LocationsFetcher.fetch = () => | |
if (LocationsFetcher.fetchLastResult) { | |
return Promise.reject(new AlreadyCalledError()); | |
} else { | |
return LocationsFetcher.fetchLastResult = doFetchInternal(); | |
} | |
}; |
大哉問,但是我覺得我沒辦法正面回答。 | |
在《人月神話》裡面有提到軟體開發的一個現象, | |
就是軟體越大,維護越困難(廢話)。 | |
這是因為初期的設計不可能考慮到後期的需求, | |
所以增加新功能,要顧慮到所有與原有設計接合的部份, | |
所以增加一個新功能的成本,跟這個軟體的規模成正比。 | |
也就是說,當軟體規模是 10 的時候,加一個新功能成本的 10。 |
""" | |
run: pack unpack diff | |
pack: | |
python pack.py pack > strokes.bin | |
gzip -kf strokes.bin | |
ls -l strokes.bin* | |
unpack: | |
gzip -dc < strokes.bin.gz | python pack.py unpack > strokes.unpacked |
while (!targetUnit.IsDead()) { | |
actor.animation.Play("run"); | |
while (Vector3.Distance(actor.transform.position, target.transform.position) > actorUnit.attackRange) { | |
actorUnit.MoveTo(target.transform.position); | |
yield return null; | |
} | |
while (Vector3.Angle(actor.transform.forward, target.transform.position - actor.transform.position) > 10) { |
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
// JobManager is just a proxy object so we have a launcher for the coroutines | |
public class JobManager : Singleton<JobManager> {} | |
public class Job | |
{ | |
public event System.Action<bool> jobComplete; |
const ContactBadge = (props) => ( | |
<div className='Badge' {...props}> | |
<div>{props.user.name}</div> | |
<div>{props.contactMethod.type}</div> | |
</div> | |
); | |
export default connect((state, {userId, contactMethodId}) => ({ | |
user: selectUser(state, userId), | |
contactMethod: selectContactMethod(state, contactMethodId) |
// Simple wrapper to use bootstrap's grid system to position elements side-by-side | |
var VerticalFieldsElement = React.createClass({ | |
render: function() { | |
return dom.div( | |
{ className: 'clearfix' }, | |
React.Children.map(this.props.children, function(child) { | |
if(!child) { | |
return child; | |
} |
34. to/lo po/lo' i/ra ko se/pat. | |
Mi/sa/lof, | |
Mi/sa/nga’, | |
Mi/pa/la/sa/wad to | |
Ma/le/ka/ya/tay to/na Ri/ke/c | |
O ci/to/do/ngay a | |
mi/ko/wa/nay i, | |
i la/lo/ma’ no | |
to/lo a mih/ca/an |
löb is a well-known function in Haskell for implementing spreadsheet-like behaviors and tying the knot. It is defined as:
loeb :: Functor f => f (f a -> a) -> f a
loeb fs = xs
where xs = fmap ($ xs) fs