Anchor tag in txt file
is there any way that i could include a link that has
punctuation characters inside of an anchor tag of an externally
loaded txt file. something like this <a href='
http://www.dailymotion.com/relevance/search/leah%2Bdizon/video/x18dj1_leah-dizon'>click</a >.
i noticed that txt files loaded into flash seem to break at any
point where more unusual punctuation characters are
included.
This is such a great solution--thanks so much for sharing. I'm having a problem with the name of my collapsible panels (which operate similarly to Tabbed Panels, as far as I understand). Basically I am trying to use anchor tags and my goal is to create a hyperlink on page 1 that points to content within a spry widget on page 2 of my webpage. I obviously want the spry widget on page 2 to open up on click and the user to be taken to where my anchor tag is located. In this thread (http://forums.adobe.com/message/209107#209107), Mr. Celic seems to indicate using something like this:
<a href="#anchorname" onclick="TabbedPanels1.showPanel(2);">
My exact code is like this: <a href="pagetwo.html#myanchortag" onclick="CollapsiblePanel1.open();">content here</a>
The good news is that this works, but my problem is that page 1 of my website also has a CollapsiblePanel1 so when I click on the link above, CollapsiblePanel1 on page 1 opens, not the CollapsiblePanel1 on page 2 of my site. I went into page 2 and clicked on "CollapsiblePanel1" and in the "Properties" panel renamed it to "CollapsiblePanel11" then changed my code to
<a href="pagetwo.html#myanchortag" onclick="CollapsiblePanel11.open();">content here</a>
but that didn't do a thing! I'm super stuck and don't know how else to rename the collapsible panels or how to get it to work.
One thing I can't figure out from the original solution (<a href="#" onclick="TabbedPanels1.showPanel(2);">) is what is "showPanel(2)"? Where did she get this from/where can I find the equivalent for my collapsible panel spry? This could be where I'm going wrong.
Any thoughts would be greatly appreciated.
Thanks so much! Catherine
Similar Messages
-
File Download not working for anchor tags
Hello,
I've encountered a bug with the 4.1.31 version of Tomcat. Apparently, when
I use an anchor tag for a file, and I click on the link, it does not show the
file download message "Do you want to open or save this file?" with the open
and save options. Instead, it displays the file in the browser. I know you
could normally save this information from the browser to a file, but I need it
to show the download message because it's easier for users to save their
file. I'm using Internet Explorer version 6, SP2. I've also tried setting
the "Confirm open after download" check box for file types to no avail. It
use to work in Tomcat 4.1.18.
Any help would be appreciated.Can anyone pls. help me ? I tried all options from disbling firewall to uninstalling Bonjour.. But nothing works. Had I known that Apple makes such worst software I would never have bought iPhone !!!! Apple really *****!!!!!!!
-
Checking .txt file with valid XML tags
hey guys,
I've a .txt file which conatins info with XML tags. I've to check whether the file contains valid tags or not!
a tag should start with "<" and end with ">", there shouldn't be space between characters after "<" e.g.
a tag should be like "<name>" or "</name>" not "< name>" or "< /name>" nor "<name" or "</name"nor "name>" or "/name>"Here is an example of a well formed XML document:
<root>
Some text <nextTag> more text <secondTag> stuff </secondTag> </nextTag> more text again
</root>Here is an example of XML .txt file:
<students >
<student>
<name> John </name>
<name> Doe </name>
<address> 98 Pine St.</address>
</stdnt>
</students>I also have to make sure that no text appears before and after the root tag! Please help me, i'm trying to figure out but my alogrithm just doesn't work! Thanks in advance!!!What's the purpose of those requirements? If you
wanted to check whether the file was well-formed XML
then you would just need to run it through an XML
parser. But some of the things you plan to reject are
actually well-formed XML. I don't see the point of
that.basically, it's my assignment. In the assignment our task is to check the .txt files to make sure that all XML tags are valid. The problems i mentioned in my first post, i've figured those out, eventually. There're few other things which i've to also make sure for example no text appearing before and after the root tag
Can someone please tell me how i can check following cases:
text<root> or </root> text (both are invalid XML files) -
Open linked files in new page? Anchor tags?
I'm making a website for a friend's Pilates studio in iWeb 2008. She has her class schedules as PDF documents, which I've linked in, but there appears to be no way to choose for the PDF to open in a new window (unlike web page links, which come with a little box to check if you want to open them in a new window).
Also, her husband has requested anchor tags on some of the pages.
My questions: Is there a way to do this in iWeb 2008? Could I do it if I could access the code? Is there a way to access the code for a specific page?
Any help would be greatly appreciated!
GwenWelcome to the Apple Discussions. Anchors are not supported in iWeb (send a feature request to Apple via http://www.apple.com/feedback/iweb.html).
As far as having pdfs open in a new window you have to first upload the pdf file to the server and then use the hyperlink to a external page and enter the URL to the file on the server. I have a couple of examples on this demo page: LinkTestPage . The links are on the right side of the page and the URL used is listed (for a MMe account).
OT -
How to open a doc file using jsp Anchor tag
when i am trying to open a doc file using a jsp it is opening with out proper alignment.
how to open a doc file with proper alignment using Anchor Tag in JSp Page
Hello!
Does some one of you had open a MS word file (.doc) in Java search for a token like [aToken] replace it with another text and then feed it to a stream of save it?
I want to build a servlet to open a well formatted and rich on media (images) ms word document search for tokens and replace them with information form a web form.
Any Ideas?
Thank you in advanced. -
Apply a hyperlink to an anchor tag in Muse to a file created in Edge Animate?
Is it possible to apply a hyperlink to an anchor tag in Muse to a file created in Edge Animate?
thanksHI Eric,
Found a discussion thread that could help you.
Re: anchor link to muse
Thanks,
Preran -
Tagging words through a .txt file
Hi all,
We have been looking all over the internet for a script that we can use/buy. But cannot find it anywhere.
We have a rather large document and an external word list in a .txt file. This list contains words that need to be in the index at the end of the document.
Instead of filling in a couple of hundred words and linking them by hand, it would be great if there is a script that can handle this.
We have looked in to Indexmatic2 (http://www.indiscripts.com/post/2011/07/indexmatic-2-public-release-and-user-s-guide ), but this script generates its own index list and does not create links to the original words in the document.
We have found a script that can create index links from colored words in the document.
So does anyone know if there is a script floating around that can load an external .txt wordlist and either color or add a character style to words in a document?
Or even a script that does what we need in 1 go?
ThanksThedesmodus,
there is a script by Martin Fischer at www.hilfdirselbst.ch (a swizz-german website) that could fit your needs. You can download it if you choose to be a premium member which requires a small fee. It's written for InDesign CS3 but it should run with CS4 or CS5. I tested it with a small list of words and it ran fine with InDesign CS5.
http://indesign.hilfdirselbst.ch/text/indexeintrage-mit-unterstichworten-uber-eine-konkord anzdatei-erzeugen.html
If you prefer a Google translation:
http://translate.google.de/translate?hl=de&sl=de&tl=en&u=http%3A%2F%2Findesign.hilfdirselb st.ch%2Ftext%2Findexeintrage-mit-unterstichworten-uber-eine-konkordanzdatei-erzeugen.html
Uwe -
Problems getting elements to work in a txt file within Flash.
Hello! I'm working on my band's new website and have been
searching many hours for answers to some problems I'm having with
txt files referenced as HTML in Flash.
Our site is
http://moumusic.com.
One of the problems is having an image as a link. For
instance, I have a photo and try to link a website to it:
quote:
<a href="
http://cdbaby.com/cd/motuniverse"
target="_blank"><img src="images/cdbaby.gif" width="100"
height="100"></a>
It works when loaded as an HTML file, but not when viewed in
the Flash site. The text file for this is at
http://moumusic.com/moualbum.txt.
The page comes up when you click the "MoU's First CD" link on
moumusic.com.
Next, I can't link to external media files. For instance, I
tried inserting the code:
quote:
<a href="
http://fusco-moore.com/videos/SongforCliff-2.wmv">Song
for Cliff Video Part 2</a>
. You can click the text (while viewing it as
part of the Flash site), but nothing happens. You can even copy the
shortcut, but you can't use the link properly.
Last, I want to put a PayPal Buy It Now button on one of the
pages. The link is pretty long:
quote:
<a
href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=producer%40wcjm%2ecom&it em_name=%22Masters%20of%20the%20Universe%22%20CD%20by%20MoU&amount=10%2e00&no_shipping=2&n o_note=1¤cy_code=USD&lc=US&bn=PP%2dBuyNowBF&charset=UTF%2d8">Buy
Now!</a>
. I heard that there's a 128 character limit for
links in Flash. Is there any way around this?
What about forms? PayPal has the option of doing a form for a
shopping cart. Flash won't even begin to recognize it when I just
drop the form code in there.
Well, thanks for the help in advance- hopefully this stuff
can be accomplished!
JimI assume you are using the Flash TextField object set to
render html.
First to understand is that the extent of html recognized is
limited and by
player version. That means you cannot use any HTML tag you
wish.
See
http://livedocs.macromedia.com/flash/8/main/00001459.html
for the
supported list in Flash Player 8
You might check "About making hypertext links out of embedded
media " as
well:
http://livedocs.macromedia.com/flash/8/main/00001477.html
Malformed html in a TextField can render any tag in the field
non
functional. Be sure the html in the TextField is validated.
I would assume the anchor tag in Flash text field would
follow the same
rules an anchor tag in HTML as to length of the query string.
Finally consider using Flash with a button and getURL for the
PayPal link.
http://livedocs.macromedia.com/flash/8/main/00001730.html
Lon Hosford
www.lonhosford.com
Flash, Actionscript and Flash Media Server examples:
http://flashexamples.hosfordusa.com
May many happy bits flow your way!
"wcjmproducer" <[email protected]> wrote in
message
news:[email protected]...
> Hello! I'm working on my band's new website and have
been searching many
> hours
> for answers to some problems I'm having with txt files
referenced as HTML
> in
> Flash.
>
> Our site is
http://moumusic.com.
>
> One of the problems is having an image as a link. For
instance, I have a
> photo and try to link a website to it:
>
>
quote:
<a href="
http://cdbaby.com/cd/motuniverse"
target="_blank"><img
> src="images/cdbaby.gif" width="100"
height="100"></a>
>
> It works when loaded as an HTML file, but not when
viewed in the Flash
> site.
> The text file for this is at
http://moumusic.com/moualbum.txt.
The page
> comes
> up when you click the "MoU's First CD" link on
moumusic.com.
>
> Next, I can't link to external media files. For
instance, I tried
> inserting
> the code:
quote:
<a
> href="
http://fusco-moore.com/videos/SongforCliff-2.wmv">Song
> for Cliff Video Part 2</a>
. You can click the text (while viewing it
> as
> part of the Flash site), but nothing happens. You can
even copy the
> shortcut,
> but you can't use the link properly.
>
> Last, I want to put a PayPal Buy It Now button on one of
the pages. The
> link
> is pretty long:
quote:
<a
>
href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=producer%40wcjm
>
%2ecom&item_name=%22Masters%20of%20the%20Universe%22%20CD%20by%20MoU&amount=10%2
>
e00&no_shipping=2&no_note=1¤cy_code=USD&lc=US&bn=PP%2dBuyNowBF&charset=UTF
> %2d8">Buy Now!</a>
. I heard that there's a 128 character limit for
> links
> in Flash. Is there any way around this?
>
> What about forms? PayPal has the option of doing a form
for a shopping
> cart.
> Flash won't even begin to recognize it when I just drop
the form code in
> there.
>
> Well, thanks for the help in advance- hopefully this
stuff can be
> accomplished!
>
> Jim
> -
CS5.5 Phonegap - Anchor Tags Don't Work
So I made a test Android app using the phonegap template and it seemed to work okay. Now I'm trying to add anchor tags to link a table of contents from the top to text found lower on the page like this:
<a href="#cq">Clinical Question</a>
<a id="cq">Clinical Question:</a>
But I get "ERROR LOADING PAGE" when testing in multi-view and web browser.
External links work just fine though like:
<a href ="http://www.adobe.com">Adobe</a><br>
I'm assuming it has something to do with how the page/site is saved, does anyone have a solution?GP Animations wrote:
So I made a test Android app using the phonegap template and it seemed to work okay. Now I'm trying to add anchor tags to link a table of contents from the top to text found lower on the page like this:
<a href="#cq">Clinical Question</a>
<a id="cq">Clinical Question:</a>
But I get "ERROR LOADING PAGE" when testing in multi-view and web browser.
That's correct. The jQuery Mobile framework uses IDs to load page blocks in multiple-page files. You cannot link to an ID within an individual page block. See this page in the jQuery Mobile documentation for a detailed explanation: http://jquerymobile.com/demos/1.0a4.1/#docs/pages/docs-pages.html. Confirmation that you can't do what you're trying to achieve is near the bottom of the page. -
I found that the when transforming PDF files into TXT files by Acrobat 9 Pro, the Acrobat will wrongly transform the sentences of the left hand side and right hand side paragraphs into one sentence, while the correct format should be the later sentence follows the former sentence in each paragraph.
An example PDF is : http://cardiovascres.oxfordjournals.org/content/cardiovascres/45/1/200.full.pdf
Is there any solution for this problem? Or should I use other software (or other version of Acrobat) to solve the problem? Thank you.PDF is not a word processor file format.
It has no "styles", "format", "layout", "columns", "rows", "tables", etc.
PDF writers paint the content to the canvas that is the PDF page.
Depending on what was used and how it operates this painting can be like a paint by numbers affair.
ISO 32000-1:2008, the ISO standard for PDF explains it all.
So, when exporting to text from your PDF the progression is left to right, top down.
Remember, PDF has no awareness of "columns". What we see is our construct not PDF's.
What you and I see as two columns with a specific read order is our imposition.
What is on the PDF page is simply a line of text characters.
That is how it is with all versions of Acrobat. Applications can only make use of what the file format supports eh.
What to do?
Master content in a logical hierarchy in the authoring file.
Always use the build-in Headings for Headings.
Use the built-in "table" feature.
Use a PDF writer process that is compliant with the ISO standard and that supports proper output of Tagged PDF.
A well-formed Tagged PDF will export properly.
Two key design considerations for Tagged PDF are:
(1) Support Accessible PDF
(2) Support Export of PDF page content.
What constitutes a "well-formed tagged PDF?"
This would be a PDF that is ISO 14289-1, PDF/UA-1 compliant.
Be well... -
Only writing Integer pixel array to a .txt file,or showing in Frame
Sir,
I want to write integer values (range:0 to 255) to a .txt file .Actually after manipulating a .jpeg/.gif image I have gotten a 2D pixel array and a 1D pixel array that can be easily shown in console but I want to write this pixel array into a .txt file. Using of writeInt() is not working. Actually after using this faction the created file contain information which is non-alphanumeric /alphanumeric characters......
following is error free the code: Plz. See only and only into the �class TestImage�and plz look after line marked by //�my_problem_to_be_resolved.�It is just few lines of code .I promise you will not be bothered.Plz��..
import java.awt.*;
import java.io.File;
import java.io.FileWriter;
import java.awt.image.*;
import java.io.*;
import java.util.*;
import javax.imageio.*;
import javax.imageio.stream.*;
import java.awt.image.Raster;
import java.awt.image.WritableRaster;
class Image {
protected int width,height;
// 'samples' stores the image pixel values.
protected int[][] samples;
// Constructor: Reads the image from the
// specified file name.
public Image(String filename)
throws Exception { read(filename); }
// Returns the pixel width of the image.
public int getWidth() { return width; }
// Returns the pixel height of the image.
public int getHeight() { return height; }
// Reads the image from the specified file
// name into the 'samples' array. Throws an
// exception if the image is stored in an
// unsupported file format (currently only
// .GIF, .JPG, and .PNG are supported by Sun).
public void read(String filename)
throws Exception {
// Extract the file name suffix.
String ext = filename.substring
(filename.indexOf('.')+1);
// Create a file object for the file name.
File fileImage = new File(filename);
// Get a list of ImageReaders that claim
// to be able to decode this image file
// based on the file name suffix.
Iterator imageReaders = ImageIO.
getImageReadersBySuffix(ext);
ImageReader imageReader;
// Grab the first ImageReader in the list.
if (imageReaders.hasNext())
imageReader = (ImageReader)
imageReaders.next();
// If we get here we cannot decode the image.
else throw new IIOException
("Unsupported image format");
// Create a file input stream object to
// read the image date.
FileImageInputStream imageInputStream =
new FileImageInputStream(fileImage);
// Tell the ImageReader object to read data
// from our file input stream object.
imageReader.setInput(imageInputStream);
// Get the width and height of the image.
width = imageReader.getWidth(0);
height = imageReader.getHeight(0);
// Read the image from the file input stream,
// and close the input stream when done.
BufferedImage bufImage =
imageReader.read(0);
imageInputStream.close();
// Get a raster object so we can extract the
// pixel data from the BufferedImage.
WritableRaster wRaster =
bufImage.getRaster();
// Create our 'samples' 2d-array.
samples = new int[height][width];
// Extract the image data into our 'samples'
// array.
for (int row = 0; row < height; row++)
for (int col = 0; col < width; col++)
samples[row][col] =
wRaster.getSample(col,row,0);
// Write the image stored in the 'samples'
// array to the specified file. The file name
// suffix should be a supported image file
// format (currently either .JPG or .PNG).
public void write(String filename)
throws Exception {
// Extract the file name suffix.
String ext = filename.substring
(filename.indexOf('.')+1);
// Create a file object for the file name.
File fileImage = new File(filename);
// Get a list of ImageWriters that claim to
// be able to encode images in the specified
// image file format based on the file name
// suffix.
Iterator imageWriters = ImageIO.
getImageWritersBySuffix(ext);
ImageWriter imageWriter;
// Grab the first ImageWriter in the list.
if (imageWriters.hasNext())
imageWriter = (ImageWriter)
imageWriters.next();
// If we get here we cannot encode the image.
else throw new IIOException
("Unsupported image format");
// Create a file output stream object to
// write the image data.
FileImageOutputStream imageOutputStream
= new FileImageOutputStream
(fileImage);
// Tell the ImageWriter to use our file
// output stream object.
imageWriter.setOutput
(imageOutputStream);
// The ImageWriter.write() method expects a
// BufferedImage. Convert our 'samples' array
// into a BufferedImage.
BufferedImage bufImage =
createBufferedImage();
// Encode the image to the output file.
imageWriter.write(bufImage);
imageOutputStream.close();
// Draws the image stored in the 'samples'
// array on the specified graphics context.
public void draw(Graphics gc,int x,int y){
BufferedImage bufImage =
createBufferedImage();
gc.drawImage(bufImage,x,y,null);
// Converts the 'samples' array into a
// BufferedImage object. Students do not have
// to understand how this works.
private BufferedImage
createBufferedImage() {
// Create a monochrome BufferedImage object.
BufferedImage bufImage = new
BufferedImage(width,height,
BufferedImage.TYPE_BYTE_GRAY);
// Create a WriteableRaster object so we can
// put sample data into the BufferedImage
// object's raster.
WritableRaster wRaster =
bufImage.getRaster();
// Copy the 'samples' data into the
// BufferedImage object's raster.
for (int row = 0; row < height; row++)
for (int col = 0; col < width; col++)
wRaster.setSample
(col,row,0,samples[row][col]);
// Return the newly created BufferedImage.
return bufImage;
} // End of Class Image
class TestImage {
public static void main(String args[])
throws Exception {
// Create a frame to display the image.
Frame frame = new Frame("Test Image");
frame.setSize(1024,768);
frame.setVisible(true);
Graphics gc = frame.getGraphics();
try {
// Read the image from the file.
Image img = new Image("C:/lilies.jpg");
int height=img.getHeight();
int width =img.getWidth();
//�my_problem_to_be_resolved.�
File image_object_arry=new File("C:/Image_array.txt");
FileOutputStream image_object_arry_stream= new FileOutputStream(image_object_arry);
DataOutputStream int_image_object_arry_stream=new DataOutputStream(image_object_arry_stream);
//Conversion of two dimensional pixel arrry into one dimensional array
int intPixels1[] = new int [height * width];
int k = 0;
for(int i = 0; i <= width; i++) {
for(int j = 0; j <= height; j++) {
intPixels1[k] = img.samples[i][j];
int_image_object_arry_stream.writeInt((int) intPixels1[k]);
// System.out.println(intPixels1[k]);
k = k+1;
import java.awt.*;
import java.io.File;
import java.io.FileWriter;
import java.awt.image.*;
import java.io.*;
import java.util.*;
import javax.imageio.*;
import javax.imageio.stream.*;
import java.awt.image.Raster;
import java.awt.image.WritableRaster;
class Image {
protected int width,height;
// 'samples' stores the image pixel values.
protected int[][] samples;
// Constructor: Reads the image from the
// specified file name.
public Image(String filename)
throws Exception { read(filename); }
// Returns the pixel width of the image.
public int getWidth() { return width; }
// Returns the pixel height of the image.
public int getHeight() { return height; }
// Reads the image from the specified file
// name into the 'samples' array. Throws an
// exception if the image is stored in an
// unsupported file format (currently only
// .GIF, .JPG, and .PNG are supported by Sun).
public void read(String filename)
throws Exception {
// Extract the file name suffix.
String ext = filename.substring
(filename.indexOf('.')+1);
// Create a file object for the file name.
File fileImage = new File(filename);
// Get a list of ImageReaders that claim
// to be able to decode this image file
// based on the file name suffix.
Iterator imageReaders = ImageIO.
getImageReadersBySuffix(ext);
ImageReader imageReader;
// Grab the first ImageReader in the list.
if (imageReaders.hasNext())
imageReader = (ImageReader)
imageReaders.next();
// If we get here we cannot decode the image.
else throw new IIOException
("Unsupported image format");
// Create a file input stream object to
// read the image date.
FileImageInputStream imageInputStream =
new FileImageInputStream(fileImage);
// Tell the ImageReader object to read data
// from our file input stream object.
imageReader.setInput(imageInputStream);
// Get the width and height of the image.
width = imageReader.getWidth(0);
height = imageReader.getHeight(0);
// Read the image from the file input stream,
// and close the input stream when done.
BufferedImage bufImage =
imageReader.read(0);
imageInputStream.close();
// Get a raster object so we can extract the
// pixel data from the BufferedImage.
WritableRaster wRaster =
bufImage.getRaster();
// Create our 'samples' 2d-array.
samples = new int[height][width];
// Extract the image data into our 'samples'
// array.
for (int row = 0; row < height; row++)
for (int col = 0; col < width; col++)
samples[row][col] =
wRaster.getSample(col,row,0);
// Write the image stored in the 'samples'
// array to the specified file. The file name
// suffix should be a supported image file
// format (currently either .JPG or .PNG).
public void write(String filename)
throws Exception {
// Extract the file name suffix.
String ext = filename.substring
(filename.indexOf('.')+1);
// Create a file object for the file name.
File fileImage = new File(filename);
// Get a list of ImageWriters that claim to
// be able to encode images in the specified
// image file format based on the file name
// suffix.
Iterator imageWriters = ImageIO.
getImageWritersBySuffix(ext);
ImageWriter imageWriter;
// Grab the first ImageWriter in the list.
if (imageWriters.hasNext())
imageWriter = (ImageWriter)
imageWriters.next();
// If we get here we cannot encode the image.
else throw new IIOException
("Unsupported image format");
// Create a file output stream object to
// write the image data.
FileImageOutputStream imageOutputStream
= new FileImageOutputStream
(fileImage);
// Tell the ImageWriter to use our file
// output stream object.
imageWriter.setOutput
(imageOutputStream);
// The ImageWriter.write() method expects a
// BufferedImage. Convert our 'samples' array
// into a BufferedImage.
BufferedImage bufImage =
createBufferedImage();
// Encode the image to the output file.
imageWriter.write(bufImage);
imageOutputStream.close();
// Draws the image stored in the 'samples'
// array on the specified graphics context.
public void draw(Graphics gc,int x,int y){
BufferedImage bufImage =
createBufferedImage();
gc.drawImage(bufImage,x,y,null);
// Converts the 'samples' array into a
// BufferedImage object. Students do not have
// to understand how this works.
private BufferedImage
createBufferedImage() {
// Create a monochrome BufferedImage object.
BufferedImage bufImage = new
BufferedImage(width,height,
BufferedImage.TYPE_BYTE_GRAY);
// Create a WriteableRaster object so we can
// put sample data into the BufferedImage
// object's raster.
WritableRaster wRaster =
bufImage.getRaster();
// Copy the 'samples' data into the
// BufferedImage object's raster.
for (int row = 0; row < height; row++)
for (int col = 0; col < width; col++)
wRaster.setSample
(col,row,0,samples[row][col]);
// Return the newly created BufferedImage.
return bufImage;
} // End of Class Image
/*class TestImage {
public static void main(String args[])
throws Exception {
// Create a frame to display the image.
Frame frame = new Frame("Test Image");
frame.setSize(1024,768);
frame.setVisible(true);
Graphics gc = frame.getGraphics();
try {
// Read the image from the file.
Image img = new Image("C:/srk.jpg");
// Display the image.
img.draw(gc,10,40);
// Flip the image upside down
//img.flipX();
// Display the flipped image.
img.draw(gc,20+img.getWidth(),40);
// Write the new image to a file
img.write("HorseNew.jpg");
} catch (Exception e) {
System.out.println
("Exception in main() "+e.toString());
class TestImage {
public static void main(String args[])
throws Exception {
// Create a frame to display the image.
Frame frame = new Frame("Test Image");
frame.setSize(1024,768);
frame.setVisible(true);
Graphics gc = frame.getGraphics();
try {
// Read the image from the file.
Image img = new Image("C:/lilies.jpg");
int height=img.getHeight();
int width =img.getWidth();
File image_object_arry=new File("C:/Image_array.txt");
FileOutputStream image_object_arry_stream=new FileOutputStream(image_object_arry);
DataOutputStream int_image_object_arry_stream=new DataOutputStream(image_object_arry_stream);
//Conversion of two dimensional pixel arrry into one dimensional array
int intPixels1[] = new int [height * width];
int k = 0;
for(int i = 0; i <= width; i++) {
for(int j = 0; j <= height; j++) {
intPixels1[k] = img.samples[i][j];
int_image_object_arry_stream.writeInt((int) intPixels1[k]);
// System.out.println(intPixels1[k]);
k = k+1;
catch (Exception e) {
System.out.println("Exception in main() "+e.toString());
catch (Exception e) {
System.out.println("Exception in main() "+e.toString());
}My Friend, you need to put your code within CODE tags
And I suspect if anyone would go through your code this way.
Assuming your problem is to write pixel values to a file you may use this,
try{
// Create file
FileWriter fstream = new FileWriter("out.txt");
BufferedWriter out = new BufferedWriter(fstream);
for(int i =0; pixels.length() ; i++)
out.write(pixels[i]+"\t");
//Close the output stream
out.close();
}catch (Exception e){//Catch exception if any
System.err.println("Error: " + e.getMessage());
} -
External loading .txt file can I link URL in txt file?
So, I can't remember and it's not working. I basically want to add this to my text file:
<a href="http://www.gap.com" target="_blank">Go here</a>
which obviously doesn't work. what's the easiest way add HTML tags to a TXT file without changing the way the files being loaded too much?
var filename:String="text/home.txt";
var loaderText:URLLoader = new URLLoader();
var myRequest:URLRequest=new URLRequest(filename);
function loadFile(filename:String):void {
myRequest.url=filename;
loaderText.load(myRequest);
loadFile("text/press.txt");textfield_InstanceName.htmlText = which for me would be: content_mc.pageText_txt.htmlText=pageText; in the complete event.
-
Scanning .txt file and outputting results?
Greetings Everyone. My employer has charged me with a rather
confusing task. Basically I need to scan a .txt file and retrieve
some information from it. Here is a little background on the file
itself.
This is a feed file containing the information for employees
such as name, department, employement status etc...Zeros are used
in place of spaces in this file. What I am charged with is
retrieving the employment status and name for every single person
in the file (60,000+).
I need to write a coldfusion script that can do the
following.
1. Scan a .txt file that is sent to me every night and look
for the 99th character on each line of the .txt file
2. If the 99th character is a 'T' I need to pull characters
'10-50' (which contain the name for that person).
3. Output the results of the scan to a coldfusion page
displaying the individuals' names.
If anyone out there can point me in the right direction I
would be very grateful. I've been looking for websites on this
topic but I have been unsucessful so far. Should I post this in the
advanced section of the cf forums? Once again, thank you for any
help you can give me.I guarantee you can do this! And it shouldnt be to hard so
you can breath a sigh of relief... :)
I would use <cffile action="read" file="filepath/name.txt"
variable="fileContents">
Then you should be able to do something like <cfset
fileArray = ListToArray(fileContents, "#CHR(13)##CHR(10)#")>
Now you have an array so you can loop through and try
something like the following...
<cfloop index="i" from="1" to="#ArrayLen(fileArray)#"
step="1">
<cfif fileArray
NEQ "">
<!--- Find 99th Char --->
<cfset 99thchar = Mid(fileArray, 99, 1)>
<cfif 99thchar EQ "T">
<!--- Get Name --->
<cfset empName = Mid(fileArray
, 10, 40)>
<!--- Change 0's to Spaces--->
<cfset empName = Replace(empName, "0", "#CHR(32)#")>
<cfoutput>#empName#</cfoutput><br />
</cfif>
</cfif>
</cfloop>
That should be close to what you could use... You may have to
tweak it a bit... now if it is going though 60000+ records this may
take a while...lol You might have to use the cfsetting tag to
extend the normal request timeout..
Hope this helps! -
Method call in html anchor tag
I have read about how to place a hyperlink in JTable cell in other threads. i have a method called Details() which has a mouse pressed event which responds on left click on the first column cells of my JTable. then i get the column and row positions and open up a JDialog.
so Now i have to show the first column cells as hyperlinks(underlined and handcursor on visit).
i have done something like this,
setText( "<html><a href=\"\">" + (String)(value==null?"":value ) +"</a></html>"); this makes the cell values blue colored as well as underlined as soon as the table is loaded.
how can i make it behave like a hyperlink ? that is colored, underlined and handcursor only when mouse is placed on it.
Can i have the call to Details() method inside the anchor tag which i have shown above?
Thanks,Well what do you know, I was doing everything correctly.
Firefox does not allow local file links from a web page.
http://kb.mozillazine.org/Firefox_:_Issues_:_Links_to_Local_Pages_Don%27t_Work -
Hyperlink set to open new window & jump to anchor tag, doesn't jump
I am generating Flash Help output in RH7.
We have content hyperlinks that are set to open in a new window (target="_blank") and jump to an anchor tag in the destination topic (a href="newwindowtopic.htm#anchor")
This works fine if I compile the file as is.
However, we edit the whtopic.js topic in order to remove the "Show" link that appears when you open context sensitive topics. We do this by adding the following code at the end or the addShowButton function:
setRelStartPage("ourstartpage.htm");
show();
Replacing the Show link worked fine in RH5 and it works fine in RH7. However, in RH7 when we replace the "show" link to have the TOC load when all topics are called (not just the start page), the ability to open a new window AND jump to the anchor tag is no longer working. When you click the hyperlink the new page opens, but only to the top of the page, not to the bookmark (anchor). The anchor jump does work if the hyperlink is set to open in the current window in RH7.
The issue exists in IE7 and Firefox.
Any ideas?Hi there
Why are you editing the JavaScript file? Did you know that when generating FlashHelp you have an option to turn off the Show link?
Additionally there are ways to link to topics so the TOC is visible and synchronized. These are described at this link right here.
Cheers... Rick
Begin learning RoboHelp HTML 7 within the day - $24.95!
Click here for Adobe Authorized Captivate and RoboHelp HTML Training
Click here for the SorcerStone Blog
Click here for RoboHelp and Captivate eBooks
Maybe you are looking for
-
Hi all I have a dir that has a list of folders that are created using php that my customers upload to. the PHP creates a new folder using the system date on the days that they upload. (using this format yyyymmdd) What I am trying to do is loop thou t
-
My footage looks posterized in FCP playback
im using FCP 7 and have downloaded all the latest software updates. my footage looks normal when i play it back on my video camera, it's normal when i watch it on quicktime, and even when i export it as a quicktime from FCP. it's also normal when cap
-
Validate soap header in coldfusion
Hello, How can I validate soap header in cold fusion. Any example will be greatly appreciated. Thanks
-
App.Xaml cannot be edited in design view(Visual Studio 2012 for Window Store).
-
Facing issue while trying to disable automatic discovery of devices through Apple Bonjour
Hi All, I am facing issue while trying to disable automatic discovery of devices through Apple Bonjour. Background: Whenever our application is in running state, devices are automatically discovered if it connects to PC. We are using Apple Bonjour's