|
Eddy Vluggen wrote: I guess you can adapt it to send a message on every keystroke.
hey can yu guide me that how can i do this??
|
|
|
|
|
yum 2010 wrote: hey can yu guide me that how can i do this??
I can't.
The code that you posted is a basic client/server example. I suggest you search for multiple chat-applications and study them.
I are Troll
|
|
|
|
|
Eddy Vluggen wrote: I can't.
The code that you posted is a basic client/server example. I suggest you search for multiple chat-applications and study them.
okay!
|
|
|
|
|
sorry for my english
I'm creating a webusercontrol and i need to obtain the classes types from my solution, How Can I do it
|
|
|
|
|
Do you mean object GetType() - then see here.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Greetings,
I have a file which is binary. It contains lots of text encoded in UTF8 and binary blobs. I am trying to find a specific section which is 'xref' located somewhere at the end of the file.
So I need to open the file, read the file from the beginning, and find something.
What I have, below, is probably horribly inefficient and perhaps even plain wrong.
Hence I write this in the hope of getting advice from my more experienced peers...
First off, I am maintaining a lock on the file with the filereader, right? Isn't that bad?
Please tell how you would do this
thanks,
<pre>
string path,data;
Boolean munching = true;
long length;
int offset = 0;
int count = 4;
UTF8Encoding utf8 = new UTF8Encoding();
if (txtFilePath.Text != "")
{
path = txtFilePath.Text;
if (File.Exists(path))
{
FileStream fs = File.OpenRead(path);
length = fs.Length;
byte[] buffer = new byte[count];
offset = Convert.ToInt32(length) - count;
int lastBytes = Convert.ToInt32(length-count);
fs.Seek(offset, 0);
while (munching)
{
fs.Read(buffer, 0, count);
data = utf8.GetString(buffer);
if (data == "xref")
{
// Yay! I've finally figured this part out.
}
offset = offset - 1;
fs.Seek(offset, 0);
</pre>
-- Modified Wednesday, July 7, 2010 12:27 PM
|
|
|
|
|
The text "xref" contains only letters in the 7bit ASCII range, so you don't even need to handle funny UTF8 things (multi-byte characters never contain anything from the ASCII range), you can pretend it is a binary file and search for the byte sequence 0x78, 0x72, 0x65, 0x66
|
|
|
|
|
There is one very large inefficiency in there: Every time around the loop you convert the whole buffer to utf8, and then extract a substring from it.
So, the first time, you read 100 bytes, convert 100 bytes, and then extract 100 bytes into a string.
The second time, you read 100 bytes, convert 200 bytes, and then extract 100 bytes into a string.
The third time, you read 100 bytes, convert 300 bytes, and then extract 100 bytes into a string.
...
Then you do a comparison to check if the whole 100 bytes you read in are "xref" - a four byte string. I think I can guarantee it will only work if the last four bytes in your file are 'x', 'r', 'e' and 'f' in that order...
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
By The Way:
1) If it's at the end of the file, why do you start reading from the beginning?
2) What if it is in two blocks ("xr" at the end of one, "ef" at the start of the next)?
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
Statements such as offset = Convert.ToInt32(length) - count; are incorrect; why are you trying to convert integers to integers?
I am also assuming that you are still trying to work on a PDF file, in which case you should use the PDF reference document and read the dictionaries (from the end of the file) and address the individual items via the use of structures.
It's time for a new signature.
|
|
|
|
|
Hi Richard,
Thanks for answering.
The FileStream.Length is of type long... hence the convert.
So at my speed (baby steps) I now have the code to find the menu (a.k.a. the cross reference table or xref) at the end of the file. For now I'll work with the scenario that its not a stream. I am still reading the PDF Reference.. its a long document!
I want to learn about the PDF format hence my project is to write an application that can replace text or iamges in a PDF. I doubt I'll ever succeed, honestly, since its a humongous task. On the plus side I'll learn a lot by simply trying
Thanks again for the advices, its really appreciated.
Antoine
|
|
|
|
|
Alright. In Outlook, if I want to arrange my tasks by categories, I can go View-Arrange By-Categories.
My question is, is there anyway to do this programatically?
Thanks a bundle
|
|
|
|
|
I am using BarTender[^] software.
And try to print barcodes from DB.
I am able to fetch data from DB with sql query.
But when i try to use Stored Procedure its giving error like
BarTender: error message #3239
OLEDB has encountered error 0x800ade78
Operation is not allowed when the object is closed.
But when i use sql query its running ok.
also i tried with SP having single select query.
Its running also ok.
But when i give SP (performing some operations in it) then its giving error.
Plz, Can any one help/guide me.
Whats the issue in this?
Regards
|
|
|
|
|
It's normal practice, when having a problem with vendor specific software, to post the question on the forum for that software or email it to the company in question. They will be much better placed to offer advice to you than we possibly could, what with our not knowing this software. I will say though, that the error message looks funnily like you attempting to issue a SQL command on a closed connection, but that's just me reading the error text you posted. I couldn't honestly expect you to have done the same.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: post the question on the forum for that software or email it to the company in question
I did that, and mailed on id they had provided on their site.
Pete O'Hanlon wrote: the error message looks funnily like you attempting to issue a SQL command on a closed connection
Any one who know English will say what you had...!!
But its like this, its giving an error like this.
But i couldn't understand, if i use single select statement its running
But the actual procedure i need to call, creates a temp table , insert data in it and then drop this table.
its giving error in this?
|
|
|
|
|
Hum Dum wrote: But its like this, its giving an error like this.
But i couldn't understand, if i use single select statement its running
But the actual procedure i need to call, creates a temp table , insert data in it and then drop this table.
This is why they are better placed to solve this than we are. How on earth do you expect us to know what it's doing internally? I would expect that it's expecting a query and you are supplying it with DML and that's causing it to bork. Again - they will know the answer.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
1) You are talking about an error with a third party application.
2) You have not provided any code.
It will be tough for anyone to help you in those circumstances.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
string SQL = "SELECT `Calories` FROM `NutritionInformation`";
Engine btEngine = new Engine();
LabelFormatDocument btFormat = btEngine.Documents.Open(@"C:\NutritionLabel.btw");
((OLEDB)btFormat.DatabaseConnections[0]).SQLStatement = SQL;
Well above is part of code. Which i used mentioned at their SDK help file.
I am replacing the SQL with sql i want to use - Working
I am just mentioning SP name in SQL (Sp contain only single Select) - Working
But when i call SP which i had to use actually, its giving error.
For above code to work you have to download their SDK and install it, then add reference to Seagull.BarTender.Print.
|
|
|
|
|
Well - you could try searching for a similar problem on their forums.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
This is a complete guess as I have never even heard of that product before but do you have the correct permissions to connect and run a stored procedure? Sorry if that is complete bollocks but worth a try.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Hallo
I'd need to write into a textbox of an external application.
Investigating with Spy++ I found that its controlID changes: the only thing helping to identify it unequivocally is the Class attribute: it is the only control of that Class in that form.
How could I address the textbox by this value?
Could you post a snippet?
Thanks in advance
|
|
|
|
|
the search is your best friend
try searching like TextBox Text Win32Api
|
|
|
|
|
thank you for the reply, I previously did a search and adapted a snippet found on Stackoverflow.com, but it (and many other examples in the net) shows how to address controls by their handle.
In this case, I have a control contained into a modal window addressable by portion of its name (the only part that doesn't change).
|
|
|
|
|
I guess that would be done using the FindWindowEx [^] function. At least, that way you could retrieve the current handle.
I are Troll
|
|
|
|
|
I have two tables: table1 field contains the ID type UniqueIdentifier and table2 contains ID as foreign key when inserting values is not the same values filled in the two table table1 in this ID is filled eg e210d5ad-BC41-439th-b8e8-e8ed775ee932, and in table 2 it is filled with zero
So how do I do to unify all relationships necessary is active
the two queries are:
CREATE Procedure [dbo].[Insert1](@ID uniqueidentifier, @name varchar(10),@tel varchar(10))AS INSERT INTO [table1] ([ID], [name], [tel])VALUES (NEWID(), @name, @tel)
CREATE Procedure [dbo].[Insert2](@ID uniqueidentifier, @cmd1 varchar(20))AS INSERT INTO [Table2] ([ID], [cmd1])VALUES (@ID, @cmd1)
table1: ID Primary key
Table2:ID foreign Key
Thank you very much for your help
|
|
|
|