Hi All.
I'm trying to do some raw socket programming. I have some example code that compiles/run just fine on a 32 bit machine but when I try to compile the same code on a 64 bit machine I get this discrepancy between /usr/includes/sys and/usr/includes/linux header files. I would have thought that on a 64 bit machine all the headers are ...
I am new to Python. I am a C programmer by profession. I have file, whose header has some specific data, that I need to extract. For example, Byte 0-5 has a magic, Byte 6-8 has offset etc.
In C (An Example) :
struct {
int32_t payload_offset,
int32_t len,
char *magic,
int32_t type
int32_t header_size
} file_hd...
Hello,
I'm trying to force a download of a protected zip file (I don't want people to access it without logging in first.
I have the function created for the login and such, but I'm running into a problem where the downloaded file is corrupting.
Here's the code I have:
$file='../downloads/'.$filename;
header("Content-type: applicatio...
I'm trying to implement a tree-like structure with two classes: Tree and Node. The problem is that from each class I want to call a function of the other class, so simple forward declarations are not enough. Let's see an example:
Tree.h:
#ifndef TREE_20100118
#define TREE_20100118
#include <vector>
#include "Node.h"
class Tree
{
...
I've a gridview in my web form and I'm using a the following code in my web form's Save button:
foreach (GridViewRow row in gvList.Rows)
if (row.RowType == DataControlRowType.DataRow)
{ for (int i = 0; i < row.Cells.Count; i++)
{
string headerRowText = ???;
How can I get the...
If I'm using the CGI module in Perl, I can do this
$cgi = CGI->new();
$cgi->header(-type=>"text/html");
Or go for the classic
print "Content-Type: text/html\r\n\r\n";
Does it matter which we use? Is there any difference between the two? Both seem to work.
For me I'd go for the first if I was using CGI anyway, but if not then I wou...
Hello all
Trying a different approach for tooltipping on a gridview using the following code:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
{
if (e.Row.RowType == DataControlRowType.Header)
{
foreach (TableCell cell in e...
Hi,
Seem to have a unique problem. I'm doing form validation using a php script. I initially wrote this code in 2007. All of a sudden it stopped working, and I've been trying to figure out why.
Here's the code:
<?php
$error_msg = '';
// Only Validate Form when it is submitted
if (isset($formSubmit)) {
if (!isset($_SESSION["Firs...
I came across a library written in Objective C (I only have the header file and the .a binary).
In the header file, it is like this:
@interface MyClass : MySuperClass
{
//nothing here
}
@property (nonatomic, retain) MyObject anObject;
- (void)someMethod;
How can I achieve the same thing? If I try to declare a property without i...
I use PHP 5.2.9.
To see/log errors, at the beggining of my script I have:
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 'On');
ini_set('log_errors', 'On');
ini_set('error_log', $_SERVER['DOCUMENT_ROOT'] . '/php.log');
But when I use the first of the next two lines, my script issue a HTTP 500 error, and nothing is displ...
Where is the best place to put Jquery code (or separate Jquery file)? Will pages load faster if I put it in the footer?
...
I want to have a summary row at the top of an AdvancedDataGrid that is not actually a summary of the values in the row: I want to stuff values in there "by hand".
I have no problem writing an ItemRenderer that will figure out which header cell it's showing and lookup the value I want in there. I just don't know how to create the second ...
With PHP, is it possible to send HTTP headers with file_get_contents() ?
I know you can send the user agent from your php.ini file. However, can you also send other information such as HTTP_ACCEPT, HTTP_ACCEPT_LANGUAGE, and HTTP_CONNECTION with file_get_contents() ?
Or is there another function that will accomplish this?
...
I'm using a function called headerLocation() in order to redirect properly.
This is the pertinent part of the function, I'm using it to redirect and then display an appropriate message (personal preference).
function headerLocation($location,$message)
{
$_SESSION['output'] = $message;
header("Location: ". $location);
}
The pro...
Hi there
I was wondering if you could help me, Im trying to set an expiration date on the caching of certain files in my website, are there some tips you could give me how to do that? Ive been able to find some things on how to change entire file types, but not SPECIFIC files. Is that possible?
ExpiresActive On # enab...
I have a banner in actionscript 2, that posts to a URL, and gets a response back. The http header from that is then used to figure out if the posting was successful. This works like a charm i IE, but in Firefox and Safari, the Flash player shomehow interprets the HTTP header as a 0, no matter what the browser actually gets. My guess is t...
Hi, I used the YSlow Firefox add-on and it return the follow result:
Grade F on Add Expires headers
There are 8 static components without a far-future expiration date.
* (no expires) http://localhost:63808/WebSite/css/Global.css?...
* (no expires) http://localhost:63808/WebSite/css/BemVindo.css?...
* (no expires) http://localhost:6380...
I have 3 header files in the project: Form1.h - this is header with implementation there, TaskModel.h with TaskModel.cpp, TaskController.h with TaskController.cpp.
There are content of files:
//-----
TaskController.h
#pragma once
#include "TaskModel.h"
..........
//----
Form1.h
#pragma once
#include "TaskModel.h"
#include "TaskCo...
Given this header , how do I find if the MORE FRAGMENTS field is set or not..
struct sniff_ip {
u_char ip_vhl; /* version << 4 | header length >> 2 */
u_char ip_tos; /* type of service */
u_short ip_len; /* total length */
u_short ip_id; /...
Hi, I'm new to Perl but need to use it on a project I'm working on. What I need to do is check to see if a URL has a 301 redirect and if it has, get the location. The following told me the code but not the location:
use strict;
use warnings;
require LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
$ua->ma...