Evento Gaming.NET

by Juan 26. August 2008 16:45

El día viernes 29, a las 18.30 hs estaremos haciendo el evento de promoción de Gaming para los colegios técnicos de Capital Federal en el auditorio del colegio Esteban Echeverría (San Juan 983, Capital Federal).

Se darán algunas charlas, y se responderán consultas sobre el concurso.

Espero verlos ahi!

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

Gaming.NET

Stack Overflow

by Juan 22. August 2008 20:21

No, this is not a post about that old problem with the same name, this is about a new Website

I've been beta testing for a few days Jeff Atwood's new venture, and I must say, it's promising. It is a site made and maintained by programmers, for programmers... kind of like a wikipedia meets experts-exchange, but free.

The beta is supposed to end at the end of the month, so that means that it will open to the general public (at least that's the current rumor) next month.

In the meantime, here are some screenshots

image

 

image

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

General | Programming

Feed migration

by Juan 21. August 2008 16:17

I have migrated my feed to Google, so if you are subscribed to the old feedburner address through google reader or any other feed program, please update the adress to http://feedproxy.google.com/juanformoso

The old one will continue to work, but the new one is preferred.

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

General

Dynamic SiteMap for ASP.NET Websites

by Juan 20. August 2008 10:56

I wanted some easy way to add modules to a website of mine, and have it automatically generate the menu, so I thought I'd compile some existing ideas and code I found into something useful for that end.

In short, what I wanted to do is have a Sitemap generated based on the folders in the application.

First, armed with what I learned about HttpHandlers, I created one to do just that: search folders and .aspx files and create the sitemap as needed by the XmlSiteMapProvider. It hooks to sitemap.axd and outputs the xml.
You can download that code at the end of this article, just drop it in the App_Code folder.

The target format is this

<siteMap>
  <siteMapNode title="RootNode" description="This is the root node of the site map. There can be only one root node." url="Page1.aspx" >
    <siteMapNode title="ChildofRootNode" description="Descriptions do not have to be unique." url="Page2.aspx">
      <siteMapNode title="ChildOfChildNode" description="SiteMapNode objects can be nested to any level." url="Page3.aspx"/>
    </siteMapNode>
    <siteMapNode title="ChildofRootNode" description="Descriptions do not have to be unique." url="Page4.aspx"/>
  </siteMapNode>
</siteMap>

The first problem I run into was that the .NET provider didn't like two things, the extension (.axd) and the fact that the file doesn't really exists, as can be seen quickly using Reflector.

image
(...)
image

After thinking for a bit, I decided to implement my own SiteMapProvider, luckily one already existed.

I used Stefan Sedich's code, removed the dynamic node part, and modified the way it looks for the file (which was to map the physical path, but as I said earlier, the file doesn't exist) like this:

   siteMapXML = XDocument.Load(GetUrlPath(HttpContext.Current.Request.Url.AbsoluteUri) + "/~/" +this.siteMapFile);

This way, the HttpHandler takes the request, and outputs the sitemap xml.

The result is that for this sample web site:

image

This xml is generated:

image

There's also configuration entry in the web.config file to exclude specific folders in the search, nothing too fancy:

   <add key="SiteMap_ExcludeFolders" value="App_Code;App_Themes;Bin;MasterPages"/>

So with this, whenever I add a subfolder in my application, it will automatically appear in the Menu, SiteMapPath, or whatever control that uses the sitemap.

I hope this is useful to someone

Downloads
SiteMap.cs (4.28 kb)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , ,

Programming

Live semantic errors

by Juan 15. August 2008 10:11

One of the new features that came with Visual Studio .NET 2008 SP1, is the real-time compiler errors (feature I read VB developers have had for a long time).

So if you type something wrong, you see it without having to compile

image

I've been working with it for two days, and I definitely don't like it, it distracts me to have errors appearing and disappearing all the time, it doesn't even let you finish writing the line, it shows an error when there isn't one (I just need to finish the line please!). I found myself trying to type faster to avoid seeing the "error".

I'm sure they had good intentions.

Luckily, almost anything can be turned off, you just need to find it.

If you go to Tools > Options > Text Editor > C# > Advanced, and uncheck "Show live semantic errors", it works like before, only showing hints

image

I will go back to the old ways with this one...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Programming | Tips

Gaming.NET y Facebook

by Juan 15. August 2008 00:18

Gaming.NET tiene grupo en Facebook!

Pueden verlo haciendo click acá

La idea es canalizar dudas del juego por ahí, a modo de foro (que es mejor que el de la página oficial dicho sea de paso, nunca conseguí que me lo cambien =) )

No es obligatorio para participar

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Gaming.NET

Gaming.NET 2008 - Cursos UP

by Juan 14. August 2008 11:00

Es de mi agrado informarles que están confirmados los cursos (si, plural, van a ser 2) que se dictaran en la Universidad de Palermo para Gaming.NET 2008

Las fechas son

Curso 1

6, 13, 20 y 27 de septiembre (de 10:00 a 13:00 hs)

Curso 2

4, 11,18 y 25 de octubre (de 10:00 a 13:00 hs)

La inscripción se realiza a través de la web de gaming, y ya está abierta!

Espero verlos ahí 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Gaming.NET

Visual Studio 2008 and .NET 3.5 SP1 Released

by Juan 12. August 2008 11:56

You can download the Visual Studio 2008 SP1 from here (which includes the .NET 3.5 SP1)

Following those links you have the information regarding what fixes and new features they bring

The ASP.NET new features include

  • Enabling high-productivity data scenarios by using ASP.NET Dynamic Data.
  • Supporting the browser navigation in ASP.NET AJAX applications by using ASP.NET AJAX browser history.
  • Increasing the download speed for ASP.NET applications by using ASP.NET AJAX script combining.
  • Enjoy!

    Be the first to rate this post

    • Currently 0/5 Stars.
    • 1
    • 2
    • 3
    • 4
    • 5

    Tags: , , ,

    Programming

    Weak References

    by Juan 30. July 2008 15:01

    The internal framework we are developing here at Iceberg includes a Lock Manager.

    All it does is keep a record of the status of objects (that generally represent records in a table), so you can know if it can be modified (i.e. it's not locked).

    The basic design includes a Lock(obj) method and an UnLock(obj) method. However, the possibility exists for the application to end abruptly, or even for the programmer to forget to call UnLock to free the object's exclusive lock.

    The first approach to solve this was to have the object register itself to a Ping event in the Lock Manager, so it can tell it it's still alive. The problem was that since it's registered in the Lock Manager's event, it was never garbage collected, ergo, it was always alive.

    After a few more ideas that ranged from looking for some reference count (and finding it doesn't exist) to considering manipulating the memory through unsafe code, I found the most beautiful class in the world: WeakReference

    A weak reference allows the garbage collector to collect an object while still allowing an application to access the object. If you need the object, you can still obtain a strong reference to it and prevent it from being collected. For more information about how to use short and long weak references, see Weak References.

    With 2 lines of code you can solve the problem:

    MyClass c = new MyClass();

    WeakReference w = new WeakReference(c);

    // (...)

    bool wasGarbageCollected = w.IsAlive;

    It's magic!

    Currently the Lock Manager creates a Weak Reference in the Lock method and ads it to a list, it has an internal timer where it iterates through the list, and it unlocks every object that was garbage collected.

    You should've seen the test application go... this is by far the best class in the .NET Framework.

    Be the first to rate this post

    • Currently 0/5 Stars.
    • 1
    • 2
    • 3
    • 4
    • 5

    Tags: , ,

    Programming

    Dynamic Master Pages

    by Juan 18. July 2008 15:16

    I wanted to create a template web site with the ability to completely change its layout via the web.config file, and it was also a good excuse to look into HttpModules.

    HttpModules are services that execute when the requests reach the webserver, you can use them to do whatever you want... like compressing the output before sending it to the client, parsing scripts and put them all in a single file, etc, etc, etc

    This time, what I want to do is set the the page's MasterPage according to a value in the web.config file.

    What I do is register for the page's PreInit method, and set the MasterPageFile property in the handler, like this:

    public void Init(HttpApplication context)

    {       

        context.PreRequestHandlerExecute += new EventHandler(context_PreRequestHandlerExecute);   

    }   

     

    void context_PreRequestHandlerExecute(object sender, EventArgs e)   

    {       

        Page page = HttpContext.Current.CurrentHandler as Page;       

        if (page != null)       

            page.PreInit += new EventHandler(page_PreInit);       

    }   

     

    void page_PreInit(object sender, EventArgs e)   

    {       

        Page page = sender as Page;       

        if (page != null)

            page.MasterPageFile = "~/MasterPages/" + ConfigurationManager.AppSettings["MasterPageTheme"] + "/site.master";       

    }

    In that example, you have to have a MaterPageTheme setting with the name of the folder that contains site.master.

    image

    Then you just need to register the module, and you are good to go

    <httpModules>

        <add name="MasterPageModule" type="MasterPageModule"/>
    </httpModules>

    You can download the code below, just drop it in the App_Code folder

    MasterPageModule.zip (620.00 bytes)

    Be the first to rate this post

    • Currently 0/5 Stars.
    • 1
    • 2
    • 3
    • 4
    • 5

    Tags: , , ,

    Programming

    Powered by BlogEngine.NET 1.4.5.7
    Theme by Mads Kristensen Modified by Juan Manuel Formoso

    About the Author

    Juan Manuel
    Networking
    View my LinkedIn profile View my Technorati profile View my Facebook profile View my bookshelf
    View my Plaxo profile View my digg profile

    Juan Manuel Formoso
    There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something more bizarrely inexplicable.

    There is another theory which states that this has already happened.

    E-mail me Send mail

    Ads

    Most comments

    Cristian Pereyra Cristian Pereyra
    3 comments
    ar Argentina
    Miguel Miguel
    2 comments
    us United States
    Ariel Ariel
    1 comments
    ar Argentina
    Mauro Mauro
    1 comments
    ar Argentina
    Daniel Daniel
    1 comments
    mx Mexico

    Google Reader Picks

    Calendar

    <<  August 2008  >>
    MoTuWeThFrSaSu
    28293031123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    View posts in large calendar

    Recent posts

    Recent comments

    Comment RSS

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in  anyway.

    © Copyright 2008
    XFN Friendly