Programming :: No Match For 'operator<<' In '((HttpRequest*

Jul 13, 2011

I have a simple program from book C++ cookbook, page 291, 8.3, Using Constructors and Destructors to manage resources (or RAII), but it can not get compiled in my g++

------------------------------------------------------------------------------------------------
// Example 8-3. Using constructors and destructors
#include <iostream>
#include <string>
using namespace std;

[code]....

View 2 Replies


ADVERTISEMENT

Programming :: C++ Operator Overloading Within Already Overloaded Operator

Apr 16, 2011

I'm having a bit of an issue using overloaded operators in an already overloaded operator. In my following code, I have overloaded the && operator to compare two Course objects. The operator in turn goes to a function which calls other overloaded operators to compare private object variables of that object to compare them.

View 8 Replies View Related

Programming :: Php/HttpRequest/https: A TLS Packet With Unexpected Length Was Received?

May 29, 2010

I'm working on an application that makes http requests using HttpRequest and it's been doing what I need so far without a problem. Now I need to make https requests as well and when I try to make the request, i get this error message:

Code:
Fatal error: Uncaught exception 'HttpInvalidParamException' with message 'Empty or too short HTTP message: ''' in /home/antoranz/waneesia/html/index.php:0 inner exception 'HttpRequestException' with message 'SSL connect error; gnutls_handshake() failed: A TLS packet with unexpected length was received. (https://www.paypal.com/)' in /home/antoranz/waneesia/html/index.php:104 Stack trace: #0 /home/antoranz/waneesia/html/index.php(0): HttpRequest->send() #1 {main} thrown in /home/antoranz/waneesia/html/index.php on line 0
What's going on?

The project: url

View 1 Replies View Related

Programming :: Match Datetime By The Minute (not An Exact Match By The Second)

Oct 21, 2010

I have the following query:

Code:
$sql="SELECT table1.datetime, table1.user_id, table2.ip, FROM table1,table2 WHERE id='$id' AND (table1.id = table2.id AND table1.datetime = table2.datetime)";

In table2 the datetime fields are about 1 to 2 seconds off due to the source of the data, which I cannot change.

Is it possible via a query match table1.datetime & table2.datetime by HH:MM (ie. to the minute instead of to the second)?

View 1 Replies View Related

Programming :: Can't Get The OR Operator To Work?

Apr 18, 2011

I'm having a bit of trouble getting the OR operator to work.This is the code that I have:

global.php:
Code:
$vars["admin link"] = "<a href='/path/to/admin.php'>Admin</a>";
$vars["admin ip"] = "xxx.xxx.xxx.xx1";
$vars["admin ip2"] = "xxx.xxx.xxx.xx2";

[Code]...

View 7 Replies View Related

Programming :: TCL AND Operator (&) On A Binary Value?

May 1, 2010

I have a binary value which I receive from a controller. Say this binary value is 42. Just plain hex 42. If you would look at that byte in a debugger you would see 42.Now this value hold 8 bits each indicating a high or a low output. So 0x42 = 01000010b. Which means bits 1 and 6 are '1'.When I would want to find out which bits are set and which are not in a language like C, I simply do:

Code:

mask = 0x80;
if (binval & mask) {...}
etc..

However I am programming in TCL, and I try to do:

Code:

set mask 0x80
if { [expr ($binval & $mask) > 0] } {...}
etc...

this fails. At the moment the expr is executed, $binval is evaluated and substituted so the expression I am evaluating is

Code:

set mask 0x80
if { [expr ('B' & '0x80') > 0] } {...}
etc...

Eventually I got it working by converting the $binval into a '0x42' string value, like this:

Code:

binary scan $binval c byte
set byte [format "0x%0x" $byte]
set mask 0x80
if { [expr ($byte & $mask) > 0] } {...}
etc...[

Then the expression yields what I want. But this seems so stupid and clumsy. Isn't there a better way where I can compare two binary values without conversions?

View 14 Replies View Related

Programming :: Getting A Comparison Operator To Work?

Feb 8, 2010

I'm very new at Bash scripting and have a bone head issue that I'm trying (and failing) to resolve. I cannot get this one IF statement to work, it seems the comparison operator does not think the resulting number from the $b*$c+$b operation is an integer even though it is a number. Below is a small proof of concept script with the bit I'm having trouble with.

Code:
#! /bin/bash
a=800
b=700
c=.15
if [ "$a" -le "$(echo "($b*$c+$b)"|bc)" ]

[Code]...

View 6 Replies View Related

Debian Programming :: Square Bracket Operator?

Sep 1, 2014

Is there a way to achieve the following with the square bracket operator?I have a class:

Code: Select allclass A
{
public:
    void SetValue(int index, Item* B);
private:
    int m_iCount;
    ItemCollection Item_Collection;

[code]....

The probelm is that I am not just blindly assigning whatever given on the right hand side to the returned value from operator [], I need to verify it's not NULL, and it is not already there in the Item_Collection, and I also need to increase the count.

View 5 Replies View Related

Programming :: Operator For Floating Point Comparison?

May 10, 2011

I know it is wrong to use the "==" operator to compare the equality of two floating point numbers. Logically it would seem that if the "==" operator is not usable for floating point comparison, then the "<=" operator would also not be usable. Is this true? The lack of google search results on this topic made me think that it must be true. If that is true, then is it true that the only way to compare floats with <= or >= is with something like the code below? Code: bool smaller_than_or_equal(float a, float b) {

if ( fabs(a-b) < EPSILON){return true;}
else if (a < b) {return true;}
else {return false;}

} I think this is a general question, but if specifics are necessary, I am using the C++ language to code at the moment.

View 5 Replies View Related

Programming :: C++ Cin Doesn't Wait For Input By Operator

Jan 4, 2010

I am trying to learn C++.I implemented a simple archive program, and I am in a situation in which the user is prompted by a menu to make a choice.So I have some cout instruction to illustrate the possible choices and then

int choice;
cin>>choice;

and everything works fine.I introduced this code in a "while" loop that checks wether the choice made by the user is valid or not:

bool check=true;
int choice;
while(check)
{
cin>>choice;
if(the choice is valid) {...;check=false}
else cout<<"please make an other choice"
}

What is happening is that if by mistake the user introduces a character in place of a number, the loop repeats indefinitely because the program, when it get to the "cin" instruction, does not pauses to wait for a new input.

View 7 Replies View Related

Programming :: Print Increment Operator In Perl?

Apr 25, 2010

Can one of you point me towards a comprehensive print function tutorial in perl? I was under the impression that everything within quotes will get interpolated - but I am running into exceptions where it is not desirable to run some varaibles under quotes.

ordinal.pl
1 #!/usr/bin/perl
2 $idx = 1;
3 foreach $letter (a..z) {
4 print "Letter #",$idx++," is: $letter
";
5 #print "Letter # $idx++ is: $letter

[Code]...

View 9 Replies View Related

Programming :: Python Equivalent Of C Ternary Operator?

Jun 12, 2010

I've been reading and googling, etc. I've seen some things, but not a definite explanation of this. What is the appropriate way to mimic a C ternary operator using Python? Isn't there an exact proper way to do it? Any difference for using lambda functions? I'm sorry, but I've been searching and it's ambiguous to me how this should be handled. I would appreciate a person's help on this. I came up with this link, but I'm wondering if I'm missing something.[URL]...

So, is that it? In Dive Into Python, it's using the and-or trick. Well, if the above post is the full explanation,

View 6 Replies View Related

Programming :: Subscript Operator For A List Class?

Jun 27, 2010

how to overload the subscript operator ([]) for a list class?

Code:
template <typename T>
class list
{
public:
struct node

[Code]...

View 1 Replies View Related

Programming :: Ostream<< Operator With Double Variable Is Not Accurate?

Mar 27, 2010

I have tryed out this operator on program:

Code:

#include <iostream.h>
#include <iomanip.h>
#include <fstream.h>
ofstream myfile;

[code]...

which definitly is not the same number. I guess somewhere in the convertion from double to char* ("<<") something is not right and what can i do to save these double numbers in an accurate manner in a file?

View 14 Replies View Related

Programming :: String Comparison - [: =: Unary Operator Expected?

Nov 23, 2010

I would like to compare the nmlookup result of IP's stored in the file ips with a list of PC names stored in the file pcs.

Code:
for line in `cat "ips"`
do

[code]....

View 2 Replies View Related

Programming :: C++: Assignment Operator Copy All The Members Also For Structures Containing STL Objects?

Sep 26, 2010

does the assignment operator copy all the members also for structures containing STL objects strings,vectors,vectors of vectors...)? I did try it on my platform,and it works that way (copying all the fields),but i was wondering if it is a standard behavior or not.

View 2 Replies View Related

Programming :: Use Awk Or Sed To Match ?

Apr 8, 2011

How awk and sed can be used to preg match strings? how would I go about matching a string like:

Code:

View 7 Replies View Related

Programming :: Bash Scripting With "source" Or . (dot) Operator (Cygwin & Ubuntu)?

Jan 22, 2010

This one is driving me crazy.

My .bashrc is set as:
if [ -d ~/.bashrc.d ]; then
for file in $(/bin/ls ~/.bashrc.d/); do

[code]....

View 3 Replies View Related

Programming :: Change Or Add Paths For The Compiler To Look In When Using The "<>" Operator?

May 12, 2010

My compiler won't find <new>. Since it's such a basic function, I'm a bit confused. Is <new> supposed to be in a file of its own? Where do I find it? And if it turns out to be missing on my computer, where can I find a <new> one? Or do you see anything else that I do wrong?

After some trying out, it seems I can't find stuff like iostream or any other basic stuff either. The compiler is prolly looking for them at the wrong place. Does anyone know how I change or add paths for the compiler to look in when using the "<>" operator?

View 2 Replies View Related

Programming :: Sed - Add A Line After A Match?

Sep 16, 2009

I need to edit the sudo file on lots of machines. I figure the easiest way is to run a for loop to ssh to each box, sed the sudoers file to a new file & copy/move back over the top of the original (and of course, change permissions accordingly)

The problem is, I'm not sure how to add a line after a match with sed.

So if my file looks like:

Code:

I'd like it to add the new sudoer after "other" so the file looks like:

Code:

View 2 Replies View Related

Programming :: Match A Literal String In Awk?

Jun 2, 2011

how I can match a literal string in awk i.e. making awk to *not* interpret the characters coressponding to its builtin operators in a given string. Take this code:

[Code]...

View 5 Replies View Related

Programming :: Cannot Match Strings That Appear To Be Identical

Feb 25, 2011

i have an sql table with 2 columns i run a script that randomly selects a word from the table in column 1.
the word is displayed on the screen and I guess what it means i concatenate the randomly selected word and the answer the script looks for a match in mysql if it finds a match it says "Good job!" if there is no match it will say "not correct". However when i get it right it says not correct even though when i echo the variables they look exactly the same. the script below:

#!/bin/bash
var=$(mysql translator -u root --password=*-N<<EOF
SELECT word FROM tagalog ORDER BY RAND() LIMIT 1
EOF
)

[Code]....

View 4 Replies View Related

Programming :: Delete Lines Between Match?

May 15, 2011

My problem is like this I have to delete all lines between two pattern match example- suppose below is the content of the file then i have to delete all lines between text1 and text2

...
text1
abc
def
ghi

[Code]....

View 14 Replies View Related

Programming :: Perl Match Rss Tags ?

Apr 22, 2011

I am trying to match the rss files with regex:

If I have a file here:

Code:

I want to match watever that is within the <item></item> tags and save it in the $content variable. however, the <item> tags can spread over multiple lines:

Code:

View 1 Replies View Related

Programming :: Sed Match Last X Lines Of A File

Mar 17, 2009

I'm trying to find the correct sed syntax to match from a given pattern to the end of the file and then append that pattern to the end of the file.

I was trying:

But that prints each line right after its original occurrence. I want to match the block and then append it to the end of the file.

View 12 Replies View Related

Programming :: String Match In Perl ?

Sep 15, 2010

One of my application generates a text file with an XML output in it. I need to read that log files and if the output does not match to a string in couple of tags it should create a log file with the file name and the the tag name.

The two tags where the string should match is:

Identity format tag should always be JPEG , well- formed and valid status tags should be true.

sample output file:

View 7 Replies View Related

Programming :: Display All Lines Before A Match Is Found?

Sep 9, 2010

I have a file, and I have to display all the lines from the beginning of the file till a matching string is found.

I know grep with "-a", "-b" as option does exist, but it needs the number of lines to be printed in advance. eg grep -b 10 "search_string" file so it will print 10 lines before a match is found.

View 3 Replies View Related

Programming :: Match Strings Inside 2 Lists?

Jul 8, 2011

I have that script that checks the nfs mount points:

Code:
#!/bin/ksh
#set -xv
test="DO_NOT_DELETE"
rc=0

[Code]....

I am no expert in loops and it took me all day to write that. I couldn't really tell how to match the string in $df_file and $fs_share, so I did a little workaround with a count.

View 9 Replies View Related

Programming :: Sed Move To Prev Line If Match

Jan 31, 2010

sed move to prev line if match

file:

desired result:

View 4 Replies View Related

Programming :: Sed Regular Expression Match Everything Up To A Certain Character

May 27, 2009

I need to use sed to edit a file that contains just one line. This should be pretty simple, but I've googled and can't seem to figure it out. I need to match everything from a certain string up until the first comma in the line. There are multiple commas in the line and my matching pattern is matching up until the last comma, not the first.

Here is what I'm trying:

As you can see it is matching up until the last comma. Seems like the .* is matching any character including the other commas. The output from this that I am hoping to achieve:

How can I get the regular expression to match from asdf: up until the first comma?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved