Search Results

Search found 36369 results on 1455 pages for 'document write'.

Page 6/1455 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • javascript function document.location working incorrectly

    - by john
    When I change on proxy-server page from cnn.com (I add javascript, that call document.location), result of the document.location is some url of advertisement: http://ads.cnn.com/html.ng/site=cnn_international&cnn_intl_pagetype=mmst&cnn_intl_position=336x850_rgt&cnn_intl_rollup=asia&page.allowcompete=yes&params.styles=fs&tile=5656033441721&domId=894131 and not current url:http://edition.cnn.com/2010/WORLD/asiapcf/04/13/soccer.world.cup.pakistan/index.html?hpt=C1 Do you know, where can be problem?

    Read the article

  • Are there Any Concerns with Importing Document Files From a Competing Product?

    - by Thunderforge
    I have a new product that serves the same purpose as my competitor's long-standing product. One thing I have considered doing is allowing my program to import document files created by their product in order to provide an easy way for users to migrate towards mine. Naturally, this would be done without the competitor's permission, as it goes against their interests. I've seen this done before with office suite software (e.g. Open Office and Apple Pages can import MS Word documents), but I'm wondering if there are any concerns, legal or ethical, with me doing this. I fully expect any answers will most likely fall under the "I am not a lawyer" clause, but it would be helpful to have a starting point for anything I would need to be aware of, or if I shouldn't need to worry.

    Read the article

  • iTextSharp everything works but getting strange error when opening pdf document

    - by Dmitris
    Hello everybody, I am using iTextSharp to create my PDF document on the fly. Everything works fine, and i get no errors in the code; however, when i open created PDF it gives me error saying that document will be not displayed properly because it contain errors. Here is the code bellow that gives me a problem: public class pdfevents : PdfPageEventHelper { public override void OnEndPage(PdfWriter writer, Document document) { base.OnEndPage(writer, document); PdfContentByte cb = writer.DirectContent; cb.BeginText(); cb.SetTextMatrix(20, document.GetBottom(-30)); BaseFont bf = BaseFont.CreateFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, BaseFont.NOT_EMBEDDED); cb.SetFontAndSize(bf, 10); //thats is the piece of code that makes problems //if i remove it then document displays without error cb.MoveTo(15F, document.GetBottom(-15)); cb.SetLineWidth(0.5F); cb.LineTo(document.GetRight(0), document.GetBottom(-15)); cb.Stroke(); cb.ShowText(DateTime.Now.ToLongDateString()); int n = writer.PageNumber; cb.SetTextMatrix(document.GetRight(20), document.GetBottom(-30)); cb.ShowText(" - " + n + " - "); cb.EndText(); } } If i remove following lines : //thats is the piece of code that makes problems //if i remove it then document displays without error cb.MoveTo(15F, document.GetBottom(-15)); cb.SetLineWidth(0.5F); cb.LineTo(document.GetRight(0), document.GetBottom(-15)); Then i am getting no error opening generated PDF, otherwise i can open PDF and see the document and it's content including the line. However, then i get error that document been generated with error. Can somebody tell me what is wrong ? Thanks in advance. cb.Stroke();

    Read the article

  • XML: to append xml document into the node of another document

    - by Bibhaw
    Hi all, I have to insert file1.xml elements into another file2.xml. file2.xml has several node and each node has it's node_id. is there any way to do that. let suppose : file1.xml : <root> <node_1> ......</node_1> </root> file2.xml : <root> <node> <node_id>1</node_id> </node> </root> I want ? file2.xml : <root> <node> <node_1>......</node_1> [here i want to append the file1.xml] </node> </root>

    Read the article

  • Python: slow read & write for millions of small files

    - by Jami
    I am building directory tree which has tons of subdirectories and files. The total directory count is somewhere along 256^32 subdirectories with 256 files in each end which are only a few bytes long. I did this so I would have fast access to these files (since i'm not searching and i'm just directly accessing then via a known file path) I have a python script that builds this filesystem and reads & writes those files. The problem is that when I reach more than 1Gb of total filesize, the read and write methods become extremely slow. Here's the function I have that reads the contents of a file (the file contains an integer string), adds a certain number to it, then writes it back to the original file. def addInFile(path, scoreToAdd): num = scoreToAdd try: shutil.copyfile(path, '/tmp/tmp.txt') fp = open('/tmp/tmp.txt', 'r') num += int(fp.readlines()[0]) fp.close() except: pass fp = open('/tmp/tmp.txt', 'w') fp.write(str(num)) fp.close() shutil.copyfile('/tmp/tmp.txt', path) I previously tried performing linux console commands but it was slower. I copy the file to a temporary file first then access/modify it then copy it back because i found this was faster than directly accessing the file. I think the cause of the slowdown is because there're tons of files. performing this function 1000 times sometimes reach 1 minute now, but before (when there were only a few files, 1000 calls was performed for only less than 1 second) How do you suggest I fix this?

    Read the article

  • Cocoa document-based app: Notification not always received by observer

    - by roysolay
    Hi, I hope somebody can help with my notification problem. I have a notification which looks to be set up correctly but it isn’t delivered as expected. I am developing a document based app. The delegate/ document class posts the notification when it reads from a saved file: [[NSNotificationCenter defaultCenter] postNotificationName:notifyBsplinePolyOpened object:self]; Logging tells me that this line is reached whenever I open a saved document. In the DrawView class, I have observers for the windowOpen notification and the bsplinePoly file open notification: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mainWindowOpen:) name:NSWindowDidBecomeMainNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(savedBspline:) name:notifyBsplinePolyOpened object:nil]; - (void) mainWindowOpen:(NSNotification*) note { NSLog(@"Window opened"); _mainWindow = [note object]; } - (void) savedBspline:(NSNotification*) note { NSLog(@"savedBspline called"); NSLog(@"note is %@", [note name]); } The behavior is odd. When I save and close the main window and reopen it, I get the “Window opened” message but not the “savedBspline called” message. If I leave a main window open and open a previously saved session, I get the “Window opened” message and the “savedBspline called” message. I have searched online discussion and Apple DevCenter documentation but I have not seen this problem.

    Read the article

  • Create PDF document using iTextSharp in ASP.Net 4.0 and MemoryMappedFile

    - by sreejukg
    In this article I am going to demonstrate how ASP.Net developers can programmatically create PDF documents using iTextSharp. iTextSharp is a software component, that allows developers to programmatically create or manipulate PDF documents. Also this article discusses the process of creating in-memory file, read/write data from/to the in-memory file utilizing the new feature MemoryMappedFile. I have a database of users, where I need to send a notice to all my users as a PDF document. The sending mail part of it is not covered in this article. The PDF document will contain the company letter head, to make it more official. I have a list of users stored in a database table named “tblusers”. For each user I need to send customized message addressed to them personally. The database structure for the users is give below. id Title Full Name 1 Mr. Sreeju Nair K. G. 2 Dr. Alberto Mathews 3 Prof. Venketachalam Now I am going to generate the pdf document that contains some message to the user, in the following format. Dear <Title> <FullName>, The message for the user. Regards, Administrator Also I have an image, bg.jpg that contains the background for the document generated. I have created .Net 4.0 empty web application project named “iTextSharpSample”. First thing I need to do is to download the iTextSharp dll from the source forge. You can find the url for the download here. http://sourceforge.net/projects/itextsharp/files/ I have extracted the Zip file and added the itextsharp.dll as a reference to my project. Also I have added a web form named default.aspx to my project. After doing all this, the solution explorer have the following view. In the default.aspx page, I inserted one grid view and associated it with a SQL Data source control that bind data from tblusers. I have added a button column in the grid view with text “generate pdf”. The output of the page in the browser is as follows. Now I am going to create a pdf document when the user clicking on the Generate PDF button. As I mentioned before, I am going to work with the file in memory, I am not going to create a file in the disk. I added an event handler for button by specifying onrowcommand event handler. My gridview source looks like <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Width="481px" CellPadding="4" ForeColor="#333333" GridLines="None" onrowcommand="Generate_PDF" > ………………………………………………………………………….. ………………………………………………………………………….. </asp:GridView> In the code behind, I wrote the corresponding event handler. protected void Generate_PDF(object sender, GridViewCommandEventArgs e) { // The button click event handler code. // I am going to explain the code for this section in the remaining part of the article } The Generate_PDF method is straight forward, It get the title, fullname and message to some variables, then create the pdf using these variables. The code for getting data from the grid view is as follows // get the row index stored in the CommandArgument property int index = Convert.ToInt32(e.CommandArgument); // get the GridViewRow where the command is raised GridViewRow selectedRow = ((GridView)e.CommandSource).Rows[index]; string title = selectedRow.Cells[1].Text; string fullname = selectedRow.Cells[2].Text; string msg = @"There are some changes in the company policy, due to this matter you need to submit your latest address to us. Please update your contact details / personnal details by visiting the member area of the website. ................................... "; since I don’t want to save the file in the disk, I am going the new feature introduced in .Net framework 4, called Memory-Mapped Files. Using Memory-Mapped mapped file, you can created non-persisted memory mapped files, that are not associated with a file in a disk. So I am going to create a temporary file in memory, add the pdf content to it, then write it to the output stream. To read more about MemoryMappedFile, read this msdn article http://msdn.microsoft.com/en-us/library/dd997372.aspx The below portion of the code using MemoryMappedFile object to create a test pdf document in memory and perform read/write operation on file. The CreateViewStream() object will give you a stream that can be used to read or write data to/from file. The code is very straight forward and I included comment so that you can understand the code. using (MemoryMappedFile mmf = MemoryMappedFile.CreateNew("test1.pdf", 1000000)) { // Create a new pdf document object using the constructor. The parameters passed are document size, left margin, right margin, top margin and bottom margin. iTextSharp.text.Document d = new iTextSharp.text.Document(PageSize.A4, 72,72,172,72); //get an instance of the memory mapped file to stream object so that user can write to this using (MemoryMappedViewStream stream = mmf.CreateViewStream()) { // associate the document to the stream. PdfWriter.GetInstance(d, stream); /* add an image as bg*/ iTextSharp.text.Image jpg = iTextSharp.text.Image.GetInstance(Server.MapPath("Image/bg.png")); jpg.Alignment = iTextSharp.text.Image.UNDERLYING; jpg.SetAbsolutePosition(0, 0); //this is the size of my background letter head image. the size is in points. this will fit to A4 size document. jpg.ScaleToFit(595, 842); d.Open(); d.Add(jpg); d.Add(new Paragraph(String.Format("Dear {0} {1},", title, fullname))); d.Add(new Paragraph("\n")); d.Add(new Paragraph(msg)); d.Add(new Paragraph("\n")); d.Add(new Paragraph(String.Format("Administrator"))); d.Close(); } //read the file data byte[] b; using (MemoryMappedViewStream stream = mmf.CreateViewStream()) { BinaryReader rdr = new BinaryReader(stream); b = new byte[mmf.CreateViewStream().Length]; rdr.Read(b, 0, (int)mmf.CreateViewStream().Length); } Response.Clear(); Response.ContentType = "Application/pdf"; Response.BinaryWrite(b); Response.End(); } Press ctrl + f5 to run the application. First I got the user list. Click on the generate pdf icon. The created looks as follows. Summary: Creating pdf document using iTextSharp is easy. You will get lot of information while surfing the www. Some useful resources and references are mentioned below http://itextsharp.com/ http://www.mikesdotnetting.com/Article/82/iTextSharp-Adding-Text-with-Chunks-Phrases-and-Paragraphs http://somewebguy.wordpress.com/2009/05/08/itextsharp-simplify-your-html-to-pdf-creation/ Hope you enjoyed the article.

    Read the article

  • EXSLT date:format-date template without document() XSLT 1.0

    - by DashaLuna
    Hello guys, I'm using date:format-date template EXSLT file I'm using XSLT 1.0 and MSXML3.0 as the processor. My date:format-date template EXSLT file's declaration is: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tui="http://www.travelbound.co.uk/" xmlns:date="http://exslt.org/dates-and-times" exclude-result-prefixes="msxsl tui date" version="1.0"> ... </xsl:stylesheet> I cannot use document() function due to the 3rd party restrictions. So I have changed the months and days (similarly) from XML snippet: <date:months> <date:month length="31" abbr="Jan">January</date:month> <date:month length="28" abbr="Feb">February</date:month> <date:month length="31" abbr="Mar">March</date:month> <date:month length="30" abbr="Apr">April</date:month> <date:month length="31" abbr="May">May</date:month> <date:month length="30" abbr="Jun">June</date:month> <date:month length="31" abbr="Jul">July</date:month> <date:month length="31" abbr="Aug">August</date:month> <date:month length="30" abbr="Sep">September</date:month> <date:month length="31" abbr="Oct">October</date:month> <date:month length="30" abbr="Nov">November</date:month> <date:month length="31" abbr="Dec">December</date:month> </date:months> to the variable: <xsl:variable name="months"> <month length="31" abbr="Jan">January</month> <month length="28" abbr="Feb">February</month> <month length="31" abbr="Mar">March</month> <month length="30" abbr="Apr">April</month> <month length="31" abbr="May">May</month> <month length="30" abbr="Jun">June</month> <month length="31" abbr="Jul">July</month> <month length="31" abbr="Aug">August</month> <month length="30" abbr="Sep">September</month> <month length="31" abbr="Oct">October</month> <month length="30" abbr="Nov">November</month> <month length="31" abbr="Dec">December</month> </xsl:variable> And correspondingly, I've changed the code that originally uses document() function from: [from month processing bit of EXSLT stylesheet] <xsl:variable name="month-node" select="document('')/*/date:months/date:month[number($month)]" /> to use MSXML3.0 node-set function: <xsl:variable name="month-node" select="msxsl:node-set($months)/month[number($month)]" /> So I assumed that this would work. According to the EXLT instructions "The format pattern string is interpreted as described for the JDK 1.1 SimpleDateFormat class." [I used current version]. I'm specifing the month in accordance to SimpleDateFormat class as 'dd MMMMM yyyy' so that the month will be the full month's name, for example January. But it doesn't work :( I've looked in EXSLT stylesheet and it has got the logic to do that. Also there is logic to display the name of the week for a day using 'E' pattern, which doesn't work for me. Maybe changing from using document() to variables broke it. Would really appreciate any help. Many thanks!

    Read the article

  • write cache and write sequence order

    - by excanoe
    ok, here i have some weird question: let say we have some binary file (.log), and sequence of write operations, for example log1, log2, log3 and each has some block size n (raw data). question: can I be sure that log1,log2 and log3 sequences can be written in the correct order in ONE file, even if i have few cache levels (disk hardware and os level)? update very interested in what will be with records order (not with records) if we have software or hardware failure (reboot or another reason). update there can be some percent of write failures, but main question is: will write order stay correct?

    Read the article

  • Would this data requirement suit a Document -Oriented database?

    - by codecowboy
    I have a requirement to allow users to fill in journal/diary entries per day. I want to provide a handful of known journal templates with x columns to fill in. An example might be a thought diary; a user has to record a thought in one column, describe the situation, rate how they felt etc. The other requirement is that a user should be able to create their own diary templates. They might have a need for a 10 column diary entry per day and might need to rate some aspect out of 50 instead of 10. In an RDBMS, I can see this getting quite complicated. I could have individual tables for my known templates as the fields will be fixed. But for custom diary templates I imagine I would would need a table storing custom_field_types (the diary columns), a table storing entries referencing their field types (custom_entries) and then a third custom_diary table which would store rows matching custom_entries to diaries. Leaving performance / scaling aside, would it be any simpler or make more sense to use a document oriented database like MongoDB to store this data? This is for a web application which might later need an API for mobile devices.

    Read the article

  • Go - How to read/write to file?

    - by Seth Hoenig
    I've been trying to learn Go / Golang on my own, but I've been stumped on trying read and write to ordinary files. I can get as far as: inFile,_ := os.Open(INFILE,0,0); but actually getting the content of the file doesn't make sense, since the read function takes a []byte as a parameter?? func (file *File) Read(b []byte) (n int, err Error)

    Read the article

  • automating write conflict messages

    - by archer
    is there any method to avoid the annoying write conflict messages by automating and hiding the process so that it doesn't appear as if the program is defective? there doesn't seem to be any point to these messages anyway as there is only one real choice which is to drop the changes.

    Read the article

  • Write-Through Cache

    - by Mubashar Ahmad
    Dear All I am trying to do an C# implementation of Write-through Cache to minimize the read hits on db i need your suggestions, articles or sample codes to fulfill this assignment. Initially this would be use only on one server but will be updated to work in clustered environment. I only able to get a worth reading article on Oracle Site. Please share your views Regards Mubashar

    Read the article

  • write system call to file desciptor ZERO

    - by shadyabhi
    int main ( ) { char C[] = "Hello World"; write(0,C,sizeof(C)); return 0; } In the above program, I am writing to File descriptor ZERO which I suppose by default is STDIN.. Then why I am I getting output at STDOUT? shadyabhi@shadyabhi-desktop:~$ ./a.out Hello Worldshadyabhi@shadyabhi-desktop:~$

    Read the article

  • Read/Write Excel Files Directly To/From Memory

    - by Corey O.
    Several people have asked, in a roundabout way, but I have yet to see a workable solution. Is there any way to open an excel file from directly memory (like a byte[]) ? Likewise is there a way to write a file directly to memory? I am looking for solutions that will not involve the hard disk or juggling temporary files. Thanks in advance for any suggestions.

    Read the article

  • Replace click() with document.ready() in jquery....

    - by bala3569
    I downloaded jquery effects example and all effects are appearing only onclick but i want it to be executed on document.ready() and continue... <script type="text/javascript"> var ImgIdx = 2;//To mark which image will be select next function PreloadImg(){ $.ImagePreload("images/im2.jpg"); $.ImagePreload("images/im3.jpg"); $.ImagePreload("images/im4.jpg"); $.ImagePreload("images/im5.jpg"); } $(document).ready(function(){ PreloadImg(); $(".SlashEff ul li").click(function(){ $(".Slash").ImageSwitch({Type:$(this).attr("rel"), NewImage:"images/im"+ImgIdx+".jpg", speed: 4000 }); ImgIdx++; if(ImgIdx>5) ImgIdx = 1; }); }); </script> and my <div class="SlashEff"> <ul> <li class="TryFadeIn" rel="FadeIn">Fade in</li> <li class="TryFlyIn" rel="FlyIn">Fly in</li> <li class="TryFlyOut" rel="FlyOut">Fly out</li> <li class="TryFlipIn" rel="FlipIn">Flip in</li> <li class="TryFlipOut" rel="FlipOut">Flip out</li> <li class="TryScroll" rel="ScrollIn">Scroll in</li> <li class="TryScroll" rel="ScrollOut">Scroll out</li> <li class="TrySingleDoor" rel="SingleDoor">Single Door</li> <li class="TryDoubleDoor" rel="DoubleDoor">Double Door</li> </ul> </div> Here is the link http://www.hieu.co.uk/blog/index.php/imageswitch/ I tried this, $(document).ready(function(){ PreloadImg(); $(".Slash").ImageSwitch({Type:$(this).attr("rel"), NewImage:"images/im"+ImgIdx+".jpg", speed: 4000 }); ImgIdx++; if(ImgIdx>5) ImgIdx = 1; }); I tried this but it gets executed only once.... I want to execute this every 5000ms... Is this possible...

    Read the article

  • Word Document Turns to Read-Only

    - by Psycho Bob
    I am running into an issue with a user whose Word document is somehow turning itself into Read-Only. The user is using Word 2003 and is accessing a document that is in a Server 2008 share. The document itself starts out as a normal, editable document (user has Full Control permissions), and the user is able to save and do the 'normal' things you would do to a document. However, after a couple of saves, the document turns to Read-Only (according to the title bar) even though the Read-Only attribute is not checked on the document's properties. Here is some additional information about the situation: *User has approximately 5-8 Word documents open at a time *User saves the document frequently (sometimes at a frequency of once per minute) *Once the document is closed it will open as a normal document if reopened *When the document does turn to Read-Only the user will do a "Save As" on the document and save it as FILENAME # where # is some increment of how many times this has happened (some documents are up to their 30th iteration) I understand that there is probably some room for user education here and that they could just be copying the RO document to a new one, closing and opening the RO doc, then copying all the information back. However, I would like to get to the route cause of the problem and try to stop it from happening in the first place. UPDATE: Apparently the reinstall did not fix the issue. I researched the issue a bit more and found that disabling the background save may take care of it, but I haven't had a chance to try it yet. Does anyone else have any other ideas?

    Read the article

  • Need to write at beginning of file with PHP

    - by Timothy
    I'm making this program and I'm trying to find out how to write data to the beginning of a file rather than the end. "a"/append only writes to the end, how can I make it write to the beginning? Because "r+" does it but overwrites the previous data. $datab = fopen('database.txt', "r+"); Here is my whole file: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Facebook v0.1</title> <style type="text/css"> #bod{ margin:0 auto; width:800px; border:solid 2px black; } </style> </head> <body> <div id="bod"> <?php $fname = $_REQUEST['fname']; $lname = $_REQUEST['lname']; $comment = $_REQUEST['comment']; $datab = $_REQUEST['datab']; $gfile = $_REQUEST['gfile']; print <<<form <table border="2" style="margin:0 auto;"> <td> <form method="post" action=""> First Name : <input type ="text" name="fname" value=""> <br> Last Name : <input type ="text" name="lname" value=""> <br> Comment : <input type ="text" name="comment" value=""> <br> <input type ="submit" value="Submit"> </form> </td> </table> form; if((!empty($fname)) && (!empty($lname)) && (!empty($comment))){ $form = <<<come <table border='2' width='300px' style="margin:0 auto;"> <tr> <td> <span style="color:blue; font-weight:bold;"> $fname $lname : </span> $comment </td> </tr> </table> come; $datab = fopen('database.txt', "r+"); fputs($datab, $form); fclose($datab); }else if((empty($fname)) && (empty($lname)) && (empty($comment))){ print" please input data"; } // end table $datab = fopen('database.txt', "r"); while (!feof($datab)){ $gfile = fgets($datab); print "$gfile"; }// end of while ?> </div> </body> </html>

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >