Programming :: Write A Stream Inserter For A Template Class?

Mar 28, 2011

I had some trouble doing this but finally figured it out. Here is a general solution:

Code:
#include <iostream>
using namespace std;

[code]....

View 1 Replies


ADVERTISEMENT

Programming :: Define A Static Member In A Template Class?

Oct 6, 2009

i have trouble to define a static member in a template, and i search from google, but didn't find any similar case, my case is a little complex, i paste the code below.code in xxx.h

Code:
template <class T> class FreeListManager
{

[code]...

View 6 Replies View Related

Server :: Error "Can't Locate Class/Template.pm In @INC" Trying To Setup A Website On CentOS

Aug 27, 2010

I get this error when setting up my site. Software error: Can't locate Class/Template.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /var/www/html/en/subscribe.cgi line 10. BEGIN failed--compilation aborted at /var/www/html/en/subscribe.cgi line 10. send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.

I have tried the following with no success: # yum install perl-Class-Template from the Rpmforge repo [URL] Or use the cpan command 1) # yum install perl-CPAN

2) # cpan
3) > install Class::Template
..

The website I am trying to get working is hosted on CentOS. The version is 2.6.18-194.11.1.el5PAE. Im trying to get migrate the site from one server to another and now the cgi script doesnt execute correctly as it requires the class Template which is in a folder within the website tree.

View 1 Replies View Related

Programming :: C++ Template Specialization?

Feb 6, 2011

I am having trouble understanding some concepts regarding C++ template specialization and I was hopping you guys can help me like you did last time.I will go right into the code and let the code do the talking.File foo.hpp

Code:
// Template Class
template < typename T1, typename T2> struct foo {

[code]....

View 2 Replies View Related

Programming :: Template Algorithm For Std::vector And Std::string?

Sep 8, 2010

I have two functions:

Quote:

void func1(std::string &s)
{
s.clear();
}

[code]....

Is there a way to create one template function for both vector and string that would clear them?

View 4 Replies View Related

Programming :: G++ Fails On Multiple Files If There's A Template Involved

Aug 12, 2010

If I remove all the template stuff, it works.

whats going on here?

View 2 Replies View Related

Programming :: Include Html On A Velocity Template Mail?

Jul 13, 2010

Right now we send notification emails using a velocity template (apache and java), the thing is that the notification engine call the Email.vm file to add all the information and variables. This process only attach the information (text) on the .vm file.

We need to send that email on html. The thing is that if we write the html code on the file, when the .vm file is called that email includes the code not the result of the html.

We have tried adding the headers and everything.

The question is:

Is there some way that we can pre-process the html code and include to that email the result?

Or can we tell the .vm file that it should be handle as html? (like php for example <?php ?>, the <html> and </html> tags doesn't work.

View 1 Replies View Related

Programming :: Have The Javascript Include On The Page (it's A Php Template So That's Elsewhere In The Code?

Jun 6, 2011

this should have been a simple task, but for some reason one of my rollovers plain old isn't workingmy html sheet

Code:
<div style="background:#F5F5E9 url('/sites/all/themes/flossmoore1/images/bricks250.png');padding:1px;padding-

[code]....

View 1 Replies View Related

Programming :: Compile And Build Program Using A Makefile Template?

Jul 8, 2011

I am new to the whole concept of makefiles, and I'm trying to compile and build my program using a makefile template I have found. My project consists of three directories: "source", where my .cpp files are (source1.cpp, source2.cpp, source3.cpp), "include", where my .h files are (header1.h, header2.h, header3.h), and "obj", where the object files are to be stored (obj1.o, obj2.o, obj3.o). In the project root directory is my makefile, which is as follows:

Code:
EXEC = myexe
CC = g++
IDIR = include
SDIR = source
ODIR = obj

[Code]..

View 4 Replies View Related

Programming :: Build A Simple Program For C Programming Class?

Feb 12, 2011

im trying to build a simple program for my C programming class, this is the source code

#include <stdio.h>
int main()
{
int length, width, length, height, area, perimeter;
perimeter = width + length + height;
area = width * length + heigth;

[Code]...

i dont see any error (you might)but every time i run it it runs but after it asks me to input for the width i do it but it doesn't take me to the length, it just stays blank until i input another value in the same place for the width, it asks me for 4 inputs in total i don;t know why, and after i run it different times it gives me different values for the perimeter and are. how can I fix this?

View 5 Replies View Related

Programming :: Develop An Html Template Parser Employing Flex & Bison?

Mar 23, 2011

I'm trying to develop an html template parser employing Flex & Bison, but now I found a problem and I don't know if surrender, so let's see if you can guide me to the solution (if any).

[Code]...

(Here I simplified the code to make only print what it gets, but it returns a token and the text to the bison program). Now my problem is that I would like to get the unknown characters as an unique string. [using the flex file above, returns char by char all HTML code that is not a comment!].

So, Could it be possible to make a flex rule that gets the HTML code?. It is not necessary to check if HTML code is correct I do it (before parse) using expat. Also there is no need to check the resulted code it will be done by the parser or compiler of the used language.

I know that are a lot of tools that uses this kind of templates in all languages and systems... but I'm just exercising my pour flex&bison skills. Also, using my current flex file, I have to remove the string "<!--MARKUP" from the beginning and "-->" from the end of returned string to bison... But in reality, if I could manage the HTML code as a flex rule, I could solve that sednding to bison an start Token, the code and and end token.

View 1 Replies View Related

Programming :: Make A Template Char Or Wchar_t Default Function Argument?

Oct 30, 2009

I have a template similar to the following.

Code:

template <charT>
virtual void do_get_date(charT* = "str")
{ ... }

As you can see we have a problem. If we use a wchar_t instead the string wont be formatted right we need to prefix L in front. If we use char16_t we need to prefix a u in front. Is there a was to make the generic without resorting the the std::string class?

View 2 Replies View Related

Ubuntu Multimedia :: Metadata Stripper / Inserter For Avi / Mp4?

Jun 24, 2010

I have about twenty five hundred films, shorts, serials in (mostly) avi and mp4 containers. I would like to both add and subtract metadata like title and creator in bulk.Most all of my machines are Ubuntu/Debian now, but I could even work with what I have left of Windows, which are virtual machines.

View 2 Replies View Related

OpenSUSE Install :: Cannot Compile Vdrift-2009-06-15 - Warning: The Options Class Is Deprecated; Use The Variables Class Instead

Mar 12, 2010

I have a problem with compiling vdrift-2009-06-15 using scons. As the source that i obtained only supports scons i cannot use make. the error that i get when i try to compile it in GNOME Terminal is: scons: Reading SConscript files ... scons: warning: The Options class is deprecated; use the Variables class instead.
File "/home/mohit/Download/vdrift-2009-06-15/SConstruct", line 9, in <module>

scons: warning: The BoolOption() function is deprecated; use the BoolVariable() function instead.
File "/home/mohit/Download/vdrift-2009-06-15/SConstruct", line 13, in <module>
Checking for C++ header file asio.hpp... (cached) yes
Checking for C++ header file boost/bind.hpp... (cached) yes
Checking for C++ header file GL/gl.h... (cached) yes
Checking for C++ header file GL/glu.h... (cached) yes
Checking for C++ header file SDL/SDL.h... (cached) yes
[Code]........

View 4 Replies View Related

Programming :: Passing Class To Itself (CPP)?

May 18, 2010

I'm struggling with the issue of passing a vector of a class to itself, here's what state its in now... (tried many variations, but without direction).

Code:
#include <iostream>
#include <string>

[code]...

View 2 Replies View Related

Programming :: C++: Defining A New Class - Periodic B.c?

Apr 9, 2010

I am trying to make a periodic boundary condition type function, using an existing class given to me in lecture notes, but am having some trouble! Effectively, I am trying to make an array such that, for a point in any row of a 2D matrix ("Matrix(i,j)"), the command "next_i[i]" will return "(i+1)%L", where L is the number of data points in the row. This will enable me to select a point to the right of any point in the matrix: "Matrix(next[i],j)"

[Code]....

View 1 Replies View Related

Programming :: Use A Class Inside A Struct?

Apr 8, 2011

Is is possible to use a class inside a struct? I keep getting segmentation fault with this code:

Code:

struct my_struct {
unsigned count;
std::string msg;

[code]....

View 3 Replies View Related

Programming :: Unable To Compile Class For JSP?

Mar 15, 2011

My new guy has created several functioning webpages on his machine with TOMCAT 6 with Sun JDK, yet our machines use TOMCAT 5.5 with Open JDK, which his webpages don't show. Do you have any idea how to make them work? The error showing in a browser:

Code:
HTTP Status 500 -
type Exception report
message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception org.apache.jasper.JasperException: Unable to compile class for JSP:

[Code]...

View 2 Replies View Related

Programming :: How To Set Up Global Class In JAVA?

May 10, 2011

I've had to do some code in java, a language I'm very much unfamiliarly with so please excuse my incorrect use of terms. The basic outline of my problem is I create a class object as a local within a swing button function it works fine. If I create it as a global ( with I think I need to do ) within main, then prototype it with the other swing objects at the bottom of the file when it is called it causes a host of problems. I think the easiest way is to show it.

View 2 Replies View Related

Programming :: How To Modify ArrayList From Outside Of Class?

Mar 10, 2010

Okay so I'm working on a program here as I'm learning java,I have an array that is initialized with 5 objects that are hard coded. I have made a GUI that takes the input needed and creates an object with those values.I need to add that object to the ArrayList that I have previously made.Okay, so I have three classes, guiclass.java, main.java and gladiator.java Objects are made and defined in "gladiator".Main contains my public static void main section, launches my gui, creates my five hard coded objects, creates my ArrayList and adds my five hard coded objects to the ArrayList.Now, I need to add the object that I generated in the guiSection [action Listener]to the ArrayList that I created in my main class's public static void main string... section. Problem is my arraylist "cannot be resolved" from guiclass.

View 13 Replies View Related

Programming :: Md5 In Java Without Using MessageDigest Class

Sep 18, 2010

I am looking to write a function to return an MD5 hash in Java but I don't want to us the MessageDigest class as I am using the J2ME framework which doesn't include it.

View 3 Replies View Related

Programming :: Php And Variable Class Names?

Sep 30, 2010

How can I handle the situation below so that the "Fatal Error" message is not shown. It would be ideal if I could supply a default class to be used. I'd prefer to not use: ini_set() to supress the errors but actually be able to "handle" the error.

Code:
<?php
class MyClass

[code]....

View 2 Replies View Related

Programming :: Possible To Communicate Values Between Class?

Feb 24, 2009

I have a application in C++, and now I have two class. MyDialog is the class that main function launch. In MyDialog class there are four elements and when I click over theese elements, there is a MousePressEvent that launch other class, Touchpad class. So, in some moments, I have loaded two class. My question is, how can pass a value from Touchpad class to MyDialog class, when I close (destroy) Touchpad class. In a few words, is it possible to communicate values between class?

View 5 Replies View Related

Programming :: Implement A Set Class (like In Stl) Using A Vector?

Sep 3, 2010

i need to implement a Set class(like in stl) using a vector.Here is my code that doesnt work corectly:

Code:
#include <iostream>
#include <vector>
template<class T>
class Set
{

[Code]....

View 2 Replies View Related

Programming :: Implement C_str() For A String Class?

Oct 19, 2010

How can I implement c_str() for a string class?

View 2 Replies View Related

Programming :: Declaring A Vector Inside A C++ Class?

Mar 23, 2010

Is it not possible to declare a vector inside a C++ class ? Have a look at the following code:

Code:

#include <stdio.h>
#include <iostream>
#include <malloc.h> // malloc
#include <strings.h> // bzero

[code]....

View 2 Replies View Related

Programming :: Default Port For UDPWriter Class?

May 9, 2011

This is a really specific question, but maybe someone can help. I'm debugging someone else's code, and they call a UDPWriter and specify an IP address and port, and I'm trying to make sure this multicast traffic goes over a certain port. How can I determine which port the UDP defaults to and change it?

It's confusing to me because I'm not familiar with all the layers the OS sends traffic through before it goes through the interface. Is there maybe some simpler way to tell the OS to send multicast traffic over both interfaces?

View 2 Replies View Related

Programming :: Function Pointers To Class Members Cpp

May 23, 2010

i'm a bit stuck playing with the following class setup for glut. The actual issue is with the function pointers.Basically the following code is the opengl redbook cube example slightly modified.

View 2 Replies View Related

Programming :: Getting Undefined Reference To Main In Sub-class For BST?

Apr 27, 2011

I'm writing a binary search tree class to insert records and I'm stuck on the following error:

Code:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
Here is the code for my class:

[Code]...

I really don't know how to approach this, I thought that everything was working fine but I have no idea what is wrong. Also, for clarification, main() is in a different .cpp file that #includes "tree.h"

View 13 Replies View Related

Programming :: JApplet Class Not Loading / Resolve This?

Jan 5, 2011

I have a JApplet class I have copied to both a windows and a linux server. When I open up a webpage with the applet in it in my browser from both servers (http://server1/....) I can only get it to work from the Windows server. The Java console on my PC pops up complaining it cannot find the class file on the Linux server. Has anyone experienced anything like this before and how have you solved the problem?

View 1 Replies View Related







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