tag:blogger.com,1999:blog-73770286273552293392024-01-29T08:31:11.189+00:00Another Angle On TechnologyVarious snippets of wisdom related to technologies like .Net, C#, Agile, Cloud, Virtualisation, Connected Entertainment, Business Intelligence, Information Consumerism, Augmented Reality. Any opinion expressed here is my personal and may be subjective.demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.comBlogger75125tag:blogger.com,1999:blog-7377028627355229339.post-12580596413405248152013-09-20T11:00:00.000+01:002013-09-20T11:07:13.769+01:00Quick HTML Template<div dir="ltr" style="text-align: left;" trbidi="on">
This is the template that I can copy-paste whenever I need some simple HTML page. You are free to use it for yourself.<br />
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><!DOCTYPE html></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><html xmlns="http://www.w3.org/1999/xhtml"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><head></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><title></title></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><!-- <link rel="stylesheet" type="text/css" href="" /> --></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><!--<script type="text/javascript" src=""></script>--></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><script src="http://code.jquery.com/jquery-1.10.1.min.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><style type="text/css"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>body { background-color: #adadad; font-size:8pt; }</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span></style></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//<![CDATA[</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>//]]></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"></head></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><body></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><div id="main"></div></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><canvas<span class="Apple-tab-span" style="white-space: pre;"> </span>id="myCanvas" width="200" height="100" style="border:1px solid #000000;"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"></canvas></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><script type="text/javascript"></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">//<![CDATA[</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$(document).ready(function(){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>});</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>/* for handling canvas events, if needed */</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$(window).load(function(){</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>});</span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"> </span></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;">//]]></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"></script></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"></body></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"></html></span></div>
<br /></div>
</div>
demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-90645581555753781212013-09-18T18:37:00.000+01:002013-09-18T18:37:15.091+01:00Query to show Performance Counters that SQL Server exposes to Windows OS<div dir="ltr" style="text-align: left;" trbidi="on">
T-SQL query that can quickly show some valuable performance counters from SQL Server. The values in this system view are actual, they get refreshed many times a second.<br />
<br />
<div class="MsoNormal">
<span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">SELECT</span><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: grey;">*</span><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">FROM</span><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: blue;">master</span><span style="color: grey;">.</span><span style="color: green;">sys</span><span style="color: grey;">.</span><span style="color: green;">dm_os_performance_counters<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: 'Courier New'; font-size: 10pt;">WHERE</span><span style="font-family: 'Courier New'; font-size: 10pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: 'Courier New'; font-size: 10pt;">instance_name <span style="color: grey;">=</span> <span style="color: red;">'MyDbName'<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="color: grey; font-family: 'Courier New'; font-size: 10pt;">OR</span><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: magenta;">OBJECT_NAME</span> <span style="color: grey;">=</span> <span style="color: red;">'SQLServer:General Statistics'<o:p></o:p></span></span></div>
<br />
<div class="MsoNormal">
<span style="color: grey; font-family: 'Courier New'; font-size: 10pt;">OR</span><span style="font-family: 'Courier New'; font-size: 10pt;"> counter_name <span style="color: grey;">=</span> <span style="color: red;">'Batch Requests/sec'</span></span></div>
<br />
Troubleshooting: if this query returns nothing then you may have Performance Counters disabled. Run this to verify, it should return at least one row : <span style="font-family: Consolas, Courier, monospace; font-size: 13px; line-height: 17px;">SELECT COUNT(*) from sys.dm_os_performance_counters;</span><br />
<br />
<div class="MsoNormal">
<br /></div>
</div>
demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-75483837505756169222012-12-14T10:21:00.001+00:002012-12-14T10:21:39.357+00:00SQL Server, query performance and Execution Plan panel<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Noticed one interesting thing with sql management studio. <o:p></o:p></div>
<div class="MsoNormal">
Was trying to pinpoint some performance issues with a query
which had WHILE loop. I switched on the execution plan to analyse the query. It
was strange – like if performance was degrading with each new iteration. After
several rounds of optimizations there was no luck, same performance
degradation.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
I created very simple test shown below (Example 1). It does
nothing but counts the rows in sys.objects table 500 times so it returns the
same result each time. There are 1570 rows in
<span style="font-family: 'Courier New'; font-size: 10.833333015441895px;">MyDatabase</span>.sys.objects on my
machine<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Still no luck – average execution times were rising, total
time was more than a minute<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Switched off the execution plan and it complete in less than
a second!<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
The conclusion is that Execution Plan panel should be used
carefully when your queries have WHILE loops – use Profiler or use <span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">SET</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">SHOWPLAN_ALL</span> <span style="color: blue;">ON</span><span style="color: grey;"> </span></span>or <span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">SET</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">SHOWPLAN_XML</span>
<span style="color: blue;">ON </span></span>statements as alternative (see
Example 2)<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
--EXAMPLE1:<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">USE</span><span style="font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;"> MyDatabase<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">SET</span><span style="font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;"> <span style="color: blue;">STATISTICS</span> <span style="color: blue;">TIME</span> <span style="color: blue;">OFF</span><span style="color: grey;">;<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">set</span><span style="font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;"> <span style="color: blue;">nocount</span> <span style="color: blue;">on</span><span style="color: grey;">;<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">DECLARE</span><span style="font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;"> @indexRow <span style="color: blue;">INT</span> <span style="color: grey;">=</span> 0<span style="color: grey;">,</span> @cnt <span style="color: blue;">int<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">SET</span><span style="font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;"> <span style="color: blue;">STATISTICS</span> <span style="color: blue;">TIME</span> <span style="color: blue;">ON<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">WHILE</span><span style="font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;"> @indexRow <span style="color: grey;"><=</span> 500<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">BEGIN<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;"> <span style="color: blue;">SELECT</span>
@cnt<span style="color: grey;">=</span><span style="color: magenta;">COUNT</span><span style="color: grey;">(*),</span> @indexRow <span style="color: grey;">=</span>
@indexRow <span style="color: grey;">+</span> 1 <span style="color: blue;">FROM</span>
<span style="color: green;">sys</span><span style="color: grey;">.</span><span style="color: green;">objects<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">END</span><span style="font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">SET</span><span style="font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;"> <span style="color: blue;">STATISTICS</span> <span style="color: blue;">TIME</span> <span style="color: blue;">OFF<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
--EXAMPLE2:<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">SET</span><span style="font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;"> <span style="color: blue;">SHOWPLAN_ALL</span> <span style="color: blue;">ON</span><span style="color: grey;">;<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">GO<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">DECLARE</span><span style="font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;"> @indexRow <span style="color: blue;">INT</span> <span style="color: grey;">=</span> 0<span style="color: grey;">,</span> @cnt <span style="color: blue;">int<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">WHILE</span><span style="font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;"> @indexRow <span style="color: grey;"><=</span> 500<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">BEGIN<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;"> <span style="color: blue;">SELECT</span>
@cnt<span style="color: grey;">=</span><span style="color: magenta;">COUNT</span><span style="color: grey;">(*),</span> @indexRow <span style="color: grey;">=</span>
@indexRow <span style="color: grey;">+</span> 1 <span style="color: blue;">FROM</span>
<span style="color: green;">sys</span><span style="color: grey;">.</span><span style="color: green;">objects<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">END<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">GO<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">SET</span><span style="font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;"> <span style="color: blue;">SHOWPLAN_ALL</span> <span style="color: blue;">OFF</span><span style="color: grey;">;<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: "Courier New"; font-size: 8.0pt; mso-no-proof: yes;">GO<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
</div>
demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com1tag:blogger.com,1999:blog-7377028627355229339.post-89740630436189620862012-07-30T14:01:00.001+01:002012-07-30T14:01:39.858+01:00Resize the partition on Windows Server for free and non-destructive<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Problem:</b> after cloning smaller hard drive (HDD, 80 Gb) to a larger solid-state drive (SSD, 128 Gb), the partitions on the SSD became exactly the same as on HDD. 40 Gb were "lost". I needed a way to expand the partition on the SSD not loosing the files on it. Did it on Windows Server 2008 x64, with an idea to install that SSD in the laptop where HDD belonged.<br />
<br />
<b>Tried these free utilities:</b><br />
<a href="http://www.paragon-software.com/home/pm-express/download.html">Paragon Partition Manager Free Edition</a> - doesn't work with server OS. Rumours are it also doesn't support dynamic disks<br />
<a href="http://partitionwizard.com/free-partition-manager.html">MiniTool Partition Wizard Home Edition 7.5</a> - doesn't support Windows Server OS.<br />
<br />
<b>Solution:</b><br />
<b><br /></b><br />
<b></b><br />
<a name='more'></a><b><br /></b><br />
<b><br /></b><br />
Ok, scrap the GUI - I need the job done. Will use diskpart command-line tool that is available on Windows Server.<br />
<br />
<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">start -> run -> cmd</span><br />
type <span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">diskpart</span><br />
Agree to run elevated, enter Administrator's credentials<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">list volume</span><br />
see that my volume is #6<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">select volume 6</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">extend</span><br />
<br />
done!<br />
<br />
In windows explorer I can now see that my disk is 119 gigs, not 74 as it was. And files are all there. Non-destructive operation<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">list partition</span> - see that offset is 94. This is alright - multiplied by 1024 it gives 96256 which is divisible by 4 and by 64. Good for SSD.<br />
<br />
Shutdown the PC, unplug the power, remove SSD, implant it in the laptop, power on, voila! Windows 7 is loading from my new SSD now!</div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com1tag:blogger.com,1999:blog-7377028627355229339.post-53416203752920619742012-07-29T10:42:00.001+01:002012-07-29T11:37:00.178+01:00Updating firmware on OCZ Vertex 4 SSD<div dir="ltr" style="text-align: left;" trbidi="on">
After several unsuccessfull attempts to update the firmware on my new SSD - OCZ Vertex 4 - I think I found a way that works.<br />
<br />
<a name='more'></a><br />
<br />
<br />
My setup: Windows Server 2008 OS running on Gigabyte GA-MA78GM-S2H mobo<br />
SSD plugged in to spare SATA socket<br />
It arrived with firmware 1.4<br />
Downloaded OCZ Toolbox 3.02.14 from here: <a href="http://www.ocztechnology.com/ssd_tools/">http://www.ocztechnology.com/ssd_tools/</a><br />
<br />
<ul style="text-align: left;">
<li>Started the tool, it listed my ssd drive, clicked on it, it gave me it's details like model number, firmware version, etc</li>
<li>Clicked "Tools" in the menu</li>
<li>Clicked "Update Firmware" button</li>
<li>Received a pop-up warning that it is a two step process, that it will require to shutdown and restart the PC</li>
<li>Clicked OK</li>
<li>It said "Downloading Everest firmware to the drive" then "Download Firmware Complete" then a pop-up "Firmware download successful, shutdown and restart computer to complete firmware update"</li>
<li>Restart (very important step, remember it!)</li>
<li>Start the toolbox again - and it still says version 1.4, no change here, nothing updated! ;(</li>
</ul>
Tried to reformat the drive, set it to be dynamic, set it to be basic, assign the drive letter, don't assign it - each try followed by the steps above. No luck.<br />
<br />
It appears that "shutdown and restart" here means "shutdown, unplug, start again".<br />
<br />
<strong>What worked: run the OCZ Toolbox, Shutdown, <span style="color: orange;">Unplug the power, Wait couple of minutes</span>, Start the PC</strong><br />
<br />
Firmware was updated to 1.4.1.2. I repeated the process then to upgrade to firmware 1.5.<br />
For me, both updates (1.4 -> 1.4.1.2, 1.4.1.2 -> 1.5) were non-destructive, it didn't remove files from the drive. However, beware, you better backup your drive first!</div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-8265220757996767362012-06-25T12:31:00.000+01:002012-06-25T12:43:32.497+01:00Enabling CAT.Net to work with Visual Studio 2010<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://www.microsoft.com/security/sdl/discover/implementation.aspx">Microsoft recommends</a> using their CAT.Net Security Code Analysis tool as part of the SDL (Software Development Process). Unfortunately, latest released version is <a href="http://www.microsoft.com/en-us/download/details.aspx?id=5570">CAT.Net v1 CTP</a>. There was CAT.Net 2.0 Beta but it disappeared even from Microsoft's sites <a href="http://social.msdn.microsoft.com/Forums/en/catnet/thread/31663b6d-254e-48ce-8345-3355cb8b6023">due to some incompatibility</a> or missing libraries (where??).<br />
<br />
What is left of CAT.Net 2.0 for the community is <a href="http://channel9.msdn.com/Blogs/Jossie/Using-the-Code-Analysis-Tool-CATNET-20-to-Identify-Security-Vulnerabilities">this video on Channel 9</a>.<br />
<br />
CAT.Net 1.0 doesn't work with Visual Studio 2010 unless you manually alter (hack) its config file a little. See below.<br />
<br />
<ol style="text-align: left;">
<li><span style="background-color: white;">Close Visual Studio 2010 IDE</span></li>
<li><span style="background-color: white;">Find this file: %APPDATA%\Microsoft\MSEnvShared\Addins\Microsoft.ACESec.CATNet.AddIn</span></li>
<li><span style="background-color: white;"><span style="background-color: white;">Edit it in your preferred text editor, adding the line </span><span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><Version>10.0</Version></span> right after <span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><Version>9.0</Version></span>
</span></li>
<li style="text-align: justify;"><span style="background-color: white;">Open IDE again. Go to Tools->CAT.Net Code Analysis</span></li>
</ol>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Hope it helps.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>P.S.:</b> there is some information on how to use CAT.Net and OWASP O2 Platform along with Roslyn compiler outside of the IDE. It is all on <a href="http://diniscruz.blogspot.co.uk/2012/06/usingconsuming-catnets-engine-inside-o2.html">Dinis Cruz blog</a>.<br />
<br />
<b>Update 1:</b> <a href="http://blogs.msdn.com/b/securitytools/archive/2011/04/11/cat-net-and-our-fiscal-year-end.aspx">Found a blog post</a> from April 2011 which says this:<br />
<blockquote class="tr_bq">
<span style="background-color: #ced5db; color: #333333; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: x-small; line-height: 18px; text-align: left;">At this point in time we are accepting recommendations, suggestions and new features. However, we do not have any planned updates for the remainder of the fiscal year. We are going through our FY12 planning and CAT.NET is on the list of requests for next year. We will know by the end of June if funding has be approved. At that time we’ll notify people of the budgetary decisions.</span> </blockquote>
</div>
</div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-18764337621981104492012-06-21T10:38:00.002+01:002012-06-21T10:38:32.983+01:00Alternative to sp_changedbowner which is being deprecated<div dir="ltr" style="text-align: left;" trbidi="on">
SQL Server Books online suggest that will <a href="http://msdn.microsoft.com/en-us/library/ms178630(v=sql.100).aspx">is being deprecated starting from 2008</a> (not even 2008 R2) and will be removed from future releases of SQL Server.<br />
What is the alternative?<br />
Meet much more flexible command - <a href="http://msdn.microsoft.com/en-us/library/ms187359(v=sql.90).aspx">ALTER AUTHORIZATION</a> - which is available from version 2005 onwards.<br />
<br />
so instead of<br />
<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">USE MyDatabase</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">GO</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">EXEC sp_changedbowner 'sa'</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">GO</span><br />
<div>
<br /></div>
<br />
you may do<br />
<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">USE MyDatabase</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">GO</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">ALTER AUTHORIZATION ON DATABASE::MyDatabase TO sa;</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">GO</span><br />
<br />
<div style="text-indent: -22px;">
<span style="color: #006699; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;"><span style="font-size: 14px; line-height: 14px;"><b><br /></b></span></span></div>
<div style="text-indent: -22px;">
<span style="color: #006699; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;"><span style="font-size: 14px; line-height: 14px;"><b><br /></b></span></span></div>
<div style="text-indent: -22px;">
<span style="color: #006699; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;"><span style="font-size: 14px; line-height: 14px;"><b><br /></b></span></span></div>
</div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-31792717199649587172012-06-13T13:23:00.000+01:002012-06-13T13:23:10.363+01:00wix, managed code custom action may fail when temp folder is compressed<div dir="ltr" style="text-align: left;" trbidi="on">
msi installer was created by WiX 3.5. VM with Windows Server 2003 SP1 32 bit, Windows Installer 4.5, .Net 3.5 SP1.<br />
<br />
It had a c# custom action named Managed_PutFeatureState. That custom action was failing with not many clues in the log (see below). Added logging to c# code, added try\catch constructs to prevent any possible failures and it still was failing. Noticed that it fails maybe 80% of times which was even more annoying.<br />
<br />
I thought that it had something to do with files it creates in %TEMP% folder, by some reason I suspected that it either couldn't unpack or couldn't find an unpacked .dll file with the custom action itself.<br />
<br />
Ran ProcMon.exe from sysinternals to see what is going on on the disk. And it stopped failing when ProcMon was capturing the events!<br />
<br />
This started me thinking about disk i\o. Played with various virtualization settings, host i\o enabled\disabled, etc to no joy. Still it was failing.<br />
<br />
<b>Solution: </b>disable "compressed" attribute on %TEMP% folder!<br />
<br />
ran via command line with logging like this:<br />
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">msiexec /l*vx! install.log /i MySetup.msi </span></blockquote>
The log:<br />
<br />
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">MSI (c) (50:54) [13:02:15:952]: Doing action: Managed_PutFeatureState<br />Action 13:02:15: Managed_PutFeatureState.<br />Action start 13:02:15: Managed_PutFeatureState.<br />MSI (c) (50:54) [13:02:16:046]: Creating MSIHANDLE (5) of type 790542 for thread 3924<br />MSI (c) (50:E8) [13:02:16:046]: Invoking remote custom action. DLL: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\MSI9.tmp, Entrypoint: PutFeatureState<br />MSI (c) (50!F0) [13:02:16:108]: Creating MSIHANDLE (6) of type 790531 for thread 4080<br />MSI (c) (50!F0) [13:02:16:124]: Closing MSIHANDLE (6) of type 790531 for thread 4080<br />MSI (c) (50!F0) [13:02:16:186]: Creating MSIHANDLE (7) of type 790531 for thread 4080<br />MSI (c) (50!F0) [13:02:16:186]: Closing MSIHANDLE (7) of type 790531 for thread 4080<br />MSI (c) (50!F0) [13:02:16:327]: Creating MSIHANDLE (8) of type 790531 for thread 4080<br />MSI (c) (50!F0) [13:02:16:343]: Closing MSIHANDLE (8) of type 790531 for thread 4080<br />MSI (c) (50!F0) [13:02:16:374]: Note: 1: 2727 2: <br />MSI (c) (50!F0) [13:02:16:389]: Note: 1: 2205 2: 3: MsiAssembly<br />MSI (c) (50!F0) [13:02:16:389]: Note: 1: 2228 2: 3: MsiAssembly 4: SELECT `MsiAssembly`.`Attributes`, `MsiAssembly`.`File_Application`, `MsiAssembly`.`File_Manifest`, `Component`.`KeyPath` FROM `MsiAssembly`, `Component` WHERE `MsiAssembly`.`Component_` = `Component`.`Component` AND `MsiAssembly`.`Component_` = ?<br />MSI (c) (50!F0) [13:02:16:389]: Note: 1: 1402 2: HKEY_CLASSES_ROOT\.4 3: 2<br />MSI (c) (50!F0) [13:02:16:405]: Note: 1: 2205 2: 3: _RemoveFilePath<br />MSI (c) (50!F0) [13:02:16:405]: Note: 1: 2727 2: <br />MSI (c) (50!F0) [13:02:16:514]: Note: 1: 2727 2: <br />MSI (c) (50!F0) [13:02:16:546]: Note: 1: 2727 2: <br />MSI (c) (50:E8) [13:02:16:577]: Closing MSIHANDLE (5) of type 790542 for thread 3924<br />Action ended 13:02:16: Managed_PutFeatureState. Return value 3.<br />DEBUG: Error 2896: Executing action Managed_PutFeatureState failed.<br />The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2896. The arguments are: Managed_PutFeatureState, ,<br />Action ended 13:02:16: WelcomeDlg. Return value 3.<br />MSI (c) (50:58) [13:02:16:608]: Doing action: FatalError<br />Action 13:02:16: FatalError.<br />Action start 13:02:16: FatalError.<br />Action 13:02:16: FatalError. Dialog created<br />Action ended 13:02:17: FatalError. Return value 2.<br />Action ended 13:02:17: INSTALL. Return value 3.<br />MSI (c) (50:58) [13:02:17:686]: Destroying RemoteAPI object.<br />MSI (c) (50:9C) [13:02:17:686]: Custom Action Manager thread ending.</span></blockquote>
</div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-40994201468715030552012-06-12T12:46:00.000+01:002012-06-12T12:46:12.819+01:00tools or utilities to edit Windows Installer msi files<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<ul style="text-align: left;">
<li>Orca - part of Windows Installer SDK. Free</li>
<li><a href="http://www.pantaray.com/msi_super_orca.html">SuperOrca</a> - from Pantaray Research. Free. Allows viewing \ editing binary tables along with other features not present in Orca.</li>
<li><a href="http://www.instedit.com/">InstEd</a> - Free version. With InstEd Plus - Commercial version.</li>
</ul>
</div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-55680102302346657242012-05-10T13:45:00.001+01:002012-05-10T13:45:58.474+01:00WiX, Maximum recommended length of Tooltip attribute is 50 characters<div dir="ltr" style="text-align: left;" trbidi="on">
When building an installer with WiX (Windows Installer XML) 3.5, you may encounter the following warning:<br />
<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">warning LGHT1076: ICE03: String overflow (greater than length permitted in column); Table: Control, Column: Help, Key(s): ....</span><br />
<br />
<br />
This is because the Control@Tooltip value is too long. It stops giving out when the length is 50 characters or less.<br />
<br />
Interesting fact that even with the warning, with string longer than 50, it still adds it to installer and uses the tooltip in UI.<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span></div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com1tag:blogger.com,1999:blog-7377028627355229339.post-65306509835979760902012-05-04T16:47:00.002+01:002012-05-04T16:47:38.929+01:00asp.net PasswordRecovery control uses ControlState to persist data<div dir="ltr" style="text-align: left;" trbidi="on">
Took me a while to figure out why PasswordRecovery control persisted its "Success" state between postbacks if MailError happened, even when EnableViewState="false"<br />
<br />
One of its internal properties is CurrentView which can be UserName or Success. This property is not available for use and it is persisted between postbacks in the ControlState.<br />
<br />
My problem was that the state of the control stayed as "Success" after I catched the smtp error in <span style="background-color: white; color: magenta; font-family: Consolas; font-size: 13px;">OnSendMailError</span> handler by setting <span style="background-color: white; font-family: Consolas; font-size: 13px;">e.</span><span style="background-color: white; color: purple; font-family: Consolas; font-size: 13px;">Handled</span><span style="background-color: white; font-family: Consolas; font-size: 13px;"> = </span><span style="background-color: white; color: blue; font-family: Consolas; font-size: 13px;">true</span><span style="background-color: white; font-family: Consolas; font-size: 13px;">; </span>.<br />
<br />
<br />
<br /></div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-76659611862244758682012-05-03T11:11:00.002+01:002012-05-04T15:13:39.278+01:00PhoneGap (Cordova), fail to navigate to index.html<div dir="ltr" style="text-align: left;" trbidi="on">
Noticed when debugging Windows Phone 7.1 or 7.5 Mango app made with <a href="http://phonegap.com/">PhoneGap (Cordova) 1.6.1</a>. The same may apply to earlier versions. Visual Studio 2010.<br />
<br />
<b>Error 1:</b> fails to build with the following error<br />
<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">Arg :: path to project\MyProject.csproj</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">path to solution\
MyProject\BuildManifestProcessor.js(14, 1) Microsoft JScript runtime error : Permission denied</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"> </span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1036,5): error MSB3073: The command "CScript "path to project\
MyProject\/BuildManifestProcessor.js" "
path to project\ MyProject\
MyProject.csproj"" exited with code -1.</span><br />
<br />
<b>Reason:</b> CordovaSourceDictionary.xml in the root of the project is read-only. Happened because it was included in the project and then added to source control.<br />
<b>Fix: </b>Make sure that CordovaSourceDictionary.xml is not read-only before doing the build<br />
<br />
<br />
The file CordovaSourceDictionary.xml is dynamic, generated on each build by a pre-build event<br />
<br />
However, if this file is excluded from the project, you will experience<br />
<br />
<a name='more'></a><br /><br />
<b>Error 2: </b> build succeeded, but debugging failed - after your project is built and installed in Windows Phone emulator, you see the error page with the message <span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">"We're having trouble displaying this page. We're having trouble with the page you're trying to reach and can't open it right now."</span><br />
<br />
Studying output (or immediates) log in IDE reveals the following errors:<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.dll</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">Updating IsolatedStorage for APP:DeviceID :: 7a37d1a9-bad8-49a9-a8cc-1bee764e65c1</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">GapBrowser_Navigating to :: /app/www/index.html</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">GapBrowser_NavigationFailed :: /app/www/index.html</span><br />
<br />
<br />
<b>Reason:</b> When debugging, it tries to navigate to the default web page which is www\index.html and fails to do so.<br />
<br />
<b>Why? </b>because it doesn't make it into the resulting .xap file<br />
<br />
It appears that PhoneGap needs this file to be present, even though it is dynamically generated each time, on each build, by a prebuild event. In a pre-build event, it is executing BuildManifestProcessor.js<br />
<br />
<b>workaround 1:</b> make sure the file CordovaSourceDictionary.xml is present in your project folder before debugging, is not read-only and is included in the project as "Content". Check it out , if it is under source control.<br />
<br />
<b>better fix:</b> I ended up with the pre-build event looking like this:<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">@echo off</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">IF EXIST "$(ProjectDir)CordovaSourceDictionary.xml" attrib -R "$(ProjectDir)CordovaSourceDictionary.xml"</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">CScript /nologo "$(ProjectDir)BuildManifestProcessor.js" "$(ProjectPath)"</span></div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-71477427187845751552012-05-01T23:25:00.000+01:002012-05-01T23:25:28.533+01:00Paste Special in Excel can be broken because of Skype<div dir="ltr" style="text-align: left;" trbidi="on">
It appears that Skype Click-to-Call browser plugin somehow interferes with Microsoft Office applications ability to copy-paste. Some other application can be also affected. Paste Special in Excel 2007 \ Excel 2010 suffers most as it looses ability to paste formulas, can paste only text, it looks broken and not working.<br />
<br />
<b>Problem:</b> in Excel worksheet, copy a cell with the formula either with Ctrl-C or right-click, copy. Paste into another cell. It pastes text only. copy again, right click on another cell, choose Paste Special - it offers to paste only plain text or unicode, no nice choice of formula, etc<br />
<br />
<b>Workaround: </b>if you have Skype installed and any web browser is open - close the browser. May need to re-open Excel work sheet. If it doesn't help - disable or uninstall Skype Click-to-Call browser plugin<br />
<br />
Skype <a href="http://community.skype.com/t5/Windows/Skype-conflicts-with-MS-Word/m-p/594631#M49196">confirmed the problem</a> and said they are working on an update</div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-157940032284148242012-04-27T16:25:00.004+01:002012-04-27T16:25:45.794+01:00How to change smtp server in TFS2008<div dir="ltr" style="text-align: left;" trbidi="on">
Team Foundation Server 2008 is not the most user-friendly application to configure. Here is how to change the smtp server it is using for alerts and other outgoing emails<br />
<br />
It is done by changing standard .Net smtp configuration section in the following files, change the host attribute on smtp/network node:<br />
<br />
C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\Services\web.config<br />
C:\Program Files\Microsoft Visual Studio 2008 Team System Web Access\Web\web.config<br />
<br />
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;"><span style="font-size: xx-small;"><configuration></span><span style="font-size: xx-small;">...</span><span style="font-size: xx-small;"> <system.net></span><span style="font-size: xx-small;"> <mailSettings></span><span style="font-size: xx-small;"> <smtp deliveryMethod="network" from="teamserver@mydomain.net"></span><span style="font-size: xx-small;"> <network host="my.mail.server" port="25" defaultCredentials="true" /></span><span style="font-size: xx-small;"> </smtp></span><span style="font-size: xx-small;"> </mailSettings></span><span style="font-size: xx-small;"> </system.net></span></span></blockquote>
</div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-88158038008140870042012-04-27T13:38:00.003+01:002012-04-27T13:38:46.289+01:00Couldn't start Default Web Site on Windows7. Solved<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Problem:</b><br />
You try to start Default Web Site in IIS Manager and it fails with the following error message:<br />
<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)</span><br />
<br class="Apple-interchange-newline" /><br />
<b>Solution: </b><br />
If Skype is running - quit it. Then start the web site! Your Skype was listening on the port 80.<br />
<br />
<b>Hint:</b><br />
Start the Default Web Site <b>before </b>starting Skype.<br />
<br />
Happened to me on Windows7 64bit, IIS7, IIS7.5<br />
<br />
<br />
<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br /></span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br /></span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br /></span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><b><br /></b></span></div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-56412216258682682752012-04-11T13:59:00.000+01:002012-05-04T15:12:32.757+01:00Stress Analysis of a Software Project [long]<div dir="ltr" style="text-align: left;" trbidi="on">
Found it on a <a href="http://catless.ncl.ac.uk/Risks/15.80.html#subj4.1">Risks Digest</a> and decided to copy the whole post here - just in case it goes missing. The posting is quite long. It is an internl Silicon Graphics memo by Tom Davis and it is a great representation of what can go wrong with (any) big (or small) software project<br />
<br />
<b>CITATION STARTS</b>
<br />
<blockquote class="tr_bq">
<address>
Jerry Leichter <leichter@lrw.com></address>
<i>Tue, 26 Apr 94 08:42:32 EDT</i>
<br />
<pre>The following, which claims to be an internal Silicon Graphics memo, has
already seen fairly broad network distribution. I have no way of verifying
that it is what it claims to be, but (a) I'm told by someone with close
dealings with SGI that it fits with what he's heard; (b) if it's a fake,
someone put a huge amount of effort into producing it.
I forward it to RISKS as a wonderful record of what goes wrong with large
software projects, and why. It would be as useful if all the names, including
the company and product names, were removed. This memo should not be seen as
an indictment of SGI, which is hardly unique. There is good evidence that
Sun, for example, had very similar problems in producing Solaris; and I
watched the same thing happen with the late, unlamented DEC Professional
series of PC's, and something like it almost happen with firmware for DEC
terminals a number of years back.
<a name='more'></a>
I hope that Tom Davis's position hasn't been badly hurt by the broad
distribution of his memo - but based on the traditional reaction to bearers of
bad news, especially when the bad news becomes widely known, I can't say I'm
sanguine about it.
-- Jerry
------- Begin Document -------
Software Usability II
October 5, 1993
Tom Davis
Last May, I published my first report on software usability, which
Rocky Rhodes and I presented to at Tom Jermoluk's staff meeting (with
Ed, but without Tom). Subsequently, I made it available to quite a few
other people.
This sequel is to satisfy all those people who have urged me to bring
it up to date. I begin with a summary; details follow.
Please read at least the summary.
SUMMARY
Release 5.1 is a disappointment. Performance for common operations has
dropped 40% from 4.0.5, we shipped with 500 priority 1 and 2 bugs, and
a base Indy is much more sluggish than a Macintosh. Disk space
requirements have increased dramatically.
The primary cause is that we attempted far too much in too little
time. Management would not cut features early, so we were forced to
make massive cuts in the final weeks of the release.
What shall we do now? Let's not look for scapegoats, but learn from
our mistakes and do better next time.
A December release of 5.1.2 is too early to fix much -- we'll spend
much more time on the release process than fixing things. Allow enough
time for a solid release so we don't get: 5.1.2.1, 5.1.2.2, 5.1.2.3, ...
Let's decide ahead of time exactly what features are in 5.1.2. If we
pick a reasonable set we'll avoid emergency feature cuts at the end.
Nobody knows what's wrong -- opinions are as common as senior
engineers. The software environment is so convoluted that at times it
seems to rival the US economy for complexity and unpredictability. I
propose massive code walk-throughs and design reviews to analyze the
software. We'll be forced to look closely at the code, and fresh
reviewers can provide fresh insights.
For the long term, let's change the way we do things so that the
contents and scheduling of releases are better planned and executed.
Make sure marketing and engineering expectations are in agreement.
INTRODUCTION
We've addressed some of the problems presented in the original May
report, but not enough. Most of the report's warnings and predictions
have come true in 5.1. If we keep doing the exact same thing, we'll
keep getting the exact same results.
I'm preparing this report in ASCII to make it widely available. It's
easy to distribute via news and mail, and everyone can read it.
An ASCII version of the May 12 report can be found in:
bedlam.asd:/usr/tmp/report.text
The included quotations are not verbatim. Although the wordings
are inexact, I believe they capture the spirit of the originals.
BLOAT UPDATE
"Do you want to be a bloat detective? It's easy;
just pick any executable. There! You found some!"
-- Rolf van Widenfelt
In the May report, I listed a bunch of executable sizes, and pointed
out that they were unacceptable if we intended to run without serious
paging problems on a 16 megabyte system. Between May and the 5.1
release, many have grown even larger. IRIX went up from 4.8 megabytes
to 8.1 megabytes, and has a memory leak that causes it to grow. Within
a week, my newly-booted 5.1 IRIX was larger than 13.8 megabytes -- a
big chunk of a 16 megabyte system. It's wrong to require our users to
reboot every week.
There are too many daemons. In a vanilla 5.1 installation with Toto,
there are 37 background processes.
DSOs were supposed to reduce physical memory usage, but have had just
the opposite effect, and their indirection has reduced performance.
Programs like Roger Chickering's "Bloatview" based on Wiltse
Carpenter's work make some problems obvious. The news reader "xrn",
starts out small, but leaks memory so badly that within a week or so it
grows to 9 or 10 megabytes, along with plenty of other large programs.
But what's really embarrassing is that even the kernel leaks memory
that can't be recovered except by rebooting!
Showcase grew from 3.2 megabytes to 4.0 megabytes, and the master and
status gizmos which are run by default occupy another 1.7 megabytes.
Much of this happened simply by recompiling under 5.1 -- not because of
additional code.
The window system (Xsgi + 4Dwm) is up from 3.2 MB to 3.6 MB, and
the miscellaneous stuff has grown as well. As I type now, I have the
default non-toto environment plus a single shell and a single text
editor, jot. The total physical memory usage is 21.9 megabytes, and
only because I rebooted IRIX yesterday evening to reduce the kernel
size. Luckily, I'm on a 32 megabyte system without Toto, or I'd be
swamped by paging.
Much of the problem seems to be due to DSOs that load whole libraries
instead of individual routines. Many SGI applications link with 20 or
so large DSOs, virtually guaranteeing enormous executables.
In spite of the DSOs, large chunks of Motif programs remain unshared,
and duplicated in all Motif applications.
PERFORMANCE UPDATE
"Indy: an Indigo without the 'go'".
-- Mark Hughes (?)
"X and Motif are the reasons that UNIX deserves to die."
-- Larry Kaplan
The performance story is just as bad. I was tempted to write simply,
"Try to do some real work on a 16 megabyte Indy. Case closed.", but
I'll include some details.
In May, I listed some unacceptable Motif performance measurements.
Just before 5.1 MR, someone reran my tests and discovered that the
performance had gotten even worse. Some effort was expended to tune
the software so that instead of being intolerable, it was back to
merely unacceptable performance.
We no longer report benchmark results on our standard system. The
benchmarks are not done with the DSO libraries; they are all compiled
non-DSO so that the performance in 5.1 has not declined too much.
Before I upgraded from 4.0.5 to the MR version of 5.1, I ran some
timings of some everyday activities to see what would happen. These
timings were all made with the wall clock, so they represent precisely
what our users will see. I run a 32 megabyte R4000 Elan.
Test 4.0.5 5.1 % change
---- ----- --- --------
C compile of a 25 sec 35 sec 40%
small application
C++ compile of a 68 sec 105 sec 54%
small application
Showcase startup, 13 sec 18 sec 38%
May report file
Start a shell <2 sec ~3 sec ~50%
Jot 2 MB file <2 sec ~3 sec ~50%
What's most frightening about the 5.1 performance is that nobody knows
exactly where it went. If you start asking around, you get plenty of
finger-pointing and theories, but few facts. In the May report, I
proposed a "5% theory", which states that each little thing we add
(Motif, internationalization, drag-and-drop, DSOs, multiple fonts, and
so on) costs roughly 5% of the machine. After 15 or 20 of these,
most of the performance is gone.
Bloating by itself causes problems. There's heavy paging, there's so
much code and it's so scattered that the cache may as well not be
there. The window manager and X and Toto are so tangled that many
minor operations like moving the mouse or deleting a file wake up all
the processes on the machine, causing additional paging, and perhaps
graphics context swaps.
But bloat isn't the whole story. Rocky Rhodes recently ran a small
application on an Indy, and noticed that when he held the mouse button
down and slid it back and forth across the menu bar, the (small) pop-up
menus got as much as 25 seconds behind. He submitted a bug, which was
dismissed as paging due to lack of memory. But Rocky was running with
160 megabytes of memory, so there was no paging. The problem turned
out to be Motif code modified for the SGI look that is even more
sluggish than regular Motif. Perhaps the problem is simply due to the
huge number of context swaps necessary for all the daemons we're
shipping.
The complexity of our system software has surpassed the ability of
average SGI programmers to understand it. And perhaps not just average
programmers. Get a room full of 10 of our best software people, and
you'll get 10 different opinions of what's causing the lousy
performance and bloat. What's wrong is that the software has simply
become too complicated for anyone to understand.
WHAT WENT WRONG IN 5.1?
The one sentence answer is: we bit off more than we could chew. As a
company, we still don't understand how difficult software is.
We planned to make major changes in everything -- a new operating
system, new compilers, a new user environment, new tools, and lots of
new features in the multi-media area. Not only that, but the new stuff
was promised to do everything the old software had done, and with major
enhancements. (Early warning: version 6.0 promises to be even more
disruptive.)
About 9 months ago, Rocky and I pointed out the impossibility of what
we were attempting. Rather than reduce the scope of the projects, a
decision was made to hire a couple of contractors (who know nothing
about our system) to handle the worst user interface problems in the
Roxy project. In addition, promises were obtained from various
executives that a significant effort would be made to improve software
performance.
Management was basically afraid to cut any features, so we continued to
work on a project that was far too large. The desperate attempt to do
everything caused programmers to cut corners, with disastrous effects
on the bug count. And the bug count was high simply because 5.1 was so
big.
Only when the situation was beyond hope of repair did we start to do
something. Features and entire products were removed wholesale from
the
release, and hundreds of high-priority bugs were classified as
exceptions, so that we could ship with "no priority 1 and 2 bugs". We
did, however, ship with over 500 "exceptions". The release was deemed
too crummy to push to all our machines, but was restricted to the
Indys, the high-end machines, and a few others where new hardware
required the new software. Due to the massive bug count, virtually no
performance tuning was done.
When the schedule is impossible as it was in 5.1, the release process
itself can get in the way. The schedule imposes a code freeze long
before the software is stable, and fixing things becomes much more
difficult. If you know you're going to be late, slip before the code
freeze, not after. We're trying to wrap up the box before the stuff
inside is finished, and then trying to fix things inside the box
without undoing the wrapping -- it has to be less efficient.
Management Issues:
There was never an overall software architect, and there still is not,
and until Way Ting was given the job near the end, there was no manager
in charge of the 5.1 release, either.
I wrote a note in sgi.bad-attitude about the "optimist effect", which I
believe is mostly true. In condensed form:
Optimists tend to be promoted, so the higher up in the organization
you are, the more optimistic you tend to be. If one manager says
"I can do that in 4 months", and another only promises it in 6
months, the 4 month guy gets the job. When the software is 4
months
late, the overall system complexity makes it easy to assign blame
elsewhere, so there's no way to judge mis-management when it's time
for promotions.
To look good to their boss, most people tend to put a positive spin
on their reports. With many levels of management and increasing
optimism all the way up, the information reaching the VPs is very
filtered, and always filtered positively.
The problem is that the highly filtered estimates are completely out of
line with reality (at least in recent software plans here at SGI), and
there are no reality checks back from the VPs to the engineers on the
bottom. I think it's great to have aggressive schedules where you try
to get things out 20% or so faster than you'd expect. The problem is
that in 5.1, the engineers were expected to get things out 80% faster,
and it was clearly impossible, so many just gave up.
We certainly didn't win any morale prizes among the engineers with
5.1. It's the first release here at SGI where most of the engineers I
talked to are ashamed of the product. There are always a few, but this
time there were many. When engineers were asked to come in over the
weekends before the 5.1 release to fix show-stopper bugs, I heard a
comment like: "Why bother? SGI's going to release it anyway, whether
they're fixed or not."
I'm not blaming the engineers. Most of them worked their hearts out
for 5.1, and did the best they could, given the circumstances. They'll
be happy to buy into a plan where there's a 20% stretch, but not where
there's an 80% stretch. They figure: "It's hopeless, and I'll be late
anyway, and I'm not going to get rewarded for that, so why kill
myself?"
Marketing - Engineering Disconnect
"Marketing -- where the rubber meets the sky."
-- Unknown
There's a disconnect between engineering and marketing. It's not
surprising -- marketing wants all the whiz-bang features, it wants to
run in 16 megabytes, and it wants it yesterday. Although engineering
would like the same things, it is faced with the reality of time
limits, fixed costs, and the laws of nature.
It's great to have pressure from marketing to do a better job, but at
SGI, we often seem to have deadlocks that are simply not resolved.
Marketing insists that Indy will work in 16 megabytes and engineering
insists that it won't, but both continue to make their plans without
resolving the conflict, so today we're shipping virtually useless 16 MB
systems. Similarly for feature lists, reliability requirements, and
deadlines.
Well, at least we met the deadline.
WHAT TO DO -- SHORT TERM (5.1.2)
"We should sell 'bloat credits', the way the government
sells pollution credits. Everybody's assigned a certain
amount of bloat, and if they go over, they have to purchase
bloat credits from some other group that's been more
careful."
-- Bent Hagemark
There are problems in both performance and bugs, and we'd like to fix
both. In addition, the first thing we should do is decide exactly
what's going into release 5.1.2.
If we are serious about a December all-platforms release, there may be
very little we can do other than keep stumbling along as we have been.
Three months isn't much time to do anything, considering the overhead
of a release, where perhaps half of the time will be spent in "code
freeze". After 5.1, many engineers are exhausted, and it's
unreasonable to expect them to start hard work immediately. 500
outstanding priority 1 and 2 bugs is a huge list, and we haven't even
begun to hear about customer problems yet.
What Should be in Release 5.1.2:
I'm afraid the answer is going to be "everything that didn't make it
into 5.1". I know that won't be the case, but I hope that we will
carefully select what goes in now, rather than hack things out in a
panic in December. The default should be "not included", and we should
require a good reason to include things. Let's make sure that there's
a minimal, solid, working set before we start adding frills.
Improving Performance:
"SGI software has a cracked engine block, and we're trying
to fix it with a tune-up."
-- Mark Segal
As stated above, we don't even know exactly what's wrong. We probably
never will, but we should start doing things that will have as much of
an impact on the problem as possible. I don't think we have time to
study the problem in detail and then decide what to do -- we've got to
mix the research with doing something about it.
Before we begin, we should have definite performance goals -- lose less
than 5% wall-clock time on compiles of some known program over 4.0.5,
have shells come up as fast as in 4.0.5, or whatever.
Some people claim that we need new software debugging tools to look at
the problem, and that may be true, but it's not a short-term solution,
and it runs the risk of causing us to spend all our time designing
performance measurement tools, rather than fixing performance.
In fact, I don't really believe that simple "tuning" will make a
large dent. To get things to run significantly faster, we've got
to make significant changes. And we can't beat the "5% rule" by just
speeding up all the systems by 5% -- if everything is exactly 5%
faster,
the overall system will be exactly 5% faster.
There's a strong tendency to look for the "quick fix". "Get the code
re-arranger to work", or "Put all the non-modifiable strings in shared
code space", for example. These ideas are attractive, since they
promise to speed up all the code, and they should probably be pursued,
but I think we're not going to make a lot of progress until we identify
the major software architectural problems and do some massive
simplification. Remember that DSOs were the last "quick fix".
There's got to be more to it than tuning; there must be some amazingly
bad software architecture -- from a novice's point of view, a 4 MB
Macintosh runs a far more efficient, interesting system than a 16 MB
Indy. The Mark Segal quote above sums it up.
Code walk-throughs and design reviews are in order for most of our
software. The attendees should include not only people working in the
same area, but a small cross-section of experienced engineers from
other areas. Get a pool of, say, 20 experienced engineers and
perhaps 3 at a time would sit in on code reviews together with the
other people working in that area.
Code reviews will help in many ways -- the engineer presenting the code
will have to understand it thoroughly to present it, others will learn
about it, and outside observers will provide different ways to look at
the problems.
The most important thing should be the focus -- we're trying to make
the code better and faster, not to make it more general, or have new
features, or be more reusable, or better structured.
For complex problems, the walk-through should also include some general
design review. Are these daemons really necessary? Do we really need
this feature? And so on.
Fixing Bugs:
The code walk-throughs will obviously tend to turn up some bugs, so
they'll serve a dual purpose.
With 500 or so priority 1 and 2 bugs, we must prioritize these as
well. A bug that causes a system crash only on machines with some rare
hardware configuration is properly classified priority 1, but it's
probably less important than a bug in a popular program like Showcase
that causes you to lose your file every tenth time, which would
normally rank as priority 2. The effort involved in the fix should
also be taken into account. For bugs of equal frequency of occurrence,
it's probably better to fix 20 priority 2 bugs than 1 priority 1 bug if
the priority 2 bugs are 20 times easier to fix.
A bunch of bugs can be eliminated by getting rid of features. Let's
have the courage to cut some of the fat.
WHAT TO DO -- LONG TERM
"Software quality is not a crime."
-- Unknown (seen on a poster in building 7)
It's easy to go on forever here, but I'll try to limit it to a few key
ideas. We don't have to do all these at once, but we'd better start.
Have an overall SGI software plan.
Let's get an architect, or at least a small group of highly
technical people, not just managers, to agree on plans for
releases. In fact, since the release is a company-wide project,
there ought to be company-wide participation in the decisions of
what's in a release. The group should include marketing,
documentation, engineering, and management and should come up with
a compromise that's reasonable to all.
In every case, some attempt must be made to check reasonableness
all the way to the bottom. There's a long series of excuses,
"Well, that's what my junior VPs told me.", or "That's what my
directors/managers/lead engineers/engineers told me." We get
killed by the optimist effect, and a disinclination to listen
seriously to anyone but our direct reports. Try to imagine the
guts it takes for an engineer to go to his director and say: "My
manager's out of his mind -- I can't possibly do what he's
promised."
Let's try to concentrate on performance and quality, not on new
features, especially for the 5.1.2 release. I know from my own
experience that when I write good code, I spend 10% of the time
adding features, and 90% debugging and tuning them. It's the only
way to make quality software. In SGI's recent releases, the
opposite proportions are often the rule. It's much easier to add
100 really neat features that don't work than to speed up
performance by 1%.
Aim for simplicity in design, not complexity. Make a few things
work really well; don't have 1000 flaky programs.
Be willing to cut features; who's going to be more pissed off: a
customer who was promised a feature that doesn't appear, or the
same customer who gets the promised feature, and after months of
struggling with it, discovers he can't make it work?
Get better agreement between the top level VPs and the lowest
engineers that a given schedule is reasonable.
For new development, continue the formal design reviews and code
walk-throughs. These shouldn't just happen once in the development
cycle -- things are bound to change, and code reviews can be very
valuable, even for our experienced programmers.
ACKNOWLEDGEMENTS
I take full responsibility for the opinions contained herein, but I'd
like to thank Mark Segal, Rosemary Chang, Mary Ann Gallager, Jackie
Neider, Sharon Fischler, Henry Moreton, and Jon Livesey for suggestions
and comments.
</pre>
</blockquote>
<b>CITATION ENDS</b>
<br />
<b><br /></b><br />
<b><br /></b><br />
<br /></div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-82241807290799144132012-04-11T13:56:00.001+01:002012-04-11T13:56:47.499+01:00Convert full datetime to start of the day in T-SQL<div dir="ltr" style="text-align: left;" trbidi="on">
Nice trick to convert full datetime to just year-month-day portion, resetting hours, minutes, seconds. Works in T-SQL, SQL Server<br />
<br />
This statement:<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">SELECT GETDATE() AS FullDate, DATEADD(day, DATEDIFF(day, '19000101', GETDATE()), '19000101') AS StartOfTheDay</span><br />
<br />
Produces this result:<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">FullDate</span><span class="Apple-tab-span" style="font-family: 'Courier New', Courier, monospace; font-size: xx-small; white-space: pre;"> </span><span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">StartOfTheDay</span><br />
<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">2012-04-11 13:51:15.570<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-04-11 00:00:00.000</span><br />
<br />
<br />
<b>Note1:</b> you can put any datetime instead of GETDATE()
<br />
<br />
<b>Note2:</b> <span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">DATEADD(day, DATEDIFF(day, '19000101', GETDATE()), '19000101')</span> is the functional equivalent of <span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span></div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-59532013166988687922012-03-27T12:17:00.000+01:002012-03-27T12:17:09.842+01:00Using WinMerge in VS2010<div dir="ltr" style="text-align: left;" trbidi="on">
My recommended tool for Compare and Merge operation in Visual Studio is <a href="http://winmerge.org/">WinMerge</a><br />
<br />
Here is how to setup Visual Studio 2010 IDE to use it. Assuming you are using Team foundation Server and WinMerge is already installed<br />
<br />
<br />
<b>In IDE:</b><br />
Tools->Options<br />
Expand "Source Control"<br />
Click "Visual Studio Team Foundation Server" link<br />
Click "configure User Tools ..." button<br />
<br />
click "Modify ..." for each extension<br />
or click "Add ..." to add new one<br />
<br />
You may add .* as an extension which will mean any file extension<br />
<br />
<b>Compare:</b><br />
Command: C:\Program Files (x86)\WinMerge\WinMergeU.exe<br />
Arguments: /e /u /wl /wr /dl %6 /dr %7 %1 %2<br />
<br />
<b>Merge:</b><br />
Command: C:\Program Files (x86)\WinMerge\WinMergeU.exe<br />
Arguments: /e /u /wl /dl %6 /dr %7 %1 %2 %4<br />
<br />
<br />
<br /></div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-65547363252429438982012-02-24T10:19:00.000+00:002012-02-24T10:19:51.760+00:00Fixing Gallio ReSharper Runner file not found exception<div dir="ltr" style="text-align: left;" trbidi="on">
Visual Studio 2010. Windows 7 x64. <a href="http://www.jetbrains.com/resharper/">ReSharper</a> 5.1. <a href="http://www.gallio.org/Downloads.aspx">Gallio 3.3.458.0</a>, installed from 64 bit msi.<br />
<br />
When debugging a unit test written with Gallio Framework, there is the following system.IO.FileNotFound exception : <span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">{"Could not load file or assembly 'Gallio.ReSharperRunner51, Version=3.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.":"Gallio.ReSharperRunner51, Version=3.3.0.0, Culture=neutral, PublicKeyToken=null"}</span><br />
<br />
You click "Continue" and test debugging continues as normal.<br />
<br />
It appears that it looked for the Gallio.ReSharperRunner51.DLL in the following paths<br />
<br />
<span style="font-family: inherit; font-size: x-small;">C:/Program Files/Gallio/bin</span><br />
<span style="font-family: inherit; font-size: x-small;">C:/Program Files/Gallio/bin/Gallio.ReSharperRunner51</span><br />
<br />
and the file is not there.<br />
<br />
Quick solution would be to get that dll from the zip "bundle" and copy it to <span style="font-size: x-small;">C:/Program Files/Gallio/bin</span>.<br />
<br />
<br />
<span style="font-size: x-small;"><br /></span></div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-5399919312449920702012-01-27T12:50:00.001+00:002012-01-27T12:50:10.357+00:00Reclaim HDD space on Windows 7<div dir="ltr" style="text-align: left;" trbidi="on">
Collection of tips on getting some more free hard disk space. Applicable to Windows 7.<br />
WARNING! use carefully, not all tips are applicable to your situation<br />
<br />
- Use Disk Cleanup and free space occupied by SP1 backup files, if you never going to rollback to pre-SP1 state<br />
- (Useful for desktop PC, may be harmful for a laptop) This will disable the hybernation feature, in theory should free up the same amount of HDD space as you have RAM. Run as administrator in command prompt:<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">powercfg -h off</span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span><br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span></div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-35403229575731096112012-01-17T13:13:00.001+00:002012-01-19T12:04:20.813+00:00Exporting TFS work item(s) (Scenarios, QoS) to Word<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Approach 1)</b> Use the <a href="http://www.teamsystemsolutions.com/teamspec/features/microsoft-word-integration.aspx">TeamSpec</a> - commercial tool<br />
<br />
<b>Approach 2)</b> <a href="http://www.aitgmbh.de/index.php?id=word_to_tfs0&no_cache=1&L=1">AIT Word2TFS</a> - Free tool but works only with TFS2010<br />
<br />
<b>Approach 3)</b> Run a report in SSRS, deliver it as Word<br />
<br />
<b>Approach 4)</b> Wait for ALM Rangers to release their Word4TFS tool <a href="http://blogs.msdn.com/b/willy-peter_schaub/archive/2011/12/31/rangers-flash-december-2011.aspx">here</a> <br />
<br />
<b>Approach 5)</b> use TFS Power Tools and xslt<br />
<br />
1. Download and Install <a href="http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f">TFS Power Tools (Team Foundation Server 2010 Power Tools)</a><br />
2. Download <a href="http://www.microsoft.com/download/en/details.aspx?id=21714">MSXSL utility</a> msxsl.exe or use your own xslt transformer<br />
3. Run the query like below for Scenarios:<br />
<span style="font-family: "Courier New",Courier,monospace; font-size: xx-small;">tfpt query /collection:http://myserver:8080 /format:xml /wiql:"SELECT * FROM WorkItems WHERE [System.TeamProject] = 'MyProject' AND [System.WorkItemType] = 'Scenario' AND [System.IterationPath] = 'MyProject\MyIteration' ORDER BY [System.Id]" > WorkItems.xml </span><br />
4. Learn the <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=101">xml reference schema for Microsoft Office 2003</a> or <a href="http://www.microsoft.com/download/en/details.aspx?id=4463">Microsoft Office 2007</a>. Transform your xml with xslt<br />
<br />
if you use that msxsl.exe then the command line is: <span style="font-family: "Courier New",Courier,monospace; font-size: xx-small;">msxsl.exe WorkItems.xml tfs2word.xslt -o myitems.xml</span><br />
<br />
<b>Updated:</b> Now the xslt can transform line breaks and generate simple Table of Contents (TOC)<br />
<br />
xslt to use:<br />
<span style="font-family: "Courier New",Courier,monospace; font-size: xx-small;"><?xml version="1.0" encoding="UTF-8" ?><br /><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"<br /> xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"><br /> <xsl:output method="xml" indent="yes" /><br /> <xsl:template match="/"><br /> <xsl:processing-instruction name="mso-application"><br /> <xsl:text>progid="Word.Document"</xsl:text><br /> </xsl:processing-instruction><br /><w:wordDocument xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" <br /> xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" <br /> xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" <br />
xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" <br /> xmlns:wsp="http://schemas.microsoft.com/office/word/2003/wordml/sp2" <br /> xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" w:macrosPresent="no" w:embeddedObjPresent="no" <br /> w:ocxPresent="no" xml:space="preserve"><br /> <o:DocumentProperties><br /> <o:Author>AngledOnTech.blogspot.com</o:Author><br /> </o:DocumentProperties><br /> <w:docPr><br /> <w:view w:val="print" /><br /> </w:docPr><br /> <w:fonts><br />
<w:defaultFonts w:ascii="Times New Roman" w:fareast="Times New
Roman" w:h-ansi="Times New Roman" w:cs="Times New Roman"/><br /> <w:font w:name="Times New Roman"><br />
<w:panose-1 w:val="02020603050405020304"/><w:charset
w:val="00"/><w:family w:val="Roman"/><w:pitch
w:val="variable"/><w:sig w:usb-0="E0002AFF" w:usb-1="C0007841"
w:usb-2="00000009" w:usb-3="00000000" w:csb-0="000001FF"
w:csb-1="00000000"/><br /> </w:font><br /> <w:font w:name="Cambria Math"><br />
<w:panose-1 w:val="02040503050406030204"/><w:charset
w:val="01"/><w:family
w:val="Roman"/><w:notTrueType/><w:pitch
w:val="variable"/><w:sig w:usb-0="00000000" w:usb-1="00000000"
w:usb-2="00000000" w:usb-3="00000000" w:csb-0="00000000"
w:csb-1="00000000"/></w:font><w:font
w:name="Cambria"><w:panose-1
w:val="02040503050406030204"/><w:charset
w:val="00"/><w:family w:val="Roman"/><w:pitch
w:val="variable"/><w:sig w:usb-0="E00002FF" w:usb-1="400004FF"
w:usb-2="00000000" w:usb-3="00000000" w:csb-0="0000019F"
w:csb-1="00000000"/><br /> </w:font><br /> </w:fonts><br /> <w:styles><br /> <w:versionOfBuiltInStylenames w:val="7"/><br /> <w:latentStyles w:defLockedState="off" w:latentStyleCount="267"><br /> <w:lsdException w:name="Normal"/><br />
<w:lsdException w:name="heading 1"/><w:lsdException
w:name="heading 2"/><w:lsdException w:name="heading
3"/><w:lsdException w:name="heading 4"/><w:lsdException
w:name="heading 5"/><w:lsdException w:name="heading
6"/><w:lsdException w:name="heading 7"/><w:lsdException
w:name="heading 8"/><w:lsdException w:name="heading 9"/><br />
<w:lsdException w:name="toc 1"/><w:lsdException
w:name="toc 2"/><w:lsdException w:name="toc
3"/><w:lsdException w:name="toc 4"/><w:lsdException
w:name="toc 5"/><w:lsdException w:name="toc
6"/><w:lsdException w:name="toc 7"/><w:lsdException
w:name="toc 8"/><w:lsdException w:name="toc 9"/><br />
<w:lsdException w:name="caption"/><w:lsdException
w:name="Title"/><w:lsdException w:name="Default Paragraph
Font"/><br /> <w:lsdException
w:name="Subtitle"/><w:lsdException
w:name="Strong"/><w:lsdException w:name="Emphasis"/><br />
<w:lsdException w:name="Table Grid"/><w:lsdException
w:name="Placeholder Text"/><w:lsdException w:name="No
Spacing"/><br /> <w:lsdException w:name="Light
Shading"/><w:lsdException w:name="Light
List"/><w:lsdException w:name="Light Grid"/><br />
<w:lsdException w:name="Medium Shading 1"/><w:lsdException
w:name="Medium Shading 2"/><w:lsdException w:name="Medium List
1"/><w:lsdException w:name="Medium List 2"/><w:lsdException
w:name="Medium Grid 1"/><w:lsdException w:name="Medium Grid
2"/><w:lsdException w:name="Medium Grid 3"/><w:lsdException
w:name="Dark List"/><w:lsdException w:name="Colorful
Shading"/><w:lsdException w:name="Colorful
List"/><w:lsdException w:name="Colorful
Grid"/><w:lsdException w:name="Light Shading Accent
1"/><w:lsdException w:name="Light List Accent
1"/><w:lsdException w:name="Light Grid Accent
1"/><w:lsdException w:name="Medium Shading 1 Accent
1"/><w:lsdException w:name="Medium Shading 2 Accent
1"/><w:lsdException w:name="Medium List 1 Accent
1"/><w:lsdException w:name="Revision"/><w:lsdException
w:name="List Paragraph"/><w:lsdException
w:name="Quote"/><w:lsdException w:name="Intense
Quote"/><w:lsdException w:name="Medium List 2 Accent
1"/><w:lsdException w:name="Medium Grid 1 Accent
1"/><w:lsdException w:name="Medium Grid 2 Accent
1"/><w:lsdException w:name="Medium Grid 3 Accent
1"/><w:lsdException w:name="Dark List Accent
1"/><w:lsdException w:name="Colorful Shading Accent
1"/><w:lsdException w:name="Colorful List Accent
1"/><w:lsdException w:name="Colorful Grid Accent
1"/><w:lsdException w:name="Light Shading Accent
2"/><w:lsdException w:name="Light List Accent
2"/><w:lsdException w:name="Light Grid Accent
2"/><w:lsdException w:name="Medium Shading 1 Accent
2"/><w:lsdException w:name="Medium Shading 2 Accent
2"/><w:lsdException w:name="Medium List 1 Accent
2"/><w:lsdException w:name="Medium List 2 Accent
2"/><w:lsdException w:name="Medium Grid 1 Accent
2"/><w:lsdException w:name="Medium Grid 2 Accent
2"/><w:lsdException w:name="Medium Grid 3 Accent
2"/><w:lsdException w:name="Dark List Accent
2"/><w:lsdException w:name="Colorful Shading Accent
2"/><w:lsdException w:name="Colorful List Accent
2"/><w:lsdException w:name="Colorful Grid Accent
2"/><w:lsdException w:name="Light Shading Accent
3"/><w:lsdException w:name="Light List Accent
3"/><w:lsdException w:name="Light Grid Accent
3"/><w:lsdException w:name="Medium Shading 1 Accent
3"/><w:lsdException w:name="Medium Shading 2 Accent
3"/><w:lsdException w:name="Medium List 1 Accent
3"/><w:lsdException w:name="Medium List 2 Accent
3"/><w:lsdException w:name="Medium Grid 1 Accent
3"/><w:lsdException w:name="Medium Grid 2 Accent
3"/><w:lsdException w:name="Medium Grid 3 Accent
3"/><w:lsdException w:name="Dark List Accent
3"/><w:lsdException w:name="Colorful Shading Accent
3"/><w:lsdException w:name="Colorful List Accent
3"/><w:lsdException w:name="Colorful Grid Accent
3"/><w:lsdException w:name="Light Shading Accent
4"/><w:lsdException w:name="Light List Accent
4"/><w:lsdException w:name="Light Grid Accent
4"/><w:lsdException w:name="Medium Shading 1 Accent
4"/><w:lsdException w:name="Medium Shading 2 Accent
4"/><w:lsdException w:name="Medium List 1 Accent
4"/><w:lsdException w:name="Medium List 2 Accent
4"/><w:lsdException w:name="Medium Grid 1 Accent
4"/><w:lsdException w:name="Medium Grid 2 Accent
4"/><w:lsdException w:name="Medium Grid 3 Accent
4"/><w:lsdException w:name="Dark List Accent
4"/><w:lsdException w:name="Colorful Shading Accent
4"/><w:lsdException w:name="Colorful List Accent
4"/><w:lsdException w:name="Colorful Grid Accent
4"/><w:lsdException w:name="Light Shading Accent
5"/><w:lsdException w:name="Light List Accent
5"/><w:lsdException w:name="Light Grid Accent
5"/><w:lsdException w:name="Medium Shading 1 Accent
5"/><w:lsdException w:name="Medium Shading 2 Accent
5"/><w:lsdException w:name="Medium List 1 Accent
5"/><w:lsdException w:name="Medium List 2 Accent
5"/><w:lsdException w:name="Medium Grid 1 Accent
5"/><w:lsdException w:name="Medium Grid 2 Accent
5"/><w:lsdException w:name="Medium Grid 3 Accent
5"/><w:lsdException w:name="Dark List Accent
5"/><w:lsdException w:name="Colorful Shading Accent
5"/><w:lsdException w:name="Colorful List Accent
5"/><w:lsdException w:name="Colorful Grid Accent
5"/><w:lsdException w:name="Light Shading Accent
6"/><w:lsdException w:name="Light List Accent
6"/><w:lsdException w:name="Light Grid Accent
6"/><w:lsdException w:name="Medium Shading 1 Accent
6"/><w:lsdException w:name="Medium Shading 2 Accent
6"/><w:lsdException w:name="Medium List 1 Accent
6"/><w:lsdException w:name="Medium List 2 Accent
6"/><w:lsdException w:name="Medium Grid 1 Accent
6"/><w:lsdException w:name="Medium Grid 2 Accent
6"/><w:lsdException w:name="Medium Grid 3 Accent
6"/><w:lsdException w:name="Dark List Accent
6"/><w:lsdException w:name="Colorful Shading Accent
6"/><w:lsdException w:name="Colorful List Accent
6"/><w:lsdException w:name="Colorful Grid Accent
6"/><w:lsdException w:name="Subtle
Emphasis"/><w:lsdException w:name="Intense
Emphasis"/><w:lsdException w:name="Subtle
Reference"/><w:lsdException w:name="Intense
Reference"/><w:lsdException w:name="Book
Title"/><w:lsdException
w:name="Bibliography"/><w:lsdException w:name="TOC
Heading"/></w:latentStyles><w:style w:type="paragraph"
w:default="on" w:styleId="Normal"><w:name
w:val="Normal"/><w:rPr><wx:font wx:val="Times New
Roman"/><w:lang w:val="EN-GB" w:fareast="EN-GB"
w:bidi="AR-SA"/></w:rPr></w:style><w:style
w:type="paragraph" w:styleId="Heading2"><w:name w:val="heading
2"/><wx:uiName wx:val="Heading 2"/><w:basedOn
w:val="Normal"/><w:next w:val="Normal"/><w:link
w:val="Heading2Char"/><w:rsid
w:val="002E2428"/><w:pPr><w:keepNext/><w:spacing
w:before="240" w:after="60"/><w:outlineLvl
w:val="1"/></w:pPr><w:rPr><w:rFonts w:ascii="Cambria"
w:h-ansi="Cambria"/><wx:font
wx:val="Cambria"/><w:b/><w:b-cs/><w:i/><w:i-cs/><w:sz
w:val="28"/><w:sz-cs
w:val="28"/></w:rPr></w:style><w:style
w:type="character" w:default="on"
w:styleId="DefaultParagraphFont"><w:name w:val="Default Paragraph
Font"/></w:style><w:style w:type="table" w:default="on"
w:styleId="TableNormal"><w:name w:val="Normal
Table"/><wx:uiName wx:val="Table
Normal"/><w:rPr><wx:font wx:val="Times New
Roman"/><w:lang w:val="EN-GB" w:fareast="EN-GB"
w:bidi="AR-SA"/></w:rPr><w:tblPr><w:tblInd w:w="0"
w:type="dxa"/><w:tblCellMar><w:top w:w="0"
w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom
w:w="0" w:type="dxa"/><w:right w:w="108"
w:type="dxa"/></w:tblCellMar></w:tblPr></w:style><w:style
w:type="list" w:default="on" w:styleId="NoList"><w:name w:val="No
List"/></w:style><w:style w:type="character"
w:styleId="Heading2Char"><w:name w:val="Heading 2
Char"/><w:basedOn w:val="DefaultParagraphFont"/><w:link
w:val="Heading2"/><w:rsid
w:val="002E2428"/><w:rPr><w:rFonts w:ascii="Cambria"
w:fareast="Times New Roman" w:h-ansi="Cambria" w:cs="Times New
Roman"/><w:b/><w:b-cs/><w:i/><w:i-cs/><w:sz
w:val="28"/><w:sz-cs w:val="28"/></w:rPr><br /> </w:style><br /> </w:styles> <br /> <w:body><br /> <w:tbl><br /> <w:tblPr><br /> <w:tblStyle w:val="TableGrid"/><br /> <w:tblW w:w="0" w:type="auto"/><br /> <w:tblLook w:val="01E0"/><br /> </w:tblPr><br /> <w:tblGrid><br /> <w:gridCol w:w="4428"/><w:gridCol w:w="4428"/><br /> </w:tblGrid><br /> <w:tr><br /> <w:tc><w:p><w:r><w:t>ID</w:t></w:r></w:p></w:tc><br /> <w:tc><w:p><w:r><w:t>Title</w:t></w:r></w:p></w:tc><br /> </w:tr><br /> <xsl:apply-templates select="WorkItems/WorkItem" mode="toc"/><br /> </w:tbl> <br /> <w:br w:type="page"/><br /> <br /> <xsl:apply-templates select="WorkItems/WorkItem" /><br /> <br /> </w:body><br /> </w:wordDocument><br /> </xsl:template><br /><br /><xsl:template match="WorkItems/WorkItem" mode="toc"><br /> <w:tr><br /> <w:tc><w:p><w:r><w:t><xsl:value-of select="Fields/Field[@RefName='System.Id']/@Value" /></w:t></w:r></w:p></w:tc><br /> <w:tc><w:p><w:r><w:t><xsl:value-of select="Fields/Field[@RefName='System.Title']/@Value"/></w:t></w:r></w:p></w:tc><br /> </w:tr><br /></xsl:template> <br /><br /> <xsl:template match="WorkItem"><br /> <w:p><br /> <w:pPr><br /> <w:pStyle w:val="Heading2"/><br /> <w:keepLines w:val="on"/><br /> <w:keepNext w:val="on"/><br /> </w:pPr><br /> <w:r><br /> <w:t><br /> <xsl:value-of select="Fields/Field[@RefName='System.Id']/@Value" />: <xsl:value-of select="Fields/Field[@RefName='System.Title']/@Value" /><br /> </w:t><br /> </w:r><br /> </w:p><br /> <w:p><br /> <w:pPr><w:keepLines w:val="on"/></w:pPr> <br /> <w:r><br /> <w:t><br /> <xsl:call-template name="string-replace-with-mswordbreaks"><br /> <xsl:with-param name="text" select="Fields/Field[@RefName='System.Description']/@Value" /><br /> <xsl:with-param name="replace" select="'&#10;'" /><br /> </xsl:call-template> <br /> </w:t><br /> </w:r><br /> </w:p> <br /> </xsl:template> <br /><br /><br /> </xsl:stylesheet></span><br />
<br />
<span style="font-size: small;"><b>Useful links:</b></span><br />
<a href="http://rep.oio.dk/microsoft.com/officeschemas/wordprocessingml_article.htm">Good overview of WordprocessingML</a><br />
<a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=101">Office 2003 reference schemas</a><br />
<a href="http://www.microsoft.com/download/en/details.aspx?id=4463">Office 2007 Schema Reference</a><br />
<br />
<br /></div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-7132338678042532872012-01-11T16:44:00.000+00:002012-01-13T12:21:55.385+00:00Dropping all stored procedures, functions, views and also system-generated constraints<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;"><span style="font-family: inherit; font-size: small;">The script below will drop all stored procedures, functions and views in the database. Very useful when doing upgrades. It will also drop all system-generated default constraints. Just make sure that from now on, in your DB upgrade script, all the constraints have predefined names.</span></span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;"><span style="font-family: inherit; font-size: small;"><br /></span></span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;"><span style="font-family: inherit; font-size: small;">Works in SQL Server 2008</span></span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<br /></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;"><br /></span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;">DECLARE @schemaName varchar(100), @objName varchar(500), @objType varchar(2), @parentObjName varchar(500)<br />
DECLARE cur CURSOR<br />
FOR SELECT sa.name AS SchemaName, s.[name] AS ObjName, s.[type] AS ObjType, s2.[name] AS ParentObjName<br />
FROM sys.objects s<br />
INNER JOIN sys.schemas sa ON s.schema_id = sa.schema_id<br />
LEFT OUTER JOIN sys.objects s2 ON s2.object_id = s.parent_object_id <br />
WHERE<span style="color: teal;"> s</span><span style="color: grey;">.</span><span style="color: teal;">[name]</span> <span style="color: grey;">NOT</span> <span style="color: grey;">LIKE</span> <span style="color: red;">'%aspnet%' AND </span></span><span style="font-size: xx-small;">s.[type] in (N'P', N'PC', N'V', N'FN', N'TF') OR (s.[name] like '%[_][_]%' AND s.[name] NOT LIKE '%aspnet%')</span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-family: "Courier New",Courier,monospace; font-size: xx-small;">--ignoring constraints on ASP.Net tables as they are not touched by the upgrade<br />
OPEN cur<br />
<br />
FETCH NEXT FROM cur INTO @schemaName, @objName, @objType, @parentObjName<br />
WHILE @@fetch_status = 0<br />
BEGIN<br />
PRINT 'Dropping ['+@objName+'] ...'<br />
IF @objType = N'V'<br />
BEGIN<br />
EXEC (N'DROP VIEW ['+@schemaName+'].['+@objName+']')<br />
END<br />
IF @objType IN (N'P', N'PC')<br />
BEGIN<br />
EXEC (N'DROP PROCEDURE ['+@schemaName+'].['+@objName+']')<br />
END<br />
IF @objType IN (N'FN', N'TF')<br />
BEGIN<br />
EXEC (N'DROP FUNCTION ['+@schemaName+'].['+@objName+']')<br />
END <br />
IF @objType IN (N'D') AND @parentObjName IS NOT NULL<br />
BEGIN<br />
PRINT 'Will drop the '+ @objName +' constraint in ' + @parentObjName<br />
EXEC (N'ALTER TABLE ['+@schemaName+'].['+@parentObjName+'] DROP CONSTRAINT ['+@objName+']');<br />
END <br />
FETCH NEXT FROM cur INTO @schemaName, @objName, @objType, @parentObjName<br />
END<br />
CLOSE cur<br />
DEALLOCATE cur<br />
GO</span><span style="font-size: xx-small;"><span style="font-family: inherit; font-size: small;"> </span></span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;"><br /></span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;"><br /></span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;"><br /></span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;"><br /></span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;"><br /></span></div>
</div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-76312393450092430142012-01-03T16:20:00.000+00:002012-01-05T16:27:31.434+00:00On compiling Doom3 source code<div dir="ltr" style="text-align: left;" trbidi="on">
As you may know, <a href="https://twitter.com/#%21/ID_AA_Carmack/status/139106966357282817">idSoftware released the source code for Doom3</a> game under the GPL license. You can <a href="https://github.com/TTimo/doom3.gpl/downloads">download it from here</a> https://github.com/TTimo/doom3.gpl/downloads. This is the source code for their <a href="http://en.wikipedia.org/wiki/Id_Tech_4">id Tech 4 engine</a><br />
<br />
The zip file is 9 megs, 55 megs unzipped.<br />
<br />
You will need to have non-free (i.e. not Express) version of Visual Studio 2010 and also download and install <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6812">DirectX SDK</a> (550 megs, free) to compile the code.<br />
<br />
For me it failed in Release configuration with the following errors:<br />
<br />
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;">7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(574,5): error MSB6006: "mt.exe" exited with code 31. </span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;"><br /></span></div>
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: xx-small;">5>sound\snd_system.cpp(167): error C2664: 'ALenum (ALubyte *)' : cannot convert parameter 1 from 'const char [16]' to 'ALubyte *'</span></div>
<span style="font-size: xx-small;">5>sound\snd_system.cpp(167): error C2664: 'ALenum (ALubyte *)' : cannot convert parameter 1 from 'const char [16]' to 'ALubyte *'</span><br />
<br />
<br />
<br />
<b>mt.exe error:</b> Google suggested that there could be missing > bracket in <Mt in <br />
<br />
"C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets" - not in my case<br />
<br />
The error was gone next time a hit Build on the solution. Weird.<br />
<br />
<b>ALenum errors: </b>the fix was to add missing<span style="font-family: "Courier New",Courier,monospace; font-size: xx-small;"> ID_ALCHAR </span>directives on the following line in <span style="font-size: xx-small;">sound\snd_system.cpp</span> file:<br />
<br />
instead of: <br />
<br />
<pre style="background: white; color: black; font-family: Consolas; font-size: 13;"><span style="font-family: "Courier New",Courier,monospace; font-size: xx-small;"><span style="color: blue;">#if</span> ID_OPENAL
common->Printf( <span style="color: #a31515;">"%8d kB total OpenAL audio memory used\n"</span>, ( alGetInteger( alGetEnumValue( <span style="color: #a31515;">"AL_EAX_RAM_SIZE"</span> ) ) - alGetInteger( alGetEnumValue( <span style="color: #a31515;">"AL_EAX_RAM_FREE"</span> ) ) ) >> 10 );
<span style="color: blue;">#endif</span></span>
</pre>
<br />
<br />
do this: <br />
<br />
<pre style="background: white; color: black; font-family: Consolas; font-size: 13;"><span style="font-family: "Courier New",Courier,monospace; font-size: xx-small;"><span style="color: blue;">#if</span> ID_OPENAL
common->Printf( <span style="color: #a31515;">"%8d kB total OpenAL audio memory used\n"</span>, ( alGetInteger( alGetEnumValue( ID_ALCHAR <span style="color: #a31515;">"AL_EAX_RAM_SIZE"</span> ) ) - alGetInteger( alGetEnumValue( ID_ALCHAR <span style="color: #a31515;">"AL_EAX_RAM_FREE"</span> ) ) ) >> 10 );
<span style="color: blue;">#endif</span></span>
</pre>
<br />
After these changes, I was able to compile it and it ended up with 204 megs in build\Win32\Release subfolder, among which there was DOOM3.exe.<br />
<br />
Now I'm off to draw some textures and get that Radiant editor or DarkRadiant which is supposed to be more suitable for Doom3 modding ... ;) <br />
<br />
<b>Update 1: How to use that built DOOM3.exe</b><br />
<ul style="text-align: left;">
<li>Create the folder like C:\MyGames\Doom3</li>
<li>Place doom3.exe in the above folder</li>
<li>Copy base folder from the source code into the above</li>
<li>Copy compiled gamex86.dll into base folder</li>
<li>Run the command line below in base folder to create initial folders layout</li>
<li>Run doom3.exe - it will start and then stop with error "<span style="font-family: "Courier New",Courier,monospace;">_default material not found</span>" - I'm off to investigate it now</li>
</ul>
<br />
<br /><span style="font-family: "Courier New",Courier,monospace; font-size: xx-small;">md af<br />md dds<br />md def<br />md demos<br />md efxs<br />md env<br />md fonts<br />md fx<br />md glprogs<br />md guis<br />md lights<br />md maps<br />md materials<br />md models<br />md newpdas<br />md particles<br />md script<br />md skins<br />md sound<br />md strings<br />md textures<br />md ui<br />md video</span><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com1tag:blogger.com,1999:blog-7377028627355229339.post-18236138603775933542011-12-16T10:46:00.000+00:002011-12-16T10:46:08.118+00:00How to make IE8 emulate IE7, but tell IE9 to run normally<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<pre style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">This will make IE8 parse your web page in IE7 emulation mode, but IE9 will be running as normal. The trick here, contrary to Microsoft's own recommendations, is to put comma and not a semicolon after EmulateIE7</span></pre>
<pre style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 13px;"><span style="color: blue;">
</span></pre>
<pre style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 13px;"><pre style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 13px;"><span style="color: blue;"><!</span><span style="color: maroon;">doctype</span> <span style="color: red;">html</span><span style="color: blue;">></span>
<span style="color: blue;"><</span><span style="color: maroon;">html</span> <span style="color: red;">xmlns</span><span style="color: blue;">=</span><span style="color: blue;">"http://www.w3.org/1999/xhtml"</span><span style="color: blue;">></span></pre>
</pre>
<pre style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 13px;"><span style="color: blue;"><</span><span style="color: maroon;">head</span><span style="color: blue;">></span>
<span style="color: blue;"><</span><span style="color: maroon;">meta</span> <span style="color: red;">http-equiv</span><span style="color: blue;">=</span><span style="color: blue;">"X-UA-Compatible"</span> <span style="color: red;">content</span><span style="color: blue;">=</span><span style="color: blue;">"IE=EmulateIE7, IE=9"</span> <span style="color: blue;">/></span></pre>
</div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0tag:blogger.com,1999:blog-7377028627355229339.post-38634976260032019522011-12-14T17:39:00.000+00:002011-12-14T17:39:15.997+00:00Most meetings suck. And are expensive.<div dir="ltr" style="text-align: left;" trbidi="on">
Copy\pasted from the <a href="http://www.forbes.com/sites/bruceupbin/2011/12/13/five-new-management-metrics-you-need-to-know/">Forbes.com</a>:<br />
<span style="line-height: 24px;"><span style="font-family: inherit;"><i><br /></i></span></span><br />
<span style="line-height: 24px;"><span style="font-family: inherit;"><i>Most meetings suck. And they’re expensive: a one-hour meeting of six software engineers costs $1,000 at least. People who don’t have the authority to buy paperclips are allowed to call meetings every day that cost far more than that.</i></span></span>
<br />
<span style="line-height: 24px;"><i><br /></i></span></div>demphttp://www.blogger.com/profile/01281974273442097501noreply@blogger.com0