Search

Categories

Fourth Dimension

<<  July 2008  >>
SuMoTuWeThFrSa
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

Blogroll

Tags

Recent posts

Recent comments

Apostrophes and QueryStrings in ASP.NET

Posted on January 31, 2008 02:53 by ruisu

I am in the process of building a content management style website for my friend who writes articles on a regular basis. I was handling section navigation with QueryStrings because I didn't know anything about URL rewriting, and it was quick and easy. It was working fine until he added a section with an apostrophe in it. This actually throws an error on ASP.NET. Server.URLEncode apparently ignores apostrophes. But even when I manually replaced the ' with %27 (the hex value) it still threw an error. However, two apostrophes in the URL will give the desired behavior.

A simple way I went about solving this was with .Replace("'","''") to replace a single apostrophe with two of them. 

So, in my case I was using a datalist to display the sections and just tacked that on to the URL:

        <asp:DataList ID="dlSections" runat="server" DataSourceID="SqlSection">
        <ItemTemplate>
             - <a href="section.aspx?section=<%# Eval("section").Replace("'","''") %>" ><%# Eval("section")%></a>
                </ItemTemplate>
        </asp:DataList>

I also used the QueryString to display the current section, during the PageLoad in the codebehind. It would work the same from there, except now replacing the twin apostrophes with a single one:

    lblSection.Text = Request.QueryString("section").Replace("''", "'")

Hope this helps someone.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Notice: If you already downloaded 0.1.9 grab 0.1.9.1. Looks like when I was adding the nested directory support in 0.1.9 I omitted the code for regular directories. It's back now.

Here's a minor update, now you can encode/transcode a directory of directories. I just let it run on a huge (30GB) audiobook that had nested directories. Worked like a charm. I haven't tested it much and since there are a number changes under the hood, I might have missed something. If so, the old version was heavily used by me and seems to be solid as a rock.

Downloads: LameQSMP v0.1.91 (148.40 kb) | LAME 3.98a (269KB)

 
 Check out that compression! The V8 still sounds amazing...


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

LameQSMP (Quasi-SMP) v0.1.8

Posted on January 18, 2008 09:49 by ruisu

Note: There is an updated version available. Check out this link for related posts.

Okay, some little fixes and here's the first usable version.


Features:
  • One or dual-core support
  • One or more HD support
  • Networked files support
  • All VBR new settings (V0-V9)
  • All CBR settings
  • Detects if you want to encode or transcode

Future Versions:
  • More than two core support
  • Smarter use of temp files
  • Deep folder option (i.e., if a you want to work with a folder of folders)
  • Tagging support (ID3vX)


Usage:
To use it, just run it and select the folder you want to encode/transcode. It will do some prep work. Click begin to start the transcoding/encoding. It needs to be in the same directory as LAME, so copy it or LAME to the same folder.  By default it will make a V0 mp3. You can make a CBR mp3 by unchecking the VBR box, and entering your desired bitrate in the CBR box.

Downloads: LameQSMP 0.1.8 (148.16 kb) | LAME 3.98a (269.12 kb)

Usage in pictures:

Select the folder of music you want to work with.


It will figure out what it should be doing...


Make sure you picked the settings you wanted. Then click the begin button.


It will tell you where the results are.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5