Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Can you be a little more specific as to the nature of your problem?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

We "bashed" viewpoints, and never each other

As it should be. I wish this applied to the real world on a broader scale (we all know who I am talking about).

I would hope that's the way Jim took it too

Absolutely. Dani is a respected friend and I always appreciate her viewpoint whether I agree or disagree with it. And I have been convinced to change my mind from time to time. That's the great thing about informed opinions.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I asked someone who is an acknowledged expert (not just by me). He agreed with the generated answer. If I had instead written him that advice, letting him believe it was mine, he would have given the same response. In other words, it was most definitely not simply AI generated garbage.

If I asked ChatGPT and my doctor what to do for a particular pain and they both replied with "Take two Aspirin, get a good night's sleep, and call me in the morning if it still hurts", would you consider the advice from your doctor to be garbage simply because the AI gave the same response?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

see if you can convert it to a WHERE clause

I made a foolish assumption that the HAVING was something that depended on the GROUPing and thus could not be converted to a WHERE.

As for my expert, I also assumed that if he could have been more specific he would have been. That would have required more info on your specific situation. May I suggest that next time, you post your query? Changing the HAVING to a WHERE might have been obvious on seeing it.

Dani commented: It did depend on GROUP. I spent hours and hours rewriting the query to be able to remove it. +34
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If I had taken the ChatGPT reply, reworded, then posted it, would that have been OK? Or would that be plagiarism? What if I posted my reworded version AND credited it as a rewording of a ChatGPT generated answer? Then that just makes me look like an idiot.

Where is the line?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Clearly you missed the part where my friend said, it's the same answer he would have given. In other words, the answer generated by ChatGPT was vetted by an expert.

I do not understand your response in this case. If I were to post a code project here, and that project happened to contain a ChatGPT generated function, would that be a no-no in your books?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I have a friend who spent the better part of a career doing SQL. I wrote up your question and sent it off to him. Just for sh!ts and giggles, he decided to feed it to ChatGPT first. He said that what he got back was what he would have written if he spent a lot of time researching. Here is what ChatGPT said...

Yes, you're correct that efficient indexing plays a crucial role in optimizing the SELECT/WHERE part of the query. However, when it comes to improving the efficiency of the HAVING part, there are several strategies you can employ:

Indexing: Just like with the WHERE clause, appropriate indexing can improve the efficiency of the HAVING clause. If the columns used in the HAVING clause are frequently filtered on, consider creating indexes on those columns. However, be cautious with indexing as it comes with overhead and can affect write performance.

Optimize the Query: Ensure that your query is optimized and written in a way that allows the database engine to execute it efficiently. Avoid unnecessary joins, subqueries, or complex expressions in the HAVING clause that can slow down the query processing.

Aggregate Functions: If possible, try to use more efficient aggregate functions in your HAVING clause. Some aggregate functions might be more computationally expensive than others. For example, SUM() might be more efficient than COUNT() in certain scenarios.

Limit the Result Set: Reduce the number of rows processed by the HAVING clause by applying more selective conditions in …

Dani commented: Keep It Clear: Do not post spun or AI-generated content -8
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'm not very familiar with HAVING but my understanding is that it is used to filter results after a GROUP operation so I can't imagine that indexes would improve performance other than on the original SELECT. Using WHERE would return rows based on one or more criteria, and would benefit from indexing, but HAVING, as I understand, is performed after the selection and grouping.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I realize that moderating Facebook posts is an exponentially greater task than moderating Daniweb, but if Facebook is not doing its job now, what happens once the election cycle heats up and untold thousands of AI posts created by bots start flooding the ecosphere?

rproffitt commented: I recently read the electrical grid isn't capable of supplying AI's needs. We all know how the M5 fixed that problem. Star Trek reference. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I wonder how this will apply to individuals who use AI to generate, then post content? It's even more problematic in the US. Take this scenario...

If I have a party in my house, and while at that party, some people use the opportunity to sell illegal drugs, I can be charged since the illegal activity is taking place in my house.

Likewise, if a newspaper publishes lies, even those made by freelance journalists or people submitting letters to the editor, as long as that material is published in the newspaprer, the publisher can be held liabel.

But a special exemption was made in the 1990s (under Bill Clinton) which exempted internet hosted agencies. Under that exemption, Facebook, Twitter, etc. are not responsible for libelous content.

Here at Daniweb we moderate posts and remove those posts which are blatantly false, or even in some cases not false but overly nasty in tone. We do this to maintain a certain standard but apparently there is no legal requirement to do so.

rproffitt commented: I had an issue with squatters selling drugs. Had to lawyer up, city police didn't take any action until I finished my court actions. +17
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Your response to my last post.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I recall reading, "If the text is unusually coherent or consistent, it might raise suspicion."

I'm afraid that does not speak well of our educational system. And it's not very useful in trying to automate detection.

As a side note, I read recently about some researchers using a "needle in a haystack" test on an AI. They buried an anomalous question about pizza in with a bunch of physics questions. The AI pointed out the anomaly along with the question, "Was this inserted to test me?"

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Hi, and welcome to Daniweb.

dennyfontaine commented: Thank you +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Welcome to Daniweb

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

SEO hasn't been about gaming the system for nearly 15 years now

Then you may find this interesting. Also this.

rproffitt commented: I'll ask ChatGPT instead. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Does that mean, "how to use AI to game the system"?

rproffitt commented: Or AI games you? +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Hello, and welcome to Daniweb.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I can't offer any suggestions other than to just download the compiled app for your system instead of building it yourself.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Wouldn't that be a more appropriate question for google?

I suppose that would depend on what kind of "things". We could send you to USPS, U-Haul, Fed-Ex, etc.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Assuming this is python you have to ensure the backslashes are not read as escape characters. Try

image = cv2.imread(r'C:\Users\Audun Nilsen\Pictures\pica.webp')

Using r' in front of a string indicates a raw string and the backslashes will not be interpreted as special unless the backslash is the final character in the string. You could also use

image = cv2.imread(C:\\Users\\Audun Nilsen\\Pictures\\pica.webp')

but I prefer the raw string format.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Welcome to aniweb. Please take a few moments to read the Daniweb Posting Rules and Suggestions For Posting Questions.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

As a first language I highly recommend Python. It is free and comes with a simple IDE (idle). For something more robust you can use Microsoft vscode (also free) as the Python IDE. Python has a very friendly syntax and there are a large number of free online tutorials. And you can post questions here for things that are unclear. I've programmed in a large number of languages over many years and I now program exclusively in Python. It give me fast turnaround and is also fun.

If you learn better from books I suggest Magnus Lie Hetland - Beginning Python_ From Novice to Professional. It's slightly out of date but is an excellent resource.

Keep in mind that learning to program is not just about learning a language. It is also about learning how to design software. You can't learn how to build a house by merely learning how to use all the tools.

lam_189 commented: Thanks,sir. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Welcome to Daniweb

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Why not just load it into paint.exe then save as whatever format you want? Or you could download ffmpeg (free) and do

ffmpeg -i myfile.ico myfile.jpg (or whatever format you want)

ffmpeg can also be used to convert video between any formats. Also subtitle files.

ffmpeg is a portable app (no installation required) but is more convenient if you add the bin folder where you unzip it to your system PATH environment variable.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I always recommend ditching VB6. It is super old technology. If you were using Python 2.x I would also advise moving to Python 3.x for the same reason. If you stick with the old you will be left behind. If I were a potential employer I would not hire anyone who only worked in old tech except for the very rare case when it is required to maintain legacy code like COBOL. It would not surprise me in the least if upcoming versions of Windows would not even run VB6 programs.

cambalinho commented: now i get.. thanks for all +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Glad you were able to work it out. Why are you still using VB6?

cambalinho commented: why you are, always, tell me that? i have installed the VS2022, but it's very slow... even for create and run a project... for now i still with VS98.. +7
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Normally I would have just deleted this as spam but I thought it was worth leaving in to make a couple of comments.

Firstly, it is not an academic lifesaver. The purpose of a term paper is to teach you how to do research and to help you learn the research topic. It does not meet your requirements because you don't learn anything.

Secondly, because you paid someone to do the work for you you haven't earned anything.

If paying someone else to do it for you was effective then I would expect to get thin by paying someone to diet for me, or get fit by paying someone to exercise for me. I'd also like to learn to play the piano. Could I do that by slipping someone a few dollars to do the work?

If you actually believe what you posted then your teachers have utterly failed in teaching you how to think. Perhaps they earned their degrees the same way you are trying to.

I would be remiss if I did not also point out that by passing someone else's work off as your own you are committing plagiarism. Any reputable school would expel you for that. Good luck in the real world.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Remove the trailing ) and it should work.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try

import re

pat = '<td>(.+?)</td>'

for line in open('yourfile.html'):
    if line.startswith('<tr align="right"><td>'):
        print(re.findall(pat,line))

I realized that findall is cleaner than split. You might want to have a look at this regex online tool

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
You can either read the entire file into a list, then filter that list, or you could process it line by line and process each matching line. For example (using my file)

for line in open('usblog.txt'):
if '2024-01-24' in line:
    print(line)

or

text = open('usblog.txt').readlines()
for line in [x for x in text if '2024-01-24' in x]:
    print(line)

if

<tr align="right">

only appears in the lines you want then filter on that.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Just process the file line by line and apply the regular expression to particular lines. I can't give you an expression that matches only the lines you showed me with a guarantee that in matches nothing else without seeing the entire file.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The trick is to use lazy matching which matches the shortest possible string.

html = '<tr align="right"><td>236</td><td>Roy</td><td>Allyson</td>'
pat = '<td>(.+?)</td>'

then

re.split(pat,html)

returns

['<tr align="right">', '236', '', 'Roy', '', 'Allyson', '']

and

re.split(pat,html)[1::2]

returns

['236', 'Roy', 'Allyson']
Tom_45 commented: Hey Jim, thanks for the advice. I did finally get the results I was looking for using the pattern '<td>(\d+)+<\/td><td>(\w+)<\/td><td>(\w+)'. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

For

html = '<tr align="right"><td>236</td><td>Roy</td><td>Allyson</td>'
pat = '<td>(.+?)</td>'

then

re.split(pat,html)

returns

['<tr align="right">', '236', '', 'Roy', '', 'Allyson', '']

and

 re.split(pat,html)[1::2]

will return only

['236', 'Roy', 'Allyson']

The expression .+? does a lazy match (returns the shortest possible string that matches the pattern.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I frequently had to deal with Engineers who felt they could both design software and write it. I only once met an engineer who could do both competently. She got her degree in computer engineering and started in my group as a junior member. She rose quickly through the ranks and even became my boss for a couple of years (my happiest at work) before going on maternity leave. The other engineers failed miserably at both design and coding.

I think anyone who aspires to software design should be forced to spend at least one year doing software maintenance. You learn a lot about what not to do by having to work with someone else's bad decisions.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

and find your choice of plumbing perhaps apt

Before I retired, if someone asked what I did I usually replied, "digital plumber". It was not my full job but it described the major duties much better than just "programmer".

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Welcome to Daniweb. Please take a moment to read the Daniweb Posting Rules and Suggestions For Posting Questions.

digitalfolks commented: Sure I Will Read and follow all your rules +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'm saying that the design team should get input from the coders who will have to implement/maintain and software system. A designer might not put hooks into the code for logging that can be enabled and disabled as required for troubleshooting. When I designed infrastructure I put in many hooks of this type. In a production system they would usually run disabled, but by setting a few global flags a lot of very useful information would be instantly available to the person (usually me) who would be called in at three in the morning to fix a problem.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I think it is a good idea for the design team to get input from the coders. Let me give you a non-programming example. My brother was a civil engineer in charge of the maintenance of the province's water treatment plants. When the design for a new plant came to his desk he showed it to the people who would be doing the actual hands-on maintenance. Their major input was that some of the pipe runs were continuous. That meant there were no junctions that could be disassembled to clean the insides of the pipes. They would have had to cut the pipes after installation and install access points to allow for cleaning.

Design people often don't have maintenance as a priority.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

So back to you, how do you deal with choosing such standards?

I code under the assumption that the person who will be maintaining my code is a psychopath who knows where I live.

cored0mp commented: I answered you below! +1
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I loved that one when it first came out. And, yes, that is indeed FORTRAN. The system also came with a preprocessor called SFORX which added structured statements ($IF-$ELSE, $WHILE, etc.) but for some reason it was not used in this case. Just for fun I eventually rewrote the above with no GOTOs to prove to a co-worker that it could be done.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

As an example, here is some code we got from a vendor. It is rock-solid. It does what it is supposed to but it is virtually unmaintainable. I can't begin to imagine how it was ever debugged.

      SUBROUTINE READALL(UNIT,BUFF,*,*,IFIRST)
C*TTL READALL READ FROM ANYTHING

C     THIS SUBROUTINE IS USED FOR READING COMPRESSED OR UNCOMPRESSED
C     DATA INPUT FILES FROM LFC 'UNIT' INTO 80 BYTE ARRAYY BUFF.
C     END RETURNS TO FIRST RETURN, ERROR RTETURNS TO SECOND
C     IFIRST IS LOGICAL WHICH CALLER PROVIDES TRUE ON
C     FIRST READ OFF OF THIS ALLOCATION OF THIS LFC, ELSE FALSE
C*PGMXX READALL  SAVD TOOLS    FS$READA ON 07/23/80 17:43:51 01819B00R01
      LOGICAL IFIRST
      INTEGER*1 BUFF(80)
      INTEGER*4 UNIT
      INTEGER*1 BYTE(120,2)

      INTEGER*1 IN(2)/2*0/,ISP(2)/2*0/,ITX(2)/2*0/,NB(2)/2*0/
      INTEGER*1 NBT(2)/2*1/
      INTEGER*1 KCR/ZBF/,KLR/Z9F/
      INTEGER*1 EOR/ZFF/
      INTEGER*2 NSEQ(2)/2*0/,ITY(6),ISEQ(60,2),ICKS(60,2)
      INTEGER*4 LFC(2)/2*0/
      INTEGER*4 K,N,IERR,IN0,ISP0,ITX0,NB0,IS,I,ISUM,J

      EQUIVALENCE (BYTE(3,1),ICKS(1,1)),(BYTE(5,1),ISEQ(1,1))

      IF(.NOT.IFIRST) GO TO 21
      DO 19 K=1,2
      IN(K) = 0
      ISP(K) = 0
      ITX(K) = 0
      NB(K) = 0
      NBT(K) = 1
      NSEQ(K) = 0
      LFC(K) = 0
19    CONTINUE
21    CONTINUE
      DO 101 N=1,2
      IF (UNIT.EQ.LFC(N)) GO TO 103
      IF (LFC(N).EQ.0) GO TO 102
101   CONTINUE
      GO TO 94
102   LFC(N) = UNIT
      CALL W:PDEV(UNIT,ITY)
      NBT(N) = 1
      IF (ITY(3).GE.4.AND.ITY(3).LE.6) NBT(N)=2
103   IERR = 0
      IN0 = IN(N)
      ISP0 = ISP(N)
      ITX0 = ITX(N)
      NB0 = NB(N)
1     IF (IN0.NE.0) GO TO 8
2     CALL BUFFERIN(UNIT,0,BYTE(1,N),30)
      CALL M:WAIT(UNIT)
      CALL STATUS(UNIT,IS,NB0)
      IF (IS-3) 3,80,90
3     IF (BYTE(1,N).EQ.KCR.OR.BYTE(1,N).EQ.KLR) GO TO 6
      NB0 = NB0*NBT(N)
      DO 4 I=1,NB0
      IF (BYTE(I,N).EQ.10.OR.BYTE(I,N).EQ.13) BYTE(I,N) = 1R
4     BUFF(I) = BYTE(I,N)
      IF (NB0.GE.80) GO TO …
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Are you differentiating between design and programming? Some professionals get stuck in their heads. For example, too many surgeons feel that surgery is the first option. My job as a professional programmer was not primarily to write code. My job was to provide solutions to problems. Ideally that meant writing as little code as possible. If coding is required then it should be as clean and as clear as possible. Above all it must be maintainable, and not just by you.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Welcome to Daniweb.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Welcome to Daniweb.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

So with non-organic "you're pretty much on a hamster wheel constantly having to fund the beast". But with organic, "it's important to keep on top of it, and continue to invest in your strategy/strategies over time."

Sounds like a lot of work either way.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Can someone please explain the difference between "Increase website traffic" and "Increase website traffic organically"? What, exactly, does organically mean?

rproffitt commented: At risk of censure, maybe it's something a sniff test would reveal? +17
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You might try spin-rite

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I have found that the maintainability of an app has a lot more to do with the quality of the developer than the language choice, given that you are choosing a mainstream language.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Any particular reason why you are also posting as keziashan?