|
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
|
|
|
|
|
Not sure what the problem is. This works fine for me in WinForms
ManagementObject mgmtObject = new ManagementObject("Win32_Service.Name='Dhcp'");
MessageBox.Show(mgmtObject.Properties["StartMode"].Value.ToString());
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)
|
|
|
|
|
It's probably not the WinForm's fault but I can't figure out why it fails.
Is there a way took analyze this problem and find the source or the error?
darthBug
Join the dark side of the code
|
|
|
|
|
The normal debugging/breakpoints/stacktrace etc.
If you can't get to the bottom of it, post a little more code and I'm sure one of us can help.
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)
|
|
|
|
|
Hi,
Thanks for the reply.
The wierd thing is it seems to be working during run time but inside the debbuger I get the error.
When I was debugging it I got the error and thought it wasn't working at all, didn't really bother to let it go all the way.
Thanks,
darthBug
Join the dark side of the code
|
|
|
|
|
Hi,I need you to help me with the c# code for help function.Me and my project team members are going to develop system for security soon .
|
|
|
|