473,657 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tic-Tac-Toe (Working Solution)

Vallerie, combining Kims logic for determining whether
an "X" or an "O" should be displayed & the rest of my
code makes a perfect working solution for the course
book. Liked the use of NOT kim cheers for that. anyway
heres the complete code for a working solution, any
improvments or comments are as always appreciated.
/////////

Dim mLabelCollectio n As New Collection()
Private Sub ExitButton_Clic k(ByVal sender As Object,
ByVal e As System.EventArg s) Handles ExitButton.Clic k
Me.Close()
End Sub

Private Sub NewGameButton_C lick(ByVal sender As
Object, ByVal e As System.EventArg s) Handles
NewGameButton.C lick
'declare object & integer variables
Dim objLabel As Label
Dim intx As Integer

'looping to find Label controls on form &
clearing the contents
Do While intx < Controls.Count - 1
If TypeOf Controls.Item(i ntx) Is Label Then
objLabel = Controls.Item(i ntx)
objLabel.Text = ""

End If
intx = intx + 1
Loop

End Sub

Private Sub TicTacToeForm_L oad(ByVal sender As
Object, ByVal e As System.EventArg s) _
Handles MyBase.Load

'add controls to the form level collection
mLabelCollectio n.Add(Me.TTT1La bel)
mLabelCollectio n.Add(Me.TTT2La bel)
mLabelCollectio n.Add(Me.TTT3La bel)
mLabelCollectio n.Add(Me.TTT4La bel)
mLabelCollectio n.Add(Me.TTT5La bel)
mLabelCollectio n.Add(Me.TTT6La bel)
mLabelCollectio n.Add(Me.TTT7La bel)
mLabelCollectio n.Add(Me.TTT8La bel)
mLabelCollectio n.Add(Me.TTT9La bel)
End Sub

'determine player turn & process the label clicks to
display the correct marker
Private Sub PlacePlayersMar ker(ByVal sender As
Object, ByVal e As System.EventArg s) _
Handles TTT1Label.Click , TTT2Label.Click ,
TTT3Label.Click , _
TTT4Label.Click , TTT5Label.Click ,
TTT6Label.Click , _
TTT7Label.Click , TTT8Label.Click ,
TTT9Label.Click
'determine which label has been clicked and
display players marker

'declare object variables
Dim ObjLabel As Label
'assign sender parameter to object variable
ObjLabel = sender
Static strPlayer As Boolean

strPlayer = Not strPlayer
If ObjLabel.Text = "" Then
If strPlayer Then
ObjLabel.Text = "X"
Else
ObjLabel.Text = "O"
End If
End If
End Sub
End Class
////////
Nov 20 '05 #1
7 4859
Nak
Nice to see when things work out :-)

I made an online tic-tac-toe, but it was in VB6 so I doubt it would help
much, but the logic was pretty much the same as yourself, whoever clicked
the board first became "O" in my case (In England we do "O" first for some
reason or another), the players go would toggle with each position of the
piece and a 'check for win' routine would also run with ever click on and
after the 3rd go :-)

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Slow internet connection?
Having problems with you job?
You're marriage is on the rocks?
You can't sleep at night?
You have a drink and drugs addiction?
You are sexually impotent?
Then enable Option Strict!
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #2
oops. I kept replying to you personally instead of to you in the newsgroups.
Did you get my messages?
"Steven Smith" <St**********@e mailaccount.com > wrote in message
news:07******** *************** *****@phx.gbl.. .
Vallerie, combining Kims logic for determining whether
an "X" or an "O" should be displayed & the rest of my
code makes a perfect working solution for the course
book. Liked the use of NOT kim cheers for that. anyway
heres the complete code for a working solution, any
improvments or comments are as always appreciated.
/////////

Dim mLabelCollectio n As New Collection()
Private Sub ExitButton_Clic k(ByVal sender As Object,
ByVal e As System.EventArg s) Handles ExitButton.Clic k
Me.Close()
End Sub

Private Sub NewGameButton_C lick(ByVal sender As
Object, ByVal e As System.EventArg s) Handles
NewGameButton.C lick
'declare object & integer variables
Dim objLabel As Label
Dim intx As Integer

'looping to find Label controls on form &
clearing the contents
Do While intx < Controls.Count - 1
If TypeOf Controls.Item(i ntx) Is Label Then
objLabel = Controls.Item(i ntx)
objLabel.Text = ""

End If
intx = intx + 1
Loop

End Sub

Private Sub TicTacToeForm_L oad(ByVal sender As
Object, ByVal e As System.EventArg s) _
Handles MyBase.Load

'add controls to the form level collection
mLabelCollectio n.Add(Me.TTT1La bel)
mLabelCollectio n.Add(Me.TTT2La bel)
mLabelCollectio n.Add(Me.TTT3La bel)
mLabelCollectio n.Add(Me.TTT4La bel)
mLabelCollectio n.Add(Me.TTT5La bel)
mLabelCollectio n.Add(Me.TTT6La bel)
mLabelCollectio n.Add(Me.TTT7La bel)
mLabelCollectio n.Add(Me.TTT8La bel)
mLabelCollectio n.Add(Me.TTT9La bel)
End Sub

'determine player turn & process the label clicks to
display the correct marker
Private Sub PlacePlayersMar ker(ByVal sender As
Object, ByVal e As System.EventArg s) _
Handles TTT1Label.Click , TTT2Label.Click ,
TTT3Label.Click , _
TTT4Label.Click , TTT5Label.Click ,
TTT6Label.Click , _
TTT7Label.Click , TTT8Label.Click ,
TTT9Label.Click
'determine which label has been clicked and
display players marker

'declare object variables
Dim ObjLabel As Label
'assign sender parameter to object variable
ObjLabel = sender
Static strPlayer As Boolean

strPlayer = Not strPlayer
If ObjLabel.Text = "" Then
If strPlayer Then
ObjLabel.Text = "X"
Else
ObjLabel.Text = "O"
End If
End If
End Sub
End Class
////////

Nov 20 '05 #3
-----Original Message-----
Hi Steven,

I walloped your code onto an existing form of mine and it failed to work -completely that is. The placement is fine but the clearing isn't quite.
Questions.
What do you do with that lovely collection of yours?
In NewGameClicked are you sure about that loop? What is the equivalentFor loop that you'd use? Does the existing while loop match that?
On style - why is strPlayer a Boolean ? (I know why, just want you tosee it :-))

I would tend to put Static strPlayer As Boolean at the top of the routineso that it stands out.

Regards,
Fergus
.

Your absolutely right fergus the collection does
nothing... :)

The program runs fine here, so not sure whats goin on
there.

the static boolean selection structure is explained in
code to the best of my ability but I've only been doing
this for a few weeks :)

the do...while loophas also been replaced.

any further comments or guidance is appreciated

Private Sub ExitButton_Clic k(ByVal sender As Object,
ByVal e As System.EventArg s) Handles ExitButton.Clic k
Me.Close()
End Sub

Private Sub NewGameButton_C lick(ByVal sender As
Object, ByVal e As System.EventArg s) Handles
NewGameButton.C lick
'declare object & integer variables
Dim objLabel As Label
Dim intx As Integer

'looping to find Label controls on form &
clearing the contents

'///Do While intx < Controls.Count - 1
'///If TypeOf Controls.Item(i ntx) Is Label Then
'///objLabel = Controls.Item(i ntx)
'///objLabel.Text = ""

'///End If
'///intx = intx + 1
'///Loop
'Equivalent FOR... LOOP carrrying out task
'of clearing the text property from all members
'of the label class on the form

For intx = 0 To Controls.Count - 1
If TypeOf Controls.Item(i ntx) Is Label Then
objLabel = Controls.Item(i ntx)
objLabel.Text = ""
End If
Next

End Sub
'determine player turn & process the label clicks to
display the correct marker
Private Sub PlacePlayersMar ker(ByVal sender As
Object, ByVal e As System.EventArg s) _
Handles TTT1Label.Click , TTT2Label.Click ,
TTT3Label.Click , _
TTT4Label.Click , TTT5Label.Click ,
TTT6Label.Click , _
TTT7Label.Click , TTT8Label.Click ,
TTT9Label.Click

'declare static
Static strPlayer As Boolean
'declare object variable
Dim ObjLabel As Label

'assign sender parameter to object variable
ObjLabel = sender

'change value of strPlayer to True. Then check if
a
'marker has already been displayed in the Label
control
'which was returned by the sender. If not check
'wether strPlayer = strPlayer if that is true
'set the text property of the object label to "X"
'if it is false set the text property to "O"
'the process is then repeated except the initial
'value of the static variable is "O" as it holds
'its value after the procedure ends

strPlayer = Not strPlayer
If ObjLabel.Text = "" Then
If strPlayer = True Then
ObjLabel.Text = "X"
Else 'false
ObjLabel.Text = "O"
End If
End If
End Sub
End Class


Nov 20 '05 #4
Hi again Stephen,

I wanted to make you look for meanings rather than me handing them to you
on a plate. Then I'd come back after to fill in any gaps. Best for learning
that way, even if it's a bit puzzling for you in the meantime. :-)

I mentioned the collection because it's just what you need in that reset
loop! It doesn't matter in this sort of program, of course, but I'm interested
in you learning principles as well as getting your code working.

Namely:
Having taken the trouble to create a collection containing <only> the
tic-tac labels, what do you do with it? And then when it comes to clearing the
labels, how many Controls do you check? That's one part of it. The other part,
which you wouldn't realise on your test setup, is that there may be other
labels on the Form, such as "Player 1", "Player 2". These would get wiped
too!! Oops.

Regarding the 'while' loop. I can assure you that it didn't work for me.
Not because I plonked it onto my form and messed it up, but because there was
a logic error in your code. That's why I asked about the equivalent 'for'
loop. I also wanted you to tell me whether your 'while' loop matches the 'for'
loop. (It doesn't - but why? Learning point: How 'while' and 'for' are not
always the same.)

strPlayer - presumably it was initially a string variable. Now it's a
Boolean. But a reader of your code will wionder - did he forget to change the
"str" to "t" (truth) or "f" (flag) or "b" (boolean) or whatever is your choice
for a Boolean. I've got no problem with your choice of a Boolean for a
two-state variable! But change the type and change the name is a handy habit
to develop early on.

In fact developing a style and becoming habitually consistent is very
important. I notice that you have the following:

strBoolean - lower-case type and capitalised type, but no name.
mLabelCollectio n m for member, capitalised type, capitalised name, but
only a sort of name.
objLabel - lower case type, but no name.
intx - lowercase everything
TTT1Label. - upper case name, capitalised type.

strBoolean - it's a Boolean give it a 't' (that's my style, many would
disagree, but 'b' and 'f' are already taken in my scheme). That says it all as
regards type. So what should its name be? Well, it controls whose turn it is.
It also controls which type of mark is made (X or O). Which is the central
concept? At the moment it's the mark. But, if later you decide to allow Player
1 to choose whether they'd like to be X or O, then it directly controls the
player's turn but only indirectly the mark - you'd use it to index an array of
Marks - one for each player. But that wouldn't work because it's a Boolean -
an integer would be better. So let's change it to, say, iPlayerToGo. And place
asMarks (iPlayerToGo) in the tic-tak grid. ["asMarks" is 'a', an array, of
's', strings, containing 'Marks' the marks made by the players. Or whatever
word you prefer.]

All that discussion over just a single variable. Is it worth it? Tell me
what you think.

mLabelCollectio n, TTT1Label, ObjLabel. These are all labels. It's common
to have control types abbreviated in lower case at the front. There's a
Microsoft recommended list somewhere in the Help. For labels you'd use "lbl".
Which gives us mlblCollection, lblTTT1 and lblObj. Still not there yet.

mlblCollection. Some people like to separate the 'm' with an underscore.
Now, what is it a collection of? Not labels. That's how whatever they are is
<implemented> but that's not what they <are>. They are in fact squares, or
places or whatever, on your tic-tac-toe board. Labels is a computery thing.
But your game is a human thing. Choose the human names over the computery
names. So that gives us "m_lblSquar es". Note the use of the plural. This
indicates that it's not a single sqaure. Some people like to have "coll"
instead. "m_colllblSquar es" or "m_collSqua res" and who cares about the
labelness, or "m_alblSqua res" because it's an array of labels.

Tomorrow you might rewrite your program using PictureBoxes instead of
labels. "m_collSqau res" would survive untouched. Anything with "lbl" would
have to be changed to "pic". [Remember strBoolean - that didn't survive the
change from string]. So a name that is implementation free can be better.
There are those who go for that approach.

Well, that's enough to put in your pipe for now. I'm not saying which
style you should develop. My own style has developed and changed over many
years. It has never conformed to Microsoft's (I got there first, lol). Many
others have different styles. You are just beginning to develop a style.
Ponder on it. Adapt it. Be consistent but prepared to change it when
necessary.

This applies to code layout as well. There's a bit that you did that I
particularly liked. It doesn't show well here so I'm going to edit it a bit.

Private Sub PlacePlayersMar ker(.....) _
Handles TTT1.Click, TTT2.Click, TTT3.Click, _
TTT4l.Click, TTT5.Click, TTT6.Click, _
TTT7l.Click, TTT8l.Click, TTT9.Click

You broke the line <before> the Handles. This means that anyone looking at
the next line will immediately see it there. This leaves only one
interpretation for TTT1.Click - it is an event being handled. Had you left it
out, the next line would have started with TTT1.Click. Now is that an event
being handled or is it a method being called? It's only a small point but a
bit of careful thought can save someone tripping up. Some will say that that's
too trivial. [I call it subtle :-)]. As you develop your style and think about
all these "little points" you get to develop code which has a clarity that
will be appreciated without even being noticed.

Here's another example:
If tTheHouseIsOnFi re And tTheresNoPhone And _
eDistanceToNeig hbour = eDistances.TooF arToWalk Then
JumpInTheCarAnd DriveLikeHell (GrabTheKeysOnT heWayOut())
vs.
If tTheHouseIsOnFi re And tTheresNoPhone _
And eDistanceToNeig hbour = eDistances.TooF arToWalk Then
JumpInTheCarAnd DriveLikeHell (GrabTheKeysOnT heWayOut())

In the first case you see the assignment "eDistanceToNei ghbour = ..." and
finally notice the Then at the end which makes you realise that it's <not> as
assignment.
In the second you see the "And" first and know immediately that it can't
be an assignment.

Subtle. Trivial. What do you think ?

Anyway, that's enough for now. :-)

All the best,
Fergus.

ps. You'll have noticed that I like long variable names and 'If ' statements
that read like a sentence.
Nov 20 '05 #5
I used mLabelCollectio n because my text, Programming with Microsoft Visual
Basic .Net by Diane Zak states on page 50, ... the naming convention in this
book records the object's purpose at the beginning of the name, and then
includes the object's type at the end of the name. Hence, TTT1Label
(TicTacToe/Position1in the grid/Label), mLabelCollectio n (m is for a
form-level variable; Label for the type of controls contained within the
Collection), objLabel (object variable that is for the addresses of Label
controls), etc., etc., etc.

The naming convention that you prefer to use (lblTTT1) is also preferred by
my instructor. My instructor began using Visual Basic before .Net.

Whether or not Diane Zak created the naming convention used in her book or
it is a new naming convention to go with .Net, I don't know.

I am beginning my Visual Basic knowledge with .Net. So, whenever I see
lblTTT1 versus TTT1Label, I believe the programmer came to Visual Basic .Net
after having experience with an earlier version of Visual Basic.

I used the mLabelCollectio n because I have another label on my form with
self identifying information for the instructor's need to distinguish each
student's work. Therefore, I need to separate my labels. I chose a
collection to do so.

thank you everyone for your help. i think i got it now. peace

"Fergus Cooney" <fi******@tesco .net> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi again Stephen,

I wanted to make you look for meanings rather than me handing them to you on a plate. Then I'd come back after to fill in any gaps. Best for learning that way, even if it's a bit puzzling for you in the meantime. :-)

I mentioned the collection because it's just what you need in that reset loop! It doesn't matter in this sort of program, of course, but I'm interested in you learning principles as well as getting your code working.

Namely:
Having taken the trouble to create a collection containing <only> the
tic-tac labels, what do you do with it? And then when it comes to clearing the labels, how many Controls do you check? That's one part of it. The other part, which you wouldn't realise on your test setup, is that there may be other
labels on the Form, such as "Player 1", "Player 2". These would get wiped
too!! Oops.

Regarding the 'while' loop. I can assure you that it didn't work for me. Not because I plonked it onto my form and messed it up, but because there was a logic error in your code. That's why I asked about the equivalent 'for'
loop. I also wanted you to tell me whether your 'while' loop matches the 'for' loop. (It doesn't - but why? Learning point: How 'while' and 'for' are not
always the same.)

strPlayer - presumably it was initially a string variable. Now it's a
Boolean. But a reader of your code will wionder - did he forget to change the "str" to "t" (truth) or "f" (flag) or "b" (boolean) or whatever is your choice for a Boolean. I've got no problem with your choice of a Boolean for a
two-state variable! But change the type and change the name is a handy habit to develop early on.

In fact developing a style and becoming habitually consistent is very
important. I notice that you have the following:

strBoolean - lower-case type and capitalised type, but no name.
mLabelCollectio n m for member, capitalised type, capitalised name, but only a sort of name.
objLabel - lower case type, but no name.
intx - lowercase everything
TTT1Label. - upper case name, capitalised type.

strBoolean - it's a Boolean give it a 't' (that's my style, many would
disagree, but 'b' and 'f' are already taken in my scheme). That says it all as regards type. So what should its name be? Well, it controls whose turn it is. It also controls which type of mark is made (X or O). Which is the central
concept? At the moment it's the mark. But, if later you decide to allow Player 1 to choose whether they'd like to be X or O, then it directly controls the player's turn but only indirectly the mark - you'd use it to index an array of Marks - one for each player. But that wouldn't work because it's a Boolean - an integer would be better. So let's change it to, say, iPlayerToGo. And place asMarks (iPlayerToGo) in the tic-tak grid. ["asMarks" is 'a', an array, of
's', strings, containing 'Marks' the marks made by the players. Or whatever word you prefer.]

All that discussion over just a single variable. Is it worth it? Tell me what you think.

mLabelCollectio n, TTT1Label, ObjLabel. These are all labels. It's common to have control types abbreviated in lower case at the front. There's a
Microsoft recommended list somewhere in the Help. For labels you'd use "lbl". Which gives us mlblCollection, lblTTT1 and lblObj. Still not there yet.

mlblCollection. Some people like to separate the 'm' with an underscore. Now, what is it a collection of? Not labels. That's how whatever they are is <implemented> but that's not what they <are>. They are in fact squares, or
places or whatever, on your tic-tac-toe board. Labels is a computery thing. But your game is a human thing. Choose the human names over the computery
names. So that gives us "m_lblSquar es". Note the use of the plural. This
indicates that it's not a single sqaure. Some people like to have "coll"
instead. "m_colllblSquar es" or "m_collSqua res" and who cares about the
labelness, or "m_alblSqua res" because it's an array of labels.

Tomorrow you might rewrite your program using PictureBoxes instead of
labels. "m_collSqau res" would survive untouched. Anything with "lbl" would
have to be changed to "pic". [Remember strBoolean - that didn't survive the change from string]. So a name that is implementation free can be better.
There are those who go for that approach.

Well, that's enough to put in your pipe for now. I'm not saying which
style you should develop. My own style has developed and changed over many
years. It has never conformed to Microsoft's (I got there first, lol). Many others have different styles. You are just beginning to develop a style.
Ponder on it. Adapt it. Be consistent but prepared to change it when
necessary.

This applies to code layout as well. There's a bit that you did that I
particularly liked. It doesn't show well here so I'm going to edit it a bit.
Private Sub PlacePlayersMar ker(.....) _
Handles TTT1.Click, TTT2.Click, TTT3.Click, _
TTT4l.Click, TTT5.Click, TTT6.Click, _
TTT7l.Click, TTT8l.Click, TTT9.Click

You broke the line <before> the Handles. This means that anyone looking at the next line will immediately see it there. This leaves only one
interpretation for TTT1.Click - it is an event being handled. Had you left it out, the next line would have started with TTT1.Click. Now is that an event being handled or is it a method being called? It's only a small point but a bit of careful thought can save someone tripping up. Some will say that that's too trivial. [I call it subtle :-)]. As you develop your style and think about all these "little points" you get to develop code which has a clarity that
will be appreciated without even being noticed.

Here's another example:
If tTheHouseIsOnFi re And tTheresNoPhone And _
eDistanceToNeig hbour = eDistances.TooF arToWalk Then
JumpInTheCarAnd DriveLikeHell (GrabTheKeysOnT heWayOut())
vs.
If tTheHouseIsOnFi re And tTheresNoPhone _
And eDistanceToNeig hbour = eDistances.TooF arToWalk Then
JumpInTheCarAnd DriveLikeHell (GrabTheKeysOnT heWayOut())

In the first case you see the assignment "eDistanceToNei ghbour = ..." and finally notice the Then at the end which makes you realise that it's <not> as assignment.
In the second you see the "And" first and know immediately that it can't be an assignment.

Subtle. Trivial. What do you think ?

Anyway, that's enough for now. :-)

All the best,
Fergus.

ps. You'll have noticed that I like long variable names and 'If ' statements that read like a sentence.

Nov 20 '05 #6
"Nak" <a@a.com> wrote in news:ub******** ******@TK2MSFTN GP11.phx.gbl:
I made an online tic-tac-toe, but it was in VB6 so I doubt it would


Do you have an algorithm for creating a computerized opponent? I've been
looking for one to study and have not been able to find one.

Chris
Nov 20 '05 #7
Nak
> Do you have an algorithm for creating a computerized opponent? I've been
looking for one to study and have not been able to find one.


Hi,

Unfortunately my version wasn't as flash as that. But I shouldn't
imagine that it would be that hard to be honest with you. Maybe there are a
few on Planet Source Code,

www.planet-source-code.com

You'll find most under the "Visual Basic" section rather than the .NET
section.

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Slow internet connection?
Having problems with you job?
You're marriage is on the rocks?
You can't sleep at night?
You have a drink and drugs addiction?
You are sexually impotent?
Then enable Option Strict!
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #8

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

Similar topics

6
2429
by: Daniel Bowett | last post by:
I have just started playing around with MySQLdb for a project I am planning. As a test I have written a script that executes 3000 insert statements on a table. The table contains 10 fields with a mix of text and numbers - its a product table for a website eg UPC, ProductName, Price etc. The problem I have is that it takes just over two minuted to execute the 3000 insert statements which seems really slow! I am running it on a machine...
18
500
by: davineastley | last post by:
Hello, My name is Davin Eastley and I'm 13 years old. I live in Tasmania, Australia and am training for MCAD Certification in C#. I was interested to know what the best resources for learning C++ is as I am a beginner. I later want to learn Java as well. Feel free to e-mail me at davineastley@gmail.com. Regards, Davin Eastley
12
1125
by: WindAndWaves | last post by:
Hi Gurus I am sorry to ask so many questions, but unfortunately, you are just such an awesome source of knowledge that I can not help myself but ask lots. One day, I hope to be able to answer other people's questions. Here we go, I have the following function (I made it myself ...!) function tic(form,a,z){ for(f=a;z;f++){
30
4148
by: nephish | last post by:
Hey there, i have tried about every graphing package for python i can get to work on my system. gnuplot, pychart, biggles, gdchart, etc.. (cant get matplot to work) so far, they all are working ok. I need to make an x y chart for some data that comes in from sensors at different times durring the day. i need it to show the value in the y and the time in the x . no problem so far. But what i cannot get to happen is to scale x (time of the...
4
1621
by: Jim Heavey | last post by:
I am wanting to find any instance in a string where more then on occurance of a value occurs and replace it with a single occurance of the value. Specifically I want to search a text field and find any time where more then a single ' (tic) occurs in succession, and replace it with a single ' (tic). Can this be done with a RegularExpression? Any example of how to do this?
10
5256
by: Chao | last post by:
I've been trying to develop some numerical codes with python, however got disappointed. A very simple test, a = 1.0 for i in range(1000): for j in range(1000): a = a+1
3
38774
by: Arielle | last post by:
Greetings! I'm using classic ASP and an insert statement to save bulletin messages to a database that can be updated or viewed later. At first I thought it worked perfectly so I took some sample messages and one of them kept erroring out. I've pretty much determined that it hates the ' character.. and I'm sure it'd hate other special characters as well so here's my question. How do I insert special characters into a database? My...
2
7924
by: cylin | last post by:
Hi, I am currently doing a project regarding image processing. I had facing problem writing C++ code to calculate time taken to execute a function. Can somebody help me on this. thanks. #include "picture.h" #include <iostream> using namespace std; int main()
15
4268
by: Sampat | last post by:
Hi, I wanted to know the performance of calling a function pointer v/s a normal function call in javascript in a scenario where there are multiple calls in the js to the same function. Please share your thoughts if someone has worked on this. Thanks, Sampat.
83
4163
by: liketofindoutwhy | last post by:
I am learning more and more Prototype and Script.aculo.us and got the Bungee book... and wonder if I should get some books on jQuery (jQuery in Action, and Learning jQuery) and start learning about it too? Once I saw a website comparing Prototype to Java and jQuery to Ruby... but now that I read more and more about Prototype, it is said that Prototype actually came from Ruby on Rails development and the creator of Prototype created it...
0
8399
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
8312
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
8827
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
7337
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
6169
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
4159
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
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
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.