Useful Stuff

Coding Games Geeky Office Technical

Coding

Save Embedded Pictures in Their Original Format:

I sometimes want to save a picture someone has used as a background in an e-mail and until I found this I found it quite tricky.  Animations were impossible.

Sub SaveAttachment()
Dim objCurrentItem As Outlook.MailItem
Dim colAttachments As Outlook.Attachments
Dim objAttachment As Outlook.Attachment

Set objCurrentItem = Application.ActiveInspector.CurrentItem
Set colAttachments = objCurrentItem.Attachments
Set strFolderpath = CreateObject("WScript.Shell")

For Each objAttachment In colAttachments
objAttachment.SaveAsFile (strFolderpath.SpecialFolders("Desktop") & "\" & objAttachment.FileName)
Next

Set objAttachment = Nothing
Set colAttachments = Nothing
objCurrentItem.Close (olDiscard)
Set objCurrentItem = Nothing

End Sub

 

Log the date and time in a DOS batch file:

Create a file called log.txt.

Create a batch file, let's call it log.bat, with the following lines:

@echo off
REM Bootup Date and Time recorder
echo.Next Bootup: >>log.txt
echo |date |find "current" >>log.txt
echo |time |find "current" >>log.txt

Note:  Make sure you get the spacing right.

Type log at the prompt.

Open the text file - you'll see the date and time recorded. For more DOS stuff, have a look at http://malektips.com/subsite/dos.html

 

Help with HTML, Javascript, etc.

JavaScript

 

Games

Call of Duty 2 DirectX error:

After a hardware failure I replaced my sound card.  At that point COD2 stopped running in DirectX9.  As it had worked previously I was confused.  I had the latest DirectX and the latest drivers.  I tried moving the HW acceleration sliders about.  None of it helped.  Searching the net turned up nothing useful from the publishers or hardware manufacturers.  I got the usual rubbish from people who think they know (spotty teenagers) and the ones with stock answers who don't listen.  I was almost resigned to playing in DX7...  Then I found out about switching my machine to ACPI, rather than ACPI Uniprocessor.  One thing this achieves is to do with interrupt masking and my Creative sound card, which I think was the issue - apparently they don't like sharing.  Having applied the fix I'm playing COD2 again, so I'm happy.  Of course, it would be easier if it didn't come up.  It's a general problem, especially with new software that uses the latest tricks.  They seem to have trouble agreeing how it's all going to work on some of the fine details, which matter when you push the machine.  All very easy to accept until this brilliant game stops working.  If I didn't like it so much I'd play something else.  I struggle with it because it's worth the effort once I get it right.

In Device Manager, expand the Computer section and change the driver from ACPI Uniprocessor to Advanced Control and Power Interface (ACPI) PC, then you'll need a couple of reboots.  Loads of thanks to guru3d.

Note:  As usual, it depends...  You could cause fairly serious problems with this, if your BIOS is on the 'bad' list.  Look into it before you do anything.  Microsoft

 

Geeky

Cool Desktop Thingy:

Leave messages, relieve boredom, etc.  Desktop Graffiti

 

Moore's law will run out

I was reading a WIKI about ZFS (a disc filing system) today when I saw this bit:

Project leader Bonwick said, "Populating 128-bit file systems would exceed the quantum limits of earth-based storage. You couldn't fill a 128-bit storage pool without boiling the oceans."[3] Later he clarified:

Although we'd all like Moore's Law to continue forever, quantum mechanics imposes some fundamental limits on the computation rate and information capacity of any physical device. In particular, it has been shown that 1 kilogram of matter confined to 1 litre of space can perform at most 1051 operations per second on at most 1031 bits of information.[11] A fully populated 128-bit storage pool would contain 2128 blocks = 2137 bytes = 2140 bits; therefore the minimum mass required to hold the bits would be (2140 bits) / (1031 bits/kg) = 136 billion kg. To operate at the 1031 bits/kg limit, however, the entire mass of the computer must be in the form of pure energy. By E=mc², the rest energy of 136 billion kg is 1.2x1028 J. The mass of the oceans is about 1.4x1021 kg. It takes about 4,000 J to raise the temperature of 1 kg of water by 1 degree Celsius, and thus about 400,000 J to heat 1 kg of water from freezing to boiling. The latent heat of vaporization adds another 2 million J/kg. Thus the energy required to boil the oceans is about 2.4x106 J/kg * 1.4x1021 kg = 3.4x1027 J. Thus, fully populating a 128-bit storage pool would, literally, require more energy than boiling the oceans.[12]

This claim is dubious, however, since the energy calculation is based not only on the storage capacity but also on the maximum possible calculation rate of 1051 operations per second. Since the energy requirements are directly proportional to the calculation rate[13], reducing the calculation rate to, say, 1040 operations per second on 2140 bits would reduce the energy required to 1.2x1017 J -- perhaps enough to boil a small lake, but not the oceans.

 

p (Pi):

Not all of it.  Pi, like the square root of 2 amongst others, is an irrational number  - it can't be expressed as a fraction x/y where x and y are integers so in decimal it just goes on and on and on...

3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067
98214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196
44288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737
24587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433
05727036575959195309218611738193261179310511854807446237996274956735188575272489122793818301194912983
36733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005
68127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019
95611212902196086403441815981362977477130996051870721134999999837297804995105973173281609631859502445
94553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534
90428755468731159562863882353787593751957781857780532171226806613001927876611195909216420198938095257
20106548586327886593615338182796823030195203530185296899577362259941389124972177528347913151557485724
24541506959508295331168617278558890750983817546374649393192550604009277016711390098488240128583616035
63707660104710181942955596198946767837449448255379774726847104047534646208046684259069491293313677028
98915210475216205696602405803815019351125338243003558764024749647326391419927260426992279678235478163
60093417216412199245863150302861829745557067498385054945885869269956909272107975093029553211653449872
02755960236480665499119881834797753566369807426542527862551818417574672890977772793800081647060016145
24919217321721477235014144197356854816136115735255213347574184946843852332390739414333454776241686251
89835694855620992192221842725502542568876717904946016534668049886272327917860857843838279679766814541
00953883786360950680064225125205117392984896084128488626945604241965285022210661186306744278622039194
94504712371378696095636437191728746776465757396241389086583264599581339047802759009946576407895126946
83983525957098258226205224894077267194782684826014769909026401363944374553050682034962524517493996514
31429809190659250937221696461515709858387410597885959772975498930161753928468138268683868942774155991
85592524595395943104997252468084598727364469584865383673622262609912460805124388439045124413654976278
07977156914359977001296160894416948685558484063534220722258284886481584560285060168427394522674676788
95252138522549954666727823986456596116354886230577456498035593634568174324112515076069479451096596094
02522887971089314566913686722874894056010150330861792868092087476091782493858900971490967598526136554
97818931297848216829989487226588048575640142704775551323796414515237462343645428584447952658678210511
41354735739523113427166102135969536231442952484937187110145765403590279934403742007310578539062198387
44780847848968332144571386875194350643021845319104848100537061468067491927819119793995206141966342875
44406437451237181921799983910159195618146751426912397489409071864942319615679452080951465502252316038
81930142093762137855956638937787083039069792077346722182562599661501421503068038447734549202605414665
92520149744285073251866600213243408819071048633173464965145390579626856100550810665879699816357473638
40525714591028970641401109712062804390397595156771577004203378699360072305587631763594218731251471205
32928191826186125867321579198414848829164470609575270695722091756711672291098169091528017350671274858
32228718352093539657251210835791513698820914442100675103346711031412671113699086585163983150197016515
11685171437657618351556508849099898599823873455283316355076479185358932261854896321329330898570642046
75259070915481416549859461637180270981994309924488957571282890592323326097299712084433573265489382391
19325974636673058360414281388303203824903758985243744170291327656180937734440307074692112019130203303
80197621101100449293215160842444859637669838952286847831235526582131449576857262433441893039686426243
41077322697802807318915441101044682325271620105265227211166039666557309254711055785376346682065310989
65269186205647693125705863566201855810072936065987648611791045334885034611365768675324944166803962657
97877185560845529654126654085306143444318586769751456614068007002378776591344017127494704205622305389
94561314071127000407854733269939081454664645880797270826683063432858785698305235808933065757406795457
16377525420211495576158140025012622859413021647155097925923099079654737612551765675135751782966645477
91745011299614890304639947132962107340437518957359614589019389713111790429782856475032031986915140287
08085990480109412147221317947647772622414254854540332157185306142288137585043063321751829798662237172
15916077166925474873898665494945011465406284336639379003976926567214638530673609657120918076383271664
16274888800786925602902284721040317211860820419000422966171196377921337575114959501566049631862947265
47364252308177036751590673502350728354056704038674351362222477158915049530984448933309634087807693259
93978054193414473774418426312986080998886874132604721569516239658645730216315981931951673538129741677
29478672422924654366800980676928238280689964004824354037014163149658979409243237896907069779422362508
22168895738379862300159377647165122893578601588161755782973523344604281512627203734314653197777416031
99066554187639792933441952154134189948544473456738316249934191318148092777710386387734317720754565453
22077709212019051660962804909263601975988281613323166636528619326686336062735676303544776280350450777
23554710585954870279081435624014517180624643626794561275318134078330336254232783944975382437205835311
47711992606381334677687969597030983391307710987040859133746414428227726346594704745878477872019277152
80731767907707157213444730605700733492436931138350493163128404251219256517980694113528013147013047816
43788518529092854520116583934196562134914341595625865865570552690496520985803385072242648293972858478
31630577775606888764462482468579260395352773480304802900587607582510474709164396136267604492562742042
08320856611906254543372131535958450687724602901618766795240616342522577195429162991930645537799140373
40432875262888963995879475729174642635745525407909145135711136941091193932519107602082520261879853188
77058429725916778131496990090192116971737278476847268608490033770242429165130050051683233643503895170
29893922334517220138128069650117844087451960121228599371623130171144484640903890644954440061986907548
51602632750529834918740786680881833851022833450850486082503930213321971551843063545500766828294930413
77655279397517546139539846833936383047461199665385815384205685338621867252334028308711232827892125077
12629463229563989898935821167456270102183564622013496715188190973038119800497340723961036854066431939
50979019069963955245300545058068550195673022921913933918568034490398205955100226353536192041994745538
59381023439554495977837790237421617271117236434354394782218185286240851400666044332588856986705431547
06965747458550332323342107301545940516553790686627333799585115625784322988273723198987571415957811196
35833005940873068121602876496286744604774649159950549737425626901049037781986835938146574126804925648
79855614537234786733039046883834363465537949864192705638729317487233208376011230299113679386270894387
99362016295154133714248928307220126901475466847653576164773794675200490757155527819653621323926406160 13635815590742202020318727760527721900556148425551879253034351398442532234157623361064250639049750086
56271095359194658975141310348227693062474353632569160781547818115284366795706110861533150445212747392
45449454236828860613408414863776700961207151249140430272538607648236341433462351897576645216413767969
03149501910857598442391986291642193994907236234646844117394032659184044378051333894525742399508296591
22850855582157250310712570126683024029295252201187267675622041542051618416348475651699981161410100299
60783869092916030288400269104140792886215078424516709087000699282120660418371806535567252532567532861
29104248776182582976515795984703562226293486003415872298053498965022629174878820273420922224533985626
47669149055628425039127577102840279980663658254889264880254566101729670266407655904290994568150652653
05371829412703369313785178609040708667114965583434347693385781711386455873678123014587687126603489139
09562009939361031029161615288138437909904231747336394804575931493140529763475748119356709110137751721
00803155902485309066920376719220332290943346768514221447737939375170344366199104033751117354719185504
64490263655128162288244625759163330391072253837421821408835086573917715096828874782656995995744906617
58344137522397096834080053559849175417381883999446974867626551658276584835884531427756879002909517028
35297163445621296404352311760066510124120065975585127617858382920419748442360800719304576189323492292
79650198751872127267507981255470958904556357921221033346697499235630254947802490114195212382815309114
07907386025152274299581807247162591668545133312394804947079119153267343028244186041426363954800044800
26704962482017928964766975831832713142517029692348896276684403232609275249603579964692565049368183609
00323809293459588970695365349406034021665443755890045632882250545255640564482465151875471196218443965
82533754388569094113031509526179378002974120766514793942590298969594699556576121865619673378623625612
52163208628692221032748892186543648022967807057656151446320469279068212073883778142335628236089632080
68222468012248261177185896381409183903673672220888321513755600372798394004152970028783076670944474560
13455641725437090697939612257142989467154357846878861444581231459357198492252847160504922124247014121
47805734551050080190869960330276347870810817545011930714122339086639383395294257869050764310063835198
34389341596131854347546495569781038293097164651438407007073604112373599843452251610507027056235266012
76484830840761183013052793205427462865403603674532865105706587488225698157936789766974220575059683440
86973502014102067235850200724522563265134105592401902742162484391403599895353945909440704691209140938
70012645600162374288021092764579310657922955249887275846101264836999892256959688159205600101655256375

and so on...

 

Office

Outlook is unable to open the required form:

Trying to create an appointment in a calendar in Outlook with a custom form gets you an error saying the custom form is unavailable.  Clearing the cache has no effect, even if you go and delete it manually.  If you create HKLM\Software\Microsoft\Office\11.0\Outlook DWORD ForceFormReload=1 it seems to clear the problem.  I think it has something to do with 2003/2007 incompatibilities.

 

Outlook new messages are in the wrong language:

I could not get Outlook to accept the correct spellings of certain words in new messages.  Having set everything on the computer and in M$ Office to English rather than American - even changing the template and saving over it - the computer still insisted it was 'color', not 'colour'.  Finally I deleted the normalemail.dotm template, then restarted Outlook so it could rebuild the template.  That fixed it.  The new template was created by Outlook with the language set properly and worked.  Set the M$ Office Tools language to yours, delete the template and restart Outlook.

 

User has default Outlook language set to English but new messages are in American:

Use Word to edit new mail.
In Word, create a new template Email.dot.
Launch Outlook, create a new Email.
In the document go to the Menu Tools : Templates and Add-Ins.
On the Tab Template : Click Attach.
Select your Email Template and Click Open.
Tick Attach to All new-email messages and Update Automatically.
Click OK.
Close the message then open a new one, select all and change the language, then say yes when asked if you want to change the template.

 

No spellchecker in Outlook 2007:

Assuming you've already checked Proofing Tools are installed and enabled, you could try this:

Close Word and Outlook.
Open Regedit.
Go to HKCU\Software\Microsoft\Shared Tools\Proofing Tools.
Rename the folder to Old Proofing Tools.
Close Regedit.
Go back to Outlook, it should be working now.

If anything goes wrong you can revert to the old folder since you didn't just delete it (the voice of experience).  I've been seeing this ever since I started mixing up Office 2007 and Office 2003.  Users who move between versions with roaming profiles get it.  With luck M$ will notice and fix it...

 

Outlook Express help:

Outlook Express

 

Recovering Deleted Mail:

How to...

 

Printer printing words or letters on top of each other:

Find the advanced settings and get the printer to download fonts as bitmaps.

 

Word:

All sorts of useful tips:  http://www.gmayor.com/Word_pages.htm

 

ActiveSync errors

Pocket PC FAQ

If, like me, you are expected to make phones work with Exchange servers or you have one you’re trying to fix you’ll find this page of error numbers and simple explanations invaluable.  It's also good advice to ensure (barring known issues) that:
1. In ActiveSync on the PC check that "Computer is Connected" to "The Internet"
2. On your phone, got to Settings - Connections and click Menu - Advanced and set Internet Connection to Automatic.
3. On your phone, open ActiveSync, click Menu - Connections and make sure that USB is selected.

 

Stop Adobe interfering:

It annoys me when programs grant themselves the right to reconfigure your PC without even telling you, let alone asking.  Remove the Adobe rubbish from Office:  http://www.gmayor.com/.

 

Technical

Advanced file type editing in Windows 7

For reasons known only to them, Microsoft chose to remove the ability to associate commands with file types from Vista and Windows 7.  I make use of it and found it quite irritating as the alternative involves some messy registry editing.  After hunting around and trying out a few programs which either didn't work or were simply unintelligible, I ended up with Creative Powertools which includes File Type Doctor.

 

The sound and/or playback stutters when I watch a DVD

I updated VLC on my 'TV' computer and found that whenever I put a DVD in you couldn't watch it.  The playback was nearly OK but the sound crackled and jumped and made strange noises.   I tried removing and reinstalling various bits of software but eventually discovered, using this tool (EFD Inspector) that my DVD drive had switched to PIO mode on its own because of a bad disc, drastically reducing its performance.  I had to go into the Registry and remove the DMA/PIO settings so that Windows redetected them when I restarted, then everything worked again.  (As usual, you edit the Registry at your own risk.)   Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}\ and for the Primary and Secondary IDE channels, remove the value for MasterIdDataChecksum and SlaveIdDataChecksum if it's there.  Then restart your computer.

 

Windows cannot load WINDOWS\SYSTEM32\CONFIG\SYSTEM:

Use this if you find yourself looking at the "Windows cannot load WINDOWS\SYSTEM32\CONFIG\SYSTEM" message, it really works. http://support.microsoft.com/kb/307545

 

Edit stored logons for websites:

control keymgr.dll

 

Flash won't play videos but is installed:

Download and run Flash Player Active X control content debugger.

 

The Six Dumbest Ideas in Computer Security:

Fun to read and something to think about: http://www.ranum.com/security/computer_security/editorials/dumb/

 

Lots of useful tips:

Lots of different tips and fixes: http://www.dougknox.com/ & http://www.pctools.com/guides/registry/

 

HTM & HTML files show default icon:

I saw a lot of answers that just didn't work until I came across this one:  http://windowsxp.mvps.org/htmicon.htm - changing the icon in the file types tab had no effect but the executable fixed it.

 

Start Windows Explorer on 'My Computer':

Create a shortcut to %SystemRoot%\explorer.exe /e,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}

 

Stop Errors:

Find out what that Blue Screen Of Death is trying to tell you.

 

Install XP:

With pictures - I always find it helps: http://www.theeldergeek.com/xp_pro_install_-_graphic.htm.

 

Anti-Slimeware

Slimeware: Software written by useless trash with nothing better to do than break your computer or sometimes even with actual malicious intent.  Help getting rid of it:  Tips

 

TCP/IP Ports:

I was looking for the port for PPTP when I came across this comprehensive list:  http://www.chebucto.ns.ca/~rakerman/port-table.html

 

Automatically find results:

Have IE7 go to the "I'm Feeling Lucky" result from Google:  http://aphnetworks.com/tutorials/google_im_feeling_lucky_to_internet_explorer_7_ie7.

 

Errors:

A page that turns the cryptic message "Error x" into "Try doing this to fix it."  Very useful.  http://technet2.microsoft.com/windowsserver/en/library/f3aadac7-1e97-495b-af62-5d179df2990d1033.mspx?mfr=true

 

Remove the search bar from IE7:

I don't see the point of a search bar in IE7 since I use the address bar to enter searches.  Remove it with this:  http://www.intelliadmin.com/blog/2006/12/remove-search-bar-from-ie-7.html.

 

FGA: Frequently Given Answer

Which is a far more sensible approach than FAQ, or Frequently Asked Question.  Here's a page or two by someone who clearly knows what they're talking about.

 

Check your video hardware

I often find myself trying to figure out what GPU it is.  Open a Command window.  Run debug.  At the prompt enter this:
d C000:0010

At the next prompt, just enter a d, you might need to do it a couple of times.  You'll see information about your video card to the right of the screen.

 

Windows Update Error 0x80070424:

Now and again I get this error.  Often this works - regsvr32.exe wuaueng.dll

 

Subnetting:

So, you have an address like 213.546.224.0, now you want to subnet it into three networks.  A subnet mask like 255.255.255.224 gives

128   64   32   16   8    4    2    1
1     1    1    0    0    0    0    0
128 + 64 + 32 + 0  + 0  + 0  + 0  + 0 = 224

so 3 bits are allocated, giving 2^3=8 subnets.

Sometimes, despite being able to do these calculations, I find I confuse myself over subnetting.  This is handy.  Subnet calculator.

 

Workgroup Browsing Errors:

Chuck's page

 

Windows Explorer Not Refreshing Automatically:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Update - "UpdateMode"=DWORD:0 - from Kelly's Corner.

 

BOOT.INI switches:

Such as:  /BOOTLOGO, /PAE

Use the BOOTLOGO switch to have Windows XP or Windows Server 2003 display a custom splash screen.  First, create a 16-colour (any 16 colours) 640x480 bitmap and save it in the Windows directory with the name boot.bmp. Then add "/bootlogo /noguiboot" to the boot.ini selection.

From http://www.sysinternals.com/Information/bootini.html

 

HTTP UNIX Server Software:

Geek stuff really but I liked it so here it is. LINK

 

Check that tweak:

Dispelling a few myths about XP.  XP myths.

 

Speed up disc access:

Whenever XP reads a file it marks the file with the date and time of the access. Obviously there are times when this is very useful but it can also be a waste of disc access time. To turn it off run this: FSUTIL behavior set disablelastaccess 1  (Notice it's 'BEHAVIOR' since the Yanks can't spell.)

Alternatively, find the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentContolSet\Control\Filesystem and change the NtfsDisableLastAccessUpdate entry to 1.  Change 1 to 0 to switch it back on.

 

Kernel paging:

Start regedit and navigate to the following key:  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

Change this and reboot;

"DisablePagingExecutive"=dword:00000001

The "DisablePagingExecutive" entry in the registry causes the system to store the kernel in RAM (not on the disc in the pagefile) which should make XP more responsive, assuming you have enough memory.  Most people do these days.

 

Learn how to fix your own printer:

Printer Problems

 

Why won't it turn off?

W. S. C.

 

Run a program as a service:

Microsoft instructions.

 

NT help:

NT

 

Windows in general:

Windows

 

Show or hide filenames in thumbnail view:

If you hold down SHIFT while changing to thumbnail view, you toggle the display of filenames.

 

Speed up browsing the network:

In Explorer, go to Tools, Folder Options, View. Uncheck 'Automatically search for network folders and printers'. You may need to restart your computer for it to take effect.

 

Simple Folder View:

Windows XP and Windows Server 2003 both display an irritating behaviour I have been learning to suppress.

It's called 'Simple Folder View' and means that whenever you drag files into a folder, the folder opens for you.  It is NOT helpful, it's just the computer doing things on its own again.  So, I attempt to turn it off.  This can turn out to be quite difficult often and after some research I found a tip.  If the behaviour continues after you turn off Simple Folder View, go to Start, Run and type regsvr32 /i shell32 which re-registers the appropriate function files and should remove the unwanted behaviour.

 

Operating System stuff:

Software and hardware, lots of systems.  Click.

 

Connect all sorts of network equipment with one cable:

Just make yourself a 5 in 1 network cable.

 

I.E. opens empty new windows:

Source

1. Click Start, then click Run.

2. In the Open box, type: regsvr32 urlmon.dll

3. Click OK, then click OK again when you receive the following message: DllRegisterServer in urlmon.dll succeeded.

You can also try this: Go to Start/run, type SFC (SFC /SCANNOW for Win2K or WinXP). Choose 'Extract One File From Installation Disk'. Type oleaut32.dll, not worrying about its location. Then, click Start. Next to 'Restore From', type in or browse for the file's location, which is probably in the Win98 folder of your installation CD-ROM or in your Windows\Options\Cabs folder, as the case may be. Then, next to 'Save File In', enter C:\Windows\System and click OK. System File Checker looks for the file, saves it as you requested, then tells you that 'the file has been successfully extracted'. You may need to reboot.

 

What's that in my Task Manager?

List of process names.

If not, try this one.