Posts

Showing posts with the label programming

Uber's Michelangelo vs. Netflix's Metaflow

  Uber's Michelangelo vs. Netflix's Metaflow Michelangelo Pain point Without michelangelo, each team at uber that uses ML (that’s all of them - every interaction with the ride or eats app involves ML) would need to build their own data pipelines, feature stores, training clusters, model storage, etc.  It would take each team copious amounts of time to maintain and improve their systems, and common patterns/best practices would be hard to learn.  In addition, the highest priority use cases (business critical, e.g. rider/driver matching) would themselves need to ensure they have enough compute/storage/engineering resources to operate (outages, scale peaks, etc.), which would results in organizational complexity and constant prioritization battles between managers/directors/etc. Solution Michelangelo provides a single platform that makes the most common and most business critical ML use cases simple and intuitive for builders to use, while still allowing self-serve extensibi...

Notes on Effective Java 2nd Edition

Chapter 3 - Methods Common to All Objects   Item 8 : Obey the general congract when overriding equals - page 33 If you decide to implement equals, make sure it is reflexive: for all x, x.equals(x) symmetric: for all x & y, x.equals(y) iff y.equals(x) transitive: for all x, y, z, if x.equals(y) and y.equals(z), then x.equals(z) must be true consistent: for all x & y, multiple invocations of x.equals(y) return the same result provided nothing used in equality is changed in either x or y for all x, x.equals(null) must return false Item 9 : Always override hashCode when you override equals Item 10 : Always override toString Item 11 : Override clone judiciously Item 12 : Consider implementing Comparable Chapter 4 - Classes and Interfaces   Item 13 : Minimize the accessibility of classes and members accessibilities private package-private (default) protected public classes with public mutable fields are not thread-safe Item 14 : In public cla...

Adapter Design Pattern

The adapter pattern is an extremely useful pattern for a few reasons. The reason I like it so much is because if you understand it, then you understand the concept of Dependency Inversion (the "D" in SOLID object-oriented design). Dependency Inversion is an object-oriented principle which states that in code, higher level modules should not depend on lower level modules. Instead, lower level modules should depend on higher level ones. Let's say you've got one higher level object that requires a lower level object to do it's job. But the lower-level object is likely to change or be swapped out for another. Here's the bad way to do it: namespace HigherLevelModule { public class HigherLevelObject { ...... public void Run() { LowerLevelObject obj = new LowerLevelObject(); string result = obj.GetSomething(); Console.WriteLine(result); } } } namespace LowerLevelMod...

Command Design Pattern

Image
The command pattern is best used when you have a command that must be executed by one object, while another object has the responsibility of deciding WHEN that command will be executed. The three entities associated with the command pattern are: client : the object that CREATES the command object and assigns it's receiver receiver : the object that HAS the method that will be run invoker : the object that DECIDES WHEN the command will be run Now let's look at an example. You have an IDE, and the 'undo' command is extremely important. Every action that is performed on the IDE has a method called undo() on it. But the actions have to be stored somewhere after they perform their task though, so that it's possible to call the undo() methods later, right? The solution is to push each action onto a stack when it's run, and register a listener for the 'undo' keyboard-combination/menu-item. The listener will pop() the stack, and invoke the popped ac...

Factory Design Pattern

Image
The factory pattern is used when you want to separate the creation of objects from where they'll be used. For example, say you have one object that must get a Triangle object and draw it on screen. It doesn't care about what the triangle's state is, just that it has a void Draw() method. Suppose further that you have many types of triangles, and they can all be 'drawn' onscreen. In order to separate the creation of triangle objects from the caller, we would use the Factory Design Pattern: 1.) Create an interface called ITriangle, with one method : void Draw() 2.) Have all types of Triangle implement ITriangle. 3.) Create an interface called ITriangleFactory with 1 method: ITriangle GetTriangle() 4.) Create a concrete 'factory' class for each type of Triangle, each of which implements ITriangleFactory, and returns a new instance of their respective triangle in their implementations of GetTriangle()...since each Triangle type implements ITriangle, ...

TryRuby today!

Evening code fans. I'm making some progress on a software system that I'm building at work, and I've started to enjoy the process of finding a problem, creating a solution, and writing code to represent what I've come up with. But now I wanna try something new... I've been hearing a lot about Ruby on Rails in recent times, and I'm highly interested in it at this point. For those of you who don't know, Ruby is an object oriented programming language, but it's different from Java and C# in that it's a scripting language, so it doesn't get compiled down to machine code before it's run. "Rails" is a framework written for the Ruby language that makes it ridiculously easy to create websites in a Model-View-Controller sorta way. Just to get a basic web server up and running requires only 2 super simple commands on the command line! A Rails webpage differs from ASP.NET MVC (the stuff I'm using at work) in that it doesn't r...

Adobe Flex 3.0 - Passing parameters to event listeners - actionscript

So I just started this job, and I'm writing an application that lets users view photos and tag them, giving descriptions of the tags as well.  I was trying to add an event listener to a Text object, when I realized there was no way to add a parameter to it!  Because the addEventListener function goes like this: var itemToPass:Object; textObject.addEventListener(MouseEvent.MOUSE_OVER, callbackListenerFunction); there was no way to pass a parameter, except for the event object, which is passed automatically.  Of course you could use an anonymous function for the callback, like this: var itemToPass:Object; textObject.addEventListener(MouseEvent.MOUSE_OVER, function(event:Event):void {     callbackListenerFunction(itemToPass); }); And this will work in many cases.  But the underlying problem is still there!  You see, if you change the value of itemToPass later on in the current code block, then the value that's passed into callbackListenerFunct...