create account

Daily Steem-Python Challenge #21, Win 1 Steem! by steempytutorials

View this thread on: hive.blogpeakd.comecency.com
· @steempytutorials ·
$2.64
Daily Steem-Python Challenge #21, Win 1 Steem!
<center>https://cdn.discordapp.com/attachments/404587860872921088/405329216280723458/challenge.png</center>

For each tutorial we release there will be a relevant challenge where the winner receives 1 STEEM! 

### Challenge

Take the code from the tutorial from [here](https://github.com/amosbastian/steempy-tutorials/tree/master/part_21) and change it to be able to do the following

1. Determine the most optimal amount of threads for your CPU and plot this. Time each session and use this data to make a plot which shows where there is no more benefit of adding any additional threads. To keep it simple stick to a fixed block count of 1000.

That's it! Good luck to everyone participating!

### Deadline
The prize money will be rewarded to the person that solves the problem first. If there is no solution within 7 days after this post has been submitted the prize pool expires.

### Relevant Tutorial
- [Part 21: Use Multi Threading To Analyse The Steem Blockchain In Parallel](https://steemit.com/utopian-io/@steempytutorials/part-21-use-multi-threading-to-analyse-the-steem-blockchain-in-parallel)

---

If you have questions about the tutorial or the challenge then don't hesitate to comment below or contact us on [Discord](https://discord.gg/rYTV87W)!
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 23 others
properties (23)
authorsteempytutorials
permlinkdaily-steem-python-challenge-21-win-1-steem
categoryprogramming
json_metadata{"tags":["programming","python","contest","bot","steemdev"],"image":["https://cdn.discordapp.com/attachments/404587860872921088/405329216280723458/challenge.png"],"links":["https://github.com/amosbastian/steempy-tutorials/tree/master/part_21","https://steemit.com/utopian-io/@steempytutorials/part-21-use-multi-threading-to-analyse-the-steem-blockchain-in-parallel","https://discord.gg/rYTV87W"],"app":"steemit/0.1","format":"markdown"}
created2018-02-05 05:40:06
last_update2018-02-05 05:40:06
depth0
children10
last_payout2018-02-12 05:40:06
cashout_time1969-12-31 23:59:59
total_payout_value2.586 HBD
curator_payout_value0.050 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,261
author_reputation31,094,047,689,691
root_title"Daily Steem-Python Challenge #21, Win 1 Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id35,062,275
net_rshares386,596,742,247
author_curate_reward""
vote details (87)
@cccp ·
[Here's](https://pastebin.com/spSBtW15) my solution

I've assumed that the number of threads is optimal, when the addition of a new one improves the execution time of the algorithm by less than 5%. you can change this value by modifying STOP_CONDITION variable. 

I've also changed `head_block = blockchain.get_current_block_num()-int(sys.argv[1])` to `head_block 		= blockchain.get_current_block_num()`, which I believe is correct
properties (22)
authorcccp
permlinkre-steempytutorials-daily-steem-python-challenge-21-win-1-steem-20180207t183104297z
categoryprogramming
json_metadata{"tags":["programming"],"links":["https://pastebin.com/spSBtW15"],"app":"steemit/0.1"}
created2018-02-07 18:31:06
last_update2018-02-07 18:31:06
depth1
children1
last_payout2018-02-14 18:31:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length431
author_reputation0
root_title"Daily Steem-Python Challenge #21, Win 1 Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id35,722,230
net_rshares0
@komail · (edited)
I really very excited for it 
I already learn python very easy language obviously it is a high level language which is easy for human
I am ready
properties (22)
authorkomail
permlinkre-cccp-re-steempytutorials-daily-steem-python-challenge-21-win-1-steem-20180214t190255374z
categoryprogramming
json_metadata{"tags":["programming"],"app":"steemit/0.1"}
created2018-02-14 19:03:00
last_update2018-02-14 19:03:45
depth2
children0
last_payout2018-02-21 19:03:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length144
author_reputation6,633,855,647
root_title"Daily Steem-Python Challenge #21, Win 1 Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id37,550,277
net_rshares0
@daveiano · (edited)
How would I share my solution? Paste the relevant code as a comment?
properties (22)
authordaveiano
permlinkre-steempytutorials-daily-steem-python-challenge-21-win-1-steem-20180221t093636090z
categoryprogramming
json_metadata{"tags":["programming"],"app":"steemit/0.1"}
created2018-02-21 09:36:36
last_update2018-02-21 09:36:54
depth1
children0
last_payout2018-02-28 09:36:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length68
author_reputation4,366,297,315
root_title"Daily Steem-Python Challenge #21, Win 1 Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id39,302,709
net_rshares0
@drowkeudrow · (edited)
Tutorial yang bagus @  steempytutorials
properties (22)
authordrowkeudrow
permlinkre-steempytutorials-daily-steem-python-challenge-21-win-1-steem-20180207t154040933z
categoryprogramming
json_metadata{"tags":["programming"],"app":"steemit/0.1"}
created2018-02-07 15:40:45
last_update2018-02-07 15:42:21
depth1
children0
last_payout2018-02-14 15:40:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length39
author_reputation3,109,901,127,459
root_title"Daily Steem-Python Challenge #21, Win 1 Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id35,690,013
net_rshares0
@graciousrecipe ·
Excellent information. Thanks alot.
properties (22)
authorgraciousrecipe
permlinkre-steempytutorials-daily-steem-python-challenge-21-win-1-steem-20180313t090807681z
categoryprogramming
json_metadata{"tags":["programming"],"app":"steemit/0.1"}
created2018-03-13 09:08:21
last_update2018-03-13 09:08:21
depth1
children0
last_payout2018-03-20 09:08:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length35
author_reputation-602,091,313,971
root_title"Daily Steem-Python Challenge #21, Win 1 Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id44,096,974
net_rshares0
@muhammadazzikra ·
THANK YOU FOR THIS INCREDIBLE INFORMATION
properties (22)
authormuhammadazzikra
permlinkre-steempytutorials-daily-steem-python-challenge-21-win-1-steem-20180306t202616587z
categoryprogramming
json_metadata{"tags":["programming"],"app":"steemit/0.1"}
created2018-03-06 20:26:21
last_update2018-03-06 20:26:21
depth1
children0
last_payout2018-03-13 20:26:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length41
author_reputation319,634,092,040
root_title"Daily Steem-Python Challenge #21, Win 1 Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,703,880
net_rshares0
@paulasepistle ·
where to submit the solution?
properties (22)
authorpaulasepistle
permlinkre-steempytutorials-daily-steem-python-challenge-21-win-1-steem-20180327t113330377z
categoryprogramming
json_metadata{"tags":["programming"],"app":"steemit/0.1"}
created2018-03-27 11:33:30
last_update2018-03-27 11:33:30
depth1
children0
last_payout2018-04-03 11:33:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length29
author_reputation8,402,037,074
root_title"Daily Steem-Python Challenge #21, Win 1 Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id46,878,264
net_rshares0
@rahmadsanjaya ·
siplah pokoknya
👍  
properties (23)
authorrahmadsanjaya
permlinkre-steempytutorials-daily-steem-python-challenge-21-win-1-steem-20180217t163528534z
categoryprogramming
json_metadata{"tags":["programming"],"app":"steemit/0.1"}
created2018-02-17 16:35:39
last_update2018-02-17 16:35:39
depth1
children0
last_payout2018-02-24 16:35:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length15
author_reputation156,085,468,790
root_title"Daily Steem-Python Challenge #21, Win 1 Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id38,296,167
net_rshares0
author_curate_reward""
vote details (1)
@shirishpaudel ·
https://steemit.com/smartphonephotography/@shirishpaudel/beautiful-flower-50c0af8c34f74
properties (22)
authorshirishpaudel
permlinkre-steempytutorials-daily-steem-python-challenge-21-win-1-steem-20180216t065625438z
categoryprogramming
json_metadata{"tags":["programming"],"links":["https://steemit.com/smartphonephotography/@shirishpaudel/beautiful-flower-50c0af8c34f74"],"app":"steemit/0.1"}
created2018-02-16 06:56:33
last_update2018-02-16 06:56:33
depth1
children0
last_payout2018-02-23 06:56:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length87
author_reputation4,996,979,925
root_title"Daily Steem-Python Challenge #21, Win 1 Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id37,933,573
net_rshares0
@tiboine ·
dead?
properties (22)
authortiboine
permlinkre-steempytutorials-daily-steem-python-challenge-21-win-1-steem-20180428t152650687z
categoryprogramming
json_metadata{"tags":["programming"],"app":"steemit/0.1"}
created2018-04-28 15:26:51
last_update2018-04-28 15:26:51
depth1
children0
last_payout2018-05-05 15:26:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5
author_reputation2,110,692,062
root_title"Daily Steem-Python Challenge #21, Win 1 Steem!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id52,662,714
net_rshares0