Search Results

Search found 4077 results on 164 pages for 'throw'.

Page 60/164 | < Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >

  • Cannot SSH anymore, what went wrong?

    - by lbwtz2
    I use to ssh to a remote server (no rsa-key, just password). Now the server do not accept the connection any more and throw me this error: ssh_exchange_identification: Connection closed by remote host While I can google a little to find a fix I can't figure out what went wrong since I haven't touched anything on the machine since last login. Can you help me find the cause? EDIT: Inspecting the logs I've found these: /var/auth.log /var/log/auth.log:Dec 26 16:40:32 vps sshd[15567]: error: fork: Cannot allocate memory /var/log/auth.log:Dec 26 16:41:05 vps sshd[15567]: error: fork: Cannot allocate memory /var/log/auth.log:Dec 26 16:43:47 vps sshd[15567]: error: fork: Cannot allocate memory /var/log/auth.log:Dec 27 03:20:06 vps sshd[15567]: error: fork: Cannot allocate memory /var/log/auth.log:Dec 27 16:15:02 vps sshd[15567]: error: fork: Cannot allocate memory And in the same span-time I've also found a lot of these: /var/log/auth.log:Dec 26 13:00:01 vps CRON[1716]: PAM unable to dlopen(/lib/security/pam_unix.so): libcrypt.so.1: cannot map zero-fill pages: Cannot allocate memory /var/log/auth.log:Dec 26 13:00:01 vps CRON[1716]: PAM adding faulty module: /lib/security/pam_unix.so What are these?

    Read the article

  • Why is hosted storage so expensive?

    - by Mark Henderson
    There are many questions on Server Fault asking why server storage is so expensive. e.g. Why do I have to pay 50 bucks a month per extra gigabyte of storage or Our file server is always running out of space, why doesn't our sysadmin just throw an extra 1TB drive in there? These questions usually come from people who lack an understanding of how enterprise-level storage works and what influences the price. This question is designed to be the "question to end all questions" regarding the price of enterprise storage.

    Read the article

  • file:// command-line arguments

    - by Cory Grimster
    Is it possible to pass command-line arguments to a program that is invoked via a file:// url? I'm trying to include Remote Desktop links in a wiki page that lists some servers: <a href="file:///c|/windows/system32/mstsc.exe /v:serverName">serverName</a> When I omit the argument the link works fine, but when I include it the link doesn't work. I Googled around a bit and couldn't find any references to this. I suspect that the answer is that file:// urls simple don't accept arguments (I can think of all kinds of ways to abuse them if they do), but I thought I'd throw it out there in case I've simply got the syntax wrong. Thanks.

    Read the article

  • Internet Explorer cannot download rss.php

    - by davethegr8
    Whenever I try to go to an RSS feed in IE7 directly, I get a very strange error. IE 7 tries to download the page, but fails. It throws an error, Internet Explorer cannot download rss.php from www.example.com. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later. But when I click a link to view the same feed, it doesn't throw an error but displays the XML instead. Are there any ways I caan fix this, that don't involve OS hacks? Also, if I try to put an xsl stylesheet on it, it tries to download the file no matter what and still errors.

    Read the article

  • Servlet response wrapper has encoding problem

    - by John O
    A servlet response wrapper is being used in a Servlet Filter. The idea is that the response is manipulated, with a 'nonce' value being injected into forms, as part of defence against CSRF attacks. The web app is using UTF-8 everywhere. When the Servlet Filter is absent, no problems. When the filter is added, encoding issues occur. (It seems as if the response is reverting to 8859-1.) The guts of the code : final class CsrfResponseWrapper extends AbstractResponseWrapper { ... byte[] modifyResponse(byte[] aInputResponse){ ... String originalInput = new String(aInputResponse, encoding); String modifiedResult = addHiddenParamToPostedForms(originalInput); result = modifiedResult.getBytes(encoding); ... } ... } As I understand it, the transition between byte-land and String-land should specify an encoding. That is done here, as you can see, in two places. The value of the 'encoding' variable is 'UTF-8'; the alteration of the String itself is standard string manipulation (with a regex), and never specifies an encoding (addHiddenParamToPostedForms). Where am I in error about the encoding? EDIT: Here is the base class (sorry it's rather long): package hirondelle.web4j.security; import javax.servlet.ServletOutputStream; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintWriter; /** Abstract Base Class for altering response content. (May be useful in future contexts as well. For now, keep package-private.) */ abstract class AbstractResponseWrapper extends HttpServletResponseWrapper { AbstractResponseWrapper(ServletResponse aServletResponse) throws IOException { super((HttpServletResponse)aServletResponse); fOutputStream = new ModifiedOutputStream(aServletResponse.getOutputStream()); fWriter = new PrintWriter(fOutputStream); } /** Return the modified response. */ abstract byte[] modifyResponse(byte[] aInputResponse); /** Standard servlet method. */ public final ServletOutputStream getOutputStream() { //fLogger.fine("Modified Response : Getting output stream."); if ( fWriterReturned ) { throw new IllegalStateException(); } fOutputStreamReturned = true; return fOutputStream; } /** Standard servlet method. */ public final PrintWriter getWriter() { //fLogger.fine("Modified Response : Getting writer."); if ( fOutputStreamReturned ) { throw new IllegalStateException(); } fWriterReturned = true; return fWriter; } // PRIVATE /* Well-behaved servlets return either an OutputStream or a PrintWriter, but not both. */ private PrintWriter fWriter; private ModifiedOutputStream fOutputStream; /* These items are used to implement conformance to the javadoc for ServletResponse, regarding exceptions being thrown. */ private boolean fWriterReturned; private boolean fOutputStreamReturned; /** Modified low level output stream. */ private class ModifiedOutputStream extends ServletOutputStream { public ModifiedOutputStream(ServletOutputStream aOutputStream) { fServletOutputStream = aOutputStream; fBuffer = new ByteArrayOutputStream(); } /** Must be implemented to make this class concrete. */ public void write(int aByte) { fBuffer.write(aByte); } public void close() throws IOException { if ( !fIsClosed ){ processStream(); fServletOutputStream.close(); fIsClosed = true; } } public void flush() throws IOException { if ( fBuffer.size() != 0 ){ if ( !fIsClosed ) { processStream(); fBuffer = new ByteArrayOutputStream(); } } } /** Perform the core processing, by calling the abstract method. */ public void processStream() throws IOException { fServletOutputStream.write(modifyResponse(fBuffer.toByteArray())); fServletOutputStream.flush(); } // PRIVATE // private ServletOutputStream fServletOutputStream; private ByteArrayOutputStream fBuffer; /** Tracks if this stream has been closed. */ private boolean fIsClosed = false; } }

    Read the article

  • Is there a potential for resource leak/double free here?

    - by nhed
    The following sample (not compiled so I won't vouch for syntax) pulls two resources from resource pools (not allocated with new), then "binds" them together with MyClass for the duration of a certain transaction. The transaction, implemented here by myFunc, attempts to protect against leakage of these resources by tracking their "ownership". The local resource pointers are cleared when its obvious that instantiation of MyClass was successful. The local catch, as well as the destructor ~MyClass return the resources to their pool (double-frees are protected by teh above mentioned clearing of the local pointers). Instantiation of MyClass can fail and result in an exception at two steps (1) actual memory allocation, or (2) at the constructor body itself. I do not have a problem with #1, but in the case of #2, if the exception is thrown AFTER m_resA & m_resB were set. Causing both the ~MyClass and the cleanup code of myFunc to assume responsibility for returning these resources to their pools. Is this a reasonable concern? Options I have considered, but didn't like: Smart pointers (like boost's shared_ptr). I didn't see how to apply to a resource pool (aside for wrapping in yet another instance). Allowing double-free to occur at this level but protecting at the resource pools. Trying to use the exception type - trying to deduce that if bad_alloc was caught that MyClass did not take ownership. This will require a try-catch in the constructor to make sure that any allocation failures in ABC() ...more code here... wont be confused with failures to allocate MyClass. Is there a clean, simple solution that I have overlooked? class SomeExtResourceA; class SomeExtResourceB; class MyClass { private: // These resources come out of a resource pool not allocated with "new" for each use by MyClass SomeResourceA* m_resA; SomeResourceB* m_resB; public: MyClass(SomeResourceA* resA, SomeResourceB* resB): m_resA(resA), m_resB(resB) { ABC(); // ... more code here, could throw exceptions } ~MyClass(){ if(m_resA){ m_resA->Release(); } if(m_resB){ m_resB->Release(); } } }; void myFunc(void) { SomeResourceA* resA = NULL; SomeResourceB* resB = NULL; MyClass* pMyInst = NULL; try { resA = g_pPoolA->Allocate(); resB = g_pPoolB->Allocate(); pMyInst = new MyClass(resA,resB); resA=NULL; // ''ownership succesfully transfered to pMyInst resB=NULL; // ''ownership succesfully transfered to pMyInst // Do some work with pMyInst; ...; delete pMyInst; } catch (...) { // cleanup // need to check if resA, or resB were allocated prior // to construction of pMyInst. if(resA) resA->Release(); if(resB) resB->Release(); delete pMyInst; throw; // rethrow caught exception } }

    Read the article

  • HP Photosmart C5280 black ink not printing properly

    - by Andreas Strandfelt
    I just got a used HP Photosmart C5280 from my father in law. There is a problem with the black ink, though. Sometimes, it doesn't print and when it does, it's not really black. An example can be seen at the following link, where I created three black boxes on a Word page and printed. The outcome is somewhat blueish: Other tests with black text only come out as blank pages. I have tried using the print head cleaning utility from the menu of the printer as well as doing the cleaning myself with alcohol. Nothing has worked. Any ideas before I throw out the black cartridge?

    Read the article

  • How can I use the proxy settings on Epic privacy browser to log on to Facebook?

    - by EddieN120
    I love the Epic privacy browser because it is built from the ground up to enhance privacy. It's built on Chromium but because it has stripped out all code that tracks users across the Internet, pages load faster and things work snappier. With one click you can enable a proxy to hide your IP address, sort of like Chrome's "Incognito" mode on steroids. But there's a problem: if I load Epic, go to facebook.com, log in, and then click the proxy button, I can use Facebook for a while. But eventually, Facebook would throw up an error screen, saying that it thinks that my account has been hacked, and then it would make me verify my identity, force me to change my password, etc. I've had to change my password four times in as many days, which is very annoying. Now I turn on the proxy for browsing on to every other site but Facebook. Question: how can I use the proxy settings on Epic privacy browser to successfully log onto and use Facebook?

    Read the article

  • Managing PHP processes on Windows 7 (with WAMP)

    - by Andrea
    Is there a way to manage (especially list and kill) long-running PHP processes on a Windows 7 system set up with WAMP? Every once in a while, I'll accidentally throw an infinite loop into a PHP process and want to kill it. Right now, all I can think to do is to restart all my WAMP services but sometimes the PHP processes manage to survive right through the restart, i.e., I still see them outputting to logs even after WAMP's restarted. And if the process isn't logging, then I have no way at all to know when/if it's been killed. Not to mention, this will wipe out everything I'm doing with WAMP, not just a single process. I don't seem to see anything relevant in the Windows Task Manager, but maybe I'm missing something.

    Read the article

  • How can I set Qmail to relay all mail to one address

    - by MoSiAc
    I'm new to qmail it's setup and working like it should. I need to set it to do something a bit different. I need it to take all mail that would be incoming to it and relay all of that to one address as opposed to whatever address they could have possibly set it to. The idea is we have setup a test enviroment and we want no e-mails from a test server to actually go out to real people so this relay server will catch all of that outgoing mail and throw it into a test e-mail account inbox to check for errors and so forth. I'm honestly not sure if this is even possible so if it's not let me know now so I can come up with a different method to manage all these test e-mails. Thanks

    Read the article

  • Less daunting front end for SQL Server

    - by Martin
    We currently have a few users who have been using Access very succesfully to throw around large amounts of data. We've now got to the point where the data is just too large to be held in Access, as well as wanting to hold it in a single place where multiple users can access it. We have therefore moved the data over to SQL Server. I want to provide a general tool that they can use to view the data on the server and do some simple things like run queries and filters and export the data for offline manipulation. I don't want the support headaches that might come with rolling out SQL Management Studio, and neither do I want to have to create an Access database with links for each current database or ones that are created in the future. Can anyone recommend a simple tool that will connect to a server, list all the databases and allow a user to drill into a table and look at the data. Many thanks.

    Read the article

  • RAID setup for maximizing data retention and read speed

    - by cat pants
    My goals are simple: maximize data retention safety, and maximize read speeds. My first instinct is to do a a three drive software RAID 1. I have only used fakeraid RAID 1 in the past and it was terrible (would have led to data loss actually if it weren't for backups) Would you say software raid 1 or a cheap actual hardware raid card? OS will be linux. Could I start with a two drive raid 1 and add a third drive on the fly? Can I hot swap? Can I pull one of the drives and throw it into a new machine and be able to read all the data? I do not want a situation where I have a raid card fail and have to try and find the same chipset in order to read my data (which i am assuming can happen) Please clarify any points on which it sounds like I have no idea what I am talking about, as I am admittedly inexperienced here. (My hardest lesson was fakeraid lol) Thanks!

    Read the article

  • Options to Reformat USB Drive

    - by user8783
    I have a 64GB usb thumb drive. When I plug it into a Windows system (I have tried several machines with both Windows 7 and 8), the system attempts to read it and never completes. The drive does not show up in the device manager, nor does it appear in Computer Management - Disk Management. If I click on the "Safely Remove Hardware" icon, however, I do get an option for "Eject Mass Storage Media", although it never accomplishes anything. Also, as long as the USB drive is connected, I cannot access other USB drives or even restart my computer. It seems as though it locks up Windows Explorer. Is there any option to reformat this drive? It was a great drive up until all this craziness began and I would hate to throw it out because it was rather pricey.

    Read the article

  • Using Dynamic Proxies to centralize JPA code

    - by Daziplqa
    Hi All, Actually, This is not a question but really I need your opinions in a matter... I put his post here because I know you always active, so please don't consider this a bad question and share me your opinions. I've used Java dynamic proxies to Centralize The code of JPA that I used in a standalone mode, and Here's the dynamic proxy code: package com.forat.service; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.logging.Level; import java.util.logging.Logger; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence; import com.forat.service.exceptions.DAOException; /** * Example of usage : * <pre> * OnlineFromService onfromService = * (OnlineFromService) DAOProxy.newInstance(new OnlineFormServiceImpl()); * try { * Student s = new Student(); * s.setName("Mohammed"); * s.setNationalNumber("123456"); * onfromService.addStudent(s); * }catch (Exception ex) { * System.out.println(ex.getMessage()); * } *</pre> * @author mohammed hewedy * */ public class DAOProxy implements InvocationHandler{ private Object object; private Logger logger = Logger.getLogger(this.getClass().getSimpleName()); private DAOProxy(Object object) { this.object = object; } public static Object newInstance(Object object) { return Proxy.newProxyInstance(object.getClass().getClassLoader(), object.getClass().getInterfaces(), new DAOProxy(object)); } @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { EntityManagerFactory emf = null; EntityManager em = null; EntityTransaction et = null; Object result = null; try { emf = Persistence.createEntityManagerFactory(Constants.UNIT_NAME); em = emf.createEntityManager();; Method entityManagerSetter = object.getClass(). getDeclaredMethod(Constants.ENTITY_MANAGER_SETTER_METHOD, EntityManager.class); entityManagerSetter.invoke(object, em); et = em.getTransaction(); et.begin(); result = method.invoke(object, args); et.commit(); return result; }catch (Exception ex) { et.rollback(); Throwable cause = ex.getCause(); logger.log(Level.SEVERE, cause.getMessage()); if (cause instanceof DAOException) throw new DAOException(cause.getMessage(), cause); else throw new RuntimeException(cause.getMessage(), cause); }finally { em.close(); emf.close(); } } } And here's the link that contains more info (http://m-hewedy.blogspot.com/2010/04/using-dynamic-proxies-to-centralize-jpa.html) (plz don't consider this as adds, as I can copy and past the entire topic here if you want that) So, Please give me your opinions. Thanks.

    Read the article

  • Windows 7 CD keys, are they interchangable?

    - by unixman83
    I am talking about during installation. Using regular licensing, not volume licensing. Amongst OSes of the same class, are CD keys interchangeable or are they locked to a specific subset of CDs? In other words: If I have 10 legally purchased copies of Windows 7 Professional, can I throw out the discs for all but one? And all the CD keys will work? UPDATE: How about for service packs (when they come out). If I have Windows 7 Professional SP1 and a Windows 7 RTM original? Do they change CD keys between service packs?

    Read the article

  • Multi-monitors and the corners of the screen

    - by Neil Barnwell
    I currently have two monitors (let's call them "left" and "middle" - you'll see why in a sec), and would love three (let's call it "right"). However, I often will throw the mouse-cursor up to the top-right corner on "middle" because for a maximised window that's where the close button will be. If I add the "right" monitor, the mouse cursor will just carry on off "middle" into "right", and aiming for the close button on "middle" will become more difficult. I'm currently using UltraMon 3.10, but does anyone know of a way to get the mouse to stick to the corners, so that it doesn't go off into the other monitor (Synergy allows this by configuring the "gap" where the mouse is allowed to travel from monitor to monitor).

    Read the article

  • Export Import error 'SSIS Data Flow Task could not be created' ... registering DTSPipeline.dll, cannot create task "STOCK:PipelineTask"

    - by Moin Zaman
    I'm about to throw in the towel on this one. Running SQL Server 2008 enterprise on Windows 7 x64. Can't get past this issue. When I try to Import / Export Data from databases through SQL Server Management Studio I get the following Error. Error: TITLE: SQL Server Import and Export Wizard ------------------------------ The SSIS Data Flow Task could not be created. Verify that DTSPipeline.dll is available and registered. The wizard cannot continue and it will terminate. ------------------------------ ADDITIONAL INFORMATION: Cannot create a task with the name "STOCK:PipelineTask". Verify that the name is correct. ({0194F10C-9860-4A4F-AF8B-DE7EFD89859F}) I have tried many solutions found via Google, but none of them have worked. A side issue that may be related is when I try to create an Integration Services Project in Business Intelligence Studio I get a 'project creation failed' error.

    Read the article

  • How to set a low process priority for everything spawned from a command prompt in XP?

    - by Binary Worrier
    As a developer, once or twice a week I run a full build on my XP dev machine. This will run at 100% cpu for 30 or 40 minutes, making my machine usless for anything other than basic browsing & email. Is there anyway I can specify that for a given process (i.e. a command prompt) it and any process spawned by it will hae a lower priority, say taking up no more than 60 - 70% of CPU, leaving my machine more usable. I don't mind the build talking 30 or 40% longer, if I still have use of my machine while it's running. Thanks BW P.S. I'd love to be able to throw more hardware at the problem, but that isn't under my control.

    Read the article

  • Excel: link value once, then prevent change

    - by user1832164
    For some budgeting spreadsheets I'm working on, I'd like to link each month to a value (in this case, a percentage). However, if the original percentage is changed I ONLY want to change values going forward. For example, let's say item one is budgeted at 10%, so each month reflects 10% of the total (which changes every month). If I decide to change that to 12% going forward, I don't want the previously linked values to also change from 10 to 12% (and throw off lots of other numbers). My thought was to have a check box where if I placed an x, the values would be locked to the value at the time of placing the x and no longer change. Is this possible? I know there are options for doing a paste special, but I'm creating this spreadsheet for someone who is not very Excel savvy, so I want it to be as seamless as possible. Many thanks.

    Read the article

  • Fun projects to do with an old 17" LCD Monitor

    - by Adam Haile
    I've got an old 17" LCD that I've had for nearly 9 years now but still works pretty well. It's been my secondary monitor for a few years, but I just got a new 24" monitor, so my current main LCD (19") will become the new secondary screen. Any good suggestions of interesting (and preferably cheap/free) hacks, etc. I could do with this old monitor? I don't want to just throw it out. For example, is there an easy way to turn it into a touch screen or something? I'm open to suggestions

    Read the article

  • How can I see if apache is overloaded and dropping or not accepting connections?

    - by cat pants
    Basically I just want to see if apache is handling a current level of high traffic or if I need to tune it to handle more connections. (I have found plenty of information on the actual tuning, so no help needed there) I know it has been dropping or not accepting connections earlier today, but not seeing anything in the error logs. Is the expected behavior to throw a 503 in the error log if apache cannot accept more connections? If so, what error logging level do I need in order to see these? What is the correct terminology: dropping connections or not accepting connections? MPM is prefork, OS is Linux, apache version is 2.2.15.

    Read the article

  • CRM 2011 Plugin for CREATE (post-operational): Why is the value of "baseamount" zero in post entity image and target?

    - by Olli
    REFORMULATED QUESTION (Apr 24): I am using the CRM Developer Toolkit for VS2012 to create a CRM2011 plugin. The plugin is registered for the CREATE message of the "Invoice Product" entity. Pipeline-Stage is post-operational, execution is synchronous. I register for a post image that contains baseamount. The toolkit creates an execute function that looks like this: protected void ExecutePostInvoiceProductCreate(LocalPluginContext localContext) { if (localContext == null) { throw new ArgumentNullException("localContext"); } IPluginExecutionContext context = localContext.PluginExecutionContext; Entity postImageEntity = (context.PostEntityImages != null && context.PostEntityImages.Contains(this.postImageAlias)) ? context.PostEntityImages[this.postImageAlias] : null; } Since we are in post operational stage, the value of baseamount in postImageEntity should already be calculated from the user input, right? However, the value of baseamountin the postImageEntity is zero. The same holds true for the value of baseamount in the target entity that I get using the following code: Entity targetEntity = (context.InputParameters != null && context.InputParameters.Contains("Target")) ? (Entity)context.InputParameters["Target"] : null; Using a retrieve request like the one below, I am getting the correct value of baseamount: Entity newlyCreated = service.Retrieve("invoicedetail", targetEntity.Id, new ColumnSet(true)); decimal baseAmount = newlyCreated.GetAttributeValue<Money>("baseamount").Value; The issue does not appear in post operational stage of an update event. I'd be glad to hear your ideas/explanations/suggestions on why this is the case... (Further information: Remote debugging, no isolation mode, plugin stored in database) Original Question: I am working on a plugin for CRM 2011 that is supposed to calculate the amount of tax to be paid when an invoice detail is created. To this end I am trying to get the baseamount of the newly created invoicedetail entity from the post entity image in post operational stage. As far as I understood it, the post entity image is a snapshot of the entity in the database after the new invoice detail has been created. Thus it should contain all properties of the newly created invoice detail. I am getting a "postentityimages" property of the IPluginExecutionContext that contains an entity with the alias I registered ("postImage"). This "postImage" entity contains a key for "baseamount" but its value is 0. Can anybody help me understand why this is the case and what I can do about it? (I also noticed that the postImage does not contain all but only a subset of the entities I registered for.) Here is what the code looks like: protected void ExecutePostInvoiceProductCreate(LocalPluginContext localContext) { if (localContext == null) { throw new ArgumentNullException("localContext"); } // Get PluginExecutionContext to obtain PostEntityImages IPluginExecutionContext context = localContext.PluginExecutionContext; // This works: I get a postImage that is not null. Entity postImage = (context.PostEntityImages != null && context.PostEntityImages.Contains(this.postImageAlias)) ? context.PostEntityImages[this.postImageAlias] : null; // Here is the problem: There is a "baseamount" key in the postImage // but its value is zero! decimal baseAmount = ((Money)postImage["baseamount"]).Value; } ADDITION: Pre and post images for post operational update contain non-zero values for baseamount.

    Read the article

  • Toshiba Satellite A305-S6861 Display Problems

    - by brock029
    Well this is the first Laptop I have ever worked on with a dedicated video card. So, there is no video going to the laptops monitor or to an external. Ripped it apart found the gpu and now am stuck. I cant decide if its the gpu that has gone out or the motherboard. Any one have any suggestions? If it were a desktop I would throw in one of my spare video cards. Mainly I don't want to order the video card and eat the $50 if its the motherboard.

    Read the article

  • C++ - getline() keeps reading the same line over and over again for some reason

    - by Jammanuser
    I am wondering WTF my while loop which calls istream& getline ( istream& is, string& str ); keeps reading the same line again. I have the following while loop (nested down several levels of other while loops and if statements) which calls getline, but my output statement which is the first code line in the while loop's block of code tells me it is reading the same line over and over again, which explains why my output file doesn't contain the right data when my program is finished. while (getline(file_handle, buffer_str)) { cout<< buffer_str <<endl; cin.get(); if ((buffer_str.find(';', 0) != string::npos) && (buffer_str.find('\"', 0) != string::npos)) { //we're now at the end of the 'exc' initialiation statement buffer_str.erase(buffer_str.size() - 2, 1); buffer_str += '\n'; for (size_t i = 0; i < pos; i++) { buffer_str += ' '; } buffer_str += "throw(exc);\n"; for (size_t i = 0; i < (pos - 3); i++) { buffer_str += ' '; } buffer_str += '}'; } else if (buffer_str.find(search_str6, 0) != string::npos) { //we're now at the second problem line of the first case buffer_str += " {\n"; output_str += buffer_str; output_str += '\n'; getline(file_handle, buffer_str); //We're now at the beginning of the 'exc' initialiation statement output_str += buffer_str; output_str += '\n'; while (getline(file_handle, buffer_str)) { if ((buffer_str.find(';', 0) != string::npos) && (buffer_str.find('\"', 0) != string::npos)) { //we're now at the end of the 'exc' initialiation statement buffer_str.erase(buffer_str.size() - 2, 1); buffer_str += '\n'; for (size_t i = 0; i < pos; i++) { buffer_str += ' '; } buffer_str += "throw(exc);\n"; for (size_t i = 0; i < (pos - 3); i++) { buffer_str += ' '; } buffer_str += '}'; } output_str += buffer_str; output_str += '\n'; if (buffer_str.find("return", 0) != string::npos) { getline(file_handle, buffer_str); output_str += buffer_str; output_str += '\n'; about_to_break = true; break; //out of this while loop } } } if (about_to_break) { break; //out of the level 3 while loop (execution then goes back up to beginning of level 2 while loop) } output_str += buffer_str; output_str += '\n'; } Because of this problem, my if statement and then my else statement in my loop are not functioning as they should, and it doesn't break out of that loop when it should (though it eventually does break out of it, but I don't know exactly how yet). Anyone have any idea what could be causing this problem?? Thanks in advance.

    Read the article

  • Boost Up My Old Laptop Using a SSD

    - by Sina Bizbone
    I have an old laptop Lenovo SL400 (Core2Due T9550 2.66GHz / 4GB DDR2 Ram). Since I can't afford to buy a new laptop, I thought maybe I could throw an ADATA SP600 64GB SSD as primary drive and move my current HDD to DVD-ROM space by using HDDCADDY. I know that 64gb will come short after installing Visual Studio, SQL Server, etc. So is there anyway to just install the kernel part of windows on SSD and the rest on HDD. Doesn't windows have built-in support to do this? (ReadyBoost is out of picture since it's just simple caching)

    Read the article

< Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >