Click to See Complete Forum and Search --> : Giving away code.....a drawback
stevess
Jun 19th, 2001, 06:07 PM
Just an observation that I have seen over and over again.
Many advanced people on this forum will readily post complex code for people that can't even figure out the InStr function.
In some cases I think that is fine, but I also know, from experience, that if you are given the code to solve a difficult problem, and it works, you will probably not take the time to figure out why it works, or how it works, thereby not learning anything.
The code below is an example from my past, I had no clue what it did then, and I still don't, because it worked from day one and has never had a bug (except for commenting out the first If).
This code is very poorly written, so perhaps it's a bad example, but it is a good example of the point I am making.
Private Function RSEncode(NumRSSyms As Integer, TmpArray() As String, ParitySyms() As String) As Integer
'------------------------------------------------------------------
' This function accepts as inputs the number of input symbols, an
' array where the input symbols are stored and an output array
' where the resulting output symbols are stored.
'------------------------------------------------------------------
'Code supplied by AustraliaPost web site
'SSS 02/99 AU Mail update
Dim N As Integer
Dim i As Integer
Dim j As Integer
ReDim mult(0 To 63, 0 To 63) As Integer 'used for Reed Solomon error correction
ReDim gen(0 To 4) As Integer ' " " " " " "
ReDim temp(31) As Integer
'Static RSInited As Integer
ReDim ParitySyms(0 To 3) As String
'If Not RSInited Then
'RSInit needs to be called once at the start
'Code supplied by AustraliaPost web site
'I don't claim to understand it-SSS
Dim primpoly As Integer
Dim testv As Integer
Dim prevv As Integer
Dim nextv As Integer
'Dim i As Integer
'Dim j As Integer
primpoly = 67 ' a**6 + a + 1 where a (alpha) is 2
testv = 64
For i = 0 To 63
mult(0, i) = 0
mult(1, i) = i
Next i
prevv = 1
For i = 1 To 63
nextv = prevv * 2
If (nextv >= testv) Then
nextv = nextv Xor primpoly
End If
For j = 0 To 63
mult(nextv, j) = mult(prevv, j) * 2
If mult(nextv, j) >= testv Then
mult(nextv, j) = mult(nextv, j) Xor primpoly
End If
Next j
prevv = nextv
Next i
gen(0) = 48
gen(1) = 17
gen(2) = 29
gen(3) = 30
gen(4) = 1
'RSInited = True
'End If
On Error GoTo OOOps
N = NumRSSyms + 4
For i = 0 To 3
temp(i) = 0
Next i
For i = 4 To N - 1
temp(i) = Val(TmpArray(N - 1 - i)) 'Fill in reversed order
Next i
For i = NumRSSyms - 1 To 0 Step -1
For j = 0 To 4
temp(i + j) = temp(i + j) Xor mult(gen(j), temp(i + 4))
Next j
Next i
For i = 0 To 3 ' Fill in the resulting output array
ParitySyms(i) = Str(temp(i))
Next i
RSEncode = 0
On Error GoTo 0
Exit Function
OOOps:
RSEncode = 1
Exit Function
End Function
Olly
Jun 19th, 2001, 06:15 PM
Hmm, those who are really interested in vb will learn it anyway.
Those who aren't won't get too far. But hey, it's great too to examine difficult code and experiment with it. Learning by manipulating.
http://members.tripod.de/Kluetifun/images/needmoney_jpg.jpg
barrk
Jun 19th, 2001, 06:17 PM
I'm usually a nice person and would refrain from saying things like this but.........................
You, Sir, have an attitude problem.
My cubemate has answered many questions on this site and invariably you follow immediately afterward with practically the same code with a few variations and some nasty comment about how his code is sloppy code or how his code was much more complex than it needed to be and how does he expect people to learn with such examples or some such nonsense! According to your not very well informed opinion, it's a miracle he has a job if he is such a poor programmer!
I have worked with this man for three years and he is an excellent programmer and is very well paid for what he does. He is also a fine human being who takes his time to teach other people so..........stuff that in your ear!
stevess
Jun 19th, 2001, 06:19 PM
I don't agree, people will learn what they NEED to learn. Especially, if they do it for a living.
Nice sign!
chrisjk
Jun 19th, 2001, 06:27 PM
Originally posted by barrk
I'm usually a nice person and would refrain from saying things like this but.........................
You, Sir, have an attitude problem.
My cubemate has answered many questions on this site and invariably you follow immediately afterward with practically the same code with a few variations and some nasty comment about how his code is sloppy code or how his code was much more complex than it needed to be and how does he expect people to learn with such examples or some such nonsense! According to your not very well informed opinion, it's a miracle he has a job if he is such a poor programmer!
I have worked with this man for three years and he is an excellent programmer and is very well paid for what he does. He is also a fine human being who takes his time to teach other people so..........stuff that in your ear! Woah! Warpath Katie strikes again! :D Who is the cubemate?
stevess
Jun 19th, 2001, 06:30 PM
barrk,
I do not have an attitude and I am not attacking anyone. You're reference to your cubemate refers to a very specific thread, and I remember it, overall you are completely incorrect.
Giving code away is NOT the best way to teach someone. The best way is to point them in the right the direction and force then to figure it out on their own, THAT is where retention comes from. Nothing is truely LEARNED until you no longer have to refer to someone elses code (or past code that someone gave you) in order to duplicate it.
I am sure your cubemate is very adept, could you survive without him?
I AM your cubemate in my job, and my cubemate relies on me for answers. I make him work for it, and he is a better programmer because of it.
barrk
Jun 19th, 2001, 06:35 PM
You don't have an attitude problem but "overall I'm completely incorrect"?????????
Yes, I could survive without my cubemate...he's a very talented young pup but a young pup none the less....and he still teaches me things and vice versa!
I bet you're just a joy to work with if you have that attitude toward your cubemate........the word mate is in there for a reason you know!
I do find it quite interesting that you assume that I am the junior member....could you also be the least bit sexist????
chrisjk
Jun 19th, 2001, 06:41 PM
@"£&^*#!!! You didn't answer!!Who is the cubemate?could you also be the least bit sexyYeah baby yeah, you know it!!!!
stevess
Jun 19th, 2001, 06:42 PM
#1) I meant you were incorrect about me being critical of other peoples code.
#2) I didn't know you were female until that comment, I was typing mine when the last one was posted.
#3) The assumption was my mistake, sorry.
Olly
Jun 19th, 2001, 06:48 PM
When you program hard stuff on your own you will get this "Yeeessss" feeling. If it's just copied n' pasted you won't.
Those who like feeling like a doughnut with a hole inside will prefer the 2nd one. Also this is not some school teaching forum.
It would take too long to advise somebody completely from scretch every time by new. People will get that code anyway if not here then somewhere else. If they don't take it serious, then it will just blow away in the wind...Noone will get far with code that he doesn't understand. And at the point of realising that serious folks will start examining the code.
-->btw, nice to know not to be in a guys only zone here ;)
stevess
Jun 19th, 2001, 07:08 PM
Olly,
I can accept that. In the process of replying you emphasized a previous point. If people on this forum are not enthusiastic about what they do, then why supply them with code that someone else has worked hard to develop? Make them expend at least a little effort, many people will come here before they even open a help file. I think that is pure laziness and they don't deserve an answer, in some cases.
I have been forced to learn most of what I know on my own, I know the resources are there.
Dig a little before you ask for help, and you'll be better off because of it.
For those people that don't have help/MSDN.....you're not that serious if you don't want to make the investment for a legal copy.
barrk,
Learn to have a discussion without getting defensive. As for whether or not I am a "joy to work with", coworkers do like me, but more importantly, they respect me. I am never derogitory, but I do make it obvious when someone asks me something that they could easily find on their own with a little effort.
Jethro
Jun 19th, 2001, 07:19 PM
Who is the ciubemate Katie.....another seppo we can indoctrinate into the aussie culture thing.
Olly
Er, your a wild looking dude.
stevess
You got a code snippet from Oz Post. You sick puppy, it was probably to do with the pay tv rollout.
Ok have been given a heap of complex code snippets from time to time here. And have then delved into them line by line to see what they are doing. Generally either ask the poster or some one in our office if can't work out what the hell they are doing.
Anyone that just pastes in 50 lines of code and doesn't bother analysing it, is not a good programmer and is not going to be a good programmer.
Have used both approaches when answering questions. Either posted wads of code, (if currently have it on line), or pointed out a function etc which solves the problem. Or even pointed to a web site where they can get the answer.
So is this a closet thing with you:rolleyes:
This posting brought to you by "Forum Fights - another Parksie/Jethro joint venture".
stevess
Jun 19th, 2001, 07:27 PM
Jethro,
Can't understand half of what you said, and don't don't know what point you're making with the other half.
The code I posted I have had had for 2 years and it is in use in the software I support, it is used for generating Australia Post barcodes.
Who is Oz? Never seen any posts by same.
chrisjk
Jun 19th, 2001, 07:27 PM
Originally posted by stevess
For those people that don't have help/MSDN.....you're not that serious if you don't want to make the investment for a legal copyMSDN is available at support.microsoft.com and msdn.microsoft.com anyway!Who is the ciubemate KatieI already asked (see up a few), but she didn't answer, then left.
chrisjk
Jun 19th, 2001, 07:30 PM
Originally posted by stevess
Who is Oz? Never seen any posts by same. ha ha "Oz" or "Aus" is slang for Australia!! Which planet do you come from?!? :D
Jethro
Jun 19th, 2001, 07:32 PM
Originally posted by stevess
Jethro,
Can't understand half of what you said, and don't don't know what point you're making with the other half.
The code I posted I have had had for 2 years and it is in use in the software I support, it is used for generating Australia Post barcodes.
Who is Oz? Never seen any posts by same.
Are you for really?
Clearly your powers of analysis leave something to be desired.
Australia = Oz.
Chris
Yeap noticed that, thought l might back you on that one. Currently am thinking it's Dennis...........which would be really weird.
chrisjk
Jun 19th, 2001, 07:37 PM
Yeap noticed that, thought l might back you on that one. Currently am thinking it's Dennis...........which would be really weirdNah, Dennis is on the East side of the states, she is in Cali on the west, she keeps pointing that out for some reason.
I reckon it's someone we've never heard of that has almost no posts or something and has only just started appearing, or they don't both with General VB or Dbase/FF or CC and so don't see them.
stevess
Jun 19th, 2001, 07:40 PM
Is that the typical code that comes out of "Oz"?
I can only assume that I am out of touch.;)
Not to brag, but I work on THE #1 software in the world for non-profit fundraising. GreenPeace, AU is one of our clients (and rather vocal), as well as American Red Cross, Unicef, Salvation Army, and 9900 others.
stevess
Jun 19th, 2001, 07:46 PM
Jethro,
"Are you for really?"
Can you speakee English?
What makes you think that people should know that Oz = Aus?
I have worked on software that sells in Aus for 3 years and I have never heard the term.
Jethro
Jun 19th, 2001, 07:48 PM
Originally posted by stevess
Is that the typical code that comes out of "Oz"?
I can only assume that I am out of touch.;)
Not to brag, but I work on THE #1 software in the world for non-profit fundraising. GreenPeace, AU is one of our clients (and rather vocal), as well as American Red Cross, Unicef, Salvation Army, and 9900 others.
Well that explains things. No Australia Post do not do typical code.Hmmm.....probably why you missed some stuff in previous post, alot of Oz jokes included.
Chris
We just have to keep nagging her. Your probably right, though it could be some one we know who doesn't want to admit he knows katie in the flesh.:eek: Er, you know what l mean.
chrisjk
Jun 19th, 2001, 07:49 PM
Well it's a term used in Aus and Britain, so maybe you wouldn't have heard of it, but the aussies definately use it.
chrisjk
Jun 19th, 2001, 07:51 PM
Originally posted by Jethro
admit he knows katie in the flesh.:eek: Er, you know what l mean. :eek: :eek: ;)
stevess
Jun 19th, 2001, 07:51 PM
I can tell you who she was talking about, give me a minute.
stevess
Jun 19th, 2001, 08:01 PM
You guess who it is.
I can't seem to get this right.....
http://161.58.186.97/showthread.php?s=&threadid=82731&highlight=amazed
Jethro
Jun 19th, 2001, 08:04 PM
It's telling me the page can't be found.
Ok have given up on needling ya. Now all l need to find out is that your another seppo with a sense of humour.
stevess
Jun 19th, 2001, 08:06 PM
It works now.
What's a seppo?
(More lack of exposure)
chrisjk
Jun 19th, 2001, 08:10 PM
seppo = American
pom or pommie = english
chrisjk
Jun 19th, 2001, 08:13 PM
It's got to be numtel, his location is CA (california) and that's where Katie lives.
stevess
Jun 19th, 2001, 08:17 PM
lol
What is numtel?
I am in South Carolina.
Humbly, a stupid seppo.
Jethro
Jun 19th, 2001, 08:26 PM
Originally posted by stevess
lol
What is numtel?
I am in South Carolina.
Humbly, a stupid seppo.
Could also be Eer3 whose location is also CA.
Sorry Dude,
Oz slang
Spectic Tank -> Yank -> Seppo
Now for the 250,000 question
What is a Noah?
stevess
Jun 19th, 2001, 08:39 PM
I plead the 5th Amendment (The Right to not incriminate one's self, or something like that)
North American H? ??
Spectic Tank -> Yank -> Seppo ???????
Where do the p's and o come from?
I think we are a little off subject here.
:D :D :D :D :D :D :D :D :D :D :D
PS
Any guesses on who the cubemate is?
Jethro
Jun 19th, 2001, 08:50 PM
Originally posted by stevess
I plead the 5th Amendment (The Right to not incriminate one's self, or something like that)
North American H? ??
Spectic Tank -> Yank -> Seppo ???????
Where do the p's and o come from?
I think we are a little off subject here.
:D :D :D :D :D :D :D :D :D :D :D
PS
Any guesses on who the cubemate is?
Oops spelling mistake...lets try that again
Septic Tank -> Yank -> Seppo.
Of course we are off the subject, and we haven't start on the smut yet;)
SurfDemon
Jun 19th, 2001, 09:19 PM
Grumble Grumble.... typical, I miss all the good fights......
Personally, I learned to program from reading examples (there weren't any books available for the languages I was using (Hewlett Packard C and Basic back in 1978 odds... both very syntax specific), and it was very instructional. I always try to post code examples as I think it gives a cleaner answer. if the person wants ot learn they will try to find out why the code works the way it does.
Just my two pennies,
SD
CiberTHuG
Jun 20th, 2001, 08:00 AM
Damn, I miss the good shows, too. Three points for Katie. Sorry, Steve, but have allegainces, besides, I disagree with you, and here is why.
I learned C++ in university. I learned assembly on the 68K. I've done real programming, I understand the logic and OO and memory management and clock cycles on a very good level. VB is not a very advanced language. It is not a very good language. I'm using VB, VBScript for ASP, and JavaScript. Of these three, I have the most respect for JavaScript, and that is shakey since it is hard to get cross the board compliance to standards.
Anyway... it is much faster for me now to reverse engineer any code that you may have. I already know how to program. I just need to know the syntax and functions particular to VB/VBScript.
Now, as to others... well... if they are using VB, I find it hard to believe they are truely in it to learn the subtle side of programming. VB is a very corse, messy way to do things, and it is grossly platform specific.
Now, give me a moment and I'll rewrite you code. We can all make it nice and pretty, and discuss why we are doing what we are doing. Those who want to learn can learn from that.
SurfDemon
Jun 20th, 2001, 08:29 AM
Originally posted by CiberTHuG
VB is a very corse, messy way to do things,
Sounds like my sex life :D
CiberTHuG
Jun 20th, 2001, 08:39 AM
Ah, those were the good old days.
Anticipated response from SD: What, you enjoyed my sex life?
Ah... having a sex life, those were the good old days.
So, SD, do you have a Mullet Hair Daemon?
CiberTHuG
Jun 20th, 2001, 09:04 AM
Okay, so I'm mulling through the code. Yes, it could look cleaner, and it could everything declared better, and it could have avoided the use of the label, but... what is it doing? The code is very messy simply because this particular algorithm requires the massive shuffling of array values. I'd hope there is a way to avoid that, but it would require knowledge of Reed Solomon encoding.
My biggest change would be to not ask for NumRSSyms. If I'm correct, NumRSSyms is just the UBound for TmpArray.
*shrug*
SurfDemon
Jun 20th, 2001, 09:53 AM
Originally posted by CiberTHuG
So, SD, do you have a Mullet Hair Daemon?
Yes! It's rather fetching isn't it! :D
SD
CiberTHuG
Jun 20th, 2001, 12:36 PM
I am Southern, I am not a Redneck.
parksie
Jun 20th, 2001, 12:37 PM
Aha new friends of Katie's join the...party ;)
barrk
Jun 20th, 2001, 12:38 PM
Sorry, Travis! That crack was aimed at my cubemate not you! We just had a new guy move into the cube and he is the one I was referring too as a redneck...not you!
barrk
Jun 20th, 2001, 03:21 PM
After reading your responses in the General VB Section I have decided that you are my hero, Chris......
http://www.vbforums.com/attachment.php?s=&postid=345901
chrisjk
Jun 20th, 2001, 03:30 PM
Glad to be of service...
*wonders what Katie is talking about*
barrk
Jun 20th, 2001, 03:33 PM
Originally posted by chrisjk
Glad to be of service...
*wonders what Katie is talking about*
You're entire attitude during this (http://161.58.186.97/showthread.php?s=&threadid=84182) entire thread
chrisjk
Jun 20th, 2001, 03:45 PM
Ah! It was fun! Thanks for the smootch :D
Jethro
Jun 20th, 2001, 04:45 PM
Travis
Tsk, Tsk, my language is better than your language...............
Get over it guy, know C, COBOL, BASIC (of course), PASCAL, and a number of languages you probably haven't heard of.
VB is fine, as in most languages, it's just the way people code in it that makes it look messy. Why we enforce strict standards, that from time to time l argue about here. It's not that our standards are the very best, but they avoid some of the dross we have had to support in the past.
Now COBOL, that was a man's language:eek: Yeap, used to love writing a book, every time you wanted the least bit complex program.
All
Am thinking of starting a new soceity." Society for the Prevention of Insanity in Katie's cubemates".
Katie'sCubeMate
Jun 20th, 2001, 04:49 PM
Am thinking of starting a new soceity." Society for the Prevention of Insanity in Katie's cubemates".
Where do I sign up?
Katie'sCubeMate
Jun 20th, 2001, 04:52 PM
Where do I sign up?[
Someone should ask SuperSteve if he wants to join too!
barrk
Jun 20th, 2001, 04:53 PM
Mr. Super Steve to you, Mr. CubeMate!!!
CiberTHuG
Jun 20th, 2001, 04:53 PM
Originally posted by Jethro
Travis
Tsk, Tsk, my language is better than your language...............
Get over it guy, know C, COBOL, BASIC (of course), PASCAL, and a number of languages you probably haven't heard of.
VB is fine, as in most languages, it's just the way people code in it that makes it look messy. Why we enforce strict standards, that from time to time l argue about here. It's not that our standards are the very best, but they avoid some of the dross we have had to support in the past.
Now COBOL, that was a man's language:eek: Yeap, used to love writing a book, every time you wanted the least bit complex program.
Okay, so I'm guessing my post was taken the wrong way. Very likely my fault I don't want to sound elitist or superior. I just don't think you need to worry about anyone using VB needing to learn. If they truely wanted to program, then the need to get a true language. If they just want to use VB, then they aren't interested in the subtlties of good programming.
chrisjk
Jun 20th, 2001, 04:59 PM
I hope you're not dissing VB Ciber.If they truely wanted to program, then the need to get a true languageSo VB isn't real? Interesting. What is it...fake? an imposter?
It's no lesser language than anything else, it's a language. Whether it's easy or not doesn't mean it's not a language.
CiberTHuG
Jun 20th, 2001, 05:05 PM
Yes, I'm dissing VB.
It isn't fake. It is a real language. It just isn't a very good language.
There is a tool for every job. I love Perl. Perl is poetry. But you shouldn't write an OS out of Perl. Guess what... someone is. :rolleyes:
VB is good for RAD. It is good for apps that you will use on a limited scale, internally, or products that you will not worry about supporting in two or three years. VB is also very platform specific, and any application you can write in VB, you can write in VC++ and use less memory.
To me, VB is a hobbyist language, for home use.
Anyway, the original point was... we aren't teaching people well if we provide the VB solution for them. *shrug* We aren't teaching people well if we let them learn on VB.
PS Sorry, forgot to address the easy part. I don't consider VB bad because it is 'easy'. In fact it can be very challenging at times to do things that I want to do (regex, pointers). I have a very warped sense of what is easy. To me, Perl is very easy. Perl just flows, it is so easy. It is lazy, too, with its loose typing and modified looping structures. But it is not a hard language.
Jethro
Jun 20th, 2001, 05:10 PM
Originally posted by Katie'sCubeMate
Someone should ask SuperSteve if he wants to join too!
New Meat...New Meat
Now repeat after me
"I want to be an Aussie, cause Katie's an Aussie Sheila, and l want to be an Aussie bloke";)
Travis
Good point mate.
All
Was going to make it "Prevention of Cruelty" but then thought that might be a bit cruel.
barrk
Jun 20th, 2001, 05:13 PM
Hey now, Jethro! Katie'sCubeMate considers it a priviledge to work with such an "interesting" person as myself...unfortunately, he rolls his eyes when he says interesting...what do you think that means???
chrisjk
Jun 20th, 2001, 05:14 PM
I like Perl too, but it doesn't mean I have any less respect for VB. I find those who consider it a hobbyist language are usually those who are "getting on a bit" and remember the good old days when you had to get your hands dirty with cobol and assembler. I'm not saying you are like that, but that is my perception.
Why do you think it's a hobbyist language? Is it because it's got the word Basic in it? It's got shortcomings, but so has any language (like trying to write an OS in perl ;) )
Katie'sCubeMate
Jun 20th, 2001, 05:15 PM
Originally posted by barrk
Hey now, Jethro! Katie'sCubeMate considers it a priviledge to work with such an "interesting" person as myself...unfortunately, he rolls his eyes when he says interesting...what do you think that means???
MAYBE "Prevention of Cruelty" ISN'T TOO CRUEL?
barrk
Jun 20th, 2001, 05:17 PM
Hey now, Cubie......I'm close enough to seek my revenge in person you forget.......I will force you to listen to Erin, Ian and Travis stories all day......oh wait....I already do that, don't I!
Jethro
Jun 20th, 2001, 05:23 PM
Originally posted by chrisjk
Yeah, but what is your real username??
Apparently "parksie's duck" or "parksie's dick", strange but true:rolleyes:
CiberTHuG
Jun 20th, 2001, 05:24 PM
Wow... someone thinks I'm getting on a bit in years. Cool. I wish.
My first years seriously playing with computers was in '93. That was the end of the glory years. Phone BBS were going away or gone, the 'Net was starting to become commercial. We went from the World Wide Web Worm to Yahoo. :(
But yes, VB is BASIC. It has the shortcomings of BASIC. It has labels and gotos, it has no pointers. It has been refined over an over again so it has single and doulbe point precision floats, so it can do OO, but... why did we spend all that time working on making VB less BASIC when we had other languages that were already not BASIC?
*shrug*
People don't like C/C++ because they think the syntax is to obscure. Fine, make a version of C++ that has a much more natural syntax. Now, if you start to remove the ;s then you will hinder it a bit, but that is still okay.
I don't find a problem with
for(i = 0; i < x; i++){}
But there are those that preffer
for i = 0 to x step 1
*shrug*
Now I have to change
for(i = 0; i < x; i += y){}
to
for i = 0 to x
i = i + y
next
I don't guess I can do this
for(;i < x;){}
in a VB for loop. Guess I have to use a while or something.
CiberTHuG
Jun 20th, 2001, 05:27 PM
Damnit, a smiley showed up in my code.
Jethro
Jun 20th, 2001, 05:27 PM
Originally posted by barrk
Hey now, Jethro! Katie'sCubeMate considers it a priviledge to work with such an "interesting" person as myself...unfortunately, he rolls his eyes when he says interesting...what do you think that means???
Where to begin........could be that sixties drug induced haze that has become katie's world. A place we all love by the way.
It's katie's world
It's katie's world
It's Party time
Excellent
And for heavens sake why is he rolling his eyes, l mean he is sitting there in his village people outfit.....oops.....you did tell him the web cam is on right:eek:
barrk
Jun 20th, 2001, 05:28 PM
Originally posted by CiberTHuG
Damnit, a smiley showed up in my code.
That's what you get for posting C++ code in a VB Forum, Travis;) :p
barrk
Jun 20th, 2001, 05:29 PM
Originally posted by Jethro
Where to begin........could be that sixties drug induced haze that has become katie's world. A place we all love by the way.
It's katie's world
It's katie's world
It's Party time
Excellent
And for heavens sake why is he rolling his eyes, l mean he is sitting there in his village people outfit.....oops.....you did tell him the web cam is on right:eek:
Damn it, Jethro...you gave it away! Now I'll never get to see him dance again.:( ;)
CiberTHuG
Jun 20th, 2001, 05:31 PM
Originally posted by barrk
That's what you get for posting C++ code in a VB Forum, Travis;) :p
Hey, that code could've worked in Java, JavaScript, and Perl, not just C/C++.
Wow... that's five languages you people don't like. :(
barrk
Jun 20th, 2001, 05:32 PM
Originally posted by CiberTHuG
Hey, that code could've worked in Java, JavaScript, and Perl, not just C/C++.
Wow... that's five languages you people don't like. :(
I didn't say I didn't like it.......just yanking your chain a little........okay more than a little...but I was just kidding, Travis!:)
chrisjk
Jun 20th, 2001, 05:34 PM
Originally posted by CiberTHuG
Wow... someone thinks I'm getting on a bit in years. Cool. I wish.I didn't say you were old, I said that is usually the case!!Wow... that's five languages you people don't likeI like Perl!!!!!!!!!!!
Jethro
Jun 20th, 2001, 05:34 PM
Originally posted by barrk
Damn it, Jethro...you gave it away! Now I'll never get to see him dance again.:( ;)
And he looked so good dancing to Celine Dion on his desk as well:rolleyes:
Tell the new guy that his "Rocky Horror Picture Show" outfit doesn't do a thing for him. Would suggest maybe a Doris Day theme instead.
barrk
Jun 20th, 2001, 05:35 PM
He's more of a Jackie Chan in Shanghai Noon wouldn't you say cubie??
Katie'sCubeMate
Jun 20th, 2001, 05:44 PM
Yeah, definately Jackie...
...and maybe we could get these two to put on a show, seems as though they have similar talents...
Originally posted by Jethro from "parksies duck needs a name!"
That is just so mean. I have a good mind to take my hands off my hips, turn off the soundtrack to The Sound of Music, and hit you with my sweet little black satin handbag.
barrk
Jun 20th, 2001, 05:47 PM
Hehehe
:D
Jethro
Jun 20th, 2001, 05:51 PM
Originally posted by barrk
Hehehe
:D
katie that was a private message...............what...........you mean every one can read them............huh...............the private button down the bottom was a joke:eek:
Er, Aliens took me over all morning, have only just escaped their mind control ray.
barrk
Jun 20th, 2001, 05:53 PM
You posted it in Parksie's Dick....I mean the thread about Parksie's dick...the aliens have definitely got to you, better have a beer!
Jethro
Jun 20th, 2001, 06:02 PM
Your right, and could someone get this handbag off my desk so l can read the sports section followed by Playboy:rolleyes:
barrk
Jun 20th, 2001, 06:06 PM
Your job sounds much more interesting than mine.....are Playboys required reading.......they have such interesting articles you know!
parksie
Jun 20th, 2001, 06:12 PM
Yep, especially those fold-out centre sections...hard study is required :p
Jethro
Jun 20th, 2001, 06:14 PM
Originally posted by barrk
Your job sounds much more interesting than mine.....are Playboys required reading.......they have such interesting articles you know!
Never get passed the pictures myself:rolleyes:
And no l have not seen "Cats" 58 times as some one so sneering implied. It was only 57, the final night was sold out.
barrk
Jun 20th, 2001, 06:20 PM
Isn't it interesting that stevess starts this thread to bag on us for the way we answer posts in the other sections and we somehow manage to turn it into another smut fest............we are quite the talented bunch, I must say!!!!!!!!
chrisjk
Jun 20th, 2001, 06:24 PM
Did you expect any less :rolleyes: :D
barrk
Jun 20th, 2001, 06:25 PM
I only have 10 more minutes and then I get to go home!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I am sooo happy!!!!!!!!!!
Although, we haven't really accomplished a lot today....did any of you decide who my cube mate is???? and Jethro..you don't get to guess because I told you already!
chrisjk
Jun 20th, 2001, 06:28 PM
I reckon it's either num something or eeer something
barrk
Jun 20th, 2001, 06:30 PM
it's not num something....he's just a kid.......although my cubie isn't all that old either:rolleyes:
chrisjk
Jun 20th, 2001, 06:31 PM
by a process of illimination therefore it must be eer something
Jethro
Jun 20th, 2001, 06:33 PM
or not...........................
chrisjk
Jun 20th, 2001, 06:34 PM
Originally posted by chrisjk
illiminationBrain fart (as Katie would say) Elimination you fool.
SurfDemon
Jun 20th, 2001, 10:55 PM
Sorry folks, I'm a bit late into this discussion (work .... in VB... not C++.... don't you know)....
CiberThug, as much as I respect your opinion, I do have to disagree with it a little bit. (Hell, I'm an argumentative sort of guy:D)
You don't like VB because it is easy. I haven't programmed in Assembler for at least 10 years.... all the other languages, including C are much easier..... so what's your logic on this, I like easy.
Sure it's way too forgiving... but believe me, I kiss the ground VB walks on, I had to write all the sh*tty C programs that created windows and buttons etc. and that sucked the big one. VB was the biggest single advance in programming that I have seen. It still is the best language for front ends of databases (which is what most apps are, like it or not), and it can be written cleanly by an experienced programmer.... just as C can be written terribly by an in-experienced one.
I suspect one of two things, either you have an elitest attitude (which you shouldn't as I imagine most people on this forum know C and/or C++ plus a multitude of other languages) or VB hurt you as a child.....
sit dwn on SD's couch.... what happened... did a VB box fall on you as a child, maybe it just wouldn't install for you... yet it instaled for all the other boys...... or is it you resent giving Bill Gates your money ....... tell me about your mother .. does she wear revealing underwear?
:D
SD
eer3
Jun 20th, 2001, 11:20 PM
The jig is up, the news is out
They finally found me
The renegade who had it made
Retrieved for a bounty
Never more to go astray
This'll be the end today
Of the wanted man...
Somebody should make this into a song or something! - hehehe
(hey - don't blame me if Styx sues for copyright infringement)
Okay, all kidding aside... I don't normally post here, and probably won't again, at least not on a regular basis - it just isn't my style... but it was fun whilst it lasted (I really like that "whilst" word - did I use it correctly? Probably not!) Anyway, getting on to my point.
I know in my heart that my co-worker is correct and has my (and others) best interest at heart...
In the other corner...
I never had a beef with stevess (a.k.a. SuperSteve), nor do I now. Take a look at the thread he mentioned - it twern't me that pitched a ***** 'bout his whiny little "but what's wrong with my code" post. I CAN see how the post could irritate one though!
This here "Giving away code.....a drawback" thread of Steve-a-rino's originally had a point however...
I think that that we all (or at least I did) came to the forums to GET some kind of info as quickly as possible. "I need an answer NOW" seems to be a pretty common theme - and I've been there myself! And then, whilst (hehe - whilst) you're asking that first question, you realize that there are other folks who have yet to overcome the task(s) that you already have (simple or not). At some point, you do the right thing and give back to the forum - regardless of the requestors talents. It's up to them to take it from there - ask more questions or research it themselves.
Don't ya think?
SurfDemon
Jun 20th, 2001, 11:29 PM
Originally posted by eer3
Don't ya think?
I try not to. It hurts......... might possibly be something ot do with the drink....... but I reckon it's the programming myself.
Nice to meet you though. I hope you will post more often in Chit-chat. You're more than welcome, and any friend of Katies is a friend of mine.:D
SD
Jethro
Jun 20th, 2001, 11:30 PM
Probably the C++ boys had bigger things in the communial shower he used on fire island:eek:
Jethro
Jun 20th, 2001, 11:38 PM
Eer3 if you don't post in here on a regular basis then we will just go hunting for you in the other forums;) Bad luck, blame katie, she push us into this.
eer3
Jun 20th, 2001, 11:46 PM
hmm... she has that effect on you as well? So be it, I'll make the occasional appearance as req'd.
P.S I'm charging a minimal 1 U.S. $ fee for personal info on the aforementioned.
LOL
Just kidding Katie!
(send me a pm with your bank accnt for that info)
Really LOL
Just kidding again! I'll pay for this!
Jethro
Jun 21st, 2001, 12:07 AM
Cool Eer3
Best $2.50 AUD l ever spent by the way.
So katie really comes to work dressed in shorts and t-shirt waving big arnie about, and demanding that you all call her Lara Croft:eek:
CiberTHuG
Jun 21st, 2001, 08:12 AM
Originally posted by SurfDemon
Sorry folks, I'm a bit late into this discussion (work .... in VB... not C++.... don't you know)....
CiberThug, as much as I respect your opinion, I do have to disagree with it a little bit. (Hell, I'm an argumentative sort of guy:D)
You don't like VB because it is easy. I haven't programmed in Assembler for at least 10 years.... all the other languages, including C are much easier..... so what's your logic on this, I like easy.
Sure it's way too forgiving... but believe me, I kiss the ground VB walks on, I had to write all the sh*tty C programs that created windows and buttons etc. and that sucked the big one. VB was the biggest single advance in programming that I have seen. It still is the best language for front ends of databases (which is what most apps are, like it or not), and it can be written cleanly by an experienced programmer.... just as C can be written terribly by an in-experienced one.
I suspect one of two things, either you have an elitest attitude (which you shouldn't as I imagine most people on this forum know C and/or C++ plus a multitude of other languages) or VB hurt you as a child.....
sit dwn on SD's couch.... what happened... did a VB box fall on you as a child, maybe it just wouldn't install for you... yet it instaled for all the other boys...... or is it you resent giving Bill Gates your money ....... tell me about your mother .. does she wear revealing underwear?
:D
SD
You are muchly late in this conversation, but... I don't think VB is bad because it is easy. Infact, I know I have a warped sense of what is easy. What I find easy, tends to bother others. To me, Perl is easy. Perl is easier than VB because I can do what I want to and I don't have to think about a way around it. I can very easily whip out anonymous variables and pointers in Perl.
Sorry for the tangent... but I haven't tried anon variables in C++. I'll have to try that.
Anyway... your arguement that VB is a great leap because it handles all of the GUI for you... well... what about VC++? There is also Perl/Tk (or any Tk, Tcl/Tk being the obvious). You can also program in Motif, but I haven't done that myself, so I'm not sure how easy it is.
Now that MicroSoft has bought ActiveState, they are threatening to release a Visual Studio plugin for Perl and Python.
Anyway... VB is not a bad language because it is easy, it is just simply not suited for serious business applications. The application that I'm working with right now with my client, will no be supported in two to three years. It is in VB, and they are looking to make it a sell it. For that, VB may be perfect. But if you want to make a long lived application, that will adapt to different platforms, and that you can maintain and grow, you need to use a serious language.
MS Office was not written in VB. IE was not written in VB. IIS was not written in VB. (Now to list serious applications) Netscape was not written in VB. Oracle's DB was not written in VB. Apache was not written in VB.
Anyway.. I respect your opinion, but VB has its limitations just like every other language. VB's limitations happen to be more severe than others.
Oh, wait... I have a question... how easy is it to multithread a VB app/DLL? I once had a client that had a VB parser for homegrown XML. I rewrote the parser (it wasn't very big) because the guy who had written it was using a lot of temporary variables and extra routines. This was being used for ecommerce, and I wanted it to be as small and as fast as it could be. I cut down the executable by 40%. I'm not sure how much smaller the memory footprint was, but I think if I could've used VC++ I would've dropped it another 5-10%. I'm wondering if multithreading it would've saved some more memory without sacrificing too much processor time.
barrk
Jun 21st, 2001, 12:15 PM
Originally posted by eer3
hmm... she has that effect on you as well? So be it, I'll make the occasional appearance as req'd.
P.S I'm charging a minimal 1 U.S. $ fee for personal info on the aforementioned.
LOL
Just kidding Katie!
(send me a pm with your bank accnt for that info)
Really LOL
Just kidding again! I'll pay for this!
Okay.....I just spent the morning thrashing Ed within an inch of his life.....I had hoped to dissuade him from revealing anything about me that I'd rather you not know, but then I realized you already knew everything about me so I felt bad for beating him up....until I noticed how much he was enjoying it, that is:rolleyes:
parksie
Jun 21st, 2001, 12:23 PM
How could you not enjoy being beaten up by Katie :p
CiberTHuG
Jun 21st, 2001, 12:28 PM
Let me guess. The web cam was off durning his beating? :(
barrk
Jun 21st, 2001, 12:31 PM
Yeah, sorry, Travis. I shouldn't have been so selfish:rolleyes:
SurfDemon
Jun 21st, 2001, 01:36 PM
Originally posted by CiberTHuG
Anyway... your arguement that VB is a great leap because it handles all of the GUI for you... well... what about VC++? There is also Perl/Tk (or any Tk, Tcl/Tk being the obvious). You can also program in Motif, but I haven't done that myself, so I'm not sure how easy it is.
VB was the first. And it was a god send.
Originally posted by CiberTHuG
Anyway... VB is not a bad language because it is easy, it is just simply not suited for serious business applications. The application that I'm working with right now with my client, will no be supported in two to three years.
I'm sorry, I'm not trying to be insulting, but VB can written well or written poorly. Well written code can be maintened for a very long time. I was speaking to a mate from an old company about 6 months ago, and he was asking me about a number of VB app's I wrote there 5 or 6 years ago that are still going strong.
Most corporate systems are front-ends for databases. This is what VB excels at. I wouldn't try to write a game in it, but for corporate use it's excellent, which is why there are so many jobs in it.
It's biggest drawback is that it is easy to pick up, and therefore alot of people call themselves VB programmers without having learned any disipline. These people make it much harder for the rest of us because they write very poor code.
If you get a professional programmer writing VB it's clean, stable and easily maintained.
It's all about following the money. And the money's in VB at present.:D
SD
parksie
Jun 21st, 2001, 01:44 PM
Originally posted by SurfDemon
It's all about following the money. And the money's in VB at present.:DBugger. And here's me just about to start a C++ job :(
CiberTHuG
Jun 21st, 2001, 02:35 PM
Originally posted by SurfDemon
It's all about following the money. And the money's in VB at the present.
:eek: No, managers can be stupid!! You must protect them from themselves. You must herd them toward better technologies.
;)
Skitchen8
Jun 21st, 2001, 03:59 PM
I think that the code people give is fine... if you really want to learn than u will look at the example and figure out what it does... i just used some code for saving to the registry w/ api and figured out a lot from just one api call and a line of code
Jethro
Jun 21st, 2001, 04:52 PM
Originally posted by barrk
Okay.....I just spent the morning thrashing Ed within an inch of his life.....I had hoped to dissuade him from revealing anything about me that I'd rather you not know, but then I realized you already knew everything about me so I felt bad for beating him up....until I noticed how much he was enjoying it, that is:rolleyes:
He did mention the photos as well didn't he;)
barrk
Jun 21st, 2001, 04:55 PM
Uhhhh....photos??? He promised me he burned those!!!:confused: :eek:
Jethro
Jun 21st, 2001, 05:13 PM
Originally posted by barrk
Uhhhh....photos??? He promised me he burned those!!!:confused: :eek:
Apparently the FBI wouldn't let him, something to do with evidence and corruption of minors:rolleyes:
stevess
Jun 21st, 2001, 05:26 PM
Ok, I have been trying to stay out of this since I started it, but I feel I must make a comment or two.
Cyber,
I can understand your view of VB, but i also know that it is very "adaptable" to business applications, as a matter of fact, that is probably what it is best suited for.
I work on an app that is written primarily in VB, although we do use some C++ dlls and numerous Type libs.
Our most recent sale was to Pepperdine U. in CA for $450,000 (plus ~$30k/yr maintenance). We have very large clients, and numerous competitors, and they would not pay that kind of money for something that is "basic".
VB can be a powerful tool in the right hands.
The real money, these days, is in Web Developing, and VB is a good foundation to start with.
barrk
Jun 21st, 2001, 05:32 PM
Originally posted by stevess
barrk,.....I am never derogitory,.....
Stevess,
You may want to do a search on threads you have replied to and see if you still want to make that assertion.
stevess
Jun 21st, 2001, 05:35 PM
barrk,
Obviously you have a problem with me. I don't care. Don't bother making pointless, and vague, replies to me.
barrk
Jun 21st, 2001, 05:37 PM
My replies always have a point...it just depends on whether you are intelligent enough to understand them.
stevess
Jun 21st, 2001, 05:39 PM
Bring on the IQ test.
Jethro
Jun 21st, 2001, 05:43 PM
Originally posted by barrk
My replies always have a point...it just depends on whether you are intelligent enough to understand them.
Don't worry l have a problem with him too katie. But you should feel sorry for him, as l don't think he can read. Either that or he is only into chapter two of "Teach Yourself VB in 24 Hours".
chrisjk
Jun 21st, 2001, 05:45 PM
Bring on the IQ test.Okay...
You have 15 oranges and 42.79 bananas (someone ate the other 0.21).
Each orange weighs 0.3 kilos and each banana weighs 0.2 kilos. You have a bag with handles that can support a maximum of 5 kilos. How many bags will you need to carry all the items safely.
And no using a calculator or any other microprocessor!!!
barrk
Jun 21st, 2001, 05:47 PM
Don't bother, Jethro, Chris, he is obviously vastly superior to us all. It must be wonderful to be him.:rolleyes:
stevess
Jun 21st, 2001, 05:47 PM
7
chrisjk
Jun 21st, 2001, 05:50 PM
Originally posted by stevess
7 Nope...3.
15 * 0.3 = 4.5
42.79 * 0.2 = 8.558
8.558 + 4.5 = 13.058
13.058/5 = 2.6116 (or 3)
chenko
Jun 21st, 2001, 05:53 PM
OK, Argument? Fill me in so far and i will join!! :D
chrisjk
Jun 21st, 2001, 05:55 PM
Originally posted by barrk
Don't bother, Jethro, Chris, he is obviously vastly superior to us all. It must be wonderful to be him.:rolleyes: Hey! Don't drag me into this...i was just providing an IQ test like the man asked!!
stevess
Jun 21st, 2001, 05:55 PM
That may very well be the wrong answer, I was just seeing how fast I could up with something.
barrk,
It's probably not worth the effort, but you have me pegged completely wrong.
I am not arrogant at all, as a matter of fact I am quite humble. My fault is that I challenge everything, I want to know the best way to do anything with the least amount of code.
People like you (and your cubehoney) and Jethro take offense whenever your code is questioned.
Having a debate, without getting angry, requires intelligence and complacency. If you think you are being wrongly critisized, then back it up with an intelligent answer, not an insult.
Jethro
Jun 21st, 2001, 05:56 PM
Originally posted by stevess
That may very well be the wrong answer, I was just seeing how fast I could up with something.
barrk,
It's probably not worth the effort, but you have me pegged completely wrong.
I am not arrogant at all.
:eek: Gee, the rest of us must be wrong then.
stevess
Jun 21st, 2001, 05:58 PM
Jethro,
Don't you think it is just a little arrogant to think that everyone else agrees with you?
barrk
Jun 21st, 2001, 06:06 PM
Having a debate, without getting angry, requires intelligence and complacency. If you think you are being wrongly critisized, then back it up with an intelligent answer, not an insult.
I have followed your responses to others in the various forums and refrained from voicing my opinion. You did not question me or criticize me personally but you have done so to many others. When you posted this thread in Chit-Chat, I decided to let you know how you were coming across to myself and other members of the forum.
You are the one who became defensive and angry. I was just pointing out to you that your attitude was offensive.
I have had many discussions with others in this forum and they have disagreed with me and I have disagreed with them. There is no rancor between us as a result of this. Yet there was immediate rancor between us. I think this may indicate that the fault lay partly in your court. Feel free to disagree with me but I am not compelled to agree with you.
Jethro
Jun 21st, 2001, 06:09 PM
Originally posted by stevess
Jethro,
Don't you think it is just a little arrogant to think that everyone else agrees with you?
Quite right, who disagrees? See noone....since when did he come back on site.
Chris
Nice work on the locking issue, worked brilliantly...thanks for that now have a headache and a working form;)
chrisjk
Jun 21st, 2001, 06:09 PM
somehow this has made 4 pagesNice work on the locking issue, worked brilliantly...Anytime ;)
stevess
Jun 21st, 2001, 06:15 PM
At the very least, I have started a hell of a thread.:p
chrisjk
Jun 21st, 2001, 06:21 PM
Originally posted by stevess
At the very least, I have started a hell of a thread.:p Apart from the post race I don't think i've ever seen a thread make 4 pages so quick.
barrk
Jun 21st, 2001, 06:25 PM
I think the nukem thread did......ummmmmmm I see a similarity here.:rolleyes:
chenko
Jun 21st, 2001, 06:29 PM
Katie, In his last statment, I notice he is saying that you are to stupid to argue/debate
Me and Mike got one closed the quickest :D
chrisjk
Jun 21st, 2001, 06:32 PM
I think the nukem thread did......ummmmmmm I see a similarity hereThat happened before I bothered with Chit Chat.
barrk
Jun 21st, 2001, 06:33 PM
Originally posted by chenko
Katie, In his last statment, I notice he is saying that you are to stupid to argue/debate
I understand that Simon...but since he really has nothing to base that statement on besides this one thread I figured he was showing which one of us was really the unintelligent one...:rolleyes:
stevess
Jun 21st, 2001, 06:54 PM
It's nice to see that you all know each other, no wonder I am getting hammered so bad.
Chenko/Simon,
That just shows your immaturity and/or ignorance.
Katie/barrk,
By agreeing, that shows your's too.
Most of you all act like a bunch of children.
SurfDemon
Jun 21st, 2001, 07:07 PM
Originally posted by stevess
Most of you all act like a bunch of children.
Phhhht! the way you say it you make it sound like a bad thing! :p
Chill out, have fun! Don't be so defensive!
P.S. I once spent a summer re-writing a system originally written by someone who thought that quick, short code was the best way to go. Believe me, in industry speed is nothing. Readability and Maintainability is everything.
SD
chrisjk
Jun 21st, 2001, 07:22 PM
Originally posted by stevess
It's nice to see that you all know each other, no wonder I am getting hammered so bad.I'm not going to ***** at you, but you should know that we are like a little community and if you pick on one of us, the rest will invariably join in.
The best thing to do is sit back, relax and just chill. If i've said something nasty I often regret it afterwards, so it's a good idea to chill before reacting, and that goes for all of you, not just steve.
SD: The No comment-kid was it? I know the type! ;)
Jethro
Jun 21st, 2001, 07:24 PM
Originally posted by stevess
Most of you all act like a bunch of children.
Nice to see your ego is under control Steve, and your point is!
stevess
Jun 21st, 2001, 07:24 PM
Readability and Maintainability have nothing to do with speed at all. Naming a variable x or lTestCount, has no bearing on speed. I am 100% for descriptive code.
stevess
Jun 21st, 2001, 07:31 PM
Jethro,
You are most childish and over-defensive yet. You are the epitome of "Don't tell me I'm wrong or I will hit you!"
Quote:
"The epitome of stupidity is not knowing how to say epitome"
Or perhaps, how to spell it. :D
chrisjk
Jun 21st, 2001, 07:50 PM
Good to see you took note of what I said steve:rolleyes:
Skitchen8
Jun 21st, 2001, 08:00 PM
hey... i can be childish and overly defensive too, don't leave me out!!
stevess
Jun 21st, 2001, 08:01 PM
Chris.
I am not a passivist, I will say things as I see them. I watched all the comments made before I finally chimed in.
I am not here to be "loved". I am a very secure person, I don't care if people like what I sat or not.
That should be:
...people like what I say or not.
Skitchen8
Jun 21st, 2001, 08:03 PM
good because i happen to hate what you sat...
chrisjk
Jun 21st, 2001, 08:08 PM
Your choice. But you will be driven outta town. People will start to ignore you/your questions/your advice then they'll be no point you saying anything, then those who orchestrated the campaign against you would have won.
I am far from the passivist (just look at some of my aurguments), but sometimes it is better to not get peoples' back's up.
SurfDemon
Jun 21st, 2001, 08:18 PM
Originally posted by stevess
Readability and Maintainability have nothing to do with speed at all. Naming a variable x or lTestCount, has no bearing on speed. I am 100% for descriptive code.
True, but I was actually refering to your comments about you liking to do things in the smallest amount of code.
So what would you pick as a good coding from the following two routines
sOutput = mid$(sOldString,instr(1,sOldString,".")+1)
or
iPosOfDot = instr(1,sOldString,".")
sOutput = mid$(sOldString, iPosOfDot + 1)
??
SD
stevess
Jun 21st, 2001, 08:21 PM
Yes but, the people that I am helping are not the people posting in this thread. EVERYONE that has posted a reply in this thread is far beyond needing help from anybody (apparantly), so it doesn't matter.
I have only been a member of this forum for a month or two, I have helped a lot of people, screw anyone that doesn't see that.
All of the "you are arrogant, don't talk to me" crowd can eat $#@%.
I am not a senior programmer, but I am definitely not a beginner either.
stevess
Jun 21st, 2001, 08:24 PM
SurfDemon,
I would pick #2 without hesitation.
I like "clean code", there would be no speed loss in using the second example.
SurfDemon
Jun 21st, 2001, 08:33 PM
I would pick #2 too. :D
#1 is fractionally more efficent, but not enough to make a difference.
I still think you should chill out. People aren't ganging up on you (well maybe a little), but it's probably because you do come across as being arrogant. Try wording things more gently, and try seeing the other persons point of view. Certainly, there is little to be gained by openly slagging (insulting) somebody elses code. Everyone here helps out everyone else. It's a good community, I'm sure you'll enjoy it alot more if you weren't so angry all the time. So relax, think happy thoughts and enjoy the forum.
SD
stevess
Jun 21st, 2001, 08:36 PM
SurfDemon,
Look at the original post in this thread, my point was that that code is extremely unreadable and non-descriptive. If you have seen any of my code posts, you will see that I Dim every variable on a separate line, and that they are generally representative of what they are for.
There is no no need to be cryptic in order to achieve the fastest code possible. (unless you're using VB3)
chrisjk
Jun 21st, 2001, 08:39 PM
Originally posted by stevess
EVERYONE that has posted a reply in this thread is far beyond needing help from anybody (apparantly)Who said that?!? I certainly didn't!
Well, whatever, I'm not going to argue the toss over it, suffice to say that people do read threads like this without actually participating.
I can't believe your "I am not here to be "loved". I am a very secure person, I don't care if people like what I sat or not" attitude gets you very far in life, but who am I to diss it.
stevess
Jun 21st, 2001, 08:41 PM
I am not angry, never have been. If you read my posts I think you will find that the negative comments here are unwarranted.
I challenge anyone to show where I have "insulted" or "slammed" someones code. I have only questioned it. I have never said "your code is crap" or anything similar.
chrisjk
Jun 21st, 2001, 08:44 PM
Originally posted by SurfDemon
So what would you pick as a good coding from the following two routinesI would go for No. 2, but it depends on the circumstance. For example something more complex provided I could work it out straight away, something like thisMyString = Left(MyString, Len(MyString) - 1)which simply removes the last character from a string.
stevess
Jun 21st, 2001, 08:49 PM
chris,
I can't believe your "I am not here to be "loved". I am a very secure person, I don't care if people like what I sat or not" attitude gets you very far in life, but who am I to diss it.
Ask any CEO, being confident and not afraid to say what's on your mind, will get get you farther than any other trait that you have.
In those weekly dept. meetings, never saying anything will get you nowhere. Speak your mind, within reason, and you'll get noticed (and remembered). Just think before you speak,
SurfDemon
Jun 21st, 2001, 08:51 PM
Originally posted by stevess
SurfDemon,
Look at the original post in this thread, my point was that that code is extremely unreadable and non-descriptive. If you have seen any of my code posts, you will see that I Dim every variable on a separate line, and that they are generally representative of what they are for.
There is no no need to be cryptic in order to achieve the fastest code possible. (unless you're using VB3)
mmmm, I found this one straight away :D
comp = instr(1, " " & text1 & " ", " abc ", vbBinaryCompare)
If comp <> 0 then msgbox "Match found"
If one of my developers wrote this I would have cut their beer ration...;)
But, I think this proves the point. I'm sure you normally write much neater code than this, but you're just quickly throwing something up on the website to show somebody how to do something. Well, thats what everyone else is doing, they don't expect or appreciate being insulted for it.
Oh, and I did come across a couple of comments from you which i certainly construed to be insulting other peoples answers.
Cheers,
SD
chrisjk
Jun 21st, 2001, 08:55 PM
Originally posted by stevess
Speak your mind, within reasonThat's the key! It's also the point I've been trying to make, "within reason"!
stevess
Jun 21st, 2001, 08:57 PM
If one of my developers wrote this I would have cut their beer ration...
Taken out of context, I see your point, but that was relevent to the question that was asked.
Oh, and I did come across a couple of comments from you which i certainly construed to be insulting other peoples answers.
Show me!
SurfDemon
Jun 21st, 2001, 08:58 PM
Originally posted by stevess
chris,
Ask any CEO, being confident and not afraid to say what's on your mind, will get get you farther than any other trait that you have.
Okay, I'm here. Sorry, but speaking your mind can be a good thing when tempered with reason and understanding. I would rather have a quiet team player anyday than someone who was outspoken. There is a line, which if you step over will instantly mark you as having a negative attitude.
True, I'd want to know if things were going wrong, but alot of people do this without being outspoken. In fact I have one very quiet guy working for me. If he complains about anything i fix it as I know it's REALY important if he's plucked up the courage to say anything. I have had one loud mouthed employee who moaned about everything instead of fixing things, I never paid any attention to him (the boy who cried wolf). he's gone.
Jethro
Jun 21st, 2001, 09:07 PM
Originally posted by stevess
Show me!
*ahem*
SurfDemon
Totally agree with your comments. Stevess has an attitude which he doesn't appear aware of.
Stevess
Yeah lets just blast everyone else's code, that way John wont have to worry about getting new servers in the future. No one will bother posting.
Get over the attitude.
stevess
Jun 21st, 2001, 09:09 PM
I never said I was "loud mouthed" or "talking crap without a solution". I said "within reason", if you can't get your point across calmly, then you should shut up. I am just as comfortable telling the CEO what I think as I am telling my immediate superior. It's all how you present your opinion.
As I have stated previously, I am not uptight, or loud, or overconfident, I just say what I think, I am opened to being shot down for any valid reason.
I just state my opinions, and my superiors want to hear those opinions, even if they disregard them as nonsense.
Good managers recognize the fact that their employees can, occasionally, have good ideas.
scoutt
Jun 21st, 2001, 09:14 PM
I want to play
what about this one where all you did was dis on Jehtro and his code and never shown any code of your own to help the poor guy out.
http://161.58.186.97/showthread.php?threadid=84230
and yes SD I was thinking of that one too.
stevess
Jun 21st, 2001, 09:22 PM
scoutt,
Is that the best you could come up with? Jethro was rude to Gaffer, and that influenced my response. But even still, I don't see how Jethro's code helped at all. HE was the first to critisize, not me. And then he reacted with insults because his precious code had been critisized.
He stated that he "knew" the poster and "knew" what he meant. Does that mean that the rest of us should "know" what the poster really means? I don't know who he is, I can only go by the question that was posted.
SurfDemon
Jun 21st, 2001, 09:22 PM
Thank you Scoutt & Jethro!
Now Stevess, don't take this the wrong way. But is there possibly any way that all of us can have got the wrong opinion of you? If we have, then I suggest that maybe you do try thinking before you start spouting off. Try to see things from the other persons point of view and be a bit more understanding.
That's just friendly advice, you can ignore it if you want obviously, I'm just trying to be helpful.
:)
SD
SurfDemon
Jun 21st, 2001, 09:23 PM
I was thinking of the post
By Stevess
Don't criticize what you can't even figure out on your own. This is pretty basic stuff, so why would we think that you were anywhere near prepared to start using classes.
SurfDemon
Jun 21st, 2001, 09:26 PM
and
I can't help but be completely amazed at the responses to this post. I am not criticizing anyones code, but...........
As far as I know, less code is better (usually, and I think it applies here).
HeSaidJoe,
I here ya', but you still have to TYPE every string you want to allow for. ??????????????? Why?
Simple is better as long as it works. End of story.
Over coding is a bad habit, look for simple solutions first.
SurfDemon
Jun 21st, 2001, 09:28 PM
and
What is this post supposed to mean?
SurfDemon
Jun 21st, 2001, 09:29 PM
and
Vlatco & Adamcox both supplied the same answer:
MsgBox a + b
and that will work, it's just bad code (Implicit Conversions)
SurfDemon
Jun 21st, 2001, 09:31 PM
and
You're looking for functions that will interpret your BAD code correctly. MS has been nicest enough to try and provide what you are looking for.
Speaking from experience, I (we) do NOT use even the simplest VB functions, such as FORMAT, we write our own.
Interesting theory about writing your own functions.....
SD
Jethro
Jun 21st, 2001, 09:31 PM
Originally posted by stevess
scoutt,
Is that the best you could come up with? Jethro was rude to Gaffer, and that influenced my response. But even still, I don't see how Jethro's code helped at all. HE was the first to critisize, not me. And then he reacted with insults because his precious code had been critisized.
He stated that he "knew" the poster and "knew" what he meant. Does that mean that the rest of us should "know" what the poster really means? I don't know who he is, I can only go by the question that was posted.
Gee, this is like stamping things in concrete.
1. I was not being rude to gaffa, (thinking you mean the avatar comment), he will return the comment with interest in due course.
2. Yes l know Kovan (on site, having exchanged many a posting tussle with the guy). He is or was doing a vb exam. And l did not state that l "knew" what he meant, merely pointed out that here's some code but probably more complex requirement.
3. If you can't see how the code would help, perhaps you ain't as good a coder as you seem to think you are.
The purpose of these forums is to ask questions and help others, not to put up with arrogant people like yourself.
SurfDemon
Jun 21st, 2001, 09:34 PM
and
Placing any code in a Property Get generally indicates a bad design
***?
stevess
Jun 21st, 2001, 09:39 PM
Now Stevess, don't take this the wrong way. But is there possibly any way that all of us can have got the wrong opinion of you?
Yes.
If you read those threads, I may have been a liitle coarse, but they were valid questions for what had been posted.
I think that most of the opinions here are based on what has been said here, not on what I have posted.
You are all just a big happy family.
I don't see any of the examples above as any thing that bad, unless the recipient was over sensative.
stevess
Jun 21st, 2001, 09:44 PM
Placing any code in a Property Get generally indicates a bad design
????????????????????????????????????????????????????????
Read the whole thread, what the heck is wrong with that?
Is that critisizing someone?
Generally speaking, if you have anything more than simple code in a Property Get, that's bad code. If you don't agree, then you don't what you are doing.
SurfDemon
Jun 21st, 2001, 09:44 PM
Originally posted by stevess
I don't see any of the examples above as any thing that bad, unless the recipient was over sensative.
Now thats were we differ. On the web it's easy for people to misconstrue what mood you are in (hence the smilies etc.). To me, all of these statements come across as incredibly arrogant, and I'm sure others think the same way. If you posted anything like that about any of my code I would be right in there with all guns blazing :)
If you see nothing wrong with them, then thats fair enough, keep posting as you're going, but pretty soon you will find that people have blocked you.....
Like I say, just some friendly advice.
SD
Jethro
Jun 21st, 2001, 09:46 PM
Originally posted by stevess
Yes.
If you read those threads, I may have been a liitle coarse, but they were valid questions for what had been posted.
I think that most of the opinions here are based on what has been said here, not on what I have posted.
You are all just a big happy family.
I don't see any of the examples above as any thing that bad, unless the recipient was over sensative. :eek: :eek: :eek:
Hey its nukem without the swearing
stevess
Jun 21st, 2001, 09:51 PM
Interesting theory about writing your own functions.....
Is this something you have never heard of??
Can you not grasp writing your own Format fuction?
If you can trust VB to do all your formatting then you must be working on a pretty simple app.
And...Yes...I am starting to get a little more "froggy".
SurfDemon
Jun 21st, 2001, 09:52 PM
Originally posted by stevess
????????????????????????????????????????????????????????
Read the whole thread, what the heck is wrong with that?
Is that critisizing someone?
Generally speaking, if you have anything more than simple code in a Property Get, that's bad code. If you don't agree, then you don't what you are doing.
You actually said no code.... that would make it pretty hard to use!
As for the quote in bold..... absolutely classic! I couldn't have proved you're arrogance better. I happen to agree that code should be kept to a minimum in properties, but I would never dream of being so arrogant as to acuse someone of "not knowing what they're doing":D
Tell me, you don't see anything wrong with that statement.
If you don't, then you are as thick as too short planks.
(That was me just rephrasing you're statement by the way:))
SD
denniswrenn
Jun 21st, 2001, 09:54 PM
Originally posted by Jethro
:eek: :eek: :eek:
Hey its nukem without the swearing
And the death-threats :eek:
It was actually quite funny when he said he was going to come down to Va. with his friends and beat me up... I wasn't worried 'cause I knew he didn't have any friends.....
I kinda miss picking on that little ****er... :D:D:D
SurfDemon
Jun 21st, 2001, 09:55 PM
Originally posted by stevess
Is this something you have never heard of??
Can you not grasp writing your own Format fuction?
If you can trust VB to do all your formatting then you must be working on a pretty simple app.
And...Yes...I am starting to get a little more "froggy".
And once he scores an own goal!!!!
You're sitting there insulting my programming skills and you have no idea what i can do :)
You're statement was that you always re-write functions and never use the VB one's. Again if you worked for me I would sack you for wasting time. Most of the VB functions work fine. Do you rewrite Instr or Split or Int.... if you don't then you're original statement is bollocks, if you do then you are in a sorry state!
SD
scoutt
Jun 21st, 2001, 09:59 PM
originally posted by stevess
scoutt,
Is that the best you could come up with? Jethro was rude to Gaffer, and that influenced my response.
Sorry the computer I am on is loading the forums really slow. I have found a bunch more. but it seems that SD has posted them faster then I.
I am sure Gaffa is a big boy and can take care of himself, beside he knows what playing around is as oppesed to you. mister seious all the time.
so you are going to sit here and argue with everybody and say that you don't have an attitude when everybody sees it? you are starting to act like DBC but you forget to say sorry and then turn around and call them names. we are here to learn and sometimes take a side route to a little laughter.
case in point, I posted a thread about a month ago and Jethro answered it with a pun form another thread we had discussed on and HB came and bitched out Jethro for saying that. I knew what was what and thought it actually funny. same goes with Gaffa, he knows and I'm sure will get back to Jethro.
I'm sorry dude but you take things too seroius and you do come off a little strong.
chrisjk
Jun 21st, 2001, 10:00 PM
...5 pages...
Jethro
Jun 21st, 2001, 10:08 PM
Dennis
Would also presuppose that he could find Virgina, after all he couldn't find his ass with both hands;) He had a nice graps of English though.
Scoutt
Got over the thing with HB, and he has promised to improve his act, as l promised to improve mine:rolleyes:
Stevess
Don't worry about gaffa, he will come back with all guns blazing in due course. It's called humour, which is clearly lacking in the South.
SD
Fast work on the threads, remind me never to get you off side:eek:
stevess
Jun 21st, 2001, 10:09 PM
Do you rewrite Instr or Split or Int...
InStr..yep, rewrote it. Check out Oracles InStr function, blows VB's away, so we wrote our own to match (and then some) Oracle's.
Split..It's new, we had our own before VB6 ever came out.
Int..Nope, it works OK.
If ou don't think VB's functions are limited, then you have never been challenged.
stevess
Jun 21st, 2001, 10:11 PM
I am from New York. I am just temporarily stuck in the damn South.
SurfDemon
Jun 21st, 2001, 10:18 PM
Originally posted by stevess
InStr..yep, rewrote it. Check out Oracles InStr function, blows VB's away, so we wrote our own to match (and then some) Oracle's.
Split..It's new, we had our own before VB6 ever came out.
Int..Nope, it works OK.
If ou don't think VB's functions are limited, then you have never been challenged.
I'm afraid, if you worked for me you would already be packing your stuff :) You're employers must love wasting their money on you.
And oh look, another arrogant statement :If ou don't think VB's functions are limited, then you have never been challenged.
Maybe we find it easier to overcome these "challenges" than you. You strike me as being fairly new to programming. Are you? Maybe we just know how to use VB properly? Some of the systems I have worked on would blow you away.
I started off being quite even handed, but I have to say Stevess I am losing patience with your unbelievable arrogance. Trust me. You come across really badly. You should stop making statements like
If you don't do X then you're stupid.
SD
scoutt
Jun 21st, 2001, 10:19 PM
Jethro, I know that, I was just using it as an example.
So Stevess you can write your own functions, well i wrote this bad-a$$ function that blows eveything out of the water but I can't tell you about it or show you the code.
Jethro
Jun 21st, 2001, 10:23 PM
Originally posted by stevess
Jethro,
You are most childish and over-defensive yet. You are the epitome of "Don't tell me I'm wrong or I will hit you!"
:o Gee, you could take your bat and ball and go home.
Very ironic, you are clearly externalising your own deep setted anger onto me. Now Steve, take a good long breath, "In with the good, out with the bad".
Am quite happy to admit when l am wrong, but that presupposes that the person proving it has at less a four year olds ability to read and comprehend what is being stated.
From your postings in various threads, l have to wonder if you need remedial comprehension lessons;)
SD
Are we playing good cop bad cop, or am l just in one of those moods.
SurfDemon
Jun 21st, 2001, 10:24 PM
Originally posted by Jethro
SD
Fast work on the threads, remind me never to get you off side:eek:
No worries of that mate. You have a sense of humour :D
SD
SurfDemon
Jun 21st, 2001, 10:25 PM
Originally posted by Jethro
SD
Are we playing good cop bad cop, or am l just in one of those moods.
We were, but I think it just changed to bad cop, bad cop.
:D
And no it isn't my turn to wear the handcuffs.
SD
SurfDemon
Jun 21st, 2001, 10:33 PM
Okay folks, gotta dash. The wife has just lured me away from the computer with alchohol!
See ya's tomorrow!
SD
Jethro
Jun 21st, 2001, 10:52 PM
Originally posted by SurfDemon
:D
And no it isn't my turn to wear the handcuffs.
SD
Damn, those things chaff. Ok as long as l get too wear the clean pair of underwear next week.
Have a couple for me.............still three hours to go before ripping corks:eek:
Beacon
Jun 22nd, 2001, 03:12 AM
*psssssst Jethro called steve a girl* pass it on.:eek:
Dont pick on SD he's got Blue tits out of his window man!:p
And i hear now this is just a rumour stevess picks his nose!:)
Gaffer
Jun 22nd, 2001, 04:03 AM
Originally posted by stevess
scoutt,
Is that the best you could come up with? Jethro was rude to Gaffer, and that influenced my response. But even still, I don't see how Jethro's code helped at all. HE was the first to critisize, not me. And then he reacted with insults because his precious code had been critisized.
He stated that he "knew" the poster and "knew" what he meant. Does that mean that the rest of us should "know" what the poster really means? I don't know who he is, I can only go by the question that was posted.
Takes different strokes guys, (as I remember a little dwarf and his white family say once) ;) you do take on a stifling air of superiority sometimes steve (I'm used to it because of where I work) and most people will generally find offence with it. I guess you'll have to get used to it if you can't change it.
As for Jethro, I think there may be a case of mistaken identity here - I noticed theres a vbworld member called Gaffa (possibly from Oz?). I'm in Landon Taaaan.
As for the insult? Love it. My avatar expects to receive taunts...
stevess_isatwat
Jun 22nd, 2001, 04:16 AM
I have had about enough of this - I was gonna post a joke to try and diffuse the situ', I was even gonna try and start a "code off" so you could put your money where your smelly mouth is, but I can't be arsed....I even took the time to register under a different name so that John wouldn't kick me off the forum for what i'm about to say, im not chicken (in fact im hard as nails !!!), but I like the forum, so SteveSS if you want some then lemme know and i'll be on the first flight out there to rip your scrawny angry little head off your scrawny neck you stupid little man!!!!!!
You clearly have a problem, everyone else gets on fine here (mostly ;) )
How can anyone else manage to be so obtuse and rile so many people with so few posts???
I suggest you shut the F*** up, and F*** off to whichever padded cell you came from and keep trying to open your sphincter with that pink crowbar of yours - you stupid ******.
There - happy now :)
chenko
Jun 22nd, 2001, 04:23 AM
Originally posted by stevess
It's nice to see that you all know each other, no wonder I am getting hammered so bad.
Chenko/Simon,
That just shows your immaturity and/or ignorance.
Katie/barrk,
By agreeing, that shows your's too.
Most of you all act like a bunch of children.
Call me CHENKO you butt fu*k !!!:mad:
And yes, I am ignorant, but only towards people like you, we have seen people like you before here....and we just dont like it
Children? I think most of us are probaly older than you and have more right to make that comment, take nukem996 (http://www.vbforums.com/member.php?s=&action=getinfo&userid=13393) for example...look at his status...I think if you carry on like this you will be just like him...
Is your aim here to make everyone hate you to get attention?
chenko
Jun 22nd, 2001, 04:29 AM
"stevess_isatwat" WWOOOOOOOO HHHHHHHOOOOOOOOOo:D
stevess
Jun 22nd, 2001, 06:08 AM
For scoutt,
I just wrote this since the code I was referring to is at work, which is where I have to go now.
Public Function InStr2(sString As String, sSearch As String, Optional lStart As Long = 1, Optional bReverse As Boolean = False, Optional lOccurrence As Long = 1, Optional bMatchCase As Boolean = False) As Long
Dim lPos As Long
Dim lCntr As Long
Dim lLength As Long
Dim lSearchLen As Long
Dim sTemp As String
Dim lNum As Long
lLength = Len(Trim$(sString))
lSearchLen = Len(Trim$(sSearch))
If (lLength = 0) Or (lSearchLen = 0) Or (lSearchLen > lLength) Then
InStr2 = 0
Exit Function
End If
If Not bMatchCase Then
sString = UCase$(sString)
sSearch = UCase$(sSearch)
End If
If lSearchLen = 1 Then
If bReverse Then
For lCntr = lLength To 1 Step -1
sTemp = Mid$(sString, lCntr, 1)
If sTemp = sSearch Then
lPos = lLength - (lCntr - 1)
lNum = lNum + 1
If lNum = lOccurrence Then Exit For
End If
Next lCntr
Else
For lCntr = 1 To lLength
sTemp = Mid$(sString, lCntr, 1)
If sTemp = sSearch Then
lPos = lCntr
lNum = lNum + 1
If lNum = lOccurrence Then Exit For
End If
Next lCntr
End If
Else
If bReverse Then
For lCntr = lLength To 1 Step -1
sTemp = Mid$(sString, lCntr, lSearchLen)
If sTemp = sSearch Then
lPos = lLength - (lCntr - 1)
lNum = lNum + 1
If lNum = lOccurrence Then
Exit For
Else
lCntr = lCntr - lSearchLen
End If
End If
Next lCntr
Else
For lCntr = 1 To lLength
sTemp = Mid$(sString, lCntr, lSearchLen)
If sTemp = sSearch Then
lPos = lCntr
lNum = lNum + 1
If lNum = lOccurrence Then
Exit For
Else
lCntr = lCntr + lSearchLen
End If
End If
Next lCntr
End If
End If
If lNum = lOccurrence Then
InStr2 = lPos
Else
InStr2 = 0
End If
End Function
Simon, I'm 36
chenko
Jun 22nd, 2001, 06:20 AM
Originally posted by stevess
Simon, I'm 36
Appologies, Just act like it then
and ****ING call me chenko!!
stevess
Jun 22nd, 2001, 07:12 AM
Sorry, Chenko.
parksie
Jun 22nd, 2001, 08:33 AM
typedef basic_string<TCHAR> tstring;
tstring _SPRINTF(const TCHAR *pcFormat, ...) {
va_list args;
TCHAR pcBuf[1025];
va_start(args, pcFormat);
_vsntprintf(pcBuf, 1024, pcFormat, args);
va_end(args);
pcBuf[1024] = 0; // Just make sure
return pcBuf;
}
parksie
Jun 22nd, 2001, 08:35 AM
Oops...I missed a .c_str() in the MessageBox code.
stevess
Jun 22nd, 2001, 12:49 PM
SD,
I wrote this in 20 minutes while I was having my morning coffee
this morning. It was just meant to be an example of how InStr could be improved, and it can be improved.
The actual code we used is not mine to give away.
SurfDemon
Jun 22nd, 2001, 12:56 PM
:D
Well doesn't that just prove my earlier point?
You quickly run off code and it's sloppy.
But, as soon as someone else posts sloppy code you leap down their throat. Now, admit it, you didn't like it when I ripped your code apart. So why would you do that to anyone else. It's not a nice thing to do.
I apologise if my comments about your code upset you. I was just trying to make a point (Hell, I've posted some pretty poor code on this site loads of time).
SD
chrisjk
Jun 22nd, 2001, 02:14 PM
Look at the way this whole thing that you started has blown up, Katie!!
It's all YOUR fault!! muwahahahah :D
Skitchen8
Jun 22nd, 2001, 03:39 PM
stop arguin.... its my bday and your making it bad :(
scoutt
Jun 22nd, 2001, 03:55 PM
well crippy, happy b-day Skitchen8 :D
ok everybody stop ragging on stevess so Skitchen8 can have a good b-day.
Skitchen8
Jun 22nd, 2001, 03:57 PM
Thank You finally some peace on the thread... anyways i gotta go to my sis's graduation ceremony soon so ill talk to y'all later
stevess
Jun 22nd, 2001, 03:58 PM
SD,
It doesn't bother me at all to have my code criticized. I will learn from it. I have fixed most of the things you pointed out, but I have a question. You said,
Now, you're looping through the strings instead of using instr ..... wow, this is so inneficient.
InStr is just a built in function, I would think it must do somthing similar, but I don't know.
I tested this, x = InStr2(sTestStr, "A", lOccurrence:=285000) on a 300,000 character string, and it is almost instant.
stevess
Jun 22nd, 2001, 04:05 PM
Actually, I just tested it on a 3 million character string and it is a lot slower than InStr.
But if I want to find the 5000th occurrence of "X", how can I make it faster?
Latest version:
Public Function InStr2(ByVal sString As String, ByVal sSearch As String, Optional ByVal lStart As Long = 1, Optional ByVal lOccurrence As Long = 1, Optional ByVal bMatchCase As Boolean = False) As Long
'If sSearch is negative, the search will occur from right to left
'and will return the position from the right that the search string starts
Dim lPos As Long
Dim lCntr As Long
Dim lLength As Long
Dim lSearchLen As Long
Dim sTemp As String
Dim lNum As Long
Dim bReverse As Boolean
lLength = Len(sString)
lSearchLen = Len(sSearch)
bReverse = lStart < 0
lStart = Abs(lStart)
If (lLength = 0) Or (lSearchLen = 0) Or (lSearchLen > lLength) Then
InStr2 = 0
Exit Function
End If
If Not bMatchCase Then
sString = UCase$(sString)
sSearch = UCase$(sSearch)
End If
If bReverse Then
For lCntr = lLength To 1 Step -1
sTemp = Mid$(sString, lCntr, lSearchLen)
If sTemp = sSearch Then
lPos = lLength - (lCntr - 1)
lNum = lNum + 1
If lNum = lOccurrence Then Exit For
End If
Next lCntr
Else
For lCntr = 1 To lLength
sTemp = Mid$(sString, lCntr, lSearchLen)
If sTemp = sSearch Then
lPos = lCntr
lNum = lNum + 1
If lNum = lOccurrence Then Exit For
End If
Next lCntr
End If
If lNum = lOccurrence Then
InStr2 = lPos
Else
InStr2 = 0
End If
End Function
SurfDemon
Jun 22nd, 2001, 06:49 PM
Happy Birthday Skitchen8.
Okay, let's just agree that it's not nice to slag off other peoples answers and I'll be happy.:D
I don't have VB on this machine, but this should give what you want for the forward search. Use InstrRev for the backwards search.
The If.. Then statement in the middle isn't really needed as the loop will end eventually, but it might provide a speed increase if you are unsure if there are that many occurences of the search string.
lPos=0
For lCntr = 1 To lOccurence
lPos = instr(lPos+1,sString, sSearch)
If lPos=0 then
Exit For
End If
Next lCntr
I hope this helps,
SD
stevess
Jun 22nd, 2001, 07:14 PM
So simple, yet so effective.
When did InStrRev pop up? I can't believe I have never even heard of it.
Thanks, and I'll try to play nice from now on.
SurfDemon
Jun 22nd, 2001, 07:18 PM
Cool. Peace man.
InstrRev came in with VB 6.0 and all the other split functions and the like.
Have fun :D
SD
Jimmy Changas
Jun 22nd, 2001, 09:57 PM
Stevess you said "I dont know what this code does" right..
well, look at the comments that the person who wrote the code before had typed
"This function accepts as inputs the number of input symbols, an
array where the input symbols are stored and an output array
where the resulting output symbols are stored."
does that answer your question? :p
stevess
Jun 23rd, 2001, 05:22 AM
Actually, that has very little to do with what it does. Honestly, if I tried, even a little, to figure it out I could probably grasp it. My whole point was that it pretty much worked as supllied so I never took the time. It was just a small piece of a large project and I knew that I would probably never use it again.
If someone had just given me the algorithms and said "This is how it works on paper, translate it into code.", I would have been forced to learn exactly what it was doing.
There is a lot more to generating these bar codes, the rest of it I pretty coded myself using a Guide supplied by Australia Post.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.