deploying docker containers for great good!

title inspiration: Using % and .format() for great good!

this container thing better be worth it…

I just spent an inordinate amount of time on the last tutorial.

it’s good for you, most probably.

before you start reading this

have a containerized app.

have a google cloud console account.

have the gcloud cli (if you’re using google cloud shell, then I don’t know how to help you)

the short of it*

  1. install kubectl cli
  2. use gcloud cli to make a kubernetes cluster (make kubernetes in cloud)
  3. connect your kubectl to kubernetes cluster (connect terminal to cloud)
  4. deploy app on kubernetes cluster (put in kubernetes)
  5. expose app on kubernetes cluster (connect to the world)
  6. profit twice (look ma, no magic ??? in between)

*only tested on mac0S 10.13.5 High Sierra

Continue reading “deploying docker containers for great good!”

Advertisements

running docker containers for great good!

title inspiration: Using % and .format() for great good!

huh?

template. lets you run apps in containers.

before you start reading this

know how to use a terminal /  command prompt.

have install docker on your pc / mac.

the short of it*

  1. make app with flask (or django i guess)
  2. write dockerfile
  3. run
  4. profit (look ma, no magic ??? in between)

*only tested on mac0S 10.13.5 High Sierra

Continue reading “running docker containers for great good!”

How to tokenize japanese words in python

So, you’re working in japan, you’re an english speaking man, and you found out that tokenizing words with your nltk library isn’t cutting it in japanese.

Tokenizing in Japanese is quite a different ball of nettles compared to tokenizing in english. in english, you split stuff by whitespaces and call it a day (more or less). in Japanese however, well, you do not.

Here now, is the easiest way to unstuck yourself out of your tokenizing pothole (for a Mac user). There are other ways, of course, like natto-py.

  1. pip install JapaneseTokenizer
  2. brew install mecab
  3. brew install mecab-ipadic
  4. after that, mecab-ipadic will tell you to make sure mecab knows where its dictionary is. you make sure.
  5. try this gist. It’s a bunch of stuff strung together through a few tutorials and some hunting on stack overflow.

if python isn’t happy, try these steps:

  1. in case python doesn’t find mecab, follow this.
  2. in case of other random errors, check out natto-py’s installation procedure (you might need something called cffi for python to do C related stuff)

 

once you can tokenize japanese words, you can then properly do doc2vec.

here’s an alternative instruction set. here’s another.

EDIT: since posting, I’ve been trying to push a flask app with mecab dependencies onto containers, and this helped a lot. in short, tell your base image to install mecab before you install mecab-python through pip, otherwise it would not find mecab in the docker’s virtual environment.

EDIT2: and to make apt-get (linux) go and not get kicked out of docker cli whenever it asks for permission:

Do you want to continue [Y/n]?

follow this.

Finding correlations in building data

an urban catalogue(仮)

– identifying a building’s ‘character’

Preamble

So now we know about how machine learning can change every industry that it touches. What can it do for architecture? Can it learn relationships between buildings? What does doing that actually do for us?

Well, let’s consider this: buildings are rows in a dataset, and their corresponding features are the columns describing them.

What the dataset can look like

These columns are descriptions of each building, ranging from:

  • location
  • height
  • number of floors, basements
  • number of apartments and offices (this small study was previously done based on mixed use developments)
  • gross floor area
  • number of parkings
  • floor area ratio

down to perhaps even more subtle features such as:

  • percentage of floor that receives direct sunlight
  • reflectivity of facade
  • contribution to heat island effect
  • building energy consumption footprint
  • weather attributes where the building is located
  • other correlated data that comes from having the building sitting in the same place, exposed to changing weather, land conditions, and socioeconomic trends.

The possibilities for hand-describing features are in fact quite endless, and similar in character to the features defined to tag songs (ala The Music Genome Project).

Right now it seems one way to make sense of a building is to hand-label these features based on traits that are familiar to architects (used by architects to describe a building).

Perhaps in time, with a sufficient size of the dataset to zoom out and get a feel for ‘what describes a building’, we can maybe move on up to trying different methods of gleaning features from raw data (photographs or the building, or raw data from sensors in the future of buildings fully connected with the cloud)

What can the Dataset Do

Initially, it can be clustered. Many clustering algorithms can be applied to a clean dataset to provide insights that come from merely referencing related buildings.

e.g. what sort of facades work well in this climate? oh here are some similar buildings from similar climates that use the same window detail and product supplier..

e.g. what are the most similar buildings in terms of (architect selects a few features out of the many)

They can also be trained in a regression model (or a simple neural network) to learn what the best features are for a new site, based on everything the dataset knows on all sites.

There are way more. They are an extremely attractive proposition. They are mouth-wateringly low hanging fruit.

We just need a large enough dataset. Wouldn’t it be nice if architecture firms started sharing data with the world?

Continue reading “Finding correlations in building data”

Designing a Prefab House System

Recently came across an old script from last year, and thought it would be nice to see if i I could still read it (disclaimer : I couldn’t. the definition was so atrocious that I had a headache just trying to understand what goes where)

This idea was a long time coming. I had been mulling about building an entire building, down to every last detail, from scratch with grasshopper, and thus allowing everything to be procedural (meaning: driven by numbers). This project was a first attempt at doing just that.

 

Step 1 : input how many boxes you want to use to make your house.

prefab6

Step 2 : place points in the boxes where you want a floor, and place arrows in the boxes where you want a staircase. draw rectangles in boxes where you want a skylight.

Step 3 :  Get building.

 

prefab1

Optional Step 1 : draw some door details to tell it how you want it to be done.

prefab2

Optional Step 2 : change the angle of your roof and skylights to your liking.prefab3

Optional Step 3 : change the column thicknesses to your liking. boring stuff like how the ends meet at corners are solved for you.

prefab4