Lazycoder

23Nov/09Off

Why should I care about Big-IP 10.1?

 

Big-IP 10.1 has been released announced. It includes a lot of new features and enhancements to some existing features.

You can read some of the press releases on our main news page:

F5 Delivers Advanced Web Security Solutions to Help Customers Efficiently Address Threats to Web Applications and Enhance Business Performance

F5′s BIG-IP Solution Enables Service Providers to Transparently Scale and Grow Mobile Services

F5 Enhances IP Geolocation Capability through Partnership with Quova

F5 Solutions Optimize Microsoft Windows 7 and Windows Server 2008 R2 Deployments

 

Enhanced support for Windows 7 and Windows Server 2008 R2.

Direct Access and BranchCache

Microsoft DirectAccess lets Windows 7 clients create a secure connection directly to the network over IPsec rather than having to create a separate VPN connection. That means that you can still access your files securely while you are enjoying coffee and a scone at Starbuck Joe wrote a great article addressing how Big-IP 10.1 helps enable DirectAccess using Windows 7 clients with Windows Server 2008 R2 servers in your enterprise. BranchCache is a new feature in Windows 7 and Windows Server 2008 R2 that will cache content from remote servers on local servers. You can access the file once it is cached as if you were working in the remote office, using less WAN bandwidth and wasting less of your time. BranchCache can work in one of two modes: Hosted cache mode and Distributed Cache mode. In hosted mode, a Windows Server 2008 R2 server will host the cached content. In Distributed mode the clients will host the cached content. Big-IP v10.1 will route the file requests to the correct server or client.

 

Security

DNSSEC

Lori wrote a great post about what DNSSEC is and how it works, “It’s DNSSEC Not DNSSUX”, and Jason posted an article explaining how to configure the new DNS features using both the GUI and TMSH. Configuring GTM Version 10.1′s DNS Security Extensions

Advanced bot and scanner protection

Big-IP 10.1 includes support for detecting web site scraping and allows you to set thresholds for locking out IP addresses.

Enhanced reporting

ASM’s new Attack Expert System helps make sense of the attacks you see logged against your network. Each attack has a list of possible attack types and the types are explained. The reporting GUI has been reworked. You can either view a chart or drill down into the attacks with a few clicks. Ten-Point-One also includes a PCI compliance report.

 

Look for some more information about some of these features in the coming months.

 

(edited for clarity SCK)

23Nov/099

Pros don’t make do

I had a locksmith come out to replace a doorknob that had gone bad. It had gradually gotten hard and harder to turn and finally the bolt got stuck inside the door. Which meant the only thing keeping the door shut was the deadbolt. I had replaced doorknobs before, but this one had a non-standard length and strike plate so I didn’t want to mess with it. The thing that struck me while watching him work is that he never had to try and force a tool to do something it wasn’t designed to do. He always had the correct tool and it worked exactly the way he expected it to. mikeg-longtermfixHe never tried to screw in a Phillips head screw using a knife blade or a flat head screwdriver. He didn’t have to duct tape anything

I have a small battery powered Dremel rotary tool. It works for very small jobs. There have been a couple of times when I’ve had to push it way beyond it’s limit, including once when I needed to make the opening on a door jam for a strike plate a little wider. It took me forever. I had to charge the battery twice and broke a bit before I finally had enough room, but just barely enough room. Contrast that with the locksmith who had to do the exact same thing. He pulled out a much larger Dremel that plugged into the wall. Where it took me almost 45 minutes to rout out the door jam, he took about 2 minutes with his much more powerful tool. I could have stopped, went to the store, and bought a more powerful tool and gotten the job done much faster. But I thought that this tool would do the trick and going to the store would have cost me some resources, it might have taken a little longer. I’d have to learn how to use the new tool. Get a new bit. But overall, it probably would have saved me some time in the future and probably would have saved me some time on that project. I could definitely find other uses for the new tool.

Think about that the next time you reject a new programming tool because you think it might take too long to learn or it’s different. Instead of doing the hacky way you KNOW will work, check to see if there is a more elegant or permanent solution.  Because if you aren’t careful, your cheap and easy workaround might end up sticking around in the project long enough for it to become a problem to you.

Filed under: General 9 Comments
22Nov/09Off

Herding Code 64: Phil Haack on MVC 2

The guys grill Phil on ASP.NET MVC2, and introduce a new segment: Abusive Questions From Twitter! Phil starts with the new <%: code block syntax, IHtmlString, HtmlString, MvcHtmlString Jon asks about DisplayFor, EditorFor improvements Phil discusses validation improvements – validation extensibility and client-side validation MVC 2 is built on .NET 3.5 SP1 Phil talks about [...]

17Nov/0913

We need a language for programmers

Here is a great rant about “modern” programming languages.

And so for 20 years now these folks —
*the* shining lights, in many ways, of “practical” programming
language, operating systems, and general systems research — have
continued to fail to “get” the fundamental practical needs of everyday
programmers working in The Real World. “Go” is just another language
written first for the compiler and only secondarily for the programmer
— and stuck in a 70s mindset* about the relationship of that
programmer to the (digital) world within which they live and work!
(But hey, it compiles fast! Which is, of course, THE problem that
really needs addressing.)

He then goes on to talk about some aspects of languages that frustrate him.

J.H.C, folks, it’s nearly 2010. Let’s get a few things straight:

– most programming involves schlepping a few but complex data types
between different string representations
– programmers have become plumbers and documentation-archaeologists
mostly, which is sad and uninteresting
– programming languages are for *programmers* — not compilers and
compiler-writers
– until you make the everyday, “simple” things simple, it will
continue to be a dark art practiced by fewer and fewer
– any language that makes you explicitly import an IO module to
read a file or stdin is fucked
– declarations are a pointless anachronism (same for explicit
memory management)
– if I have to understand category theory to write a program that
does IO, IT IS A NON STARTER!
– less stupid line-noise syntax and punctuation, people

I don’t understand why the need to compile fast is such a big deal. If your programming language makes you write so much code that it takes more than a few seconds to compile, you should probably look at using a different language. Here are some things that I’d like to see in a programming language that is designed for programmers rather than compilers or computers.

1) No typing – That’s not to say that I can’t declare my own types, classes, objects, etc… But that calls to objects should be type independent. (e.g. messaging and dynamic dispatch)

2) Built in unit testing – I should be able to declare contracts on the methods and pass/fail criteria. The tests should be run as part of the compile step or interpretation (if the language is compiled or interpreted)

3) Jellybeans

4) Automatic inclusion of libraries based on path and usage. – I don’t mind having to pull in a library to do file I/O or consume some other kind of data like ATOM or JSON. But at compile time, if I have referenced any of the objects contained in the library, all of the references to the library should be handled for me automatically. Any name collisions should be compiler warnings so I can specify which library to use by in my code or make the reference explicit in some other way. I like Pythons path based module convention, the language should just search the child directories for a library if the library isn’t already included in the base language pack.

5) Anytime a design pattern emerges, it should be re-factored into the language itself.

6) It should be a pocket language, have a set of keywords and syntax that is small and compact but still understandable. JavaScript and C are good examples of pocket languages. It’s easy to pick up the syntax.

I’m sure there’s more that I would add. What kinds of features would you like to see in a language oriented towards programmers rather than compilers?

Filed under: General, Languages 13 Comments
5Nov/09Off

Why should I care about the hardware?

I’m not a network engineer. I just build the applications, the network professionals take care of deploying my applications and making sure they stay up. Why should I care about what hardware they use?

 

Because the hardware they use could influence my application architecture.

  • If I know the IT guys are able to bring in new servers in response to increased demand, I start to think about distributed caching instead of replication maybe. I start to think that the application shouldn’t store any data in a machine specific session so that the load balancer can send the user to any machine.
  • If they have access to distributed hardware caching, maybe I don’t have to worry about donut caching in my pages.
  • If I know they can pull servers in and out of the clusters at will with no visible downtime to our users, I start to think about deploying more often. I can become more agile.
  • If I don’t have to worry about how much space is left where I’m storing my users uploads, I don’t have to write code to check how much space is available and present an error to my users if the space fills up.

 

One of my goals with my F5 Devcentral blog is to explore ways that developers and IT professionals can cooperate more and blur the lines between them a bit more.

3Nov/0910

Dependency Injection and Inversion of Control are not rocket surgery

I see a lot of people talking about how “advanced” techniques like dependency injection and inversion of control are and how their team won’t understand either technique.

 

Folks, this isn’t hard. In fact, both of these things are so simple I simply call it “using the programming language”.

 

Let’s look at dependency injection.

C#:
  1. public class MyClass
  2.     {
  3.         private DataTableReader _reader;
  4.         public MyClass()
  5.         {
  6.             _reader = new DataTableReader(new DataTable());
  7.         }
  8.         private void DoStuffWithTheReader()
  9.         {
  10.             while (_reader.Read())
  11.             {
  12.                 //do fun stuff with the reader.
  13.             }
  14.         }
  15.     }

See the reader variable? That's a dependency. You have to have it in there to do fun things later on. But we have to create it ourselves, which is one more thing that we have to do in our class constructor. In reality we also have to populate the DataTable. So what if we make the reader variable constructor parameter so that another class can do the work of creating the DataTable and the reader?

C#:
  1. public class MyClass
  2.     {
  3.         private DataTableReader _reader;
  4.         public MyClass(DataTableReader dataTableReader)
  5.         {
  6.             _reader = dataTableReader;
  7.         }
  8.         private void DoStuffWithTheReader()
  9.         {
  10.             while (_reader.Read())
  11.             {
  12.                 //do fun stuff with the reader.
  13.             }
  14.         }
  15.     }

There, that's better. Now our class doesn't have to worry about creating the reader and the DataTable. This, in a nutshell, is dependency injection. It's not very complicated is it? We've made our class construction a little simpler and if we want to unit test this, we don't have to do any complicated mocking, we can just new up our own DataTableReader instance and populate it with whatever test data we want. If you run into any funny looking data in the DoStuffWithTheReader method, you know that you don't have to look in this class at all to see where the funny data is coming from, only in whatever method is creating this class and passing in the DataTableReader.

Now is there anyone who thinks that developers on their team would have trouble understanding passing in a parameter? Should they really be a developer if they do?
Honestly, it's not that hard.

Ok, so let's look at inversion of control. The original definition of inversion of control I read was by Martin Fowler:

There's a big difference now in the flow of control between these programs - in particular the control of when the process_name and process_quest methods are called. In the command line form I control when these methods are called, but in the window example I don't. Instead I hand control over to the windowing system (with the Tk.mainloop command). It then decides when to call my methods, based on the bindings I made when creating the form. The control is inverted - it calls me rather me calling the framework. This phenomenon is Inversion of Control (also known as the Hollywood Principle - "Don't call us, we'll call you").

If you look at the previous example, you'll see that we have already inverted the control a bit just by using dependency injection. But the class still has a degree of control over WHAT concrete object is created, in this case a DataTableReader. What if we need to switch over to a SqlDataReader or an OleDbDataReader? Well, we could create three other classes that all take the specific type of data reader we might want to use. But that's a bad idea, you end up with the same logic spread all over the place. Instead we can use the IDataReader interface that all three classes implement.

C#:
  1. public class MyClass
  2.     {
  3.         private IDataReader _reader;
  4.  
  5.         public MyClass(IDataReader dataTableReader)
  6.         {
  7.             _reader = dataTableReader;
  8.         }
  9.         private void DoStuffWithTheReader()
  10.         {
  11.             while (_reader.Read())
  12.             {
  13.                 //do fun stuff with the reader.
  14.             }
  15.         }
  16.     }

Now our class not only doesn't have to worry about creating the DataTableReader, it doesn't even really care if it gets a DataTableReader at all. All it cares about is that the reader is referencing something that implements the IDataReader interface. This is a type of inversion of control. Most of the time people get confused between inversion of control and a container that enables inversion of control and dependency injection (like Ninject, StructureMap or Unity). You don't have to use a container to utilize these two techniques, it just makes it a little easier.

update:Also check out this great post "It’s all about the delivery"

update: I mistakingly thought it was hard to do D.I. in Python due to the inheritance mechanism in Python. Turns out, it's just as easy.

PYTHON:
  1. class MyClass():
  2.  
  3.     def __init__(self, dataTableReader):
  4.         self._reader = dataTableReader
  5.        
  6.     def DoStuffWithTheReader(self):
  7.         while(self._reader.Read()):
  8.             #Do Fun Stuff with the reader.
  9.             print(self._reader.item)