473,666 Members | 2,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The other kind of map?

There are probably a zillion ways to do this, but I'm wondering of there's a
C++ convention. I want to have a fixed mapping between keys and values.
It's basically the same thing as a std::map<>, except what I'm talking
about would not create a new element on a miss. This is a traditional
approach I've seen with C and other languages.
string
SectionTypes( Elf32_Word type )
{
string sRet = "UNKNOWN";
switch ( type ) {
case SHT_NULL :
sRet = "NULL";
break;
case SHT_PROGBITS :
sRet = "PROGBITS";
break;
case SHT_SYMTAB :
sRet = "SYMTAB";
break;
case SHT_STRTAB :
sRet = "STRTAB";
break;
case SHT_RELA :
sRet = "RELA";
break;
case SHT_HASH :
sRet = "HASH";
break;
case SHT_DYNAMIC :
sRet = "DYNAMIC";
break;
case SHT_NOTE :
sRet = "NOTE";
break;
case SHT_NOBITS :
sRet = "NOBITS";
break;
case SHT_REL :
sRet = "REL";
break;
case SHT_SHLIB :
sRet = "SHLIB";
break;
case SHT_DYNSYM :
sRet = "DYNSYM";
break;
}

return sRet;
}

If I were to use a switch method, I'd return from the case rather than
falling off the end. Even that seems a bit too clunky for me. std::map<>
is good for what it's designed for, but it doesn't work for fixed sets with
a default for cases where there's no key to match the sample.

I know this is trivial, but it's the kind of thing I find myself fretting
over more than seems necessary. Everytime I encounter the situation I toy
around with a solution, but I've never found the "right fit". Any
suggestions for a nice, concise, flexible way of setting up this kind of
associative mapping.

I could use a set of std::pair<key,v alue>, and provide a comparator, but
that seems unnecessarily complicated for the situation. Using a std::map<>
and doing a find likewise seems excessive.

--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true.-Bertrand Russell
Aug 19 '05 #1
11 1377
* Steven T. Hatton:
std::map<>
is good for what it's designed for, but it doesn't work for fixed sets with
a default for cases where there's no key to match the sample.


How about wrapping a std::map in your own little class with your own
accessor, where you use 'find'?

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Aug 19 '05 #2
Alf P. Steinbach wrote:
* Steven T. Hatton:
std::map<>
is good for what it's designed for, but it doesn't work for fixed sets
with a default for cases where there's no key to match the sample.


How about wrapping a std::map in your own little class with your own
accessor, where you use 'find'?


I guess a variant on this theme is what you're talking about. That's among
the best I've come up with so far.

#ifndef FILEDUMPER_H
#define FILEDUMPER_H

#include <string>
#include <map>
#include <iostream>

class FileDumper {
public:

FileDumper(cons t std::string& filename_);

~FileDumper();

std::string SectionFlags(El f32_Word flags);
std::string SectionTypes(El f32_Word type);
std::string SegmentTypes( Elf32_Word type );
//...

private:
std::string _filename;
std::map<Elf32_ Word,std::strin g> _sectionTypes;
std::map<Elf32_ Word,std::strin g> _segmentTypes;
};
#endif

/*************** *************** ***************/

FileDumper::Fil eDumper(const std::string& filename_)
:_filename(file name_) {
_sectionTypes[SHT_NULL] = "NULL";
_sectionTypes[SHT_PROGBITS] = "PROGBITS";
_sectionTypes[SHT_SYMTAB] = "SYMTAB";
_sectionTypes[SHT_STRTAB] = "STRTAB";
_sectionTypes[SHT_RELA] = "RELA";
_sectionTypes[SHT_HASH] = "HASH";
_sectionTypes[SHT_DYNAMIC] = "DYNAMIC";
_sectionTypes[SHT_NOTE] = "NOTE";
_sectionTypes[SHT_NOBITS] = "NOBITS";
_sectionTypes[SHT_REL] = "REL";
_sectionTypes[SHT_SHLIB] = "SHLIB";
_sectionTypes[SHT_DYNSYM] = "DYNSYM";

_segmentTypes[PT_NULL] = "NULL";
_segmentTypes[PT_LOAD] = "PT_LOAD";
_segmentTypes[PT_DYNAMIC] = "PT_DYNAMIC ";
_segmentTypes[PT_INTERP] = "PT_INTERP" ;
_segmentTypes[PT_NOTE] = "PT_NOTE";
_segmentTypes[PT_SHLIB] = "PT_SHLIB";
_segmentTypes[PT_PHDR] = "PT_PHDR";

}

FileDumper::~Fi leDumper() {}

std::string FileDumper::Sec tionFlags(Elf32 _Word flags) {
std::string sRet = "";
if ( flags & SHF_WRITE ) { sRet += "W"; }
if ( flags & SHF_ALLOC ) { sRet += "A"; }
if ( flags & SHF_EXECINSTR ) { sRet += "X"; }
return sRet;
}

std::string FileDumper::Sec tionTypes(Elf32 _Word type) {
return(_section Types.end()!=_s ectionTypes.fin d(type))?_secti onTypes[type]:
"UNKNOWN";
}

--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true.-Bertrand Russell
Aug 19 '05 #3
Steven T. Hatton wrote:
There are probably a zillion ways to do this, but I'm wondering of there's
a
C++ convention. I want to have a fixed mapping between keys and values.
It's basically the same thing as a std::map<>, except what I'm talking
about would not create a new element on a miss. This is a traditional
approach I've seen with C and other languages.
string
[big switch snipped]
If I were to use a switch method, I'd return from the case rather than
falling off the end. Even that seems a bit too clunky for me. std::map<>
is good for what it's designed for, but it doesn't work for fixed sets
with a default for cases where there's no key to match the sample.

I know this is trivial, but it's the kind of thing I find myself fretting
over more than seems necessary. Everytime I encounter the situation I toy
around with a solution, but I've never found the "right fit". Any
suggestions for a nice, concise, flexible way of setting up this kind of
associative mapping.

I could use a set of std::pair<key,v alue>, and provide a comparator, but
that seems unnecessarily complicated for the situation. Using a
std::map<> and doing a find likewise seems excessive.

What about:

#include <map>

template < typename KeyType,
typename ValueType >
class dictionary {
public:

typedef KeyType key_type;
typedef ValueType value_type;

private:

typedef std::map< key_type, value_type > map_type;

map_type data;
value_type answer_default;

public:

dictionary ( value_type default_value = value_type() )
: data ()
, answer_default ( default_value )
{}

dictionary add_pair ( key_type const & key,
value_type const & val ) const {
dictionary result ( *this );
result.data[key] = val;
return( result );
}

value_type const & operator[] ( key_type const & key ) const {
typename map_type::const _iterator iter = data.find( key );
if ( iter != data.end() ) {
return( iter->second );
} else {
return( answer_default );
}
}

}; // dictionary<>
#include <iostream>
#include <string>

int main ( void ) {
dictionary< int, std::string > dict =
dictionary<int, std::string> ( "!" )
.add_pair( 0, "hello" )
.add_pair( 1, " " )
.add_pair( 2, "world" );

for ( int i = 0; i < 5; ++i ) {
std::cout << dict[i];
}
std::cout << '\n';
}
Best

Kai-Uwe Bux
Aug 19 '05 #4
Kai-Uwe Bux wrote:
Steven T. Hatton wrote:
There are probably a zillion ways to do this, but I'm wondering of
there's a
C++ convention. I want to have a fixed mapping between keys and values.
It's basically the same thing as a std::map<>, except what I'm talking
about would not create a new element on a miss. This is a traditional
approach I've seen with C and other languages.
string

[big switch snipped]

If I were to use a switch method, I'd return from the case rather than
falling off the end. Even that seems a bit too clunky for me.
std::map<> is good for what it's designed for, but it doesn't work for
fixed sets with a default for cases where there's no key to match the
sample.

I know this is trivial, but it's the kind of thing I find myself fretting
over more than seems necessary. Everytime I encounter the situation I
toy
around with a solution, but I've never found the "right fit". Any
suggestions for a nice, concise, flexible way of setting up this kind of
associative mapping.

I could use a set of std::pair<key,v alue>, and provide a comparator, but
that seems unnecessarily complicated for the situation. Using a
std::map<> and doing a find likewise seems excessive.

What about:

#include <map>

template < typename KeyType,
typename ValueType >
class dictionary {
public:

typedef KeyType key_type;
typedef ValueType value_type;

private:

typedef std::map< key_type, value_type > map_type;

map_type data;
value_type answer_default;

public:

dictionary ( value_type default_value = value_type() )
: data ()
, answer_default ( default_value )
{}

dictionary add_pair ( key_type const & key,
value_type const & val ) const {
dictionary result ( *this );
result.data[key] = val;
return( result );
}

value_type const & operator[] ( key_type const & key ) const {
typename map_type::const _iterator iter = data.find( key );
if ( iter != data.end() ) {
return( iter->second );
} else {
return( answer_default );
}
}

}; // dictionary<>
#include <iostream>
#include <string>

int main ( void ) {
dictionary< int, std::string > dict =
dictionary<int, std::string> ( "!" )
.add_pair( 0, "hello" )
.add_pair( 1, " " )
.add_pair( 2, "world" );

for ( int i = 0; i < 5; ++i ) {
std::cout << dict[i];
}
std::cout << '\n';
}
Best

Kai-Uwe Bux


Indeed. There are many ways to approach this situation. It just seems a
shame to write so many lines of code to do something so trivial. My guess
is someone considered providing

const T& operator[](const key_type& x) const;

which would behave in much the way I want my other_map to behave. It
probably was rejected because of the subtleties involved in using in
correctly.

I'm currently toying with the idea of an

//or should it be char, or long, or unsigned, or????
template <const int, typename Mapped_T>
class int_keyed_pair {
typedef const int key_type;
typedef Mapped_T mapped_type;
operator const key_type& () const;
};

and trying to figure out if I can get it to behave correctly in
circumstances such as the case constant expression in a switch() statement.
I also want the key to automagically morph into a std::string when
appropriate. The mapped_type should (also) be (convertable to) a
std::string.

It's the kind of thing that has often seemed marginally useful. Of course
the first place I want to use it is as an element in a key_map<Key_T,
Mapped_T>.

BTW, as counterintuitiv e as it may seem, the actual name given to the type
of the other half of a key-value pair in a std::map<> is as shown in the
following:

namespace std {
template <class Key, class T, class Compare = less<Key>,
class Allocator = allocator<pair< const Key, T> > >
class multimap {
public:
typedef Key key_type;
typedef T mapped_type;
typedef pair<const Key,T> value_type;
//...
};
}
--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true.-Bertrand Russell
Aug 19 '05 #5
Steven T. Hatton wrote:
I'm currently toying with the idea of an

//or should it be char, or long, or unsigned, or????
template <const int, typename Mapped_T>
class int_keyed_pair {
typedef const int key_type;
typedef Mapped_T mapped_type;
operator const key_type& () const;
};

and trying to figure out if I can get it to behave correctly in
circumstances such as the case constant expression in a switch()
statement. I also want the key to automagically morph into a std::string
when
appropriate. The mapped_type should (also) be (convertable to) a
std::string.

You are thinking of some kind of two-faced type that will convert silently
to either an int or a string so that a variable of that type could be used
like so:

Smart_Error_Cod e exit_code = some_function() ;
std::cerr << exit_code << '\n';
switch exit_code {
case NO_RET : {...}
....
}

Here NO_RET would also be of type Smart_Error_Cod e. I played around with it
for a little while, but I was not able to get the implicit conversion work
out properly. Damn code would not compile.

It's the kind of thing that has often seemed marginally useful. Of course
the first place I want to use it is as an element in a key_map<Key_T,
Mapped_T>.
Does not the two-faced type already represent the map? Obviously I am
missing something.

BTW, as counterintuitiv e as it may seem, the actual name given to the
type of the other half of a key-value pair in a std::map<> is as shown in
the following:

namespace std {
template <class Key, class T, class Compare = less<Key>,
class Allocator = allocator<pair< const Key, T> > >
class multimap {
public:
typedef Key key_type;
typedef T mapped_type;
typedef pair<const Key,T> value_type;
//...
};
}


You are right.
BTW, I revisited the first posting. Here is a version of the dictionary that
uses expression templates to unroll the checks at compile time. It could
compile to something rather close to your original code:

// I am practicing expression templates right now, so here you go:

struct not_found {};

template < typename Key,
typename Map >
class DictionaryEntry {
public:

typedef Key key_type;
typedef Map mapped_type;

private:

key_type const entry_key;
mapped_type const entry_map;

public:

DictionaryEntry ( key_type const & key,
mapped_type const & val )
: entry_key ( key )
, entry_map ( val )
{}

mapped_type lookup ( key_type const & key ) const {
if ( entry_key == key ) {
return( entry_map );
}
throw ( not_found() );
}

};

template < typename SubExprA, typename SubExprB >
class DictionaryExpr {
public:

typedef typename SubExprB::key_t ype key_type;
typedef typename SubExprB::mappe d_type mapped_type;

private:

// WARNING: [references?]
/*
I really would like to know, why I cannot
use const references here.
*/
SubExprA const a;
SubExprB const b;

public:

DictionaryExpr ( SubExprA const & a_,
SubExprB const & b_ )
: a ( a_ )
, b ( b_ )
{}

mapped_type lookup ( key_type const & key ) const {
try {
return( b.lookup( key ) );
}
catch ( not_found ) {}
return( a.lookup( key ) );
}

DictionaryExpr< DictionaryExpr, SubExprB >
add_pair ( key_type const & key, mapped_type const & val ) const {
return( DictionaryExpr< DictionaryExpr, SubExprB >
( *this, DictionaryEntry < key_type, mapped_type >( key, val ) ) );
}

};

template < typename Map >
class DictionaryDefau lt {
public:

typedef Map mapped_type;

private:

mapped_type entry_map;

public:

DictionaryDefau lt ( mapped_type val = mapped_type() )
: entry_map ( val )
{}

template < typename Key >
mapped_type lookup ( Key const & key ) const {
return( entry_map );
}

template < typename Key >
DictionaryExpr< DictionaryDefau lt, DictionaryEntry < Key, mapped_type > >
add_pair ( Key const & key, mapped_type const & val ) const {
return( DictionaryExpr< DictionaryDefau lt, DictionaryEntry < Key,
mapped_type > >
( *this, DictionaryEntry < Key, mapped_type >( key, val ) ) );
}

};

#include <iostream>
#include <string>

std::string find_word( unsigned long i ) {
return
DictionaryDefau lt<std::string> ( "!" )
.add_pair( 0, "hello" )
.add_pair( 1, " " )
.add_pair( 2, "world" )
.lookup( i );
}

int main ( void ) {
for ( unsigned int i = 0; i < 4; ++i ) {
std::cout << find_word( i );
}
std::cout << '\n';
}

// This is one of the most complicated hello.cc that I have written so far.

Best

Kai-Uwe Bux
Aug 19 '05 #6
Kai-Uwe Bux, I think your dictionary class is very nice. I tinkered
around with it:

template < typename KeyType,
typename ValueType >
class dictionary {
public:
typedef KeyType key_type;
typedef ValueType value_type;

private:
typedef std::map< key_type, value_type > map_type;

mutable map_type data; // made this mutable
value_type answer_default;

public:
dictionary ( value_type default_value = value_type() )
: data ()
, answer_default ( default_value )
{}

// return by reference instead of by value
dictionary& add_pair ( key_type const & key,
value_type const & val ) const {
data[key] = val;
return(const_ca st<dictionary&> (*this));
}
value_type const & operator[] ( key_type const & key ) const {
typename map_type::const _iterator iter = data.find( key );
if ( iter != data.end() ) {
return( iter->second );
} else {
return( answer_default );
}
}
}; // dictionary<>

I tested it using your test cases and it still works. Could you please
explain the merits of returning by value in the member function
add_pair() versus returning by reference in add_pair()? Thank you.

Aug 19 '05 #7
Frank Chang wrote:
Kai-Uwe Bux, I think your dictionary class is very nice. I tinkered
around with it:

template < typename KeyType,
typename ValueType >
class dictionary {
public:
typedef KeyType key_type;
typedef ValueType value_type;

private:
typedef std::map< key_type, value_type > map_type;

mutable map_type data; // made this mutable
value_type answer_default;

public:
dictionary ( value_type default_value = value_type() )
: data ()
, answer_default ( default_value )
{}

// return by reference instead of by value
dictionary& add_pair ( key_type const & key,
value_type const & val ) const {
data[key] = val;
return(const_ca st<dictionary&> (*this));
}
value_type const & operator[] ( key_type const & key ) const {
typename map_type::const _iterator iter = data.find( key );
if ( iter != data.end() ) {
return( iter->second );
} else {
return( answer_default );
}
}
}; // dictionary<>

I tested it using your test cases and it still works. Could you please
explain the merits of returning by value in the member function
add_pair() versus returning by reference in add_pair()? Thank you.


I do not see any merits in returning by value. I just wasn't thinking.
Thanks a lot for spotting.

As for your code, why not go all the way and just not pretend that
add_pair() is a const method:

template < typename KeyType,
typename MappedType >
class dictionary {
public:

typedef KeyType key_type;
typedef MappedType mapped_type;

private:

typedef std::map< key_type, mapped_type > map_type;

map_type data;
mapped_type answer_default;

public:

dictionary ( mapped_type default_value = mapped_type() )
: data ()
, answer_default ( default_value )
{}

dictionary & add_pair ( key_type const & key,
mapped_type const & val ) {
data[key] = val;
return( *this );
}
mapped_type const & operator[] ( key_type const & key ) const {
typename map_type::const _iterator iter = data.find( key );
if ( iter != data.end() ) {
return( iter->second );
} else {
return( answer_default );
}
}
}; // dictionary<>
Should be equivalent to your code, but without const-cast / mutable.
Best

Kai-Uwe Bux
Aug 19 '05 #8
Kai-Uwe Bux, Your approach is the most elegant. Thank you for reviewing
the code I posted.

Aug 19 '05 #9
Kai-Uwe Bux wrote:
Steven T. Hatton wrote:
[...]
You are thinking of some kind of two-faced type that will convert silently
to either an int or a string so that a variable of that type could be used
like so:

Smart_Error_Cod e exit_code = some_function() ;
std::cerr << exit_code << '\n';
switch exit_code {
case NO_RET : {...}
...
}

Here NO_RET would also be of type Smart_Error_Cod e. I played around with
it for a little while, but I was not able to get the implicit conversion
work out properly. Damn code would not compile.


Actually, I was combining a few such musings into a single design idea.
Probably a bad idea at this stage. The most important behavior would be
something such as:

MagicPair<int, std::string> mp(42, "SuSE Linux 4.2");

switch(key) {
case mp: return "The first version of SuSE Linux.";//as if mp===42;
}

std::cout<<mp<< std::endl;
// prints `SuSE Linux 4.2'
It's the kind of thing that has often seemed marginally useful. Of
course the first place I want to use it is as an element in a
key_map<Key_T, Mapped_T>.


Does not the two-faced type already represent the map? Obviously I am
missing something.


Probably because my thinking, and hence my words are not clear. I want
something that I can easily print out in a for-each loop as key/value
pairs. The auto-conversion to std::string for the key was "additional
support". That would be for situations such as are dealt with by this bit
of code:

http://www.research.att.com/~bs/bs_f...#int-to-string

It would probably be sufficient to have something along the lines of

MagicPair<>::ke y_as_string();
BTW, as counterintuitiv e as it may seem, the actual name given to the
type of the other half of a key-value pair in a std::map<> is as shown in
the following:

namespace std {
template <class Key, class T, class Compare = less<Key>,
class Allocator = allocator<pair< const Key, T> > >
class multimap {
public:
typedef Key key_type;
typedef T mapped_type;
typedef pair<const Key,T> value_type;
//...
};
}


You are right.
BTW, I revisited the first posting. Here is a version of the dictionary
that uses expression templates to unroll the checks at compile time. It
could compile to something rather close to your original code:

[snip for further review]

Now I've done it! I opened my mouth, and now people are expecting me to
_think_! I'll take a closer look at your code before commenting on it.

I will observe that in another post you provided this:

value_type const & operator[] ( key_type const & key ) const {
typename map_type::const _iterator iter = data.find( key );
if ( iter != data.end() ) {
return( iter->second );
} else {
return( answer_default );
}

Which suggests you are aware of the gotcha related to std::map::opera tor[
(key) const;
This is my current hack to address the original issue:

template<typena me K, typename M>
class KeyMap_T {
public:
typedef std::map<K,M> map_type;

KeyMap_T(const map_type& map_, const M& default_)
:_map(map_.begi n(), map_.end())
,_default(defau lt_)
{}

// Big dilemma: If I explicitly create a variable of iterator type, I avoid
// calling _map.find(k) twice. But I cannot accomplish that in one line of
// moderately sane code. I'm not sure which version an optimizer will
// prefer.
const std::string& operator[](const K& k) const {
return _map.find(k) != _map.end()? _map.find(k)->second: _default;
}

private:
map_type _map;
M _default;
};

//---------------------------------------

typedef KeyMap_T<Elf32_ Word,std::strin g> Elf32_WordMap;
Elf32_WordMap:: map_type mapSectionHeade r();
const Elf32_WordMap sectionHeaderKe yMap(mapSection Header(),"UNKNO WN ");

// I had a KeyMap_T<>::add (const key_type& k, const mapped_type& m), but I
// wasn't using it, so I removed it. What I have may appear hackish, but it
// is the most comfortable version I came up with.

Elf32_WordMap:: map_type mapSectionHeade r() {
Elf32_WordMap:: map_type m;

m[SHT_NULL] = "NULL ";
m[SHT_PROGBITS] = "PROGBITS";
m[SHT_SYMTAB] = "SYMTAB ";
m[SHT_STRTAB] = "STRTAB ";
m[SHT_RELA] = "RELA ";
m[SHT_HASH] = "HASH ";
m[SHT_DYNAMIC] = "DYNAMIC ";
m[SHT_NOTE] = "NOTE ";
m[SHT_NOBITS] = "NOBITS ";
m[SHT_REL] = "REL ";
m[SHT_SHLIB] = "SHLIB ";
m[SHT_DYNSYM] = "DYNSYM ";
return m;
}
I don't like the return by value, but the alternative is to create `m' in
the calling scope, which is a bother.
--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true.-Bertrand Russell
Aug 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2753
by: Lenard Lindstrom | last post by:
I was wondering if anyone has suggested having Python determine a method's kind from its first parameter. 'self' is a de facto reserved word; 'cls' is a good indicator of a class method ( __new__ is a special case ). The closest to this I could find was the 2002-12-04 posting 'metaclasses and static methods' by Michele Simionato. The posting's example metaclass uses the method's name. I present my own example of automatic method kind...
2
2321
by: Joh | last post by:
Hello, (sorry long) i think i have missed something in the code below, i would like to design some kind of detector with python, but i feel totally in a no way now and need some advices to advance :( data = "it is an <atag> example of the kind of </atag> data it must handle and another kind of data".split(" ")
2
1847
by: Joh | last post by:
Hello, (first i'm sorry for my bad english...) for a program, i need to have some kind of dictionary which will contain a huge amount of keys and values. i have tried 'to do it simple' using a normal dict but when available memory was exhausted, my computer started to be really slow as it swap-ed. so i wondered if i can not use some kind of cache, i googled and found
7
4384
by: Mike Kamermans | last post by:
I hope someone can help me, because what I'm going through at the moment trying to edit XML documents is enough to make me want to never edit XML again. I'm looking for an XML editor that has a few features that you'd expect in any editor, except nearly none of them seem to have: 1 - Search and repalce with Regular Expressions. 2 - Search and Replace in an Xpath context. 3 - User specified tag-generation for either on a...
1
2707
by: Henro V | last post by:
I am byuilding this database which (among others things) will have to produce a kind of calendar. Users give in the appointments they have and how long they take. F.e: John Doe is attending a conference which will take three days. This conference starts on 12-07-2004 So the user would give in a) Name John Doe (selectable from a list,
4
1098
by: Pieter | last post by:
Hi, For a VB.NET 2005 application I need some kind Application Variable that holds a value that can be accessed everywhere in the application. It should also be available for a usercontrol in a seperate dll. Even more: I should be able to trigger everywhere in the application when this variable changes. I need it for some kind of Copy Paste operation of Documents in the application. Not only the ID of what I want to copy must be...
0
1384
by: Arthur | last post by:
Hi, I am trying to write a windows service in VC++.NET 2003, the task of this server is to detect the kind of internet connection and if there is a connection send some file and do something. I have found a method calls InternetGetConnectedState() in .net, this returns false or true for connection also this one has flags and you can use them to know what kind of connection machine uses. But here is my problem: suppose you don't have...
4
4003
by: Steph | last post by:
hello, because msdn is so poor... somebody did he write a similar script ? (DTE/DTE2) _applicationObject.Documents.Open(docPath, "?string kind?", false); i must type the "string kind"... but with what ?
7
2649
by: anklos | last post by:
Hi~! I met a problem on printing out a kind of hash array. i.e @array=(1,2,3,4,5,6); $array{$term}=1; diffent $i may contain diifernt $term(more than one term for each $i)
0
8352
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8780
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7378
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2005
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.