I am having my friend USB, which contains the error while Formatting, copying, deleting, renaming, moving files from it. The error is `"The Disk is Write Protected"`, I don't Know why this all happens? I try to repair it with the google help and find some common solution and tried too But I failed (i.e. that's don't work for me) My Work (My trials) Regarding the hotfix, I think you can install it directly. The hotfix will replace/update some USB related system files which would be helpful for USB related issues. Actually, I have had this type of issue before …

Member Avatar
Member Avatar
+0 forum 16

Hi, I have started this project and come to the point where I can't figure out how to finish it. First Want to say that I'm noob for VB6 and programming in general, but I saw some examples and make it work this part of job I need. I will upload complete project, and sample text file, and screen shoot also, where I have explained how I want my app to work. So, please take a look and help me if you can :) in short - I need app to write text file with specific number of lines, continuing …

Member Avatar
Member Avatar
+0 forum 10

Hi, I have writen web sites before but have been asked to create a VB program, but dont know where to start so hoping someone can help me. I need to create a program that sits waiting for data from the serial port which is attached to a set of scales, when the scales are triggered they send the weight of the object down the serial port to the pc that then writes the data to a text file and then waits for the next weight to be received, and continuous to run until stopped at the end of the …

Member Avatar
Member Avatar
+0 forum 5

**Read title.** username = base64.b64encode(username)+'\n' This is what I thought would have worked, but it comes up with an error, "TypeError: can't concat bytes to str", meaning that I cannot add +'\n' to the end of the code. If there is anyway anyone knows how to write the byte of base64.b64encode(username) to a file line by line, please help!

Member Avatar
Member Avatar
+0 forum 2

I'm not understanding why i'm able to read from the file but i can't write to it. The fstream is open in both modes. Once the program finishes i haven't changed the content of the file. Thank you in advance. #include <fstream> #include <string> #include <iostream> int main() { std::string line; std::fstream m_File("/home/user/file.txt", std::ios::in | std::ios::out); if(m_File.fail()) return -1; // read file std::getline(m_File, line); while(m_File.good()) { std::getline(m_File, line); std::cout << line << std::endl; } // write to file std::string line2 = "test to write"; m_File.seekp(std::ios_base::beg); m_File << line2; m_File.close(); return 0; }

Member Avatar
Member Avatar
+0 forum 6

hi all i've been strugling with this error. could someone help me. below is the code stremail = "some@email" For Each store In outlookapp.Session.Stores strchecking = store.DisplayName outlookfolder = store.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox) For Each objfolder In outlookfolder.Folders For Each obj As Object In objfolder If TypeOf (obj) Is Outlook.MailItem Then MsgBox(obj.Subject) End If Next Next Next the error says : "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." and it appears in this line `outlookfolder = store.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)`

Member Avatar
Member Avatar
+0 forum 10

Hi all, I'm trying to use the following code to see if a method exists and then use it if it does: $method_exists = method_exists('myclass', 'mymethod'); if ($method_exists && isset(myclass::mymethod('blah')) { but I am getting the following error: Fatal error: Can't use function return value in write context I've looked around on google and seen various explanations of why this could occur but none of them seem to make sense with this scenario. Any light shed on the matter would be greatly appreciated. Thanks

Member Avatar
Member Avatar
+0 forum 1

Hi, I need to create a page where an admin can upload an excel worksheet in the .xlsx file format, this is then read and writen onto another php page. I'm new to PHP so I am confused by the code, I can find help on .xls but not accepting .xlsx. Thanks for any help.

Member Avatar
Member Avatar
+0 forum 1

Hey guys, I need assistance with my program need to write a program that writes a series of random numbers to a file. Each random number should be in the range of 1 through 100. The application should let the user specify how many random numbers the file will hold. Once that program is done, need to write a program that reads from a file named ‘random.txt’ using a for loop with in file_object clause, display the numbers, and then display the following data: the sum total of the random numbers picked and the number of random numbers read from …

Member Avatar
Member Avatar
+0 forum 2

i am working on a project but this parts seems to stall me i want to be able to write to a text file to change just two lines of d file say line 1 and 3 using wxwidgets i will appreciate helps nd suggestions thanks

Member Avatar
Member Avatar
+0 forum 5

Good morning community, Can someone help me with the IndexOf method to reverse the name: Don Paul to Paul, D

Member Avatar
Member Avatar
+0 forum 4

How to read a specific value from a text file and then save the value in another text file. Example: in data.txt file there is some values. Item Name : m-01 Item Brand : One Man Item size : XXL Item Price : 1000 Item vat : 15% these are the data saved in data.txt Now my program will ask for the item name and when I will write the item name(ex:m-01) It will just take the values 1000 ( price ) and 15 (vat) and then will save them in a new txt file data2.txt How can I do …

Member Avatar
Member Avatar
+0 forum 12

Hi Guys, I was trying to code in C for the following. You are given with 2 files, file1.txt and file2.txt. The contents of the file contain INTERGER values. Add the contents of the file and write them to another file file3.txt. My code is as follows #include <stdio.h> #include <stdlib.h> int main() { static int data,data1,sum; FILE *f1,*f2,*f3; f1 = fopen("C:\\file1.txt","r"); f2 = fopen("C:\\file2.txt","r"); f3 = fopen("C:\\file3.txt","w"); while(( fscanf(f1,"%d",&data) != EOF ) || ( fscanf(f2,"%d",&data1) != EOF )) { if(data == EOF && data1 == EOF) { break; } else if(data == EOF) { sum += data1; } else …

Member Avatar
Member Avatar
+0 forum 5

Hello I have a XML DB. I write the first element. I can not get the entries to (fragments) to write to the Database. I know I do not have the error handler setup right. The error stops the process on the transform. Is there some debugging techniques I could use to understand why the fragments are not being appended. All the data is collected and in place. Thanks. java.lang.NullPointerException at com.sun.org.apache.xml.internal.serializer.ToUnknownStream.characters(ToUnknownStream.java:342) [code] dom: import java.io.*; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import model.notes.reference.ReadXML; import org.w3c.dom.*; [/code] [code] XML DB <?xml version="1.0" …

Member Avatar
Member Avatar
+0 forum 2

Okay I am wondering what is a syntax to create a new property with read-write proprties, I read the book but it is not clear. Your help is appreciated

Member Avatar
Member Avatar
+0 forum 1

trying to make this script work: <script type="text/javascript"> var tmp='<html><head><title>popup</title>'; tmp+='<script type=text/javascript>'; tmp+='function nowTime(){'; tmp+='var oNowTime=new Date();'; tmp+='var iMonth=oNowTime.getMonth();'; tmp+='var iDate=oNowTime.getDate();'; tmp+='var iYear=oNowTime.getFullYear();'; tmp+='var iHours=oNowTime.getHours();'; tmp+='var iMinutes=oNowTime.getMinutes();'; tmp+='var iSeconds=oNowTime.getSeconds();'; tmp+='var iMilliSeconds=oNowTime.getMilliseconds();'; tmp+='var sNowTime=iHours+":"+iMinutes+":"+iSeconds;'; tmp+='return sNowTime'; tmp+='}'; tmp+='function nowDate(){'; tmp+='var oNowTime=new Date() '; tmp+='var iMonth=oNowTime.getMonth()+1'; tmp+='var iDate=oNowTime.getDate()'; tmp+='var iYear=oNowTime.getFullYear()'; tmp+='var iHours=oNowTime.getHours()'; tmp+='var iMinutes=oNowTime.getMinutes()'; tmp+='var iSeconds=oNowTime.getSeconds()'; tmp+='var iMilliSeconds=oNowTime.getMilliseconds()'; tmp+='var sNowTime=iYear+"-"+iMonth+"-"+iDate;'; tmp+='return sNowTime'; tmp+='}'; tmp+='function showNowTime(){'; tmp+='var oObjId1=document.getElementById("mdate");'; tmp+='oObjId1.innerHTML=nowDate();'; tmp+='var oObjId2=document.getElementById("mclock");'; tmp+='oObjId2.innerHTML=nowTime();'; tmp+='setTimeout("showNowTime()",1000)'; tmp+='}'; tmp+='<\/script></head><body onload="showNowTime()">'; tmp+='<font size="7">'; tmp+='<div id="mdate">mdate</div>'; tmp+='<div id="mclock">mclock</div>'; tmp+='</font></body></html>'; var newwindow2=window.open('','name','height=200,width=150'); newwindow2.document.write(tmp); </script> What's Wrong ?? any suggestions are welcomed. thanks

Member Avatar
Member Avatar
+0 forum 5

hi, does any one know about the pipe & filter architecture implemntation in C# have a question in that.

Member Avatar
Member Avatar
+0 forum 3

Hello, I'm trying to write data to an INI file, I've got some code to read it: [http://pastebin.com/Jpwf8XJM](http://pastebin.com/Jpwf8XJM). I've tried to modify this code to get it to be able to write to INI files, but I haven't had much success. I know there are DLL's designed for this, but I would like to have my application so it can be distributed as a single EXE. Also, I know there is My.Settings, but I cannot use this, as this INI file is used by another application, that I have not developed. So, I was wondering if anyone could help me …

Member Avatar
Member Avatar
+0 forum 2

I keep getting this error and i don't understand why. [code]Traceback (most recent call last): File "E:\University\Workspace eclipse\dictionares\src\dcts\dicts.py", line 105, in <module> fr_runt() File "E:\University\Workspace eclipse\dictionares\src\dcts\dicts.py", line 95, in fr_runt run.run() File "E:\University\Workspace eclipse\dictionares\src\dcts\dicts.py", line 58, in run self.data.write(file, key, value) File "E:\University\Workspace eclipse\dictionares\src\dcts\dicts.py", line 23, in write fh = open(file, 'a') TypeError: coercing to Unicode: need string or buffer, type found[/code] I'm trying to make a so called 'database', working with dictionaires, and it won't let me write down the changes in the file. I'll put the code bellow: [CODE]''' Created on Feb 20, 2012 @author: sin ''' import …

Member Avatar
Member Avatar
+0 forum 2

Hi everyone, I'm currently working on a cross-platform project to copy data from the computer onto a USB drive quickly. [B]Main problem: EOF in the middle of the file[/B] It's going good so far, but I stumbled across a problem in my copy_file function: [CODE]int copy_file(char *source_path, char *destination_path) { FILE *input; FILE *output; char temp1[MAX_PATH] = {0}; strcpy(temp1, source_path); char temp2[MAX_PATH] = {0}; strcpy(temp2, destination_path); if ( (input = fopen(temp1, "r")) != NULL ) { if ( (output = fopen(temp2, "w+")) != NULL ) { /* Copying source to destination: */ char c; while ( (c = getc(input)) != …

Member Avatar
Member Avatar
+0 forum 7

Not sure if this should be in the MySQL section but here goes, I basically need some sort of code which can read events from a database, display them on a webpage, and the ability to edit and add new events. Please do not suggest any sort of calendar as this is not what im looking for, i basically want an admin page to be able to add a new event, and then that to be shown in another page. I just need pointing in the right direction really, and have tried searching but only seem to come up with …

Member Avatar
Member Avatar
+0 forum 2

So, I have a two part question for you... I'm going to be writing several lines of code to a .txt file, but I won't know what each line is, or how many there will be. There could easily be hundreds of lines. I need to add a prefix to the front of each individual line. Is such a thing possible, when you don't know how many lines there are going to be? (It will all be contained within a list before being written to the file, btw.) And second question... if I potentially had say, over 1000 lines of …

Member Avatar
Member Avatar
+0 forum 1

I'm pretty new to programming, so this may be really obvious, but I'm having trouble with it. I'm trying to learn python, so I thought I'd make a simple program in python to help me write similar lines of java code faster, (I'm going to easily have hundreds of lines of this.) and I've got it all worked out, except one little thing, which I'm sure is very simple, but I searched around a bit for it, and couldn't find anything, so I thought I'd just ask here before going to bed. As you can probably tell, this will take …

Member Avatar
Member Avatar
+0 forum 3

Hi there, I'm using php to try and take two separate arrays ($colors and $message), write them to a single multidimensional array ($endline), and then write the resulting md array into a csv. This works fine on my localhost, but for some reason it doesn't work through my web host. Could this be a windows unix difference? I've had some minor problems with this before. It also may be a problem with the way the webhost runs sessions. The $filename below is the previous session file from which I've gathered the $colors array. I just wanted to write over it …

Member Avatar
Member Avatar
+0 forum 5

I am trying to do this simple encoding program for class. It is supposed to encode it using the ASCII chart and some slight modding of the number. Then it should be written to a file 'encryptedmessage.txt' for later reading by a decoder later. My issue is I dont know how to add newMessage so I can write it to file. I can't use the for loop in the output file. Any help would be appreciated. i tried searching but everything I found was actually more complex then what we are into as of now. Thank you for taking the …

Member Avatar
Member Avatar
+0 forum 11

Hi all, I searched this topic and found a couple of posts but I couldn't find what I am looking for. Here's the problem - I am trying to send an image to a client (browser in this case) over a socket. After the image is received I am trying to display it in the browser but it looks corrupted, as if some of the data is missing. The weird thing is that I am able to send some images and display them without any problems. I probably should mention that I am resizing the images, but that's done in …

Member Avatar
Member Avatar
+0 forum 3

hi, i have this code: [CODE]#include <iostream> #include <fstream> #include<cstdio> #include<cstdlib> using namespace std; int main (char argc) { for(;;) { fstream myfile; myfile.open("example.txt"); cout << "1: Write" << endl; cout << "2: Read" << endl; int n1; cin >> n1; if(n1 == 1) { string n2; getline(cin,n2); myfile << n2 << endl; } if(n1 == 2) { string n3; getline(myfile,n3); cout << n3 << endl; } myfile.close(); } } [/CODE] when i run it, i want to write to the file but when i press 1, the program just goes back to the main menu. any solutions?

Member Avatar
Member Avatar
+0 forum 7

I had a problem with some program I wrote that edit specific values within a specific file. When I saved the values, using fstream's write() function, everything between these values became null. I've looked again in the I/O tutorial - [URL="http://www.cplusplus.com/doc/tutorial/files/"]http://www.cplusplus.com/doc/tutorial/files/[/URL] and saw that they use memory block at the read()/write() example. I also saw that they are using it at the example in the description about the write() function - [URL="http://www.cplusplus.com/reference/iostream/ostream/write/"]http://www.cplusplus.com/reference/iostream/ostream/write/[/URL] I open the file and write to it directly. For example: [CODE]ofstream saveFile(saveFilePath, ios::binary); saveFile.seekp(a, ios::beg); saveFile.write(x,y); saveFile.seekp(b, ios::beg); saveFile.write(w,x); //...[/CODE] Does my code null everything between the …

Member Avatar
Member Avatar
+0 forum 4

Hi I have a problem with a code I made, some save editor for some game. The code suppose to write 2 bytes to a specific offset in some file. The file's short integers are saved as little endian. everything works fine, but when one of the integers equal 10, it is saved as another number. my function to write the short integers is: [CODE] void writeInt(int n, int pos, fstream* file) { char tmp[2]; tmp[0] = n & 0xff; tmp[1] = (n >> 8) & 0xff; file->seekp(pos, ios::beg); file->write(tmp, 2); }[/CODE] I call this function in the function: [CODE] …

Member Avatar
Member Avatar
+0 forum 2

Hi masters, I try to write and read file into txt file but i dont know how to do it. Anyone know how to achieve this? Please help me. any help will appreciated much. Best Regards

Member Avatar
Member Avatar
+0 forum 3

The End.