Sunday 31 January 2016

Spark - Building an Application .jar

https://nosqlnocry.wordpress.com/2015/02/27/how-to-build-a-spark-fat-jar-in-scala-and-submit-a-job/

To launch an application on Spark:
spark-submit --class com.examples.MainExample \
    fedorov-simulator-16.02.07-RELEASE.jar \
    inputhdfspath \
    outputhdfspath
To see the console: localhost:4040

Saturday 30 January 2016

Максим - первые разы "папа"

Вчера и сегодня по многу раз Максим повторяет по нескольку раз "папа" в голос.

Переступал ножками, делая несколько шагов вперед. Держась за опору передвигается в боковом направлении. Часто держится только одной рукой.

Friday 29 January 2016

CoC - Donations, Queen 3, Camp or Drill, Mortar or Cannon

We have just won a war against clan 8. A lot of loot and thus target of gold won in war becomes very close: 4-7-10 days.

Donations is the first target as on the critical path. Have to be always ready to donate: wizards, giants, archers. In few days, when in war also balloons on request. Prevision by PC after all field is cleared gives 16 days till the target:


Queen 3 is close. It is a matter of few strong raids. Some strategy with queen and healer should be tried.

As soon as queen and healer given 3 stars in the last battle the investment in level 3 healer that costs only 1 million could have sense in the case of possibility to invest at the same time in a camp (short investment) or drill (long run investment).

Double mortar update is a bit risky in general but with empty deposits and average destroy below 50%, it could have sense. Quicker general defense increase is guaranteed.

CoC - Wizard Tower Early Update

Avoiding job finished in the middle of the night, I have scheduled wizard tower and not archer one.

War targhet is reached. Both enimies had early town hall 9. One 3 star, one 1 star.

Today 2 workers will be free. Early towers updates and deposits.

Due to game update giving daily bonus that is considered as war gold, high league is desired. Gold 3 league gives +20%. We need yet 2.5 M 20 days of pure farming. But wars must reduce this period significantly.

Anyway critical path is donations. Yet 4.5 K, that is about 25 days.

Best nexts:
research: PEKKA or healer
elixir: camp.

Thursday 28 January 2016

CoC - Balloons 5 In Research, First Mortar in Constraction

Emptied both gold and elixir deposits but invested in 2 very valuable updates. No risk to loose resources. Valuable increase in the power both in defense and attacks.

Was promoted to be a co leader without any condition.

Wednesday 27 January 2016

CoC - Early Town Hall 9 Gold Updates

For sure the most efficient from the utility/time point of view is sequence:

  • all updates of archer tower
  • all updates of wizard tower
  • all updates of Tesla

Tuesday 26 January 2016

CoC - Research Using Elixir

3 main directions:
  1. air: balloon 5 (2.5), balloon 6 (6), dragon 6 (7) - the strongest line for wars at the moment, would be logical to improve it quickly;
  2. healer for queen: (1), (3) - low cost but doubts about usefulness at early levels of the queen;
  3. PEKKA for GoWiPe: (3), (6) - long run investment, as soon as also Golem has to be updated to the 4th level and no sense to do it at the early stages of Town Hall 9.
The coefficients for dragons is 11, for balloons is 44, for PEKKA is 8.

balloon 5: utility = 44 * (108 - 72 ) * (390 - 280 ) = 44 * 36 * 110 = 174240
/ cost = 69.7 / time = 13.9

dragon 7: utility = 11 * (200-180) * (2500-2300) = 11 * 20 * 200 = 44000
/ cost = 6.28 / time = 0.45

pekka 2: utility = 8 * (270-240) * (3100-2800) = 8 * 30 * 300 = 72000
/ cost = 24 / time = 2.4

balloon 6: utility = 44 * (162-108  ) * (545-390) = 44 * = 368280
/ cost = 61  / time = 6.1

pekka 3: utility = 8 * (300-270) * (3500-3100) = 8 * 30 * 400  = 96000
/ cost = 16 / time = 1.3

CoC - Archers vs Giants 6

The occupied space is 50 for 10 giants and 60 for archers.
60*2*4 = 480
10*12*24=2880
Thus giants are in top of priorities for research at level 7.
Minion 5 - the last update:
15*4*6=360

Turning back to the previous findings:

New research and camp extension may be compared by:
(number units in farming raid)*(delta health)*(delta power) / (cost research) 
vs
(delta number)*(health)*(power) / (cost of camp)
.
(camp update) = 5 (20) * (40) / 2.2 = 1818
(research giants 5 to 6)=10*12*24/6.0 = 2880/6.0 = 480
(research archers 5 to 6) = 60 * (22-20) * (44-40) / 6.0 = 80

Thus the camp update is for sure is the most effective investment and yet another confirmation regarding that the research of giants is much more important than archers.

CoC - Spell Factory Upgrade

Considering that its update would require not being in war for some days (and we are still looking forward the archivement of 15 M gold to get 5th builder) and the use of 4th spell during farming is a quite rare case in this period, it seems more logical instead go on with camps firstly. At least till the archivement or till all of the camps are extended.

Other try to do is to try to boost queen with 1 angel. It could be later used during war as a consolidated practice. Good moment to produce it during the shield or before stopping to play. Especially adapted for a concentration of full extractors.

Monday 25 January 2016

CoC - Elixir Updates

For the gold it is all clear - we invest in early updates of 4 new defensive structures.

For the dark elixir is all clear as well - we are waiting for 25 K to launch the upgrade of queen till level 3.

The main issue is the elixir updates. It is less problematic resource during the whole town hall 9 period but seems at the beginning there are a lot of important investments with it to do:

  • in research the cheapest investment is healer 2 (1 M), it is fine as soon as it could a good alternative strategy with the queen
  • camp (5 days, 2.25 M) - good boost (wizard + archer) - around 35K
  • spell factory (5 days, 1.75 M) - perfect boost (1 healing spell) - ( 35 * 40 = 1400 ) * (180 x dragon) * (3 number of dragons in circle) = 756 K (20 times more!)

CoC - After First Weekend in TH9

Queen is at 2nd level. All structures are at least in construction. One camp in update. One dark elixir drill in update. Hog riders 4 are ready to be used. Healer 2 is in research.

Research is on critical path: 1.5 months of delay to full update of all buildings except gold and elixir extractors.

The resource that is more rare than others from investment/production point of view is for sure dark elixir. Dark drills updates have to double actual production (4.8 K a day) but could not be a solution. To provide all 5 M of dark elixir necessary for update the farming rate should be 28 K a day.

Friday 22 January 2016

CoC - Ready for Update

All deposits have necessary limits: 60 K of dark elixir, 4.7 M of gold, 5.3 M of elixir.  
The plan is:
1. Queen (immediate)
2.  Archer tower 1 (15 mins)
Air tower (22K and 5 hours)
Wizard tower (0.18M, 12 hours)
Tesla  (1M, 1 day)
* X Bow (3 M, 7 days) (big update of gold)
* Queen 2? (the first long update, dark elixir is over)
* camp (5 days, 2.25 M) (big update of elixir)
* drill (1 day, 1 M)

Thursday 21 January 2016

CoC - Last Day of Town Hall 8

Tomorrow at this time the town hall switch to a new era. Gold is on a half of capacity thus today is the last chance to full it. No film on tv and a war thus I expect the deposit will not be fulled.

Scheduled gold mine upgrade. Lost 16 hours of construction for this decision. At the end no sense to be crazy about all 4 builders running immediately on new constructions. First level of defensive structures and big investments will down deposits to the safe level. Rollback of the 4th is always possible.

Ideally with gold at 4.5 M every new defence except 2nd x bow will be at least in construction in a very first day.

It is feasible to launch immediately 2 camp updates and a bit later spell factory update.

Queen 2 should be feasible as well.

Yet 5.5 K of troops to donate. It is 220 full 25 space castles. Today the main target is make money for tomorrow, if possible.

War gold bonus should be safe for such period even if we loose all wars till that time. My risk remains in war exclusion. In this case other clan may be searched.

Wednesday 20 January 2016

CoC - Utility Function Model for Updates

Two days before town hall 9, the gold is lower then 2 M. We are in an unexpected situation. We have two evenings to try to manage it.

Now about the model. For sure both measures are important (time of construction and costs) but for sure at the early phase of town hall 9 the costs are less important (it is a bound measure) thus the quickest good approximation is:

(hits) * (health) = (utility)
(utility) / (construction time) - only utility optimization measure (>50% of deposits)
(utility) / ( (construction time) * (costs) ) - budget optimization measure (<50 deposits="" of="" p="">
Considering said, best sequence:

  1. archer tower
  2. wizard (as soon as splash damage)
  3. Tesla
  4. X bow (to put earlier only the case of risk of not being able to collect enough resources later)

Tuesday 19 January 2016

CoC - 3 Days Till Town Hall 9 - High Priority - Camps

Last estimation for 5th builder is 21 days to go.

The most important question, how effective will be farming after the update. 20% of penalization should not be a problem. In one day with farming easily get 1 M of gold, it is enough for going ahead.

Increase of the army should arrive almost instantly together with 4th spell. The queen appearance and her quick increase in power at the beginning (2x K dark elixir quotes are well tested) should help as well.

Full power on elixir farming should be the main target. Indeed we need 4 camps, 2 spell factories, and a lot of elixir researches (also postponed for a long in last month) all require elixir investment.

New research and camp extension may be compared by:
(number units in farming raid)*(delta health)*(delta power) / (cost research) 
vs
(delta number)*(health)*(power) / (cost of camp)
.
Considering archers 5 vs 6 we have:

  • (camp update) = 5 (20) * (40) / 2.2 = 1818
  • (research) = 60 * (22-20) * (44-40) / 6.0 = 80


Thus investment in camps is 22 times more efficient as the resource allocation than upgrade in the laboratory.

More, x-bow vs archer tower gives advantage to activate firstly the archer tower. It will be up and running shortly. The only thoughts could be about the huge amount of resources difficult to collect at the early stages of town hall 9. Thus natural to think that all early updates of the defensive structures should be put all active and then the huge update has sense only for "putting in save" huge amount of resources brought from the previous era.

Thus for sure at the beginning we have to consider the investments in:

  • new walls (installation/upgrade)
  • new archer tower (installation/upgrade)
  • new air defense? (installation/upgrade)
  • new wizard tower? (installation/upgrade)
  • new tesla? (installation/upgrade)

Максим - с утра сказал "мам", "пап"

Сегодня утром Максим очень рано проснулся, до 5 утра и потом промотался с Аней до завтрака. За завтраком мы его посадили на стульчик. Во время завтрака он к нам обратился: "мам, пап" в первый раз.

Monday 18 January 2016

Максим - стоял

Во время купания в большой ванне, схватился за край и с небольшой помощью поднялся (был по пояс в воде). Постоял с удовольствием 20 секунд.

CoC - 5 Days Till Town Hall 9

This Friday town hall 9 is ready. As soon as the working week is started and most of internal walls (more than a half) are updated to dark purple, the gold stopped to be invested in walls and is saved now for the next era beginning. 3 mines are under upgrade thus the own production rate is a half of normal.

Elixir is spendibile only for troops. The deposits are close to 4M level.

Dark elixir is waiting for town hall 9. Till now it is at 42M level. Enough for the burn of the queen. Could be yet feasible to collect also for the first queen update.

When the first upgrading gold mine is finished, the bombs can be scheduled. But it will impact notably gold deposits (2M). Thus the decision about upgrade is not yet taken. Depends how efficient we will be in gold collaboration in these days. Other upgrading mines, when finished, leave the builders without work till town hall 9. To guarantee full power immediately after update.

Updated sequence plan:
1. queen 40; queen 20 or x bow 3
2. camp 2.25
3. camp 2.25
4. x bow 3 (possibile if full) or spell factory 1.6 (with a bit of farming before) or low cost new structures (walls, towers)

War is oriented only for "justified" bonus. Best choice is mirror and one attack on higher enimy.

Donate when possible. With job it has slown down till become the decisive event for 5th builder. Actual prospection is 23 days to go or February 10.

The strategy to empty gold deposits for wall upgrade worked really good. More than 10M of gold farmed in a couple of days. During opponent selection missing gold in deposits increases the probability of opponents with full gold loot.

Wednesday 13 January 2016

CoC - Plan Till Town Hall 9

The first 5-7 days is better to invest all gold in walls and search to empty gold deposit daily to have constant strong unbalanced situation gold vs elixir.

Elixir there is no way to invest except the wars, donations and raids. Thus the strongest army for wars (dragons and rush), big donations (giga, wizard, dragons, pekka), raids with dragons and lightning  (quick to produce, most powerful).

Dark elixir. No way to spend except in wars with hog riders and golems. But both strategies have not shpwn till now to be more effective than dragons except once.

Deposit of gold has to be maxed in next days in the way that do not create a gap in freeing a builder greater than a day.

3 bombs upgrades are better to safe till the very end to be able to balance better the load before town hall 9.

All other updates are related to extractors of gold.

Максим - первый раз длинный путь ползком вперед

Сегодня Максим несколько раз прополз из зала на кухню к Ане. В первый раз Аня ему помогла с дорогой, а в следующий он сам к ней дополз.

CoC - Countdown till Town Hall 9 is Started

Has chosen to launch town hall upgrade immediately. With real life activities the ambition to have 5th builder as soon as possible is not so important.

Tuesday 12 January 2016

CoC - Town Hall 9 Upgrade Start

The theme of when to launch the upgrade is still the hottest topic. The choice is between now and somewhere in the next 2 weeks.

The only bonus under the risk is the bonus for the gold got during wars. It is 100 gems that is about 10 days of farming. Immediate availability of the Queen in town hall 9 should increase the chance of winning at least one star in the first battle and increases the chances in the second attempt. Thus the only real risk is that I will not be considered anymore for the wars but the only loose would be that I arrive to the target with 10 days of delay. At the end not so dramatic for real life: a bit less to farm in this period, that is fine.

Launching the upgrade this evening the further extractors updates would be limited by other 3 ones. Thus it would almost level the gold and elixir production.

Monday 11 January 2016

CoC - Gems

Gems is returning as a key topic for the strategy. The main reason is the return to the office and thus significant change in the way I am able to play.

1. Running out all extractor upgrades to get as quick as possible the 5th builder does not seem anymore the best way to go. The farming speed after upgrade will be probably too low to guarantee all 5 builders up and running. Instead the possibility to go slower with occasional upgrade of an extractor seems more adeguate with current situation in the real life.

2. Key archivement for the quick 5th builder: friends in need that gives 250 gems requires frequent presence online that now is doubtful. Internet is not working well in the office and it could create some issue for the image.

3. Key archivement in war gold bonus is also close to the estimated date of 2K limit. The recent tendency to go in war with 10 makes the second attack less secure in result. As it happened in the last one in which I had to attack town hall 10 for bonus but failed  with 44% thus bonus will be halved. Thus the risk of unexpected postponement of 5th builder could bring to the situation when all builders finish their jobs but the 2K limit is yet to reach. In this case further waiting in town hall 8 would lead to useless idle of all builders. Switch to town hall 9 instead could mean that all time for striving for getting bonus for this archivement is vanished.

4. Walls are at 25% of upgrade but already cover the most of essential defense parts. Thus immediate start of town hall 9 upgrade would already permit to arrive in the new era with strong core walls.

Now the plan to launch the upgrade would lead to:
* yet half of extractors would be available for upgrades in new era
* hog riders would be perfect
* now significant impact on the bonus targets would happen, if I am included in wars
* core walls would be already in place

Thursday 7 January 2016

Максим - первое мама в 7 месяцев

Теперь говорит безперебойно, по многу раз.

Monday 4 January 2016

CoC - First Steps in Town Hall 9


  • Queen - 40 K dark elixir - immideate
  • Laboratory - 2.5 M elixir - 5 days 
  • X-bow - 3 M gold - 7 days (both could be good)
  • Spell Factory - 1.6 M  elixir - 5 days (greater immediate force increase)
Later in the laboratory

  • Barbarians? - 4.5 M elixir - 10 days?
  • Archers? - 6 M elixir - 10 days?
Later:
  • Camp - 2.25 M elixir - 5 days
  • Dark elixir drill 3-4-5 M 
  • Dark spell factory - 3.5 M - 8 days