Skip to content

Instantly share code, notes, and snippets.

View nicolas-f's full-sized avatar

nicolas-f nicolas-f

View GitHub Profile

In a game I have a sheep barn that can hold 120 sheeps. I can buy 0 month 3 month and 8 month old sheeps.

A sheep is able to reproduce at 8 month (will always create only 1 (0 month) sheep ) every 5 month cycle (so first born is 8+5 month, then every 5 month)

Here a table explaining the price,needs and production of a sheep:

age > 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
buy price 200 236 272 308 344 381 417 453 489 525 561 597 633 669 706 742 778 814 850 886
@nicolas-f
nicolas-f / gist:7c8f995b3a0eb3227fff0ddfd5e0c844
Created April 19, 2026 09:30
Trains module Captain Of Industry
B2360:H4sIAAAAAAAACoXZ/0sUaRwH8Hmm2ad19fbWaW8zM29PIiRCPJMSiShPPQuvk3WJiNA2d9XJcWeZHbsMiQiRiAiR6EIiIiQiIiIiJEQiIkIiIiIkIiL6E+4PuPm2z+w+O+92f/T1fD7zfPnM7mdGidDWlo6W3al7oripW5s6pWYGjZShaNm/tPSUmtkg/CdKUjipp0YmuhU9M2KRGIjZfxicymX0LlUbmch3KcZkKifQRh56zuZUZUQx3AEbN9sDBhRVTZWGCiRYNaBrhmZM5zJVtYOGnlLGxo3W4UTr8J+twz2CGKoyY7P5UU2fDMTrJVGoDtnJetXUWF4kgiSJAYEKG+1U5vBAvMEa5CuNUOJQmqBsh7KDE5FJsyvW2JpacyFK1l5N3tkbwSfZTniZXVBaoLRCaYPSDmUPlA4onVD2QdkP5QCULijd8Hh6i4/H7zD6YNLDUPqhHIEyACUBJQnlKFzwsUoLPg6TnoAyBOUklFNwiulKUxyFScehnIaiQslCyUHRoRhQzkA5C+UclBko54HQ+AUCToPGL5IfHweNz/LBHs1huoTpMqYrmK5imse0gOkaput4v26U7ZfEHUOdRN1YXmJQolBkR8RyiXDi3WFhV9gUaYC6oT9tLf1J7hjuGU6kJnNmu6AbVrCcFERSvUF0whrNMMkMC8f8w+yIPisiIAn2p+yKP2/xD+3Jpu3oTpFdj1uhUC9R4rsrQgMnbO1CoyvoeIQ4TNoEZTuUHVCaoeyEsgtKC5RWuBVtlbaiHSbdA6UDSieUfVD2QzkApQtKN5ReKH1QDkPph1t+pNKWD8CkCShJKEfhRI5VmshxmPQElCEoJ6GcglNMV5riKEw6DuU0FBVKFkoOig7FgHIGylko56DMQDkPhApmH+B/GlS4SH58HFSY5YM9msN0CdNlTFcwXcU0j2kB0zVM1/F+3SjbL64dE+okkfg2akIMSpQT726RHRHh5SLugHIJMynqAywJJ82B5b/1NvVZhH/U7TGdIgvnm5
@nicolas-f
nicolas-f / SavedPrints.txt
Last active October 6, 2026 22:37
Songs Of Syx BluePrints
BLUEPRINTS: [
{
NAME: "center25x25",
ROOM: _STOCKPILE,
STRUCTURE: _,
CHECK: 112147483647412213141516171222324252627,
WIDTH: 9,
HEIGHT: 23,
DATA: [
2,
@nicolas-f
nicolas-f / log.txt
Created August 10, 2017 07:14
duplicati Traceback
Server has started and is listening on 127.0.0.1, port 8200
Invalid type Microsoft.WindowsAzure.Storage.Blob.BlobEncryptionPolicy for instance field Microsoft.WindowsAzure.Storage.Blob.BlobRequestOptions:<EncryptionPolicy>k__BackingField
Invalid type Microsoft.WindowsAzure.Storage.Queue.QueueEncryptionPolicy for instance field Microsoft.WindowsAzure.Storage.Queue.QueueRequestOptions:<EncryptionPolicy>k__BackingField
Invalid type Microsoft.WindowsAzure.Storage.Table.TableEncryptionPolicy for instance field Microsoft.WindowsAzure.Storage.Table.TableRequestOptions:<EncryptionPolicy>k__BackingField
Full thread dump:
"IO Threadpool worker" tid=0x0x65b34e906700 this=0x0x65b355e35fb0 thread handle 0x42e state : interrupted state owns ()
"Threadpool worker" tid=0x0x65b34c20f700 this=0x0x65b31d61aa38 thread handle 0x8f9 state : interrupted state owns ()
@nicolas-f
nicolas-f / dp.py
Last active August 29, 2015 13:57 — forked from zed/dp.py
#!/usr/bin/env python
"""Find height, width of the largest rectangle containing all 0's in the matrix.
The algorithm for `max_size()` is suggested by @j_random_hacker [1].
The algorithm for `max_rectangle_size()` is from [2].
The Python implementation [3] is under CC BY-SA 3.0
(if you need other license, e-mail me)
[1]: http://stackoverflow.com/questions/2478447/find-largest-rectangle-containing-only-zeros-in-an-nn-binary-matrix#comment5169734_4671342
@nicolas-f
nicolas-f / gist:9206451
Created February 25, 2014 10:26
H2 1.3.175, && Java Heap Space
-- H2 1.3.175, && Java Heap Space
CREATE TABLE LANDTEST(
THE_GEOM GEOMETRY
);
-- 15 +/- SELECT COUNT(*) FROM PUBLIC.LANDTEST;
INSERT INTO PUBLIC.LANDTEST(THE_GEOM) VALUES
('MULTIPOLYGON (((184856.70313 2431947.75, 184863.20313 2431954.5, 184887.48438 2431963.75, 184908.67188 2431973, 184921.0625 2431979.25, 184974.15625 2432001.25, 184992.01563 2432009.75, 185018.21875 2432025.75, 185017.73438 2432028, 185013.21875 2432033.5, 184990.10938 2432074.5, 184996.3125 2432078.25, 185015.35938 2432090.5, 185039.17188 2432104.5, 185067.26563 2432119.75, 185078.46875 2432126, 185080.125 2432119.75, 185086.34375 2432113.25, 185105.84375 2432093.5, 185107.98438 2432090.75, 185118.70313 2432083, 185141.5625 2432066, 185152.51563 2432056.5, 185146.79688 2432051.75, 185127.75 2432037.5, 185103.70313 2432023.25, 185072.98438 2432002.25, 185077.26563 2431996, 185076.3125 2431988.5, 185079.65625 2431973.5, 185082.98438 2431961.75, 185077.03125 2431959.25, 185070.35938 2431957.5, 185068.70313 2431954, 185066.79688 243194
@nicolas-f
nicolas-f / gist:5813901
Created June 19, 2013 12:27
stack trace 2 np
Exception occurred during event dispatching:
java.lang.NullPointerException
at org.orbisgis.view.toc.actions.cui.LegendTree.refreshIcons(LegendTree.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:57)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
@nicolas-f
nicolas-f / gist:5813790
Created June 19, 2013 12:09
stack trace
org.apache.commons.math3.exception.OutOfRangeException: valeur de quantile -87,889 hors bornes, doit être dans l'intervalle ]0, 100]
at org.apache.commons.math3.stat.descriptive.rank.Percentile.setQuantile(Percentile.java:474)
at org.apache.commons.math3.stat.descriptive.DescriptiveStatistics.getPercentile(DescriptiveStatistics.java:428)
at org.orbisgis.view.toc.actions.cui.legends.stats.Thresholds.getQuantiles(Thresholds.java:89)
at org.orbisgis.view.toc.actions.cui.legends.stats.Thresholds.getThresholds(Thresholds.java:37)
at org.orbisgis.view.toc.actions.cui.legends.PnlAbstractCategorized.onComputeClassification(PnlAbstractCategorized.java:190)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)