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

So your argument is that if a solution is not perfect then it is bad?

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

An expression is typically something that reduces to a value (usually a part of a statement). A statement is something that performs an action. For example:

x + y * 5

is an expression

z = x + y * 5

is a statement that computes a value (from the expression), then assigns it to the variable, z (an action)

Typically a statement will cause a change of state. For example, the following two lines will cause two changes of state

int x                     allocates space for the variable x
x = 19                    modifies the location pointed to by x

whereas an expression will not change state (barring side effects). For example

x + 5

computes a result, then throws it away

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

It also assumes that said AI will be vindictive (like the gods). Even if the supposition is true, once a conscious AI is created, what reason would it have to be vindictive? In any case, there is still no evidence that machine consciousness it attainable. We have had claims of consciousness by at least one engineer involved with the development of OpenAI but that claim was quickly disproved.

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

Believe in a super powerful entity that's gonna solve all your problems but you need to "worship" it unless you want to be tortured for the rest of your life/eternity? We already have that. It's called God, Jesus, Yahweh, Allah, etc. Take your pick. Show me evidence that any of these exist and I'll consider it. Otherwise it's at best a stupid thought experiment and at worst fear-mongering.

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

Sounds like "data science" is the "new math". And we know how well new math turned out.

rproffitt commented: Also, 2+2 can equal something else. +17
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Welcome to Daniweb.

I offer my sincere apologies for any inadvertent mistakes I may have made thus far.

Not even so much as a grammatical error so far. Even meticulous comma placement. Well done ;-)

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

NetBIOS over TCP/IP needs to be checked (that setting)

I have no idea what you mean by that. It was also not mentioned in any of the tutorials I have gone through. Although one helpful comment was that I really have no business even attempting this without first becoming a linux guru.

rproffitt commented: NetBIOS over TCP/IP is buried somewhere in a Windows setting. Also, all this helps you build guru points. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I can ping it both by IP and name.

rproffitt commented: That means IP name resolution is good. NetBIOS over TCP/IP needs to be checked (that setting) +17
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Having just acquired a Raspberry Pi Model 3, I am attempting to set it up as an NAS. So far I have set up the Raspberry Pi OS and configured samba. It appears to be working fine except for one minor problem. While I can remote in using TightVNC, I cannot map to any of my media folders from Windows 10 or Windows 11.

So far I have tried

  1. forcing SMB2 protocol on Pi by adding "protocol = smb2" to smb.conf
  2. enabling SMB1 in windows features

The instructions say to use "\raspberrypi\NAS" as the "browse to" folder. NAS is the name I set up in smb.conf. It asks for username/password but just responds with

2023-09-29_122752.jpg

I can browse to \10.0.0.177 or \raspberrypi and it shows my NAS share, but when I try to open NAS I just get the same error. There is probably some setting that needs to be tweaked that all the help sites I've been to are omitting because they are assuming I already know. Any suggestions will be much appreciated.

I already have file and printer sharing enabled (I can map to folders on other machines).

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

Ah. Turns out I had a test file in the same folder named asyncio.py and the openai package imports asyncio, causing it to import my local file. However, trying to run the code now just results in

openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.
usmanmalik57 commented: OpenAI API is not free. So probably you ran out of credits. You need to top-up your account I guess! +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Yesterday (Sept 20) several authors, including John Grisham and George R R Martin, filed a lawsuit against OpenAI alleging that their LLM was illegally trained using pirated copies of their books. Their major concern is that, once trained, ChatGPT could be used to generate stories in the style of famous authors.

That raises two immediate questions.

  1. How did they determine that the books used to train the LLM were pirated?
  2. How is new material "in the style of..." a copyright violation?

I can understand the first claim in that the books would have to be either scanned and converted to text, or obtained in digital form, before being fed to the LLM for training. In that sense the books have been digitally reproduced without permission.

As for the second claim, according the their reasoning (I assume), were I to read all of John Grisham's books, then write a new story in his style (which I could not help being heavily influenced by), I could be liable to a copyright infringement suit. Assuming that this would not be the case, how is that different from an AI generated "in the style of" story? Typically, authors claim copyright on ideas, not styles. For example, Harlan Ellison famously sued anyone who used his ideas. He sued James Cameron when Cameron remarked that he got his idea for Terminator from an Outer Limits episode written by Ellison years before (which is interesting since Ellison himself admitted that he got his idea …

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

The only way to get good at something is by doing it. After decades of programming professionally in multiple languages I read several python book but I found that just "dabbling" was not sufficient to become comfortable with the language. I had to jump into the deep end of the pool (program almost exclusively in python) before I got to the point of thinking in python. It's a common thing to carry over programming practices from your comfort language. You have to unlearn certain habits.

One thing that I found prepared me (at least a little) was having programmed in APL. There are certain constructs in APL that make things like list comprehensions just make sense. In that case carrying over idioms from another language was actually beneficial.

I'm far from a python pro but if you have questions feel free to post them and I'll try to help.

rproffitt commented: "How do I get to Carnegie Hall?" "Practice, practice, practice." +17
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

There are several free libraries available for calculating with big numbers in c. Google c bignum library to see a few.

rproffitt commented: This. The first library that came to my mind as well was BIGNUM. +0
Sairus_1 commented: Without using a library, instead using the approach of storing each digit in an array.... Is that possible? +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try going into

Personalization -> Lock Screen

Select some option other than Windows Spotlight, exit, and reboot. Then go set it back to Windows Spotlight.

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

My laptop seldom leaves my house. When I am not using it I close the lid to put it into sleep mode. I also close the lid when carrying it to another room (or perhaps into the backyard hammock). This causes a minor inconvenience as every time I open the lid I have to enter my password to unlock it. On my old (Windows 10) laptop I was able to turn this off but because Microsoft keeps changing the layout of the Settings app I had to Goggle to find out how to disable this in Windows 11. The new process was

  1. Open Settings
  2. Select Accounts
  3. Select Sign-in options
  4. Scroll down to Additional settings

Under Additional settings there is a section with the text If you've been away when should Windows require you to sign in again?" To the right of this is a drop-down box with the default text Every Time. According to Google (and Microsoft) I simply have to select a different option, like Never**.

That would be the case if the entire section were not greyed out and followed by the text Windows Hello is preventing some options from being displayed.

The recommended solution from Microsoft was to

  1. Install the latest version of Windows
  2. Apply all outstanding Windows updates
  3. Run the Surface Diagnostic Toolkit
  4. Run the built-in troubleshooter
  5. Remove Windows Hello and re-install it

Since I keep my laptop current I focused on Windows Hello. Specifically, Windows Hello is used to facilitate access …

rproffitt commented: "Jim, it goes to 11." reference: Spinal Tap +17
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Welcome to Daniweb. I hope this leads to many interesting discussions.

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

A programmer (or programmers) going by the alias Nea Paw has created an AI application called CounterCloud that automatically generates responses to Russian and Chinese disinformation posts/tweets. We have now entered the era when information/disinformation generated by bots will flood the internet and we will be unable to wade through the BS to determine what is reliable and what is not.

Sort of like now, except exponentially worse.

source

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

What skills are you planning to work on?

AndreRet commented: What current skills do you currently possess? +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I don't have a brother in Syria, let alone one with a laptop, let alone a brother.

abod_1 commented: If I am in need from Syria +0
AndreRet commented: :) +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Been a while since I thought of something to add...

I hate the trend these days of showing text messages on a character's phone. These are impossible to read from across the room, even on a big screen TV. In order to keep up with the show I have to keep pausing and walking across the room. In the Cumberbatch/Freeman version of Sherlock, however, instead of showing the screen, they'd show pop-ups of the messages in letters large enough to read. So it can be done correctly. It just mostly isn't.

AndreRet commented: Very annoying I agree, especially at our age :) +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

From what I gather, no, because all the "creation" was done by you.

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

if I prompt an AI platform to write something, then the AI platform generates something, and may even add it to its own database before even showing it to me. At that point, by the time I've seen it for the first time, it's been created by another entity and stored in that entity's database.

If you use an IDE that supports code snippets, by inserting a code snippet are you giving up any of your intellectual property rights to the people who created the IDE and supplied the code snippet library?

What does existing copyright law say today about me handing a photography expert an old photo, and that expert manually colorizing and enhancing the photo with their own skillset?

I have no idea.

This is similar to how an author, by default, is also the owner of the copyright.

There is a fair use doctrine (I think that is the name) that protects people who do things like use quotes from known works, or who parody the works of others. I'm not sure exactly how this works since I have heard that Weird Al cannot parody songs without the permission of the original artist. If fair doctrine applies to code, how much code would I be able to "borrow"? If I copy/paste a code snippet from the web, am I violating copyright?

I'm asking out of curiosity since I have no intention of ever asking for payment for anything I write.

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

When I joined in 2010 I thought there was a clause in the TOS that said Dani owned the rights to any software posted on the site. It's possible (gasp) that I am mistaken, or that the TOS has been modified since then. In any case, I gave up my desire to be paid for code when I retired and as far as I am concerned she is welcome to anything I post.

Having said that, given the capabilities of modern IDEs, changing variable names, etc. is trivial so it would be difficult to prove that the modified code is a rip-off of the unmodified code, at least for interpreted code like Python. I would imagine it would be much more difficult for compiled code.

AndreRet commented: Exactly my sentiments. +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Where do you draw the line? If I set up parameters for ray-tracing and run them through "generative" software, would I own the rights to the result? Pre AI I believe I would have, but now it could be argued that I would not. Consider a tool like Topaz Photo AI. Would it be possible that I could own the rights to a blurry photo (input) but not the enhanced output? Would it depend on the amount on enhancement?

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

My problem was with the "negativity bias" statement although I suppose you could make a case based on evolution. If you pay more attention to negative news than positive news you are less likely to ignore potentially dangerous stimuli (is the rustling bush a predator or the wind).

rproffitt commented: "Clever girl." (Some won't get this reference.) +17
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I don't entirely agree with that. I think the reason bad news prevails is

  1. It produces a stronger emotional response
  2. It requires almost zero thought
  3. There is just so much more of it

I can believe the negativity bias in the case where it confirms (or seems to confirm) something you already believe.

pritaeas commented: Agree +17
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

That's a problem when the news shows only allocate two minutes to cover the topic. You need much more than that to cover it fairly. And, honestly, most people would just tune it out (the same people who read only the headlines). The only person I trust to give it a fair hearing is John Oliver. If you ignore the crude asides, he does cover his main stories in great detail.

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

Another area is to contract for code that used regular expressions

Ooooh. I had not thought of that one. That would be awesome. At least it would be if more people knew how to properly express their wishes in plain English.

exp = rx.compile("It's like, you know a letter or whatever followed by a dot and some stuff, right?")
rproffitt commented: "I have 99 problems. I used regular expressions. I have 100 problems." +0
AndreRet commented: Lol, yup. As rproffitt states, I have 20 pages code with errors pointing to 23 pages. +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I don’t see the positive in that.

I suppose that depends on whether it is good code, or bad code.

rproffitt commented: For business, it's a good thing as in lower cost. +17
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The main purpose of ANY testing is to identify and eliminate

  1. bugs
  2. bad/inefficient/confusing user interfaces

I really don't know why the question even needed to be asked.

Why is there air? There's air to blow up footballs and basketballs. - former (now disgraced) stand-up comic

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

First of all, please, please, please learn to

  1. add whitespace
  2. add comments
  3. break up monolithic code into logical segments
  4. pick meaningful variable names (or at least document them)

Rather than debugging your code I'll give you an example of blitting a semi-transparent circle

import pygame

pygame.init()

width, height = 800, 600
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption('Semi-transparent Circle')

circle = pygame.Surface((100, 100), pygame.SRCALPHA)
colour = (0, 0, 0, 128)
centre = (50, 50)
radius = 40

pygame.draw.circle(circle, colour, centre, radius)

running = True

while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False

    screen.fill((255, 255, 255))
    screen.blit(circle, (width // 2 - 50, height // 2 - 50))
    pygame.display.update()

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

You wouldn't expect to get ripped by getting someone else to go to the gym for you. You won't learn how to program by getting someone else to do your homework.

But if you are having a particular problem, please post your code and an explanation of the problem and perhaps we can offer some help.

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

It's still happening to me as well and the usual fixes (sfc, dism) have found/fixed nothing. At least with VLC I can set it to be always on top.

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

Can you please define what that is and why we should care about it?

AndreRet commented: I have posted numerous suggestions to member to start using Google, no luck +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

When I had a bad lower back injury years ago I built a kneeling chair that was very comfortable for working. It looked very similar to this one except I built mine for under $10.

Please note I am in no way promoting/endorsing the product in the link.

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

AI doesn't "understand" anything.

rproffitt commented: Sometimes humans too. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

As the message says, strings do not have a "reverse" attribute (method or property). You can reverse a string by

newstring = my_string[::-1]

If you run idle or idlex and start a shell (interactive) window you can see your options by assigning a string to "my_string", then typing "my_string" followed by a dot, and then waiting for the intellisense pop up.

rproffitt commented: !eciN +17
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I couldn't believe 4.5 hours to do an update (from the posted article). My updates download in the background so I don't know how long that takes, but the install/restarts take five minutes at the most.

AndreRet commented: Same here, mine is running in the background and when I shut down it prompts for install, also around 5-8 minutes most... +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

That looks promising. Incidentally, Daniweb shows that as a broken link, but if I click on it and select "go there anyway" it takes me to the page. Curious. I've seen this happen here before recently.

AndreRet commented: I've noticed the same. I can understand if certain links is blocked but not legitimate ones... +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

On line 10 you have count+=1:. Python will tell you that this is a syntax error. Take off the trailing colon. However this still leaves you with a problem. The game runs, but it does not display the hangman in progress when you guess a wrong letter.

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

I've only ever noticed this happening while playing a video in vlc media player. I'll have the video playing in full screen with the video's folder in the background. Without touching the mouse, keyboard, or touchpad, the background Explorer window will pop to the front, obscuring the video. I can have other apps open, but it's always an Explorer window that pops up.

AndreRet commented: Yup, mine goes awry with file explorer. +15
richards1222 commented: good. +0
Naini commented: Amazing +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Or the way they slapped "User Friendly" on the outside of the box without actually making the software user friendly.

rproffitt commented: I remember the old version was user-hostile. +17
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I can't help you with blockchain, but I am curious as to the part of your post where you say

By framing the question in this way, you're indicating that you're seeking guidance and open to different programming languages and approaches, which can encourage members of the forum to provide their insights and code examples.

I'm reminded of a scene in MTM where Ted Baxter (reading the news off the cue cards) says out loud "take off glasses and look concerned."

AndreRet commented: LOL!! +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I forgot one point. Social media platforms are a tool that big business uses to harvest your personal data for profit. If the government was asking for the same data we'd be screaming about "Big Brother", but it seems most people are happy to just give it away to Google, Facebook, etc. Remember what they say, "if you aren't paying for it then YOU are the product".

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

In my opinion the major purpose of social media platforms is to provide people with no voice a platform. Unfortunately that platform is used mainly to shout "HEY EVERYBODY LOOK AT ME LOOK AT ME LOOK AT ME". In other words, social media is mostly a vast wasteland.

Elon Musk recently put a cap of 600 for the number of tweets that can be read by a user per day. After (supposedly) widespread outrage he relaxed this to 800. If you find 600-800 a limit then you are spending way too much time on social media. Go read something worthwhile.

AndreRet commented: And the competition launched a few days ago and crushed him ouch! +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I wrote a timer/alarm app in Python that I wanted to be accessible from all Windows Desktops. What I had to do until recently was run the app, select the desktops icon on my toolbar, then right click the app and select "Show this window on all desktops". I was certain there was a way I could do it from within the app and after a little research I found it. Here is a function you can call to do this. Note the usually bad practice of using an except clause to trap all possible errors.

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

Python in an excellent first language to learn. It has low overhead (you don't need a lot of boilerplate code for simple programs) and a structure that promotes clear, readable code. The IDE that comes with it (Idle) can be learned in a few minutes, and the included REPL (Python shell) allows for easy experimentation.

There are tons of available free online tutorials and help. Plus piles and piles of source code examples and high quality packages for just about every application.

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

There are two types of people - those who divide things into two types, and those who don't.