Search Results

Search found 7586 results on 304 pages for 'header'.

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

  • C header file won't compile with C, but will with C++.

    - by Leif Andersen
    I have the following chunk of a header file BKE_mesh.h: /* Connectivity data */ typedef struct IndexNode { struct IndexNode *next, *prev; int index; } IndexNode; void create_vert_face_map(ListBase **map, IndexNode **mem, const struct MFace *mface, const int totvert, const int totface); void create_vert_edge_map(ListBase **map, IndexNode **mem, const struct MEdge *medge, const int totvert, const int totedge); Note that the header file was prepared for the possibility of being used in a C++ file, as it had: #ifdef __cplusplus extern "C" { #endif at the top of the file, and the needed finish at the bottom. But the class implementing it was written in C. Next, whenever I try to #include the header file, I get an odd error. If the file has a .cpp extension, it compiles just fine, no complaints whatsoever. However, if I do: #include "BKE_mesh.h" inside of a file with a .c extension, I get the following errors: expected ')' before '*' token for the two last functions, in specific, the variable: ListBase **map in both classes. (Note that earlier in the header file, it declared, but not defined ListBase). So, my question is: why is this valid C++ code, but not C code? Thank you.

    Read the article

  • How do I copy the layout from a header of a JTabbedPane onto a JPanel?

    - by Snail
    I have created a "CollapsingPanel"class/sort of a JTabbedPane (code skeleton can be found at http://www.coderanch.com/t/341737/Swing-AWT-SWT-JFace/java/Expand-Collapse-Panels). It is in other words a lot of headers which you click on to show a hidden Panel. At the moment these header-panels are a rectangular box with a LineBorder around them. That is ugly! I'm wondering if there is a way to copy the layout that the JTabbedPane uses for its headers/titles (which is inhierted from Look&Feel I assume) and use it on my JPanel-based headers? So that my headers get a smooth look which is in line with the rest of the program (based on Look&Feel!) instead of looking like alien flat blocks. Illustrated below with the headers nicely circled in green ;) I want to apply the header-look from 2nd picture over the red header JPanel in picture 1: Picture 1: hxxp://img7.imageshack.us/img7/2319/34158982.png - change to http, I got <10 rep :( Pictrue 2: hxxp://img46.imageshack.us/img46/2572/jtabpane.png

    Read the article

  • Haproxy not properly passing on X-Forwarded-For header

    - by JesseP
    I have backend web servers that receive requests by way of haproxy-nginx-fastcgi. The web app used to see multiple ip's coming through in the X-Forwarded-For header, chained together with commas (most original IP on the left). At some point in the recent past (just noticed, so not sure what caused it) something changed, and now I'm only seeing a single IP passed in the header to my web application. I've tried with haproxy 1.4.21 and 1.4.22 (recent upgrade) with the same behavior. Haproxy has the forwardfor header set: option forwardfor Nginx fastcgi_params config defines this header to be passed to the app: fastcgi_param HTTP_X_FORWARDED_FOR $http_x_forwarded_for; Anyone have any ideas on what might be going wrong here? EDIT: I just started logging the $http_x_forwarded_for variable in nginx logs, and nginx is only ever seeing a single IP, which shouldn't ever be the case, as we should always see our haproxy ip added in there, right? So, issue must either be in nginx handling of the variable coming in, or haproxy not building it properly. I'll keep digging... EDIT #2: I enabled request and response header logging in HAProxy, and it is not spitting anything out for X-Forwarded-For, which seems very odd: Oct 10 10:49:01 newark-lb1 haproxy[19989]: 66.87.95.74:47497 [10/Oct/2012:10:49:01.467] http service/newark2 0/0/0/16/40 301 574 - - ---- 4/4/3/0/0 0/0 {} {} "GET /2zi HTTP/1.1" O Here are the options i set for this in my frontend: mode http option httplog capture request header X-Forwarded-For len 25 capture response header X-Forwarded-For len 25 option httpclose option forwardfor EDIT #3: It really seems like haproxy is munging the header and just passing on a single one to the backend. This is fairly impacting to our production service, so if anyone has an ideas it would be greatly appreciated. I'm stumped... :(

    Read the article

  • How to set response header in JAX-RS so that user sees download popup for Excel?

    - by masato-san
    I wrote code that generate Excel file using REST JAX-RS and I confirmed that the generated Excel file is in GlassFish server directory. But my goal is when user click on the button (which generate Excel .xls), I want download popup to show up asking user whether to save or open the .xls file just like any other web services doing for downloading any type of files. According to my search, the step is: generate Excel .xls (DONE) write the excel to stream in JAX-RS file, set response header to something like, String fileName = "Blah_Report.xls"; response.setHeader("Content-Disposition", "attachment; filename=" + fileName); My question is I'm doing all of this in JAX-RS file and I don't have HttpServletResponse object available. According to the answer from Add Response Header to JAX-RS Webservice He says: You can inject a reference to the actual HttpServletResponse via the @Context annotation in your webservice and use addHeader() etc. to add your header. I can't really figure what exactly that means without sample code..

    Read the article

  • Correct use of SMTP "Sender" header?

    - by Eric Rath
    Our web application sends email messages to people when someone posts new content. Both sender and recipient have opted into receiving email messages from our application. When preparing such a message, we set the following SMTP headers: FROM: [email protected] TO: [email protected] SENDER: [email protected] We chose to use the author's email address in the FROM header in an attempt to provide the best experience for the recipient; when they see the message in their mail client, the author is clear. To avoid the appearance of spoofing, we added the SENDER header (with our own company email address) to make it clear that we sent the message on the author's behalf. After reading RFCs 822 and 2822, this seems to be an intended use of the sender header. Most receiving mail servers seem to handle this well; the email message is delivered normally (assuming the recipient mailbox exists, is not over quota, etc). However, when sending a message FROM an address in a domain TO an address in the same domain, some receiving domains reject the messages with a response like: 571 incorrect IP - psmtp (in reply to RCPT TO command) I think this means the receiving server only saw that the FROM header address was in its own domain, and that the message originated from a server it didn't consider authorized to send messages for that domain. In other words, the receiving server ignored the SENDER header. We have a workaround in place: the webapp keeps a list of such domains that seem to ignore the SENDER header, and when the FROM and TO headers are both in such a domain, it sets the FROM header to our own email address instead. But this list requires maintenance. Is there a better way to achieve the desired experience? We'd like to be a "good citizen" of the net, and all parties involved -- senders and recipients -- want to participate and receive these messages. One alternative is to always use our company email address in the FROM header, and prepend the author's name/address to the subject, but this seems a little clumsy.

    Read the article

  • How to make g++ search for header files in a specific directory?

    - by Bane
    I have a project that is subdivided into a few directories with code in them. I'd like to to have g++ search for header files in the project's root directory, so I can avoid different include paths for same header files across multiple source files. Mainly, the root/ directory has sub-directories A/, B/ and C/, all of which have .hpp and .cpp files inside. If some source file in A wanted to include file.hpp, which was in B, it would have to do it like this: #include "../B/file.hpp". Same for another source file that was in C. But, if A itself had sub-directories with files that needed file.hpp, then, it would be inconsistent and would cause errors if I decided to move files (because the include path would be "../../B/file.hpp"). Also, this would need to work from other projects as well, which reside outside of root/. I already know that there is an option to manually copy all my header files into a default-search directory, but I'd like to do this the way I described.

    Read the article

  • Correct use of SMTP "Sender" header?

    - by Eric Rath
    Our web application sends email messages to people when someone posts new content. Both sender and recipient have opted into receiving email messages from our application. When preparing such a message, we set the following SMTP headers: FROM: [email protected] TO: [email protected] SENDER: [email protected] We chose to use the author's email address in the FROM header in an attempt to provide the best experience for the recipient; when they see the message in their mail client, the author is clear. To avoid the appearance of spoofing, we added the SENDER header (with our own company email address) to make it clear that we sent the message on the author's behalf. After reading RFCs 822 and 2822, this seems to be an intended use of the sender header. Most receiving mail servers seem to handle this well; the email message is delivered normally (assuming the recipient mailbox exists, is not over quota, etc). However, when sending a message FROM an address in a domain TO an address in the same domain, some receiving domains reject the messages with a response like: 571 incorrect IP - psmtp (in reply to RCPT TO command) I think this means the receiving server only saw that the FROM header address was in its own domain, and that the message originated from a server it didn't consider authorized to send messages for that domain. In other words, the receiving server ignored the SENDER header. We have a workaround in place: the webapp keeps a list of such domains that seem to ignore the SENDER header, and when the FROM and TO headers are both in such a domain, it sets the FROM header to our own email address instead. But this list requires maintenance. Is there a better way to achieve the desired experience? We'd like to be a "good citizen" of the net, and all parties involved -- senders and recipients -- want to participate and receive these messages. One alternative is to always use our company email address in the FROM header, and prepend the author's name/address to the subject, but this seems a little clumsy.

    Read the article

  • re-direct SSL pages using header statement based on port

    - by bob's your brother
    I found this in the header.php file of a e-commerce site. Is this better done in a .htaccess file. Also what would happen to any post parameters that get caught in the header statement. // flip between secure and non-secure pages $uri = $_SERVER['REQUEST_URI']; // move to secure SSL pages if required if (substr($uri,1,12) == "registration") { if($_SERVER['SERVER_PORT'] != 443) { header("HTTP/1.1 301 Moved Permanently"); header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); exit(); } } // otherwise us regular non-SSL pages else { if($_SERVER['SERVER_PORT'] == 443) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); exit(); } }

    Read the article

  • Finding header files

    - by rwallace
    A C or C++ compiler looks for header files using a strict set of rules: relative to the directory of the including file (if "" was used), then along the specified and default include paths, fail if still not found. An ancillary tool such as a code analyzer (which I'm currently working on) has different requirements: it may for a number of reasons not have the benefit of the setup performed by a complex build process, and have to make the best of what it is given. In other words, it may find a header file not present in the include paths it knows, and have to take its best shot at finding the file itself. I'm currently thinking of using the following algorithm: Start in the directory of the including file. Is the header file found in the current directory or any subdirectory thereof? If so, done. If we are at the root directory, the file doesn't seem to be present on this machine, so skip it. Otherwise move to the parent of the current directory and go to step 2. Is this the best algorithm to use? In particular, does anyone know of any case where a different algorithm would work better?

    Read the article

  • Office Word 2007 Interop - Header FieldCodes not showing up in my code, but are when viewed with Wor

    - by Ryan
    Hello, I'm writing an application in Delphi (have two over revisions of it written in both C# and Visual Basic, also). In my C# and Visual Basic version, I did something like the following to loop through the header/footer FieldCodes: // Supress filename, date and username field codes in headers fieldCount = WordApp.ActiveDocument.Sections[1].Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Fields.Count; for (Int32 x = 1; x <= fieldCount; x++) { if ((WordApp.ActiveDocument.Sections[1].Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Fields[x].Type == Microsoft.Office.Interop.Word.WdFieldType.wdFieldDate) || (WordApp.ActiveDocument.Sections[1].Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Fields[x].Type == Microsoft.Office.Interop.Word.WdFieldType.wdFieldFileName) || (WordApp.ActiveDocument.Sections[1].Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Fields[x].Type == Microsoft.Office.Interop.Word.WdFieldType.wdFieldUserName)) { WordApp.ActiveDocument.Sections[1].Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Fields[x].Select(); WordApp.Selection.TypeText("{ " + WordApp.ActiveDocument.Sections[1].Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Fields[x].Code.Text + " }"); } } In my Delphi one I'm doing the same kind of routine. But, I've got a Word file that I'm trying to process and it has a Date FieldCode in the Header. My code is not finding the field code for some odd reason. It says there's no Fields in the Header. Does anyone know if there's such thing as like hidden FieldCodes, or something that would cause these to not show up in my code? Thanks, Ryan

    Read the article

  • Should '#include' and 'using' statements be repeated in both header and implementation files (C++)?

    - by Dr. Monkey
    I'm fairly new to C++, but my understanding is that a #include statement will essentially just dump the contents of the #included file into the location of that statement. This means that if I have a number of '#include' and 'using' statements in my header file, my implementation file can just #include the header file, and the compiler won't mind if I don't repeat the other statements. What about people though? My main concern is that if I don't repeat the '#include', 'using', and also 'typedef' (now that I think of it) statements, it takes that information away from the file in which it's used, which could lead to confusion. I am just working on small projects at the moment where it won't really cause any issues, but I can imagine that in larger projects with more people working on them it could become a significant issue. An example follows: //Unit.h #include <string> #include <ostream> #include "StringSet.h" using std::string; using std::ostream; class Unit { public: //public members private: //private members //unrelated side-question: should private members //even be included in the header file? } ; //Unit.cpp #include "Unit.h" //The following are all redundant from a compiler perspective: #include <string> #include <ostream> #include "StringSet.h" using std::string; using std::ostream; //implementation goes here

    Read the article

  • My VB crushes for a pre-header non recognized

    - by Newben
    I have a great problem to deal : no access anymore to Ubuntu through my VirtualBox. I always have the same message Session failed to Open Could not open the medium '/Users/me/VirtualBox VMs/Ubuntu/Ubuntu.vdi'. VDI: error reading pre-header in '/Users/me/VirtualBox VMs/Ubuntu/Ubuntu.vdi' (VERR_DEV_IO_ERROR). VD: error VERR_VD_VDI_INVALID_HEADER opening image file '/Users/me/VirtualBox VMs/Ubuntu/Ubuntu.vdi' (VERR_VD_VDI_INVALID_HEADER). Code d'erreur : NS_ERROR_FAILURE (0x80004005) Composant : Medium Interface : IMedium {53f9cc0c-e0fd-40a5-a404-a7a5272082cd} I tried to follow this post explaining how to mount manually the vdi file. But I can't open my 6go sized file nor with HexFiend, nor with 0exED... And if I did, how do I find the pre-header ?

    Read the article

  • Installing missing package that provides Xm/Xm.h

    - by Nicholas Kinar
    I'm compiling a software package that requires a header file. The header file is missing from my Ubuntu 11.10 (64-bit) installation. During the compilation using make, gcc and gfortran, I receive the following error message. XMstr.c:7:19: fatal error: Xm/Xm.h: No such file or directory Googling for an answer leads me to believe that a MESA library needs to be installed on my system, but I can't find an exact match for the package name. What might be the name of the package that I need to install? Does the package have the same name on more recent Ubuntu distros?

    Read the article

  • Is it a good idea to work on header files only, just at the start of the project?

    - by m4design
    To explain my point further, I'm a beginner in programming, and I'm working on a small project. Instead of separating the .cpp file from the header file, I'm implementing the code in the header files, and making one .cpp file for testing. I do this to have less files, hence easier navigation. Then later I'll separate the code as it should be. Will this cause any problems? should I continue doing that? Thanks.

    Read the article

  • PHP: How do I have a variable hhtp-header value for my GET request?

    - by Cortopasta
    I want the user to submit an answer to a question, then upon submission be redirected back to the page where they asked the question and I can't seem to get this to work: if (!isset($_POST['answer']) && !isset($_POST['verse'])) { echo "Please fill out form."; } elseif (!isset($_POST['answer']) || !isset($_POST['verse'])) { echo "one field left blank"; } else { $user->submitAnswer($question_id); header("Location: welcome.php?question_id=$question_id"); exit; } What am I doing wrong? EDIT: Sorry, wasn't very clear. I'm trying to pass the variable $question_id to the header(location: part so that it will pull up the question they were just on and show the answer they posted

    Read the article

  • Hide Crystal Report Header

    - by Chandana De Silva
    Hi all, in my Crystal Report have a Page Header(section Page Header "a" and Page Header "b") and Groupe Header #1 and #2 My problem is, I want to hide Page Header "a" when Group #2 have more records, I want to print records next page without Page Header "a" Please reply me , its an urgent one.. Thanks in advance

    Read the article

  • Is using .h as a header for a c++ file wrong?

    - by Chris Huang-Leaver
    Is using .h as a header for a c++ file wrong? I see it all over the place, especially with code written in the "C style". I noticed that Emacs always selects C highlighting style for a .h header, but c++ for hpp or hh. Is it actually "wrong" to label your headers .h or is it just something which annoys me? EDIT: There is a good (ish) reason why this annoys me, if I have project files labelled, 'hpp & cpp' I can get away with 'grep something *pp' etc. otherwise I have to type '.h cpp'

    Read the article

  • How to specify HTTP expiration header? (ASP.NET MVC+IIS)

    - by Marek
    I am already using output caching in my ASP.NET MVC application. Page speed tells me to specify HTTP cache expiration for css and images in the response header. I know that the Response object contains some properties that control cache expiration. I know that these properties can be used to control HTTP caching for response that I am serving from my code: Response.Expires Response.ExpiresAbsolute Response.CacheControl or alternatively Response.AddHeader("Expires", "Thu, 01 Dec 1994 16:00:00 GMT"); The question is how do I set the Expires header for resources that are served automatically, e.g. images, css and such?

    Read the article

  • Are there any alternative to the header(); function ?

    - by Simon
    The thing is, I have a log-in page. And, when user enters Username & Password, they must be re-directed to success/failure page. Now, I have placed a "header('location:welcome.php');" after mysql rows are returned. But, it is giving me Header already sent errors, and I don't know much about PHP to do anything about it, let alone understand why it is happening. So, how to you transfer a user to another page after log-in data is verified? Same problem is happening with register, post, comment and search functions in my site.

    Read the article

  • “X_FORWARDED_FOR” Header Doesn't Present In The Request

    - by Radi
    In my web application I need to extract the real ip address for clients behind proxy, after searching I found that the possible method to do that is to read the content of "X_FORWARDED_FOR" header , I am using java servlet and the headers of the incoming request doesn't contain "X_FORWARDED_FOR" header , So why the header doesn't included in the request? I am using java 1.7 , tomcat v7 , proxy server :TMG and configured to use "X_FORWARDED_FOR" header . Please advice. Thanks in advance.

    Read the article

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