Skip to content

Instantly share code, notes, and snippets.

View DylanDmitri's full-sized avatar
🅱️

Dylan Dmitri Gray DylanDmitri

🅱️
View GitHub Profile
>>> type(reader)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'reader' is not defined
>>> with open('hr_data.csv.csv', 'rU') as infile:
... reader = list(csv.DictReader(infile, delimiter=','))
...
>>> type(reader)
<class 'list'>
def plot_keras_weights(model, outfile='model.png'):
graph = pydot.Dot(graph_type='digraph')
prev_layer = []
for i in range(model.input_shape[1]):
node = pydot.Node(f'Input[{i}]')
prev_layer.append(node)
graph.add_node(node)

Pseudocode ideas

for client -> server streaming


client code

function SaveImageOnServer(imageFile, albumName)
{
  let writer = connection.UploadStream("SaveImage", albumName);

New client-side class, "StreamingUploadHandler", that's a wrapper around the write end of a pipe. This is a nice interface, and can be more consistently ported to other clients where we don't have the same c# channel class.

Constructing a "StreamingUploadHandler" is async, because it confirms the server is ready to receive incoming chunks. The constructor needs two types, one for inputs (what data do you send?) and one for outputs (what data do you receive?).

For a basic file upload, you would send byte arrays and receive a status message.

In this example, you send letters one-by-one, and the server concats them and returns a string.

Setting

Standard dnd fantasy. Campaign takes place on a mid-sized island, about 10 days walk coast to coast.

The Isle is relatively isolated; the only trade is by ocean and difficult. It takes ships 6-7 months to make the journey, and seasonal storms limit the frequency of arrivals.

The Isle has a large supply of gems and precious metals, which are in high demand back on the mainland. Commercial mining has only really picked up in the last fifty years or so. The population and prosperity of the main port city of Nawa is growing at a respectable clip.

Most of the island's wealth is held by the merchant's guild in the main port city. The guild, composed of around a dozen leading families, runs most of the mining operations and charters trade ships. The guild are mostly wealthy mainlanders hoping to build a fortune.

Setting

Standard dnd fantasy. Campaign takes place on a mid-sized island, about 10 days walk coast to coast.

The Isle is relatively isolated; the only trade is by ocean and difficult. It takes ships 6-7 months to make the journey, and seasonal storms limit the frequency of arrivals.

The Isle has a large supply of gems and precious metals, which are in high demand back on the mainland. Commercial mining has only really picked up in the last fifty years or so. The population and prosperity of the main port city of Nawa is growing at a respectable clip.

Most of the island's wealth is held by the merchant's guild in the main port city. The guild, composed of around a dozen leading families, runs most of the mining operations and charters trade ships. The guild are mostly wealthy mainlanders hoping to build a fortune.

@DylanDmitri
DylanDmitri / OpusMagnum.md
Last active October 7, 2018 19:57
Opus Magnum Suggestions

Opus Magnum

In search of better metrics!

Speed

  • cycles to first item
  • cycles to 6 items
  • long-term production schedule (average speed, batch size & pattern if applicable)

Hardware Complexity

@DylanDmitri
DylanDmitri / azure_face_demo.py
Last active July 24, 2018 19:45
Azure Face Python Demo
def get_face_info(image_bytes):
url = 'https://westcentralus.api.cognitive.microsoft.com/face/v1.0/detect'
params = {
'returnFaceId': 'true',
'returnFaceLandmarks': 'false',
'returnFaceAttributes': 'age,gender,headPose,smile,facialHair,glasses,' +
'emotion,hair,makeup,occlusion,accessories,blur,exposure,noise',
}
DESIGN GOALS
Force Improvisation
Variety.
Break the default gameplan. These enemies are armored. What do you do?
Randomness builds stories (Hearthstone)
Provide Building Blocks
Give tools not fish.

Your team assigns you a project, not because the project is super critical, but because it's a good "starting project" and about the right size for an internship.

Then, if you fail to show meaningful progress on the problem, or if you have toxic personality issues, they don't hire you back. This is rare.

If you complete only a large piece of the project, or if some blocker comes up partway through and you can't get around it, you generally get a level 59 offer.

If you complete it, you get a level 60 offer, and the quality of your work (and other offers) determines your stock bonus, which can vary wildly. (see levels.fyi for more details)

The typical distribution of outcomes is 10% no return offer, 50% level 59 offer, 40% level 60 offer. A big part of the internship is convincing you to work at Microsoft, because most interns are already competent.