473,695 Members | 2,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Better program design?

I am a self taught programmer and I have figured out most syntax but
desigining my programs is a challenge. I realize that there are many
ways to design a program but what are some good rules to follow for
creating a program?

I am writing a map game program. I created several objects: board
object that is an array of integers each number 0-5 is a kind of
terrain, a terrain object that is an array of terrain types and each
number of the map coresponds to a kind terrain on the map. Finally I
have a unit object:

#include "graphic.h"
#include "libs.h"
#include "board.h"

#ifndef UNIT_H
#define UNIT_H

class unit : public graphic{

std::map<char, coordkeys; //movement engine
coord n; //directions
coord s;
coord e;
coord w;

int xloc; //x location
int yloc; //ylocation
int r, g, b; //color
int attack; //attack factor
int defence; //defence facor
int move; //movemnt factor
int moved; //the number of factors used
void make();

public:
unit();
void SetGr(int, int, int, BYTE c[]); //sets graphic info
void SetData(int, int, int);//sets ofensive defensive and move facors
void Place(int, int); //puts on the map
void moveUD(int, int); //handled up down movment
//direction, cost to enter next space.
void moveLR(int, int);
void newMove(char, board *,terrain trn[]);
void show(HWND); //displays the unit
void reset(); //restes movemnt
int red(){return r;} //returns colors for display
int grn(){return g;}
int blu(){return b;}
int getXloc()const {return xloc;} //returns location
int getYloc()const {return yloc;}
bool canMove(); //still has movement factors left.
};
void unit::newMove(c har ch, board * b, terrain trn[]){

int n, mv;
int tempX = xloc + keys[ch].x;
int tempY = yloc + keys[ch].y;

mv = trn[b->GetSpace(tempY , tempX)].move();
if(moved 0 && mv != 0){
moved -= mv;
xloc = tempX;
yloc = tempY;
}
}

case VK_UP:

if(red){rteam[t1m].newMove('n',b, trn);}
else{ yteam[t2m].newMove('n',b, trn);}

This all works and my units move around the map but is it good design
to send up the board and terrain objects to the function? I am
planning to have a fight function and that may involve even ore
objects, that is units from both sides the map and the kind of terrain.
Are there some rules or guides I can go by to write better programs?
For example I was instructed to tell on ask objects to do things.

Aug 23 '06 #1
23 2375
JoeC wrote:
>I am a self taught programmer and I have figured out most syntax but
desigining my programs is a challenge. I realize that there are many
ways to design a program but what are some good rules to follow for
creating a program?
Use a unit test rig, such as UnitTest++, and write test cases before you
write the code to pass the tests.

That simple step prevents many hours of debugging.
int xloc; //x location
int yloc; //ylocation
Next, after the code works, you should "refactor" to remove duplication. In
this case, you have a latent object called Point, with members x and y. Then
you can write Point loc; here, and you can re-use the Point everywhere that
you have x and y now.
int red(){return r;} //returns colors for display
int grn(){return g;}
int blu(){return b;}
Similary, a single accessor, here, would return a Color object.
int getXloc()const {return xloc;} //returns location
int getYloc()const {return yloc;}
And these
bool canMove(); //still has movement factors left.
Next, OO design is about replacing conditional statements (if and switch)
with polymorphism. If that were simply a method called virtual maybeMove(),
you could derive a MobileUnit from your Unit. Then Unit::maybeMove () would
do nothing, and MobileUnit::may beMove() would move.

OO is about putting the behaviors inside the objects - not about stuffing
objects full of data and putting the behaviors outside them.
This all works and my units move around the map but is it good design
to send up the board and terrain objects to the function? I am
planning to have a fight function and that may involve even ore
objects, that is units from both sides the map and the kind of terrain.
Maybe or maybe not. The items shouldn't be global. If your design is
otherwise clean then this might be the best way.

More importantly, my other guidelines attempt to make a program's original
design less important than its tests. If you can upgrade the design after
the program works, you can use the program itself to learn what the best
design will be.
Are there some rules or guides I can go by to write better programs?
For example I was instructed to tell on ask objects to do things.
Google for these, with quotes:

"test driven development"
"refactorin g"
"hollywood principle"
"dependency inversion principle"

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Aug 23 '06 #2

Phlip wrote:
JoeC wrote:
I am a self taught programmer and I have figured out most syntax but
desigining my programs is a challenge. I realize that there are many
ways to design a program but what are some good rules to follow for
creating a program?

Use a unit test rig, such as UnitTest++, and write test cases before you
write the code to pass the tests.

That simple step prevents many hours of debugging.
int xloc; //x location
int yloc; //ylocation

Next, after the code works, you should "refactor" to remove duplication. In
this case, you have a latent object called Point, with members x and y. Then
you can write Point loc; here, and you can re-use the Point everywhere that
you have x and y now.
int red(){return r;} //returns colors for display
int grn(){return g;}
int blu(){return b;}

Similary, a single accessor, here, would return a Color object.
Does that realy matter? It would be a structure much like a coord
struct. paint(obj.gcolo r().r, obj.gcolor().b
paint(obj,r(),o bj.b()...
int getXloc()const {return xloc;} //returns location
int getYloc()const {return yloc;}

And these
bool canMove(); //still has movement factors left.

Next, OO design is about replacing conditional statements (if and switch)
with polymorphism. If that were simply a method called virtual maybeMove(),
you could derive a MobileUnit from your Unit. Then Unit::maybeMove () would
do nothing, and MobileUnit::may beMove() would move.
I was trying to figure out how I could keep the move concept a seperate
object. I was able to derrive my unit class and terrain from my
graphic class. It may be a good idea to do the same with a color
class.

I try to avoid dynamic binding. The only thing I find it useful for is
putting simmilliar objects in the same container. The terrain and the
units are in different containers and are different objects.
>
OO is about putting the behaviors inside the objects - not about stuffing
objects full of data and putting the behaviors outside them.
I tried to put the behavior in the objects. I tell the objects what to
do. Can move is internal to the object. If you tell an object to move
when it dosn't have any movement points, it does nothing.
>
This all works and my units move around the map but is it good design
to send up the board and terrain objects to the function? I am
planning to have a fight function and that may involve even ore
objects, that is units from both sides the map and the kind of terrain.

Maybe or maybe not. The items shouldn't be global. If your design is
otherwise clean then this might be the best way.
No my objects are not global. They are to enxtent so that they can be
created in the create part of the program and then are visible to
winproc part of the program. I am using win32 for graphics support.
>
More importantly, my other guidelines attempt to make a program's original
design less important than its tests. If you can upgrade the design after
the program works, you can use the program itself to learn what the best
design will be.
I have done some upgrade since I first wrote the program. Mostly I put
the workings of the move function in the object instead of outside of
it. But the problem is that I have several objects that influence each
other and I am worried that my functions will be too cumbersom and my
compiler will start to complain at times.
>
Are there some rules or guides I can go by to write better programs?
For example I was instructed to tell on ask objects to do things.

Google for these, with quotes:

"test driven development"
"refactorin g"
"hollywood principle"
"dependency inversion principle"

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Aug 23 '06 #3
In article <11************ **********@m79g 2000cwm.googleg roups.com>,
"JoeC" <en*****@yahoo. comwrote:
I am a self taught programmer and I have figured out most syntax but
desigining my programs is a challenge. I realize that there are many
ways to design a program but what are some good rules to follow for
creating a program?

I am writing a map game program. I created several objects: board
object that is an array of integers each number 0-5 is a kind of
terrain, a terrain object that is an array of terrain types and each
number of the map coresponds to a kind terrain on the map. Finally I
have a unit object:

#include "graphic.h"
#include "libs.h"
#include "board.h"

#ifndef UNIT_H
#define UNIT_H

class unit : public graphic{

std::map<char, coordkeys; //movement engine
coord n; //directions
coord s;
coord e;
coord w;

int xloc; //x location
int yloc; //ylocation
int r, g, b; //color
int attack; //attack factor
int defence; //defence facor
int move; //movemnt factor
int moved; //the number of factors used
That's an awful lot of variables. I notice that 'newMove' only uses
keys, xloc, yloc, and moved. You may have more than one concept buried
in this class.

One idea that I found useful in the past... Get some graph paper (or use
a spreadsheet program.) List the member-variables in the first column,
and the member-functions in the first row. Then go through and put an X
in the cell of each member-function that uses that particular
member-variable. You may find that several of the variables are only
used in a proper subset of the functions, and they are only used in that
subset. If so, it would be a good idea to group them in a class.
void make();

public:
unit();
void SetGr(int, int, int, BYTE c[]); //sets graphic info
void SetData(int, int, int);//sets ofensive defensive and move facors
void Place(int, int); //puts on the map
void moveUD(int, int); //handled up down movment
//direction, cost to enter next space.
void moveLR(int, int);
void newMove(char, board *,terrain trn[]);
void show(HWND); //displays the unit
void reset(); //restes movemnt
int red(){return r;} //returns colors for display
int grn(){return g;}
int blu(){return b;}
int getXloc()const {return xloc;} //returns location
int getYloc()const {return yloc;}
bool canMove(); //still has movement factors left.
};
void unit::newMove(c har ch, board * b, terrain trn[]){

int n, mv;
int tempX = xloc + keys[ch].x;
int tempY = yloc + keys[ch].y;

mv = trn[b->GetSpace(tempY , tempX)].move();
if(moved 0 && mv != 0){
moved -= mv;
xloc = tempX;
yloc = tempY;
}
}

case VK_UP:

if(red){rteam[t1m].newMove('n',b, trn);}
else{ yteam[t2m].newMove('n',b, trn);}

This all works and my units move around the map but is it good design
to send up the board and terrain objects to the function?
I would limit the function to only the data it needs. I would be
inclined to, for example, only send the one cell from trn that the
function actually uses, or maybe limit it to just the int returned by
..move(). Doing so would remove the need to send the board to newMove at
all.
Are there some rules or guides I can go by to write better programs?
For example I was instructed to tell on ask objects to do things.
There are many heuristics. The book "Object-Oriented Design Heuristics"
by Riel has a bunch, "C++ Coding Standards" by Sutter and Alexandrescu
has a bunch, "Enough Rope to Shoot Youreelf in the Foot" by Holub has a
bunch, "Large Scale C++ Design" by Lakos has a bunch, the "Effective
C++" series by Meyers, the list goes on and on. Many of these books have
heuristics that conflict with heuristics from a different book. A few
even have heuristics that conflict within the same book! You have to
read the heuristics understand the motivation for them and decide for
yourself which is more relevant to your particular situation.

One book I think should be on every programmer's shelf and read at least
every other year... "The Pragmatic Programmer" by Hunt and Thomas.
Aug 23 '06 #4
One idea that I found useful in the past... Get some graph paper (or use
a spreadsheet program.) List the member-variables in the first column,
and the member-functions in the first row. Then go through and put an X
in the cell of each member-function that uses that particular
member-variable. You may find that several of the variables are only
used in a proper subset of the functions, and they are only used in that
subset. If so, it would be a good idea to group them in a class.
I took that advice and did, it was redundant code from my terrain
class.

class color{
protected:
int r, g, b; //color red, green, blue

public:
color() : : r(0), g(0), b(0){}
int red(){return r;} //returns colors for display
int grn(){return g;}
int blu(){return b;}
class unit : public graphic
: public color{
>
I would limit the function to only the data it needs. I would be
inclined to, for example, only send the one cell from trn that the
function actually uses, or maybe limit it to just the int returned by
.move(). Doing so would remove the need to send the board to newMove at
all.
I did that and with all the directions I had lots of redundant code.

if(red){
n = b->GetSpace((rtea m[t1m].getYloc()-1),
rteam[t1m].getXloc());
mv = trn[n].move(); //gets movemnt cost
rteam[t1m].moveUD(-1,mv); //moves
} else {
n = b->GetSpace((ytea m[t2m].getYloc()-1),
yteam[t2m].getXloc());
mv = trn[n].move();
yteam[t2m].moveUD(-1,mv);
}

to:

case VK_UP:

if(red){rteam[t1m].newMove('n',b, trn);}
else{ yteam[t2m].newMove('n',b, trn);}
break;
>
Are there some rules or guides I can go by to write better programs?
For example I was instructed to tell on ask objects to do things.

There are many heuristics. The book "Object-Oriented Design Heuristics"
by Riel has a bunch, "C++ Coding Standards" by Sutter and Alexandrescu
has a bunch, "Enough Rope to Shoot Youreelf in the Foot" by Holub has a
bunch, "Large Scale C++ Design" by Lakos has a bunch, the "Effective
C++" series by Meyers, the list goes on and on. Many of these books have
heuristics that conflict with heuristics from a different book. A few
even have heuristics that conflict within the same book! You have to
read the heuristics understand the motivation for them and decide for
yourself which is more relevant to your particular situation.

One book I think should be on every programmer's shelf and read at least
every other year... "The Pragmatic Programmer" by Hunt and Thomas.
OK, I have been looking into getting a design book but not sure which
ones are worth it. I have been looking into the mythical man of the
month.

I realy appreciate this advice. I do take it and try to create better
programs.

Aug 23 '06 #5
JoeC wrote:
>Similary, a single accessor, here, would return a Color object.

Does that realy matter? It would be a structure much like a coord
struct. paint(obj.gcolo r().r, obj.gcolor().b
paint(obj,r(),o bj.b()...
Why does your Color object have accessors? It's just a data bucket.

Either way, what matters is replacing duplication with structure. Maybe a
higher-level paint() method can take a Color object. Or maybe a lower-level
one needs raw values.

We don't have enough evidence to tell, but we both know the present
situation - getting and setting everything - will lead to sloppy code.
I was trying to figure out how I could keep the move concept a seperate
object. I was able to derrive my unit class and terrain from my
graphic class. It may be a good idea to do the same with a color
class.

I try to avoid dynamic binding.
You may want to read /Design Patterns/, to see good examples of OO designs.
You should use dynamic binding when it makes the code simpler, and there are
many ways to do that.
>--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!

Aug 23 '06 #6

Phlip wrote:
JoeC wrote:
Similary, a single accessor, here, would return a Color object.
Does that realy matter? It would be a structure much like a coord
struct. paint(obj.gcolo r().r, obj.gcolor().b
paint(obj,r(),o bj.b()...

Why does your Color object have accessors? It's just a data bucket.

Either way, what matters is replacing duplication with structure. Maybe a
higher-level paint() method can take a Color object. Or maybe a lower-level
one needs raw values.
I took some advice and did:

class unit : public graphic, public color{

class color{
protected:
int r, g, b; //color red, green, blue

public:
color() : r(0), g(0), b(0){}
int red(){return r;} //returns colors for display
int grn(){return g;}
int blu(){return b;}
};

It eliminates redundant code in both the unit and terrain objects. It
is basically a data bucket that holds color data. Used like:

for(int y = 0; y != b->GetSizeY(); y++){
for(int x = 0; x != b->GetSizeX(); x++){
if(b->GetSpace(y,x)) {
num = b->GetSpace(y,x );
SetTextColor(hd c,RGB(trn[num].red(), trn[num].grn(),
trn[num].blu()));
trn[num].display(hwnd,c onvert(y),conve rt(x));
}
}
}

Aug 23 '06 #7
JoeC wrote:
class color{
protected:
int r, g, b; //color red, green, blue
Why aren't these public?

There are two kinds of objects out there - class objects and structures.

Class objects store behavior, and structures store data. Of course either
might have a little of the other. But if your color object has no behavior,
then it has no reason to defend its data members. We can't cause a bug, for
example, by tweaking the red!

(We might max it out; that's a different topic...)

If you simply must make r,g,b private, then make the entire color class
private to the classes that use it.
SetTextColor(hd c,RGB(trn[num].red(), trn[num].grn(),
trn[num].blu()));
Always seek duplication to replace with structure. The above line duplicates
trn[num].

If you want to allow your color object to keep r,g,b private, and if the
above line is the only place where you access them, then you can remove
duplication simply by turning the line inside out:

trn[num].setTexColor(hd c);

All the RGB() stuff went inside a method of color.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Aug 23 '06 #8
In article <11************ **********@b28g 2000cwb.googleg roups.com>,
en*****@yahoo.c om says...

[ ... ]
I took some advice and did:

class unit : public graphic, public color{
I don't know whose advice you're taking here, but IMO, it's not very
good advice at all. Looking back at your original code, it doesn't seem
to me that a unit is substitutable for a color under all possible
circumstances. Quite the contrary, a Unit is not a color -- it's a thing
that has a color, so it should contain a color object, but should not be
derived from color (more on this below).
class color{
protected:
int r, g, b; //color red, green, blue

public:
color() : r(0), g(0), b(0){}
int red(){return r;} //returns colors for display
int grn(){return g;}
int blu(){return b;}
};
To the extent possible, a class should attempt to act as a coherent
whole, NOT simply a collection of pieces. Right now, you build a color
out of components, but the only way to use it seems to be to break it
back into the components. It's better for it to remain a whole thing
instead.
It eliminates redundant code in both the unit and terrain objects. It
is basically a data bucket that holds color data. Used like:

for(int y = 0; y != b->GetSizeY(); y++){
for(int x = 0; x != b->GetSizeX(); x++){
if(b->GetSpace(y,x)) {
num = b->GetSpace(y,x );
SetTextColor(hd c,RGB(trn[num].red(), trn[num].grn(),
trn[num].blu()));
trn[num].display(hwnd,c onvert(y),conve rt(x));
}
}
}
In line with the above, I'd add something that allows most of the code
to deal with a color as a whole. You've got a couple of choices in that
direction. From the looks of things, you're programming for Windows,
which expects a color to be encapsulated in a DWORD. You could add a
cast to your color class to support that:

class color {
// ...
operator DWORD() { return RGB(r, g, b); }
// ...
};

Or you can add a function like:

SetTextColor(HD C hdc, color const &c) {
SetTextColor(hd c, RGB(c.red(), c.grn(), c.blu());
}

Either way, your code comes out something like:

SetTextColor(hd c, trn[num].c);

where 'c' is a member of type 'color'. Of the two, the cast operator is
less work, but also easier to misuse (often by accident) -- it makes it
easy to use a color anywhere a DWORD is expected, inlcuding places a
color doesn't make sense at all.

I've looked at the rest of the code in your posts, but you've left out
far too much detail to be able to provide much in the way of meaningful
comments on it. Just for some obvious examples:

void SetGr(int, int, int, BYTE c[]); //sets graphic info
void SetData(int, int, int);//sets ofensive defensive and move facors

With no description of what the parameters are/mean, we can't really
provide meaningful advice about whether what you have is close to
optimal, and/or how it could be improved. With that said, my immediate
guess is that the existence and description of SetGr indicates that you
probably have some subset of functionality related to graphics that
should be in a class of its own, and most of what's in SetGr should
probably be in a ctor for that class (with Unit containing an instance
of such an object).

Lacking the information to comment more directly on your code, I'm going
to make some more general observations. I would try to break things down
into a larger number of smaller pieces, each of which has a more
specific purpose. You've started in that direction with the color class,
but my immediate reaction would be that there's probably a lot more to
do in that direction.

Unit deriving from color is almost certainly a poor idea -- a reasonable
derivative of color would be something that represents only a more
speicific version of the same concept -- for example, reasonable
derivatives of "color" would be classes that represent the colors
available in specific color spaces (AdobeRGB, ProPhotoRGB, sRGB, etc.)
Having Unit derive from color is almost certainly a poor and problematic
design.

My immediate reaction would be that it's _probably_ better to make
movement into an algorithm that's applied to something rather than being
part of the Unit itself -- though that's something of a judgement call.
If Unit is the base class of anything and everything that can be moved,
it might make some sense to keep it as a member -- but IMO, such a base
class is probably a poor idea to stat with.

Code that deals specifically with individual key-strokes (e.g. VK_UP)
should definitely be moved into a class that deals only with input from
the user, and translates it to a logical signal. The remainder of the
program should be 100% oblivious if you decide to change it to use input
from a joystick or mouse instead of the keyboard, for example.

Commenting a bit on some other advice you've received: I'd take the
advice about test-driven programming with a grain of salt. While it's
useful, at least IMO, it's often over-sold (including this case). While
the technique itself has uses, I've yet to see good evidence that any of
the test-drive frameworks has real utility at all.

Likewise, the advice about design patterns -- while they can be a useful
thing to study, there's a decided tendency among people who study them
to try to push everything into patterns (especially ones that are new
and "exciting") , even if they don't really apply well to the situation.
Learning something about it can be useful, but it's easy to get to the
point that it hinders rather than helps get the job done.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Aug 23 '06 #9
JoeC schrieb:
I try to avoid dynamic binding. The only thing I find it useful for is
putting simmilliar objects in the same container. The terrain and the
units are in different containers and are different objects.
But OO-design is almost always about dynamic binding. Most design
patterns use dynamic binding. Object-orientation implies polymorphism.
Why are you trying to avoid it? Is it speed? Virtual functions should
always be at least as fast as a corresponding switch statement.

Ralpe

Aug 23 '06 #10

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

Similar topics

220
19033
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have any preconceived ideas about it. I have noticed, however, that every programmer I talk to who's aware of Python is also talking about Ruby. So it seems that Ruby has the potential to compete with and displace Python. I'm curious on what basis it...
4
1349
by: fred | last post by:
Hello, I have a program that reads from a file at several different places. I want to find when the file hits the EOF. At this point I want to tell the calling method that this has happened so that the program can move onto the next phase. My class hierarchy is something like: main() -> class1 -> class1A -> class1a -> class1B
133
8537
by: Gaurav | last post by:
http://www.sys-con.com/story/print.cfm?storyid=45250 Any comments? Thanks Gaurav
39
2375
by: bazad | last post by:
Hi, I am not using C all the time. I have a general understanding of C and nothing else. The recent reply to use strlcpy and strlcat showed me that I am not aware of the best and safe techniques. Is there any place where I could learn more about safer and better C (on FreeBSD)? Thank you
43
3407
by: Rob R. Ainscough | last post by:
I realize I'm learning web development and there is a STEEP learning curve, but so far I've had to learn: HTML XML JavaScript ASP.NET using VB.NET ..NET Framework ADO.NET SSL
22
2706
by: JoeC | last post by:
I am working on another game project and it is comming along. It is an improvment over a previous version I wrote. I am trying to write better programs and often wonder how to get better at programming. I tend to learn what is useful and gets the job done. I am always curious if there is some techique I don't know. I read books and study as well as write programs. My goal is to some day be able to get a job programming. I have a...
17
5403
by: Ryan Liu | last post by:
Hi, If I have many threads write to a variable(e.g. var++) and another thread read it on an interval base. For those writing thread, I know I need lock, or its value could be lower ( even I think it is mostly not going to happen for ++ operation since it is not something like read a value and wait sometime then write back in multiple threading environment, BTW, is this understanding right?).
23
2255
by: mike3 | last post by:
Hi. I seem to have made some progress on finding that bug in my program. I deactivated everything in the bignum package that was used except for the returning of BigFloat objects. I even crippled all the constructors. So now all the operations and constructors that were used do is just return BigFloats but no memory is actually accessed at any point, nor is any allocated. However, when I reenable those parts of the constructor that...
7
1715
by: Immortal Nephi | last post by:
I have an idea how to design an object in a better way. I would like to give you my thought example. Please let me know what you think if it is best object design. Please recommend me any book which it teaches me how to design C++ OOP better as long as I know how to program OOP in C++. Think of ancient 6502 microprocessor which it was used for Commodore, Atari, and Apple II. This MPU_6502 is an object of MPU_6502 class. All member
0
8631
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
8572
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
9115
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
8984
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...
0
7661
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
6491
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...
0
5839
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4340
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
4579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.