473,783 Members | 2,563 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A non-const std::set iterator

I am trying to write an iterator for a std::set that allows the
iterator target to be modified. Here is some relvant code:

template <class Set> // Set is an instance of std::set<>
class Iterator
{
public :
typedef typename Set::value_type T;
typedef typename Set::iterator SetIterator;
Iterator(Set& container, const SetIterator& it);
Iterator& operator=(const Iterator& rhs);
T& operator*() { return m_proxy; }
T* operator->() { return &m_proxy; }
Iterator& operator++();
~Iterator() { sync(); }

private :
void sync();
Set& m_container;
SetIterator m_iterator;
T m_proxy;
};

template <class Set>
Iterator<Set>:: Iterator(Set& container, const SetIterator& it) :
m_container(con tainer),
m_iterator(it)
m_proxy(*it) {}

template <class Set>
Iterator<Set>& Iterator<Set>:: operator++()
{
sync();
++m_iterator;
return *this;
}

template <class Set>
Iterator<Set>& Iterator<Set>:: operator=(const Iterator& rhs)
{
sync();
m_container = rhs.m_contaner;
m_iterator = rhs.m_iterator;
m_proxy = rhs.m_proxy;
return *this;
}
template <class Set>
void Iterator<Set>:: sync()
{
typedef Set::key_compar e Compare;
if (Compare(*m_ite rator, m_proxy) || Compare(m_proxy , *m_iterator))
{
// sort order will be changed
container.erase (m_iterator);
m_iterator = container.inser t(m_proxy);
}
else
{
// modify set element directly (should be faster than having to do
// an insert)
const_cast<T&>( *m_iterator) = m_proxy;
}
return;
}

Am I on the right track with this, or is this a really bad idea? One
concern I have is concurrency. If more than one iterator points to
the same element it is possible for that element to get out of sync.
Jul 22 '05
26 8796
"Siemel Naran" <Si*********@RE MOVE.att.net> wrote in message news:<VN******* *************@b gtnsc05-news.ops.worldn et.att.net>...

Your code is mostly sound. In what scenario do you find this useful?

This is all part of a database framework. When I add a record to the
database I need to determine if it's a new record or a correction for
an existing record. In the latter case I need to overwrite parts of
the existing record while preserving the key information:

RainSet rainfall("dbnam e"); // manages records from a DBMS
rainfall.retrie ve();
RainFile input;
RainRecord record;
while (input >> record)
{
RainSet::Iterat or it(rainfall.fin d(record));
if (it != rainfall.end())
{
// update existing record
it->amount(record. amount());
}
else
{
rainfall.insert (record);
}
}
rainfall.store( );

I currently use a std::list as the underlying container for a RainSet,
but I have to rely on the DBMS for all of my sorting. This, as well
as finding specific records, is too slow for large datasets. Thus, I
would like to use a sorted container like a std::set or std::map. In
the example I gave above, the changes I make to a record will not
effect its sort order.

template <class Set> // Set is an instance of std::set<>
class Iterator

I posted this example mainly as an illustration of what I was trying
to with the snyc() function. I should have mentioned that it wasn't
intended to be fully functional yet.


What about operator== and operator!=. I guess we want to be able to use
these iterators :).

Of course, and the following question arises: What should the
semantics of comparison be? Are two Iterators equivalent if they
point to the same element (m_iterator == rhs.m_iterator) or does the
proxy object have to be the same too?
I can imagine cases where either comparison is desired.

Don't forget to deal with the empty container, which is certainly valid
input :). Also maybe provide a constructor Iterator(Set&) where 'it'
defaults to set.begin().
Yes, I forgot to account for an empty container in the constructor at
first and got a segmentation fault. Using set.begin() as a default
value is a good idea.


Another major problem. Your operator= and compiler generated copy
constructor do different things. Operator= copies the container itself.
Perhaps you want to turn the type of m_container from Set to Set*, that is
to a pointer to a set?
Yet another problem I found yesterday. I did indeed change
m_container from a reference to a pointer.

template <class Set>
void Iterator<Set>:: sync()
{
typedef Set::key_compar e Compare;
Don't forget "typedef typename ...". Anyway, don't you want to call
key_comp()?


Yes and yes. Two more problems fixed.
In your code the else clause is used whenever *m_iterator equals m_proxy.
But we could use the else clause whenever *(m_iterator-1) < m_proxy <
*(m_iterator+1) , which helps performance.
This is a good idea, but since I'm potentially accessing ~2 million
(and growing) records from a DBMS and inserting them into a std::set I
don't know how much time it will save.
It seems strange when iterating over a range. Suppose your set is { 2, 3,
6, 7, 9 }, you're at the 3, and you change it to 8, so the new set is { 2,
6, 7, 8, 9 } which is fine. But the iterator will be pointing to 9.
At this time, the only use I have for modifying values through an
Iterator is similar to my example above where an Iterator is obtained
through a find(). Of course, that doesn't mean I won't try to do
something silly with it in the future. For now, I think I'm going to
add a replace() method to my container instead of trying to make
modifications through an iterator.

Another problem is when to commit.

And yet another reason, I think, to shelve my mutable iterator.

Sure the problem can be solved. Something like this: the set knows all
iterators it has given out (for example it keeps an array of pointers to
iterators), copy one iterator into another and the set still knows about all
the iterators (including the copied one), when you modify an element through
Iterator::refer ence::operator= the set sends a signal to each of the
iterators.


I had orinially wanted to create a simple (ha!) and straightforward
(ha!) way to modify elements of a set. Now that we've started talking
about smart references I know that I'm on the wrong track.

After reading this thread and thinking about it some more, I don't
have a really compelling reason for a mutable set iterator. It turns
out that the people who put together the Standard Library are smarter
than me after all. :)
Jul 22 '05 #21
On 6 Apr 2004 08:50:36 -0700, md*****@ou.edu (Michael Klatt) wrote:


After reading this thread and thinking about it some more, I don't
have a really compelling reason for a mutable set iterator. It turns
out that the people who put together the Standard Library are smarter
than me after all. :)


Well, I was playing around a bit, thinking a little utility for replacing a
value of an associative container might be useful in its own right, and got
as far as this for sets (warning: For testing, I use some non-standard
utility libs for initializing and displaying contents of containers. These
are all available in my InitUtil distributions):

#include <iostream>
#include <set>

#include "ESTLUtil.h " // Utils for initializing
#include "InitUtil.h " // and displaying containers
using namespace bds;
using namespace ESTLUtils;

using namespace std;

template<class Cont, class It, class T>
void xreplace(Cont &cont, It it, const T &value)
{
typename Cont::key_compa re Compare;
if (it == cont.end())
cont.insert(val ue);

if (Compare(*it, value) || Compare(value, *it))
{
cont.erase(it);
cont.insert(val ue);
}
else
const_cast<T&>( *it) = value;
}

int main()
{
// (From InitUtil: stuff values into a container)
set<int> s = make_cont("1,1, 3,9,143,207, 194, 195, 199, 200");
// (From ESTLUtils: display contents of a container
printContainer( "s Before xreplace: ", s);

set<int>::itera tor it = find(s.begin(), s.end(), 194);
if (it == s.end())
cout << "Whoops, no 194 to replace" << endl;
else
xreplace(s, it, 50);

printContainer( "After xreplacing 194 with 50: ", s);

return 0;
}

So the "xreplace" function template is the boiled-down essence of your
Iterator class (actually, of your sync() function for the most part).

It seems to work for sets and multisets; I tried to get it to work for maps
as well, but didn't quite get to the bottom of why it doesn't (probably
just some stupid fundamental property of maps I'm spacing on, because I'm
getting an error from deep in the bowels of the STL about a missing
operator== somewhere...).

Anyway, perhaps this little xreplace template might be useful to someone,
or least be the basis for something useful.
Cheers,
-leor

--
Leor Zolman --- BD Software --- www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix
C++ users: Download BD Software's free STL Error Message Decryptor at:
www.bdsoft.com/tools/stlfilt.html
Jul 22 '05 #22
On 6 Apr 2004 08:50:36 -0700, md*****@ou.edu (Michael Klatt) wrote:


After reading this thread and thinking about it some more, I don't
have a really compelling reason for a mutable set iterator. It turns
out that the people who put together the Standard Library are smarter
than me after all. :)


Well, I was playing around a bit, thinking a little utility for replacing a
value of an associative container might be useful in its own right, and got
as far as this for sets (warning: For testing, I use some non-standard
utility libs for initializing and displaying contents of containers. These
are all available in my InitUtil distributions):

#include <iostream>
#include <set>

#include "ESTLUtil.h " // Utils for initializing
#include "InitUtil.h " // and displaying containers
using namespace bds;
using namespace ESTLUtils;

using namespace std;

template<class Cont, class It, class T>
void xreplace(Cont &cont, It it, const T &value)
{
typename Cont::key_compa re Compare;
if (it == cont.end())
cont.insert(val ue);

if (Compare(*it, value) || Compare(value, *it))
{
cont.erase(it);
cont.insert(val ue);
}
else
const_cast<T&>( *it) = value;
}

int main()
{
// (From InitUtil: stuff values into a container)
set<int> s = make_cont("1,1, 3,9,143,207, 194, 195, 199, 200");
// (From ESTLUtils: display contents of a container
printContainer( "s Before xreplace: ", s);

set<int>::itera tor it = find(s.begin(), s.end(), 194);
if (it == s.end())
cout << "Whoops, no 194 to replace" << endl;
else
xreplace(s, it, 50);

printContainer( "After xreplacing 194 with 50: ", s);

return 0;
}

So the "xreplace" function template is the boiled-down essence of your
Iterator class (actually, of your sync() function for the most part).

It seems to work for sets and multisets; I tried to get it to work for maps
as well, but didn't quite get to the bottom of why it doesn't (probably
just some stupid fundamental property of maps I'm spacing on, because I'm
getting an error from deep in the bowels of the STL about a missing
operator== somewhere...).

Anyway, perhaps this little xreplace template might be useful to someone,
or least be the basis for something useful.
Cheers,
-leor

--
Leor Zolman --- BD Software --- www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix
C++ users: Download BD Software's free STL Error Message Decryptor at:
www.bdsoft.com/tools/stlfilt.html
Jul 22 '05 #23
"Michael Klatt" <md*****@ou.edu > wrote in message
news:2c******** *************** ***@posting.goo gle.com...
"Siemel Naran" <Si*********@RE MOVE.att.net> wrote in message

news:<VN******* *************@b gtnsc05-news.ops.worldn et.att.net>...
Your code is mostly sound. In what scenario do you find this useful?


This is all part of a database framework. When I add a record to the
database I need to determine if it's a new record or a correction for
an existing record. In the latter case I need to overwrite parts of
the existing record while preserving the key information:

RainSet rainfall("dbnam e"); // manages records from a DBMS
rainfall.retrie ve();
RainFile input;
RainRecord record;
while (input >> record)
{
RainSet::Iterat or it(rainfall.fin d(record));
if (it != rainfall.end())
{
// update existing record
it->amount(record. amount());
}
else
{
rainfall.insert (record);
}
}
rainfall.store( );

I currently use a std::list as the underlying container for a RainSet,
but I have to rely on the DBMS for all of my sorting. This, as well
as finding specific records, is too slow for large datasets. Thus, I
would like to use a sorted container like a std::set or std::map. In
the example I gave above, the changes I make to a record will not
effect its sort order.


What does the function rainfall.find(r ecord) do? Does it issue a new SQL
statement to find a particular record? This could be slow if 'input'
contains many records, as you'll issue individual queries to find each
record. Is it possible to open a SQL cursor, and in RainSet::find scan the
cursor to find a particular record, which will normally take O(lg(N)) time
given an appropriate index? Alternately, you could read many records from
the database into memory using a smart WHERE statement (ie. select * from
contact where name in ('Siemel', 'Michael') or select * from contact where
home_city = 'San Francisco').

In any case, the database contains more records than can fit into memory.

Assuming you read many records into memory and that you update columns that
don't affect the sort order, I think the generic class Iterator<Set>
solution is overkill. All you need is a struct of const data and non-const
data, which is what I think John was suggesting in his reply. For example,
suppose we want to update the favorite color of many people, and we query
for people by first_name. Then issue a select statement "select first_name,
favorite_color from contact where home_city = ? order by first_name" which
should use the index on contact.first_n ame. Read all records into memory.

class Record {
public:
Record(const std::string& firstname, const std::string& favoritecolor);
const std::string& firstname() const;
const std::string& favoritecolor() const;
void favoritecolor(c onst std::string&);
private:
const std::string d_firstname;
std::string d_favoritecolor ;
};

Now just instantiate a std::vector<Rec ord> and read the SQL select results
already sorted by first_name into memory. The firstname is readonly, so you
can't possibly screw up the sort order (well, there is placement new and
delete, but that's wizadry). But favorite color is editable. Use
std::lower_boun d or std::upper_boun d to locate records in the vector. Only
one catch: class Record does not have an operator= (for classes with const
data the compiler generated operator= fails to compile), and therefore it
can't be used in a standard container. You could always use a (smart)
pointer to Data though, like a std::vector<boo st::shared_ptr< Record> >.

What about operator== and operator!=. I guess we want to be able to use
these iterators :).


Of course, and the following question arises: What should the
semantics of comparison be? Are two Iterators equivalent if they
point to the same element (m_iterator == rhs.m_iterator) or does the
proxy object have to be the same too?
I can imagine cases where either comparison is desired.


I think if the first condition is true, then the second condition ought to
be true. The iterator and iterator::refer ence classes I suggested
previously don't even use proxy objects.
Jul 22 '05 #24
"Michael Klatt" <md*****@ou.edu > wrote in message
news:2c******** *************** ***@posting.goo gle.com...
"Siemel Naran" <Si*********@RE MOVE.att.net> wrote in message

news:<VN******* *************@b gtnsc05-news.ops.worldn et.att.net>...
Your code is mostly sound. In what scenario do you find this useful?


This is all part of a database framework. When I add a record to the
database I need to determine if it's a new record or a correction for
an existing record. In the latter case I need to overwrite parts of
the existing record while preserving the key information:

RainSet rainfall("dbnam e"); // manages records from a DBMS
rainfall.retrie ve();
RainFile input;
RainRecord record;
while (input >> record)
{
RainSet::Iterat or it(rainfall.fin d(record));
if (it != rainfall.end())
{
// update existing record
it->amount(record. amount());
}
else
{
rainfall.insert (record);
}
}
rainfall.store( );

I currently use a std::list as the underlying container for a RainSet,
but I have to rely on the DBMS for all of my sorting. This, as well
as finding specific records, is too slow for large datasets. Thus, I
would like to use a sorted container like a std::set or std::map. In
the example I gave above, the changes I make to a record will not
effect its sort order.


What does the function rainfall.find(r ecord) do? Does it issue a new SQL
statement to find a particular record? This could be slow if 'input'
contains many records, as you'll issue individual queries to find each
record. Is it possible to open a SQL cursor, and in RainSet::find scan the
cursor to find a particular record, which will normally take O(lg(N)) time
given an appropriate index? Alternately, you could read many records from
the database into memory using a smart WHERE statement (ie. select * from
contact where name in ('Siemel', 'Michael') or select * from contact where
home_city = 'San Francisco').

In any case, the database contains more records than can fit into memory.

Assuming you read many records into memory and that you update columns that
don't affect the sort order, I think the generic class Iterator<Set>
solution is overkill. All you need is a struct of const data and non-const
data, which is what I think John was suggesting in his reply. For example,
suppose we want to update the favorite color of many people, and we query
for people by first_name. Then issue a select statement "select first_name,
favorite_color from contact where home_city = ? order by first_name" which
should use the index on contact.first_n ame. Read all records into memory.

class Record {
public:
Record(const std::string& firstname, const std::string& favoritecolor);
const std::string& firstname() const;
const std::string& favoritecolor() const;
void favoritecolor(c onst std::string&);
private:
const std::string d_firstname;
std::string d_favoritecolor ;
};

Now just instantiate a std::vector<Rec ord> and read the SQL select results
already sorted by first_name into memory. The firstname is readonly, so you
can't possibly screw up the sort order (well, there is placement new and
delete, but that's wizadry). But favorite color is editable. Use
std::lower_boun d or std::upper_boun d to locate records in the vector. Only
one catch: class Record does not have an operator= (for classes with const
data the compiler generated operator= fails to compile), and therefore it
can't be used in a standard container. You could always use a (smart)
pointer to Data though, like a std::vector<boo st::shared_ptr< Record> >.

What about operator== and operator!=. I guess we want to be able to use
these iterators :).


Of course, and the following question arises: What should the
semantics of comparison be? Are two Iterators equivalent if they
point to the same element (m_iterator == rhs.m_iterator) or does the
proxy object have to be the same too?
I can imagine cases where either comparison is desired.


I think if the first condition is true, then the second condition ought to
be true. The iterator and iterator::refer ence classes I suggested
previously don't even use proxy objects.
Jul 22 '05 #25
"Siemel Naran" <Si*********@RE MOVE.att.net> wrote in message news:<Hc******* *************@b gtnsc05-news.ops.worldn et.att.net>...
"Michael Klatt" <md*****@ou.edu > wrote in message
news:2c******** *************** ***@posting.goo gle.com...
"Siemel Naran" <Si*********@RE MOVE.att.net> wrote in message news:<VN******* *************@b gtnsc05-news.ops.worldn et.att.net>...
Your code is mostly sound. In what scenario do you find this useful?


This is all part of a database framework. When I add a record to the
database I need to determine if it's a new record or a correction for
an existing record. In the latter case I need to overwrite parts of
the existing record while preserving the key information:

RainSet rainfall("dbnam e"); // manages records from a DBMS
rainfall.retrie ve();
RainFile input;
RainRecord record;
while (input >> record)
{
RainSet::Iterat or it(rainfall.fin d(record));
if (it != rainfall.end())
{
// update existing record
it->amount(record. amount());
}
else
{
rainfall.insert (record);
}
}
rainfall.store( );

I currently use a std::list as the underlying container for a RainSet,
but I have to rely on the DBMS for all of my sorting. This, as well
as finding specific records, is too slow for large datasets. Thus, I
would like to use a sorted container like a std::set or std::map. In
the example I gave above, the changes I make to a record will not
effect its sort order.


What does the function rainfall.find(r ecord) do? Does it issue a new SQL
statement to find a particular record?


A RainSet is a container for database records, with the usual
container funtionality (such as RainSet::find) plus the ability to
retrieve and store database records via SQL.

Alternately, you could read many records from
the database into memory using a smart WHERE statement (ie. select * from
contact where name in ('Siemel', 'Michael') or select * from contact where
home_city = 'San Francisco').

There is a RainSet::Filter class for this purpose:

RainSet rainfall("dbnam e");
RainSet::Filter filter;
filter.timestam p(begin, end).period(dai ly);
rainfall.filter (filter);
rainfall.retrie ve(); // executes SELECT ... WHERE query on database

Assuming you read many records into memory and that you update columns that
don't affect the sort order, I think the generic class Iterator<Set>
solution is overkill.
Agreed.
All you need is a struct of const data and non-const
data, which is what I think John was suggesting in his reply.


Yes, I am giving this suggestion some thought.
Jul 22 '05 #26
"Siemel Naran" <Si*********@RE MOVE.att.net> wrote in message news:<Hc******* *************@b gtnsc05-news.ops.worldn et.att.net>...
"Michael Klatt" <md*****@ou.edu > wrote in message
news:2c******** *************** ***@posting.goo gle.com...
"Siemel Naran" <Si*********@RE MOVE.att.net> wrote in message news:<VN******* *************@b gtnsc05-news.ops.worldn et.att.net>...
Your code is mostly sound. In what scenario do you find this useful?


This is all part of a database framework. When I add a record to the
database I need to determine if it's a new record or a correction for
an existing record. In the latter case I need to overwrite parts of
the existing record while preserving the key information:

RainSet rainfall("dbnam e"); // manages records from a DBMS
rainfall.retrie ve();
RainFile input;
RainRecord record;
while (input >> record)
{
RainSet::Iterat or it(rainfall.fin d(record));
if (it != rainfall.end())
{
// update existing record
it->amount(record. amount());
}
else
{
rainfall.insert (record);
}
}
rainfall.store( );

I currently use a std::list as the underlying container for a RainSet,
but I have to rely on the DBMS for all of my sorting. This, as well
as finding specific records, is too slow for large datasets. Thus, I
would like to use a sorted container like a std::set or std::map. In
the example I gave above, the changes I make to a record will not
effect its sort order.


What does the function rainfall.find(r ecord) do? Does it issue a new SQL
statement to find a particular record?


A RainSet is a container for database records, with the usual
container funtionality (such as RainSet::find) plus the ability to
retrieve and store database records via SQL.

Alternately, you could read many records from
the database into memory using a smart WHERE statement (ie. select * from
contact where name in ('Siemel', 'Michael') or select * from contact where
home_city = 'San Francisco').

There is a RainSet::Filter class for this purpose:

RainSet rainfall("dbnam e");
RainSet::Filter filter;
filter.timestam p(begin, end).period(dai ly);
rainfall.filter (filter);
rainfall.retrie ve(); // executes SELECT ... WHERE query on database

Assuming you read many records into memory and that you update columns that
don't affect the sort order, I think the generic class Iterator<Set>
solution is overkill.
Agreed.
All you need is a struct of const data and non-const
data, which is what I think John was suggesting in his reply.


Yes, I am giving this suggestion some thought.
Jul 22 '05 #27

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

Similar topics

5
2087
by: Leif K-Brooks | last post by:
Is there a word for an iterable object which isn't also an iterator, and therefor can be iterated over multiple times without being exhausted? "Sequence" is close, but a non-iterator iterable could technically provide an __iter__ method without implementing the sequence protocol, so it's not quite right.
38
3689
by: Grant Edwards | last post by:
In an interview at http://acmqueue.com/modules.php?name=Content&pa=showpage&pid=273 Alan Kay said something I really liked, and I think it applies equally well to Python as well as the languages mentioned: I characterized one way of looking at languages in this way: a lot of them are either the agglutination of features or they're a crystallization of style. Languages such as APL, Lisp, and Smalltalk are what you might call style...
5
1825
by: Jacob Page | last post by:
I have released interval-0.2.1 at http://members.cox.net/apoco/interval/. IntervalSet and FrozenIntervalSet objects are now (as far as I can tell) functionality equivalent to set and frozenset objects, except they can contain intervals as well as discrete values. Though I have my own unit tests for verifying this claim, I'd like to run my code through actual set and frozenset unit tests. Does any such code exist? Is it in pure...
9
2133
by: Alexander Stippler | last post by:
Hi, I've got trouble with some well known issue. Iterator invalidation. My situation: for (it=v.begin(); it!=v.end(); ++it) { f(*it); } Under some circumstances, f may alter the container by removing the current
7
5188
by: andreas | last post by:
Hello, I have a problem with iterators in a fairly complex polygonal mesh data structure which is implemented using lists of geometric entities. However, the problem in itself is fairly simple: I need to define special iterator values. In particular, I want a null iterator. This is different from end() which means the end of this list. I want an iterator value that is known to just not correspond to any element. It must be possible to...
19
2134
by: fungus | last post by:
I mentioned earlier to day that I was moving some code from VC++6 to VC++2005 and having trouble with the new iterators. There's all sorts of problems cropping up in the code thanks to this change. a) With pointer-iterators you could set an iterator to null to mark it as invalid, you can't do that any more. b) You can't use const_cast with iterators.
27
5317
by: Steven D'Aprano | last post by:
I thought that an iterator was any object that follows the iterator protocol, that is, it has a next() method and an __iter__() method. But I'm having problems writing a class that acts as an iterator. I have: class Parrot(object): def __iter__(self): return self def __init__(self): self.next = self._next()
1
2880
by: tonylamb | last post by:
Hi All, I seem to be getting an error with my code when running Intel C++ compiler via Visual Studio 2005. The error generated is "Expression:map/set iterator not dereferencable" I've given my code below in the hope that someone can spot the problem. Many Thanks....... set<stl_index>::iterator eit1, eit2=elmt_ids.begin(); bool non_consecutive(false); // 0. checking whether the elements...
13
6365
by: Yosifov Pavel | last post by:
Whats is the way to clone "independent" iterator? I can't use tee(), because I don't know how many "independent" iterators I need. copy and deepcopy doesn't work... --pavel
5
2290
by: Luis Zarrabeitia | last post by:
Hi there. For most use cases I think about, the iterator protocol is more than enough. However, on a few cases, I've needed some ugly hacks. Ex 1: a = iter() # assume you got the iterator from a function and b = iter() # these two are just examples.
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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
10083
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
8968
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...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4044
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
3
2877
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.