Hello,
I am writing a C++ server side application called quote of the day. I am using the winsock2 library. I want to send the contents of a file back to the client, including newlines by using the send function. The way i tried it doesn't work. How would i go about doing this?
I'm trying to run a .jar file on my centos box, but it says "java: command not found".
What's the best or easiest way to solve this? I was hoping for a yum command but not sure that that will exist for java?
I have a login form that has Username and password as inputs from user and I want to validate these login credentials from a text file. How can I do it? I know how to write data and read data..but how to read only specific data.or check whether username password combination exists or not.
Thanks a lot.
Ani
I have a dialog use Jfilechose, when i save a file by use FileOutputStream to create a file.txt to save in path which user want . But i have problem that it alway save in c:/user/Document
Check my code
DownLoadDialog downloadDialog = new DownLoadDialog();
int result = downloadDialog.showSaveDialog(queryPanel);
if(result == downloadDialog.APPROVE_OPTION) {
File file = downloadDialog.getSelectedFile();
//String parth =file.getPath();
//System.out.println(parth);
//if(file.exists()) {
// int response = JOptionPane.showConfirmDialog (null,"Overwrite existing file?","Confirm Overwrite",JOptionPane.OK_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE);
// if(response == JOptionPane.OK_OPTION) {}
//} else {
if(resultGoogleSearch > 0) {
{
String parth = new File(downloadDialog.getSelectedFile().getAbsolutePath().concat(".txt")).toString();
System.out.println(parth);
for(int i=0;i<resultGoogleSearch;i++)
{
String[] temp = googleSearchResult.get(i).split("<br>");
//String resultURL = temp[0];
//File dir = downloadDialog.getCurrentDirectory();
try{
FileOutputStream googleReuslt = new FileOutputStream( downloadDialog.getSelectedFile().getAbsolutePath()+".txt" );
OutputStreamWriter writer = new OutputStreamWriter(googleReuslt);
BufferedWriter buffer = new BufferedWriter(writer);
writer.write(temp[0]);
writer.close();
buffer.close();
} catch (FileNotFoundException fEx){
} catch(IOException ioEx) {
}
}
}
JOptionPane.showMessageDialog(IDRSApplication.idrsJFrame, IDRSResourceBundle.res.getString("successful"));
}
problem is here : why can't i set parth for new file ?
FileOutputStream googleReuslt = new FileOutputStream( downloadDialog.getSelectedFile().getAbsolutePath()+".txt" );
OutputStreamWriter writer = new OutputStreamWriter(googleReuslt);
BufferedWriter buffer = new BufferedWriter(writer);
writer.write(temp[0]);
writer.close();
buffer.close();
Hello people,
Thanks for looking at this question.
I wanted to know how can I use the GD function imagefill() to patch an image with another image.
imagefill() currently accepts resource of a color.
I can do that.
But wanted to know how this can be done with a file.
I noticed a user note -
But that didn't worked and took a long time for completion :-(
http://www.php.net/manual/en/function.imagefill.php#84288
I've got a visual studio deployment project and would like to add an option to view a readme file from the final screen.
So basically there would be a link or checkbox that the user can select if they want to view the readme.
Does anyone know of an easy way to do this?
Initially I deployed packages on SQL server but since my machine is not having SSIS installed I faced issue of version while executing the packages. Then I deployed packages to file system on server which has SQL server enterprise edition with SSIS installed on it. I access the folder on server where I have deployed packages from my system and execute the package but I get error saying "cannot run on this edition of integration services, need higher version." Do I need to rmote login (RDP) to execute package?
Hi,
In the postfix main.cf I have configured service to invoke external php script.
smtp inet n - - - - smtpd -o content_filter=myservice:www-data
myservice unix - n n - 1 pipe
flags=Rq user=me null_sender=
argv=/home/me/my_script.php
so far so good, my_script.php is executed. It creates the file my_file.txt in home dir. However I can only manage
-rw------- 1 me www-data 16 2009-10-11 19:35 my_file.txt
How do I add 'r' permissions for www-data group ?
I have a application to list all music files in user machine, a "Explorer" button is using to quickly open Windows Explorer and highlight the file in Windows Explorer. I tried ShellExecute, but it doesn't work, the API will launch associate application. Any Windows API can do that? Thanks in advance.
I'm using Netbeans 6.8 and the finest-grained way to run my JUnit tests from the IDE appears to be to right-click a class under Test Packages and click Test File
In Eclipse it's possible to narrow the scope to testing an individual method in a given test harness. How do I test only one individual test out of a harness in Netbeans?
I have a text file that looks like this:
adapter 1: LPe11002
Factory IEEE: 10000000 C97A83FC
Non-Volatile WWPN: 10000000 C93D6A8A , WWNN: 20000000 C93D6A8A
adapter 2: LPe11002
Factory IEEE: 10000000 C97A83FD
Non-Volatile WWPN: 10000000 C93D6A8B , WWNN: 20000000 C93D6A8B
Is there a way to get this information into an anonymous type or dictionary object?
The final anonymous type might look something like this, if it were composed in C# by hand:
new
{
adapter1 = new
{
FactoryIEEE = "10000000 C97A83FC",
Non-VolatileWWPN = "10000000 C93D6A8A",
WWNN = "20000000 C93D6A8A"
}
adapter2 = new
{
FactoryIEEE = "10000000 C97A83FD",
Non-VolatileWWPN = "10000000 C93D6A8B",
WWNN = "20000000 C93D6A8B"
}
}
I would like to put a large variable definition in a separate file for the sake of getting it out of the way. I must be doing something wrong though, because my puts call isn't putting anything out.
my_class.rb:
class foobar
def initialize
require 'datafile.rb'
puts @fat_data
end
end
datafile.rb:
@fat_data = [1,2,3,4,5,6,7,8,9,10]
Can you use require this way?
Hi folks, we have a solution with multiple projects that is being developed by a team of developers. Project paths in the solution file checked in initially contains the path that are specific to that developer. Now when another dev gets latest of the solution, some of the projects won't load as the path differs.
What's a better way to manage this ?
TIA
I want to have a file dialog only allow directories, here's what I've been trying:
fileDialog = QtGui.QFileDialog()
fileDialog.setFileMode(QtGui.QFileDialog.ShowDirsOnly)
filename = fileDialog.getOpenFileName(self, 'Select USB Drive Location'))
Thank You
I had posted a question in regards to this code. I found that JTextArea does not support the binary type data that is loaded.
So my new question is how can I go about detecting the 'bad' file and canceling the file I/O and telling the user that they need to select a new file?
class Open extends SwingWorker<Void, String>
{
File file;
JTextArea jta;
Open(File file, JTextArea jta)
{
this.file = file;
this.jta = jta;
}
@Override
protected Void doInBackground() throws Exception
{
BufferedReader br = null;
try
{
br = new BufferedReader(new FileReader(file));
String line = br.readLine();
while(line != null)
{
publish(line);
line = br.readLine();
}
}
finally
{
try
{
br.close();
} catch (IOException e) { }
}
return null;
}
@Override
protected void process(List<String> chunks)
{
for(String s : chunks)
jta.append(s + "\n");
}
}
I m using Microsoft Enterprise Library 3.1 for Exception Handling in asp.net, the erors are stored in Event Viewer of the system . Instead of Event Viewer I need to store these errors in a log File using Enterprise Library. Suggest some methods to implement it. Thanks in advance.
Does Visual Studio / Resharper support this? By refactor copy I mean to be able to enter new class name in some dialog, and to have the tool do all the refactoring (renaming) for you. No Copy of ... file names, and no error upon having two classes with same name in the project.
Netbeans does this out-of-the-box :(
Hello,
I am using VS 2008 and .Net Framework 3.5 when i compile project i m getting error
Compiler executable file csc.exe cannot be found.
I have checked that csc.exe is also exist in the .net frame work folder.
When i change compiler version 3.5 to 2.0 it starts working but My 3.5 Features are not available there like LINQ.
I have try everything, Update .Net Framework, Install latest service Pack.
Please help me out this Problem.
we are trying to re-direct the output of the list to a file using the below cmd(java) in ubuntu,
Pls let us know if this works or not ?
Process p = Runtime.getRuntime().exec("ls -l /home/blah blah/new.txt")
I have developed an application in vb.net2008 and database sqlserver. Now i want to ignore the database (it has 1 table as customer(name,password,hour,minute)) as i dont want my client to install sqlserver separately or other overheads.
I am planning to do the whole using file handling in vb.net(manipulating the data in files itself eg change username, password etc). As I am new i don't actually know the proper way and of course need assistance.