|
Hey guys, thanks you very much. I will try to find someone on Craigslist who can do this for a small fee. Again, thank you very much.
|
|
|
|
|
Is the education system in the USA really so rubbish that they let teachers who know nothing about complicated technical subjects teach it to people who probably know more about how to use the technology than the teachers?
If so, then I'd fear for the future of your country, because that is like getting someone who can't drive to teach airline pilots to fly...
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
OriginalGriff wrote: education system in the USA really so rubbish
Nope. I r a produck of da puplick edukashun sistum and I terned out just fine.
I would suspect that there is much more to this story than meets the eye.
|
|
|
|
|
I've gone back through the postings of this particular poster. This[^] makes for an ironic posting.
|
|
|
|
|
Pete O'Hanlon wrote: ironic posting
Precisely.
|
|
|
|
|
Wow! They get rapid advancement in the US don't they?
Student to teacher in a few short months...
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
You're meant to be teaching this course. What happens when a student asks you a question about something that is, after all, incredibly simple? Do you wait until the following week to give an answer, the same way that you whinged about a previous lecturer of yours? If you can't write this stuff, you shouldn't be teaching it.
|
|
|
|
|
computerpublic wrote: All i am attempting to do is read a file piece by piece, turn each byte into a number You're assuming a text-file in ASCII? In UTF, a charactar might consist of multiple bytes.
static void Main(string[] args)
{
string data;
using (var fs = new FileStream(path: @"D:\Projects\ConsoleApplication6\ConsoleApplication6\Program.cs", mode: FileMode.Open))
using (var rdr = new StreamReader(fs))
{
data = rdr.ReadToEnd();
}
using (var fsout = new FileStream(path: "output.txt", mode: FileMode.Create))
foreach (char c in data)
{
Byte b = ASCIIEncoding.ASCII.GetBytes(new char[] { c })[0];
Console.WriteLine("{0} {1}", c, b);
fsout.WriteByte(b);
}
Console.WriteLine();
Console.WriteLine(File.ReadAllText("output.txt"));
Console.ReadLine();
}
Put the cursor on the first line and press the F9 . Next use F10 to step thorugh all the instructions.
Soooo, to bring the subject back to my fee..
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: Soooo, to bring the subject back to my fee..
Try CraigsList - he says he is going to!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I am sorry I approach you the wrong way. I didn't the code project forum was about charging individual for help. After all it is a "forum". The country is quickly becoming second class because those who know do not want help those who do not know. Our jails and prison are full to capacity and prisoners in California are being release prematurely to make room for new prisoners. Think about education the next you see someone getting robs or violated. It could be you, your neighbor or your love ones. Its because of education or lack of education why our prison system is overwhelmed. You disgrace the forum when you make comments about being paid. You tarnish the reputation of the people who genuinely join the forum to help others. You can insult me and be as rude as you want. At least I am trying to help these kids to be interested in something. Have a good day Sir.
|
|
|
|
|
OK. Step away from the computer, take several deep breaths, and count to 10.
Then realise that Eddy was joking when he mentioned his "fee". That Griff was joining in with that joke. And that nobody here was trying to insult you or be rude.
We're generally a friendly bunch of geeks and nerds, even if our sense of humour might seem odd to outsiders.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
You are wrong! I tried to insult him after all that rude comments he had! If he was a teacher in the school of my kids - he wasn't!!! I hope he does not pass his anger and impatience on the kids...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
OK, let me change that to:
"We're generally a friendly bunch of geeks and nerds, apart from that Kornfeld Eliyahu Peter, who's a nasty scary man who should be avoided at all costs!"
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you. I demand accuracy!
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
I am a proud American and I try to instill the same values in the students. America use to be #1 in everything. Where are we now? I guess we are too busy making jokes. This is the CodeProject, not Comedy Central. Some of the users are going away from the core values of the CodeProject stand for. The jokes are not appreciated by me or my students. Mr. Deeming, thank you for your solution. I have not tried it yet, but looks like very professional. Thank you.
|
|
|
|
|
computerpublic wrote: I guess we are too busy making jokes.
Well, Eddy's from the Netherlands, Griff's from Wales, and I'm from England, so I don't think we can blame the Americans for that.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
We aren't about charging people for help; but we also aren't about doing other people's work for them; that doesn't help anyone in the long term.
And in the case of teachers, it doesn't help anyone in the short term either. All it does is set you up for a fall - and a big one - when one of the students needs similar help and you can't provide it because you don't understand it yourself. At that point you lose the the whole class. They lose respect for your knowledge in this subject, and at that age probably respect for your knowledge in any subject.
Then how will they learn?
Go out, or use CraigsList - not to get this fixed, but to find someone who knows how to do it, and who'd willing to give up a couple of hours a week to pass that on, with your help as a profession, trained teacher (because people who are technically talented are usually about as good at teaching what the know as a dead monkey...)
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
computerpublic wrote: I am sorry I approach you the wrong way Ditto.
computerpublic wrote: I didn't the code project forum was about charging individual for help. They don't!!
That's why I also posted a possible solution, as opposed to haggling you into some agreement. Eveything that's posted becomes a bit of public property. And of the hamsters. Bottom point is, one can't ask money for what's already given.
computerpublic wrote: You disgrace the forum From time to time, yes.
computerpublic wrote: people who genuinely join the forum to help others The forum is free. It's all simply people talking about their work, sharing bits here and there, helping each other. That's how I learned this stuff, and that's why I'm helping others with their stuff here
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
You cannot engage children with text, you will lose there attention within 2 seconds. Children responds to media such as a short piece of music or video, that is why i choose to read bytes instead of what you did.
|
|
|
|
|
computerpublic wrote: string temPath = Path.GetTempFileName();
From the MSDN documentation:
Creates a uniquely named, zero-byte temporary file on disk and returns the full path of that file.
You have created an empty file; when you try to read it, you won't get any bytes returned, because it's empty.
computerpublic wrote: Console.WriteLine("{0}={1}",arry[count],buffer[count]);
As you've written it, the code would print out "NUMBER=NUMBER" for each byte in the input file. Since there are no bytes in the input file, it won't have anything to display.
computerpublic wrote: string filePath2 = Path.Combine("C:\\check", Path.GetFileName(filePath));
output.Write(buffer, 0, bytesRead);
Apart from the fact that the input file is empty, your code suggests that you're trying to write to a file in the directory C:\check , but you're actually writing to another temporary file, which will be in the %TEMP% folder.
computerpublic wrote: turn each byte into a number and SHOW IT, turn the number back to a byte and SHOW IT
A byte is a number. It's a number between 0 and 255 . There's no need to turn it into a number.
Saying "I need to turn this byte into a number" is like saying "I need to turn this fluid into a liquid". There's no conversion needed.
What I suspect you want to do is display the byte in different number bases - for example, in binary (base 2) and decimal (base 10). That's just about formatting the number, not converting it to a different type.
Based on your description, the following code should do what you're after:
using System;
using System.IO;
namespace Applica
{
static class Program
{
DirectoryInfo da = new DirectoryInfo("C:\\Folder1");
if (!da.Exists)
{
Console.WriteLine("The folder '{0}' does not exist.", da.FullName);
return;
}
FileInfo[] Arr = da.GetFiles();
if (Arr.Length == 0)
{
Console.WriteLine("There are no files in the folder '{0}'.", da.FullName);
return;
}
FileInfo ap = Arr[Arr.Length - 1];
long Totbyte = ap.Length;
string filePath = ap.FullName;
Console.WriteLine("Total Bytes = {0} bytes", Totbyte);
const int BufferSize = 1024;
byte[] buffer = new byte[BufferSize];
string destinationPath = Path.Combine("C:\\check", Path.GetFileName(filePath));
using (Stream input = File.OpenRead(filePath))
using (Stream output = File.OpenWrite(destinationPath))
{
int bytesRead;
while ((bytesRead = input.Read(buffer, 0, BufferSize)) > 0)
{
for (int count = 0; count < bytesRead; count++)
{
byte theByte = buffer[count];
string theByteInBinary = Convert.ToString(theByte, 2).PadLeft(8, '0');
Console.WriteLine("{0} = {1}", theByteInBinary, theByte);
}
output.Write(buffer, 0, bytesRead);
}
}
}
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The bytesRead may differ from the BufferSize. So, you should do the for from 0 to less than bytesRead (you are doing the for to less than buffer.Length).
You should use an ASCII text file for this to work, as other formats may use more than one byte per character.
You don't need that Totbyte variable... you should always use the bytesRead instead.
|
|
|
|
|
Pop up error message when I call AS400 Stored Procedures via c# application.But when I put select query to As400 via c# application it is working.
error MSG -"ERROR [HY000] [IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]SQL0440 - Routine GVSP07 in AMAIN1 not found with specified parameters."
All SP parameters and SP name ok.
Please any one can help me?????
|
|
|
|
|
Well, considering you haven't shown us any code at all, all we can say is that that particular routine isn't found in that database with those specific parameters. Perhaps if you provided a bit more information, such as the code. On the plus side, you have given us details of what the exception was, which is a lot more than we usually get.
|
|
|
|
|
I mention below code that I use to call AS400 SP
(SP Name-GVSP07
OdbcConnection conOdbc = new OdbcConnection("DSN=GIFT1;UID=GIFT1;PWD=GIFT1;");
public void OpenODBCConnection()
{
try
{
if (conOdbc.State == ConnectionState.Closed)
{
conOdbc.Open();
}
}
catch (Exception ex)
{
throw ex;
}
}
OdbcCommand ODBC = new OdbcCommand("call AMAIN1.GVSP07",conOdbc);
ODBC.Parameters.Add("GR1X", OdbcType.Double, 7);
ODBC.Parameters["GR1X"].Direction = ParameterDirection.Input;
ODBC.Parameters["GR1X"].Value = 3020;
ODBC.Parameters.Add("GUSX", OdbcType.Char, 10);
ODBC.Parameters["GUSX"].Direction = ParameterDirection.Input;
ODBC.Parameters["GUSX"].Value = "g";
ODBC.CommandType = CommandType.StoredProcedure;
ODBC.ExecuteNonQuery();
|
|
|
|
|
It seems that SP AMAIN1.GVSP07 does not have GR1X (double) and GUSX (char[10]) parameters...
Can you see the SP code?
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|