HELP!!!! I am in an on-line shell programming class and have a question. Here is the data:
Mike Harrington:(510) 548-1278:250:100:175
Christian Dobbins:(408) 538-2358:155:90:201
Susan Dalsass:(206) 654-6279:250:60:50
(There are 12 contribuors total)
This database contains names, phone... (1 Reply)
Hi,
I am just running a incremental back-up on one of my server.
But these days It abrubtly fails with below error.
==========
User defined signal 1
===========
When I rerun the back-up, It completed successfully.Earlier this was not happening.
Any Idea, what could be the problem... (0 Replies)
I want to add a new IP service which executes a script on SCO OS5.
I have amended /etc/services and added to port number (3333)
I have amended /etc/inetd.conf and added a line for this service but I can't get it to execute my own shell script
When I telnet to the IP address on port 3333 I... (1 Reply)
Dear Friends,
I need a help regarding User defined function in shell script.
My problem is as follows:
my_func.sh
my_funcI(){
grep 'mystring' I.dat
}
my_funcQ(){
grep 'mystring' Q.dat
}
myfuncI
myfuncQ
But As both the function has same function only the... (11 Replies)
I am converting 32-bit C++ code to 64-bit on Solaris.
I have used unsigned long in number of files. I want it to convert to unsigned int for 64-bit.
Total files are around 2000. Can you please help me if possible to do it in makefile using MACRO while build.
If it is not possible any other... (2 Replies)
Hi
Is there a way to add more user-defined signals?
I am currently using SIGUSR1 and SIGUSR2 - but I need another one.
How can I do that?
Thanks! (9 Replies)
Hi;
Is der ne to to use user defined functions for the values in awk
find $1 -type f -ls | nawk '{{print "|"$3"|"$5"|"$6"|"$8"|"$9"|"$10"|"} for(i=11;i<=NF;i++){printf("%s",$i)}}'
In above command i want to append some values returned by user functions on line.
thnks;
ajay (1 Reply)
Hi, i would like to create user defined commands.
e,g:
if an user executes ,
mkdircd test then a directory called test should be created and it should be cd to test.
How i can create the command mkdircd with below action:
mkdir $1 && cd $1.
Please help me in achieving this (7 Replies)
Hi !
I got a script from Arabic to Roman numeral conversion - .comp.lang.awk, that I would like to modify to apply it on my input file.
input ("|"-delimited fields):
AAAAAA|1, 10, 13, 14, 25, 60
wanted output:
AAAAAA|I, X, XIII, XIV, XXV, LX
script.awk:
#!/usr/bin/gawk -f
... (11 Replies)
Discussion started by: lucasvs
11 Replies
LEARN ABOUT DEBIAN
heap_allocator
heap_allocator(7rheolef) rheolef-6.1 heap_allocator(7rheolef)NAME
heap_allocator - heap-based allocator
DESCRIPTION
Heap allocators are generally used when there is a lot of allocation and deallocation of small objects. For instance, this is often the
case when dealing with std::list and std::map.
Heap-based allocator is conform to the STL specification of allocators. It does not "free" the memory until the heap is destroyed.
This allocator handles an a priori unlimited area of memory: a sequence of growing chunks are allocated. For a limited memory handler in
the same spirit, see "stack_allocator"(9).
EXAMPLE
typedef map <size_t, double, less<size_t>, heap_allocator<pair<size_t,double> > > map_type;
map_type a;
a.insert (make_pair (0, 3.14));
a.insert (make_pair (1, 1.17));
for (map_type::iterator iter = a.begin(), last = a.end(); iter != last; iter++) {
cout << (*iter).first << " " << (*iter).second << endl;
}
IMPLEMENTATION
template <typename T>
class heap_allocator {
protected:
struct handler_type; // forward declaration:
public:
// typedefs:
typedef size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef T* pointer;
typedef const T* const_pointer;
typedef T& reference;
typedef const T& const_reference;
typedef T value_type;
// constructors:
heap_allocator() throw()
: handler (new handler_type)
{
}
heap_allocator (const heap_allocator& ha) throw()
: handler (ha.handler)
{
++handler->reference_count;
}
template <typename U>
heap_allocator (const heap_allocator<U>& ha) throw()
: handler ((typename heap_allocator<T>::handler_type*)(ha.handler))
{
++handler->reference_count;
}
~heap_allocator() throw()
{
check_macro (handler != NULL, "unexpected null mem_info");
if (--handler->reference_count == 0) delete handler;
}
// Rebind to allocators of other types
template <typename U>
struct rebind {
typedef heap_allocator<U> other;
};
// assignement:
heap_allocator& operator= (const heap_allocator& ha)
{
handler = ha.handler;
++handler->reference_count;
return *this;
}
// utility functions:
pointer address (reference r) const { return &r; }
const_pointer address (const_reference c) const { return &c; }
size_type max_size() const { return std::numeric_limits<size_t>::max() / sizeof(T); }
// in-place construction/destruction
void construct (pointer p, const_reference c)
{
// placement new operator:
new( reinterpret_cast<void*>(p) ) T(c);
}
// C++ 2011: default construct a value of type T at the location referenced by p
void construct (pointer p) { new ( reinterpret_cast<void*>(p) ) T(); }
void destroy (pointer p)
{
// call destructor directly:
(p)->~T();
}
// allocate raw memory
pointer allocate (size_type n, const void* = NULL)
{
return pointer (handler->raw_allocate (n*sizeof(T)));
}
void deallocate (pointer p, size_type n)
{
// No need to free heap memory
}
const handler_type* get_handler() const {
return handler;
}
// data:
protected:
handler_type* handler;
template <typename U> friend class heap_allocator;
};
rheolef-6.1 rheolef-6.1 heap_allocator(7rheolef)