Wednesday, November 08, 2017

Vodafone Sure Signal - No smoking please!

I've just had my Vodafone Sure Signal V3 blow up with a little puff of smoke. Fortunately I was sitting right next to the thing when it popped and I was able to unplug it pretty quickly! It rattled once unplugged! I opened it up and found a capacitor that had blown itself off the board. The interior was filled with smoke, see burn marks in the photos below.

I've contacted Vodafone via Twitter. Let's see what they do about it. Hopefully it's not a fire risk for others!

The label says it's an Alcatel-Lucent Model Number : 9361 Home Cell p3.0, Part Number : 3JR09113ABBA

I notice there is a big thread on the Vodafone UK Sure Signal forums with loads of people who have had exactly the same problem.

10 Nov Update
I am pleased to report that Vodafone have agreed to send a replacement SureSignal free of charge (regardless of the warranty status). It'll apparently be delivered within 3 days. Given the unit does not have a replaceable fuse I'll be plugging it into an extension block with a very small fuse fitted to the plug. In my case the old unit tripped the downstairs circuit breaker (which also has the fridge and freezer attached). Had it blown when I was not at home it could have had far greater and more costly consequences (not to mention the potential fire risk). I'm not totally comfortable with the design of the SS3 as it runs very hot, this will always shorten the life of any electronic components. However, I have no Vodafone mobile phone signal where I live (high tech Cambridgeshire) and need to use the phone for work so I have little choice but to use one. I think powering it from a power strip with a very low current quick blow fuse will be the best way to reduce the risk associated with using this product.

13 Nov Update
A free of charge replacement unit was delivered today. I've reported the fault to Trading Standards and they are contacting Vodafone to report another failed unit.

16 Nov Update
I've made a short extension lead and fitted a small 1A fuse to the plug. Hopefully this will stop the whole power circuit tripping out if (when) this new SureSignal fails.

Monday, July 03, 2017

Dell XPS 15 (9550) swollen battery

I have had a problem with a swollen battery on my Dell XPS 15 (9550). The battery swells as it fills with gas. This swollen battery pushes the trackpad up 3 or 4 mm beyond the case (see photo). The trackpad then stops working. Dell advised me to stop using the laptop and remove power from it. For safety I have removed the battery until a replacement is received. See video below

Sunday, June 05, 2016

Simple WPF app using Task and Await with .NET 4.5

Here is a simple example showing how to create background tasks in a WPF app with .NET 4.5 and above. This is so much easier than the old BackgroundWorker approach.

<Window x:Class="TestAsyncTasks.MainWindow"
        Title="MainWindow" Height="350" Width="525">
 <Grid Margin="4">
   <RowDefinition Height="Auto"></RowDefinition>
   <RowDefinition Height="*"></RowDefinition>
  <StackPanel Grid.Row="0" Orientation="Horizontal">
   <Button x:Name="ButtonStart" Content="Start" Click="Start_Click" Padding="4"/>
   <Button x:Name="ButtonCancel" Content="Cancel" Click="Cancel_Click" Padding="4"/>
  <TextBox Grid.Row="1" x:Name="Label1"></TextBox>
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
namespace TestAsyncTasks
 /// <summary>
 /// Interaction logic for MainWindow.xaml
 /// </summary>
 public partial class MainWindow : Window
  public MainWindow()
  // To allow background task to be cancelled with cts.Cancel()   
  CancellationTokenSource cts;
  private async void Start_Click(object sender, RoutedEventArgs e)
   // Disable button so it can't be clicked again until finished  
   ButtonStart.IsEnabled = false;
   Label1.Text = "Start\r\n";
   // Setup the function to be called with updates     
   var progressUpdate = new Progress<int>(ReportProgressOnUIThread);
   // Create a new CancellationTokenSource and optionally set a time 
   // when the task will automatically cancel if it has not already 
   // finished.              
   int AutoCancelAfterMS = 50000;
   cts = new CancellationTokenSource(AutoCancelAfterMS);
   // Must be in Try/Catch to trap the OperationCanceledException  
    int loopTo = 10;
    int result = await MyBackgroundTaskAsync(loopTo, progressUpdate, cts.Token);
    // This code does not run until MyBackgroundTaskAsync finishes 
    Label1.Text += $"Final result : {result}\r\n";
   catch (OperationCanceledException ex)
    // Do stuff to handle the cancellation exception    
    Label1.Text +=  "CANCELLED\r\n";
   catch (Exception ex)
    //Do stuff to handle other exceptions       
    Label1.Text += $"Exception : {ex.Message}\r\n";
   // Reenable Start button           
   ButtonStart.IsEnabled = true;
   Label1.Text += "Finished\r\n";
  private void Cancel_Click(object sender, RoutedEventArgs e)
  async Task<int> MyBackgroundTaskAsync(int DataFromParent, IProgress<int> progress, CancellationToken ct)
   int result = await Task.Run<int>(async () =>
    for (int n=0; n< DataFromParent; n++)
     //You cannot do this because it's running on a non UI thread
     // Label1.Text += $"{n} I don't work!\r\n";
     // Throw OperationCanceledException if cts.Cancel() called 
     // Report progress back to UI thread      
     // Do the slow things in the background     
     await SlowStuff();
    // result gets this value which is returned as final result 
    return 42;
    }, ct);
   return result;
  async Task SlowStuff()
   // Simulate some slow code. This runs on a background thread.  
   await Task.Delay(1000);
  void ReportProgressOnUIThread (int value)
   // This runs on the UI thread so it can update the WPF controls 
   Label1.Text += value.ToString() + "\r\n";

Tuesday, November 10, 2015

Dell PremierColor Display Splitter on XPS15 9550

I've been setting up a Dell XPS15-9550 today. It comes with Windows 10 and the most awful Dell addin you have ever seen. I normally use Dell because they refrain from adding too much crapware or useless third party apps. However, this addin, enabled by default, is awful. It adds a popup menu whenever you try and drag a window (or dialog box or popup borderless window) to reposition it on the screen. It's totally unnecessary as Windows 10 already includes a perfectly good "Windows Snap" feature. The popup window is always "in the way" and when you release the mouse the window then flies off to an illogical place on the screen. Truly awful UI design.
Finally I've worked out how to stop it. It turns out it's a feature of "Dell PremierColor". To disable this right click on the "Dell PremierColor" icon in the notification area and select "Disable Display Splitter".
Why oh why are you including this enabled by default? Crazy. Please ensure it is disabled by default ASAP at it is confusing and totally unnecessary.

Wednesday, October 21, 2015

Getting field names from anonymous types using WPF DataGrid

Often it is useful to use a bit of LINQ to prepare data for display in a WPF control. Here is a very simple example. The WPF window contains a DataGrid used to display the data.

<Window x:Class="DCView.Window15"
        Title="Window15" Height="300" Width="300" Loaded="Window_Loaded">
        <DataGrid x:Name="DataGrid1" AutoGenerateColumns="False" SelectionChanged="DataGrid1_SelectionChanged">
                <DataGridTextColumn Header="Number" Binding="{Binding NumberX1}" />
                <DataGridTextColumn Header="Number x 10" Binding="{Binding NumberX10}" />

The data might be prepared for display with a bit of LINQ. A new anonymous type is created using field names that are then used in the WPF control bindings.

private void Window_Loaded(object sender, RoutedEventArgs e)
 List<int> data = Enumerable.Range(1, 10).ToList();
 var query = from d in data
      select new { NumberX1 = d, NumberX10 = d * 10 };
 DataGrid1.ItemsSource = query;

The problem comes when you respond to selection changed events. How do you get to the fields in the anonymous type. You could create a new class instead of using the anonymous type but the advantage of LINQ is it is quick and easy.

private void DataGrid1_SelectionChanged(object sender, SelectionChangedEventArgs e)
 dynamic dynamictype1 = DataGrid1.SelectedItem;
 int number = dynamictype1.NumberX10;
 Title = number.ToString();

The problem is DataGrid1.SelectedItem returns an object and you can't cast it to an anonymous type. To solve the problem you can use a bit of dynamic black magic to get to the fields in the anonymous type. The example above shows how to use dynamic to get to the anonymous fields. There is no Visual Studio Smart Completion to help but as long as the field names match it will work.

Saturday, February 07, 2015

Changing the rear light cluster on 2013 VW Sharan (VW part VAG 7N0945096G)

A Cambridge cyclist managed to smash the rear light cluster on our car on Thursday night (thanks for riding off without having the courtesy to stop!). A new one is just £73 and really quite easy to fit yourself once you know this little trick.
The 12V power socket slides down to reveal a single screw that holds the light cluster in place. Press the top of the 12V socket  panel and slide it downwards. 
Using a 11mm socket set simply unscrew the central white nut which holds the light cluster in place. Once the light cluster is unscrewed unclip the power cable and replace the light unit. Total time about 5 minutes.
Sorry for a slightly random blog post. Please let me know if it was helpful to you!

Thursday, September 11, 2014

The Ultimate Times Table Excel Spreadsheet!

It's that time of year again. The kids are back to school and it's time for them to learn their times tables. Please find below an Excel spreadsheet that you can use to print out a sheet of random times tables (multiplications and divisions).

To use the spreadsheet simply select which times tables should be included from the yellow cells on the first tab.

Then switch to the "Random Multiplication" or "Random Division" tab and print. Job done!