• Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Are you coding from home during this pandemic?

    The same? When we left Winnipeg at the end of May Manitoba was down to 4 active cases. Now we are at 235. Almost makes me want to stay at …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Need quick regex help with matching the same word twice

    the back reference is done with `\#` where you indicate (1-9) the desired group. You create the pattern for what you want to match by enclosing it in parentheses. In …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Need quick regex help with matching the same word twice

    Phew!
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Need quick regex help with matching the same word twice

    OK. Try this (\$[a-zA-Z_][a-zA-Z_0-9]*)(?=.*\1[^a-zA-Z_0-9]) (\$[a-zA-Z_][a-zA-Z_0-9]*) a php variable (grouped) (?=.*\1[^a-zA-Z_0-9]) a look-ahead expression The second part says "look ahead for the matched php variable as long as it isn't part …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Need quick regex help with matching the same word twice

    If you are scanning your code with a python script you could use (\$[a-zA-Z_][a-zA-Z_0-9]*) to match all of the php variables in a line, extract them into a dict and …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Need quick regex help with matching the same word twice

    This expression will find all of the php variables in a line (\$[a-zA-Z_][a-zA-Z_0-9]*) \$ The initial literal $ [a-zA-Z_] A lower/upper case letter or underscore [a-zA-Z_0-9]* 0 or more lower/upper …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Need quick regex help with matching the same word twice

    I posted a suggestion but after I got the exact definition of a php variable and fired up my regexptester it didn't pan out. I'll play with it and hopefully …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Searching files for a file format

    You might try [Everything Indexer](https://www.voidtools.com/support/everything/) by VoidTools. It's free and awesome.
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Memorable Quotations

    “One may protest against evil; it can be exposed and, if need be, prevented by use of force. Evil always carries within itself the germ of its own subversion in …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in convert cpp code to python

    A good first step would be to tell us what the code is supposed to do. A good second step would be to tell us how familiar you are with …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in How to fill the null values in python with the below condition?

    In your example for record 3 you want (1550+1540+1542) // 3, but what would you do if record 4 was also NULL? Assuming no consecutive NULLS you can do import …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Downtime today :(

    I'm on a Rogers Rocket Hub. It connects to the local cell tower. I pay a base rate for 3 gig and extra if I go over. My usage at …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Downtime today :(

    PS I hope you are still safe and healthy.
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Downtime today :(

    Not a problem for me. My problem is that everyone seems to assume we all have unlimited usage so the sites I go to regularly (weather, covid-19 updates, etc) like …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Iterate over a list of tuple.

    Here's a hint. You will be using the modulus operator (`%`) as well as integer divide (`//`). The general solution will not require loops or if statements.
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Iterate over a list of tuple.

    What have you tried so far? What you have to keep in mind is that if the number of months you are subtracting is greater than the number of months …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Check Python Interpreter Version

    Not familiar with java but your thread title says python so at the command line just type `python` and the version will be displayed before the prompt. I'm curious as …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in How have you been keeping busy during COVID19?

    Manitoba is down to 16 active cases so things are loosening up. And the Thunder Bay area has only 2 active cases, so we packed up and headed to our …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Gave Reputation to amazingadmin in Python question.

    You can refer to the programs offered by this website. [rawpython](https://rawpython.com/)
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Covid-19 Virus and N95

    >Yes, they did publish a new one. Doh! I just noticed that the dates were out of order. Still blurry though.
  • Member Avatar for Reverend Jim
    Reverend Jim

    Edited How to Start My Own Hosting Company and Domain Register

    Hey guys… Does anyone know the cheapest yet the best way to start offering hosting on one of my websites. I also want to start allowing people to register domains …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Covid-19 Virus and N95

    On a related note (not intended to derail this thread), a while back the US government gutted consumer protection laws. It used to be that financial planners were legally required …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Covid-19 Virus and N95

    >Do you really believe that a one-time cure for HIV does exist, but instead they are selling something that just keeps AIDS at bay? Just curious :) I'm not saying …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Covid-19 Virus and N95

    Just a thought... A number of big-pharma companies are currently working on a vaccine. Knowing how much that industry values profits over all else, what do you suppose is their …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Gave Reputation to rproffitt in hi,I'm trying write a AI calculator program on Python

    @kmdecoration. A few things. 1. Avoid hijacking other folk's discussions. 2. Check your links to see if they work and looking closer it looks spammy. Don't do that either. As …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in hi,I'm trying write a AI calculator program on Python

    I know what AI is, and I know what a calculator is. But I'm at a loss as to what an AI calculator is unless it's a voice actuated calculator …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Covid-19 Virus and N95

    As I recall, that image was from the beginning of the outbreak in the US when Faux News was screaming that since nobody there had died yet it was a …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Covid-19 Virus and N95

    That image is a tad blurry but I couldn't figure out what it was saying. Incidentally, Georgia has been caught three times fudging their data. And it seems Florida keeps …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Covid-19 Virus and N95

    In other breaking news, Georgia governor Kemp says that it is now safe to go to restaurants or get a haircut, but the risk of spreading Covid-19 is far too …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Covid-19 Virus and N95

    The entire media has been going bat-shit over Trump's claim that he is taking hydroxychloroquine. There is no proof that he actually is, and ample reasons to believe he isn't. …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Covid-19 Virus and N95

    For the record, the US ranks a poor 38th when it comes to testing.
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Covid-19 Virus and N95

    Breaking news. Trump now says that having so many Covid-19 cases (and I suppose Covid-19 deaths) is a good thing because it means they are doing more testing. So... Winning?
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Hello everyone. My name is Igor..

    Welcome to Daniweb. Quick movie reference - is it pronounced ee-gore, or eye-gore? Bonus points if you get the movie.
  • Member Avatar for Reverend Jim
    Reverend Jim

    Gave Reputation to rproffitt in C# Windows Form issue

    You noted that this is in "c" and to get a mouse, graphics and connecting the mouse click on such will be highly dependent on the libraries and IDE used. …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Revoked Solved Status for colliderect pygame

    this is a small part of my code where i created the collision but the issue is that it still doesnt work i have used also the distance formula to …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in colliderect pygame

    Glad I could help.
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in How to set SSD (External/Usb) as Boot Drive?

    If you are looking for a Windows bootable system that you can customize you can try [bart's PE builder](https://barts-pe-builder.en.softonic.com/). If you just want a bootable Windows PE system to access …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in colliderect pygame

    >from Settings import * thats is what i was asking about to create a different file and import it in a different file. I've never gotten into the finer points …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in colliderect pygame

    I don't understand. File, menu, and introduction are (up to) three distinct things. If you just want a text based introduction you could always put it in a python module …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in Hi everyone, I'm Yuanpeng

    I am old. Welcome to Daniweb.
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in colliderect pygame

    >the code u showed me only calcualates distance but collision doesn't happen It returns True if the objects are closer than 27 units apart. I presume your object positions are …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in colliderect pygame

    I'd add a print statment to see exactly what is happening. If you are using a debugger with breakpoints then also add one at the start of your `dead` function. …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Edited How to develop games with Random Number Generator

    First things first, it might be an excellent decision to start with basics and shed light on the essentials of random number generators (RNGs) and their capacities. For those interested …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in How to set SSD (External/Usb) as Boot Drive?

    Google `bartpe windows 10` and check the results. There are several youtube videos on how to make a bootable Windows 10 PE USB.
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in ENEMY SHOOTING NON STOP

    Isn't that pretty much the same thing you asked [here](https://www.daniweb.com/programming/computer-science/threads/522725/shoot-and-kill-pygm)? Why start a new thread?
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in INSERT INTO with LAST_INSERT_ID()

    The difference is your brain is young and smart and mine is not as much ;-P I interpreted AUTO_INCREMENT as AUTO_INCREMENTED.
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in INSERT INTO with LAST_INSERT_ID()

    >No, LAST_INSERT_ID(id) does not return an incremented id. It returns the primary key ID of the last successful insert operation. OK. That's where most of the confusion came from. I …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in INSERT INTO with LAST_INSERT_ID()

    >The ON DUPLICATE KEY UPDATE portion doesn't require that it be a duplicate primary key. That seems to be strongly implied by the wording ON DUPLICATE KEY UPDATE That's why …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in INSERT INTO with LAST_INSERT_ID()

    I don't understand how that works. From what I read the code says Get a new id which is one more than the last inserted key and if the new …
  • Member Avatar for Reverend Jim
    Reverend Jim

    Replied To a Post in INSERT INTO with LAST_INSERT_ID()

    All righty then. Instead of doing INSERT INTO table VALUES (...) ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id), why not just have an auto-incrementing primary key? I have a sneaking …

The End.