| Subcribe via RSS

Adding Project to Source Control in Visual Studio

December 8th, 2009 | Comments Off | Posted in visual studio
This is probably old hat to most here, but Source Control is still fairly new to me within the context of Visual Studio. Case in point, I was trying to take a local project I had developed on my box and integrate it into a solution already created on the Team Foundation Server. I checked the solution out then I was dead in the water. It seems the key is to right click on the name of your project in the Solution Explorer window then select ‘Add Solution to Source Control.’ Now all you need to do is check in your changes and you are set.

SQL Server Noise Words

December 3rd, 2009 | Comments Off | Posted in SQL

If you do FULLTEXT searches in SQL Server, you are very aware of the limitations of noise words. Noise words are basically words that get dropped from the query. They are like common articles like ‘a’, ‘an’, etc. These words are contained in the file c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData\noiseENU.txt (path may vary based on your directory setup). Here is the full list if you are looking to see if one of your terms is getting dropped

about
1
after
2
all
also
3
an
4
and
5
another
6
any
7
are
8
as
9
at
0
be
$
because
been
before
being
between
both
but
by
came
can
come
could
did
do
does
each
else
for
from
get
got
has
had
he
have
her
here
him
himself
his
how
if
in
into
is
it
its
just
like
make
many
me
might
more
most
much
must
my
never
no
now
of
on
only
or
other
our
out
over
re
said
same
see
should
since
so
some
still
such
take
than
that
the
their
them
then
there
these
they
this
those
through
to
too
under
up
use
very
want
was
way
we
well
were
what
when
where
which
while
who
will
with
would
you
your

“The name xxx does not exist in the current context” when Importing Files into New Visual Studio Project

December 2nd, 2009 | Comments Off | Posted in visual studio
Ok this gets filed under idiotic things that took way longer to figure out than should have. I had a code file from another programmer that I was going to pull into Visual Studio and work off of. I went New > Project > ASP.NET Web Application then I added ‘Existing Items’ to my Solution. I go to do a build, and I get back 57 errors. What the what? All the ASP.NET controls are showing up as unrecognized with that nice error message saying “The name xxx does not exist in the current context.” After trying several fruitless things, I saw an option under my right click on the solution that said “Convert to Web Application.” Punched it, rebuilt the project and it is now error free. Its always the simplest things that get me.

Sort by Date in XSLT

November 17th, 2009 | Comments Off | Posted in XSL

Sometimes the simple things are more difficult than they should be. Take sorting XML records by date through an XSLT stylesheet. Nothing is built in to handle this basic function. So when left to our own devices, we have to break up the date into substrings and compare each piece of the puzzle. In the code below, we are sifting through a date formatted like ’11/17/2009′. To get the year, we start with the 7th character then take the next 4. We evaluate our year, our month then the day and this sorts the dates in ascending order. If we wanted to have these in descending, we’d add the order=”descending” parameter to the xsl:sort.

Keep DOS Window from Closing on Console Applications

November 3rd, 2009 | Comments Off | Posted in C#
For those of you who develop console apps for automating day-to-day activities, it can be annoying when you are trying to see what happened in your execution block. One solution is to pull up a DOS prompt, navigate to the given folder, then trigger it to run. A second option is to add the line Console.WriteLine(); to the end of your code processing block. This basically tells your program that it can’t close up shop until you give the ok.

Photoshop CS2 Stuck on Hand Tool

November 1st, 2009 | Comments Off | Posted in Photoshop
So you’re trucking along all ready to make your edits to a new image and lo and behold no matter what editing option you click on, Photoshop never changes from the hand tool. Very annoying. Well it seems you’ve been hard at work and sucked up all the memory reserve resources Photoshop has allocated. You need to free these up. Go to Edi > Preferences > Memory & Image Cache then set the cache levels to 4 and 75%. Next, we need to clear out the existing memory cache by going to Edit > Purge > All. This wipes out all of the Photoshop memory and starts you anew. If you keep running into this issue, you might want to think about a memory upgrade for your computer.

Panasonic Viera Plasma TV: AV Input Changing by Itself

October 28th, 2009 | 1 Comment | Posted in General
So I’m heading off the reservation on this one. Not exactly a programming issue (or is it?), but a major technology annoyance for those who are experiencing it. About a month ago my Panasonic Viera Plasma television just started cycling through the input selections on its own. No real rhyme or reason to it. It would just skip down the list regardless of how you tried to make it do otherwise via the remote control or via the panel on the front of the television. I tried taking the batteries out of the remote — no change. I called Panasonic and they had me to a remote and system reset — still no go. Finally, I just happened to stumble across a message board one evening concerning an unrelated issue, saw a solution and decided to give it a try. Basically, there is a hidden installer menu that can be accessed by pressing the volume down button on the television while clicking the AV button on the remote three times. Once this menu comes up, I changed the AV from — over to Control 1 and the cycling stopped. Its been a week with no relapses so I’m thinking (knock on wood) I’ve found a solution that didn’t involve a costly repair man and a gutting of my TV. If you are pulling your hair out because of this bizarre input cycling problem, give this solution a try. What can it hurt?

Adding White Space in XSLT Stylesheet

October 20th, 2009 | Comments Off | Posted in XSL
XSLT can be quirky at times. Try inserting a space between your plain text and a element and its highly likely that you’ll just get a big blob of text. Not particularly helpful. We need a way to preserve that white space in our stylesheet. There are two ways we could approach this. The <xsl:text> element preserves the white space between the tags so we could use this to add our space. Also we this element will retain any line brakes we may add as well. We also can accomplish similar means by using the xsl:space attribute wrapped around the text we are looking to preserve.

Reading & Writing to a Cookie Inside a HttpHandler

October 13th, 2009 | Comments Off | Posted in VB.NET

When you are working within an HttpHandler, sometimes you need to access or write out state information. Since this is wrapped up in a class and not inheriting from the Page class, we need to approach this in a slightly different manner. The ProcessRequest method within IHttpHandler has a Response object drawn from HttpContext. The functionality works the same, we just need to adjust how we reference the cookie as follows:

Writing out a Cookie Reading from the Cookie

Display Alternate Sidebar Based on Page in WordPress

October 13th, 2009 | Comments Off | Posted in PHP, WordPress

I don’t know about you, but I get tired looking at that same right sidebar on every page of my WordPress sites. Not all pages are created equal, and some need to serve up different content based on where we are in the site. For my particular case, I wanted to display custom content to the last page in a checkout process. To do this we have to first determine which page we are on by looking at the $_SERVER['REQUEST_URL']. If we were on http://aspnetprogrammer.net/hello_world, it would return the value hello_world. Next, we set the queryValue of the page we are looking for then trigger our comparison. The strstr function in php compares two strings, telling us if the second is contained within the first. If it is, we display the checkout.php sidebar. Otherwise, we let the default sidebar load as normal.