|
Step One: Step away from the computer
Step Two: See Step One
|
|
|
|
|
Well, you will need a few things.
1) A Computer, with a monitor, keyboard, mouse and all the normal bits. (You can get one from eBay)
2) A Compiler / linker / doobry. (You can get one from those kind people at microsoft)
3) A good Idea for a program. (You can get one from your mates)
4) A very large collection of Ones and Zeros. (You can get them from me - I have a large stock of spares, some new, some used). Very cheap prices in bulk.
Now, organise the Ones and Zeros so that they fullfill your Idea.
Pass the Idea through the Compiler / linker / doobry so that the Computer can understand them.
Run the compiled Idea on the Computer.
Simple, isn't it?
Now you just have to wonder why we all go to school, then university, and slave for a number of years in the industry before we call ourselves Software Engineers.
|
|
|
|
|
OriginalGriff wrote: doobry
Do you have any links to where I can get one of these - I think that may be where I've been going wrong!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
|
No thanks, I mix up my 0 to 9s with some A to Fs and my special binary mixer does the rest for me.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
OriginalGriff wrote: Now, organise the Ones and Zeros so that they fullfill your Idea.
Pass the Idea through the Compiler / linker / doobry so that the Computer can understand them.
Run the compiled Idea on the Computer.
If you have 0's and 1's why use compiler, organise them is such order that the computer understands them . Intel books with machine instruction codes can be useful!
|
|
|
|
|
The sad thing is that I actually have the online versions of those type of Intel manuals bookmarked
|
|
|
|
|
The Compiler converts the Ones and Zeros into blocks of 32 bits, so that the Computer can execute them - I thought everybody knew that!
|
|
|
|
|
Everybody also should know that:
-blocks of 32bits are still 1's and 0's
-fact that cpu's architecture is 32bit doesn't mean it has 32-bits blocks inside, most of instructions inside x86 are 2 byte long (not counting params, fe. most move-if commands are 0x0F 0xXX /r, where /r is register param)
-That doesn't stop you to program in machine code by yourself . Create *.COM file and write pure machine (16-bit though) code with any hex editor .
|
|
|
|
|
I forgot, sorry, that some Computers only use 8 bits, so you will need an AngryCompiler to assemble seven Ones and Zeros together with a Parody bit into a byte before you can execute on those...
|
|
|
|
|
You don't need all that!
What you need is this[^]!!
|
|
|
|
|
And I've been doing it by hand for the last N years!
Wish I'd known about this marvelous machine.
Regards
David R
|
|
|
|
|
I am passing a text file using streamreader and filestream.......My moto is to replace the new lines and tab spacing with a single space....But instead the resulting text file is empty once my project is execute.........
plz help !!!
using System.IO;
.
.
.
.
.
string path="C://test.txt";
Streamreader re=File.Openext(path);
StreamWriter rw=new StreamWriter(path);
while((input=re.ReadAllLines())!=null)
{
if(input=="\n")
rw.Write(" ");
if(input=="\t")
rw.Write(" ");
}
.......whr am i goin wrong ???
|
|
|
|
|
|
1 You should output to a new file not the one you are reading in.
For example use:
string path="C://test.txt";
Streamreader re=File.Openext(path);
StreamWriter rw=new StreamWriter(@"C:\test_out.txt"));
2 Your loop is wrong. Look at what ReadAllLines() does in help.
You probably want something like:
string input;
StringBuilder sb = new StringBuilder("");
while((input=re.ReadLine())!=null)
{
input = input.Replace('\t', ' ');
sb.Append(input + " ");
}
rw.Write(sb.ToString());
The StringBuilder is used because ReadLine() drops the new lines (so you don't need to replace them) and you need to add the space after the line.
3 Have a look at File.ReadAllText() and Replace() for strings. It might be simpler to use these.
Regards
David R
|
|
|
|
|
my input in the text file is somethin like :
hi
this
is
mist
I need the output as : hi this is mist ......
i tried using ur tips for removing the new lines and replace them with a single space but could'nt do....and how can i get the output in d same text file only ??
need help..... !!..plz
|
|
|
|
|
StringBuilder sb = new StringBuilder();
string line;
using (StreamReader sr = new StreamReader(fileName))
{
while ((line = sr.ReadLine()) != null)
{
sb.Append(line + " ");
}
}
line = sb.ToString();
Now, read a manual, and do your own homework next time!
|
|
|
|
|
The code I and OriginalGriff gave should work.
Unless you show us some code and tell us what it produces we can only guess at how to help you.
Regards
David R
|
|
|
|
|
Do you want multiple whitespace characters changed to one SPACE? Or each whitespace character changed to a SPACE?
|
|
|
|
|
Here is my combobox which gets values from database:
da2.TableMappings.Add("Table", "SubjectTitle");
da2.Fill(ds2);
this.dviewmanager = ds2.DefaultViewManager;
this.comboBox1.DataSource = this.dviewmanager;
this.comboBox1.DisplayMember = "SubjectTitle.Title";
this.comboBox1.ValueMember = "SubjectTitle.ID";
When I want to insert some data to database with value from combobox everything is perfect.
string insertQuery = "INSERT INTO Lection (ID_Subject, title, body) values ('" + comboBox1.SelectedValue + "','" + textBox3.Text + "','" + textBox4.Text + "')";
OleDbCommand cmd = new OleDbCommand();
cmd.CommandText = insertQuery;
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
But when I want to select data with combobox in query I get Type mismatch error
leccom = new OleDbCommand("SELECT * FROM Lection WHERE ID_Subject ='" + comboBox1.SelectedValue + "'", leccon);
lecadapter = new OleDbDataAdapter();
lecadapter.SelectCommand = leccom;
lectable = new DataTable();
lecadapter.Fill(lectable);
textBox3.DataBindings.Add("Text", lectable, "Title");
textBox4.DataBindings.Add("Text", lectable, "Body");
lecmanager = (CurrencyManager)this.BindingContext[lectable];
ID_Subject field in database is numeric. I tried to convert combobox to an integer, but it didn't work or maybe I did it wrong. Why is this SELECT query doesn't work? Thanks in advance for any help!
|
|
|
|
|
fecaloid monster wrote: Why is this SELECT query doesn't work?
What is the error you are getting? If ID_Subject is a numeric field, you don't have to put the value in single quotes (''). Does that solves the problem?
Your code is open to SQL Injection attacks and you need to do some reading on that.
|
|
|
|
|
Oh, thank you so much, it works! And thanks for remark, i will consider that fault.
|
|
|
|
|
Dear All,
I have an SQL Server database, looking for the best data modeling tool that can develop a detailed report of my database
Any idea ?!
Regards,
Muhammad Nauman
"Mess with the Best, Die like the rest"
|
|
|
|
|
M. Nauman Yousuf wrote: Any idea ?!
Try a different forum?[^]
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Hi all,
I have a WinForm application that should display the Startup Mode of a service.
I'm using ManagementObject to access it, like that:
ManagementObject mgmtObject = new ManagementObject("Win32_Service.Name='Dhcp'");
mgmtObject.Get();
If I access any of the values of mgmtObject in the debugger it says: "Function evaluation timed out".
The same code works perfectly in a console application.
I've googled for long but couldn't find anything that explains this.
Thanks,
darthBug
Join the dark side of the code
|
|
|
|