Ultra's Brain dump What would UltraL0rd do?

14May/100

Project Euler : Problem 6 Solved

Problem 6 of Project Euler is super easy.

The Problem is as follows :

"Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum."

No tips required!

Project Euler Stats :

Total Research Time : 0 Days
Total Coding Time : 5mins
Total Code Execution Time : 0ms

14May/100

Project Euler : Problem 3 Solved

Problem 3 of Project Euler is quite the problem.

Sure it would be easy to solve if you had 30mins of Program Running Time to waste, but seeing as your total execution time shouldn't be larger than 1 min, 30mins just isn't going to cut it.

The Problem is as follows :

"What is the largest prime factor of the number "600851475143".

The first question that came to mind was : "How the hell do I even work with a number that large?" Java's "native" number classes (Integer, Long, Double) can't handle numbers that large!!

Obviously I'm not going to just dish out the answer to you, but here are some tips to get you started :

  1. Look into java.math.BigInteger
  2. Research "Sieve of Eratosthenes"
  3. Remember that you are looking for a PRODUCT of factors. So you don't need to loop through all 600851475143 numbers, and get an entire list of prime factors. You only need to iterate until the product of the collection of your prime factors is equal too that number.

Project Euler Stats :

Total Research Time : 1 Day
Total Coding Time : 10mins
Total Code Execution Time : 47ms

26Mar/100

Remove the Microsoft .NET Framework Assistant (ClickOnce) Firefox Extension

The Microsoft .NET Framework 3.5 Service Pack 1 update, pushed through the Windows Update service to all recent editions of Windows in February 2009, installs the Microsoft .NET Framework Assistant firefox extension without asking your permission.

This update adds to Firefox one of the most dangerous vulnerabilities present in all versions of Internet Explorer: the ability for websites to easily and quietly install software on your PC. Since this design flaw is one of the reasons you may've originally chosen to abandon IE in favor of a safer browser like Firefox, you may wish to remove this extension with all due haste.

Unfortunately, Microsoft in their infinite wisdom has taken steps to make the removal of this extension particularly difficult - open the Add-ons window in Firefox, and you'll notice theUninstall button next to their extension is grayed out! Their reasoning, according to Microsoft blogger Brad Abrams, is that the extension needed "support at the machine level in order to enable the feature for all users on the machine," which, of course, is precisely the reason this add-on is bad news for all Firefox users.

Here's the bafflingly-convoluted procedure required to remove this garbage from Firefox:

  1. Open Registry Editor (type regedit in the Start menu Search box in Vista/Windows 7, or in XP's Run window).
  2. Expand the branches to the following key:
    • On 32-bit systems: HKEY_LOCAL_MACHINE \ SOFTWARE \ Mozilla \ Firefox \ Extensions
    • On x64 systems: HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \ Mozilla \ Firefox \ Extensions
  3. Delete the value named {20a82645-c095-46ed-80e3-08825760534b} from the right pane.
  4. Close the Registry Editor when you're done.
  5. Open a new Firefox window, and in the address bar, type about:config and press Enter.
  6. Type microsoftdotnet in the Filter field to quickly find the general.useragent.extra.microsoftdotnet setting.
  7. Right-click general.useragent.extra.microsoftdotnet and select Reset.
  8. Restart Firefox.
  9. Open Windows Explorer, and navigate to %SYSTEMDRIVE%\Windows\Microsoft.NET\Framework\v3.5\Windows Presentation Foundation.
  10. Delete the DotNetAssistantExtension folder entirely.
  11. Open the Add-ons window in Firefox to confirm that the Microsoft .NET Framework Assistant extension has been removed.

It will be a great day when PC users no longer have to waste this much time to protect themselves from those who write the software they use. (And if you're thinking, "Why not just use a Mac," may I remind you of the MobileMe junk recently installed on so many Windows machines without their owners' permission!)

25Mar/101

Got annoying cables? Got crocodile clips? Then you’ve got a solution!

I've just stumbled across this awesome little trick which is quite useful for anyone with a laptop, or a desktop PC that doesn't have enough USB slots to support all the USB gadgets you might have..

Crocodile Clips FTW