18. January 2010




Wavelength to Colors in Silverlight

IWavelength to Colors haven't done many experiments lately and thought I'd do a quick one I have been meaning to do for a while.

It is basically a slider that runs from 350nm to 780nm (visible spectrum) and displays (I think accurately) the resulting color and graphical wavelength.

I had done something failry identical in a Windows application several years back, but wanted to do it in Silverlight.

See it here: wavelength to colors.


by Miguel Moreno

Category: Programming | Tags:

27. September 2009




Another Silverlight Clock experiment...

Continue TimeI thought I had told myself I wouldn't do anymore watch or clock-related experiment. Well, maybe one more and this is it...!

In this case, I saw a YouTube movie showcasing a beautiful and elegant clock designed by Sander Mulder. The simple clock has a single arm, fragmented in three parts, representing the hours, minutes and seconds arm all correlated and pointing in the correct direction at any time. 

In this simple experiment I attempt to recreate the motion of the arms of this clock in Silverlight 3.

See the experiment here...


by Miguel Moreno

6. July 2009




Vacheron Constantin watch experiment..

This morning I ran across an article about some watches and there is one that caught my attention. It is a Vacheron Constatin Mercator America and it is a beautifaul watch. A bit pricey, but if I ever have $47.500 that I don't need, maybe I'll get it some day.

The hands of the clock represent what are called nautical dividers and are used by navigational officers to quickly determine distance on a maritime chart.

Here is my attempt at recreating the design of this watch in Silverlight: Vacheron Constantin Mercator America watch experiment.


by Miguel Moreno

Category: Programming | Tags:

27. June 2009




Web.Config inheritance tip...

web.config tipMainly writing this entry so I don't spend hours looking for a solution when I need it again, since I tend to forget rather quickly how exactly I solved a problem. In this case, I have a website that is ASP.NET 3.5 and a folder which contains a different .NET application. I understand that the web.config in the root of the site, will cascade down into the applications within by default. What if our application within uses different settings... how do we prevent the settings in the root to affect the child applications?

Well, I learned that this can be accomplished in two parts. First there is a somewhat undocumented trick to instruct IIS that we do not want the settings to be inherited by child applications. You will need to wrap your <system.web> tag in a new tag, named <location> with the attributes as shown below: 

<location path="." inheritInChildApplications="false" >
  <system.web>  
    [...]  
  </system.web>
</location>

Note that this will show a red squigly line in Visual Studio since the inheritInChildApplications attribute is unknown to VS. 

Now, this only seems to work with <system.web>...what if we need to do the same with, let's say the <configsections>...? Assume we are pointing to System.Web.Extension dll, version 3.5 in the root and we want to point to a version 1.1 in the childApplication? In that case, we cannot use the <location> trick mentioned above. Instead, we can to do a runtime binding redirect in the web.config of the childApplication as shown below: 

<configuration>
  [...]
  <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
              <assemblyIdentity name="System.Web.Extensions"
                                          publicKeyToken="31bf3856ad364e35"/>
              <bindingRedirect oldVersion="3.5.0.0"
                                       newVersion="1.0.61025.0"/>
          </dependentAssembly>
      </assemblyBinding>
  </runtime>
</configuration>

Enjoy!

by Miguel Moreno

4. May 2009




Google Android phone...

Although I have pretty much always had one, I have never really cared much for the functionality of a cellphone, other than what it was meant to do...like placing phonecalls. I have an uninteresting Motorola Rzr, so anything is pretty much an upgrade.

So I decide to get a new phone. Windows Mobile? no thanks. I have had experience with a couple of pda's and until Microsoft comes out with something completely new, I will not go through that again...iPhone? no thanks... and although I have an open mind to maybe sometime try anything that Apple makes, it seems that everyone has one and I would have to switch providers.

What else...: Google Android...? all my Google apps constantly synchronized? Built-in GPS and Google Maps...? Unlimited Internet via 3G in my area? I now understand what is so interesting about a smart phone. The amount of productive apps that are available, the variety of functions they can performs is impressive, especially the location-aware applications. The one drawback is that if I ever want to write an application for it, I am going to need to learn some Android OS and Java.

Other than that, I have had it for only a couple of days and really love it...


by Miguel Moreno

Category: Tools | Tags: ,

14. April 2009




Desktop fences...

FencesOn occasions, I come across some software that saves me a ton of time or help me be a bit more organized. Here is one that definitively helps me both ways.

I use my desktop as somewhat of a clipboard for temporary files and end up with a cluttered workspace. When it gets out of control, I then tend to create a folder called "old desktop" and must have several of these in my backups. 

This software allows you to create these regions or fences that hold your shortcuts and files together. You can create as many as you want and basically group your files. There is a ton more features and even more good products from their site. Oh, and did I mention it is free...?

Read more: http://www.stardock.com/products/fences


by Miguel Moreno

Category: Tools | Tags:

15. March 2009




Silverlight 2.0 Moonlander game...

MoonlanderA quick post here on an experiment that has taken way too long and maybe I have lost interest over time or it just became a bit more than a short experiment. In essence, it is a replica of the 1980's Moonlander arcade game.

I was shockingly surprised that Silverlight 2.0 does not have an obvious built-in HitTest or collision detection method for individual objects and the known workaround is quite clever, but somewhat less than elegant nor efficient, especially when checking many objects at the same time.   

I haven't really formed an opinion yet, since I may have overlooked features that are in the Silverlight 2.0 box and will post so, if I come across such feature. In any case, here is the game.

See it here...


by Miguel Moreno

Category: Programming | Tags:

22. January 2009




More free stuff from DevExpress...

DevexpressIn a previous post I had mentioned about 60 free .NET components available at no cost at all. These are high quality controls and I still have to try many of them. 

Well, looking for a Silverlight Datagrid, I came across Devexpress again and noticed they are offering these two compoent sets for free, including their source code. 

  • Silverlight Datagrid Control - here
  • Silverlight Menu - Toolbar controls - here

I used to love Xceed andComponentOne controls, but they are expensive and Devexpress has become one of my favourites since they make it nearly impossible not to try/use their components and become a fan of them...

I just thought I'd post this, because there aren't many Silverlight Datagrid controls and this one is free. I will likely be doing some experiments with these controls, as soon as I am done with another Silverlight experiment I am working on..


by Miguel Moreno

Category: Programming | Tools | Tags:

21. January 2009




What is the Windows Key for...?

Windows KeyI don't know...it is just a key that doesn't seem to do anything when pressed and it is just in the way. So many years staring at it and wondering what it was good for.

Well, it appears this little key is actually quite useful, as I have recently learned. By combining the Windows Key with other key, it allows you to perform frequently used task with hardly any effort. For example, to launch Windows Explorer, you may go to Start > Accessories, etc or maybe rightclick the Start button and select Explore or...... you could just hit Windows Key + E. That simple. Check out this list of shortcuts that I am sure you will start using, if you didn't know them already. 

[Windows Key] + L: Locks the workstation
[Windows Key] + E: Launch Windows Explorer

[Windows Key] + Tab: Cycle through the buttons in the Task Bar.

[Windows Key] + R: Launch the Run dialog box
[Windows Key] + Pause/Break: Launch System Properties dialog box

[Windows Key] + D: Minimize or restore all windows
[Windows Key] + M: Minimizes all open windows.
[Windows Key] + Shift + M: Undo minimize all windows

[Windows Key] + F: Launch Search for Files
[Windows Key] + Ctrl + F: Launch Search for Computers

[Windows Key] + U: Launch the Utility Manager

PS: In Office 2003 SP1 and 2007 the Windows Key has even more functionality. For example, by pressing Windows key + S in OneNote you can take an instant screen clipping - just drag the cursor over the area you want to "clip". Then paste the clipping wherever you need it.


by Miguel Moreno

Category: Tips for life | Tools | Tags:

25. December 2008




Another Silverlight clock experiment...

ExperimentAnother attempt at yet another approach of representing time in an unusual manner. I saw this clock implemented in Flash and wondered what it would take to do this in Silverlight. Let's call it Mark II...

Here is my attempt... Again, as with many of these experiments, I thought I could make something work in a matter of a couple of hours and, especially this one, took me a bit more than that. I managed to consolidate a lot of the repetitive looping into one single method that moves all gears... 

See it for yourself here...


by Miguel Moreno

Category: Programming | Tags:

18. December 2008




Silverlight Error when adding objects

Silverlight Instance NameI have done a couple of Silverlight experiments where I programmatically generate objects on the fly and then attempt to add them to the Canvas. In one scenario, I was trying to generate 10 circles, give them some properties and then add them to the parent object, a Canvas, in this case.

However, when I did this, I got the following runtime error: "{System.ArgumentException: Value does not fall within the expected range." right when I try to add the instances to the parent (Children.Add()).

I wasn't able to find out exactly why this is happening, but after some digging, I figured that this happens because the newly created object instances have not been given a name and therefore the runtime cannot dynamically add two instances with the same name, or no names, for that matter...

So, to avoid this run time exception, all you have to do is to give your newly created instances a name, thus, in our case, simply add:  e.SetValue(Canvas.NameProperty, <name>); to your loop...

for (int i = 0; i < 10; i++)
{
   Ellipse e = new Ellipse();

   e.SetValue(Canvas.NameProperty, "e_" + i.ToString());

   e.Stroke    = new SolidColorBrush(...);
   e.Fill        = new SolidColorBrush(...);

   e.Width = 10;
   e.Height = 10;

   LayoutRoot.Children.Add(e);
}

Not sure whether this is the cause and the fix for this issue, but it seemed to fix it...


by Miguel Moreno

Category: Programming | Tags:

14. December 2008




Two more Silverlight 2.0 experiments...

ExperimentsI have been meaning to get some more Silverlight 2.0 experience under my fingertips and have taken a couple of Sunday mornings to acomplish a couple of experiments.

Nothing spectacular, but interesting nonetheless.

  • Silverlight Clock: emulating the concept of a fantastic animated clock I had seen done in Flash.

  • Silverlight Snow: Figuring that I would see so many ads, banners and logos with falling snow, I figured I ty my own approach. 

Stay tuned, as I will be working on more Silverlight experiments in the near future..

Read more...


by Miguel Moreno

Category: Programming | Tags:

1. December 2008




Joining Microsoft...

Microsoft StoreWell, that didn't take very long... a good opportunity presented itself almost immediately and although I was hoping for some downtime, I have decided to accept a job offer at Microsoft's headquartes in Redmond Washington.

I will be joining the development team of the brand new store.microsoft.com site as a web developer starting tomorrow. The store was launched just a couple of weeks ago and provides an online presence where one can buy any Microsoft product directly from the source.

It sounds like a great opportunity that I don't want to let pass....


by Miguel Moreno

Category: | Tags:

20. November 2008




Added a couple of SharePoint Experiments...

SharePoint ExperimentsNot really experiments, but two brief articles I had been meaning to write for some time, simply to share some interesting approaches to developing Features for SharePoint:

  • A handy approach to automating your build process when writing a Feature: deactivation, uninstallation, unregistration, registration, installation, activation and recycling the application pool, all in one easy step.

  • Automatically extract data from an InfoPath form when uploaded to a SharePoint Form Library. Indispensable approach, especially when automating business processes or integrating non-homogenous enterprise applications.
Check them out here...

by Miguel Moreno

Category: Programming | Tags: ,

19. November 2008




Microsoft Silverlight 2.0 Progress...

Flash vs SilverlightAlthough it is undeniable that Silverlight has made quite an impact and, apparently been embraced without much resistance, it still has a long road ahead to catch up to its rival: Flash. As Scott Gu points out in his blog, more and more Rich Internet (and non-Internet as well) Applications are being written in Silverlight and the technology is becoming mainstream with the big names.

On the other hand, Flash has clearly the upper hand. More than 10 years in the business and a platform that can be embraced by non developers, gave them a long early start.

Just looking at the demand for developers in either realm on Monster.com gives you the picture:  Flash (2241) vs. Silverlight (178).

A few good articles comparing these two platforms can be found here, here, here and here.

So, as a developer familiar with both technologies, on which one would you concentrate...?


by Miguel Moreno

Category: Programming | Tags: ,

14. November 2008




Looking again...

AcquisitionWell. While on my vacation OpenText finalized the acquisition of Captaris, for which I have been working for four years and...let's just say my badge stopped working when I returned. 

I am on the lookout again, dusting off my resume and working on some more experiments to learn new technologies and proof my skills.

I have gained a tremendous amount of experience in solutions engineering, enterprise software development, integrations and business process automation and am not quite sure in which area I will focus my searches.

More to come...


by Miguel Moreno

Category: Tips for life | Tags:

12. November 2008




6 tips from Europe....

EU For our 10 year wedding anniversary, I decided to take my wife to the places I grew up in and maybe try to explain some of my behaviors she has never quite understood.
We visited Holland, France, Italy and Spain seeing friends and family and covered quite a bit in two weeks.

We just got back today and here are a few thing I learned from this trip that you might find useful: 

  • Don't rent a car unless you are very familiar with the driving style and the roads. Unlike in the US, the lanes are narrower, drivers are more aggressive, the streets are not organized by cardinal points (N,E,S,W) and are mostly named and not numbered. Prepare to use all your reflexes avoiding cars, scooters, bycicles and pedestrians in poorly marked and/or respected lanes. Also, gas is incredibly expensive and the likelihood that you'll spend much time of your vacation stressed, either finding your way around or simply finding a parking spot is high. Instead travel by public transportation. The rail system in most of Western Europe is highly evolved and you can get to pretty much everywhere, if you know how to connect.
  • Don't eat at the main tourist attractions. The food and drinks might be appealing, but if you walk a few blocks away, into the backstreets, you will find food that is much more authentic in flavor and price. You will also find friendlier people, unless, of course, you walked into the wrong back alley….
  • Don't measure the hotel star system by the same rule as in the US. It seems to me that a two star hotel in Europe is much more likely to be cleaner and adhere to a higher standard than a two star hotel in the US.
  • Make an effort to communicate. Educated in Europe and at 15 years of age, I already spoke 4 languages, but a large percentage of people educated in the US, only speak English. The instinct is to speak in English anywhere, assuming everyone else does too. This may be perceived as arrogance by a local and you'll get a much friendlier reaction if you start out by making any, I mean any, attempt in the local language. After they realize you are destroying the grammar of their beloved language they'll usually switch themselves and be friendlier and more helpful to your requests. 
  • For long flights, check seatguru for power ports. Most airlines now offer power ports in Economy class every other row. Make sure you reserve a seat in a row with a power socket, just in case.
  • Last, try the local stuff. Don't order food or drinks that you can get in your home country. Experiment and ask the waiter to surprise you with his favourite dish or drink. You'll be amazed how many free drinks or samplers you can get with this approach...
Enjoy!

by Miguel Moreno

Category: Tips for life | Tags:

13. October 2008




Microsoft Releases Silverlight 2...

Silverlight 2.0"Microsoft Corp. today announced the availability of Silverlight 2, one of the industry’s most comprehensive and powerful solutions for the creation and delivery of applications and media experiences through a Web browser.

Silverlight 2 delivers a wide range of new features and tools that enable designers and developers to better collaborate while creating more accessible, more discoverable and more secure user experiences."

Read more: press release.


by Miguel Moreno

Category: Programming | Tags: ,

23. August 2008




Bug tracking software

BugsI am evaluating several bug tracking/project management software packages and have found a couple of interesting one that seem very robust and are quite popular.

Even better, I have found that two of these offer some sort of free version of their paid product, being the amount of users, the only limitation...

  • OnTime 2008 by Axosoft.
    Offers a single developer edition for free (details here and here).

  • FogBugz by FogCreek software.
    Offers a trial that (via workhappy.net) can be enabled to work fully functional for two users in student and startup edition  (details)
Enjoy! 

by Miguel Moreno

Category: Tools | Tags:

14. August 2008




Intellisense not working in Visual Studio...

"IntelliSense is Microsoft's implementation of autocompletion, best known for its use in the Microsoft Visual Studio integrated development environment. In addition to completing the symbol names the programmer is typing, IntelliSense serves as documentation and disambiguation for variable names, functions and methods using metadata-based reflection." (Wikipedia)

So, I can't quite remember when exactly Intellisense stopped working for me in Visual Studio 2008, but I know I have been without (automatic) Intellisense for quite a while.When typing a dot after an object or method, it used to just show up automatically... I could however have it come up by pressing <CTRL><SPACE> and eventually got in the habit of just doing that when I needed it, without attempting to find out exactly why it was broken in the first place...

So, several months later, I stumble upon an entry by Richard Fennell, who explains how to fix it. I thought I'd post it for when it breaks again, I know where to find the answer...

In Visual Studio 2008, select Tools > Options > Text Editor > All Languages. Ensure that the checkboxes in the Statement Completion section are actively checked (not grayed out).

That is it!. Click Ok and try it.


by Miguel Moreno

Category: Programming | Tags: