Failed the Turing Test
Exploring the science, art, and craft of software development
Wednesday, August 21, 2019
Functional Program Design in Scala
The second class in the Scala specialization down. I was a little put off by the fact that this is basically a retooled/abridged version of the "Functional Reactive Programming" class, which made it feel incomplete. Regardless, the programming exercises were fun, if a bit lightweight. The lecture material was ... meh.
My solutions on Github: FunctionalProgramDesignScala
Wednesday, July 24, 2019
How to install OpenToonz and Synfig on a Chromebook
Backstory
I've wanted to dabble in digital art for some time now, and I finally got up the motivation to play around with it a bit on my dinosaur laptop. My 8 year old was showing some interest in drawing, and I thought she might have fun doing animation, so I started looking around for animation software. I found several programs, including opentoonz, synfig, and pencil2d. While she was immediately fascinated (and almost just a quickly lost interest), I was annoyed by how difficult it was to try to draw anything with a mouse.
Not long ago we had replaced my wife's aging Lenovo Twist with a Lenovo C330 Chromebook. For under $250 it was quite adequate for her needs. Being that it was a touch screen device, I thought it might be better suited for digital art, so I began looking into whether the programs I'd installed in Ubuntu could be used on it. There wasn't a Chromebook version, per se (boo), but it turns out that Chromebooks can now run Linux apps (yay!), but only if they have a version for ARM processors (boo). "Welp," I thought, "guess I'll just have to see about building from source." How hard could that be, right?
For any non-techies who just want this to work, don't be scared. It's actually pretty straight forward...
Sunday, April 7, 2019
Generating a bigram language model from the Wikipedia corpus
Motivation
While working through the Scala Principles class, the final unit had an example exercise that involved creating a "mnemonic" for a telephone number by mapping the number to an English "phrase". While a fun exercise, I was unsatisfied with the naive generation of mnemonic phrases. Yes, you could get "Scala is fun" for 7225247386, but you also get:
- sack air fun
- pack ah re t
- pack bird to
- Scala ire to
- rack ah re to
- pack air fun
- sack bird to
- rack bird to
- sack ah re to
- rack air fun
... which are decidedly less helpful. I thought that if I could implement even a simplistic language model, like a bigram model, to the options, and then rank them, I could make the output a little more useful. So I went looking for some bigram data, and eventually ran across a Wikipedia corpus on corpusdata.org. The second paragraph points out that prepping the data yourself is hard work and would require many hours, so paying them $295 for it is a steal. Challenge accepted mofos.
Functional Programming Principals in Scala
After a long break (Advanced Algos took a lot out of me), I decided it was time to take another class. When the topic of taking the Scala series of classes from Coursera came up in my programming group, I jumped at the chance. I needed a break from theory, and a chance to do some coding in a new language was just the ticket. This post covers the first course in the series, "Functional Programming Principles in Scala". tl;dr: Take this course, it's great!
Monday, December 10, 2018
Harvard COMPSCI 224 - Advanced Algorithms
For a long time I've been eyeing Jelani Nelson's Advanced Algorithms class. It's taken me a while to convince myself I was prepared to understand the material, and it's taken me even longer to convince myself I had the time to get back into self studying computer science courses. Per my usual MO, I'm supplementing the lectures from Nelson's class with some lectures from MIT on the subject, though those have more of a bootleg feel to them. Hoping it will be quality content nonetheless.
The goals of the course are to look at different ways to analyze algorithms, and use different "models" to think about algorithms.
Harvard COMPSCI 224:
The goals of the course are to look at different ways to analyze algorithms, and use different "models" to think about algorithms.
Harvard COMPSCI 224:
- Fall 2014 Lectures (Jelani Nelson)
- Fall 2014 Website
MIT Advanced Algorithms (6.854):
- Fall 2013 Lectures (David Karger)
- Spring 2016 Lectures (Ankur Moitra)
- Spring 2016 Website
Monday, September 24, 2018
Learning Python
Several months ago I embarked on a project at work that made me question my decisions in life. Well, ok, that's a bit melodramatic. But it definitely made me question my choice of programming languages. I thought I had on my hands a simple, straight forward problem. Loop a couple arrays, can a handful of command line utilities. Oh I know, I'll use shell script (bash)! It was not long before I was asking what I'd gotten myself into.
I was too far in to turn back, and I ended up with a 1000+ line monstrosity over a handful of files. I hated bash... seeing my kludgy attempts at modularity made me want to claw my eyes out. The first few lines of every function were devoted to parsing the parameters. It was an unholy mess, and I knew I needed something better. I knew I needed Python (ironically, I ended up rewriting it in Java, funny how things work out)...
I put together this post to describe my experience with several learning resources I took advantage of.
I was too far in to turn back, and I ended up with a 1000+ line monstrosity over a handful of files. I hated bash... seeing my kludgy attempts at modularity made me want to claw my eyes out. The first few lines of every function were devoted to parsing the parameters. It was an unholy mess, and I knew I needed something better. I knew I needed Python (ironically, I ended up rewriting it in Java, funny how things work out)...
I put together this post to describe my experience with several learning resources I took advantage of.
Tuesday, May 1, 2018
The Command Line as a Gaming Platform: ANSI Graphics and Midi Music
Introduction
Last September (2017) I got the bright idea that it would be fun to make a game for the command line. I wanted it to be graphical, but only using basic text characters (charmap is my good friend). I messed around with it a bit in .NET and posted some experimental code to GitHub, and got as far as generating box drawings based on text files:
Tuesday, March 27, 2018
MIT 6.042 - Mathematics for Computer Science (Incomplete)
Back, oh, probably in September 2017 or so, a couple of MOOC buddies and I decided we wanted to tackle 6.042 together. For my part, I felt that having a better understanding of the underlying principles of proofs would be a huge boon when tackling advanced CS courses that lean on them heavily. Thinking back to 6.006 in particular, when going through CLRS (which is very proof heavy), I think I would have benefited from better fundamentals in this area. So, as is my habit, I'm keeping a log of my experience here; part notes, part stream of consciousness reflection.
We're mostly following the 2015 version of the course, however I really enjoy the 2010 lectures by Tom Leighton, so I'm double dipping a bit there. The most natural way to divide up the coursework is by "week", corresponding to each of the 12 psets. We decided on Overleaf for document creation and collaboration, as we agreed it would be best to suck it up and learn a bit of LaTeX if we wanted to get the full "genuine" experience with the pset "submissions".
Index for 2015 course: link
Discrete Math playlists that were helpful:
We're mostly following the 2015 version of the course, however I really enjoy the 2010 lectures by Tom Leighton, so I'm double dipping a bit there. The most natural way to divide up the coursework is by "week", corresponding to each of the 12 psets. We decided on Overleaf for document creation and collaboration, as we agreed it would be best to suck it up and learn a bit of LaTeX if we wanted to get the full "genuine" experience with the pset "submissions".
Index for 2015 course: link
Discrete Math playlists that were helpful:
- Trefor Bazett - Discrete Mathematics
- Bill Shillito - Introduction to Higher Mathematics
- TheTrevTutor - Discrete Math 1
Friday, January 26, 2018
Microsoft Exam 70-487 Study Guide
Other Study Guides
Tobias Nilsson's Study Guide (Alert Coding)
Chris Myers' Study Guide (Blogged by Chris)
PluralSight Learning Path
Microsoft Exam 70-487
Tobias Nilsson's Study Guide (Alert Coding)
Chris Myers' Study Guide (Blogged by Chris)
PluralSight Learning Path
Microsoft Exam 70-487
Thursday, January 25, 2018
Microsoft 70-487: Secure a Web API
Exam Objectives
Implement HTTPBasic authentication over SSL; implement Windows Auth; prevent cross-site request forgery (XSRF); design, implement, and extend authorization and authentication filters to control access to the application; implement Cross Origin Request Sharing (CORS); implement SSO by using OAuth 2.0; configure multiple authentication modes on a single endpointQuick Overview of Training Materials
Exam Ref 70-487 - Chapter 4.3
[Book] Pro ASP.NET Web API Security
[MSDN] Security, Authentication, and Authorization in ASP.NET Web API
- Basic Authentication in ASP.NET Web API
- Integrated Windows Authentication
- Preventing Cross-Site Request Forgery Attacks in ASP.NET Web API
- Authentication Filters in ASP.NET Web API 2
- Enabling Cross-Origin Requests in ASP.NET Web API 2
- External Authentication Services with ASP.NET Web API (OAuth)
[Video] Dominick Baier - Securing ASP.NET Web APIs
- Sample Code, Slide Deck
[DotNetCurry] Preventing CSRF Hacks in ASP.NET WebAPI
[Blog] A WebAPI Basic Authentication Authorization Filter
[Book] Pro ASP.NET Web API Security
[MSDN] Security, Authentication, and Authorization in ASP.NET Web API
- Basic Authentication in ASP.NET Web API
- Integrated Windows Authentication
- Preventing Cross-Site Request Forgery Attacks in ASP.NET Web API
- Authentication Filters in ASP.NET Web API 2
- Enabling Cross-Origin Requests in ASP.NET Web API 2
- External Authentication Services with ASP.NET Web API (OAuth)
[Video] Dominick Baier - Securing ASP.NET Web APIs
- Sample Code, Slide Deck
[DotNetCurry] Preventing CSRF Hacks in ASP.NET WebAPI
[Blog] A WebAPI Basic Authentication Authorization Filter
[PluralSight] Implementing an API in ASP.NET Web API (Securing APIs)
[PluralSight] Web API v2 Security
Previous posts on ASP.NET security:
Implement a secure site with ASP.NET
Secure a WCF service
Design and implement claims-based authentication
[PluralSight] Web API v2 Security
Previous posts on ASP.NET security:
Implement a secure site with ASP.NET
Secure a WCF service
Design and implement claims-based authentication
Tuesday, January 23, 2018
Microsoft 70-487: Host and manage Web API
Exam Objectives
Host Web API in an ASP.NET app; self-host a Web API in your own process (a Windows service) including Open Web Interface for .NET (OWIN); host services in an Azure worker role; restrict message size; configure the host server for streamingQuick Overview of Training Materials
Exam Ref 70-487 - Chapter 4.4
[MSDN] ASP.NET Web API: Deployment and Hosting
- Use OWIN to Self-Host ASP.NET Web API 2
- Host ASP.NET Web API 2 in an Azure Worker Role
[MSDN] ASP.NET Web API: Deployment and Hosting
- Use OWIN to Self-Host ASP.NET Web API 2
- Host ASP.NET Web API 2 in an Azure Worker Role
[Blog] Dealing with large files in ASP.NET Web API
[Blog] Video streaming inside self-host app with Owin/Katana
[Stack Overflow] How do I configure max message size in Web API
[Blog] Video streaming inside self-host app with Owin/Katana
[Stack Overflow] How do I configure max message size in Web API
Monday, January 22, 2018
Microsoft 70-487: Consume Web API web services
Exam Objectives
Consume Web API services by using HttpClient synchronously and asynchronously; send and receive requests in different formats (JSON/HTML/etc.); request batchingQuick Overview of Training Materials
Exam Ref 70-487 - Chapter 4.5
[MSDN] Calling a Web API From a .NET Client (C#)
[Code-Maze] A few great ways to consume RESTful API in C#
[MSDN] Calling a Web API From a .NET Client (C#)
[Code-Maze] A few great ways to consume RESTful API in C#
[Blog] ASP.NET Web API Request Batching
[Blog] You're using HttpClient wrong and it is destabilizing your software
[StackOverflow] How do you set the Content-Type header for an HttpClient request?
[MSDN] Introducing batch support in Web API and Web API OData
[Blog] You're using HttpClient wrong and it is destabilizing your software
[StackOverflow] How do you set the Content-Type header for an HttpClient request?
[MSDN] Introducing batch support in Web API and Web API OData
Sunday, January 21, 2018
Microsoft 70-487: Implement a Web API
Exam Objectives
Accept data in JSON format (in JavaScript, in an AJAX callback); use content negotiation to deliver different data formats to clients; define actions and parameters to handle data binding; use HttpMessageHandler to process client requests and server responses; implement dependency injection, along with the dependency resolver, to create more flexible applications; implement action filters and exception filters to manage controller execution; implement asynchronous and synchronous actions; implement streaming actions; implement SignalR; test Web API web servicesQuick Overview of Training Materials
Exam Ref 70-487 - Chapter 4.2
[Book] Designing Evolvable Web API's with ASP.NET - Chapter 13 (Model binding)
[MSDN] Web API Documentation:
- JSON and XML Serialization in ASP.NET Web API
- Content Negotiation in ASP.NET Web API
- Parameter Binding in ASP.NET Web API
- HTTP Message Handlers in ASP.NET Web API
- Dependency Injection in ASP.NET Web API 2
- Exception Handling in ASP.NET Web API
- Testing and Debugging ASP.NET Web API
[MSDN] ASP.NET Web API 2: Http Message Lifecycle poster
[Blog] Web API 2 using ActionFilterAttribute ...
[Blog] ASP.NET MVC and Web API - Comparison of Async / Sync Actions
[CodeProject] Web API Thoughts 1 of 3 - Data Streaming
[CSharpCorner] Asynchronous Video Live Streaming with ASP.NET Web APIs 2.0
[Blog] Testing routes in ASP.NET Web API
[Book] Designing Evolvable Web API's with ASP.NET - Chapter 13 (Model binding)
[MSDN] Web API Documentation:
- JSON and XML Serialization in ASP.NET Web API
- Content Negotiation in ASP.NET Web API
- Parameter Binding in ASP.NET Web API
- HTTP Message Handlers in ASP.NET Web API
- Dependency Injection in ASP.NET Web API 2
- Exception Handling in ASP.NET Web API
- Testing and Debugging ASP.NET Web API
[MSDN] ASP.NET Web API 2: Http Message Lifecycle poster
[Blog] Web API 2 using ActionFilterAttribute ...
[Blog] ASP.NET MVC and Web API - Comparison of Async / Sync Actions
[CodeProject] Web API Thoughts 1 of 3 - Data Streaming
[CSharpCorner] Asynchronous Video Live Streaming with ASP.NET Web APIs 2.0
[Blog] Testing routes in ASP.NET Web API
Tuesday, January 16, 2018
"Effective Java" book outline
Effective Java was written by Joshua Bloch in 2001, and the second edition released in 2009 shortly after the release of Java 6. I received a copy of the second edition from my manager as recommended reading. While it was sometimes a little dated, it still made for easy reading, and it felt like most of the recommendations would still be pretty relevant. As it happens, there is now a third edition that covers Java 7, 8, and 9 which may be worth checking out...
Overall I was impressed with the advice given in the book. In order to make better practical use of it, I wanted to create a basic "outline" view that I could easily find and scan, making reference back to the book if needed. That is really all this post is. I thought about adding "notes"... either to each item or to each section, but they just cluttered it up. I want this to be more a quick cheat sheet of the guidelines, not a full blown Readers Digest edition of the book...
Friday, December 29, 2017
Resources for diving into Git internals
One of the things my boss asked me to do before I leave Farm Bureau for the bustling Bay Area was to put together some resources related to using Visual Studio Team Services. One of my co-workers on the database team also asked me to put together some resources for learning git. So, to that end, I pieced together a few things that would make my absence less disruptive.
As part of the process, I ended up uncovering a few presentation that delved pretty deep under the covers. Now, these are lessons that are best consumed by one who is already pretty familiar with git basics, but I think the reward is a deeper, richer understanding of git behavior that can make us more effective with the tool. I'm not going to rehash everything that is in the videos (just watch the videos, they're excellent), I'll just provide a link and a brief synopsis.
As part of the process, I ended up uncovering a few presentation that delved pretty deep under the covers. Now, these are lessons that are best consumed by one who is already pretty familiar with git basics, but I think the reward is a deeper, richer understanding of git behavior that can make us more effective with the tool. I'm not going to rehash everything that is in the videos (just watch the videos, they're excellent), I'll just provide a link and a brief synopsis.
Tuesday, November 7, 2017
Microsoft 70-487: Design a Web API
Exam Objectives
Define HTTP resources with HTTP actions; plan appropriate URI space, and map URI space using routing; choose appropriate HTTP method (get, put, post, delete) to meet requirements; choose appropriate format (Web API formats) for responses to meet requirements; plan when to make HTTP actions asynchronous; design and implement routesQuick Overview of Training Materials
Exam Ref 70-487 - Chapter 4.1
[Blog] Using HTTP Methods (GET, POST, PUT, etc.) in Web API
[Apigee] Web API Design: Crafting Interfaces that Developers Love
[HackerNoon] RESTful API Designing guidelines — The best practices
[MSDN] Web API Routing
[Blog] Using HTTP Methods (GET, POST, PUT, etc.) in Web API
[Apigee] Web API Design: Crafting Interfaces that Developers Love
[HackerNoon] RESTful API Designing guidelines — The best practices
[MSDN] Web API Routing
[MSDN] Media Formatters in ASP.NET Web API 2
[MSDN] REST URI Support in Web API - Converting UriTemplates to Routes
[PluralSight] Implementing an API in ASP.NET Web API
[Blog] ASP.NET MVC and Web API - Comparison of Async / Sync Actions
[MSDN] REST URI Support in Web API - Converting UriTemplates to Routes
[PluralSight] Implementing an API in ASP.NET Web API
[Blog] ASP.NET MVC and Web API - Comparison of Async / Sync Actions
Tuesday, October 31, 2017
Microsoft 70-487: Choose a deployment strategy for an Azure web application
Exam Objectives
Perform an in-place upgrade and VIP swap; configure an upgrade domain; create and configure input and internal endpoints; specify operating system configuration; deploy applications using Azure Web SiteQuick Overview of Training Materials
Exam Ref 70-487 - Chapter 5.2
[MSDN] How to update a cloud service
[MSDN] How to manage cloud services
[Blog] What is Windows Azure Fault Domain and Upgrade Domain?
[MSDN] Set up staging environments in Azure App Service
[PluralSight] Windows Azure Web Sites
[GitHub] Publish to Azure using Web Deploy
[MSDN] How to update a cloud service
[MSDN] How to manage cloud services
[Blog] What is Windows Azure Fault Domain and Upgrade Domain?
[MSDN] Set up staging environments in Azure App Service
[PluralSight] Windows Azure Web Sites
[GitHub] Publish to Azure using Web Deploy
[GitHub] Setting up a VSTS account so it can deploy to a Web App
[MSDN] Azure Exam Prep – Fault Domains and Update Domains
[MSDN] Enable communication for role instances in azure
[MSDN] Azure Guest OS releases and SDK compatibility matrix
[MSDN] Deploy your app to Azure App Service using FTP/S
[MSDN] Azure Exam Prep – Fault Domains and Update Domains
[MSDN] Enable communication for role instances in azure
[MSDN] Azure Guest OS releases and SDK compatibility matrix
[MSDN] Deploy your app to Azure App Service using FTP/S
Monday, October 23, 2017
Microsoft 70-487: Create, configure, and publish a web package
Exam Objectives
Quick Overview of Training Materials
Exam Ref 70-487 - Chapter 5.5
[MSDN] Web Packaging: Creating web packages using MSBuild
[MSDN] Building and Packaging Web Application Projects (pre-VS2013)
[MSDN] Web Deployment Overview for Visual Studio and ASP.NET
[MSDN] How to: Edit Deployment Settings in Publish Profile
[Blog] How to build and deploy a web deployment package using MSBuild
[MSDN] Web Deployment Operation
[MSDN] Web Deployment runCommand Provider
[MSDN] Excluding Files and Folders from Deployment
[MSDN] Web Packaging: Creating web packages using MSBuild
[MSDN] Building and Packaging Web Application Projects (pre-VS2013)
[MSDN] Web Deployment Overview for Visual Studio and ASP.NET
[MSDN] How to: Edit Deployment Settings in Publish Profile
[Blog] How to build and deploy a web deployment package using MSBuild
[MSDN] Web Deployment Operation
[MSDN] Web Deployment runCommand Provider
[MSDN] Excluding Files and Folders from Deployment
Friday, October 20, 2017
Microsoft 70-487: Configure a web application for deployment
Exam Objectives
Switch from production/release mode to debug mode; use SetParameters to set up an IIS app pool; set permissions and passwords; enable and monitor ASP.NET App Suspend; configure WCF endpoints (including HTTPS protocol mapping), bindings, and behaviors; transform web.config by using XSLT (for example, across development, test, and production/release environments); configure Azure configuration settingsQuick Overview of Training Materials
Exam Ref 70-487 - Chapter 5.3
[MSDN] How to: Set Debug and Release Configurations
[MSDN] Understanding Build Configurations
[MSDN] Configuring Parameters for Web Package Deployment
[MSDN] Web Deploy Parameterization
[TechNet] Using declareParam and setParam
[Blog] MSDeploy with Declare and Set parameter files
[MSDN] Configuring Permissions for Team Build Deployment
[MSDN] Basic Security Practices for Web Applications
[MSDN] Best practices for deploying passwords
[Blog] Davidson Sousa - Setting folder permissions using Web Deploy
[Blog] Sayed Hashimi - Setting Folder Permissions on Web Publish
[Blog] Kevin Leetham - Modifying directory permissions with Web Deployment
[MSDN] Enable and monitor ASP.NET App Suspend on Windows Server 2012 R2
[MSDN] ASP.NET App Suspend – responsive shared .NET web hosting
[MSDN] How to: Transform Web.config When Deploying a Web Application Project
[MSDN] Web.config Transformation Syntax for Web Project Deployment
[GitHub] Xdt transform samples
[MSDN] Configure web apps in Azure App Service
[MSDN] Configure Azure cloud service roles with Visual Studio
[MSDN] How to: Set Debug and Release Configurations
[MSDN] Understanding Build Configurations
[MSDN] Configuring Parameters for Web Package Deployment
[MSDN] Web Deploy Parameterization
[TechNet] Using declareParam and setParam
[Blog] MSDeploy with Declare and Set parameter files
[MSDN] Configuring Permissions for Team Build Deployment
[MSDN] Basic Security Practices for Web Applications
[MSDN] Best practices for deploying passwords
[Blog] Davidson Sousa - Setting folder permissions using Web Deploy
[Blog] Sayed Hashimi - Setting Folder Permissions on Web Publish
[Blog] Kevin Leetham - Modifying directory permissions with Web Deployment
[MSDN] Enable and monitor ASP.NET App Suspend on Windows Server 2012 R2
[MSDN] ASP.NET App Suspend – responsive shared .NET web hosting
[MSDN] How to: Transform Web.config When Deploying a Web Application Project
[MSDN] Web.config Transformation Syntax for Web Project Deployment
[GitHub] Xdt transform samples
[MSDN] Configure web apps in Azure App Service
[MSDN] Configure Azure cloud service roles with Visual Studio
Tuesday, October 10, 2017
Microsoft 70-487: Design a deployment strategy
Exam Objectives
Create an IIS install package; deploy to web farms; deploy a web application by using XCopy; automate a deployment from TFS or Build ServerQuick Overview of Training Materials
Exam Ref 70-487 - Chapter 5.1
[MSDN] How to: Create a Web Deployment Package in Visual Studio
[MSDN] Using Web Deploy for Web Farms (2009)
[MSDN] Deploy an Application to a Web Farm
[MSDN] How to: Create a Web Deployment Package in Visual Studio
[MSDN] Using Web Deploy for Web Farms (2009)
[MSDN] Deploy an Application to a Web Farm
[MSDN] Introducing the Microsoft Web Farm Framework
[MSDN] Xcopy
[MSDN] Walkthrough: Deploying an ASP.NET Web Application Using XCOPY
[MSDN] How to: Create an Automated Build and Deployment Solution with TFS
[MSDN] Build and Deployment Automation Case Study
[Blog] Using Windows Azure VMs to Publish and Synchronize a Web Farm
[MSDN] Xcopy
[MSDN] Walkthrough: Deploying an ASP.NET Web Application Using XCOPY
[MSDN] How to: Create an Automated Build and Deployment Solution with TFS
[MSDN] Build and Deployment Automation Case Study
[Blog] Using Windows Azure VMs to Publish and Synchronize a Web Farm
Subscribe to:
Posts (Atom)