Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I am already using multiple MySQL connections throughout the project, as well as select_db() in some other places.

My question specifically revolved around if anyone can explain why select_db() implicitly committed the transaction, and then when done again to return back to the initial database, it did a rollback instead of commit.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

A slightly related question:

Is it okay to use PHP's mysqli::select_db() function to switch databases in the middle of a transaction? This is what got me into trouble in the first place, when I started a transaction, performed some writes, switched databases, and then wrote to that second database, and then switched back, and performed some more writes, and then committed the transaction. I discovered that all of the writes that were performed after switching back to the original database were rolled back, but the initial set, and the set to the second database, were not. But what if I switch, just perform reads, and then switch back? Should that be safe?

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I ran into a bit of a snag in my code, and I'm trying to make heads or tails as to whether this will work.

From within my PHP script, can I write to a database using a MySQL connection in the middle of a transaction with a different connection?

e.g.

// Open Connection 1 and connect to Database A
// Start transaction with Connection 1
// Write some stuff with Connection 1
// Open Connection 2 and connect to Database B
// Write some stuff with Connection 2
// Close the transaction associated with Connection 1

This is probably the wrong terminology, but I hope you get the idea of what I'm trying to do here.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Thank you so much for joining, and welcome!! :)

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I am passionate about sharing my experience with a professional like you. Can you explain more about what is required?

What is required of what?

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

It depends on the purpose of the article. Short content works when people want a quick answer to something. Long content works when people want a lot more in-depth information about a particular topic. You should always have a target audience in mind when writing content.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

It would be very helpful if you could not upgrade Chrome for now, while we debug this, since you're currently the only known person who is experiencing the bug.

Mr.M commented: Noted +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Well don’t upgrade chrome just yet! If the problem goes away, we won’t have any way of testing if the bug is fixed.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Following up on this topic it seems as if Mr.M has been having trouble with Chrome crashing whenever he tries to type in our editor (which we just upgraded a week or two ago).

@Dani this happens when I type a longer message than it froze and crash. I just tried testing using a different browser and it seems ok with Tor browser, the crashing happens on Chrome browser on my Android phone.

I guess the issue is only picked up by Chrome. I know chrome does give issues, I saw while I was developing a browser extension, Firefox is always the best.

As you can see I wrote this long message and it didn't crash, but if I were to type on a Chrome it would have crashed without even reaching 10 words.

A few follow up questions:

  • What version of Chrome?
  • What version of Android?
  • Are you using any browser plug-ins?

And, perhaps the most important question, is to figure out if this is unique to DaniWeb's implementation of the editor, or if it is the editor framework we are using.

Can you pretty please go here and, in the dropdown that says Select example, choose Markdown. Then, try typing and let me know if that crashes.

Much thanks!!!!!

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Eek! I’m so sorry. We upgraded our editor last week and I suppose it’s possible a bug was introduced in my code?

Can you please start a new thread in the Meta DaniWeb forum explaining exactly what you were clicking on, etc. just before it crashes, along with your browser and operating system. I don’t really want to conflate this thread with debugging DaniWeb.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hello and welcome!

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Is anyone keeping up with the Chegg lawsuit?

rproffitt commented: The bonfire of lawsuits in progress today is feeling like we're on the surface of Venus. +17
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Emailing became more restrictive in the last year

Are you referring to SPF, DKIM, and DMARC?

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Thank you for introducing me to an app I’d never heard of. And I thought I knew about every Google product there was!

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hi

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Why build it if Winni is already successful at doing it? Is there something you don't like about Winni that you think you can do better? What would you do to convince people to use your app instead of the already successful one? If you can answer those questions, then yes, it could potentially be a good business for you.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Yes, but you might want to also add currency: 'GBP', as so:

$('table#list tfoot .grand-total').text(parseFloat(grand_total).toLocaleString('en-gb', { style:'currency', currency: 'GBP', maximumFractionDigit:2 }))
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hello and welcome. Thanks for signing up.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

If a webpage performs poorly in Lighthouse audits for metrics like LCP, Speed Index, CLS, e.t.c. those issues will also affect real Chrome users, ultimately having a negative impact on its SEO.

I have found that to not be the case. As an example, we use Google's signed exchanges, which allow Chrome to prefetch our URL on the Google SERPS pages, so they load faster if a searcher clicks through to DaniWeb. This is an example of when Lighthouse might provide poor results, but the actual user performance tells a different story.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Lighthouse metrics (which really affects SEO)

Please correct me if I'm wrong, but I'm fairly confident that Lighthouse metrics do not affect SEO. Lighthouse is just a tool that Google offers to SEOs to be able to offer actionable page improvements. In reality, it's real world performance data from Chrome users that factors into a site's SEO. This real world data can be found in the Core Web Vitals section of Google Search Console.

Unfortunately, your theory doesn't really make much sense to me based on what I know about the DOM, HTML rendering, and Javascript execution. However, I don't have a good explanation for the behavior either.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I hadn't considered that you could host Daniweb from your home. That would certainly make it more convenient.

While it might technically be possible to host DaniWeb from my home, it would not be practical. Firstly, I did some research since yesterday, and it seems against the AT&T terms of service to have servers for a for-profit business running from a home plan. A small blog would fall under the radar, but they would likely shut us down for the amount of traffic that we get.

Secondly, we currently have a rack at a datacenter in Texas. We would need to ship all of our equipment to my home, and then find room in our small home for a server rack.

Thirdly, we would lose the advantage(s) of being in a big datacenter. Redundant uplink connections, etc. The datacenter is also minutes from where blud, our sysadmin of 20 years, lives, so that if anything were to go wrong, he could go there in person and fix it.

We also have the problem of very frequent blackouts where we live, that typically last 2-3 days at a time. After dealing with it for 2 years in a row since moving here, on the 3rd year, we finally installed solar last year. After spending so much money on a solar array and batteries, there has been only one blackout since, lasting for all of 12 minutes. (Of course, right?)

So, all in all, not very practical or realistic to …

humyraseo commented: Absolutely, you are right. I totally agree with you. +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hello and welcome to DaniWeb!!

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Sorry. I’ve just been really exhausted all day. It just clicked that LCP is only for ATF. Soooo, yeah, I don’t know what’s going on there.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Actually, I take it back. I assume that, using Chrome on a fast Internet connection, and a super high screen resolution, none of the images are actually being lazy loaded.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I would like to confirm that the JS version is giving me an LCP of 0.2s and the loading="lazy" version is giving me an LCP of 1.1s, so certainly a huge difference there. FCP, total blocking time, CLS (0), and speed index (0.2s) scores are the same for both.

I admit that, at first glance, I'm not understanding why the LCP is so long for the second version. Interested in hearing your theory.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

It depends on what you want the software to do, how complex that is, how much experience you have building out that type of thing, and what your skillset is.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Dunno - could you run Daniweb at home with that kind of bandwidth and save a chunk on data centre fees?

Or would something like that fall foul of the Terms of Service and/or Acceptable Use Policy?

Running servers is allowable. Whether or not the servers can be for business purposes with a home plan, I have not yet looked into. Whether or not 5Gbps is enough, I also don't know, although my first guess would be that it previously wouldn't have been, but it would be with the very little traffic we get today. However, I also wouldn't be able to speak to the reliability of a home Internet plan, fiber or otherwise. In the datacenter, we are directly connected to the Internet through multiple bandwidth providers.

Even more reason for caution, if your livelihood depends on a stable and reliable connection.

More than anything, my livelihood depends on the ability to get out of bed, which is a real struggle most days. Hence the lack of a viable livelihood these days.

Sounds like you want it because you want it and can't think of a reason to justify it.

Yup. That one!

Can you think of any ways in which it would make your life easier?

No. Can you?

How much time would it actually save you and how often would it make a noticeable difference?

That one's easy. It would make a very noticible difference every time …

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Oh, it looks as if the tutorial was for the old DaniWeb API that no longer exists. The DaniWeb Connect API is also OAuth-based and has some of its own documentation.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Never trust ChatGPT to write fully flushed out code for ya :)

Pinterest uses OAuth to authorize your app on behalf of your app's end-user, if that makes sense. For example, your goal is for your end-user to load up your app, and have access to their Pinterest account. What OAuth does is give your end-user the ability to grant your app permission to access their Pinterest account and modify it on their behalf.

I wrote an OAuth tutorial a little over a decade ago, as the DaniWeb API is also an OAuth-based API, just like Pinterest.

However, I have really horrible brain fog right now, and I'm really struggling to be able to read Pinterest's documentation. I'll try to tackle your question tomorrow afternoon if I'm feeling better. In the meantime, I hope that the tutorial I wrote helps.

Meanwhile, do you have a client ID and client secret set up with Pinterest? If not, you can create one here as that's the first step.

Also, it looks like some other people have already beat you to writing a PHP-based OAuth flow for Pinterest:

Good luck!

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hello there.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hello and welcome to DaniWeb. That’s quite the CV you’ve got there. :)

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

This is a very old thread, but I feel the need to clarify that it is definitely not plain text.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

And you need 5Gbps because...?

Awaiting suggestions.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

In NY, I had Spectrum cable at home, and Verizon FiOS fiber at my office.

In CA, I started with Xfinity cable. Just before COVID, we moved into a townhouse that had a spotty connection that became unbearably inconsistent. Apple ended up paying for us to have AT&T fiber because my husband is an engineering manager there, and they needed their employees to have reliable Internet connections during work from home orders. We had a really shitty experience with Xfinity customer support and a really excellent experience with AT&T.

We have since moved and AT&T wasn't available, so we went back to Xfinity cable. AT&T just became in our neighborhood available and I'd love to go back to it.

rproffitt commented: I forgot to add what year. All the ATT Keystone Cops show was in 2010 and the move to the home in 2011. This isn't anyway to run a business IMO. +17
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Please help me come up with a compelling argument to convince my husband to spend an additional $200/month on AT&T Fiber Internet with 5Gbps download / 5 Gbps upload.

We currently have Comcast Xfinity cable with 1.2Gbps download and something like 35 Mbps upload. Xfinity has a 2Gbps plan we could potentially upgrade to. I'm not willing to cut the cord and get rid of cable TV. That means that we would be keeping a Comcast account just for a TV plan.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Do you have a specific, niche audience in mind that your content is targeting? What do you envision that audience doing with their free time? Are they students who are going to be in school from 9 am to 4 pm? Are they parents of young kids who are going to be busy with dinner and bath time every evening? I would suspect that scheduling social media posts is a bit like scheduling broadcast TV programming.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I'll echo rproffitt in that anything is feasible with the right tools, skillset, money, and time. However, I think the question you really mean to be asking is how feasible this is for you?

I will start off by saying that, as long as you're only thinking of very simplistic complexity, I think the existing LLMs out there are capable of looking at two pieces of code and determining if they do something similar. So the really hard work is done.

Screenshot_2025-03-02_at_12.41.56 PM.png

Now how good at you at prompting LLMs? What would you even prompt the LLM to look for to consider the matches similar? I asked ChatGPT:

What is pseudocode for an algorithm to rank 1000 articles in terms of similarity to a particular article?

Here’s a pseudocode for an algorithm that ranks 1000 articles in terms of similarity to a particular article. We'll assume the algorithm uses cosine similarity or another similarity measure to compare the articles.

1. Initialize a list of 1000 articles
   articles = [article1, article2, ..., article1000]

2. Define the target article
   target_article = articleX  // The article to compare against

3. Initialize an empty list to store similarity scores
   similarity_scores = []

4. For each article in the articles list:
   a. Compute the similarity between the target_article and the current article
      similarity = compute_similarity(target_article, current_article)

   b. Append the similarity score to the similarity_scores list
      similarity_scores.append((current_article, similarity))

5. Sort the similarity_scores list in descending order by similarity score
   sorted_similarity_scores = sort(similarity_scores, key=lambda x: …
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I don't have an odd, yet true, fact, but I felt the need to post here because I felt bad that this thread has not seen any replies.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Jim,

Is that the lake you would always spend summers at? Where are you currently living? City? Suburbs? Rural?

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Speed index should also not be affected at all by using it. Speed index measure how long it takes to load the first screen of content of a webpage. That means that if you’re using it only for content below the fold, speed index should never be affected.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Even if using it above the fold, as long as you specify image dimensions, there should never be a CLS impact.

CLS measures needing to reposition elements on the page as it loads or due to user interaction. As long as the spot for the image is carved out from the very beginning, even if the image loads much later, no other element on the page would ever need to shift to make room.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I guess I don't understand why implementing loading="lazy" will hurt the CLS if you're only doing it for images below the fold, and always specifying image dimensions (which would ensure to never affect CLS at all)?

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I would guess it just has to do with taxes and/or laws in your region that Facebook's legal/accounting/business divisions do not want to involve themselves with right now for one reason or another. I don't believe there is a way around it, unless you were to connect to Facebook using a proxy server and spoof your location. However, that would definitely be against Facebook's terms of service, and I would not do it for a shop, because you're likely to not end up receiving any payments. Why not set up something such as Shopify instead? What type of shop are you looking to set up?

MasoodDidThat commented: I already have an E commerce website i was just trying to leverage the shop feature on instagram to add more engaging content and gain some customers +0
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

A little trivia here - was anyone else aware that the voice of the Johnny-Cab in the original Total Recall movie was provided by the actor (Robert Picardo) who portrayed the AI doctor in Star Trek Voyager? The driver even physically resembles the actor.

I didn't notice, despite getting into Voyager, and watching Total Recall, both in my early college days, so roughly around the same time. (Random fact: My college friend, Dan, both recommended Total Recall to me, as well as told me I should start a programming forum.)

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

The Markdown editor that we use here at DaniWeb is called CodeMirror and we've been using it for forever. The other day, I noticed some bugs in the editor toolbar that we use, which is based on the CodeMirror API. (The one that allows the buttons for bold, italic, etc.)

Over the past few days, I've gone ahead and refactored the code for the editor toolbar and fixed some bugs as well. I decided to publish my work since it's pretty heavily commented.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hello there. Welcome to DaniWeb! :)

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Hello! Welcome! What brings you to these parts?

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

I met my husband on a dating app. However, this isn’t really the place to ask this kind of question. This is a programming forum and the discussion revolves around building a dating app, not using one. Also, this discussion is 16 years old.

Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member

Renting it out might be a viable solution for jkon. Not so in my case, where my mom would need enough for a down payment on a place in California.

As for that Japanese housing marketplace, without being familiar with Japan and/or the neighborhoods, there's no knowing if any of those homes are in good neighborhoods or what condition they are in.

The same with the US. There's certainly a shortage of affordable homes here in the Bay Area.

rproffitt commented: I have more information on that topic. I've only been in Japan a few times and every time had be wanting to return. +0