27 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for samson.dadson.3_1

the problem I have here is: when I input an integer it works fine, but when i input any other thing, it doesn't give me a chance to input again when the loop iterates, it just keeps printing "error type the right thing" to the screen even though "cin var" …

Member Avatar for samson.dadson.3_1
0
2K
Member Avatar for moaz.amin.37

import java.io.*; class ConsoleInput{ public static void main(String ss[]) throws IOException{ InputStreamReader isr=new InputStreamReader(System.in); BufferedReader br=new BufferedReader(isr); char c=' '; System.out.println("Enter Characters And q to Quiet"); do{ c=(char)br.read(); System.out.println(c); }while(c != 'q'); } } in upper code this line `c=(char)br.read();` get string from user at this point user enter some …

Member Avatar for JamesCherrill
0
263
Member Avatar for thekilon

I have this code. Its not the entire code because its a Blender addon with many lines that are unrelated to sockets so I give here only the part that deals with the sockets which I kept isolated from the rest of the program. def create_thread(): global threadSocket,listening threadSocket = …

Member Avatar for thekilon
0
2K
Member Avatar for Auroch

Hi! I'm trying to count the number of occurrences of each word in a text file. But program put in the file the first symbol of inputed word only (line 34) and don't enter in the for-statement (line 51). What should I serach for in my code in order to …

Member Avatar for Auroch
0
252
Member Avatar for murali2489

Hi All, I have come across Read and write method from InputStream and outputstream but im finding it hard to understand the logic behind it. Below is a simple example which reads a jar file from input stream and writes it to output stream. Please explain the logic on how …

Member Avatar for JamesCherrill
0
305
Member Avatar for CoilFyzx

Oh boy They ust be tired of me now. My trouble: I have two ArrayLists of custom classes. ``ArrayList<Subject>` **a**` ``ArrayList<Student>` **b**` Within those custom classes are other custom classes which themselves have primitive data types as well as an ArrayList of other custom classes. It's a big circus going …

Member Avatar for JamesCherrill
0
562
Member Avatar for abra_ka_dabra

I am using the following code to write to the file out1.txt: try{ FileWriter fostream = new FileWriter("out1.txt"); BufferedWriter out = new BufferedWriter(fostream); out.write("jlsdfjdlsfhsdkjf"); out.close(); }catch (Exception e){ System.err.println("Error: " + e.getMessage()); } Now i want to write to multiple files in the same code (let us say 2 files). …

Member Avatar for JamesCherrill
0
6K
Member Avatar for natehome

I'm working on a music streaming website for iPads and iPhones the website is programmed mostly with php and html. The website uses the website layout iwebkit (http://snippetspace.com/portfolio/iwebkit/). My question is how do I make box appear at the bottom of the screen that is always on the screen even …

Member Avatar for natehome
0
343
Member Avatar for sciwizeh

Hello, In trying to port some Java code to C++ I'm disliking the std::stream's lack of copy constructors. I know exactly what the problem is, but I don't know what I can do about it. I have a dangling reference to a stream as a member variable of a class. …

Member Avatar for vijayan121
0
2K
Member Avatar for jackshannon4

std::string s = "65//3"; std::istringstream indexBlock(s); for (int i = 0; i < 2; i++) { int index = 0; indexBlock >> index; std::cout << index << std::endl; } I would expect the output of the cout to be: output: 65 3 as I thought the stream iterates through the …

Member Avatar for jackshannon4
0
368
Member Avatar for sapure
Member Avatar for sapure
0
244
Member Avatar for sapure

public class BufferedReader { public static void main(String[] args) throws IOException { char c; BufferedReader sen = new BufferedReader (new InputStreamReader(System.in)); **// ERROR** System.out.println("Enter characters, 'q' to quit"); // read characters from the console while(c != 'q') { c = (char) sen.read(); **// ERROR** System.out.print(c); } } } I don't …

Member Avatar for NormR1
0
193
Member Avatar for borchu

Hello everyone, I have question about how AudioTrack instance should be used for streaming applications. Below my code example and some brief explation about code ... /* some work before */ InputStream in = client.getInputStream(); AudioTrack output_stream = new AudioTrack(AudioManager.STREAM_MUSIC, 8000, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_8BIT, 8192, AudioTrack.MODE_STREAM); byte[] buffer = new byte[8192]; …

Member Avatar for borchu
0
520
Member Avatar for balagod

In below code using i try to upload multiple files to remote URL. but only 1 file data only i am receiving. please help any one to resolve issue. Remotepage.php i am not getting sign,cheque file details [CODE]<?php function do_post_request($url, $postdata, $files = null) { $data = ""; $boundary = …

Member Avatar for albivl91
0
1K
Member Avatar for deluksic

Well... im making some kind of graphic engine for console in [B]c++[/B], ASCII based, just for exercise... anyways, i was wandering, can i print text [B]faster[/B]? Right now i'm printing the whole map of characters (pix[160][120]) in a [B]single line[/B], so it is fast, however i need it faster cause …

Member Avatar for deluksic
-1
2K
Member Avatar for ag_17

I was using getline() function and it was getting skipped. I searched through the forum and found the tutorial on how to flush the input stream but there is one thing that is still unclear to me : getline() uses newline character as a delimiter. So when a '\n' is …

Member Avatar for Narue
0
166
Member Avatar for Sudo Bash

Hi all, I am trying to create a class to serve as a customized cout class. Right now I have made some test code to see if I can do it. Right now I am trying to make it function just like cout, but later I will have it do …

Member Avatar for Sudo Bash
0
2K
Member Avatar for seamus400

I've found some similar posts on opening different files with the same file stream but they are difficult to understand. I'm trying to figure out for a larger project why I can't use the same file stream as in this example and what an alternative solution may be. And yes …

Member Avatar for seamus400
0
4K
Member Avatar for G_Waddell

Hi All, I have a section of my site that allows users to upload and download files. For security issues, We use a com object to take the file as a binary stream and store it on our network off of the web server (under a different randomly generated file …

Member Avatar for G_Waddell
0
315
Member Avatar for baby_c

Hey friends.Need a help from you again. I'm trying to study about streams and I wrote small code for get input from command line and print it in the screen,but It prints weird characters like Japanese :O . Can anyone explain what I did wrong... [CODE] import java.io.*; public class …

Member Avatar for baby_c
0
201
Member Avatar for bleedi

Hey, I'm working on a project where we have to stream files from a server app to clients. I have it all working nicely, but we have a special client type that cannot save files to HDD, not even temporarily. I can get the byte stream from server to this …

Member Avatar for CsharpChico
0
733
Member Avatar for G_Waddell

Hi I'm writing a site that allows users to download documents securely stored on the network off of the web server. I'm using a com object on the server that we've been using here for ages that fetches the file from the network in a binary stream thus preventing user …

Member Avatar for G_Waddell
0
1K
Member Avatar for twsmale

I have been stuck on this problem for a while, and I just can't figure it out. I'm sure there's an incredibly easy way to do it, but I'm at a loss... I need to take in this text file: Smith, M.N., Martin, G., Erdos, P.: paper name Erdos, P., …

Member Avatar for twsmale
0
209
Member Avatar for RobBobSmith

Hello all, I have a text file called: concentrations.dat The file contains a lot of different data. Here's the data that I'm interested in: # ET: list of elements <ET> 'Cu' 'C' 'Sr' 'He' 'Mg' 'O' 'Cr' What I want to do is read the elements into a vector called …

Member Avatar for RobBobSmith
0
249
Member Avatar for hkBattousai

A most basic TCT connection is established with the code below: [CODE]// Initialization IPEndPoint m_IpEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.71"), 5000); Socket m_Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); NetworkStream m_Stream = new NetworkStream(m_Socket); // Read/write operations m_Stream.Write(System.Text.Encoding.ASCII.GetBytes("Hello world!"), 0, 12); byte[] read_buffer = new byte[4096]; m_Stream.Read(read_buffer, 0, 4096); // Closing open resources …

Member Avatar for mcriscolo
0
344
Member Avatar for jd_davis

Greetings, I'm working my way through the Head Start C# book, and I know that whenever I open a stream [CODE=c#]Stream reader = File.Open(filename));[/CODE] I [B][I][U]ALWAYS[/U][/I][/B] [CODE=c#]reader.Close();[/CODE] my stream. The book also lets you know you can use a using block [CODE=c#]using (Stream ...) { }[/CODE] and the stream will …

Member Avatar for MattBerry
1
827
Member Avatar for RoyMicro

Hello There seems to be different methods to create a text file in C#. I am getting a byte array from USB device. I need to store this as text file which is to be read, updated, and saved for future usage. The data comes in different packets not in …

Member Avatar for Geekitygeek
2
183

The End.