Sunday, 30 August 2015

Moving your firefox profile after a clean install of Windows 10

After the awesome flawless upgrade to Windows 10, and knowing that I can now do a clean install and still have windows 10 activate afforded the re-install.

However an excellent question to ask is 'moving your firefox profile after a clean install of Windows 10'. You want all your extensions, bookmarks etc to come over, not just your bookmarks.

Hunting on the internet didn't yield much. Most options revolved around exporting the JSON file for your book marks. This information probably does exist somewhere but here it is anyway.

First go to the drive your windows is sitting on (Windows 7 and up). Head to <your windows system drive>:\Users\<your user>\AppData\Roaming\Mozilla\Firefox\Profiles
You will see a cryptic looking folder inside looking something like z8h0c3kh.default
Make a backup of that folder. The cryptic looking name will be important later on.

Perform a clean install of Windows 10, then install Mozilla Firefox. Run Firefox at least once and exit.

Go to the same folder as above: <your windows system drive>:\Users\<your user>\AppData\Roaming\Mozilla\Firefox\Profiles

Copy the backup you made earlier into that folder.

Now go back one level so you are at: <your windows system drive>:\Users\<your user>\AppData\Roaming\Mozilla\Firefox\
Edit the file "profiles.ini" in that folder.
It should look like :
[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=1
Path=Profiles/d9jf63k8.default
Default=1
 Change the line "Path=Profiles/d9jf63k8.default" to "Path=Profiles/z8h0c3kh.default"
In the above example, replace the cryptic looking name I have here with the one on your folder from earlier.

Now if you load Firefox everything should be there. Your bookmarks AND extensions, plugins, themes.

It will be as if Firefox was never un-installed, all the while enjoying your CLEAN install of Windows 10!

Tuesday, 25 August 2015

Windows done right

Ahhhh, local account on Windows 10, Finally!

I didn't like windows 8 and 8.x's idea of "logging to the netz" method of logging to get full benefit. You could create a local account there though but windows 10 has a lot less restrictions, and apps downloaded will work without signing in. I now have two accounts. One local for most of my stuff, and one connected for the "rest of the stuff". I like this harmony and it works for me; I will use my local more than the connected.

I digress now, my windows digression.

Also after much study on how my windows systems behaved from windows 7 on wards and with prior experience with Windows XP and down, I found something interesting.

I am a gamer, yes I am, I love games, I love the artistic expressions in games, I love the technology and the intrigue. I LOVE DEVELOPING THEM.

So I am naturally going to look for the best gaming experience and I have done so since 1995. In the "good ol' DOS" days I created a config.sys and autoexec.bat combination with menu to select which "mode" I wanted the computer to boot in. Windows 3.1 would load in the "normal" option where as games would load in a different mode and of course would not launch windows 3.1. Wow back in those days it was inconceivable to run big games from windows 3.1.

Transporting to windows 95 and "boot into dos" was used, along with its hardware profile settings for windows based games. Come windows 2k (eew 98, eeww ME, never got those!) it was time for dual booting. So the dual boot menu selected from Linux, Windows Main and Windows Game. Windows XP pro, same thing. Windows 7 pro Same thing (eeww Vista! never got past the technical preview). However in windows 7 pro I noticed something different. Previously I had to re-install windows to get it stable after using it for some time, and to make it work quicker. Windows 7 suffered less so of this problem. Infact after a while I began installing games on Windows 7 Main and comparing it to the Game boot version. No matter how much I used windows 7 main and installed stuff, I was not getting a frame hit difference. It seemed to be much better behaved than previous versions.

Ultimately windows 7 professional became the last windows OS to have multiple copies installed on the same computer, which could be used only one at a time. With windows 10, there will be one instance, and as always, on a separate drive dedicated for OS's only. Finally I can say, going from windows 3.1 up, that you can run games in windows proper. I do not envision needing a reformat, or another boot just for games in windows 10. Too early to say "Windows done right"? Perhaps, but given my experience with OS's for over 20 years from old BBC computers, Amiga's, Linux, DOS, Windows, I am confident that this time, it is going to be how I think it is going to be...Windows done right.

Tuesday, 28 July 2015

How to get your FREE Windows 10


You might have heard of Windows 10 coming out. What you may not have heard is that if you have a "qualifying" version of windows installed, you are eligible for a FREE upgrade to Windows 10. This will also depend on whether your system can handle it.

If you have Windows 7 through to windows 8.1, you may have noticed a windows flag that has come up in you notifications area. If you hover your mouse on it it will say "Get Windows 10"
Here is my blog post with a screenshot showing where:
http://techdistillate.blogspot.co.nz/2015/06/something-interesting-has-appeared-in.html

Click on that windows icon and REGISTER your system. When windows 10 gets released, you will be notified.

If you do not have that icon in your task bar and you have a qualifying Windows version then you need to do the following:
1) Perform ALL your updates using windows update.
2) If the windows icon does not appear by the next day following your update perform the steps on this website:
http://answers.microsoft.com/en-us/windows/forum/windows_10-win_upgrade/i-want-to-reserve-my-free-copy-of-windows-10-but-i/848b5cce-958b-49ae-a132-a999a883265b?auth=1

NOTE: It is better to register windows 10 even if you are not sure if you want to upgrade. The simple reason is that once you register, you have up to one year to install it after its release. Hence there is no obligation to install it after you register.
You can to do this by the 29th of July (not long now from time of post!)
If after doing all this you do not see the "Get Windows 10" icon in your notifications area then it is likely that your system has been detected to be incompatible with Windows 10. After the 29th of July 2015, the icon should appear according to Microsoft, to provide you the option to register for Windows 10, but this will not infer that your system has become compatible.

Good luck with your upgrades!

Thursday, 4 June 2015

Something Interesting has appeared in my notification area

Something interesting has appeared in the notification area of my windows 8.1 task bar.
Can you spot it in the picture below? -Click on Image to enlarge.

Time to do some backup and prepare!

Monday, 11 May 2015

A New Begining

To be precise, a Brand New Begining.

Not long ago I posted this:
End of a fantastic Server 2000-2015

Since then I have been looking at what I can get to replace it. I have a US Robotics Router that serves as the internet gateway, I need a gigabit Ethernet switch (my current one is 100 Mbps), it will draw considerably less power than my Server did, but provide many functionalities that are important for me.

After long tiresome searches and consulting with people who have owned network devices from interested brands, I came across an alien face hugger; Whoops, I mean a Netgear Nighthawk X6 R8000.
Behold:
Ahh the sight and smell of new gear!

In the picture above is the face hugger, along with Belkin surge protector (I need the extra sockets), and a Western Digital 1 TB 2.5" USB 3.0 HDD. Wow what a mouth full that was!

Here is what I wanted:
-Good filtering and well configurable firewall.
-Network sharing my printer.
-Some kind of NAS like functionality to a connected drive.
-God awesome Radio for wireless.
-Built in Gigabit switch

Here is what the Netgear Nighthawk x6 R8000 delivers:
-All of the above.
-THREE RADIOS with the ability to join the 5GHz radios for automatic channel balancing.
-BONUS unexpected awesomeness: I can segment my network between the LAN side and the WAN side!
-BONUS expected(from reading specs) awesomeness: FTP server I can access from the internet as well as internal network.
-BONUS expected(from reading specs) awesomeness: TIVO media server compatible!

If I were asked to describe this awesome face hugger in one word, it would be "Incredible".

I can list and talk about all its features but that would be a large post, so I will only talk about the features important to me. You can read the full awesomeness, eh, I mean specs on the Netgear website.

On my server, one of the cool things I liked was the network segmentation that kept the internet side of the network different to the LAN side of the network. When setting up the netgear router I found that what it called Internet setup is really a WAN/LAN bridge. As a result, the ip addresses need to be different for the router(X6) and your gateway (modem, fiber modem, etc). My US Robotics allows a VLAN to be created which can be on a different network than its own network. What I did was do just that, the VLAN on the USR is on the X6 side of the network(my LAN) and the USR's address is on a different network. The USR itself creates a WAN bridge to the ISP but this is invisible to the X6 and it doesn't care either. So in the internet setup of the X6, I assigned an ip address for the routers network side and a gateway which is the USR's router address. I can still access the USR via the VLAN address for maintenance allowing me to disable internet remote access for security. Connecting wireless devices use the address provided by the X6 via its DHCP and get given the gateway address that is on the USR's lan side.

There is another advantage to this segmentation. I can fully utilise the firewall functions of both routers. More than that, I can setup the FTP service on the X6 and rather than fiddle with its accessibility, I can simply turn on or off the pinhole on my USR. DNS services are provided by the USR, which the X6 happily passes to connecting devices.

It just works, and works wonderfully. I checked the range and found that the 2.4 GHz radio gets me to about 30 Metres, and the 5 GHz radio manages 14 Metres. This is despite having the router placed inside an old concrete building! The 5 GHz range is lower because usually the lower frequency will travel further than the higher frequency, so not even this router can change the laws of physics. However in saying this, the stability and range seriously blows away any wireless devices I have owned.

It was so easy to configure the external hard drive. In fact it was so easy, you just plug it in and that's it, you have network shared drive! The only time you will need to change the work group on the router is if you use a different Workgroup for your windows computers. That is the only thing I changed.

Of course, I know what you are REALLY waiting for, you want to see the un-boxing pictures.
Well, here they are:
First opening of the box

What is sitting underneath the router in the box

Top view straight out of the box. The black strips on the label is my paint program edit so you don't eyeball stuff where it says no stuff eye balling. mmk?

Bottom view

Rear view

First power on!

It is now settled in to my place. Shes mine now!


I still miss my Linux sever and it will still return one day, but the Netgear Nighthawk X6 R8000 does a damn good job of replacing it at a considerably reduced power consumption. It is by far the best network product I have ever owned (previously my USR). Well done Netgear with this one! Cant wait to see what they will think of next!

Saturday, 2 May 2015

C# Parameters, Value or Reference? -Explained.

C# Pass by Reference vs value

C# is one of my favorite languages with a chief architect that is also my favorite language designer. After working with C# for some time, I know C# pretty well however being an expert in it is something I am yet to achieve. There are so many things to remember about it that you really need a reference nearby. Alternatively you can browse blogs by blog posters posting their experience with the language! The other equation of programming is good design patterns so this brings me to another part of C# that I like. It makes it quite intuitive to implement design patterns such as three-tier Programming Architecture.

Recently I had a discussion with someone about whether C# passed by reference or value. It isn't a simple an answer as one would expect at the onset, however I'll explain with examples.

Firstly what does the C# specification say about parameter passing?
C# specification 1.6.6 (Version 5.0) states that parameters are passed by value. This is where the confusion arises.

Consider:
private void PassByValue(int index)
{
    index = 10;
}
What happens in the above code? The original Index remains unchanged but the index inside the method changes to 10. This is the correct behavior as outlined in the C# Specification.

The confusion arises when we do this:
private void PassByValue(int[] index)
{
    index[0] = 10;
}
What happens in the above code? In the first example and according to the C# specification if not well understood would have you believe that  the array "index" was passed by value, correct. That changing the value inside the method for cell one will not change the original, which is incorrect!

So what happens is that C# passes everything that is not a primitive, implicitly, as reference. If I just left it at that, then that statement is not entirely correct and that is where the confusion arises. When is a value not a value? When it is a reference! The array is actually a reference to memory location and when you pass the array to the method, you are passing the "value" of that reference to the method. Hence when you change a "cell" inside the array, you are changing the value pointed to by the reference. Since the original reference is not broken this change is reflected in the original. However if you changed the "value" i.e you changed the reference which was passed by value, you are breaking that therefore the original remains unchanged and you are working on a "new" reference.
Hence if you did this:
private void PassByValue(int[] index)
{
    index = new int[1];
    index[0] = 10;
}
In the above code, the reference to the original is broken. You are now working on a new reference and changing this will have no effect on the original. This does not break the C# specification because you passed by value, except in this case that value is the reference. Also the original is not left "dangling" simply because in C#, much like java, an object is never GC'ed if there is still a reference to it (the calling scope in the above example).

In order to maintain the changes you make to an object in C# in the original passed from outside the method, you need to tell C# that you want to pass a reference to a reference and that is done using the ref keyword.
The code below:
private void PassByReference(ref int[] index)
{
    index = new int[1];
    index[0] = 10;
}
The code above will reassign the reference the original is pointing to, to the new location created in-scope of the method it was passed to. So cell 0 of the original will show the value changed to 10.
This is also another advantage of C# over C++. If you did this in C++ you will get a "dangling pointer" where by once the method goes out of scope, the "new" object created inside the method is destroyed, but the original pointer is changed to point to nothing. This also highlights why C# is considered a "safe" language (Chapter 18, Paragraph 1, C# Language specification version 5.0).

If you do not understand this behavior correctly, you will either abuse the use of "ref" and "out" Modifiers or you will create a bug in your code and have trouble finding out and even understanding what went wrong.

Here is another example:
//Class for testing.
public class DataStorage
{
    public string FirstName; //Field
    public string LastName { get;  set; } //Property
}

//The test Method
private void TestCase(DataStorage ds)
{
    ds.FirstName = "John";
    ds.LastName = "Smith";
}
In the above example, the DataStorage instance passed by the caller to the TestCase Method will have its members changed to reflect the new values set by the method. If you print the original in its respective order, it will print "John Smith". It does not matter whether the members of the class are fields, properties, other class instances, they will all behave exactly the same way. Once again, it does not break the C# language specification.

This can also cause problems with 'Deep Copy'. If you created a copy method that that copies all of an objects members and some of them are objects, then the original and the copy will share those objects members. So a Deep copy may end up actually being a shallow copy - oho! a trap! A good way to avoid that is to do a Deep Copy as a clone copy where there is a bit-by-bit copy of the entire object into a new object. This means new references and new locations. It isn't hard to do and you can achieve this in 10-13 lines of code regardless of how many members you have in the object being copied! I use bit-by-bit on any of my objects I want a deep copy on. In saying that, however, I  have rarely needed to use deep copy and good program design can reduce or eliminate its needs. If you find you need to make a Deep copy, maybe it is time to re-evaluate your design and refactor it.

So to summarise, primitives have their values passed, where as objects have their reference passed as value.  In order to assign a new reference to a closure variable (external variable passed to the method) you have to explicitly tell C# this is the intended behavior.


Sunday, 19 April 2015

Auckland Harbour Bridge, New Zealand, wired up as a VU Meter

Celebrating the City's 175th anniversary a mobile telecommunications company, 2-Degrees, wired up the bridge with more than a 1000 LED lights. People can request their songs on the 2-Degrees app and then watch it play out on the bridge. This will only stay on until 25th April and runs each week from Thursday to Saturday.

It was truly an amazing sight to behold from the Silo Park Waterfront in Auckland City when I saw this on Saturday the 18th of April. Being there is an amazing experience with the 2-Degrees speaker playing out the tune as it is being rendered in VU meter style on the bridge with cars passing on the bridge. It certainly draws a crowd making for a party like atmosphere which is absolutely spectacular.

Thanks to whoever at 2-Degrees thought this up! and the only thing I can say is, "please Mr Mayor, can we make this permanent?"

Enjoy the short video I took with the best camera in the world (The best camera in the world is the one you have with you; in this case my phone the Nokia Lumia 830).