|
A stream doesn't know about lines; a line-feed is a character. So, you reed 1 char, until you find a new-line character, then process.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
But you explicitly say "if you want to read it line by line use below code" - which it doesn't do!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I think you're confusing File.ReadLines[^] and File.ReadAllLines[^].
ReadAllLines reads all lines into memory and returns them as an array.
ReadLines returns an iterator that yields each line as it's read.
File.ReadLines is essentially the same as:
using (StreamReader reader = new StreamReader(path))
{
string line;
while ((line = reader.ReadLine()) != null)
{
yield return line;
}
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
It's not a programming problem, but one of mathematics. Find the mathematical solution; turning that into C# code should be easy.
|
|
|
|
|
The math forums are useless. They ask me to show how I'm solving it haha.
The point of my post is that I don't know how to solve it... otherwise I wouldn't be asking for help lmao
|
|
|
|
|
Sorry, but this is a programming, not a maths, forum. The entire problem is one of applying certain mathematical formulas, which you should be able to find in any decent reference. Converting those calculations into code is the easy part.
|
|
|
|
|
Correct...once I got help with the proper formula converting it was simple. Some coders went through more advanced math and are definitely built for this stuff...I am not one of them...and judging by how difficult it was to find an answer, I'm guessing there aren't many out there either. Still, was fun to figure out.
|
|
|
|
|
This is not a programming problem.
It is Geometry.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
You repeat the first part of Richard's answer almost word by word without adding anything. What's the purpose of this?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Basically, I have just read the question, and not the first answer
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
Answer was to convert the 1% line to degree and add or subtract to the angles. The math equation associated with it was y=ax+b, a=tan(theta).
|
|
|
|
|
Hello Brothers
I am Looking for the best GPS tracking Application until now.
I want to make application for students tracking in Our University
please any ideas about how I start ?
if any brothers have Application please show me it
Thank you very much for all the members in code project
Best wishes
Dr. Kasa.
|
|
|
|
|
Dr Kasa wrote: I am Looking for the best GPS tracking Application until now. There is no olympic games for GPS software, so we don't know which 'the best' would be.
Dr Kasa wrote: I want to make application for students tracking in Our University
please any ideas about how I start ? Start by creating a basic application, and finding a cheap GPS you can interface with easily.
Dr Kasa wrote: if any brothers have Application please show me it Perhaps the people[^] could help.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Hi Kasa
I think it depends on what kind of GPS unit ur students are carrying ..and what type application (thick client / thin client) you want write..
in My view rather buying separate GPS device , you make could use of ur students smart phone .. as you might aware that every smart phone contains GPS unit in it.
if you bought GPS unit .. some manufacture provides APIs to integrates GPS unit.
if you decide to use mobile phone GPS unit .. you can think of writing mobile app or webapplication..
for webapp from mobile you can consider to use HTML-5 geolocation (all most all all smart mobile are compatible with HTML-5) .. you can find so many examples HTML-5 geolocation
for mobile application you can find plenthy of examples tracking geolocation for Anddroid and iOS
both type of Applications webapp/mobileapp can do tracking.
I hope this helps , Apologies if did not understand what u need
Cheers
Praveen
|
|
|
|
|
|
Hello, sometimes in programming it without a console application is assembly the compile top it up all the over off the hello world first written sorry for one time the two sentences over top but the problem was encapsulation the "hello world" as is in very standard and common prototype first one to have it:
Using Microsoft.VisualBasic; //very unnatural, not natural english
using System.Windows.Forms;
void MAIN()
{
Console.WriteLine("Hello World"); //works
System.Windows.Forms.WriteLine("Hello World"); //doesn't work
};
Explain in your own words how encapsulation would solve this problem.
|
|
|
|
|
Um...the question itself doesn't make a lot of sense - or indeed any - but the code you show also makes no sense either.
There is no Forms.WriteLine method, because you can't write directly on a form, and particularly there is no static WriteLine method because unlike a console there can be many Forms in an application.
And encapsulation won't solve that.
A console app is a special type of application which has a very limited user interface: character input and output only. There is one input stream (the keyboard) and one output stream (the console). And there is some clever software behind the scenes which ensures that the output stream is displayed as readable text.
Forms applications aren't like that - they have a much richer user interface made of of Controls like buttons, labels, textboxes, and so on, and there are a number of input methods: keyboard and mouse for starters, but each Control handles it's own input and output. Some may display text (Label and TextBox for example) others may show images without text (a PictureBox perhaps). You can't just "write a line" to a form, you have to decide which control to show it on, and tell it what to display.
So I think you need to go back to your course notes, or your book, and read that chapter again - you don't seem to have grasped that the two application types are very, very different and you can't treat them in the same way!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Now, take a deep breath: what you are about to hear is not an insult. Everyone here was a beginner ... once.
Your question suggests, to me, that you are very new to programming, and pretty confused about what a Windows Form Application is.
A Console Application and a Windows Forms Application are totally different.
Yes, a Console is a "window," and it's the only run-time surface/canvas/window the user can interact with. It has a built-in processing loop read-evaluate-print triggered by your hitting the Enter key.
A Windows Form Application has (typically, by default) a Main Window, and the programmer can create as many other Windows (Forms) as they wish. Closing the Main Window will close all the other open Forms. Each Form, when it has focus, gets connected to the Windows message-pump that sends it keystrokes, mouse-actions, etc. Which Control on a given Form "receives" these messages will vary depending on the Control, and the context.
Sometimes people get confused because in a Windows Forms Application, you can cause text output to be written to the 'Output window in Visual Studio by using code like this:
Console.WriteLine("current value: {0}", currentValue);
There's a good free book, "DotNet Zero" by Charles Petzold you can download here: [^].
Once you have gotten an initial mastery of the Console Application, I suggest you get a book on Windows Forms; I think the (older, but still good) books by Jesse Liberty and Matthew McDonald are excellent.
cheers, Bill
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
So you cannot use the same "words" to write both a console and forms app.. Not only are you forced into the new language C#, but sub languages as well
|
|
|
|
|
Why would you want to? The two application types are totally different and always have been. Before .NET (C#, VB.NET etc.) there was pure Windows, which was still different from console apps.
|
|
|
|
|
Yes, you can. A windows app is a console-app. It will write in both applications to the same destionation; stdout.
Anything else?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Sounds like ORT might be back
|
|
|
|
|