Software Geek

March 23, 2008

When Will Foreign Ownership of US Sports Teams Start ?

Filed under: Software

Also see: Publishing: Good reviews, bad reviews, and hurting oooh so many feelings.

For a while there, it looked like North American sports teams owners were going to take over European Soccer. The biggest Premiere League names were getting bought up. Then a funny thing happened. The US Dollar turned upside down against major currencies making deals that once looked tenable, all of the sudden seem very, very expensive.

But as is the nature of currency exchange, for every Yin, there is a Yang, or in this case an Abramovich or any number of wealthy Europeans or Russians who are coming to the US in search of bargains. Of course there are also the exploding number of Chinese Billionaires with global aspirations as well.

A quick trip to NYC to shop for currency induced bargains need not stop on 5th or Madison Ave. It is just a matter of time, and maybe not much of it, before we start to see our sports teams gobbled up. With the international
flavor of both the NHL and NBA, is there a better way to “mainstream” a person, product or service into the US than through the purchase of a sports franchise ?

With the lack of Salary Cap of MLB, why couldn’t or wouldn’t an ultra Wealthy (as in guys or girls who make me look poor) Sports Fan take advantage of the fall in the value of the dollar and come in and buy an Iconic or even mid market franchise and spend spend spend ?

With the price of NFL franchises now past a billion dollars with half the Dolphins apparently selling for more than 550mm, how many individuals in this country that don’t already own a franchise actu (more…)

Playing Multiple Simultaneous Sounds in WPF

Filed under: Software

Also see: Language parsing and compiler design doesn’t have to be hard, but boy this book really sucks!

WPF’s MediaElement makes simple media playback pretty straightforward, but moving beyond the simple scenarios can sometimes raise surprising challenges. For example, I recently saw someone tripped up by the MediaElement when attempting to play several sounds concurrently.

As you’ll see, one solution would have been to use MediaPlayer instead of MediaElement. The difference between these WPF classes is fairly straightforward. MediaPlayer is the class that knows how to play media files – both video and audio. MediaElement is a wrapper around MediaPlayer that provides a simple way to connect it into a visual tree (i.e. a user interface), which in turn lets us hook it into things like the animation system or event triggers.

(Note: do not be misled by the class name. Although WPF and Windows Media Player depend on the same infrastructure for media decoding, the MediaPlayer class is not a wrapper around the Windows Media Player control. While they share codecs, the path by which decoded video gets onto the screen in WPF is significantly different from Windows Media Player.)

How would that get you into trouble when using MediaElement? If it’s a wrapper around MediaPlayer, surely you could use a MediaElement any place a MediaPlayer would work? In fact it’s not always that simple. To see why, we’ll start with a simple example.

One MediaElement

(more…)

CERT C Secure Coding Standard

Filed under: Software

From SC-L :

We would like to invite the community to review and comment on the current version of the CERT C Secure Coding Standard available online at www.securecoding.cert.org before Version 1.0 is published.

Hey, maybe this is also relevant for the curriculum thread.


http://lambda-the-ultimate.org/node/2733

A Quick Fix for the Validator SetFocusOnError Bug

Filed under: Software
The ASP.NET validators have this nice property called “SetFocusOnError” that is supposed to set the focus to the first control that failed validation. This all works great until your validator control is inside a naming container. I ran into this recently when using validators in a DetailsView. Take this simple example:
<%@ Page Language=”C#” %>
<script runat=”server”>
 protected void Page_Load(object sender, EventArgs e)
 {
 if (!IsPostBack)
 DataBind();
 }
</script>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head runat=”server”>
 <title></title>
</head>
<body>
<form id=”_frm” runat=”server”>
 <asp:DetailsView
 ID=”dv1″
 DefaultMode=”Edit”
 DataSource=’<%# new object[1] %>’
 runat=”server”
 >
 <Fields>
 <asp:TemplateField HeaderText=”First Name:”>
 <EditItemTemplate>
 <asp:TextBox ID=”FirstNameTextBox” runat=”server” />
 <asp:RequiredFieldValidator
 ID=”FirstNameValidator1″
 ControlToValidate=”FirstNameTextBox”
 ErrorMessage=”First name is required.”
 Display=”Dynamic”
 EnableClientScript=”false”
 SetFocusOnError=”true”
 ValidationGroup=”bug”
 Text=”*”
 runat=”server”
 />
 </EditItemTemplate>
 </asp:TemplateField>
 </Fields>
 <FooterTemplate>
 <asp:ValidationSummary
 ID=”vs1″
 DisplayMode=”List”
 ValidationGroup=”bug”
 runat=”server”
 />
 <asp:Button
 ID=”Button1″
 Text=”Post Back”
 ValidationGroup=”bug”
 runat=”server”
 />
 </FooterTemplate>
 </asp:DetailsView>
</form>
</body>
</html>

If you run this page and do a view source you’ll see that the FirstNameTextBox gets rendered like this:
(more…)

From C# to Java: Part 5

Filed under: Software

Also see: Mix 08 Sessions Published

In the transition from C# 1.0 to C# 2.0, they added
generics.  This was an enormous improvement.  Huge.

(At first I was actually kind of skeptical of generics. 
They reminded me of C++ templates, the use of which I had opposed on several
occasions.  But my 1993 reasons for advocacy against C++ templates really
weren’t relevant to the C# generics in 2005.)

So when I started my recent exploration of Java, one of my
main questions was:  Are the generics in Java 1.5 similar to generics in C#
2.0?

The answer:  Sort of.  Not really.

To be fair, I’ll admit right up front that Java generics are
better than no generics.  I’m using them.  They work just fine in practice for
most situations.

But they’re fundamentally different from C# generics.  In
C#, a generic is implemented at the CLR level.  When you instantiate a
List<T>, at runtime it will generate an implementation of a List which is
specifically for type T.

When TPTB added generics to Java, one of their goals was to
avoid the need for any changes to the VM.  So Java’s generics are implemented
at the compiler level using a technique called “type erasure”.  Basically, the
Java compiler does all the necessary type checking, but then it throws the
parameterized type information away and generates regular collection code. 
This has a few consequences which are rather unfortunate:

  • Since the parameterized type is no longer present in the
    bytecode, reflection doesn’t show it.

  • The compiler inserts all the casts that you would have had
    to write if you were using the non-generic collection class directly.

  • In a generic collection of a primitive type, the
    parameterized type gets boxed.

(more…)

Get free blog up and running in minutes with Blogsome
Theme designed by Jay of onefinejay.com