Posts Tagged ‘Web 2.0’

September 11th, 2008

Philly .NET User Group Meeting for September 2008

I will be presenting September 17, 2008 at Philly .NET User Group Meeting.  My talk will be on:

Creating a modern, web 2.0, application with MVC and jQuery with a focus on doing this in a RESTful manor.  My goal is for the developers in attendance to learn how to create a RESTful website design using MVC and implement that RESTful design on the front end with some simple jQuery. These principals will be demonstrated by creating a simple Twitter like application for sharing messages. All the source code will be available via my website at http://www.coderjournal.com after the presentation.

The group will be meeting at the Microsoft Malvern Campus, located at 45 Liberty Blvd, Malvern, PA 19355.

If you think you might attended the meeting please make sure to register, so that Bill has an accurate count for the food order.

philly.net

User Group News

* Please distribute this notice throughout your development community!
We have some great meetings lined up for the next few months. Please take a look at the upcoming schedule on the web site.
September 17 ASP.NET Dynamic Data, MVC & Web 2.0
Wednesday

Malvern, PA

Our monthly meeting will be held at the Microsoft Greater PA Office in Malvern, PA on Wednesday, September 17 from 5:30-8:30. Refreshments are provided courtesy of Vovéo Marketing Group. Please register on our web site. Detailed directions are on the Microsoft Greater PA web site.
5:30 Rachel Appel, Appel Consulting An Introduction to ASP.NET Dynamic Data
Rachel Appel, Appel Consulting If you are tired of the same old ASP.NET webforms, GridViews, and ADO.NET data access code that make up your current applications, then you’ll want to take a closer look at ASP.NET Dynamic Data.  ASP.NET Dynamic Data is Microsoft’s new technology that provides a template infrastructure for your application, page and fields based on your application’s data model. In this session you will learn concepts and use of application templates to create ASP.NET dynamic data web application. We’ll then create customizations at the application and page levels showing how easy website maintenance is when using ASP.NET Dynamic Data. We’ll also cover field level customizations by supplying data display formats, custom field types, and data validation based on the application’s data model.

Rachel Appel lives in Northeastern Pennsylvania and is the senior technology consultant at Appel Consulting. Rachel is an MVP and a member of ASPInsiders, and holds the MCT MCAD & MCSD certifications.  She has been working as an instructor, software developer, architect and DBA for a wide variety of organizations. She is the Vice President and a regular speaker of the dotNetValley user’s group, as well as an active member in other local user groups of Northeastern Pennsylvania and the tri-state area.  Rachel’s expertise lies within developing solutions that align business and technology using the Microsoft .NET family of products.

6:45 Q&A Rob Keiser & Dani Diaz, philly.net co-leaders, ask questions, get answers from your peers!
7:00 Break Meet your peers. Refreshments and drinks courtesy of Vovéo Marketing Group.
7:15 Nicholas Berardi, Vovéo Marketing Group MVC & Web 2.0
Nicholas Berardi, Vovéo Marketing Group Creating a modern, web 2.0, application with MVC and jQuery with a focus on doing this in a RESTful manor.  My goal is for the developers in attendance to learn how to create a RESTful website design using MVC and implement that RESTful design on the front end with some simple jQuery. These principals will be demonstrated by creating a simple Twitter like application for sharing messages. All the source code will be available via my website at http://www.coderjournal.com after the presentation.

Nicholas Berardi works for Vovéo Marketing Group in Malvern, PA as a Software Architect.  He is the co-author of ASP.NET MVC Website Programming, Problem, Design, Solution published by Wrox and will be released early 2009.  He received his BS in Information Science and Technology from The Pennsylvania State University in 2003.  Nick has been using C# and the .NET framework since its beta and has over 10 years of experience in web development and related technologies. He helped to develope one the first websites on the internet to use the ASP.NET MVC framework, in a production environment, at http://www.ideapipe.com.  He blogs at http://www.coderjournal.com.

8:30 Closing & Raffle! Books, software, and other goodies!

Tags: , , ,

Posted in News, Personal | kick it on DotNetKicks.com | Bookmark | View blog reactions | No Comments »

August 14th, 2008

Is Stackoverflow.com really a Web 2.0 site?

I have been lucky enough to be one of the few and many people that have had the chance to preview the beta of stackoverflow.com. It has a very nice look and feel in my opinion and seems to work very well for an early beta. Jeff Atwood deserves major kudos. However I have had one plaguing question?

Is stackoverflow.com really a Web 2.0 site?

I started thinking about this question a couple days ago, because as many of you know I have my own project, that isn’t much different functionality wise than stack overflow. As I started cataloging everything that a Web 2.0 site is suppose to consist of, the more I asked the question what is a Web 2.0 site, and is stackoverflow.com really one?

Tim O’Reilly defines Web 2.0 as the following:

Web 2.0 is the business revolution in the computer industry caused by the move to the Internet as platform, and an attempt to understand the rules for success on that new platform.

In my opinion a platform has the following characteristics and so does a Web 2.0.  There are probably many more, but these are the top 4.

  1. It must have a fluent interface.  (this is usually implemented through AJAX)
  2. It must have an externally available API.  (because a closed platform is what Web 1.0 was all about)
  3. Users can own data and have control over who sees it.
  4. It is an obvious advancement from the previous Web 1.0 version of the software if one exisited.

http://stackoverflow.com

Just as a precursor to the following discussion, I have never heard Jeff proclaim that stack overflow is a Web 2.0 site, so this is just my ramblings.  Jeff has also done an awesome job with the site in a short period of time so everything I am saying now will probably change in the future.

Stackoverflow.com has only really done #1 of the first 3.  However what I really want to have a discussion on is if it really has advanced it self enough beyond the old forum model to really be considered 2.0 worthy or is it just a display layer on the 1.0.  For all intents and purposes we are going to use the forums on ASP.NET for comparison.

  • Allows users to create posts? (both yes)
  • Allows users to create reply to the posts? (both yes)
  • Allows users to talk to each other? (asp.net only)
  • Allows users to rank posts? (both yes, but different mechanisms)
  • Allows users to rank replies to posts? (stackoverflow.com only)
  • Allows users to get a system ranking against other users? (both yes)
  • Allows users to tag posts? (both yes)
  • Allows users to tag replies? (asp.net only)
  • Allows users to mark a reply as an answer? (both yes)
  • Allows categorization of posts? (asp.net only)
  • Users aquire badges of honor in the system? (both yes)
  • Users can have a profile of themself and their activity? (both yes)
  • Can easily follow a posting? (asp.net only)
  • Can easily follow a grouping of posts? (asp.net only)
  • Allow users to delete posts? (stackoverflow.com only)
  • Allow users to delete replies? (stackoverflow.com only)

Using the above questions it makes stackoverflow.com look like it is playing catch up to the asp.net forums, which has had a 6 year head start.  But it still begs to ask the question is the technology and application of it worth of the title 2.0 or just 1.1?  I think Jeff needs to impliment the following beyond the typical forum to really claim that 2.0 title.

  • An external API (REST seems popular)
  • Become less of a destination and more of a service:
    • Render in other platforms. (Facebook and/or Open Social)
    • Allow posting and following via SMS and IM.
  • Allow users to follow certain tags, categorizations, users, etc. through RSS, JSON, XML, etc.

I do beleive that Jeff has a long way to go before stack overflow is considered an advancement beyond the standard forum, but if anybody can make that leap it is Jeff.

Tags: , , ,

Posted in Review | kick it on DotNetKicks.com | Bookmark | View blog reactions | 1 Comment »

September 19th, 2007

If Web Comments Met Real Life Situations (NSFW)

This made me laugh so hard that I just had to share it. You don’t really realize just how juvenile some people until you can see and hear it.

Tags: , ,

Posted in ASP.NET, Programming, Rant | kick it on DotNetKicks.com | Bookmark | View blog reactions | 3 Comments »

August 24th, 2007

Creating a more accurate JSON .NET Serializer

Recently I have been diving in to the world of REST and all the great things that come along with that. If you are not familiar with REST and what it means to have a REST Web Service for your site, you can go through the Digg API, which should give you a pretty good idea. My company has been contracted to build the framework for a new Web 2.0 initiative of one of our clients. You cannot do Web 2.0 if you are not using some kind of AJAX/REST combination.

With the inclusion of Microsoft AJAX.NET are some very useful tools that have been added to the web services library. My current focus in System.Web.Script.Serialization.JavaScriptSerializer, which takes you objects and turns them in to a JSON string that can be evaluated by JavaScript and reversed in to an object. JSON (pronounced Jason) is very useful in AJAX because you do not have to retrieve and parse XML through the XML Browser Request that powers current AJAX implementations.

I found the attribute support lacking in the JavaScriptSerializer when compared to the XmlSerializer, ScriptIgnoreAttribute compared to XmlRootAttribute, XmlAttributeAttribute, XmlIgnoreAttribute, XmlElementAttribute, XmlArrayAttribute, and XmlArrayItemAttribute. So I decided to extend the JavaScriptSerializer to use the XML attributes to serialize my objects and give me greater control over how they were written in to JSON text form. The added benefit was that my XML and JSON outputs serialized the exact same way when the web service generated them. Below I have included the code.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Reflection;
using System.Web.Script;
using System.Web.Script.Serialization;
using System.Xml.Serialization;

namespace ManagedFusion.Script.Serializer
{
	public class XmlJavaScriptConverter<T> : JavaScriptConverter
	{
		public override object Deserialize(IDictionary<string,string> dictionary, Type type, JavaScriptSerializer serializer)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		public override IDictionary<string,string> Serialize(object obj, JavaScriptSerializer serializer)
		{
			return SerializeObject(obj);
		}

		private IDictionary<string,string> SerializeObject(object obj)
		{
			IDictionary<string,string> values = new Dictionary<string,string>();
			Type type = obj.GetType();

			foreach (FieldInfo info in type.GetFields(BindingFlags.Public | BindingFlags.Instance))
				if (!info.IsDefined(typeof(XmlIgnoreAttribute), true))
					values.Add(SerializeName(info), SerializeValue(info.GetValue(obj), info));

			foreach (PropertyInfo info2 in type.GetProperties(BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance))
			{
				if (!info2.IsDefined(typeof(XmlIgnoreAttribute), true))
				{
					MethodInfo getMethod = info2.GetGetMethod();
					if ((getMethod != null) && (getMethod.GetParameters().Length <= 0))
						values.Add(SerializeName(info2), SerializeValue(getMethod.Invoke(obj, null), info2));
				}
			}

			return values;
		}

		private string SerializeName(MemberInfo member)
		{
			string name = null;

			if (member.IsDefined(typeof(XmlElementAttribute), true))
			{
				object[] attrs = member.GetCustomAttributes(typeof(XmlElementAttribute), true);

				if (attrs.Length > 0)
				{
					XmlElementAttribute attr = attrs[0] as XmlElementAttribute;

					name = attr.ElementName;
				}
			}

			if (member.IsDefined(typeof(XmlAttributeAttribute), true))
			{
				object[] attrs = member.GetCustomAttributes(typeof(XmlAttributeAttribute), true);

				if (attrs.Length > 0)
				{
					XmlAttributeAttribute attr = attrs[0] as XmlAttributeAttribute;

					name = attr.AttributeName;
				}
			}

			if (member.IsDefined(typeof(XmlArrayAttribute), true))
			{
				object[] attrs = member.GetCustomAttributes(typeof(XmlArrayAttribute), true);

				if (attrs.Length > 0)
				{
					XmlArrayAttribute attr = attrs[0] as XmlArrayAttribute;

					name = attr.ElementName;
				}
			}

			if (String.IsNullOrEmpty(name))
				name = null;

			return name ?? member.Name;
		}

		private object SerializeValue(object obj, MemberInfo member)
		{
			if (obj == null)
				return obj;

			// make sure the object isn't an easily handled primity type
			if (Type.GetTypeCode(obj.GetType()) != TypeCode.Object)
				return obj;

			if (obj is IDictionary)
				return obj;

			if (obj is ICollection)
			{
				IList<object> list = new List<object>();
				object[] attrs = member.GetCustomAttributes(typeof(XmlArrayItemAttribute), true);
				string arrayName = null;

				if (attrs.Length > 0)
				{
					XmlArrayItemAttribute attr = attrs[0] as XmlArrayItemAttribute;

					arrayName = attr.ElementName;
				}

				if (String.IsNullOrEmpty(arrayName))
				{
					foreach (object o in (obj as ICollection))
					{
						if (Type.GetTypeCode(o.GetType()) != TypeCode.Object)
							list.Add(o);
						else
							list.Add(SerializeObject(o));
					}
				}
				else
				{
					foreach (object o in (obj as ICollection))
					{
						IDictionary<string,object> list2 = new Dictionary<string,object>();

						if (Type.GetTypeCode(o.GetType()) != TypeCode.Object)
							list2.Add(arrayName, o);
						else
							list2.Add(arrayName, SerializeObject(o));

						list.Add(list2);
					}
				}

				return list;
			}

			return SerializeObject(obj);
		}

		public override IEnumerable<Type> SupportedTypes
		{
			get { return new ReadOnlyCollection<Type>(new List<Type>(new Type[] { typeof(T) })); }
		}
	}
}

Then to serialize the object in my code I have the following code in place.

JavaScriptSerializer jsSerializer = new JavaScriptSerializer();
jsSerializer.RegisterConverters(new List<JavaScriptConverter>(new JavaScriptConverter[] { new XmlJavaScriptConverter<T>() }));
string response = jsSerializer.Serialize(SerializableObject);

The serializer from above outputs the following code.

{"timestamp":"\/Date(1187968133328)\/","maxCount":10,"count":1,"terms":[{"term":"dvd hollywood"}]}

From this object as the reference.

[XmlRoot("search")]
public class GetTermsResponse
{
	private string[] _terms;
	private int _maxCount;

	[XmlAttribute("timestamp")]
	public DateTime TimeStamp
	{
		get { return DateTime.Now; }
		set { ; }
	}

	[XmlAttribute("maxCount")]
	public int MaxCount
	{
		get { return _maxCount; }
		set { _maxCount = value; }
	}

	[XmlAttribute("count")]
	public int Count
	{
		get { return Terms.Length; }
		set { ; }
	}

	[XmlArray("terms")]
	[XmlArrayItem("term")]
	public string[] Terms
	{
		get { return _terms; }
		set { _terms = value; }
	}
}

So that wasn’t too hard the next step for this code is to make it so it can deserialize the JSON string back to an object, but the chances of that happening are almost 100/1 against the use of that functionality, because POST using JSON is a very dangerous activity and shouldn’t be attempted unless you know all the problems that may occur. So this code above should work in most real world examples. Happy coding.

Tags: , , ,

Posted in ASP.NET, C#, Programming | kick it on DotNetKicks.com | Bookmark | View blog reactions | 2 Comments »

May 2nd, 2007

09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

Recently I have started seeing this number repeated over and over again on the net. You may be asking what it represents and why it is so important. Well this number is one of the worst kept secrets of the MPAA. This 32 character 16 bit number is the key used to descramble data on HD-DVD disc’s. I have seen it wrote many different ways:

09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
09-F9-11-02-9D-74-E3-5B-D8-41-56-C5-63-56-88-C0
09:F9:11:02:9D:74:E3:5B:D8:41:56:C5:63:56:88:C0
09F911029D74E35BD84156C5635688C0
{09F91102-9D74-E35B-D841-56C5635688C0}

Many bloggers are afraid to even touch this number or publish the whole number, because of the MPAA and their crack team of lawyers. Coder Journal doesn’t bow to that kind of pressure, because we are here to support our readers and help them better understand the world of programming. More specifically understanding the difference between the almost 100% failure rate of security through obscurity. This encryption key is a failed attempt by the MPAA of security though obscurity, they might as well have just not encrypted the disk, because it only took the crackers days to find this key, and probably months for th MPAA to implement it.

The reason you are seeing this so prominently displayed, not just on my site, is because of the wide scale revolt at the social bookmarking site Digg. The revolt started Tuesday 5/2/2007, when the Digg moderators started deleting posts containing this sequence of numbers. Apparently as explained in this post, Digg is sponsored by the MPAA and HD-DVD, and started bowing to the pressure to keep this 16 bit number a “secret”. The consumerist has posted a time line of events.

1:30, Diggs started to take longer to register . The digg box on one post started showing 11 diggs, when the post really had 56.
1:40 Our post is the top blog post when searching for digg in technorati tags, resulting in our first noticeable traffic ever from technorati. good thing we got reinstated in the directory for the 3rd time or so recently.
1:43 Serious slowdown after digging posts…more than 30 seconds.
1:44 Digg pwns sel: “Digg will be down for a brief period, while we make some changes.”
1:45 Listening to the “Oh Nine, Eff Nine” song.
1:47 Digg still down.
1:48 It is going to take them a really long time to remove all the stories with the code in it. And then there’s all those pesky users to ban.
1:49 Still down.
1:51 They are never going to keep that number out. People will add it as comments just for no reason. Congrats, MPAA, you’ve created a powerful new meme!
1:52 Just noticed that Kevin Rose, Digg founder, posted something two hours ago about how they’re effectively going to tell the MPAA to shove the C&D. It uses the AACS code as a headline so you know he is for reals, or maybe it’s just Digg-bait to increase his AdSense revenue.
1:59 People say it’s up. But they also say it’s timing out and hanging. Still down for us.
2:03 Now everyone sees “We’ll be back shortly.”
2:05 We remember enjoying the headline that said, “BREAKING: DELL DUDE LANDS ON MOOn!” With the subheading “also 09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63.jpg.” Think it linked to a picture of Kevin Rose, a shovel, one of those terrorist creatures from Aqua Teen Hunger Force, and a graphical representation of the deadly number. Not quite the perfect Venn diagram of Digg user interests, but cut ‘em some slack, they’re working on the fly.
2:08 This is a phat rap about the number.
2:09 Fatigue, thoughts of this post’s pointlessness, begin to settle in.
2:12 Posting more screencaps taken shortly before the crash, inside.
2:16 People say it’s up!
2:17 Hasn’t propogated to us yet. Apparently the top story is Rose’s, “I will never take this down.”
2:19 It’s back for us. Looks like the same crazy pile of hex stories. It’s well past the tipping point of where people are just clicking on, and submitting all, the hex code stories they can.
2:20 Wonder if Digg will credit their advertisers for all the page refreshes.
2:21 Again, Rose: “”But now, after seeing hundreds of stories and reading thousands of comments, you ‘ve made it clear. You’d rather see Digg go down fighting than bow down to a bigger company. We hear you, and effective immediately we won’t delete stories or comments containing the code and will deal with whatever the consequences might be.”" Let’s see what kills Digg first, fighting the MPAA suit or no one wanting to read a site full of hex spam.
2:28 Submitted this post to Digg.

And Kevin Rose founder of Digg has the following to say about what happened yesterday, and that he is taking this revolt to heart:

Today was an insane day. And as the founder of Digg, I just wanted to post my thoughts…

In building and shaping the site I’ve always tried to stay as hands on as possible. We’ve always given site moderation (digging/burying) power to the community. Occasionally we step in to remove stories that violate our terms of use (eg. linking to pornography, illegal downloads, racial hate sites, etc.). So today was a difficult day for us. We had to decide whether to remove stories containing a single code based on a cease and desist declaration. We had to make a call, and in our desire to avoid a scenario where Digg would be interrupted or shut down, we decided to comply and remove the stories with the code.

But now, after seeing hundreds of stories and reading thousands of comments, you’ve made it clear. You’d rather see Digg go down fighting than bow down to a bigger company. We hear you, and effective immediately we won’t delete stories or comments containing the code and will deal with whatever the consequences might be.

If we lose, then what the hell, at least we died trying.

Digg on,

Kevin

So there you have it the Web 2.0 version of a million man march.

Tags: ,

Posted in ASP.NET, Programming, Rant | kick it on DotNetKicks.com | Bookmark | View blog reactions | No Comments »