Ivan Porto Carrero

IO(thoughts) foreach (_.propagandize)

09

Sep
2006

The Conceptual Internet

There has been some talk lately on how to define web 2.0

The Conceptual Internet

WTF is Web 2.0

In my opinion web 2.0 is something you add to the description of your application or service and have instantaneously a perceived coolness upgrade.

Everything is else is just the web.  I’m up to the point that if I hear somebody mention web 2.0 to me I’ll run out the door screaming ;-)

But let’s talk a bit more about conceptual url’s as Alex has called them. I feel they should be more self-describing urls. Alex and I have been discussing this way of forming url’s for a wee while now.

Self describing urls are urls that mean something to everybody also your mum and nana. When talking to users I often find that they don’t get anything that comes after http://www.somedomain.com/FooBar

However if it were common to implement a scheme like http://www.somedomain.com/MyAccount, http://www.somedomain.com/Blog
That is something they also grasp but what they don’t get (want to or need to) is why there is sometimes .aspx, .php, ….. and definitely the question mark is where the look in their eyes becomes fully glazed.
So a common schema to implement  could be protocol://domain/DomainObject/View/RowIDOrFilter/Action/DomainObject/View/RowIdOrFilter/Action…. Now why do i feel that they should be called self describing. The reason is because you can read them in plain english :
At domain Get me the domainObject as a view with only RowIdOrFilter and do Action with it/make it Action/apply Action to it

http://www.nblogr.com/Category/DetailByName/Venues/ShowSublist/Entry/List/ would be valid and would say then at nblogr.com get me the categories By name Venues and from those show me a sublist of entries as a list. Now that is something my grandfather with alzheimer still understands and quite possible could navigate.

That way url’s are in fact really easy to remember if you make them all up of meaningful words so that would make internet more transparent for everybody to use.

This theory poses a problem when there are complex filters to be applied. However filters can be foreseen and hence be named upfront.  And the biggest problem I see here is to come to a world wide consensus on which naming to use for commonly used filters ect.  But in fact with predefined standards really everybody would benefit from it.

In asp.net with virtual path providers you can store your whole website in sql server and never have a real physical website running

Needless to say that I can’t wait for IIS 7 to get rid of the aspx extensions etc on my projects.

I’d say back to the basic idea of the computer/internet is here to assist people into doing better jobs not to confuse the hell out of them.

02

Sep
2006

Preview Release of NBlogr

Today I put a preview release of NBlogr online.

I still have to change the online site but will do so very shortly.

This release has very basic functionality and is not yet feature complete so a lot may change later on.

If anybody feels like joining the project do not hesitate :) All help I get is extremely welcome.

            [http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=Nblogr](http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=Nblogr)

I’m heading into a very busy week/couple of weeks so I’m not sure if I will be able to spend as much time as I’ve been spending lately on the project.  But I think every week I will be able to show some progress at least.

If you feel like it go ahead and give it a try but don’t upgrade your blog just yet :).

I’d be keen to know what your thoughts are on the subject.

01

Sep
2006

FileUploading for NBlogr

To upload files in nblogr. I wanted the user to have the possibility to upload as many files as they wanted but only show one file element.

The upload procedure has to work without reloading the page entirely but there is no way of getting the size or the bytes of a file through the html input file control from clientscript without popping up a security warning.
And what do I personally think about security warnings : they are a necessary evil but limit you a lot in the development of contemporary sites with rich client interaction.
If I am to present a site to my parents and they have to figure stuff out themselves I’m pretty sure that once the read the words : Security warning, Potential risk etc… they will click no ==> site doesn’t work ==> site == crap

I wanted to include an upload with progress bar but decided to let that idea go and just give an implementation of a multiple file upload with a single inputelement. Maybe I will put this in during the next iteration. That way I can probably release a ctp this weekend and start thinking about a plugin architecture (thanks for the idea JD)

Because of the file issues i have to run it in an iframe :-s and have the page and the frame talk to eachother.

29

Aug
2006

Did Teched Have an Impact

In my case I guess it did.

First of all there were the presentations on Presentation Foundation which were really cool and made me want to start playing with it right away.

Unfortunately for my playing time, currently I am in a really busy period professionally so I’ll just have to stick with what I know already.

However I will start using communication foundation whenever possible as well as workflow foundation these two pieces are too useful for me not to use them.
Also it made me rethink the way I’ve been using atlas and how I’ve been evolving with the development of websites in atlas.

In the beginning I was doing atlas I used update panels like everybody else. But soon I came across a lot of limitations of the update panel. Where they weren’t flexible enough etc. That’s when I started talking to webservices directly and did to everything client-side. This had as drawback that once you started to put a reasonable amount of functionality in the page the initialisation process takes a really long time. In meantime atlas has evolved for the better I must say. Also the control toolkit has grown a lot.

Now the control toolkit holds the control I’ve anticipated the most : the animation control. Also for about every bit of functionality you have a blueprint in the control toolkit that let you extend every server control on your page to do pretty much anything you want.

Where I was in doubt last week if atlas was really the best choice to go the ajax route. Now these doubts have been erased.

At tech ed I got a chance to have a chat with Scott Guthrie, who for a really smart guy knows how to communicate really well and certainly better than me :), and he couldn’t say what was on the horizon atlaswise but just that it was going to be really cool. Even cooler than Nikhil Kothari’s script sharp, I for one can’t wait to set what they have in store for us.

In short teched was excellent in my case and would love to do it again :)

29

Aug
2006

A Generic Builder for Unit Tests

I’ve been using base4 quite a lot lately :). And obviously I like it. But anyway for unit testing i found myself writing virtually the same builder class over and over again.

And since it is just test data that needs to be removed later it is always very similar. I started thinking about my problem and came to the conclusion that I could easily enough build a generic class that iterates over the object and takes all the properties that belong to that type and not to any of the parent types and fill them with valid data for their returntype.

I got to work and not so long after that I came up with the following class:

                    using System;





                    using System.Collections.Generic;





                    using System.Text;





                    using Base4.Storage;

 

                    namespace NBlogr.NUnitTests.HelperClasses

{

    publicclassBuilder where T : class,IItem,new()

    {

        privateList items;

 

        publicList Items

        {

            get

            {

                if (items == null) items = newList();

                return items;

            }

            set { items = value; }

        }

 

        publicvirtual T Add()

        {

            return Add(null);

        }

 

        public T Add(int? index)

        {

            T t = new T();

            return Add(t, index, true);

        }

 

        publicvirtual T Add(T t, int? index, bool generateValues)

        {

            IItem item = t;

            if (generateValues)

            {

                foreach (PropertyImpl p in item.TypeDefinition.Properties)

                {

                    switch (p.ReturnTypeName)

                    {

                        case”bool”:

                        case”Boolean”:

                        case”System.Boolean”:

                            item[p.Name] = index.HasValue;

                            break;

                        case”string”:

                        case”String”:

                        case”System.String”:

                            if (index.HasValue)

                                item[p.Name] = string.Format(“Unittest {0} {1}”, item.TypeDefinition.Name, index);

                            else

                                item[p.Name] = string.Format(“Unittest {0}”, item.TypeDefinition.Name);

                            break;

                        case”uint”:

                        case”short”:

                        case”int”:

                        case”long”:

                        case”Int16”:

                        case”Int32”:

                        case”Int64”:

                        case”System.Int16”:

                        case”System.Int32”:

                        case”System.Int64”:

                            item[p.Name] = index.HasValue ? index.Value : newRandom().Next();

                            break;

                        case”byte”:

                        case”Byte”:

                        case”System.Byte”:

                            item[p.Name] = index.HasValue ? Convert.ToByte(index.Value) : newbyte();

                            break;

 

                        case”double”:

                        case”Double”:

                        case”System.Double”:

                            item[p.Name] = index.HasValue ? Convert.ToDouble(index.Value) : newRandom().NextDouble();

                            break;

 

                        case”byte[]”:

                        case”Byte[]”:

                        case”System.Byte[]”:

                            Byte[] bytes = newbyte[128];

                            Random rnd = newRandom();

                            rnd.NextBytes(bytes);

                            item[p.Name] = bytes;

                            break;

 

                        case”Guid”:

                        case”System.Guid”:

                            item[p.Name] = Guid.NewGuid();

                            break;

                    }

                }

            }

            item.Save();

 

            items.Add((T)item);

 

            return item as T;

        }

 

        publicvoid BuildList()

        {

            BuildList(5);

        }

 

        publicvoid BuildList(int length)

        {

            if (items == null) items = newList();

 

            for (int i = 0; i < length; i++)

            {

                int index = i + 1;

 

                Add(index);

            }

 

        }

 

        publicvoid CleanUp()

        {

            if (items != null && items.Count> 0)

            {

                foreach (IItem item in items)

                {

                    item.Delete();

 

                }

            }

        }

    }

}

24

Aug
2006

Aptana for Writing Atlas Script

I write quite a lot of javascript code these days and have been looking for a couple of months for ways to make my life easier.

Easier would mean in my opinion to get some kind of intellisense or autocomplete while writing javascript.

As it turns out in visual studio orcas these features will be available so I’ll be a very happy vs orcas user i guess :).  But in the meantime there is a free eclipse based IDE around aptana that let’s you take advantage of autocomplete etc.

I added the atlas debug files to the default code profile and I was in business.

18

Aug
2006

New Base4 CTP a Must Have

I’ve been playing with the new base4 ctp that was released yesterday. And I must say that schema website thingy … NICE ;-)

I had trouble working out the joins from time to time but now I just browse my schema and it will show me the syntax if i click on a onetomany relationship which is SO cool.

 

I’d say Alex keep doing what you’re doing :D

15

Aug
2006

The Thing I Re-learned Again

I feel so stupid sometimes and today was such a day.. I’d been putting of reinstalling my pc for a  while now.
I had installed vista on it but my machine just isn’t fast enough.

The thing I’ve re-learned today is when installing a pc install the virus scanner last or disable it  during the install period. It shaved about 1 hour of my visual studio installation.

All in all I think that feature saves me about 6 hours over the whole install.

To top