Using C#, a simple web server, and Docker, I’ve been putting together an example of one approach for how to create a “Fiddle” web app to run Python (or other script languages) in a Docker container.
The source code can be found on GitHub, but beware that at the time of this writing, the implementation isn’t complete (only “Run on Docker” and “Run on Host” buttons do anything) and I’m in the midst of writing the article on how I put this together (also in that repo – watch the progress as I write the article and finish the web app!)
One of the pleasures in life is mentoring another developer, particularly when the other developer is smart and motivated to learn. This article, on populating a tree from a collection of paths, was the result of some weekend prep work and is a good case study on refactoring. By going through the process myself and documenting it, I was able to present the problem in general terms, and the person I was mentoring did the heavy mental lifting with only occasional guidance on my part. This worked because I was prepared — had I not done this prep work, I would have taken away from my mentee’s experience to actually solving the problem himself.
Well, that was a “first!” — Two articles:
Understanding Merkle Trees
Full Duplex Asynchronous Read/Write with Named Piped
have won first place in Code Project‘s monthly article competition in the categories of “Best Everything Else” and “Best C# Article” for the month of March 2017.
And as always, with great appreciation to the amazing people @codeproject who have made Code Project possible!
Six lines (not including imports) of Python code to scrape the website onthisday.com for the “persons of interest.” Impressive!
pip install lxml
pip install cssselect
pip install requests
The Python code:
from lxml import html
from lxml.cssselect import CSSSelector
from lxml import etree
page = requests.get("http://www.onthisday.com/birthdays/august/19")
tree = html.fromstring(page.content)
sel = CSSSelector('.section--person-of-interest')
pois = sel(tree)
for poi in pois:
The results (for my birthday):
'1871 Orville Wright, aviator (Wright Brothers), born in Dayton, Ohio (d. 1912)'
'1878 Manuel Luis Quezon y Molina, Second President of the Philippines (1935-42), born in Baler, Aurora, Philippines (d. 1944)'
'1919 Malcolm Forbes, American publisher of Forbes Magazine, born in Brooklyn, New York (d. 1990)'
'1946 Bill Clinton [William Jefferson], 42nd US President (Democrat, 1993-2001), born in Hope, Arkansas'
'1967 Satya Nadella, Indian-American businessman (CEO of Microsoft), born in Hyderabad'
From Code Project:
If it walks like a duck, and quacks like a duck, it’s probably gonna throw exceptions at runtime. – Mladen Janković
I’ve posted a new article on Code Project, explaining Merkle trees and providing an interactive demo of how audit and consistency proofs work. Read all about it!
Move aside IDE’s (Integrated Developer Environment) – it’s time for the new kid on the block, the Integrated Developer Experience!
Ok, so the acronym is already taken (Internet Data Exchange, Indonesia Stock Exchange, and probably others) but I’m co-opting it for how to talk about FlowSharpCode. I’m actually surprised “Integrated Developer Experience” isn’t used somewhere already. Maybe my google-fu is not up to snuff right now.