473,395 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

shorten string length by 1

I want to shorten a string by replacing the last character by '\0'.

The following code displays the string. It works fine. It's in a
loop and different strings are displayed without problems.
-----------------------------------------------------------
temp= strlen(aGroup);
for (i=0; i< temp;i++)
printf(" %d %d %c\n", i+1,temp,aGroup[i]);
---------------------------------------------------------

To replace the last character by '\0', I have tried

aGroup[i-1]='\0';

or
temp--;
aGroup[temp]='\0';

or
aGroup[temp-1]='\0';

Though there is no compiling error, the program crashed when ran
(I was asked whether to send error report to Microsoft. Same error
for all three.)

But "aGroup[22]='\0';" works (I knew the length is greater than 22.)

What gives? This is on VC++ 6.0.
Nov 14 '05 #1
24 9005

John Smith wrote:
I want to shorten a string by replacing the last character by '\0'.

The following code displays the string. It works fine. It's in a
loop and different strings are displayed without problems.
-----------------------------------------------------------
temp= strlen(aGroup);
for (i=0; i< temp;i++)
printf(" %d %d %c\n", i+1,temp,aGroup[i]);
---------------------------------------------------------

To replace the last character by '\0', I have tried

aGroup[i-1]='\0';

or
temp--;
aGroup[temp]='\0';

or
aGroup[temp-1]='\0';

Though there is no compiling error, the program crashed when ran
(I was asked whether to send error report to Microsoft. Same error
for all three.)

But "aGroup[22]='\0';" works (I knew the length is greater than 22.)

What gives? This is on VC++ 6.0.


Verify that aGroup has been properly declared, and that it is
suffiently large enough to store the string you are copying into it.
Perhaps you are overflowing a buffer, or forgot to properly call
malloc?

-Jason
-Jason

Nov 14 '05 #2
Jason wrote:
John Smith wrote:
I want to shorten a string by replacing the last character by '\0'.

The following code displays the string. It works fine. It's in a
loop and different strings are displayed without problems.
-----------------------------------------------------------
temp= strlen(aGroup);
for (i=0; i< temp;i++)
printf(" %d %d %c\n", i+1,temp,aGroup[i]);
---------------------------------------------------------

To replace the last character by '\0', I have tried

aGroup[i-1]='\0';

or
temp--;
aGroup[temp]='\0';

or
aGroup[temp-1]='\0';

Though there is no compiling error, the program crashed when ran
(I was asked whether to send error report to Microsoft. Same error
for all three.)

But "aGroup[22]='\0';" works (I knew the length is greater than 22.)

What gives? This is on VC++ 6.0.

Verify that aGroup has been properly declared, and that it is
suffiently large enough to store the string you are copying into it.
Perhaps you are overflowing a buffer, or forgot to properly call
malloc?

-Jason
-Jason


Thanks for the reply.

As I said. The program worked fine until I added the code (any one
of the three) to replace the last character. I think this should
rule out the potential problems you mentioned.

BTW, aGroup is declared as "char aGroup[2048];" which is probably
10 times larger than what it can be.
Nov 14 '05 #3

John Smith wrote:
BTW, aGroup is declared as "char aGroup[2048];" which is probably
10 times larger than what it can be.


Could you post the actual code? Without further information I'm afraid
I won't be able to assist you.

-Jason

Nov 14 '05 #4
On Fri, 15 Apr 2005 00:43:41 GMT, John Smith <js****@company.com>
wrote:
I want to shorten a string by replacing the last character by '\0'.

snip incomplete code
Though there is no compiling error, the program crashed when ran
(I was asked whether to send error report to Microsoft. Same error
for all three.)

But "aGroup[22]='\0';" works (I knew the length is greater than 22.)

What gives? This is on VC++ 6.0.


Show the definition and initialization of aGroup please.
<<Remove the del for email>>
Nov 14 '05 #5
John Smith <js****@company.com> writes:
[...]
As I said. The program worked fine until I added the code (any one
of the three) to replace the last character. I think this should
rule out the potential problems you mentioned.
No, "The program worked fine" doesn't rule out anything. Your recent
changes could simply have changed it from undefined behavior that
happens to be harmless to undefined behavior that blows things up.
BTW, aGroup is declared as "char aGroup[2048];" which is probably
10 times larger than what it can be.


If aGroup contains a valid string, the following should shorten it by
one character:

aGroup[strlen(aGroup)-1] = '\0';

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #6
Keith Thompson wrote:
John Smith <js****@company.com> writes:
BTW, aGroup is declared as "char aGroup[2048];" which is probably
10 times larger than what it can be.

You mean its 10 times larger than necessary most of the time, and
insufficient for some marginal cases. So its neither sufficient or
efficient.
If aGroup contains a valid string, the following should shorten it by
one character:

aGroup[strlen(aGroup)-1] = '\0';


Excuse me? No. Try the following:

aGroup[strlen(aGroup) - (aGroup[0] != '\0')] = '\0';

Using Bstrlib, this is somewhat more understandable:

bdelete(b_aGroup, blength(b_aGroup) - 1, 1);

---
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

Nov 14 '05 #7
Mac
On Fri, 15 Apr 2005 15:49:26 -0400, Joe Wright wrote:
John Smith wrote:
Jason wrote:
John Smith wrote:
I want to shorten a string by replacing the last character by '\0'.

The following code displays the string. It works fine. It's in a
loop and different strings are displayed without problems.
-----------------------------------------------------------
temp= strlen(aGroup);
for (i=0; i< temp;i++)
printf(" %d %d %c\n", i+1,temp,aGroup[i]);
---------------------------------------------------------

To replace the last character by '\0', I have tried

aGroup[i-1]='\0';

or
temp--;
aGroup[temp]='\0';

or
aGroup[temp-1]='\0';

Though there is no compiling error, the program crashed when ran
(I was asked whether to send error report to Microsoft. Same error
for all three.)

But "aGroup[22]='\0';" works (I knew the length is greater than 22.)

What gives? This is on VC++ 6.0.
Verify that aGroup has been properly declared, and that it is
suffiently large enough to store the string you are copying into it.
Perhaps you are overflowing a buffer, or forgot to properly call
malloc?

-Jason
-Jason

Thanks for the reply.

As I said. The program worked fine until I added the code (any one
of the three) to replace the last character. I think this should
rule out the potential problems you mentioned.

BTW, aGroup is declared as "char aGroup[2048];" which is probably
10 times larger than what it can be.

#include <stdio.h>
#include <string.h>

int main(void)
{
char aGroup[2048];
int i;
strcpy(aGroup, "Hello Sailor");
i = strlen(aGroup);
while (i--) {
puts(aGroup);
aGroup[i] = '\0';
}
return 0;
}

Why is this thread so long?


Is this like a Zen Koan or something? Does the behavior of this program
somehow shed light on what is wrong with the OP's code fragment? If so, I
don't get it. :-(

--Mac

Nov 14 '05 #8
On Fri, 15 Apr 2005 21:26:57 GMT, in comp.lang.c , Keith Thompson
<ks***@mib.org> wrote:
Mark McIntyre <ma**********@spamcop.net> writes:
On 15 Apr 2005 01:18:50 -0700, in comp.lang.c , we******@gmail.com
wrote:
If aGroup contains a valid string, the following should shorten it by
one character:

aGroup[strlen(aGroup)-1] = '\0';

Excuse me? No. Try the following:

aGroup[strlen(aGroup) - (aGroup[0] != '\0')] = '\0';
Re-read what keith said.


Actually, websnarf caught something that I missed. If aGroup contains
a valid string of length 0, my code will write before the beginning of
the array, invoking undefined behavior.


Yes, I realise thats what he was trying to trap. I don't consider a
string of length zero to be a valid string however. YMMV, as may
Paul's.
But I don't see the need to put everything into the index expression.


me neither - it was unnecessarily obfuscated and would have failed a
code review at my shop.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #9
Mark McIntyre <ma**********@spamcop.net> writes:
[...]
Yes, I realise thats what he was trying to trap. I don't consider a
string of length zero to be a valid string however. YMMV, as may
Paul's.


Of course a string of length zero is a valid string; why wouldn't it
be? Almost any function in the standard library that accepts a string
will happily accept an empty string.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #10
Mac wrote:

On Fri, 15 Apr 2005 15:49:26 -0400, Joe Wright wrote:
John Smith wrote:
BTW, aGroup is declared as "char aGroup[2048];" which is probably
10 times larger than what it can be.

#include <stdio.h>
#include <string.h>

int main(void)
{
char aGroup[2048];
int i;
strcpy(aGroup, "Hello Sailor");
i = strlen(aGroup);
while (i--) {
puts(aGroup);
aGroup[i] = '\0';
}
return 0;
}

Why is this thread so long?


Is this like a Zen Koan or something?
Does the behavior of this program
somehow shed light on what is wrong with the OP's code fragment?
If so, I don't get it. :-(


The program takes advantage of the fact that there is
nothing extraordinary about a 2048 byte automatic object,
contrary to what John Smith suggested.
The program shortens string length by 1,
and the program is portable.

--
pete
Nov 14 '05 #11
Keith Thompson wrote:

Mark McIntyre <ma**********@spamcop.net> writes:
[...]
Yes, I realise thats what he was trying to trap. I don't consider a
string of length zero to be a valid string however. YMMV, as may
Paul's.


Of course a string of length zero is a valid string; why wouldn't it
be? Almost any function in the standard library that accepts a string
will happily accept an empty string.


Almost?

--
pete
Nov 14 '05 #12
pete <pf*****@mindspring.com> writes:
Keith Thompson wrote:

Mark McIntyre <ma**********@spamcop.net> writes:
[...]
> Yes, I realise thats what he was trying to trap. I don't consider a
> string of length zero to be a valid string however. YMMV, as may
> Paul's.


Of course a string of length zero is a valid string; why wouldn't it
be? Almost any function in the standard library that accepts a string
will happily accept an empty string.


Almost?


I was thinking of the mode argument to fopen(). An empty string is
invalid not because it's empty, but because it's not one of the
allowed forms. There may be other examples.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #13
On Sat, 16 Apr 2005 11:06:14 GMT, in comp.lang.c , Keith Thompson
<ks***@mib.org> wrote:
Mark McIntyre <ma**********@spamcop.net> writes:
[...]
Yes, I realise thats what he was trying to trap. I don't consider a
string of length zero to be a valid string however. YMMV, as may
Paul's.
Of course a string of length zero is a valid string; why wouldn't it
be?


Because it contains no characters.
Almost any function in the standard library that accepts a string
will happily accept an empty string.


Sure. That doesn't mean that /I/ consider a zero length string to be a
valid string. Personally I would have trapped that long before trying
to manipulate it, so Paul's obfuscated code would have been quite
gratuitous.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #14
Mac
On Sat, 16 Apr 2005 12:19:03 +0000, pete wrote:
Mac wrote:

On Fri, 15 Apr 2005 15:49:26 -0400, Joe Wright wrote:
> John Smith wrote: >> BTW, aGroup is declared as "char aGroup[2048];" which is probably
>> 10 times larger than what it can be.
>
>
> #include <stdio.h>
> #include <string.h>
>
> int main(void)
> {
> char aGroup[2048];
> int i;
> strcpy(aGroup, "Hello Sailor");
> i = strlen(aGroup);
> while (i--) {
> puts(aGroup);
> aGroup[i] = '\0';
> }
> return 0;
> }
>
> Why is this thread so long?


Is this like a Zen Koan or something?
Does the behavior of this program
somehow shed light on what is wrong with the OP's code fragment?
If so, I don't get it. :-(


The program takes advantage of the fact that there is
nothing extraordinary about a 2048 byte automatic object,
contrary to what John Smith suggested.
The program shortens string length by 1,
and the program is portable.


I read what John Smith wrote a little differently. According to my
reading, he was emphasizing that 2048 bytes is 10 times longer than the
actual string can be, so there is no danger of an overflow. I could be
wrong.

Anyway, John Smith is obstinate and resistant to suggestions that could
help him, so I don't want to defend him. And I guess I don't really want
to say anything more in this thread.

HAND. ;-)

--Mac

Nov 14 '05 #15
Mark McIntyre <ma**********@spamcop.net> writes:
On Sat, 16 Apr 2005 11:06:14 GMT, in comp.lang.c , Keith Thompson
<ks***@mib.org> wrote:
Mark McIntyre <ma**********@spamcop.net> writes:
[...]
Yes, I realise thats what he was trying to trap. I don't consider a
string of length zero to be a valid string however. YMMV, as may
Paul's.


Of course a string of length zero is a valid string; why wouldn't it
be?


Because it contains no characters.


You're using the term "valid" in a very odd sense.

An empty string may be invalid for some purposes. A string containing
non-printable characters, or one containing the letter 'q', may be
invalid for other purposes.

If you mean that an empty string is invalid in the limited context of
wanting to shorten a string by 1 character, I agree. (Note that if
the initial string has a length of 1, the *result* is a perfectly
valid empty string.)

Would you have the compiler issue a warning on
char *s = "";
or
char s[] = "";
?

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #16
On Sun, 17 Apr 2005 08:03:09 GMT, in comp.lang.c , Keith Thompson
<ks***@mib.org> wrote:
Mark McIntyre <ma**********@spamcop.net> writes:
Because it contains no characters.
You're using the term "valid" in a very odd sense.


How so? The context was how to shorten a string by one character. I'm
unsure how a zero length string can be valid for that operation. And
FWIW I consider it very odd to think of a string with zero length as
being a valid one.
An empty string may be invalid for some purposes.
such as the one under discussion. And even setting aside the context,
I still don't consider a character array with only a null in it to be
a string. YMMV.
Would you have the compiler issue a warning on
char *s = "";
or
char s[] = "";


Nope. Why should I? Merely because its (in my opinion) not a
well-formed string, doesn't make it any the less a useful code
construct. Come on, try not to be so silly.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
Nov 14 '05 #17
Mark McIntyre <ma**********@spamcop.net> writes:
On Sun, 17 Apr 2005 08:03:09 GMT, in comp.lang.c , Keith Thompson
<ks***@mib.org> wrote: [...]
An empty string may be invalid for some purposes.


such as the one under discussion.


If you were just talking about the particular case under discussion,
I'd agree with you.
And even setting aside the context,
I still don't consider a character array with only a null in it to be
a string. YMMV.


That's just wrong. The definition of "string" in C99 7.1.1p1 could be
interpreted to exclude empty strings, but it's obviously the intent
that the empty string is a string. If you want to refer to non-empty
strings, find another word.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #18
Mark McIntyre wrote:
On Sun, 17 Apr 2005 08:03:09 GMT, in comp.lang.c , Keith Thompson
<ks***@mib.org> wrote:
You're using the term "valid" in a very odd sense.


How so? The context was how to shorten a string by one character. I'm
unsure how a zero length string can be valid for that operation. And
FWIW I consider it very odd to think of a string with zero length as
being a valid one.


How would you implement this shortening operation, then? Surely
shortening a one-character string by one character would yield the empty
string. But that cannot be, since the empty string is invalid...
Gergo
--
The key elements in human thinking are not numbers but labels of fuzzy sets.
-- L. Zadeh
Nov 14 '05 #19
=?ISO-8859-1?Q?Gerg=F6_Barany?= <ge***@tud.at> wrote:
Mark McIntyre wrote:
On Sun, 17 Apr 2005 08:03:09 GMT, in comp.lang.c , Keith Thompson
<ks***@mib.org> wrote:
You're using the term "valid" in a very odd sense.


How so? The context was how to shorten a string by one character. I'm
unsure how a zero length string can be valid for that operation. And
FWIW I consider it very odd to think of a string with zero length as
being a valid one.


How would you implement this shortening operation, then? Surely
shortening a one-character string by one character would yield the empty
string. But that cannot be, since the empty string is invalid...


The solution is obvious: a one-character string is not a valid string,
either.

Richard
Nov 14 '05 #20
On Tue, 19 Apr 2005 06:19:27 GMT, rl*@hoekstra-uitgeverij.nl (Richard
Bos) wrote:
=?ISO-8859-1?Q?Gerg=F6_Barany?= <ge***@tud.at> wrote:
Mark McIntyre wrote:
> On Sun, 17 Apr 2005 08:03:09 GMT, in comp.lang.c , Keith Thompson
> <ks***@mib.org> wrote:
>>You're using the term "valid" in a very odd sense.
>
> How so? The context was how to shorten a string by one character. I'm
> unsure how a zero length string can be valid for that operation. And
> FWIW I consider it very odd to think of a string with zero length as
> being a valid one.


How would you implement this shortening operation, then? Surely
shortening a one-character string by one character would yield the empty
string. But that cannot be, since the empty string is invalid...


The solution is obvious: a one-character string is not a valid string,
either.


Making it trivial to prove by induction that there are no valid
strings.

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #21
Alan Balmer <al******@att.net> wrote:
On Tue, 19 Apr 2005 06:19:27 GMT, rl*@hoekstra-uitgeverij.nl (Richard
Bos) wrote:
=?ISO-8859-1?Q?Gerg=F6_Barany?= <ge***@tud.at> wrote:
Mark McIntyre wrote:
> On Sun, 17 Apr 2005 08:03:09 GMT, in comp.lang.c , Keith Thompson
> <ks***@mib.org> wrote:
>>You're using the term "valid" in a very odd sense.
>
> How so? The context was how to shorten a string by one character. I'm
> unsure how a zero length string can be valid for that operation. And
> FWIW I consider it very odd to think of a string with zero length as
> being a valid one.

How would you implement this shortening operation, then? Surely
shortening a one-character string by one character would yield the empty
string. But that cannot be, since the empty string is invalid...


The solution is obvious: a one-character string is not a valid string,
either.


Making it trivial to prove by induction that there are no valid
strings.


Isn't life beautifully simple, sometimes <g>?

Richard
Nov 14 '05 #22
On Tue, 19 Apr 2005 08:16:52 -0700, in comp.lang.c , Alan Balmer
<al******@att.net> wrote:
On Tue, 19 Apr 2005 06:19:27 GMT, rl*@hoekstra-uitgeverij.nl (Richard
Bos) wrote:
=?ISO-8859-1?Q?Gerg=F6_Barany?= <ge***@tud.at> wrote:
How would you implement this shortening operation, then? Surely
shortening a one-character string by one character would yield the empty
string. But that cannot be, since the empty string is invalid...


The solution is obvious: a one-character string is not a valid string,
either.


Making it trivial to prove by induction that there are no valid
strings.


Er, only if your induction process is broken. The same logic
demonstrates that all numbers are equal to zero, and that there are no
humans in the galaxy.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
Nov 14 '05 #23
On Tue, 19 Apr 2005 20:24:41 +0100, Mark McIntyre
<ma**********@spamcop.net> wrote:
On Tue, 19 Apr 2005 08:16:52 -0700, in comp.lang.c , Alan Balmer
<al******@att.net> wrote:
On Tue, 19 Apr 2005 06:19:27 GMT, rl*@hoekstra-uitgeverij.nl (Richard
Bos) wrote:
=?ISO-8859-1?Q?Gerg=F6_Barany?= <ge***@tud.at> wrote:

How would you implement this shortening operation, then? Surely
shortening a one-character string by one character would yield the empty
string. But that cannot be, since the empty string is invalid...

The solution is obvious: a one-character string is not a valid string,
either.


Making it trivial to prove by induction that there are no valid
strings.


Er, only if your induction process is broken. The same logic
demonstrates that all numbers are equal to zero, and that there are no
humans in the galaxy.


Of course.

It's not the induction process - it's the premise.

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #24
On Tue, 19 Apr 2005 13:35:44 -0700, in comp.lang.c , Alan Balmer
<al******@att.net> wrote:
On Tue, 19 Apr 2005 20:24:41 +0100, Mark McIntyre
<ma**********@spamcop.net> wrote:
Er, only if your induction process is broken. The same logic
demonstrates that all numbers are equal to zero, and that there are no
humans in the galaxy.


Of course.

It's not the induction process - it's the premise.


For myself, I prefer D Adams' proof of the above.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
Nov 14 '05 #25

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

Similar topics

1
by: Kenneth Keeley | last post by:
Hi, I am creating a news and events page for my web site and I have a data grid for the summary of news items that is using a TemplateColumn I can layout the data in the format I wish. My only...
1
by: Web Response Time | last post by:
I found a surprising problem. I sent a zero length's request in my asp.net program to another asp.net program on the local machine. until I received the zero length's response data, it only took...
3
by: neoswf | last post by:
hi. i want to shorten getElementById() string at my files. ive writen this function: function gebi(el){ document.getElementById(el) } and when i try to call an ID, i try to call him like this:...
15
by: morleyc | last post by:
Hi, i would like to remove a number of characters from my string (\t \r \n which are throughout the string), i know regex can do this but i have no idea how. Any pointers much appreciated. Chris
3
by: UKuser | last post by:
Hi, Is there a way to shorten this line if ((ereg(".jpg",$filename))||(ereg(".eps",$filename))||(ereg(".tif", $filename))||(ereg(".tiff",$filename))||(ereg(".jpeg",$filename))||...
5
by: Dean | last post by:
Hi, I have a table with non-unique identifiers. I need to take all the values with the same ID's and combine them into one field with a semicolon as a seperator. These values may exceed 255...
3
by: moomooboy | last post by:
guys please help me T_T im currently stuck on string, it takes too many line. here is my sample: char breadmenu; strcpy (breadmenu,"Parmasan"); strcpy (breadmenu,"Gralic"); strcpy...
1
by: treeguy | last post by:
I am not a developer but my site has long URL strings that have problem getting crawled. I understand Google now will crawl past the + but does not like the long strings. I tried URL rewrite and it...
7
by: K Viltersten | last post by:
I'm using the code below. I know for sure that the data obtained will be a single value. Hence, it feels somewhat like nuking a fly to use the adapter etc. Is it possible to shorten the code for...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...

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.