How to make BufferedReader out of StringBuffer
StringBuffer buffer = new StringBuffer("hello");
BufferedReader source= new BufferedReader(buffer);
gives me an error
.java
.\ListFiles.java:75: cannot resolve symbol
symbol : constructor BufferedReader (java.lang.StringBuffer)
location: class java.io.BufferedReader
BufferedReader source= new BufferedReader(buffer);
^
This is because the BufferedRead does takes a Reader of some description. A Reader tends to take an InputStream and the StringBuffer class does not extend any of these classes.
I think you may have a misconception of what a StringBuffer is. A StringBuffer is just a mutable String, it can be used for efficiency.
The BufferedReader is for reading from a blocking IO source. A single call to a BufferedReader reads a certain amount, in a text file its up to the end of line character, and when it reaches that point returns the result.
Hope this helps.
Similar Messages
-
How to make use out of Kernel Reader Software Rules??
Each of my agents have a Kernel Reader module loaded but there are only two software rules defined (rknrd105 & rknrd106). There are many other software rules available but I don't know how to make use out of them. How do I add them to the module?? Please assist.
Thanks in advance.
TonyEach of my agents have a Kernel Reader module loaded but there are only two software rules defined (rknrd105 & rknrd106). There are many other software rules available but I don't know how to make use out of them. How do I add them to the module?? Please assist.
Thanks in advance.
Tony -
How to make call out from XI to external applications??
Hi,
I have XI running on my system.
I want to know if there is any possibility to invoke
or to make call outs from XI to external applications
like java.If yes what is the procedure for that.
Thanks in advance
SunitaXI will need a triggering event to do this. That is, if you can send a message to XI, then using XI you can route the message to a Proxy and from the proxy (which could be a java proxy) you can make a call to a java program outside XI. But, basically, XI on its own will not make a call, but it needs a triggering message. So, you can configure a file adapter to send a triggering message from a file system to the intergration server, and configure routing rules so that the messages reaches a proxy.
Warm regards,
Venki. -
Does anyone know how to make SmallCaps out of a font in Muse?
I am using Palatino and would like to make SmallCaps and SmallCaps Italic.
Does anyone know how to do this in Muse?
Thank you for the help.Hi,
An update: Adobe Muse CC 2014.1 (released earlier today) includes support for self-hosted web fonts. To use a specific font in your Muse site, you will need to install the system font (properly licensed for desktop use) and provide the corresponding web font files (properly licensed for use on a website).
Give it a try and let us know if you need help or run into issues.
Abhishek -
How to make Document out of Node?
Hi!
I have the following problem. With Xalan I am converting a XML document into a SVG document. This SVG document I want to display with Batik (JSVGCanvas).
Xalan only returns the document root Node as org.w3c.dom.Node.
However, the Batik JSVGCanvas.setDocument method expects org.w3c.dom.Document
What is the best way to create a org.w3c.dom.Document out of a org.w3c.dom.Node?
Thanks a lot for any suggestions.Node node;
if(node.getNodeType==Node.DOCUMENT_NODE)
Document document=(Document)node; -
How to make in/out Port vis work with COM interface under different windows versions?
Hello!
I know that the accessHW is necessary for it, so I downlaoded the
this file from the homepage of NI, but there are always some problems
with it.
My program should get the the voltage impulse between
the pins DTR and RTS of a COM interface. After
I installed accessHW under winNT, the voltage between them changed
automatically from 0 mV to about 24 mV , and program
worked well . But this way does not work under Win98 and Win2000,
and this voltage is always 0 so that the device can not make any voltage
impulse.
Could someone give me a software solution for it? Thanks!
P.S:The version of the labview I use is 6.1.
LeYou shouldn't depend on a voltage difference between the tow pins unless you need something like 24 volts and not 24 millvolts. All of the signal lines are referenced to ground and the signal lines usually swing between -3 to -12 and +3 to +12 volts. If you truly saw a 24 millivolt difference between two signal leads, then all that means is that they are both at the same logic state. A difference of 24 millivolts is not much and has to do with the UART in your computer and not accessHW I believe though maybe what happened is that the difference is 24mv when both are logic "1" and less when logic "0" or vice versa. If your device requires power from the serial port, then what you'll have to do is control the signal lines in your program and I
would recomend VISA to do that instead of inport/outport. And check the voltage requirements of your device. If this is a device you designed, it should be designed for the lower voltages on new pc's and laptops. In other words, I would depend on 3 volt signals instead of 12. There are numerous references to either RS-232 or EIA-232 on the web. I think a review of the electrical specifications is needed. -
How to make a outer join dynamically
I need to make a a dynamic join based on column values ie I want to do the following for ex. IF a.column1='A' and a.column2='B' then my where clause should be a.job_num=b.job_num(+) and a.po_num=b.po_num(+)
ELSE my join caluse should be
a.po_num=b.po_num(+).
Has anyone ideas?.
I do not want to check conditions and concatenate the string to make the appropriate sqlIt doesn't necessarily have to be dynamic SQL.
begin
select column1, column2 into var1, var2 from table1 ;
if var1 = 'A' and var2 = 'B'
then
select more_columns into var_columns
from table2 a, table 3 b
where a.job_num=b.job_num(+) and a.po_num=b.po_num(+) ;
else
select more_columns into var_columns
from table2 a, table 3 b
where a.po_num = b.po_num(+). ;
end ; -
How to make image out of panel?
hi,
i have a JPanel object and i drawn something on this panel. it also contains somemore components. can anyone say how to create image (like .jpg) from what is getting displayed in my panel.
thankx in advance.Found this in the newgroups
If you are using Java 2D, you can create a JPEG image by using the
com.sun.image.codec.jpeg package. The code below creates a JPEG image and
saves it to a file.
public void save(BufferedImage destImage, String filename) {
try {
ByteArrayOutputStream boutstream = new ByteArrayOutputStream();
JPEGImageEncoder enc = JPEGCodec.createJPEGEncoder(boutstream);
enc.encode(destImage);
FileOutputStream fimage = new FileOutputStream(new File(filename));
boutstream.writeTo(fimage);
fimage.close();
} catch (Exception e) { }
The code snippet below shows how to crerate a BufferedImage:
BufferedImage bi = new BufferedImage((int)imWid,
(int)(imHt),
BufferedImage.TYPE_INT_RGB);
Graphics2D g2d = bi.createGraphics();
g2d.drawImage(img, dispTx,this);
img : Your image object.
dispTx: The Affine Transform.
You can use other drawImage()methods for drawing images.
Once the image is drawn, you can save it using the save() method. -
How to make links out of database info?
So I have a database of links and I want to make it so when
they are displayed on the page they are clickable links. Where do I
put the href tags?
Thanks!
heres the code for the page:Change this:
<td><?php echo $row_Recordset1['link'];
?></td>
To this:
<td><a href="<?php echo $row_Recordset1['link'];
?>"><?php echo
$row_Recordset1['link']; ?></a></td>
Brandon7777 wrote:
> So I have a database of links and I want to make it so
when they are
> displayed on the page they are clickable links. Where do
I put the
> href tags?
>
> Thanks!
>
> heres the code for the page:
>
> <?php require_once('../Connections/dbase.php'); ?>
> <?php
> if (!function_exists("GetSQLValueString")) {
> function GetSQLValueString($theValue, $theType,
$theDefinedValue = "",
> $theNotDefinedValue = "")
> {
> $theValue = get_magic_quotes_gpc() ?
stripslashes($theValue) :
> $theValue;
>
> $theValue = function_exists("mysql_real_escape_string")
> mysql_real_escape_string($theValue) :
mysql_escape_string($theValue);
>
> switch ($theType) {
> case "text":
> $theValue = ($theValue != "") ? "'" . $theValue . "'" :
"NULL";
> break;
> case "long":
> case "int":
> $theValue = ($theValue != "") ? intval($theValue) :
"NULL";
> break;
> case "double":
> $theValue = ($theValue != "") ? "'" .
doubleval($theValue) .
> "'" : "NULL";
> break;
> case "date":
> $theValue = ($theValue != "") ? "'" . $theValue . "'" :
"NULL";
> break;
> case "defined":
> $theValue = ($theValue != "") ? $theDefinedValue :
> $theNotDefinedValue; break;
> }
> return $theValue;
> }
> }
>
> mysql_select_db($database_dbase, $dbase);
> $query_Recordset1 = "SELECT links.link,
links.`description` FROM
> links"; $Recordset1 = mysql_query($query_Recordset1,
$dbase) or
> die(mysql_error()); $row_Recordset1 =
mysql_fetch_assoc($Recordset1);
> $totalRows_Recordset1 = mysql_num_rows($Recordset1);
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
> "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="
http://www.w3.org/1999/xhtml"
><!-- InstanceBegin
> template="/Templates/index.dwt"
codeOutsideHTMLIsLocked="false" -->
> <head>
> <!-- InstanceBeginEditable name="doctitle" -->
> <title>Something in blue - Web design by Giant
Systems</title>
> <!-- InstanceEndEditable -->
>
> <meta http-equiv="Content-Type"
content="text/html;charset=utf-8" />
> <style type="text/css">
> <!--
> @import url("../Something_in_Blue/defaultblue.css");
> .style1 {
> font-size: 16px
> }
> .style2 {font-size: smaller}
> .style3 {font-size: xx-small}
> -->
> </style>
> <!-- InstanceBeginEditable name="head" --><!--
InstanceEndEditable
> --><!-- InstanceParam name="OptionalRegion1"
type="boolean"
> value="true" --> </head>
>
>
>
>
> <body>
> <div>
> <div class="top">
>
> <div class="header">
>
> <div class="left style1"> <span
class="style2">Franco-American
> Oral History Archives</span></div>
>
> <div class="right">
> <div>
> <p><img src="../orbs.jpg" width="168"
height="64" /></p>
> </div>
> </div>
>
> </div>
>
> </div>
>
> <div class="container">
>
> <div class="navigation"><a href="home.php"
title="Contact">HOME</a><a
> href="archives.php"
title="Home">ARCHIVES</a><a href="about.php"
> title="Archives">ABOUT</a><a
href="links.php"
> title="About">LINKS</a><a
href="sponsors.php"
> title="Links">SPONSORS</a><a
href="contact.php"
> title="Contact">CONTACT</a> <div
> class="clearer"><span></span></div>
</div>
>
> <div class="main">
> <div class="content">
>
> <h1><!-- InstanceBeginEditable
name="EditRegion5" -->Links<!--
> InstanceEndEditable --></h1>
> <!-- InstanceBeginEditable name="EditRegion4" -->
> <table width="467" height="59" border="0">
> <tr>
> <td width="319" height="14"> </td>
> <td width="138"> </td>
> </tr>
> <?php do { ?>
> <tr>
> <td><?php echo $row_Recordset1['description'];
?></td>
> <td><?php echo $row_Recordset1['link'];
?></td>
> </tr>
> <?php } while ($row_Recordset1 =
> mysql_fetch_assoc($Recordset1));
>>
> </table>
> <!-- InstanceEndEditable -->
> <p> </p>
> <p> </p>
> <p></p>
> <p> </p>
> </div>
>
> <div class="sidenav">
> <h2>Language Selection </h2>
> <p> <a href="home.php">English
</a></p>
> <p><a href="../FR
files/homeFR.php">Français</a></p>
> <ul>
> <li></li><li></li>
> <li></li>
> <li></li>
> <li></li>
> </ul>
>
> <h2>Archives</h2>
> <p><a href="franco.php">Franco
American</a></p>
> <p><a
href="acadian.php">Acadian</a></p>
> <p><a
href="quebecian.php">Quebecian</a></p>
> <ul><li></li>
> <li></li>
> </ul>
>
> <h2>Contact info</h2>
> <p>Click <a
href="contact.php">here</a></p>
> <p> </p>
> <ul><li></li>
> <li></li>
> <li></li>
> <li></li>
> </ul>
> <p><br />
> </p>
> </div>
>
> <div
class="clearer"><span></span></div>
>
> </div>
>
> <div class="footer">© 2008 Brandon Chase
and UMaine Franco
> American Centre. All Rights Reserved.</div>
> </div>
>
>
>
>
> </div>
> </body>
> <!-- InstanceEnd --></html>
> <?php
> mysql_free_result($Recordset1); -
How to make DBL out of 8 chars?
I have a set of characters which represents binary data.
Every 8 characters meant to be 1 DBL number. How to convert 8 chars to 1 DBL?
Message Edited by jonni on 08-08-2006 08:08 AMFree Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be! -
Wonder how to make sense out of this!!!
here is my problem,
I'm a newbie an i have a program called Process who calls IUBank and Regist and Regist is calling RegisBankAccount and i'm having problem with my packages, dont know what should be the order , i`ve try all of them and it`s still not working i guess maybe it`s a programmation problem or just an import problem...I spent too much time now my brain is about to explose can someone please help!!!compiling is not a problem its when im trying to run it it says java applet started and then nothing but a purple square
-
I need to know how to make greyed out some songs turn bold. I have tried from my itunes library to my ipod but it still wont work. Can anyone help?
Try:
- Reset the iOS device. Nothing will be lost
Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
least ten seconds, until the Apple logo appears.
- Unsync all music and resync
- Reset all settings
Go to Settings > General > Reset and tap Reset All Settings.
All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
- Restore from backup. See:
iOS: How to back up
- Restore to factory settings/new iOS device. -
How to make it repleatedly printed out by using timer??
Dear Friends:
I have following code to run, When I press R to repeat println, only 1 line print out,
But I hope to make it continueously print out.
How to make it repleatedly printed out until I press CTRL + C key ??
Thyanks
import java.util.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
public class CertainAndRepeatTime{
public static void main(String[] args) throws IOException{
int delay = 1;
Timer timer = new Timer();
ActionListener actionListener = new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
System.out.println("Hello World Timer");
System.out.println("What do you want (Certain time or Repeat time)?");
System.out.print("Please enter \'C\' or \'R\' for that: ");
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String ans = in.readLine();
System.out.print("Please enter ans=" + ans + " IsTrue= " + (ans.equals("R") || ans.equals("r")) +"\n");
if (ans.equals("C") || ans.equals("c")){
//System.out.println("This line is printed only once start...");
timer.schedule(new TimerTask(){
public void run(){
System.out.println("This line is printed only once.");
},delay,1);
else if(ans.equals("r") || ans.equals("R")){
timer.schedule(new TimerTask(){
public void run(){
System.out.println("This line is printed repeatedly.");
},delay, 1000);
else{
System.out.println("Invalid Entry.");
System.exit(0);
System.exit(0);
}The Timer is working fine, but because it runs in another Thread, your program is ending before the Timer can repeat.
The simplest way to make your program wait until it is force-quitted as you describe would be to make an infinite loop (although this isn't very good practice), like this:
else if(ans.equals("r") || ans.equals("R")){
timer.schedule(new TimerTask(){
public void run(){
System.out.println("This line is printed repeatedly.");
},delay, 1000);
while(true){} //This will make your main thread hang.
}A better way, though, would be to listen again with your System.in reader until they enter a letter that means quit. -
I cannot figure out how to make the text larger in a received email. The finger method doesn't work and I can find no tool bar as I can for composing emails. I can find nothing in settings. Please help and thank you in advance.
Hi there,
Download a piece of software called TinkerTool - that might just solve your problem. I have used it myself to change the system fonts on my iMac. It is software and not an app.
Good wishes,
John. -
Something keeps trying to download on my mac and I don't know what it is. It is not in the apple store and just comes out nowhere and request for my password to download something and I don't know what it is. How to make this stop? It pops up every single day.
Erica,
I can, with 99.99% certainty, tell you that you are absolutely right in not wanting to download or install this "Helper," whatever it is (but we can be equally certain it would not "help" anything).
I cannot comment as to Oglethorpe's recommendation of 'adwaremedic'; I am unfamiliar with it. His links to the Apple discussion and support pages warrant your time and attention.
It might be really simple -- Trying looking in your Downloads folder, trash anything that you don't know with certainty is something you want to keep, and then Secure Empty your Trash. Then remove the AdBlock extension, LastPass, and Web of Trust extensions to Safari and re-boot. If the issue goes away, still be extraordinarily careful in the future.
Unfortunately, it's probably not going to be that simple to get rid of, in which case I'd then try the line by line editing in HT203987.
I have no further suggestions (other than a complete wipe and re-install...but that's a pain because trying to restore from Time Machine would simply ... restore the Mal).
For the rest of us, please post when you find a solution.
Best.
BPW
(Also, try to edit your second post -- black out your last name on the screenshot and re-post it for others)
Maybe you are looking for
-
used easy transfer both machines are on a domain both are the same user yet i get an error message that says " Windows Easy transfer can't log onto your domain" Your new computer might not be connected to the domain. Tried via the network same messag
-
HT5239 Where can I get Apple FIPS Role guide for user so that I can use the APIs from my application
I am trying to use Apple's FIPS certified crypto library's crypto APIs in my application to do the crypto operations. For that I was asked to refer the "Role Guide : User" in the nist document. But I couldn't find the same. Can I know where I can dow
-
How to get iMessage on an older iOS version?
my friend is running iOS 4.3 and she wants to use iMessage, not any other third party app like iMessage, and without having to update because she doesn't have enough free space for the latest update. I have read in places that you can use iMessage on
-
Problem releasing workbench transports
We had created a number of changelists in our workbench and are trying to release these to transport them into out test system. When we release the transports which are created without issue in the development workbench we get the following message:
-
Viewing all thumbnails in a folder?
I want to be able to look at all the thumbnails of images in a folder which in itself contains several sub-folders, rather than having to go into each subfolder to view the images. Is this possible? Elements 11.