Monday, October 13, 2008

Attaching SQL Server .mdb without .ldf file

If you're using SQL Server 2005:
create a database of equal size to the one you're trying to attach
shutdown the server
swap in the old mdf file
bring up the server and let the database attempt to be recovered and then go into suspect mode
put the database into emergency mode with ALTER DATABASE
run DBCC CHECKDB (dbname, REPAIR_ALLOW_DATA_LOSS) which will rebuild the log and run full repair
Your database will be available again but you'll have lost data and the data won't be transactionally consistent - see the following blog posts:
https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/15/632398.aspx
https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/16/633645.aspx
https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/18/636105.aspx
If you're on SQL Server 2000, you can still do this but you'll need to use the undocumented DBCC REBUILD_LOG at your own risk.

original post on MSDN

Wednesday, October 1, 2008

ASP.NET Visual Studio Project Types

(thru 2008)
" Visual Studio supports two modes of project management: Web Site Projects and Web Application Projects. Web Site Projects lack a project file, whereas Web Application Projects mimic the project architecture in Visual Studio .NET 2002/2003 - they include a project file and compile the project's source code into a single assembly, which is placed in the /bin folder. Visual Studio 2005 initially only supported Web Site Projects, although the Web Application Project model was reintroduced with Service Pack 1; Visual Studio 2008 offers both project models. "
- Scott Mitchell


Useful, related links:
Converting a Web Site Project to a Web Application Project
Web Application Projects versus Web Site Projects
ASP.NET Web Application Project Deployment Overview


Wednesday, August 13, 2008

Flash Frame by Frame Animation

Found out two great shortcuts for creating flash frame by frame animation:

1. When you begin, in the timeline, select a whole range of frames and right click, and select "Convert to Blank Keyframes"
2. Turn on Onion Skinning, of course.
3. As you draw each frame, just use the period key to move forward (and the comma key to go back to previous frame).


So much faster and easier!

Flash after 7 years...

I'm getting back into Flash after about 7 years. I find it inscrutable why, after all that time, the designers still don't want to show the keyboard shortcuts on the menu for inserting a KEYFRAME and a BLANK KEYFRAME.

F5 - Insert Frame
F6 - Insert Keyframe
F7 - Insert Blank Keyframe

Monday, June 2, 2008

Unicode

Succinctly puts in context:

[edit] Variable-Width Characters
Before UNICODE, there was an internationalization attempt that introduced character strings with variable-width characters. Some characters, such as the standard ASCII characters would be 1 byte long. Other characters, such as extended character sets, were two characters long. These types of character formats fell out of favor with the advent of UNICODE because they are harder to write and much harder to read. Windows does still maintain some functionality to deal with variable-width strings, but we won't discuss those here.

Unfortunately all advantages of using wide characters were lost because the number of characters needed quickly exceeded the 65,536 possible 16-bit values. Windows actually uses what is called UTF-16 to store characters, where a large number of characters actually take //two// words, these are called "surrogate pairs". This development is after much of the Windows API documentation was written and much of it is now obsolete. You should never treat string data as an "array of characters", instead always treat it as a null-terminated block. For instance always send the entire string to a function to draw it on the screen, do not attempt to draw each character. Any code that puts a square bracket after a LPSTR is wrong.

At the same time, variable-width character-based strings made a big comeback in the multi-platform standard called UTF-8, which is pretty much the same idea as UTF-16 except with 8-bit units. It's primary advantage is that there is no need for two api's, the 'a' and 'w' apis would have been the same if this was used, and since both are variable-sized, it has no disadvantage. Although most Windows programmers are unfamiliar with it, you may see increased references to using the non-UNICODE api.


-- from Windows Programming

Monday, May 19, 2008

SearchPlugins for Firefox

Trying to figure out this baby. In this arena, IE has Firefox beat.

In Firefox, look at the xml files in the following folder:
C:\program files\Mozilla Firefox\searchplugins


So far, to search Amazon MP3's, I've winnowed the search url down to:

http://www.amazon.com/s?url=search-alias%3Ddigital-music&field-keywords=TEST

Tuesday, April 1, 2008

SQL for Running Totals: The Power of Cross Join


SELECT
t.transaction_date, t.amount, t.[description], sum (t2.amount) as RunningTotal
FROM
cash_transaction_table t
CROSS JOIN cash_transaction_table t2
WHERE
(t2.transaction_date <= t.transaction_date)
GROUP BY
t.transaction_date,
t.amount,
t.[description]
ORDER BY
t.transaction_date

Friday, February 1, 2008

An Entity is a....Thing

"In the same way queries in the relational world are formulated against tables, queries in the EDM world are formulated against entities"

Wednesday, January 9, 2008

IE7 and Mathematical Characters

Certain mathematical characters no longer display in the default font of IE7 unless the operating system is Vista, including the "union" and "element of" characters. To get around this, in CSS you have to specify a different font, and the most common Windows font that works is 'Lucida Sans Unicode'.

Example:

will display fine in both XP and Vista, but

will not display correctly on XP.