Click here to Skip to main content
15,890,336 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: How to find the values of x and y in a 90 degree sector Pin
pallaka22-Jul-08 22:28
pallaka22-Jul-08 22:28 
QuestionRe: How to find the values of x and y in a 90 degree sector Pin
CPallini22-Jul-08 22:40
mveCPallini22-Jul-08 22:40 
AnswerRe: How to find the values of x and y in a 90 degree sector Pin
pallaka22-Jul-08 22:44
pallaka22-Jul-08 22:44 
GeneralYou're welcome Pin
CPallini22-Jul-08 22:50
mveCPallini22-Jul-08 22:50 
GeneralRe: How to find the values of x and y in a 90 degree sector Pin
pallaka22-Jul-08 22:33
pallaka22-Jul-08 22:33 
QuestionUnicode to html Pin
michela21-Jul-08 0:36
michela21-Jul-08 0:36 
AnswerRe: Unicode to html Pin
Paul Conrad21-Jul-08 4:20
professionalPaul Conrad21-Jul-08 4:20 
AnswerRe: Unicode to html Pin
dojohansen22-Jul-08 22:09
dojohansen22-Jul-08 22:09 
I am so nice I wrote a utility method for you:

static public void ProcessFile(string inPath, string outPath)
{
using (StreamReader r = File.OpenText(inPath))
using (FileStream f = File.Create(outPath))
using (StreamWriter w = new StreamWriter(f, Encoding.ASCII))
while (!r.EndOfStream)
w.WriteLine(HttpUtility.HtmlEncode(r.ReadLine().ToUpper()));
}

This assumes it's alright to process the file line by line; I did it because it saves a few lines of code. If your file doesn't contain many lines you should consider reading blocks of characters instead - this ensures that the methods memory footprint stays the same regardless of the file fed to it. It also makes for more efficient memory allocation since you can then reuse the same allocated character array for each read (whereas readline allocates a new string each time).

HTH
QuestionWrap values with upper and lower bound? [modified] Pin
Thrash50520-Jul-08 11:08
Thrash50520-Jul-08 11:08 
AnswerRe: Wrap values with upper and lower bound? [modified] Pin
Luc Pattyn20-Jul-08 11:31
sitebuilderLuc Pattyn20-Jul-08 11:31 
GeneralRe: Wrap values with upper and lower bound? Pin
Thrash50520-Jul-08 11:55
Thrash50520-Jul-08 11:55 
GeneralRe: Wrap values with upper and lower bound? Pin
Luc Pattyn20-Jul-08 12:01
sitebuilderLuc Pattyn20-Jul-08 12:01 
GeneralRe: Wrap values with upper and lower bound? Pin
Thrash50520-Jul-08 12:14
Thrash50520-Jul-08 12:14 
GeneralRe: Wrap values with upper and lower bound? Pin
Luc Pattyn20-Jul-08 12:26
sitebuilderLuc Pattyn20-Jul-08 12:26 
GeneralRe: Wrap values with upper and lower bound? Pin
Thrash50520-Jul-08 12:34
Thrash50520-Jul-08 12:34 
GeneralRe: Wrap values with upper and lower bound? Pin
Luc Pattyn20-Jul-08 12:45
sitebuilderLuc Pattyn20-Jul-08 12:45 
GeneralRe: Wrap values with upper and lower bound? Pin
Thrash50520-Jul-08 12:57
Thrash50520-Jul-08 12:57 
QuestionPostfix Multidigit Expression Evation in C# Pin
sadiyaVasanthKumar18-Jul-08 22:09
sadiyaVasanthKumar18-Jul-08 22:09 
AnswerRe: Postfix Multidigit Expression Evaluation in C# Pin
cp987619-Jul-08 2:17
cp987619-Jul-08 2:17 
GeneralRe: Postfix Multidigit Expression Evaluation in C# Pin
Luc Pattyn19-Jul-08 2:22
sitebuilderLuc Pattyn19-Jul-08 2:22 
GeneralRe: Postfix Multidigit Expression Evaluation in C# Pin
Paul Conrad19-Jul-08 11:01
professionalPaul Conrad19-Jul-08 11:01 
QuestionConvert a value in one number range to a value in another number range? Pin
Thrash50513-Jul-08 13:23
Thrash50513-Jul-08 13:23 
AnswerRe: Convert a value in one number range to a value in another number range? Pin
Luc Pattyn13-Jul-08 13:24
sitebuilderLuc Pattyn13-Jul-08 13:24 
GeneralRe: Convert a value in one number range to a value in another number range? Pin
Thrash50513-Jul-08 13:42
Thrash50513-Jul-08 13:42 
GeneralRe: Convert a value in one number range to a value in another number range? Pin
Luc Pattyn13-Jul-08 14:10
sitebuilderLuc Pattyn13-Jul-08 14:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.