Skip to main content

Posts

Keeping web development skill up-to-date

I recently came a cross a blog post from women trying to learn codding, and she decided that the best way to achieve her goal was to build website. In fact she has been creating one website per day for 180 days ( blog.jenniferdewalt.com ). Her post got me thinking, in my case I'm a developer, I've been developing websites, software tools, Mobile phone / Tablets apps, Excel plugins, Web scrappers.... But all this was for the benefit of a client. I realised that I've never published my own website. At the time I was mainly focussing on Non web technologies, but I was keen to keep my skills up-to-date on web developments. So I decided to follow Jennifer's lead, but not so extreme, rather than having such an aggressive time frame, one website per day, I did not set a time target but just decided to start building websites, the only constraint I've set was to use recent technologies and create something useful. The first website is a pretty basic web site that provide...

ScrolleViewer ComputedVerticalScrollBarVisibility Dependency Property

I recently came a cross a request where I had to show a WPF control only when the Vertical Delete repeated wordbar was visible, after looking at ScrollViewer on MSDN I found that it has a dependency property that indicates whether the vertical scrollbar is visible (a similar property exists for horizontal scrollbar): ComputedVerticalScrollBarVisibility Here is a sample XAML I using this property: < ScrollViewer VerticalScrollBarVisibility ="Auto" HorizontalScrollBarVisibility ="Auto">             < Button Command ="{ Binding Command}"                      Visibility ="{ Binding RelativeSource ={ RelativeSource FindAncestor , AncestorType ={x:Type ScrollViewer }}, Path = ComputedVerticalScrollBarVisibility }" />     </ ScrollViewer >

aspnet_regiis

The current identity (.......) does not have write access to 'c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files' When configuring a web site on IIS, I had this issue and I know how to resolve it by using a command line tool, but I always spend 5 or 10 minutes looking for the name of the tool in the internet: Here is the name of this tool and it's location: C:\WINNT\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis And we need to use it with these parameters to grant the right to the user running the application pool: C:\WINNT\Microsoft.NET\Framework\v2.0.50727> aspnet_regiis –ga username

Local IP Address

Here is a usefull block of code to retrieve a host IPAddress: private static class Network { #region DNS public static IPAddress FindIPAddress( bool localPreference) { return FindIPAddress( Dns .GetHostEntry( Dns .GetHostName()), localPreference); } public static IPAddress FindIPAddress( IPHostEntry host, bool localPreference) { if (host == null ) throw new ArgumentNullException ( "host" ); if (host.AddressList.Length == 1) return host.AddressList[0]; else { foreach (System.Net. IPAddress address in host.AddressList) { bool local = IsLocal(address); if (local && localPreference) return address; ...

Understanding Monte Carlo Simulation C#

This method has been introduced to resolve numerically complex physics problems, such as neutron diffusion, that were to complex for an analytical solution. This method is based on generating random values for parameters or inputs to explore the behaviour of complex systems, now this method is used in various domains like: Engineering, science and finance. These approaches tend to follow a particular pattern: 1- Define a domain of possible inputs. 2- Generate inputs randomly from the domain using a certain specified probability distribution. 3- Perform a deterministic computation using the inputs. 4- Aggregate the results of the individual computations into the final result. Here is an example of using Monte Carlo simulation to approximate the value of Pi: In this case we have 2 parameters x,y which defines a location in the plane (e.g The picture on the left). We will calculate the probability to have a point in the 1/4 Circle area, with a radius of 1. To calculate Pi we...