Sunday, August 2, 2009

The Internets 10 Most Annoying Website Features

How many times have you visited a site and thought, “oh, here we go again, what the hell?”

Popup menus invading your personal space; site streakers and digital flashers exposing themselves asking for intimate details about your personal life; and oh yeah, ads splatters about like graffiti showing up in places your mother would be embarrassed to mention.

Yeah, it drives people batty. So for a moment, I’m going to play user advocate and point out 10 violations that are simply insane…

1. Vibrant Pop up Links
What is it – Pop up box generated by mousing over key words in content areas. Usually represented by double or single dashed underlines meant to draw the user attention to key word.
Where it came from - OK I understand the concept of this technology. Some marketing executive sitting on an airplane toilet reading an article about per click revenue got an idea. It went something like this “Hey I know, we can scan keyword in a web page that will pop-up a box to drive per-click revenue.” Next things you know, the software guys are in the back room with pitch forks in hand and Malakoff cocktail at the ready. They’re on the prowl for anyone that even looks like a marketing type. After cooler heads prevail, like Houdini appearing out of thin air, “PURE FRUSTRATION IS BORN” in the form of this “STUPID” little widget. How the user see it – Simply stupid, like we’re not inundated with enough advertisements. Now our precious 48 seconds scanning an article has been simply ruined. As if there isn’t enough cunning ways to get clicks. Like I say this technology is simply “STUPID”.
Vibrant Popup
2. Yahoo Mail and Weather Expanders
What is it – A sliding panel that shifts either up or down or left to right exposing our intimate email details or weather or whatever else they can come up with.
Where it came from – Real estate is valuable, even in the virtual world. In an effort to conserve on real estate thus “be frugal”. Yet, frugal to the point that user will be driven batty by features. The funny thing, the problem is not with the widget but how it’s implemented. Mousing over scrolling text and pictures are just simply annoying and confuse the heck out of users. It’s like sitting on a whoopee cushion, “wow, what was that”. How the users see it – This is what I call, “what the hell, I didn’t ask for that”. Simple, I appreciate the weather “cool” but I don’t want the details. Kill the details, I know it hot, I live in Texas. Oh by the way, I’ll pick up my mail when I’m good and ready too. Thanks, but no thanks.
Yahoo Expanders
3. Skip this Ad
What is it – When the user clicks a link to a follow on page, instead of delivering the content; Straight out machine gun Kelly pop in a cap! 187, another advertiser on user drive-by
Where it came from – The devil, honest, it came from Satan himself. All you marketing types, I’m going to give you a break because I know, I know – “the devil made you do it”. I pour a little liquor on the curb to all my information architect types that took to the noose over this one - RIP. How the users see it – It spun from hell itself, how else are users suppose to see it. I click a link, promising “MY” content; instead some weird page having absolutely nothing to do with what I just requested is displayed. I know – “the devil made you do it”.
Skip This Ad
4. Who wrote the article
What is it – Ok strictly speaking this is not a technology, just a pet peeve of mine, but it’s on the web so I threw it in. Its content from a website without an author indicated and/or cited reference. I did not know Associated Press was an author.
Where it came from – This is just sneaky. You’re reading a news article online, like most articles advocacy reporting is the new trend in news agencies. Ok, so who actually wrote the article, no writer or sources are cited. In other words who wrote this article? I thought it was standard practice that the writers identify themselves. How the users see it – This under handedness just continues to build distrust of the news. Hey, most news agencies are hurting for cash, right. So if they deliver content which annoy the customer base then the customer won’t find value in the news, so less revenue….. “Just thinking off the top of my head here
Who Wrote the Article
5. Webpages that auto play media
What is it – The user opens up a page then streaming media immediately starts in on them.
Where it came from – The porn industry and teenagers, then adopted by main stream media sources. User experience people would never, in a million years recommend, “when a user opens a web page it starts blaring streaming media” of any type, unless of course it’s for personal pleasure. How the users see it – Damn, my boss just caught me surfing the net again or “Hey, that’s not suppose to show on my screen.”
Autoplay Streaming Media
6. Animated advertisements on print pages
What is it – Web pollution: the introduction of valueless items to a page that causes irritation, disorder and annoyance to the user.
Where it came from – I have no idea how this bright idea got implemented. How the users see it - “What the hell! Really, animated advertisements on a print page. What is this -- The Harry Potter newspaper. Great, so now my article is 13 pages of junk instead of the 2 pages I really need.
Antimated Ads on Print Pages
7. Print Dialog without the print page
What is it – The user presses the print link, instead of clean content, just the print dialog is displayed.
Where it came from – Lazy content administrators not removing the graphics and other pollution providing clean, clear print pages. How the users see it – This sucks…..
Print Dialogue Box
8. Screen Flashers and Streakers
What is it – The user gets bombarded with flying dialog boxes demanding stuff.
Where it came from – Marketing departments once again hunting for clicks to justify themselves. Usually about this time, user experienced professionals are sitting at their desks drunk and spilling their guts about how their life sucks. How the users see it –Hey, whoa, wait a minute, I didn’t expect that is all I’m saying. We just got to know each other. I mean, I just got to your site and now you’re flashing me with Chevy Cobalt ads all over the screen. Hell, I don’t know you like that!” Or “Oh, damn so soon, I mean you’re just streaking across my screen asking me to register or for a survey. Can I at least get a name and a phone number?”Yeah, that’s what it feels like - a bad date…..
Screen FlahersScreen Streakers
9. Paid advertisement in videos
What is it – The user clicks a link expecting a streaming video – Bam! Advertisement up the wazzu…
Where it came from – The same promise that cable was suppose to deliver. You pay for the service and you get no commercials. Except now it’s free, so companies are like – “kiss our ass, you’re going to see it”. How the users see it – SOB, I just cannot get away from these stupid advertisements.
Media Ads
10. Information Overload
What is it – Global website warming, content pollution, information dumping – just too much content to absorb…
Where it came from – The U.S. Tax Code and China… Two schools of thought here -- overload them for more effective confusion; and with one billion people and limited real estate, pack everything you can into as much space as possible. Even for information architects there are limits to their abilities. How the users see it – Ahhhhh…. Muhhhhh…..Ahhhhh…..
Information Overload

Saturday, February 28, 2009

How to Strong Name the Enterprise Library 4.1

Introduction The Enterprise Library is a very useful tool for developing applications. The libraries provide such services as data, caching and logging. One drawback of version 4.1 compared to 3.1 is the additionally effort required to strong name the assemblies. In completing this task you could expect to spend about 4 hours preparing the dlls. It’s not difficult but seeing time is of the essence I wanted to help shorten the effort. Here’s a zip of the libraries which have been strong named [Full download - DLL Only]. You can re-compile to customize the public/private key or just download the dlls then install them in your GAC. The directory path “sn” – [strong name] holds just the dlls. Included in the directory is the GACutil.exe, SN.exe and the .pk and .snk files. Navigate to the sn directory then execute the GAC_EntLib.bat batch process. This will automatically install all the dlls in your GAC. If you only need a few of the libraries then navigate to the list.txt file to remove the unnecessary blocks. If you’d like to customize the public/private key, the process is detailed below: Steps To create a key pair 1. At a command prompt, go to the directory that will hold the key pair. 2. To create a key pair, locate the sn.exe in the sn directory then type sn –k keyfile.snk (note: keyfile is what ever name you want to give it) You must extract the public key from the key pair (the public key is required for updating the InternalsVisibleTo attribute). The following procedure describes how to extract and display the public key. To extract and display the public key 1. At the command prompt, type sn –p keyfile.snk publickey.pk to extract the public key from the key pair. 2. Type sn –tp publickey.pk to display the public key in hexadecimal. Keep the Configuration Console window open (or copy the output to a text file). Once the key is extracted then search for the InternalsVisibleTo attribute. Replace the current PublicKey with your own. Remember that the key from the extract process will be on multiple lines, so remove the line returns for one continuous string. After completing this step then recompiling the project run the BuildLibraryAndCopyAssemblies.bat in the Scripts folder. This will add the dlls to the bin directory. Copy these dlls into the sn directory then execute the GAC_EntLib.bat batch process. This will install all dlls in the GAC. You will notice the Gacutil and Sn tools are included in the project. For those missing or can’t find the exe's, I made them readily available. Reference If you’d like to conduct the manual process yourself then knock yourself out. Here’s the document to help you achieve your goal. Strong Naming the Enterprise Library Assemblies http://msdn.microsoft.com/en-us/library/dd140121.aspx

Sunday, February 1, 2009

Token-based authentication using Asp .Net, JW Player 4.3, Web Services and Flash Media Server 3.5

Tags: JW Player, Web Service, Flash Media Server, Flash Interactive Server, Flash CS 4 Professional, Token Authentication JW Player, User Authentication Introduction With the release of Abode Flash Media Server 3.5 companies can expand their media capabilities through a suite of web distribution channel such as Video-on-Demand, Multi-Communication Chat and Live streaming. The server provides security mechanisms to verify Flash players, encrypt media streams and cross-domain authorization. However, in order to use a customized security solution the server can use web services to integrate with your application. This article will cover how to get your Adobe Flash Media server to authenticate users then authorize media resources for streaming content. The nice thing is we’ll use a real world example ASP .Net Web Site and one of the most popular Flash Players on the market to do it, the JW Player 4.3. To download free complete pdf article click here To download the free demo code click here Architecture Before we dive too deep, let’s take a look at our system architectural approach by piecing together our solution into a holistic offering. Our components consist of a Flash Media Server (FMS), an IIS Web Server, a Sql Server 2005, ASP .Net and the JW Player. The open source JW Player is a nice offering because it’s free, we don’t need to do much and it’s easy to add into web page. The only hurdle, is overcoming our understanding of ActionScript and server-side development. We don’t have to worry too much because Adobe has done a good job of using Object-Oriented technology to develop the language which will smooth our efforts. So let’s take our technology stack and put it in perspective. The FMS along with the JW Player will stream our content, IIS will server up the Asp .Net pages and Microsoft Sql Server 2005 will handle membership and roles authentication service. As a note, if you’re unfamiliar with Membership and Roles in Asp .Net, I’ve included resources to some of the leading authors in this area namely, Scott Guthrie and Scott Mitchell. Now that we know what needs to be in place, let’s get a visual of what this looks like. [APPLICATION ARCHITECTURE] Below is a summary of how our technology blocks will interoperate with each other: 1. A clients request the web page from our IIS server with the Open Source JW Player SWF file. 2. The client presses play to request the streaming video. 3. An encrypted client token that includes the user information, file requested and SWF file is sent via RTMP to the Flash Media Server (FMS). 4. A SWF verification process is enacted by the FMS to ensure the client’s JW player is authorized. After completion of SWF verification, the FM Server contacts the authentication web service to request client authorization credential. 5. Successful authentication will load and stream the media from the share. Failed authentication will refuse the request. 6. The streaming media is displayed to the client. Let’s move on to what we’ll need to develop our solutions. Requirements To complete this demonstration you’ll need the following software and files: 1. Download - Flash Media Development Server 3.5 2. Download - Flash CS4 Professional 3. Download - Microsoft Visual Studio 2008 4. Download - Microsoft Sql Server 2005 5. Download - JW Player Source Code (note: Subversion is used to connect to the source control for the JW Player. The source control path – {svn co http://developer.longtailvideo.com/svn/tags/wmvplayer-1.1} 6. Download – Subversion 7. Reference - Creating ASP.NET Web Applications. ASP .Net Web Project configured to use the Membership and Role providers. The project should include the Login.aspx to authenticate users and a Default.aspx to display the JW Player. Application Development Now let review what we will be implementing in a more concrete manner. The below item will keep us focused on each piece that needs to be developed. 1. Modify the JW Player to pass our user token and requested resource 2. Embed the JW Player in our secure web page 3. Set an encrypted user token for the JW Player to send to the FMS Server 4. Implement an ActionScript component to accept and authenticate the user token then authorize the resource for streaming. 5. Implement a web service to accept the user token and requested resource then return the authentication/authorization result. 6. Notify the JW Player to accept or refuse the connection. So in summary, we have to modify the JW Player, create an ASP .Net Web Form, develop a Server-Side ActionScript Component, build a web service then configure our FMS Server. Great, let’s move on to make this happen. Modifying the JW Player Using Subversion you should have downloaded the latest code from the open source repository for the JW player to a working folder. To create the JW Player Flash project follow the instructions below: To create a new project: 1. Do one of the following to open a new project: Select New Project from the Project pop-up menu. If no other project is open, open the Flash Project panel and select Create a New Project in the panel window. Select File > New. On the General tab, select Flash Project. If no project is currently open, right-click (Windows) or Control-click (Macintosh) in the Document window of a saved Flash document or ActionScript file and select Add to New Project from the context menu. 2. In the New Project dialog box, enter a name for the project and click Save. To open an existing project, do one of the following: Select Open Project from the Project pop-up menu. Navigate to the project and click Open. Double-click the file. If no other project is open, open the Flash Project panel and select Open an Existing Project in the panel window. Navigate to the project and click Open. Select File > Open. Navigate to the project and click Open. Modify the JW Player code base Once we have the project setup, we need to modify two files the com/jeroenwijering/player/Player.as and com/jeroenwijering/models/RTMPModel.as. These are the key pieces of code that will take our user access and resource tokens then pass them to the server to be authenticated. Player.as This file holds the configuration object that receives the flashvars from the JW Player player. We need to add a variable called “accesstoken:undefined” to the “public var config:Object” array. The flashvars are parameters Flash Players can use to provider necessary parameters to players, the server or both. Our parameter will be set to the {accesstoken} parameter we’ll set using code-behind in our web page. This will also give us an opportunity to encrypt the user information. The media resource will come from the {file} parameter which is already available. We only have to pass the two parameters to the server. RTMPModel.as Since we’re streaming content our player will connect to the server over the RTMP protocol. The RTMPModel component will initiate the connection then passes our parameters to the server-side component. We add the access token and file resource as parameters to the connection object. Below is the example code: [SEE DOWNLOAD FOR CODE BLOCK] Deploy the code After completion of the code changes then click File > Publish to compile the code. We’re done with the JW Player. A nice feature of completing this step is the SWF verification uses a checksum process to verify players. By adding this code we’ve automatically made sure the player is unique. What this means is we can now take this player include it in our SWFs folder and our web site, without worrying about others hacking another player to retrieve our secure content. Create the secure web page embedded with the JW Player Now we can create your Asp .Net C# web project then add a folder called /embed. We’re going to copy both the player.swf and swfobject.js from the JW Player Flash project we just published into this location. Also, we’ll add a Default.aspx and Login.aspx to the project. The Default.aspx will hold the JW Player and the Login.aspx will allow us to login user. Please review the Reference resource provided at the end of this document if you’re unfamiliar with ASP .Net web project and membership based security. We’re going to include our JW Player in the secured web page using the tag below: [SEE DOWNLOAD FOR CODE BLOCK] The flashvars will be left blank for the time being. We’re going to use our code-behind populate this parameter with access token. Below is the information we’re going to provide to the flashvar: file=media_resource_path&streamer=rtmp://flash_media_server_address/application_name&encrypted_accesstoken media_resource_path: The path location of the file resource on the network server flash_media_server_ip: The flash media server url or IP address application_name: The name of your Flash Media Server application encrypted_accesstoken: Encrypted user access token passed to the FMS for authentication/authorization Before we dive deeper into the web application and code, lets’ make sure we setup the database to store the file path and user security permissions. All systems are different but this is a minimum baseline for granting access to media resources. We need to ensure that users only have permissions to “Read” their media content as defined by the business rules [ERD DIAGRAM GRAPHIC] Below is the code along with a few inserts to get the database created and some demo data populated. You’ll notice that the aspnet_Membership table was created by the ASP .Net Membership process and we didn’t include the code here. Also, as a note the insert statements include a GUID that is the UserId in the aspnet_Membership table. You can use this to populate your own information. [SEE DOWNLOAD FOR CODE BLOCK] Asp .Net Web Page The Login.aspx is very straight forward. Just create the page then drop the necessary login components on the page. Below is a page mockup. [LOGIN GRAPHIC] Next we need the web page to display the JW Player and file listing. [PAGE GRAPHIC] Asp .Net HTML We’ll use a Gridview for the files and labels to display the file information as we select through each item. The code of this page is below. [SEE DOWNLOAD FOR CODE BLOCK] As we mention earlier, the {_flashvarpath} variable is set in our code-behind. We gave the format of the parameters and you will notice the {file} and {accesstoken} parameters. Both are synonymous with the config object in the Player.as. We’ll it turns out with our Player.as code entry the variable will be mapped by name to the config object. Any parameter we provide will be passed along and set. _flashvarpath = string.Format("file={0}&streamer=rtmp://{1}&accesstoken={2}", _filepath, ConfigurationManager.AppSettings["FMSPathLocation"].ToString(), _usertoken); Also our appSettings need to be in place for security and path information. [SEE DOWLOAD FOR CODE BLOCK] Create the Flash Media Server ActionScript Component For the Flash Media Server to accept the tokens then communicate with our web service for user authentication, Main.asc is needed. This component will sit in the application directory on the server and handle all requests for media content. This can be created using a text editor or Flash CS4 Professional. The code is commented and self-explanatory. Since this is scripted code we don’t need to compile anything, we just needed to include it in the application folder then reload the application. The application can be reloaded through the Flash Media Server Admin Console. [SEE DOWLOAD FOR CODE BLOCK] Implement a Web Service to authenticate the user and media resource Now we’re moving towards the final pieces. The web service will accept the user token, resource file token and web service access token then authenticate the user. The information returned to the Main.asc will be parsed to allow or reject a connection. One important note, since we’re using Asp .Net Membership security we need to allow access to the service without using any credentials. To do this we set a tag in the web.config file to allow anyone to access the web service. Hence the reason for the web service access token. We only want our Flash Media Server to connect to the service. Here is the code for the web.config. [SEE DOWLOAD FOR CODE BLOCK] Flash Media Server configuration Now that our coding is completed, we only have to ensure the server is configured correctly. A copy of the JW Player should be in the SWFs directory as well as the /embed directory of the Asp .Net application. [FOLDER GRAPHIC] The application.xml file should be located in the SecurityDemo folder. [FOLDER GRAPHIC] The Application.xml information is below. Note three important nodes Streams, SWFVerification and SWFFolder. • Streams – is local or network location of your media. If a network is used then the FMS service executables should run an account that has access to the shares. Also note the {/} in front of the path location. This is required. • SWFVerification – enabled is set to true. This will use a checksum to validate that no other player is being used to contact your Flash Media Server. • SWFFolder – this is the location of your swf file for the SWF verification process. Summary In summary, this is a fun product to work with and has incredible potential. We’ve created our application with web services, loaded the server-side components and authenticated our users for their media. I’ve included the references used along with a zip of all the project files. Good luck with your endeavors into the Flash Media Server. References ASP.NET 2.0 Membership, Roles, Forms Authentication, and Security Resources - Article Scott Guthrie ASP.NET 2.0 Security, Membership and Roles Tutorials - Article Scott Guthrie Examining ASP.NET 2.0's Membership, Roles, and Profile - Article Scott Mitchell Configuring ASP.NET 2.0 Application Services to use SQL Server 2000 or SQL Server 2005 - Article Scott Guthrie Creating ASP.NET Web Applications - Article .NET Framework Developer Center Creating a Simple ASP.NET Application - Article Kirupa Chinnathambi Get Started with ASP.NET - Reference Website Manipulating Web Services with Flash Media Server - Article Robert A. Colvin Dynamic streaming in Flash Media Server 3.5 – Part 1: ActionScript 3.0 dynamic stream API - Article David Hassoun Beginner's guide to installing Flash Media Server 3.5 - Article Tom Green Adobe Flash Media Server – Reference Website Martijn's C# Coding Blog - Reference Website martijn@dijksterhuis.org

Saturday, August 16, 2008

To the United States Of America -- The Land of Champions

From Fixed the *glitch* to all the Olympic athletes, we salute you and honor your hard work. You are what make your country great. Handwork, endurance, integrity and most of all faith. A special congratulation to Michael Phelps for become the greatest athlete in history. Your performance was "Phelpstacular". Hey I just thought about it... I'm trademarking "Phelpstacular(TM)"

Sunday, February 24, 2008

Reusing the ASP .Net SqlDataSource for multiple web controls

Ok, I assume everyone knows how to use the SqlDataSource Control. So I'll dispatch with such details and get down to business. I had a sticky problem, I wanted to dump several web controls on a page without the hassle of creating multiple SqlDataSource Controls for each. In the past, I just created my own data layer and then reuse the connection objects. I decided it was code-reuse time and the built-in controls provided by .Net was a great opportunity. Since I was dealing with a control, I needed to programmatically change the command text to query the database for information. I had ten web controls to populate, each calling the same stored procedure to retrieve the data. Each call passed a modified sql parameter for a different set of data. So for simplicity, I'll present the steps here. 1. Include a SqlDataSource Control on your web page then configure it to use your data source information. Once configured, remove all the parameters except the connection string information. asp:SqlDataSource ID="sdsDataSource" runat="server" ConnectionString="" 2. In your Page_Load event, we're going to programmatically handle the calls then pass the new query data source to each item. 3. Below we setup our information programmatically. We set the DataSourceMode to Datareader for performance, then we call our stored procedure. We pass the necessary parameters then call our Select event to retrieve the data. //Property information sdsDataSource.DataSourceMode = SqlDataSourceMode.DataReader; sdsDataSource.SelectCommand = "perReadTypesByCategory"; sdsDataSource.SelectCommandType = SqlDataSourceCommandType.StoredProcedure; sdsDataSource.SelectParameters.Add("intTypeId", "31"); 4. Then we set the necessary control parameters, in this case a radio button list of propery items. rblProperyItems.DataMember = "DefaultView"; rblProperyItems.DataSource = sdsDataSource; rblProperyItems.DataTextField = "TypeDesc"; rblProperyItems.DataValueField = "TypeId"; rblProperyItems.DataBind(); 5. After the initial call, we need to clear out the sql parameter list, reset the parameters then make a call to refresh the data. Note we've only changed the information we needed, namely the parameter argument from 31 to 1. //Property Type information sdsDataSource.SelectParameters.Clear(); sdsDataSource.SelectParameters.Add("intTypeId", "1"); ddType.DataMember = "DefaultView"; ddType.DataSource = sdsDataSource; ddType.DataTextField = "TypeDesc"; ddType.DataValueField = "TypeId"; ddType.DataBind(); 6. Repeat Step 5 for multiple controls. 7. After you're done with the SqlDataSource Contorl you need to execute the Dispose method to release the resource. That's all there is to it. Good luck and hope this helps to all.