Creating a FileContents breaks setTooltipText if a html string is passed
static void ThisAlsoWorks(){
try {
String message = "<html><body>This is my serialized object</body></html>";
MyToolTipTest2 toolTipTest = new MyToolTipTest2(message);
Thread.sleep(5000L);
FileOpenService fos = (FileOpenService)ServiceManager.lookup("javax.jnlp.FileOpenService");
FileContents fileContents = fos.openFileDialog(null, null);
MyToolTipTest2 toolTipTest2 = new MyToolTipTest2(message);
} catch (Exception ex) {
ex.printStackTrace();
If you mousehover the first frame before the thread.sleep ends, the tooltip shows up, the filechooser pops up, you choose a random file since it won't do anything with it, the new frame pops up, and both have their html tooltips working. However, if you relaunch it and you do not mousehover the first frame to see the tooltip before the sleep ends and the filechooser pops up, the tooltips won't ever show up anymore on either frame.
Here is a video of the issue: http://www.youtube.com/watch?v=bpuFB_RmuMQ
user9177879 wrote:
Thank you,.. You're welcome.
..following that link's workaround of adding ParserDelegator workaround = new ParserDelegator(); before using the FileContents did solve the issue somehow.Glad it worked for you. I have projects that use HTML in labels and need to revisit them to implement that workaround, though I'm busy on other matters at the moment.
BTW - when posting code or code snippets, HTML/XML or input/output, please use the code tags as described on the 'sticky post' at the top of the forum thread listing.
Similar Messages
-
Creating new text file (txt.) everytime a string is passed in
Dear all, need some help from you all. I am now developing a web service program to allow users to type in a string of characters. And will need to create txt. file to store this strings. Currently, i hard code the directory and the name of the txt file (e.g C:\\test.txt) does anyone know if possible solution to create new txt. file (using different names) whenever a string is passed in from the web service? I am using J2EE as programming language and BEA Workshop for Weblogic Platform version 10.
Thank You very much.well, make the name as argument.
and new File(name)...blablablabla -
How to create a page break in PDF output
Hi there
Does anyone know how to create a page break in the PDF output when using the EXPORT TO PDF command?
I can create a page break using the page-break-after/before HTML stylesheet command, but this is not "interpreted" when the PDF is generated, and I am required to print each table in my web template on a new page.
Please ... been searching for ages for a solution to this and can't find anything.
Cheers,
AndrewTry posting in the iWorks forum.
https://discussions.apple.com/community/app_store/iwork_for_ios -
How can I create a line break in pages for iPad?
On the Mac you can hold the shift key while pressing the return key to creat a line break. Only pressing the return key will creat a new paragraph of course.
On the iPad you only can creat paragraphs. Pressing the shif key does not change that.
Does anybody know how to force a linebrek on the pages app for iPad?Tap and hold where you wish to insert the line break. Select Insert from the pop up menu, then Line break.
this might be helpful for future reference: http://help.apple.com/pages/ipad/1.7/ -
RE: How can I create a page break in a file?
Thank you, Glen. I tried WriteText. But it didn't work.
Tien Wang
Indus Consultancy Services
[email protected]
From: Glen A. Whitbeck
Sent: Thursday, September 11, 1997 11:59 AM
To: Wang, Tien
Cc: forte-users; owner-forte-users
Subject: Re: How can I create a page break in a file?
Instead of using "WriteLine," try using "WriteText" ("WriteLine" writes
TextData into an open file, while "WriteText" writes data to a stream)
like this:
<method 1>
myFile : file = new();
myFile.WriteText('\f');
Glen
Wang, Tien wrote:
Hi,
I am creating a text file for a report which contains multiple pages.
How can I create a page break in my file? I tried to use the
following
two methods, but neither of them works. Specifically, it seems a
special
character printed in the file. But when I print the file through a
WordPad, it didn't separate pages.
I am currently using version 3.0.C on Windows NT 4.0 with a HP Plus 4
printer. Any help will be greatly appreciated.
Tien Wang
Indus Consultancy Services
[email protected]
>
<method 1>
myFile : file = new();
file.writeLine('\f'); --- \f is the form feed in the C language
<method 2>
myFile : file = new();
j : IntegerData = new( value = 14 );
c : char = j.IntegerValue; -- c now contains ascii 14 (form feed)
p : pointer to char = &c; -- Set a pointer to the character
pageBreakTxt : TextData = new();
pageBreakTxt.Concat(p);
myfile.writeLine(pageBreakTxt);Tien,
Try myFile.WriteText('\x0c'); instead of myFile.WriteText('\f');
Regards
Richard Stobart
-----Original Message-----
From: Wang, Tien [SMTP:[email protected]]
Sent: Friday, September 12, 1997 6:09 PM
To: Glen A. Whitbeck
Cc: forte-users; owner-forte-users
Subject: RE: How can I create a page break in a file?
Thank you, Glen. I tried WriteText. But it didn't work.
Tien Wang
Indus Consultancy Services
[email protected]
From: Glen A. Whitbeck
Sent: Thursday, September 11, 1997 11:59 AM
To: Wang, Tien
Cc: forte-users; owner-forte-users
Subject: Re: How can I create a page break in a file?
Instead of using "WriteLine," try using "WriteText" ("WriteLine" writes
TextData into an open file, while "WriteText" writes data to a stream)
like this:
<method 1>
myFile : file = new();
myFile.WriteText('\f');
Glen
Wang, Tien wrote:
Hi,
I am creating a text file for a report which contains multiple pages.
How can I create a page break in my file? I tried to use the
following
two methods, but neither of them works. Specifically, it seems a
special
character printed in the file. But when I print the file through a
WordPad, it didn't separate pages.
I am currently using version 3.0.C on Windows NT 4.0 with a HP Plus 4
printer. Any help will be greatly appreciated.
Tien Wang
Indus Consultancy Services
[email protected]
>
<method 1>
myFile : file = new();
file.writeLine('\f'); --- \f is the form feed in the C language
<method 2>
myFile : file = new();
j : IntegerData = new( value = 14 );
c : char = j.IntegerValue; -- c now contains ascii 14 (form feed)
p : pointer to char = &c; -- Set a pointer to the character
pageBreakTxt : TextData = new();
pageBreakTxt.Concat(p);
myfile.writeLine(pageBreakTxt); -
How can I create a page break in a file?
Hi,
I am creating a text file for a report which contains multiple pages.
How can I create a page break in my file? I tried to use the following
two methods, but neither of them works. Specifically, it seems a special
character printed in the file. But when I print the file through a
WordPad, it didn't separate pages.
I am currently using version 3.0.C on Windows NT 4.0 with a HP Plus 4
printer. Any help will be greatly appreciated.
Tien Wang
Indus Consultancy Services
[email protected]
<method 1>
myFile : file = new();
file.writeLine('\f'); --- \f is the form feed in the C language
<method 2>
myFile : file = new();
j : IntegerData = new( value = 14 );
c : char = j.IntegerValue; -- c now contains ascii 14 (form feed)
p : pointer to char = &c; -- Set a pointer to the character
pageBreakTxt : TextData = new();
pageBreakTxt.Concat(p);
myfile.writeLine(pageBreakTxt);
-----------------------------------Tien,
Try myFile.WriteText('\x0c'); instead of myFile.WriteText('\f');
Regards
Richard Stobart
-----Original Message-----
From: Wang, Tien [SMTP:[email protected]]
Sent: Friday, September 12, 1997 6:09 PM
To: Glen A. Whitbeck
Cc: forte-users; owner-forte-users
Subject: RE: How can I create a page break in a file?
Thank you, Glen. I tried WriteText. But it didn't work.
Tien Wang
Indus Consultancy Services
[email protected]
From: Glen A. Whitbeck
Sent: Thursday, September 11, 1997 11:59 AM
To: Wang, Tien
Cc: forte-users; owner-forte-users
Subject: Re: How can I create a page break in a file?
Instead of using "WriteLine," try using "WriteText" ("WriteLine" writes
TextData into an open file, while "WriteText" writes data to a stream)
like this:
<method 1>
myFile : file = new();
myFile.WriteText('\f');
Glen
Wang, Tien wrote:
Hi,
I am creating a text file for a report which contains multiple pages.
How can I create a page break in my file? I tried to use the
following
two methods, but neither of them works. Specifically, it seems a
special
character printed in the file. But when I print the file through a
WordPad, it didn't separate pages.
I am currently using version 3.0.C on Windows NT 4.0 with a HP Plus 4
printer. Any help will be greatly appreciated.
Tien Wang
Indus Consultancy Services
[email protected]
>
<method 1>
myFile : file = new();
file.writeLine('\f'); --- \f is the form feed in the C language
<method 2>
myFile : file = new();
j : IntegerData = new( value = 14 );
c : char = j.IntegerValue; -- c now contains ascii 14 (form feed)
p : pointer to char = &c; -- Set a pointer to the character
pageBreakTxt : TextData = new();
pageBreakTxt.Concat(p);
myfile.writeLine(pageBreakTxt); -
Any idea why in Numbers my COUNTIFS formula keeps breaking? For daycare purpose, I use a spreadsheet that helps me to count how many children I have at 3:15, 4:15 and 5:00. COUNTIFS works well when I create it but breaks after a while. Also I am using a pop-up menu in the cells in time format, does it have any consequence on the formula?
Any idea why in Numbers my COUNTIFS formula keeps breaking? For daycare purpose, I use a spreadsheet that helps me to count how many children I have at 3:15, 4:15 and 5:00. COUNTIFS works well when I create it but breaks after a while. Also I am using a pop-up menu in the cells in time format, does it have any consequence on the formula?
-
Is there a way to creat a hard break in a song, followed by a measure or so of silence, then bring the music back in within the garageband format?
I am not quite sure what you want to achieve, but you can
select all tracks at once,
move the cursor to the measure where you want to cut your song
Press cmd-T to cut all tracks at the same position
select all regions in all tracks to the right of the cut and drag them one measure to the right
Alternately you might show the Master Track (Main menu; Track -> Show Master Track) and use the Master Volume automation curve to silence all tracks at once for exactly one measure.
Regards
Léonie -
Create a Multiple-Line JButton Without Using HTML format
I used html format for multiple-line JButton and it took a long time to load that button up (about 5 seconds more). Does anyone know how to create a multiple-line JButton without using html?
Any suggestion or sample code will be appreciated.
javamesserHello,
You could try using the following:
-give your button some layout (e.g.: BoxLayout.Y_AXIS, or BorderLayout).
-create the wrapped text in separate JLabels (one line in each label)
-add your labels to the button
Advantage:
this solution does not affect the laf classes
Disadvantage:
focus rectangle is not calculated accurately
Regards,
G -
How can I create a conditional break in webi ?
Hello Mister and Misses
Can somebody explain me how i can create a conditional break , because i want to limit the number of lines to 9 l ines in a bloc
each 9 lines I want to create a break
Thank you
example :
1 toto
2 titi
3 taa
4 tutu
5 papa
6 popo
7 tata
8 momo
9 mimi
(break)
10 mumu
17 maxe
18 fax
(break)
19..
My first column is not a dimension so, i can't manage to make a break
How is it possible to tranform a measure to a dimension in order to make a break on each 9 lines
thank youTien,
Try myFile.WriteText('\x0c'); instead of myFile.WriteText('\f');
Regards
Richard Stobart
-----Original Message-----
From: Wang, Tien [SMTP:[email protected]]
Sent: Friday, September 12, 1997 6:09 PM
To: Glen A. Whitbeck
Cc: forte-users; owner-forte-users
Subject: RE: How can I create a page break in a file?
Thank you, Glen. I tried WriteText. But it didn't work.
Tien Wang
Indus Consultancy Services
[email protected]
From: Glen A. Whitbeck
Sent: Thursday, September 11, 1997 11:59 AM
To: Wang, Tien
Cc: forte-users; owner-forte-users
Subject: Re: How can I create a page break in a file?
Instead of using "WriteLine," try using "WriteText" ("WriteLine" writes
TextData into an open file, while "WriteText" writes data to a stream)
like this:
<method 1>
myFile : file = new();
myFile.WriteText('\f');
Glen
Wang, Tien wrote:
Hi,
I am creating a text file for a report which contains multiple pages.
How can I create a page break in my file? I tried to use the
following
two methods, but neither of them works. Specifically, it seems a
special
character printed in the file. But when I print the file through a
WordPad, it didn't separate pages.
I am currently using version 3.0.C on Windows NT 4.0 with a HP Plus 4
printer. Any help will be greatly appreciated.
Tien Wang
Indus Consultancy Services
[email protected]
>
<method 1>
myFile : file = new();
file.writeLine('\f'); --- \f is the form feed in the C language
<method 2>
myFile : file = new();
j : IntegerData = new( value = 14 );
c : char = j.IntegerValue; -- c now contains ascii 14 (form feed)
p : pointer to char = &c; -- Set a pointer to the character
pageBreakTxt : TextData = new();
pageBreakTxt.Concat(p);
myfile.writeLine(pageBreakTxt); -
Creating a print button to call a Report Query and pass filters
If i use the REPORT QUERY option in APEX 4 to create an statement that is the same one used in an interactive report, can I create a link or button to the REPORT QUERY and pass all the session and filter information from the interactive report to the report query?
This way I can have the interactive report screen where the user can do all sorts of modifications and such and then pass those to the REPORT QUERY so I can call that from a custom link or button.
You may ask "why does he need another print button?"
Answer: I am using a view that has some embedded HTML tags to format the output really nicely. The HTML download version created by the interactive reports works beautifully. The customer also wants a PDF version (meh) which does not render the HTML tags and actually echos them as part of the text. I found that I can create another view that uses the CHR function to create all the breaks and such I was doing with HTML and these do render properly in PDF. So, I figured just have 2 reports: 1 Interactive and 1 using a REPORT QUERY. I just want to call the REPORT QUERY version but use the Interactive Search form to set all the parameters.
Or, am I over thinking this and there is an easier method?
I made a previous post where I showed how I got the APEX printing to work and i hoped that helped someone out - fixing this issue would put the whole thing to rest.
ThanksIs BI Publisher desktop (MS Word add-in) a possibility? This would allow you to use MS Word to create your output template (RTF) that would result in a properly formatted PDF. Of course, you'd have to right an updated version of the query without HTML embedded. Just thinking outside of the box.
-
How to parse select lines in an html string?
I've been writing a program to deal with demographic data and the first server it calls returns an xml string. However, the backup server returns an html string instead of an xml string, so the formatting is a bit different. I was going to use a regex as I did with the xml server, but regex's don't work that well with html. i was wondering if you could offer some advice on how to effectively parse the html string? It is in this format <html>
<head>
<meta name="Description" content="ZIP Code Demographics"/>
<meta name="Keywords" content="zip, zip code, zipcode, demographics, 2000, county, lookup, city, state"/>
<title>ZIP Code Demographics Lookup</title>
<link rel="stylesheet" type="text/css" href="http://www.MelissaData.com/style.css" />
</head>
<body topmargin="0" onload="document.getElementById('text1').focus()">
<div align="center">
<!--Start of top.asp 9/2/08 Ray-->
<script type='text/javaScript' src='http://www.melissadata.com/cgi-bin/lib.js'></script>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="744" style="font-size:8pt; font-family:Arial; color: #666666">
<tr valign='middle' height='24'>
<td align="left" rowspan=2><a href="/index.htm">
<img border="0" src="http://www.melissadata.com/home/new1207/MelissaData-logo.gif" alt="Melissa Data Home Page" /></a><img border="0" src="http://www.melissadata.com/home/new1207/1-800-number.gif" width="112" height="22" alt="Call 1-800-MELISSA for Data Quality Solutions" /></td>
<td colspan='2' align="right">
<font size="1" face="Verdana">
<script type="text/javaScript">var r=uCookie("r"); var s=uCookie("s"); var n=uCookie("n");
//document.write (document.cookie);
if (r == "YES" && s == "IN" && n != "" ) document.write ("Hello <b>" + n.replace(/\+/g," ") + "<\/b> [<font size=1><a href=/user/signout.aspx>Sign out<\/a>, <a href=/user/user_account.aspx>My Account<\/a></font>]");else document.write (" <a href=/user/signin.aspx>Sign In<\/a> ");
</script></font></td></tr>
<tr height='24'>
<form method="get" action="http://w2.melissadata.com/cgi-bin/search.asp">
<td align="right" height=30>
<a href="/netcart/order1.aspx"><img border="0" src="http://www.melissadata.com/home/new1207/Hompage-shoppincart.gif" alt="Shopping Cart" /></a>
<a style="color: #666666" href="/netcart/order1.aspx">Buy</a>
| <a style="color: #666666" href="/cgi-bin/newsletters.asp">Newsletters</a> | Search
<input name="indata" style="font-size:7pt; font-family:Arial" size="10" /><input type="image" src="http://www.melissadata.com/home/new1207/hompage-arrow.gif" style="vertical-align: middle" value="Search" name="submit1" />
</td></form></tr>
</table>
<style="font-size:10pt; font-family:Arial; color: #0066cc" type="text/css">
<table align="center" border="0" cellpadding="4" cellspacing="0" width="744">
<tr>
<td align="center" width="106">
<b><a style="text-decoration: none" href="/products/index.htm">Products</a></b></td>
<td align="center" width="106">
<b><a style="text-decoration: none" href="/solutions/index.htm">Solutions</a></b></td>
<td align="center" width="106">
<b><a style="text-decoration: none" href="/download.htm">Downloads</a> </b></td>
<td align="center" width="106">
<b><a style="text-decoration: none" href="/tech/tech.html">Support</a> </font></td>
<td align="center" width="106">
<b><a style="text-decoration: none" href="/resources/index.htm">Resources</a></b></td>
<td align="center" width="106">
<b><a style="text-decoration: none" href="/lookups/index.htm">Lookups</a></b></td>
<td align="center" width="106">
<b><a style="text-decoration: none" href="/cgi-bin/contact.asp">Contact Us</a></b></td></tr>
</table></style>
<!-- Start Image BanAd.asp-->
<div align=center><a href='/cgi-bin/BanAd.asp?id=135'><img alt='Click here' src='/cgi-bin/BanImage.asp?id=135'></a></div><!-- End Image BanAd.asp-->
<!--TitleBorder in Shared.asp -->
<table width="744" cellspacing=0 border=1 bgcolor="#F7F7F7"><tr><td align=left><font color="#ce0000" size="5">ZIP Code Demographics Lookup</font></td><form><td width=120 align=center><input title='Help for ZIP Code Demographics Lookup' type=button onClick=openHelpWindow('/lookups/help/zipdemo2000.asp') value=Help> <a title='Lookups home page' href=/lookups/index.htm>Index</a></td></form></tr></table>
<!--TitleBorder End-->
<form action="ZipDemo2000.asp" name="Demo2000">
<table width="400" class="Disp">
<tr><td align="center"><b>Enter a 5-Digit ZIP Code</b>
<input class="Disp" title="Enter a ZIP Code" id="text1" size="5" name="ZipCode" maxlength="5"/> <input type="submit" value="Submit"/>
</td></tr>
</table>
</form>
<table cellspacing="0" cellpadding="1" width="750" border="2" bgcolor="#ffffcc">
<tr bgcolor="lightblue"><td colspan="4" align="center">Year 2000 Demographics of <br><b>ZIP Code 90041</b><br><b>LOS ANGELES, California</b><br><a href=mapzipv.asp?zip=90041>Map of ZIP Code</a></td></tr>
<tr bgcolor="#bbffff"><td>TOTAL POPULATION [1]</td><td >P001</td></tr>
<tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P001</td></tr>
<tr><td> Total</td><td align=right ><b> 27,864</b></td></tr>
<tr bgcolor="#bbffff"><td>URBAN AND RURAL [6]</td><td >P002</td></tr>
<tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P002</td></tr>
<tr><td> Total:</td><td align=right ><b> 27,864</b></td></tr>
<tr><td> Urban:</td><td align=right ><b> 27,864</b></td></tr>
<tr><td> Inside urbanized areas</td><td align=right ><b> 27,864</b></td></tr>
<tr><td> Inside urban clusters</td><td align=right ><b> 0</b></td></tr>
<tr><td> Rural</td><td align=right ><b> 0</b></td></tr>
<tr><td> Not defined for this file</td><td align=right ><b> 0</b></td></tr>
<tr bgcolor="#bbffff"><td>RACE [8]</td><td >P007</td></tr>
<tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P007</td></tr>
<tr><td> Total:</td><td align=right ><b> 27,864</b></td></tr>
<tr><td> White alone</td><td align=right ><b> 13,429</b></td></tr>
<tr><td> Black or African American alone</td><td align=right ><b> 630</b></td></tr>
<tr><td> American Indian and Alaska Native alone</td><td align=right ><b> 242</b></td></tr>
<tr><td> Asian alone</td><td align=right ><b> 7,123</b></td></tr>
<tr><td> Native Hawaiian and Other Pacific Islander alone</td><td align=right ><b> 42</b></td></tr>
<tr><td> Some other race alone</td><td align=right ><b> 4,738</b></td></tr>
<tr><td> Two or more races</td><td align=right ><b> 1,660</b></td></tr>
<tr bgcolor="#bbffff"><td>HISPANIC OR LATINO BY RACE [17]</td><td >P008</td></tr>
<tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P008</td></tr>
<tr><td> Total:</td><td align=right ><b> 27,864</b></td></tr>
<tr><td> Not Hispanic or Latino:</td><td align=right ><b> 17,109</b></td></tr>
<tr><td> White alone</td><td align=right ><b> 8,468</b></td></tr>
<tr><td> Black or African American alone</td><td align=right ><b> 555</b></td></tr>
<tr><td> American Indian and Alaska Native alone</td><td align=right ><b> 105</b></td></tr>
<tr><td> Asian alone</td><td align=right ><b> 7,053</b></td></tr>
<tr><td> Native Hawaiian and Other Pacific Islander alone</td><td align=right ><b> 30</b></td></tr>
<tr><td> Some other race alone</td><td align=right ><b> 73</b></td></tr>
<tr><td> Two or more races</td><td align=right ><b> 825</b></td></tr>
<tr><td> Hispanic or Latino:</td><td align=right ><b> 10,755</b></td></tr>
<tr><td> White alone</td><td align=right ><b> 4,961</b></td></tr>
<tr><td> Black or African American alone</td><td align=right ><b> 75</b></td></tr>
<tr><td> American Indian and Alaska Native alone</td><td align=right ><b> 137</b></td></tr>
<tr><td> Asian alone</td><td align=right ><b> 70</b></td></tr>
<tr><td> Native Hawaiian and Other Pacific Islander alone</td><td align=right ><b> 12</b></td></tr>
<tr><td> Some other race alone</td><td align=right ><b> 4,665</b></td></tr>
<tr><td> Two or more races</td><td align=right ><b> 835</b></td></tr>
<tr bgcolor="#bbffff"><td>SEX BY AGE [49]</td><td >P012</td></tr>
<tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P012</td></tr>
<tr><td> Total:</td><td align=right ><b> 27,864</b></td></tr>
<tr><td> Male:</td><td align=right ><b> 13,324</b></td></tr>
<tr><td> Under 5 years</td><td align=right ><b> 862</b></td></tr>
<tr><td> 5 to 9 years</td><td align=right ><b> 974</b></td></tr>
<tr><td> 10 to 14 years</td><td align=right ><b> 872</b></td></tr>
<tr><td> 15 to 17 years</td><td align=right ><b> 525</b></td></tr>
<tr><td> 18 and 19 years</td><td align=right ><b> 511</b></td></tr>
<tr><td> 20 years</td><td align=right ><b> 257</b></td></tr>
<tr><td> 21 years</td><td align=right ><b> 287</b></td></tr>
<tr><td> 22 to 24 years</td><td align=right ><b> 569</b></td></tr>
<tr><td> 25 to 29 years</td><td align=right ><b> 969</b></td></tr>
<tr><td> 30 to 34 years</td><td align=right ><b> 1,024</b></td></tr>
<tr><td> 35 to 39 years</td><td align=right ><b> 1,140</b></td></tr>
<tr><td> 40 to 44 years</td><td align=right ><b> 1,077</b></td></tr>
<tr><td> 45 to 49 years</td><td align=right ><b> 987</b></td></tr>
<tr><td> 50 to 54 years</td><td align=right ><b> 822</b></td></tr>
<tr><td> 55 to 59 years</td><td align=right ><b> 647</b></td></tr>
<tr><td> 60 and 61 years</td><td align=right ><b> 215</b></td></tr>
<tr><td> 62 to 64 years</td><td align=right ><b> 270</b></td></tr>
<tr><td> 65 and 66 years</td><td align=right ><b> 155</b></td></tr>
<tr><td> 67 to 69 years</td><td align=right ><b> 258</b></td></tr>
<tr><td> 70 to 74 years</td><td align=right ><b> 320</b></td></tr>
<tr><td> 75 to 79 years</td><td align=right ><b> 252</b></td></tr>
<tr><td> 80 to 84 years</td><td align=right ><b> 183</b></td></tr>
<tr><td> 85 years and over</td><td align=right ><b> 148</b></td></tr>
<tr><td> Female:</td><td align=right ><b> 14,540</b></td></tr>
<tr><td> Under 5 years</td><td align=right ><b> 864</b></td></tr>
<tr><td> 5 to 9 years</td><td align=right ><b> 949</b></td></tr>
<tr><td> 10 to 14 years</td><td align=right ><b> 875</b></td></tr>
<tr><td> 15 to 17 years</td><td align=right ><b> 534</b></td></tr>
<tr><td> 18 and 19 years</td><td align=right ><b> 592</b></td></tr>
<tr><td> 20 years</td><td align=right ><b> 285</b></td></tr>
<tr><td> 21 years</td><td align=right ><b> 264</b></td></tr>
<tr><td> 22 to 24 years</td><td align=right ><b> 600</b></td></tr>
<tr><td> 25 to 29 years</td><td align=right ><b> 932</b></td></tr>
<tr><td> 30 to 34 years</td><td align=right ><b> 1,035</b></td></tr>
<tr><td> 35 to 39 years</td><td align=right ><b> 1,026</b></td></tr>
<tr><td> 40 to 44 years</td><td align=right ><b> 1,131</b></td></tr>
<tr><td> 45 to 49 years</td><td align=right ><b> 1,038</b></td></tr>
<tr><td> 50 to 54 years</td><td align=right ><b> 970</b></td></tr>
<tr><td> 55 to 59 years</td><td align=right ><b> 689</b></td></tr>
<tr><td> 60 and 61 years</td><td align=right ><b> 261</b></td></tr>
<tr><td> 62 to 64 years</td><td align=right ><b> 327</b></td></tr>
<tr><td> 65 and 66 years</td><td align=right ><b> 208</b></td></tr>
<tr><td> 67 to 69 years</td><td align=right ><b> 307</b></td></tr>
<tr><td> 70 to 74 years</td><td align=right ><b> 482</b></td></tr>
<tr><td> 75 to 79 years</td><td align=right ><b> 450</b></td></tr>
<tr><td> 80 to 84 years</td><td align=right ><b> 331</b></td></tr>
<tr><td> 85 years and over</td><td align=right ><b> 390</b></td></tr>
<tr bgcolor="#bbffff"><td>MEDIAN AGE BY SEX [3]</td><td >P013</td></tr>
<tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P013</td></tr>
<tr bgcolor="#bbffff"><td>Median age--</td><td >P013</td></tr>
<tr><td> Both sexes</td><td align=right ><b> 35.3</b></td></tr>
<tr><td> Male</td><td align=right ><b> 34.0</b></td></tr>
<tr><td> Female</td><td align=right ><b> 36.6</b></td></tr>
<tr bgcolor="#bbffff"><td>HOUSEHOLDS [1]</td><td >P015</td></tr>
<tr bgcolor="#bbffff"><td>Universe: Households</td><td >P015</td></tr>
<tr><td> Total</td><td align=right ><b> 9,375</b></td></tr>
<tr bgcolor="#bbffff"><td>POPULATION IN HOUSEHOLDS [1]</td><td >P016</td></tr>
<tr bgcolor="#bbffff"><td>Universe: Population in households</td><td >P016</td></tr>
<tr><td> Total</td><td align=right ><b> 26,409</b></td></tr>
<tr bgcolor="#bbffff"><td>AVERAGE HOUSEHOLD SIZE [1]</td><td >P017</td></tr>
<tr bgcolor="#bbffff"><td>Universe: Households</td><td >P017</td></tr>
<tr><td> Average household size</td><td align=right ><b> 2.82</b></td></tr>
<tr bgcolor="#bbffff"><td>FAMILIES [1]</td><td >P031</td></tr>
<tr bgcolor="#bbffff"><td>Universe: Families</td><td >P031</td></tr>
<tr><td> Total</td><td align=right ><b> 6,326</b></td></tr>
<tr bgcolor="#bbffff"><td>POPULATION IN FAMILIES [1]</td><td >P032</td></tr>
<tr bgcolor="#bbffff"><td>Universe: Population in families</td><td >P032</td></tr>
<tr><td> Total</td><td align=right ><b> 21,653</b></td></tr>
<tr bgcolor="#bbffff"><td>AVERAGE FAMILY SIZE [1]</td><td >P033</td></tr>
<tr bgcolor="#bbffff"><td>Universe: Families</td><td >P033</td></tr>
<tr><td> Average family size</td><td align=right ><b> 3.42</b></td></tr>
</table>
<!-- Start of bottom.asp-->
<hr width="730" />
<span style='font-size:8pt'>
<a href="http://www.melissadata.com/enews/advisorarticles/index.htm">Articles</a> |
<a href="javascript:window.external.AddFavorite('http://www.melissadata.com/lookups/zipdemo2000.asp', 'ZIP Code Demographics Lookup')" target="_self">Bookmark</a> |
<a href="http://www.melissadata.com/cgi-bin/improve.asp?web">How Can We Improve?</a> |
<a href="http://www.melissadata.com/cgi-bin/batchprocessing.asp">Batch Processing</a> |
<a href="http://www.melissadata.com/cgi-bin/send.asp?Send2Friend">Email to Friend</a> |
<a href="http://www.melissadata.com/cgi-bin/catalogres.asp">Free Catalog</a> |
<a href="http://forum.melissadata.com/default.aspx">Forums</a> |
<a href="http://www.melissadata.com/terms-of-use.htm">Terms of Use</a>
<font color="#ddddff"><br />
<script type="text/javascript"> var r=uCookie("r"); var f=uCookie("f"); var c=uCookie("c"); var l=uCookie("l");
//document.write (r + ":" + f + ":" + c + ":" + l);</script></font></span>
<!-- End of bottom.asp-->
</div>
</body>
</html>.
The numbers I wanted to extract are the age groups of "Under 5 years," "5 to 9 years," "10 to 14 years," and "15 to 17 years," from both male and female groups, which should add up to 8 numbers total. Here is the backup server portion of my program as well, so you can see what i'm doing.
import java.net.*;
import java.net.URL;
import java.net.URLConnection;
import java.net.HttpURLConnection;
import java.io.*;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.StringReader;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.Arrays;
public class TriParser
static Scanner sc = new Scanner(System.in);
public static int[] findValues(String text, String gender, String[] labels)
Matcher m = Pattern.compile("<td>(.*?)</td>",
Pattern.MULTILINE | Pattern.DOTALL).matcher(text);
String allValues = m.find() ? m.group(1) : null; // TODO: handle if 'null' is returned!
int[] values = new int[labels.length];
for(int i = 0; i < labels.length; i++)
m = Pattern.compile(labels[i]+"[^>]+>(\\d+)").matcher(allValues);
if(m.find()) values[i] = Integer.parseInt(m.group(1));
return values;
public static void main(String[] args) throws Exception
int zip;
boolean validInteger;//indicates if zipcode is valid (has to be 5 digits)
do
System.out.print("Enter a five-digit zipcode: ");
zip = sc.nextInt();
validInteger = true;
if((zip < 10000) || (zip > 99999))
validInteger = false;
System.out.println("Invalid Entry. Please re-enter zipcode.");
while(!validInteger);
System.out.println(zip);
//String requestPart1 ="query=PREFIX+dc%3A++%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E+%0D%0APREFIX+census%3A+%3Chttp%3A%2F%2Fwww.rdfabout.com%2Frdf%2Fschema%2Fcensus%2F%3E+%0D%0APREFIX+census1%3A+%3Ctag%3Agovshare.info%2C2005%3Ardf%2Fcensus%2Fdetails%2F100pct%2F%3E+%0D%0A%0D%0ADESCRIBE+%3Ftable+WHERE+%7B+%0D%0A+%3Chttp%3A%2F%2Fwww.rdfabout.com%2Frdf%2Fusgov%2Fgeo%2Fcensus%2Fzcta%2F";
//String requestPart2 = "" + zip; // zipcode goes here
//String requestPart3 ="%3E+census%3Adetails+%3Fdetails+.+%0D%0A+%3Fdetails+census1%3AtotalPopulation+%3Ftable+.+%0D%0A+%3Ftable+dc%3Atitle+%22SEX+BY+AGE+%28P012001%29%22+.+%0D%0A%7D%0D%0A&outputMimeType=text%2Fxml";
String requestPart1 = "" + zip;
String response = "";
URL url = new URL("http://www.melissadata.com/lookups/zipdemo2000.asp?ZipCode="+requestPart1);
URLConnection conn = url.openConnection();
// Set connection parameters.
conn.setDoInput (true);
conn.setDoOutput (true);
conn.setUseCaches (false);
// Make server believe we are form data
conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
DataOutputStream out = new DataOutputStream (conn.getOutputStream ());
// Write out the bytes of the content string to the stream.
out.writeBytes(requestPart1);
out.flush ();
out.close ();
// Read response from the input stream.
BufferedReader in = new BufferedReader (new
InputStreamReader(conn.getInputStream ()));
String temp;
while ((temp = in.readLine()) != null)
response += temp + "\n"; // needs to be parsed to calculate the 4 numbers
temp = null;
in.close ();
//System.out.println("Server response:\n" + response);
// how to call the method:
String[] ages = {"Under 5 years", "5 to 9 years", "10 to 14 years", "15 to 17 years"};
String[] ages1 = {"Under 5 years"};
String[] ages2 = {"5 to 9 years"};
String[] ages3 = {"10 to 14 years"};
String[] ages4 = {"15 to 17 years"};
String female1 = Arrays.toString(findValues(response, "female", ages1));
String female2 = Arrays.toString(findValues(response, "female", ages2));
String female3 = Arrays.toString(findValues(response, "female", ages3));
String female4 = Arrays.toString(findValues(response, "female", ages4));
String female = female1 + "+" + female2 + "<" + female3 + ">" + female4 + "&";
String male1 = Arrays.toString(findValues(response, "male", ages1));
String male2 = Arrays.toString(findValues(response, "male", ages2));
String male3 = Arrays.toString(findValues(response, "male", ages3));
String male4 = Arrays.toString(findValues(response, "male", ages4));
String male = male1 + "+" + male2 + "<" + male3 + ">" + male4 + "&";
System.out.println(female);
System.out.println(male);
//Simplified string response, makes use of regular expressions
//Start manipulation of numbers inside string
int left = female.indexOf("[");
int right = female.indexOf("]");
// pull out the text inside the parens
String parsed = female.substring(left+1, right);
double parseddub = Double.parseDouble(parsed);
//divide the group Under5Years into Under12Mo and 1to4Yr
double Group1Adub = parseddub*.25;//25% for Under12Mo
Group1Adub = Math.ceil(Group1Adub);
int Group1A =(int)Group1Adub;
double Group1Bdub = parseddub*.75;//75% for 1to4Yr
Group1Bdub = Math.ceil(Group1Bdub);
int Group1B =(int)Group1Bdub;
int left2 = female.indexOf("+");
int right2 = female.indexOf("<");
// pull out the text inside the parens
String parsed2 = female.substring(left2+2, right2-1);
double parsed2dub = Double.parseDouble(parsed2);
//divide the group 5to9Yr into 5Yr, 6to7Yr, and 8to9Yr
double Group2Adub = parsed2dub*.2;//20% for 5Yr
Group2Adub = Math.ceil(Group2Adub);
int Group2A =(int)Group2Adub;
double Group2Bdub = parsed2dub*.4;//40% for 6to7Yr
Group2Bdub = Math.ceil(Group2Bdub);
int Group2B =(int)Group2Bdub;
double Group2Cdub = parsed2dub*.2;//20% for 8Yr
Group2Cdub = Math.ceil(Group2Cdub);
int Group2C =(int)Group2Cdub;
double Group2Ddub = parsed2dub*.2;//20% for 9Yr
Group2Ddub = Math.ceil(Group2Ddub);
int Group2D =(int)Group2Ddub;
int left3 = female.indexOf("<");
int right3 = female.indexOf(">");
// pull out the text inside the brackets
String parsed3 = female.substring(left3+2, right3-1);
int Group3A = Integer.valueOf(parsed3).intValue();
int left4 = female.indexOf(">");
int right4 = female.indexOf("&");
// pull out the text inside the brackets
String parsed4 = female.substring(left4+2, right4-1);
int Group4A = Integer.valueOf(parsed4).intValue();
int left5 = male.indexOf("[");
int right5 = male.indexOf("]");
String parsed5 = male.substring(left5+1, right5);
double parsed5dub = Double.parseDouble(parsed5);
//divide the group Under5Years into Under12Mo and 1to4Yr
double Group5Adub = parsed5dub*.25;//25% for Under12Mo
Group5Adub = Math.ceil(Group5Adub);
int Group5A =(int)Group5Adub;
double Group5Bdub = parsed5dub*.75;//75% for 1to4Yr
Group5Bdub = Math.ceil(Group5Bdub);
int Group5B =(int)Group5Bdub;
int left6 = male.indexOf("+");
int right6 = male.indexOf("<");
// pull out the text inside the parens
String parsed6 = male.substring(left6+2, right6-1);
double parsed6dub = Double.parseDouble(parsed6);
//divide the group 5to9Yr into 5Yr, 6to7Yr, and 8to9Yr
double Group6Adub = parsed6dub*.2;//20% for 5Yr
Group6Adub = Math.ceil(Group6Adub);
int Group6A =(int)Group6Adub;
double Group6Bdub = parsed6dub*.4;//40% for 6to7Yr
Group6Bdub = Math.ceil(Group6Bdub);
int Group6B =(int)Group6Bdub;
double Group6Cdub = parsed6dub*.2;//20% for 8Yr
Group6Cdub = Math.ceil(Group6Cdub);
int Group6C =(int)Group6Cdub;
double Group6Ddub = parsed6dub*.2;//20% for 9Yr
Group6Ddub = Math.ceil(Group6Ddub);
int Group6D =(int)Group6Ddub;
int left7 = male.indexOf("<");
int right7 = male.indexOf(">");
// pull out the text inside the brackets
String parsed7 = male.substring(left7+2, right7-1);
int Group7A = Integer.valueOf(parsed7).intValue();
int left8 = male.indexOf(">");
int right8 = male.indexOf("&");
// pull out the text inside the brackets
String parsed8 = male.substring(left8+2, right8-1);
int Group8A = Integer.valueOf(parsed8).intValue();
//female
int Group1 = Group1A;
int Group2 = Group1B + Group2A;
int Group3 = Group2A + Group2B + Group2C;
int Group4 = Group2C + Group2D + Group3A + Group4A;
//male
int Group5 = Group5A;
int Group6 = Group5B + Group6A;
int Group7 = Group6A + Group6B + Group6C;
int Group8 = Group6C + Group6D + Group7A + Group8A;
System.out.println("Server response:\n" + "\n" + "Female");
System.out.println("Under 12 Months: " + Group1);
System.out.println("1 to 4 Years Old: " + Group2);
System.out.println("5 to 8 Years Old: " + Group3);
System.out.println("8 to 17 Years Old: " + Group4);
System.out.println("\n" + "Male");
System.out.println("Under 12 Months: " + Group5);
System.out.println("1 to 4 Years Old: " + Group6);
System.out.println("5 to 8 Years Old: " + Group7);
System.out.println("8 to 17 Years Old: " + Group8);
}Currently it functions using a regex, and executes, but doesn't return any numbers, only returns zeros...If you could help me out with this, that would be amazing! Thanks so much.hmm, is there a way to do it without an external API? Of course there is.
looks like i have to download the API and the idea behind the program is to make it so multiple people running only java can run the program, without having to download APIs, ect, to make it run. Not sure if that is what JTidy entails, but is that what you were suggesting?Personally, I don't understand the resistance to using well-tested tools already in existence as opposed to trying to rewrite a shallow facsimile of said tools. You can distribute the JTidy library along with your application and save yourself a great deal of development and debugging effort.
~ -
Cannot get questionnaire HTML string SAP CRM 7.0 EHP3
Hello,
We are trying to use questionnaires in Activities and it doesn't work.
This error : Cannot get questionnaire HTML string is shown.
I checked Note 1600561 - Changes done in values template XSLT not taken into account, but it isn't valid for our release ( EHP3 )
Thanks in advance for your help.
BelénHi,
We used the questionnaires (questionnaires was displayed and worked) but we faced issues with the display in web UI (only when the questionnaires are linked to an activity/opportunity). The Admin screen for questionnaire works well).
We have implemented the following notes in order to correct this displaying issues :
- 1858059 : Upload the CRM_SVY_GENERATE_BSP_TEMPLATE.ZIP, refresh cash and generate all surveys
And then notes mentioned above
- 1914885 & 1944288 in the relevant order.
But we cannot display anymore the existing surveys (They are active, all scenarios are flagged).
Error message : Cannot get questionnaire HTML string
Any Ideas how to proceed to solve ? (we work on EHP2) -
Creating a Function module to send XML Byte String
Hi all,
I have to create a Function module to get XML byte string.The internal table is dynamic coloums based on how many data selected as a importparameter.from the internal; table data I have to create a XML byte string as a output.Pl help me to proceed further.
Thanks in Advance.
RamIf i have your question right you need to convert an internal table of unknown type to an xml string then to a byte string.
data xmlString type string.
data xmlXString type xstring.
call transformation id
source
table = internalTableYouWantToExport
result
xml xmlString.
export xmlString to data buffer xmlXString.
xmlString has the xml of the table and xmlXString contains the byte representation of the string. -
How to display a HTML String in a ActiveX WebBrowser ?
How to direct display a HTML String in a ActiveX WebBrowser without use a URL ?
I am sure that it would depend on the browser, but with Internet Explorer from Microsoft, I don't think you can. (I may be wrong on this.) What you could do would be to save your string to file and read the file as a url in the browser. I know that this is a step you are trying to avoid, but it will work.
Hope that this helps,
Bob Young
Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
DISTek Integration, Inc. - NI Alliance Member
mailto:[email protected]
Maybe you are looking for
-
IPhone 6 Plus screen protector
Is there any curved tempered glass screen protector for iphone 6 plus in ebay ? which of them are better? And I used my old iphone 4 three years any without screen protector but it didn't scratch. But iphone 6 plus is more expensive phone so I want m
-
Break Apart A Vector Created in Image Trace? CS6
I realize this is probably simple, but I have taken a simple graphic pattern jpeg and I've used image trace to trace it in Illustrator CS6. But when I try and select parts of the vector is just selects the entire image in a single big box. How can I
-
What is the diffrence betwen the pnp&pnpce
what is the diffrence betwen the pnp&pnpce
-
Can't get my paid movies, tv shows, and music back onto my iPod
I paid for a few movies, tv shows and songs for my iPod, and then my computer broke. I needed to get it fixed and so i lost all of my data including the music and movie files. Is there anyway that I can get those already paid movie and music files ba
-
CTRL+Q Does respect browser.WarnOnQuit
Hi! I hate pressing CTRL+Q accidentally, and looking at the forums someone suggested to set the variable browser.warnOnQuit to true, I have it already in true, but pressing CTRL+Q closes firefox without warning. I'm using firefox 31.0 for Ubuntu Cann