473,763 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

range count


Hi
I have a vector<charwhic h looks like this (a d d d a d s g e d d d d
d k)
I need to get the biggest count of consecutive 'd'. 5 in this example

I am toying with this method but not sure if it is optimal.

thanks

int k = 0;
vector::const_i terator i = find(v.begin(), v.end(), 'r')
while ( i != v.end() ) {
vector::const_i terator j = find(i, v.end(), any_thing_but 'r')
if ( (j - i) k ) k = (j - i)
i = j
}

Jul 26 '06
23 2900
In article <87************ @localhost.loca ldomain>,
Gary Wessle <ph****@yahoo.c omwrote:
"Daniel T." <da******@earth link.netwrites:
In article <87************ @localhost.loca ldomain>,
Gary Wessle <ph****@yahoo.c omwrote:
"Daniel T." <da******@earth link.netwrites:
>
In article <87************ @localhost.loca ldomain>,
Gary Wessle <ph****@yahoo.c omwrote:

thank you for taking the time to post this, :) I am having hard time
understanding the code you gave because of my newbi status. I'd
rather
write something I can grasp it for now till my level goes up.

That's fine. Let's look at the algorithm you wrote:

int statistics::big est_r(vector<ch arconst& cv)
{
int k = 0;
vector_iterator i = find(cv.begin() , v.end(), 'r');
while (i != cv.end()){
vector_iterator j = find_if(i, cv.end(), not_r);
if ( (j-i) k ) k = (j-i);
i = j;
}
return k;
}

Obviously your code doesn't compile, but I'm going to ignore that for
>
I am embedding what you suggested in my code but would need some
direction, if you could please.
What's the first error the compiler give you and what line does it point
to?


the code and the error are as listed ( thank you for helping :) )
OK, the first 3 errors:
statistics.h:9: error: expected template-name before '<' token
statistics.h:9: error: expected `{' before '<' token
statistics.h:9: error: expected unqualified-id before '<' token
We can see that it deals with the file "statistics .h" at line 9. So
let's look at that line:
class count_consecuti ve : public unary_function< char, void >
{
Now, all three of the errors have a problem with what is just before the
'<' token so what is that? It's "unary_function ". How can the compiler
have a problem with that, it's part of the standard library? Well, first
as part of the standard library it's in the std namespace. Also it's
defined in a file that might not have been included (it's defined in
<functional>. )

So, fix that and compile again.
Jul 27 '06 #11
Gary Wessle wrote:
>

Hi
I have a vector<charwhic h looks like this (a d d d a d s g e d d d d
d k)
I need to get the biggest count of consecutive 'd'. 5 in this example

I am toying with this method but not sure if it is optimal.

thanks

int k = 0;
vector::const_i terator i = find(v.begin(), v.end(), 'r')
while ( i != v.end() ) {
vector::const_i terator j = find(i, v.end(), any_thing_but 'r')
if ( (j - i) k ) k = (j - i)
i = j
}
How about the following?

int count_consecuti ve (const vector<char>& v, char c)
{
int current_count = 0;
int best_count = 0;
for (vector<char>:: const_iterator it = v.begin(); it != v.end(); ++it)
if (*it == c)
best_count = max(best_count, ++current_count );
else
current_count = 0;
return best_count;
}

Mark
Jul 27 '06 #12
"Daniel T." <da******@earth link.netwrites:
In article <87************ @localhost.loca ldomain>,
Gary Wessle <ph****@yahoo.c omwrote:
"Daniel T." <da******@earth link.netwrites:
In article <87************ @localhost.loca ldomain>,
Gary Wessle <ph****@yahoo.c omwrote:
>
"Daniel T." <da******@earth link.netwrites:

In article <87************ @localhost.loca ldomain>,
Gary Wessle <ph****@yahoo.c omwrote:
>
thank you for taking the time to post this, :) I am having hard time
understanding the code you gave because of my newbi status. I'd
rather
write something I can grasp it for now till my level goes up.
>
That's fine. Let's look at the algorithm you wrote:
>
int statistics::big est_r(vector<ch arconst& cv)
{
int k = 0;
vector_iterator i = find(cv.begin() , v.end(), 'r');
while (i != cv.end()){
vector_iterator j = find_if(i, cv.end(), not_r);
if ( (j-i) k ) k = (j-i);
i = j;
}
return k;
}
>
Obviously your code doesn't compile, but I'm going to ignore that for

I am embedding what you suggested in my code but would need some
direction, if you could please.
>
What's the first error the compiler give you and what line does it point
to?

the code and the error are as listed ( thank you for helping :) )

OK, the first 3 errors:
statistics.h:9: error: expected template-name before '<' token
statistics.h:9: error: expected `{' before '<' token
statistics.h:9: error: expected unqualified-id before '<' token

We can see that it deals with the file "statistics .h" at line 9. So
let's look at that line:
class count_consecuti ve : public unary_function< char, void >
{

Now, all three of the errors have a problem with what is just before the
'<' token so what is that? It's "unary_function ". How can the compiler
have a problem with that, it's part of the standard library? Well, first
as part of the standard library it's in the std namespace. Also it's
defined in a file that might not have been included (it's defined in
<functional>. )

So, fix that and compile again.
thank you

I added
#include <functional>
using std::unary_func tion;
to the statistics.h

similarly I added to statistics.cpp
using std::max

so that it shows like
#include <algorithm>
using std::count;
using std::max

the error now are
*************** * error *************** *
t$ make clean; make
rm -rf *.o proj
g++ -c -o statistics.o statistics.cpp
statistics.h:4: error: expected `;' before 'using'
statistics.cpp: 29: error: prototype for 'unsigned int count_consecuti ve::result() const' does not match any in class 'count_consecut ive'
statistics.h:23 : error: candidate is: unsigned int count_consecuti ve::result()
make: *** [statistics.o] Error 1

here are the related sections of those files again
*************** * statistics.h *************** *
#ifndef STATISTICS_H
#define STATISTICS_H
#include <vector>
using std::vector; << --- line 4 I don't see a problem.

#include <functional>
using std::unary_func tion;

#include <map>
using std::map;
*************** * statistics.cpp *************** *
#include <vector>
using std::vector;

#include <algorithm>
using std::count;

#include <algorithm>
using std::max
#include "statistics .h"
count_consecuti ve::count_conse cutive( char value )
: comp( value )
, count( 0 )
, max_count( 0 )
{ }

void count_consecuti ve::operator()( char c ) {
if ( c == comp )
++count;
else {
max_count = max( count, max_count );
count = 0;
}
}

unsigned count_consecuti ve::result() const {
return max( count, max_count );
} << ------------- here is line 29, I really don't know what type max returns

on linux
$man::max returns nothing
The C++ Programming Language by Stroustrup did not have a easy-find
way in the index.
could you recommend a good ref. book and/or web link?

thanks
Jul 27 '06 #13
Mark P <us****@fall200 5REMOVE.fastmai lCAPS.fmwrites:
Gary Wessle wrote:
Hi
I have a vector<charwhic h looks like this (a d d d a d s g e d d d d
d k)
I need to get the biggest count of consecutive 'd'. 5 in this
example I am toying with this method but not sure if it is optimal.
thanks
int k = 0;
vector::const_i terator i = find(v.begin(), v.end(), 'r')
while ( i != v.end() ) {
vector::const_i terator j = find(i, v.end(), any_thing_but 'r')
if ( (j - i) k ) k = (j - i)
i = j
}

How about the following?

int count_consecuti ve (const vector<char>& v, char c)
{
int current_count = 0;
int best_count = 0;
for (vector<char>:: const_iterator it = v.begin(); it != v.end(); ++it)
if (*it == c)
best_count = max(best_count, ++current_count );
brilliant
else
current_count = 0;
return best_count;
}

Mark
thanks, I simplified the code a lot because of your good idea but I am
getting

ps. I am still working out the other sub-thread in the hope I will
learn something.

*************** * error *************** *
$ make clean; make
rm -rf *.o proj
g++ -c -o statistics.o statistics.cpp
statistics.h:4: error: expected `;' before 'using'
make: *** [statistics.o] Error 1
here is the code
*************** * statistics.h *************** *
#ifndef STATISTICS_H
#define STATISTICS_H
#include <vector>
using std::vector;

#include <map>
using std::map;

class statistics
{
map<char, intmp;
vector<charv;
void stock_take();

public:
statistics(vect or<charconst& cv);
~statistics();
map<char,intget _counts();
};

#endif
*************** * statistics.cpp *************** *
#include <vector>
using std::vector;

#include <algorithm>
using std::max

#include "statistics .h"

statistics::sta tistics(vector< charconst& cv)
: v( cv )
{
stock_take();
}

void statistics::sto ck_take()
{
char r = 'r';
char c = 'c';
int current_count = 0;
int best_count = 0;
for (vector<char>:: const_iterator it = v.begin(); it != v.end(); ++it)
if (*it == r)
best_count = max(best_count, ++current_count );
else
if (*it != r){
current_count = 0;
if (*it == c)
mp[c]++ ;
}
mp[r] = best_count;
}
map<char,intsta tistics::get_co unts(){
return mp;
}

*************** * statistics_test .cpp *************** *
#include <iostream>
using std::cout;

#include <vector>
using std::vector;

#include "statistics .h"

int main() {

vector v = {c r r r d x c c d d d d k};
statistics st1(v);
cout << "c" << (st1.get_counts )[c]
<< "r" << (st1.get_counts )[r]
<< '\n';
}
Jul 28 '06 #14
In article <87************ @localhost.loca ldomain>,
Gary Wessle <ph****@yahoo.c omwrote:
the error now are
*************** * error *************** *
t$ make clean; make
rm -rf *.o proj
g++ -c -o statistics.o statistics.cpp
statistics.h:4: error: expected `;' before 'using'
statistics.cpp: 29: error: prototype for 'unsigned int
count_consecuti ve::result() const' does not match any in class
'count_consecut ive'
statistics.h:23 : error: candidate is: unsigned int
count_consecuti ve::result()
make: *** [statistics.o] Error 1

here are the related sections of those files again
*************** * statistics.h *************** *
#ifndef STATISTICS_H
#define STATISTICS_H
#include <vector>
using std::vector; << --- line 4 I don't see a problem.

#include <functional>
using std::unary_func tion;

#include <map>
using std::map;
*************** * statistics.cpp *************** *
#include <vector>
using std::vector;

#include <algorithm>
using std::count;

#include <algorithm>
using std::max
#include "statistics .h"
count_consecuti ve::count_conse cutive( char value )
: comp( value )
, count( 0 )
, max_count( 0 )
{ }

void count_consecuti ve::operator()( char c ) {
if ( c == comp )
++count;
else {
max_count = max( count, max_count );
count = 0;
}
}

unsigned count_consecuti ve::result() const {
return max( count, max_count );
} << ------------- here is line 29, I really don't know what type max returns

on linux
$man::max returns nothing
The C++ Programming Language by Stroustrup did not have a easy-find
way in the index.
could you recommend a good ref. book and/or web link?

thanks
To understand the error at line four, you have to understand how the
#include mechanism works. What it does is replace the line where the
#include is with the contents of the file. It works just like a
copy/paste. Many times a syntax error in a program won't be caught by
the compiler until it parses through a line or two more in the code. So,
if you don't see the problem in statistics.h look just above where it is
included. Remember, the compiler was looking for a ';' before the
'using'...

Fix that, post the code and the next error and we will continue. This
really is how I do it by the way, fix the first error then recompile.
Jul 28 '06 #15
"Daniel T." <da******@earth link.netwrites:
In article <87************ @localhost.loca ldomain>,
Gary Wessle <ph****@yahoo.c omwrote:
the error now are
*************** * error *************** *
t$ make clean; make
rm -rf *.o proj
g++ -c -o statistics.o statistics.cpp
statistics.h:4: error: expected `;' before 'using'
statistics.cpp: 29: error: prototype for 'unsigned int
count_consecuti ve::result() const' does not match any in class
'count_consecut ive'
statistics.h:23 : error: candidate is: unsigned int
count_consecuti ve::result()
make: *** [statistics.o] Error 1

here are the related sections of those files again
*************** * statistics.h *************** *
#ifndef STATISTICS_H
#define STATISTICS_H
#include <vector>
using std::vector; << --- line 4 I don't see a problem.

#include <functional>
using std::unary_func tion;

#include <map>
using std::map;
*************** * statistics.cpp *************** *
#include <vector>
using std::vector;

#include <algorithm>
using std::count;

#include <algorithm>
using std::max
#include "statistics .h"
count_consecuti ve::count_conse cutive( char value )
: comp( value )
, count( 0 )
, max_count( 0 )
{ }

void count_consecuti ve::operator()( char c ) {
if ( c == comp )
++count;
else {
max_count = max( count, max_count );
count = 0;
}
}

unsigned count_consecuti ve::result() const {
return max( count, max_count );
} << ------------- here is line 29, I really don't know what type max returns

on linux
$man::max returns nothing
The C++ Programming Language by Stroustrup did not have a easy-find
way in the index.
could you recommend a good ref. book and/or web link?

thanks

To understand the error at line four, you have to understand how the
#include mechanism works. What it does is replace the line where the
#include is with the contents of the file. It works just like a
copy/paste. Many times a syntax error in a program won't be caught by
the compiler until it parses through a line or two more in the code. So,
if you don't see the problem in statistics.h look just above where it is
included. Remember, the compiler was looking for a ';' before the
'using'...
ahha
no ";" after max in statistics.cpp
using std::max
>
Fix that, post the code and the next error and we will continue. This
really is how I do it by the way, fix the first error then recompile.
ok, I fixed this, and compiled, I changed the name of the files where
the word statistics appears to statistics2

*************** * statistics2.h *************** *
#ifndef STATISTICS2_H
#define STATISTICS2_H
#include <vector>
using std::vector;

#include <functional>
using std::unary_func tion;

#include <map>
using std::map;

class count_consecuti ve : public unary_function< char, void >
{

public:

char comp;
unsigned count;
unsigned max_count;
count_consecuti ve(char value);
~count_consecut ive();
void operator()(char c);
unsigned result();
};
class statistics
{
map<char, intmp;
vector<charv;
void stock_take();
int bigest_r(vector <charconst& cv);

public:
statistics(vect or<charconst& cv);
~statistics();
map<char,intget _counts;
};

#endif

*************** * statistics2.cpp *************** *
#include <vector>
using std::vector;

#include <algorithm>
using std::count;
using std::max;
#include "statistics 2.h"
count_consecuti ve::count_conse cutive( char value )
: comp( value )
, count( 0 )
, max_count( 0 )
{ }

void count_consecuti ve::operator()( char c ) {
if ( c == comp )
++count;
else {
max_count = max( count, max_count );
count = 0;
}
}

unsigned count_consecuti ve::result() {
return max( count, max_count );
}

statistics::sta tistics(vector< charconst& cv)
: v( cv )
{
statistics::sto ck_take();
}

void statistics::sto ck_take()
{
mp['c'] = count(v.begin() , v.end(), 'c');
mp['r'] = bigest_r(v);
}
int statistics::big est_r(vector<ch arconst& cv)
{
int k = for_each( cv.begin(), cv.end(),
count_consecuti ve( 'd' ) ).result();
return k;

}

*************** * statistics2_tes t.cpp *************** *
#include <iostream>
using std::cout;

#include <vector>
using std::vector;

#include <map>
using std::map;

#include "statistics 2.h"

int main() {

vector<charv = {c r r r d x c c d d d d k};
statistics st1(v);
map<char, intmci = st1.get_counts( );
cout << "c" << mci['c']
<< "r" << mci['r']
<< '\n';
}
*************** * error *************** *
$ make clean; make
rm -rf *.o proj
g++ -c -o statistics2.o statistics2.cpp
g++ -c -o statistics_test 2.o statistics_test 2.cpp
statistics_test 2.cpp: In function 'int main()':
statistics_test 2.cpp:14: error: 'c' was not declared in this scope
statistics_test 2.cpp:14: error: expected `}' before 'r'
statistics_test 2.cpp:14: error: 'v' must be initialized by constructor, not by '{...}'
statistics_test 2.cpp:14: error: expected ',' or ';' before 'r'
statistics_test 2.cpp: At global scope:
statistics_test 2.cpp:15: error: 'v' was not declared in this scope
statistics_test 2.cpp:16: error: no match for call to '(std::map<char , int, std::less<char> , std::allocator< std::pair<const char, int >) ()'
statistics_test 2.cpp:17: error: expected constructor, destructor, or type conversion before '<<' token
statistics_test 2.cpp:20: error: expected declaration before '}' token
make: *** [statistics_test 2.o] Error 1
fred@debian:~/myPrograms/backtest/res$
Jul 28 '06 #16
ok, if fixed them all, now it compiles, man what a learning
experience "many thanks to you".

the code does not give me what I want, but I will keep working on
that.

*************** * statistics2.h *************** *
#ifndef STATISTICS2_H
#define STATISTICS2_H
#include <vector>
using std::vector;

#include <functional>
using std::unary_func tion;

#include <map>
using std::map;

class count_consecuti ve : public unary_function< char, void >
{

public:

char comp;
unsigned count;
unsigned max_count;
count_consecuti ve(char value);
~count_consecut ive(){}
void operator()(char c);
unsigned result();
};
class statistics
{
map<char, intmp;
vector<charv;
void stock_take();
int bigest_r(vector <charconst& cv);

public:
statistics(vect or<charconst& cv);
~statistics(){}
map<char,intget _counts();
};

#endif


*************** * statistics2.cpp *************** *
#include <vector>
using std::vector;

#include <algorithm>
using std::count;
using std::max;
#include "statistics 2.h"
count_consecuti ve::count_conse cutive( char value )
: comp( value )
, count( 0 )
, max_count( 0 )
{ }

void count_consecuti ve::operator()( char c ) {
if ( c == comp )
++count;
else {
max_count = max( count, max_count );
count = 0;
}
}

unsigned count_consecuti ve::result() {
return max( count, max_count );
}

statistics::sta tistics(vector< charconst& cv)
: v( cv )
{
statistics::sto ck_take();
}

void statistics::sto ck_take()
{
mp['c'] = count(v.begin() , v.end(), 'c');
mp['r'] = bigest_r(v);
}
int statistics::big est_r(vector<ch arconst& cv)
{
int k = for_each( cv.begin(), cv.end(),
count_consecuti ve( 'd' ) ).result();
return k;

}
map<char,intsta tistics::get_co unts(){
return mp;
}
*************** * statistics2_tes t.cpp *************** *
#include <iostream>
using std::cout;

#include <vector>
using std::vector;

#include <map>
using std::map;

#include "statistics 2.h"

int main() {

vector<charv;
v.push_back('c' );
v.push_back('r' );
v.push_back('r' );
v.push_back('c' );
v.push_back('r' );
v.push_back('r' );
v.push_back('r' );
v.push_back('r' );
statistics st1(v);
map<char, intmci = st1.get_counts( );
cout << "c" << mci['c']
<< "r" << mci['r']
<< '\n';
}
*************** * out put *************** *
c2r0

*************** * expected *************** *
c2r4
Jul 28 '06 #17
Mark P <us****@fall200 5REMOVE.fastmai lCAPS.fmwrites:
Gary Wessle wrote:
Hi
I have a vector<charwhic h looks like this (a d d d a d s g e d d d d
d k)
I need to get the biggest count of consecutive 'd'. 5 in this
example I am toying with this method but not sure if it is optimal.
thanks
int k = 0;
vector::const_i terator i = find(v.begin(), v.end(), 'r')
while ( i != v.end() ) {
vector::const_i terator j = find(i, v.end(), any_thing_but 'r')
if ( (j - i) k ) k = (j - i)
i = j
}

How about the following?

int count_consecuti ve (const vector<char>& v, char c)
{
int current_count = 0;
int best_count = 0;
for (vector<char>:: const_iterator it = v.begin(); it != v.end(); ++it)
if (*it == c)
best_count = max(best_count, ++current_count );
else
current_count = 0;
return best_count;
}

Mark
many thanks, here is the code after all the repairs

*************** * statistics.h *************** *
#ifndef STATISTICS_H
#define STATISTICS_H
#include <vector>
using std::vector;

#include <map>
using std::map;

class statistics
{
map<char, intmp;
vector<charv;
void stock_take();

public:
statistics(vect or<charconst& cv);
~statistics(){}

map<char,intget _counts();
};

#endif

*************** * statistics.cpp *************** *
#include <vector>
using std::vector;

#include <algorithm>
using std::max;

#include "statistics .h"

statistics::sta tistics(vector< charconst& cv)
: v( cv )
{
stock_take();
}

void statistics::sto ck_take()
{
char r = 'r';
char c = 'c';
int current_count = 0;
int best_count = 0;
for (vector<char>:: const_iterator it = v.begin(); it != v.end(); ++it)
if (*it == r)
best_count = max(best_count, ++current_count );
else
if (*it != r){
current_count = 0;
if (*it == c)
mp[c]++ ;
}
mp[r] = best_count;
}
map<char,intsta tistics::get_co unts(){
return mp;
}

*************** * statistics_test .cpp *************** *

#include <iostream>
using std::cout;

#include <vector>
using std::vector;

#include <map>
using std::map;

#include "statistics .h"

int main() {
vector<charv;
v.push_back('c' );
v.push_back('r' );
v.push_back('r' );
v.push_back('c' );
v.push_back('r' );
v.push_back('r' );
v.push_back('r' );
v.push_back('r' );
statistics st1(v);
map<char, intmci = st1.get_counts( );
cout << "c" << mci['c']
<< "r" << mci['r']
<< '\n';
}

*************** * output *************** *
c2r4
Jul 28 '06 #18
In article <87************ @localhost.loca ldomain>,
Gary Wessle <ph****@yahoo.c omwrote:
ok, if fixed them all, now it compiles, man what a learning
experience "many thanks to you".

the code does not give me what I want, but I will keep working on
that.
When you first posted about your problem, you seemed to be confused as
to whether you are trying to count the number of consecutive 'd's or the
number of consecutive 'r's. Your current code reflects that confusion.

Look at the function bigest_r. What are you trying to count?
Jul 28 '06 #19

Gary Wessle wrote:
on linux
$man::max returns nothing
The C++ Programming Language by Stroustrup did not have a easy-find
way in the index.
Hmmm. Looked for max in the index, found max(), followed the first
reference to page 544 and found:

18.9 Min and Max
The algorithms described here select a value based on a comparison.
It is obviously useful to be
able to find the maximum and minimum of two values:

template<class T const T& max (const T& a , const T& b )
{
return (a <b ) ? b : a ;
}

Is that really too difficult?
could you recommend a good ref. book and/or web link?

thanks
Jul 28 '06 #20

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

Similar topics

0
6691
by: Daniel Chartier | last post by:
Hello, all. I found a bit of code that lets me read an Excel file from and to a specifi range. See the code below. But what if I only want to specify the STARTING position and simply want it to continue reading down the column until it hits an empty cell? Does anyone know how to do this? Thanks! Here is the range-only code:
2
5979
by: Michael Jordan | last post by:
I'm hoping that someone here can give me some insight into a problem I'm running into with Python, pywin32 and Excel. All-in-all using Python and pywin32 is great but I've run into a strange problem with the range Offset property, I'm not getting the correct offset and the returned range is a single cell and not the same size as the original range. For example, when I enter the following lines of code in PythonWin : from...
3
3478
by: Michael Conroy | last post by:
Hi... Synposis... Throws exception: "Specified argument was out of the range of valid values." Read on for the juicy tidbits. MySimpleClassCol mscc=new MySimpleClassCol(); private void InitCombo() {
4
8466
by: IMS.Rushikesh | last post by:
Hi All, I am trying to execute below code but it gives me an COMException ///// Code Start //// public string GetName(Excel.Range range) { try { if (range.Name != null)
1
1781
by: h2lm2t | last post by:
Could anyone please take a look at this? I have a table with 3 columns: ID, ZIP and Count as below: Original Table ID ZIP Count 1 00001 12 2 00002 12 3 00003 11 4 00004 11
0
2869
by: uninvitedm | last post by:
Heya I've got a table of invoices, which have dates and customer_id's. What I need to get is the number of occurances for this customer for a 12-month range window. For example, if there's an invoice for october for a certain customer - i want to count how many other invoices appear are for this customer in the 12 months from that invoice date. Similarly, if there's an invoice in november, that should show the number of occurences 12 months...
1
5633
by: Bonzs | last post by:
I have troule with this macro... geting the used rsnge... Public strName As String, ws As Worksheet Sub Test() Workbooks.Open Filename:= _ "C:\Documents and Settings\User\Desktop\IT Development\Pricer.xls" 'Begins formatting the pricer for generating the EPB... strName = ActiveSheet.Name 'MsgBox strName MsgBox "The Used Range of this Worksheet is: " & GetUsedRange(ws)
1
3015
by: =?Utf-8?B?SkI=?= | last post by:
Hello As I debug the C# code with a break point and by pressing F11 I eventually get a message stating: ContextSwitchDeadlock was detected Message: The CLR has been unable to transition from COM context 0x17aeb8 to COM context 0x17abd8 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages.
1
1519
by: CoreyReynolds | last post by:
Hey all, Here's the culprit: Sub PopulateRange(Cell_Range As Range) Dim v Dim i As Long Dim j As Long Application.ScreenUpdating = False
6
18710
by: shashi shekhar singh | last post by:
Respected Sir, I am facing problem when i try to deploy my website on iis 7.0 on test page. i have to display some .mht files on iframe in gridview and error looks like below, Server Error in '/' Application. -------------------------------------------------------------------------------- Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Description: An unhandled exception...
0
9566
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
10149
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
10003
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
9943
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
9828
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
8825
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
5271
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...
0
5410
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3918
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

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.