|
It works, thanks you very much
For anyone who is interested http://www.c-sharpcorner.com/Internet/WebRequestNResponseMDB.asp is a good tutorial of how to use webRequest.
|
|
|
|
|
double a b c;
...........
output.Writeline(""+a+"\t"+b+"\t"+c+"\t");
The problem is that output file, sometime a b c will have different precision
for example a=2.33 b=3.45 c=3.53330000001
I want a b c to have same precision (c=3.53)
how can i do it?
THX
|
|
|
|
|
Specify the format you want when you convert the values to strings, for an example: a.ToString("N2").
Now you are implicitly converting the values to strings. Unfortunately the values will be boxed first, which is not very good for performance. Always convert the values before the string concatenation.
---
b { font-weight: normal; }
|
|
|
|
|
|
Hi, how do i access my mobilphone (nokia) with IR, cabel or bluetooth...??
Have anybody wrote some C#-code to access mobilphones, or now articels about the subject...??
Helge
|
|
|
|
|
I am quite desperate with this, hopefully someone might help here:
So I have created my own add-in for visual studio. Now I want to catch the event of "line change". That is when the user no longer edits some line and moves to another.
In the "OnConnection" method of the addin, I add this line:
applicationObject.Events.get_TextEditorEvents(null).LineChanged+=new _dispTextEditorEvents_LineChangedEventHandler(Connect_LineChanged);
and in the handler I open a messagebox.
The problem is, that the add-in works perfectly, untill... I open a new XML file!!
then it stops working in any of the documents...
Am I doing something wrong?
|
|
|
|
|
Hi,
I cannot compile the source code of the Windows Media Audio compressor articel.
I tried this a few times and very different things. I tried to add references of the need DLLs, but it only crashes. I don't have the Visual Studio, only Visual C++.NET 2003, Visual C# 2005.
Is there anyone who have the compiled DLL? I need the yeti.wmf!
Please help me! Thanks.
|
|
|
|
|
Looking for some C# developers with C++ background to work on an exiting and challenging project.
Send resumes to ashish.dhar.b@bayer.com
|
|
|
|
|
Please don't double post.
---
b { font-weight: normal; }
|
|
|
|
|
ashishdhar wrote: work on an exiting and challenging project
The last time I was looking for a job I discovered that this was a euphamism for "we're going to give you lots of work in areas your not qualified for and give you no training and we want everything done by next Tuesday even although we realise that it is a 3 month project"
The jobs that are genuinely exiting don't need people to state they are exiting because it is obvious from the description. Jobs that are challenging are ones that allow the individual to grow as a person, and again that is obvious from the description.
However, since your description is "exciting and challenging" there isn't much to work with and I suspect that, quite probably, they'll turn out to be dull and tiresome.
So, prove me wrong - tell us what the job really is!
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
I'm a C# developer, with a C++ background. I'm a C++ MVP, as it happens. I love to work on projects that are 'exciting and challenging', so perhaps if you'd like to tell us what it is, you'll get resumes from people who are more in your app domain. Of course, advertising through a question board leaves me worried about your budget, but I always ask for 50% up front, as would anyone worth hiring, IMO. It's a simple concept of shared risk.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
ashishdhar wrote: to work on an exiting and challenging project
If the project is exiting, why are you hiring?
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
No offense, but:
Exiting as in "interesting", NOT as in "exit".
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
I know. I deliberately ignored the spelling error (should be "exciting").
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
i ready to work with u
Palestine
|
|
|
|
|
The project is EXITing the "I have a dream" phase and entering a "lets get real and get this thing done" phase.
|
|
|
|
|
Hi, I have made a small program that opens a data file in XML format, then searches through it for certain information, the problem I have is that if the first line of the XML text looks like;
<data xsi:schemaLocation="http://www.website.com" version="0.3" xml:lang="en">
it doesnt work, but if I change it so the first line is simply;
<data>
It does work.
The problem is that the data comes in the first way, which doesnt work for me, can anyone explain why it might be that this happens? I assume it is a simple, seeing as how I can fix it by simply removing a small amount of text.
(p.s. I am fairly new to XML so forgive me if this is really dumb!)
thanks in advance!
-- modified at 10:39 Thursday 5th January, 2006
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
---
b { font-weight: normal; }
|
|
|
|
|
Ok good point!, this is an example;
private void button4_Click(object sender, EventArgs e)
{
StreamReader sr = new StreamReader(@"data.xml");
XmlTextReader xr = new XmlTextReader(sr);
XmlDocument docData = new XmlDocument();
docData.Load(xr);
XmlNodeList wikinodes = wiki.SelectNodes("data/page");
lblNodes.Text = dataNodes.Count.ToString();
}
When it works, lblNodes will show there are 1699 nodes, when it doesnt work it just says there are 0 nodes.
The XML file looks roughly like this;
<data xsi:schemaLocation="http://www.website.com" version="0.3" xml:lang="en">
<page>informationhere</page>
<page>informationhere</page>
<page>informationhere</page>
</data>
but will only work if I change it to look like this;
<data>
<page>informationhere</page>
<page>informationhere</page>
<page>informationhere</page>
</data>
I hope that is enough info, Thank you!
|
|
|
|
|
Try with the "/data/page" xpath instead.
Otherwise, it might be the schema that removed the nodes. Does the schema that the data references to exist?
Check the contents of the InnerXml property once the document is loaded, to see if the page nodes gets loaded at all.
---
b { font-weight: normal; }
|
|
|
|
|
hhmmm, that didn't work, the page nodes do get loaded though.
The data that I am trying to process comes from the Wikipedia database dump (you know, the open source encyclopedia, see http://en.wikipedia.org/wiki/Main_Page).
I am practising on a small foreign language XML dump which can be downloaded from http://download.wikimedia.org/wikipedia/am/20051020_pages_current.xml.bz2 (the english wikipedia dump is about 3gbs, so you dont exactly want to process that every time you test the program!).
I extracted the exact first line of the XML, which is;
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.3/ http://www.mediawiki.org/xml/export-0.3.xsd" version="0.3" xml:lang="am">
This includes links to various websites that explain the schema.
I find it strange that it works by simply removing all the attribute material from this first line. I tried programmatically removing this using the Attributes.RemoveAll() method, but as I found out it should really be called RemoveAllButOne(), so that doesnt work either.
Thanks for trying to help, really appreciated, don't worry if don't have the time to go any further though.
Martin
|
|
|
|
|
I see. When you show the complete tag, it's obvious.
You need to use an XmlNamespaceManager object along with the xml document to be able to reach the nodes that belong to a namespace.
---
b { font-weight: normal; }
|
|
|
|
|
|
I am having trouble using the code from the tutorial posted here. The following is all of my code. I have commented what the original download version had in it...
using System;
using System.IO;
using org.pdfbox.pdmodel;
using org.pdfbox.util;
namespace Pdf2Text
{
class Program
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
DateTime start = DateTime.Now;
if (args.Length < 2)
{
//The following line is the way it is written in the downloaded version
//Console.WriteLine("Usage: PDF2TEXT ");
//I wrote this
Console.WriteLine("Usage: PDF2TEXT MyPDF.pdf MYTEXT.txt");
//return;
}
using (StreamWriter sw = new StreamWriter(args[1]))
{
sw.WriteLine(parseUsingPDFBox(args[0]));
}
Console.WriteLine("Done. Took " + (DateTime.Now - start));
Console.ReadLine();
}
private static string parseUsingPDFBox(string input)
{
PDDocument doc = PDDocument.load(input);
PDFTextStripper stripper = new PDFTextStripper();
return stripper.getText(doc);
}
}
}
I get the following error message when I try to run it:
"An unhandled exception of type 'System.IndexOutOfRangeException' occurred in Pdf2Text.exe
Additional information: Index was outside the bounds of the array."
Can someone help!
Curt
|
|
|
|
|
Probably tou get IndexOutOfRangeException when you use args[1] and args[1] is not avaliable. I think that you shoul uncoment this return:
<br />
if (args.Length < 2) {<br />
Console.WriteLine("Usage: PDF2TEXT MyPDF.pdf MYTEXT.txt");<br />
}<br />
Hope this hepls.
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|