Search Results

Search found 3281 results on 132 pages for 'headers'.

Page 19/132 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Splitting Code into Headers/Source files

    - by cam
    I took the following code from the examples page on Asio class tcp_connection : public boost::enable_shared_from_this<tcp_connection> { public: typedef boost::shared_ptr<tcp_connection> pointer; static pointer create(boost::asio::io_service& io_service) { return pointer(new tcp_connection(io_service)); } tcp::socket& socket() { return socket_; } void start() { message_ = make_daytime_string(); boost::asio::async_write(socket_, boost::asio::buffer(message_), boost::bind(&tcp_connection::handle_write, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); } private: tcp_connection(boost::asio::io_service& io_service) : socket_(io_service) { } void handle_write(const boost::system::error_code& /*error*/, size_t /*bytes_transferred*/) { } tcp::socket socket_; std::string message_; }; I'm relatively new to C++ (from a C# background), and from what I understand, most people would split this into header and source files (declaration/implementation, respectively). Is there any reason I can't just leave it in the header file if I'm going to use it across many source files? If so, are there any tools that will automatically convert it to declaration/implementation for me? Can someone show me what this would look like split into header/source file for an example (or just part of it, anyway)? I get confused around weird stuff like thistypedef boost::shared_ptr<tcp_connection> pointer; Do I include this in the header or the source? Same with tcp::socket& socket() I've read many tutorials, but this has always been something that has confused me about C++.

    Read the article

  • jQgrid: multiple column row headers

    - by Jonathan
    I am trying to extend my jQGrid to have multiple rows for the header. It will look something like this ----------------------- Level 1 - > | Application | ----------------------- Level 2 - > |Code | Name | ----------------------- | 0002827| Mobile Phone1 | 0202827| Mobile Phone2 | 0042827| Mobile Phon3e | 0005827| Mobile Phone4 | 0002627| Mobile Phon5e | 0002877| Mobile Phone6 | 0002828| Mobile Phone7 I am wondering how to do this with jQGrid 3.8.2? Any ideas?

    Read the article

  • Headers set on embedding

    - by mschoening
    Lets say I have a URL (http://www.example.com/something). Is the following scenario somehow possible? A) The user visits the URL directly and a standard page with markup, js, etc. is shown. B) The user embeds the same URL in an image tag and the URL is served only as an image.

    Read the article

  • C++ - Distributing different headers than development

    - by Ben
    I was curious about doing this in C++: Lets say I have a small library that I distribute to my users. I give my clients both the binary and the associated header files that they need. For example, lets assume the following header is used in development: #include <string> ClassA { public: bool setString(const std::string & str); private: std::string str; }; Now for my question. For deployment, is there anything fundamentally wrong with me giving a 'reduced' header to my clients? For example, could I strip off the private section and simply give them this: #include <string> ClassA { public: bool setString(const std::string & str); }; My gut instinct says "yes, this is possible, but there are gotchas", so that is why I am asking this question here. If this is possible and also safe, it looks like a great way to hide private variables, and thus even avoid forward declaration in some cases. I am aware that the symbols will still be there in the binary itself, and that this is just a visibility thing at the source code level. Thanks!

    Read the article

  • Post values in PHP Headers

    - by kumar
    Hi.. I want send some data to a remote webpage from my site. Actually it can be achieved through form hidden variables. but for security reason, i want set as post variables in header and then send to that webpage. i use this code $post_data = 'var1=123&var2=456'; $content_length = strlen($post_data); header('POST http://localhost/testing/test.php HTTP/1.1'); header('Host: localhost'); header('Connection: close'); header('Content-type: application/x-www-form-urlencoded'); header('Content-length: ' . $content_length); header($post_data); but my code doesn't work properly. help me...

    Read the article

  • C/C++ Headers in NetBeans

    - by sterh
    Hi to all, I installed IDE NetBeans for C/C++ development. I created C project with main.c and makefile generated netbeans. When i add test.h file in my project and try to compile it, i see that netbeans does not see this header file, and that I would not write it, even if there are errors anyway compilation is successful. How to connect a header file in netbeans? Thanks.

    Read the article

  • Warning: session_start(): Cannot send session cache limiter - headers already sent

    - by shyam
    I am receiving this warning in a page while I try starting the session. <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Video</title> </head> -this is the part of the code. There are no characters (not even space) before the first line. This page is reached after logging in from another page, through redirection. Any help? (PHP version is 5.2)

    Read the article

  • $Id tag in comment headers

    - by Bernhard
    When I read source from open source projects I often find a comment line with "$Id" at the header of the file, f. ex.: // $Id: addappwindowa.c 30792 2009-03-07 22:40:04Z neil $ Is there an "offical" syntax for this lines? (What does "30792" means? ) Are there editors that auto-generate these "$Id"s? Are there any tools that use this information?

    Read the article

  • php mp3 headers in google chrome

    - by David
    I have this in a php to show a mp3 file, it code works fine on firefox and explorer but in chrome it not work. The chrome player appears but no sound and not increases time $ext = strtolower(substr(strrchr($filename,"."),1)); $ctype="audio/mpeg"; header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); header( 'Cache-Control: no-store, no-cache, must-revalidate' ); header( 'Cache-Control: post-check=0, pre-check=0', false ); header( 'Pragma: no-cache' ); header("Content-Type: $ctype"); header("Content-Length: ".$len);

    Read the article

  • Is putting $_GET in headers safe? (PHP)

    - by ggfan
    In my profile.php script, I have a flag function that allows users to flag that user. If they flag a user, it sends data (user_id, reason, etc) to a file called flag.php which does all the banning and stuff. The data is sent to flag.php through header("Location: flag.php?user_id=___&reason=___") Then in flag.php, after it does all the banning, it redirects the user back to the profile through another header. The user never sees the flag.php. Is my flag.php safe? because they never see the script?

    Read the article

  • JAAS : on Callback ( Interesting based on HTTP headers )

    - by VJS
    I am using NameCallback and PasswordCallback for username and password.For username and password, popup comes on browser and when i enter username ans password, JAAS authenticates my request. On the wireshark, I have seen that 401 Unauthorized message (WWW-Authenticate header)comes and when i enter username/password HTTP request with credentials generate ( with Authorization header) and goes to server. My requirement : I don't want pop up to come.My application on other server having username / password, so once it received 401 then based on some logic it will generate HTTP request with Authorization header / credentials and sent it back. FLow : User - Other Server - My Tomcat5.5 Here on Other Server, nobody is available to enter username/password manually.Application is deployed and it will only generate HTTP request with credential and sent it back to tomcat. Can we have any other callback which behave like this.Need your help.Please provide me feedback as well related to approach.

    Read the article

  • Within headers, images with alt text vs. text

    - by Court
    Do search engines treat the alt text of an image placed within an h1 tag the same way they would treat regular text placed in an h1 tag? I gave a search through here looking for an answer to this question, but was only able to find information on image replacement and the infamous h1 debate. For example would: <h1><img src="#" alt="Contact Us" /></h1> Act the same as: <h1>Contact Us</h1> In the electronic eye of a search engine? This seems considerably less "CSS Hacky" than other image replacement techniques like negative text indents, display:none, height:0, or ridiculous z-index integers.

    Read the article

  • printing 2d table (headers)

    - by k0re
    Hi Is there are a better way than this one to print 2d table? std::cout << std::setw(25) << left << "FF.name" << std::setw(25) << left << "BB.name" << std::setw(12) << left << "sw.cycles" << std::setw(12) << left << "hw.cycles" << "\n" << std::setw(25) << left << "------" << std::setw(25) << left << "------" << std::setw(12) << left << "---------" << std::setw(12) << left << "---------" << "\n";

    Read the article

  • Nvidia drivers don't work with mainline kernel

    - by dutchie
    I want to try some of the new features in the btrfs filesystem, and to do that I need to use a newer kernel than is included in Ubuntu 12.04. To do that, I have installed linux-headers-3.4.0-030400_3.4.0-030400.201205210521_all.deb, linux-headers-3.4.0-030400-generic_3.4.0-030400.201205210521_amd64.deb, and linux-image-3.4.0-030400-generic_3.4.0-030400.201205210521_amd64.deb from the mainline kernel download here. However, on rebooting into the 3.4 kernel, my desktop is stuck at a very low resolution and I cannot increase it to the full. This did happen when I first installed, but a simple install of the nvidia-current package got everything working nicely with my GTX570 card. There were appear to be some DKMS errors when I installed the kernel, and they indicated I should look at /var/lib/dkms/nvidia-current/295.40/build/make.log: josh@sirius:~/Downloads$ sudo dpkg -i linux-*.deb Selecting previously unselected package linux-headers-3.4.0-030400. (Reading database ... 309400 files and directories currently installed.) Unpacking linux-headers-3.4.0-030400 (from linux-headers-3.4.0-030400_3.4.0-030400.201205210521_all.deb) ... Selecting previously unselected package linux-headers-3.4.0-030400-generic. Unpacking linux-headers-3.4.0-030400-generic (from linux-headers-3.4.0-030400-generic_3.4.0-030400.201205210521_amd64.deb) ... Selecting previously unselected package linux-image-3.4.0-030400-generic. Unpacking linux-image-3.4.0-030400-generic (from linux-image-3.4.0-030400-generic_3.4.0-030400.201205210521_amd64.deb) ... Done. Setting up linux-headers-3.4.0-030400 (3.4.0-030400.201205210521) ... Setting up linux-headers-3.4.0-030400-generic (3.4.0-030400.201205210521) ... Examining /etc/kernel/header_postinst.d. run-parts: executing /etc/kernel/header_postinst.d/dkms 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic ERROR (dkms apport): kernel package linux-headers-3.4.0-030400-generic is not supported Error! Bad return status for module build on kernel: 3.4.0-030400-generic (x86_64) Consult /var/lib/dkms/nvidia-current/295.40/build/make.log for more information. Setting up linux-image-3.4.0-030400-generic (3.4.0-030400.201205210521) ... Running depmod. update-initramfs: deferring update (hook will be called later) Examining /etc/kernel/postinst.d. run-parts: executing /etc/kernel/postinst.d/dkms 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic ERROR (dkms apport): kernel package linux-headers-3.4.0-030400-generic is not supported Error! Bad return status for module build on kernel: 3.4.0-030400-generic (x86_64) Consult /var/lib/dkms/nvidia-current/295.40/build/make.log for more information. run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic update-initramfs: Generating /boot/initrd.img-3.4.0-030400-generic run-parts: executing /etc/kernel/postinst.d/pm-utils 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic run-parts: executing /etc/kernel/postinst.d/update-notifier 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic Generating grub.cfg ... Found linux image: /boot/vmlinuz-3.4.0-030400-generic Found initrd image: /boot/initrd.img-3.4.0-030400-generic Found linux image: /boot/vmlinuz-3.2.0-24-generic Found initrd image: /boot/initrd.img-3.2.0-24-generic Found memtest86+ image: /memtest86+.bin Found Ubuntu 12.04 LTS (12.04) on /dev/sda1 Found Windows 7 (loader) on /dev/sda2 Found Windows 7 (loader) on /dev/sda3 done /var/lib/dkms/nvidia-current/295.40/build/make.log: DKMS make.log for nvidia-current-295.40 for kernel 3.4.0-030400-generic (x86_64) Thu Jun 7 00:58:39 BST 2012 NVIDIA: calling KBUILD... test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \ echo; \ echo " ERROR: Kernel configuration is invalid."; \ echo " include/generated/autoconf.h or include/config/auto.conf are missing.";\ echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ echo; \ /bin/false) mkdir -p /var/lib/dkms/nvidia-current/295.40/build/.tmp_versions ; rm -f /var/lib/dkms/nvidia-current/295.40/build/.tmp_versions/* make -f scripts/Makefile.build obj=/var/lib/dkms/nvidia-current/295.40/build cc -Wp,-MD,/var/lib/dkms/nvidia-current/295.40/build/.nv.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/include -I/usr/src/linux-headers-3.4.0-030400-generic/arch/x86/include -Iarch/x86/include/generated -Iinclude -include /usr/src/linux-headers-3.4.0-030400-generic/include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=1024 -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -I/var/lib/dkms/nvidia-current/295.40/build -Wall -MD -Wsign-compare -Wno-cast-qual -Wno-error -D__KERNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\"295.40\" -Wno-unused-function -Wuninitialized -mno-red-zone -mcmodel=kernel -UDEBUG -U_DEBUG -DNDEBUG -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(nv)" -D"KBUILD_MODNAME=KBUILD_STR(nvidia)" -c -o /var/lib/dkms/nvidia-current/295.40/build/.tmp_nv.o /var/lib/dkms/nvidia-current/295.40/build/nv.c In file included from include/linux/kernel.h:19:0, from include/linux/sched.h:55, from include/linux/utsname.h:35, from /var/lib/dkms/nvidia-current/295.40/build/nv-linux.h:38, from /var/lib/dkms/nvidia-current/295.40/build/nv.c:13: include/linux/bitops.h: In function ‘hweight_long’: include/linux/bitops.h:66:41: warning: signed and unsigned type in conditional expression [-Wsign-compare] In file included from /usr/src/linux-headers-3.4.0-030400-generic/arch/x86/include/asm/uaccess.h:577:0, from include/linux/poll.h:14, from /var/lib/dkms/nvidia-current/295.40/build/nv-linux.h:97, from /var/lib/dkms/nvidia-current/295.40/build/nv.c:13: /usr/src/linux-headers-3.4.0-030400-generic/arch/x86/include/asm/uaccess_64.h: In function ‘copy_from_user’: /usr/src/linux-headers-3.4.0-030400-generic/arch/x86/include/asm/uaccess_64.h:53:6: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] In file included from /var/lib/dkms/nvidia-current/295.40/build/nv.c:13:0: /var/lib/dkms/nvidia-current/295.40/build/nv-linux.h: At top level: /var/lib/dkms/nvidia-current/295.40/build/nv-linux.h:114:75: fatal error: asm/system.h: No such file or directory compilation terminated. make[3]: *** [/var/lib/dkms/nvidia-current/295.40/build/nv.o] Error 1 make[2]: *** [_module_/var/lib/dkms/nvidia-current/295.40/build] Error 2 NVIDIA: left KBUILD. nvidia.ko failed to build! make[1]: *** [module] Error 1 make: *** [module] Error 2

    Read the article

  • PHP File unreadable after being downloaded

    - by Drew
    Hi I have a script that creates a file and stores it on the server. The file is encoded in UTF-8 and is a kind of xml file for the cmap software. If i open the file directly from the server then there is no problem and the file can be read. I am forcing a download of this file when a user goes to a specific url. After such a download, the file is unreadable by the cmap software. I have to go into my text editor (notepad++) and change the encoding from UTF-8 to UTF-8 without BOM. Am I sending the wrong headers? Is php doing something to the file when it is downloading it? Any advice on this would really be appreciated. Cheers Drew

    Read the article

  • Any significance to Google's "expires" date being Fri, 01 Jan 1990 00:00:00 GMT?

    - by Robusto
    I was looking at the response headers for my GMail account and noticed that the date Fri, 01 Jan 1990 00:00:00 GMT shows up as the value for "Expires" over and over again. I suppose this is just an easy constant to make sure the browser understands this is past its freshness date. But is there any significance to that particular date? One might as easily have used the same date in 2000, or 1970, or whatever. It's not quirky enough to be someone's birthday or date of college graduation or anything personal like that. Maybe it's just arbitrary, but I was wondering if someone has a good explanation why that particular date was chosen.

    Read the article

  • [JS] XMLHttpRequest problem

    - by mcco
    I am trying to do "POST" with XMLHttpRequest in a firefox extension, and after that I try to get the "Location" header and open it in a new tab. For some reason, the XMLHttpRequest doesn't contain a location header. My code function web(url,request) { var http = new XMLHttpRequest(); http.open('POST',url,true); http.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); http.onreadystatechange=function() { if(http.readyState == 2) { alert(http.getResponseHeader("Location")); } } http.send(request); } Also, if I change the alert to getAllResponseHeaders() to see all headers, I just don't see the location header there. If I try to spy on the request of the original site with Firebug, it does show me the location header in the response. Please help me resolve my issues. Thanks :) P.S. I'm also unable to open a link in new tab using window.open(url, this.window.title);, but as that's not directly related to the rest of this I'll post a separate question to ask about it.

    Read the article

  • How to declare more than one header on PHP

    - by Homer Simpson
    I want to send my users to different pages based on user action. So I made multiple functions at the top of the page like so: <?php function one() { header("location: pagea.php"); } function two() { header("location: pageb.php"); } function three() { header("location: pagec.php"); } ?> Of course I get an error because I am re declaring headers. At first I though it was going to be okay since I am containing them inside functions and am calling any one function at a time. But still I get the error. Is there any other way of doing this?

    Read the article

  • HTTP Content-type header for cached files

    - by Brian
    Hello, Using Apache with mod_rewrite, when I load a .css or .js file and view the HTTP headers, the Content-type is only set correctly the first time I load it - subsequent refreshes are missing Content-type altogether and it's creating some problems for me. I can get around this by appending a random query string value to the end of each filename, eg. http://www.site.com/script.js?12345 However, I don't want to have to do that, since caching is good and all I want is for the Content-type to be present. I've tried using a RewriteRule to force the type but still didn't solve the problem. Any ideas? Thanks, Brian

    Read the article

  • Sending the variable's content to my mailbox in Python?

    - by brilliant
    I have asked this question here about a Python command that fetches a URL of a web page and stores it in a variable. The first thing that I wanted to know then was whether or not the variable in this code contains the HTML code of a web-page: from google.appengine.api import urlfetch url = "http://www.google.com/" result = urlfetch.fetch(url) if result.status_code == 200: doSomethingWithResult(result.content) The answer that I received was "yes", i.e. the variable "result" in the code did contain the HTML code of a web page, and the programmer who was answering said that I needed to "check the Content-Type header and verify that it's either text/html or application/xhtml+xml". I've looked through several Python tutorials, but couldn't find anything about headers. So my question is where is this Content-Type header located and how can I check it? Could I send the content of that variable directly to my mailbox? Here is where I got this code. It's on Google App Engines.

    Read the article

  • Hot to get custom http-header in asp.net?

    - by Sirius Lampochkin
    I have an asp.net appliction on the one server. There I've added code on server-side in Page_Load: Response.AddHeader("key", "password-key-from-hotel"); On the client side I have a form: $lt;form ... action="www.link-to-another-domaint" >   <input type="hidden" id="asd" value="fgh" > .... </form> <script type="text/javascript">   document.forms[0].submit(); </script> Then on the other domain - there is also my other application - I'm trying to get the hedaer "key" by this code: Request.Headers["key"].ToString(); But there is no such header. Is there is a desicion? Where is my mistake?

    Read the article

  • <thead> and <tfoot> in Safari

    - by AJ
    I trying to print a page with multiple tables. The problem is that any of these tables may break and carry over to the next page. Have been trying to get the table header to repeat on the second page. Am currently using thead and setting the display property to table-header-group. This works just as expected in IE and firefox but the header will not repeat in Safari. Since we are using software that converts our page to a pdf document for printing...and the 3rd party software uses a Safari engine, we are stuck with this problem. Does anyone know a way / workaround to make headers repeat if the table spans multiple pages in Safari?

    Read the article

  • Sinatra not passing header with redirect

    - by emson
    Hi All I have a simple Sinatra proxy, which when an endpoint is called, will redirect to another endpoint on the same Sinatra proxy. When I make a request with a header, the proxy doesn't seem to pass this header through to the second endpoint when the request redirects in the first. This is my code: get '/first' do # get the header from the request username = env['HTTP_USERNAME'] # set the header for the response response['username'] = username redirect '/second' end get '/second' do # This doesn't exist when redirected from /first puts env['HTTP_USERNAME'] # Here is a list of all headers env.each_key do |key| puts "KEY: #{key} VALUE: #{env[key]}" unless key.nil? end "DONE" end Any tips would be greatly appreciated. Thanks

    Read the article

  • Php Mailer problem - messages marked as spam -

    - by Guanche
    A few days ago I upgraded Php Mailer and now some email providers my messages mark as spam. This is what I see in the headers of the marked messages: X-SpamTest-Info: {TO: header missing} This is from my php file. $mail->From = $sender; $mail->FromName = $sender_name; $mail->Subject = $subject; $mail->Body = $body; $mail->AddAddress($recipient,$recipient_name); $mail->AddReplyTo($replyto,"No-Reply"); Dont know how to add "to" header and can't understand how it's possible that "to" is missing but email arrives to the correct "to" address...

    Read the article

  • PHP: How to check for response code?

    - by Tom
    Hi, I'm a relative PHP newbie implementing a PayPal IPN listener and all seems to be working fine, except I dont really know how to check for a response code. I've tried something ugly with cURL but it doesn't work at all (I'm not understanding cURL). I've tried this piece of code that I grabbed from somewhere on the net: $fp = fsockopen('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30); $response_headers = get_headers($fp); $response_code = (int)substr($headers[0], 9, 3); ... but it's not working (returns $response_code = 0). So right now, I'm debugging my IPN code without checking for a Response 200. Can anyone more experienced advise me on what's the proper/simple way to check this? Thanks

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >