Dead Internet Theory: Is the Web Dying? Community Center by Johannes C. **In 2024, over half of all internet traffic is generated by bots. For human users, it is increasingly challenging to tell what's real and what's not. These developments breath new life into the Dead Internet Theory. Have we, in our quest for clicks, killed the web?** ![dead-internet-theory.jpg](https://static.daniweb.com/attachments/4/… Re: Do email clients respect CSP? Programming Web Development by toneewa A CDN can check the HTTP referer, to make sure the request does not originate from visitors on another site. This means it denies access to requests, when the HTTP referer does not include your domain name and not blank. I also found another useful page on [hotlinking](https://securityboulevard.com/2022/10/modern-and-robust-hotlink-protection… Re: Using Natural Language to Query SQL Databases with Python LangChain Module Programming Computer Science by aishamushtaq very helpful Re: How to query database using variable and get all results not just one row Programming Web Development by Mikekelvin To ensure that you're retrieving all records associated with the current user, you need to make sure that your query accurately filters the data based on the user's identifier (variable_name). Here's how you can modify your query to achieve this: // Assuming $currentUser holds the identifier of the current user // Query database to retrieve … How to query database using variable and get all results not just one row Programming Web Development by nander Hello I am trying to query a database to show records only for the current user using variable I get the correct data but only 1 row with results any guidance? // Query database to retrieve records associated with the user $sql = "SELECT * FROM table_name WHERE variable_name = :variable_name"; $stmt = $conn->prepare($sql); $stmt… Re: How to query database using variable and get all results not just one row Programming Web Development by Chris_103 To retrieve all records associated with the current user, you can use the fetchAll() method instead of fetch(). Here's how you can modify your code: ```php // Query database to retrieve records associated with the user $sql = "SELECT * FROM table_name WHERE variable_name = :variable_name"; $stmt = $conn->prepare($sql); $stmt->… Re: How to query database using variable and get all results not just one row Programming Web Development by Biiim logically, it would be because `WHERE variable_name = :variable_name` matches 1 row in your table maybe try a `var_dump(str_replace(':variable_name',"'some_value'",$sql));var_dump($records);`? run the sql on whichever way you use to access your DB directly I don't use PDO so i'm not too familiar on how it returns results, either … Using Natural Language to Query SQL Databases with Python LangChain Module Programming Computer Science by usmanmalik57 The advent of large language models (LLM) has replaced complex scripts with natural language for automating various tasks. You can now use LLM to interact with your databases using natural language, which makes life easier for people who do not have sufficient SQL knowledge. In this article, you will learn how to retrieve information from SQL … Retrieval Augmented Generation (RAG) with Google Gemma From HuggingFace Programming Computer Science by usmanmalik57 In a previous article, I explained [how to fine-tune Google's Gemma model for text classification](https://www.daniweb.com/programming/computer-science/tutorials/541544/fine-tuning-google-gemma-model-for-text-classification-in-python). In this article, I will explain how you can improve performance of a pretrained large language model (LLM) using … Paris Olympics Chatbot- Get Ticket Information Using Chat-GPT and LangChain Programming Computer Science by usmanmalik57 I was searching for Paris Olympics ticket prices for tennis games recently. The official website directs you to a [PDF document](https://tickets.paris2024.org/obj/media/FR-Paris2024/ticket-prices.pdf) containing ticket prices and venues for all the games. However, I found the PDF document to be very hard to navigate. To make things easier, I … Paris Olympics Ticket Information Chatbot with Memory Using LangChain Programming Computer Science by usmanmalik57 In my previous article, I explained how I developed a simple chatbot using LangChain and Chat-GPT that can answer queries related to Paris Olympics ticket prices. However, one major drawback with that chatbot is that it can only generate a single response based on user queries. It can not answer follow-up questions. In short, the chatbot has no … How can I upload a tar.bz2 file to openstack swift object storage container Programming Software Development by Hanginium65 I wrote a Python script that included the python-swiftclient module to connect to the OpenStack Object Storage and upload some files to the OpenStack Object Storage container It works great if I upload a file that ends with the extension .gz however, I’m getting an error regarding the ‘TarFile’ object having no attribute ‘read’ after running my … Re: Improve HAVING BY performance Programming Databases by Reverend Jim 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 … Re: Htaccess Problem Url Friendly Programming Web Development by Adolfo_1 NO! I meant that URL loads but not friendly I have to put these STATIC URLs inside the text retrieved from the database as I cannot insert php strings. Example from database example that htaccess makes unfriendly : <em><a href="../read-lex.php?slug=Provvedimento-di-sospensione-Trib-Cagliari">Vedi &nbsp;SENTENZA&… Re: Htaccess Problem Url Friendly Programming Web Development by Adolfo_1 I apologize because I am unclear. Difference between readlex and read_lex is my mistake Your htaccess example is right except that it doesn't work for me and I don't understand. Summary: In <head> I have this php: define("BASE_URL", "http://localhost/mysite/"); if($mod_rewrite == 'Off') { … Re: Do you participate in any other communities? Community Center Geeks' Lounge by Dani I was talking to Chris (the DiC founder/owner) a little bit before he decided to shut it down. He was saying he's been so busy with his other businesses that he spent maybe 5 minutes on it over the past 5 years, so he lost interest, and it wasn't paying its server costs. At least in the case of DaniWeb, it *also* isn't even coming close to … Re: Improve HAVING BY performance Programming Databases by Dani > I know that in my experience, OR's are very bad for speed you can get away with a few but they can get very bad when they stop the whole query making use of one of the main indexes, you can actually speed it up by moving the or's into the HAVING usually. Thank you for that tip! I never thought of that, but it totally makes sense!! > … Re: Htaccess Problem Url Friendly Programming Web Development by Dani I apologize that I still am misunderstanding you. I'm confused what you mean by "example from database", because it seems your question is about htaccess and PHP. I'm confused what is being retrieved from the database In your second example, what are the values of BASE_URL and READ_LEX? Additionally, your .htaccess file said … Re: Htaccess Problem Url Friendly Programming Web Development by Adolfo_1 > Where do you set the value of $mod_rewrite? I set On-Off $mod_rewrite in database from Dashboard Admin. Now is always ON. > Again, where do you set the values for BASE_URL? In Admin config.php // Defining base url define("BASE_URL", "http://localhost/mysite/"); > What do you mean by '… Re: Improve HAVING BY performance Programming Databases by Biiim > I don't have experience with MariaDB, but in MySQL, something like that will work as long as I do SELECT sum(points) AS total FROM ... HAVING total > 10. Is that what you were getting at? Kind of, MariaDB is a fork of MySQL from around 2009 or something like that, MySQL 5.* and the creator continued developing MariaDB and Oracle took … Re: Improve HAVING BY performance Programming Databases by toneewa I'm a little late to the party, however, I want to share my experience learning MySQL in the past day. I setup a server, a database, and wrote a C++ program to connect to it. It measures the times for 3 SELECTs. The whole product list, using HAVING, and WHERE. I also tested reversing the orders. Query execution time: 0.0002336 seconds … Re: Improve HAVING BY performance Programming Databases by Dani But you're not comparing apples to apples. Your WHERE query and your HAVING query perform different calculations and do different things. In one, you're plucking out all the rows with a price greater than $4, and then calculating an average price for each product. In the other, you're plucking out *all* rows, calculating an average price for each … Re: Improve HAVING BY performance Programming Databases by Dani I think you might be missing my point. If you’re fetching different data, there’s no way of saying whether where or having is faster. You would need to write queries that use each, but retrieve the same data, to see which is faster for a use case. Even then, it totally depends on the data in the database itself. The same query can be fast for some … Re: Improve HAVING BY performance Programming Databases by toneewa I know when you don't use aggregate calculations use WHERE. Producing the same results can be done. I added another test with MAX(Price). With a database over 305K rows, 3 columns, MySQL Workbench is unstable importing. Took over 2 hours. WHERE is faster, and should be used, when no functions are needed. WHERE Query execution time: 0.… Re: DaniWeb Auto Answer A.I. feature Community Center Meta DaniWeb by Dani Pardon my cluelessness here. A $300 video card can efficiently perform complex AI tasks against DaniWeb’s entire database in real time? Missed the link to the Python API. Re: How can I upload a tar.bz2 file to openstack swift object storage container Programming Software Development by Salem First, let's prepare two tar files using different compression schemes for demo purposes. $ cat foo_1.txt This is file 1 $ cat foo_2.txt This is file 2 This is file two This is file too # Three tar files, two compressed and one uncompressed for reference $ tar -j -c -f foo.tar.bz2 foo_1.txt foo_2.txt… Re: How can I upload a tar.bz2 file to openstack swift object storage container Programming Software Development by Hanginium65 Good day, Salem. My apologies for taking so long to reply to your suggestion. I refactored my code to read the contents of the tar.bz2 file and then pass them as a file-like object to the 'put_object' and also to change the content type for the file transfer to "application/octet-stream". The first was sent through to object storage … Re: How can I upload a tar.bz2 file to openstack swift object storage container Programming Software Development by Salem I don't understand why you need to extract all the files from the compressed `tar.bz2` just to upload to a backup. Also, line 69 is now meaningless having just posted only a snippet of the code. Before the error, what was the last `logger.info` message? Re: Things I hate about TV shows Community Center Geeks' Lounge by Dani Currently the thing I hate most about TV shows is how much time elapses between seasons. I feel like I've been waiting for season 2 of Severance on AppleTV for *forever*! (It's been over 2 years already since season 1 debuted.) Speaking of that, is there ever going to be a second season for Squid Game? I can't imagine that Netflix wouldn’t invest … Re: Things I hate about TV shows Community Center Geeks' Lounge by Reverend Jim Fer sher. You pretty much have to watch the previous season again before you start the next one. I'm still waiting for season 2 of The Old Man (Jeff Bridges, John Lithgow). At my age sometimes I lose the thread if two weeks goes by between episodes. Sometimes I'll wait until the end of a season before I watch any of it. I especially hate it when a …