‘Why PHP Still Beats Your Next Favourite Alternative’

Long-time Slashdot reader Qbertino writes: On PHPday in Verona (Italy) Rasmus Lerdorf, creator of PHP, gave an enlightening talk on PHP and its history. 25 years of PHP (video of the talk) is ripe with details on PHP, the design choices behind the web’s favorite server-side templating language and with explanations on why what you may think of as an inconsistent mess actually makes perfect sense just the way it is. Very insightful, fun, interesting and a must-watch for PHP lovers and haters alike. Introducing one slide, Lerdorf remembers that in the 1990s, "the web looked like this — CGI bins written in C." But he also shows his first computers from the 1980s at the beginning of the talk, before moving on to screenshots of Gopher, and then of the Mosaic browser. "This changed everything. And not just for me, for everybody… "Everybody around at the time, playing with this stuff, and having had UUCP addresses and playing with Usenet and bulletin boards — it was very easy to see that this was going to change the world."



Share on Google+

Read more of this story at Slashdot.

via Slashdot
‘Why PHP Still Beats Your Next Favourite Alternative’

6 Ways to Add a Chat Room to Your Website

When you start a new website, the first thing you need is a reputable web host. For WordPress sites, we highly recommend WP Engine, which handles all the hard work of site management for you. If you don’t mind getting your hands dirty, then InMotion Hosting and Bluehost are both viable options as well.

Next up, you might wonder: “How can I add a free chat room for my website?” To foster more real-time communication between users of your site or the readers of your blog, chat rooms can come in handy.

Fortunately, several free chat room services allow you to create your own room. They either provide a simple link to that room, or let you add that chat room to your site. Ready to start? Here are some of the best online chat rooms that you can easily add to your website.

1. Chatzy

Chatzy Chatroom Website

Chatzy lets its users create public and private chat rooms. It provides a link to that room, which you can easily link to on a webpage or in an email. The site offers several ways to customize the chat experience to suit your needs. If you register on the site, you can view your Chatzy room list, making your chats easy to keep track of.

You can easily create a chat by selecting Start Quick Chat. After you input your name and subject, you can enter the room. Clicking Invite/Share on the left menu bar will provide you with a share link.

To embed a private chat room on your website, head to Hosted Rooms on the left menu bar. This page gives you instructions on how to customize your chat room, as well as how to embed the provided code into your site.

2. Tlk.io

Tlk.io Chatroom Website

Tlk.io lets you simply start an online chat room, making it one of the best chat room sites like Chatzy. As soon as you enter the website, Tlk.io asks you to input a channel name, as well as your nickname. Clicking Join brings you to your very own chat room. Copy and paste the chat room’s URL in the address bar to place in emails or on your social media page.

To embed Tlk.io into your website, scroll down on the homepage until you see a button that says Get Embed Code. This option allows you to name your channel, choose a chat room height, and even pick a theme. Copy the generated code on the right side of the screen, and add it to your website to make a chat room in an instant. Tlk.io’s convenience can even make it a great team communication alternative to Slack.

3. Dead Simple Chat

Dead Simple Chat Chatroom Website

To get started on Dead Simple Chat, you have to register for an account. After that, the site will direct you to your dashboard where it shows you the shareable link to your chat room, and also gives you the code to embed it on your website.

If you want to customize your chat room, click Chat Rooms on the left menu bar. Under the chat room of your choice, click Chatroom settings. You can then change the sidebar and background color of your chat room, as well as change its name. When you’re done, click Update Chat Room, and then hit Embed Chat Room to copy and paste the code into your webpage.

Dead Simple Chat also offers several paid plans. With the Pro Plan, you can have up to 2,000 different users, an unlimited amount of chat rooms, and storage for up to 180 days.

All of these perks prove that you don’t need the features of Facebook Messenger in order to communicate effectively.

4. Minnit

Minnit Chatroom Website

Like Dead Simple Chat, Minnit also requires you to sign up in order to create a chat room. Once you create your account, navigate to the Quick Links dropdown menu, and click Create your own chatroom in less than a minute. Input your chat room name, description, and then decide if you want to make your chat private or public.

Minnit will then create your chat and will ask you which plan you want. The free plan offers unlimited messages, up to 40 users, and lets you censor certain words. If you decide to upgrade to one of the paid plans, you’ll get more customization options.

When you’re ready to embed your chat room into your site, head to the page of your chat room, and then select Embed Your Chat. If you have already set up a WordPress blog, you can use the Minnit plugin to add a chat room. You can also use the Wix plugin to add Minnit to your website, or you can simply copy and paste its code onto your own domain.

5. RumbleTalk

RumbleTalk Chatroom Website

If you’ve tried embedding a chat room into your website in the past, you might remember ParaChat. Since ParaChat has closed, RumbleTalk serves as its alternative. You must register for an account before you create your chat room with RumbleTalk.

To customize your chat room, head to Design in the top menu bar. You can then insert a background image, edit text color, change your font, and even add a skin.

If you want to monetize your chat, RumbleTalk has settings for that as well. Head to Monetize on the top menu bar, and input your PayPal information. Rumbletalk also offers paid plans for an increased amount of chat seats and rooms.

When you’re ready to embed your chat room, click Embed on the top of the page. Select Get Code to copy and paste the code right on your website.

6. Pure Chat

Pure Chat Chatroom Website

If you don’t know how to add a chat room to your website, Pure Chat will walk you through the steps. Create an account, and you can then access all of its helpful features. Its free live chat gives you plenty of customization options, allows you to transfer files, and even lets you have unlimited chat rooms. For more than three users, you’ll have to upgrade to one of Pure Chat’s paid plans.

After you register, Pure Chat will give you a code that lets you embed Pure Chat into your website. When you’re ready to chat, you can have conversations from your site, and from Pure Chat’s mobile app.

Web Chat Communication Made Simple

Embedding a chat room on your website doesn’t have to involve any complicated coding. In fact, it only requires you to install a widget, or simply copy and paste a code that the chat room creator generates for you. Choose one of these options from this online chat website list, and you’ll have a reliable way to communicate with your readers, customers, or your team.

Want to extend your conversations to your smartphone and your computer? Check out these messaging apps that you can use on your phone or computer.

Read the full article: 6 Ways to Add a Chat Room to Your Website

via MakeUseOf.com
6 Ways to Add a Chat Room to Your Website

Why One Mom Decided to Get Her Concealed Pistol License

I decided to obtain my concealed pistol license (CPL) about six years ago. While I really never intended to carry a gun, my husband was taking the class, so I figured, why not take it, too? I could always learn more about guns, and I liked the idea of knowing I could carry one if I choose to. I wanted the training to teach me what it meant to carry and the fundamentals of how to be a responsible gun owner, and I liked the idea of personal protection, but I never thought to take it to the next level.

Much more than a handgun goes into completing a good Concealed Carry Rig.

RELATED STORY

Everything to Consider When Setting Up a Concealed Carry Rig

My husband always carries a gun, so I didn’t feel the need to carry, myself. I saw the struggle my husband went through with finding the proper holsters, pants and shirts to carry concealed, and I just couldn’t imagine the struggle that would entail for a woman. Women are built totally differently than men are. I like my yoga pants, tight jeans and tank tops. But then I had a child, and the whole game changed. I decided it was time to start carrying a gun when I went out, especially when my husband wasn’t around.

Carry Complications

To his dismay, I started out carrying in my purse, but I soon found that off-body carry wasn’t the best option for me for several reasons. First, toddlers always seem to want to dig around in purses—maybe it’s because of all the goodies us moms keep for our children in there. Second, if someone was going to attempt to rob me, what’s the first thing he’d probably go after? That’s right, my purse. The same purse that has my gun resting inside that’s supposed to be available for me to use to protect myself from someone who might attack me. Now the bad guy not only has my purse but also my gun, and that would be a very bad day for me indeed.

I then tried carrying inside the waistband of my pants. That didn’t work either, as I still prefer tighter clothing, so carrying was extremely uncomfortable for me. I would have to purchase a whole new wardrobe. But as much as I love buying clothes, I hated the idea of buying bigger clothes. I looked into bra holsters and outside-the-waistband holsters, tried some of my husband’s holsters and even resorted to not carrying a gun at all. It took being followed around a local grocery store by two mid-30s men to get smart about safety.

Danger Comes

I knew the two guys were following me when they continued to go out of their way to watch my every move. And I noticed eye contact and gestures out of the corner of my eye. I could feel my anxiety and adrenaline skyrocket, and I was sick to my stomach, so I kind of panicked. Then I went through the checkout line, paid for my groceries and sprinted out into the parking lot. I locked my doors and sped out of there just as the men approached my car. I felt terrified.

While I should have called the police and found a store employee to help me, but panic overshadowed my rational thinking because I knew I didn’t have a way to effectively protect myself. No gun, no knife, no pepper spray, nothing. I felt helpless. At that moment, I knew I never wanted to feel that way again, so I gave in and decided to start buying some larger clothes in order to carry concealed inside my waistband. With proper clothing and the right holster, this proved to be the best option for me. Slowly, concealed carry became a normal part of my everyday life.

Concealed Pistol License Holder: Always On Alert

As I get older, I really don’t trust anyone. My friends think I’m kind of crazy and somewhat paranoid because I’m constantly screening and watching people when we go out. I’m also the only individual in my group of friends who has a CPL and one of the only ones who’s into guns and shooting. I’m always aware of my surroundings when I’m by myself or when I’m with my son, who’s almost five years old now. Scanning, people watching, observing cars, noting how long people are standing around and their body language, observing who’s around me when I get out of my vehicle and even paying attention to where I park at the store—all of this makes me a much safer person but also generates a bit of ridicule from friends and even family.

My son knows that both my husband and I carry guns. He saw and held my gun; he knows it’s not a toy. He’s been around guns his entire life, so he knows exactly why my husband and I carry, and he understands it’s a secret that no one else should ever know. Before he can even hold a gun in our home, he must tell us the four rules of gun safety. We raised him to respect guns and knows that they’re for protection and to keep us safe.

We promised him his first gun for his 5th birthday, and he’s beyond excited to be just like mommy and daddy. The fact that my son has been exposed to and knows so much about guns at his age brings its own challenges in today’s world. I have family and friends who act like we’re bad parents because we carry guns. People judge us daily and sometimes even ridicule us if they see a photo of Colton with a gun.

Encouraging Concealed Carry for Women

RELATED STORY

Why Concealed Carry for Women Is Both Necessary and Important

Why I Do It

I feel in control and have more confidence when I carry a gun. I know I have the ability to effectively protect myself and my family if a situation arises. Most close friends understand what my husband does for a living. He has his Federal Firearms License (FFL), teaches concealed pistol license classes and is a professional photographer in the firearms industry, so they just assume that at least one of us is carrying when we go out. It’s a hot topic, and it does make me a bit nervous to meet new parents during play dates or while out with new people. What if they ask what our professions are? Or what if they aren’t gun nuts like us? What if we’re judged for what we do or how we’re raising our son?

I always approach the subject openly; I want others to understand why I carry and why it’s a benefit to them, even if they don’t understand. And I cannot allow or rely on anyone else but myself to protect me and my family. The first time we met one of Colton’s friends’ parents, we were extremely nervous. What if they asked about our careers? Should I order a beer, or do they not drink? As we introduced ourselves, we noticed that the other dad was wearing an NRA cap. Yep, instant friends. I breathed a sigh of relief knowing that we all could talk about guns and my husband’s job. Hell, their son had already started shooting at their home range!

Living the Concealed Carrier Life

But I certainly don’t go out of my way to talk about my concealed pistol license and carrying if I don’t have to. With all of the recent child abductions, I’m even more observant of what’s going on around me, especially when I have Colton with me. I’m on especially high alert when we go out into a public play area. I literally size up anyone who looks suspicious or even remotely gives me bad vibes. I will protect my son with my life, even if that means I’m reaching for the gun on my hip.

This article is from the August-September 2019 issue of Personal Defense World magazine. Grab your copy at OutdoorGroupStore.com. For digital editions, visit Amazon.

The post Why One Mom Decided to Get Her Concealed Pistol License appeared first on Personal Defense World.

via Personal Defense World
Why One Mom Decided to Get Her Concealed Pistol License

Eloquent Subquery Enhancements in Laravel 6.0

Eloquent Subquery Enhancements in Laravel 6.0

If you’ve been following my work for any length of time, you know that I am a big fan of pushing more work in our Laravel applications to the database layer. By doing more work in the database we can often reduce the number of database queries we make, reduce the amount of memory our applications use, and reduce the amount of time required by Eloquent to process our models. This can result in some pretty significant performance wins.

One excellent way to push more work to the database is by using subqueries. Subqueries allow you to run nested queries within another database query. This can be a powerful way to retrieve ancillary model data, without making any additional database queries, when it’s not possible to do via a relationship. You can also use subqueries in order by statements, where statements, and other database clauses.

During my Laracon US 2019 talk, I made reference to a couple of query builder macros I’ve been using that make it easier to use subqueries in Laravel. I’ve since submitted three pull requests to Laravel to add these to the core framework.

Here’s an overview of each:

“Select” subqueries

Pull request #29567 adds support for subqueries to both the select() and addSelect() query builder methods.

For example, let’s imagine that we have a table of flight destinations and a table of flights to destinations. The flights table contains an arrived_at column which indicates when the flight arrived at the destination.

Using the new subquery select functionality in Laravel 6.0, we can select all of the destinations and the name of the flight that most recently arrived at that destination using a single query:

return Destination::addSelect(['last_flight' => Flight::select('name') ->whereColumn('destination_id', 'destinations.id') ->orderBy('arrived_at', 'desc') ->limit(1) ])->get(); 

Notice how we’re using Eloquent to generate the subquery here. This makes for a nice, expressive syntax. That said, you can also do this using the query builder:

return Destination::addSelect(['last_flight' => function ($query) { $query->select('name') ->from('flights') ->whereColumn('destination_id', 'destinations.id') ->orderBy('arrived_at', 'desc') ->limit(1); }])->get(); 

“Order by” subqueries

In addition, pull request #29563 makes it possible to use subqueries in the query builder’s orderBy() method. Continuing our example above, we can use this to sort the destinations based on when the last flight arrived at that destination.

return Destination::orderByDesc( Flight::select('arrived_at') ->whereColumn('destination_id', 'destinations.id') ->orderBy('arrived_at', 'desc') ->limit(1) )->get(); 

As with selects, you can also use the query builder directly to create the subquery. For example, maybe you want to order users based on their last login date:

return User::orderBy(function ($query) { $query->select('created_at') ->from('logins') ->whereColumn('user_id', 'users.id') ->latest() ->limit(1); })->get(); 

“From” subqueries

Finally, pull request #29602 makes it possible to use subqueries within the query builder’s from() method. These are sometimes called derived tables.

For example, maybe you want to calculate the average total donations made by users in your application. However, in SQL it’s not possible to nest aggregate functions:

AVG(SUM(amount)) 

Instead, we can use a from subquery to calculate this:

return DB::table(function ($query) { $query->selectRaw('sum(amount) as total') ->from('donations') ->groupBy('user_id'); }, 'donations')->avg('total'); 

You probably won’t need to use this every day, but when you do need it, it’s indispensable.

One breaking change to be aware of if you’re using Eloquent outside of Laravel is a signature change to the table() method on the Illuminate/Database/Capsule/Manager object. It’s been changed from table($table, $connection = null) to table($table, $as = null, $connection = null).

Learn more

If you’re interested in learning more about subqueries and other advanced database techniques, be sure to follow my blog, and also watch my Laracon US 2019 talk.

At Laracon I also announced a new video course I’m working on called Eloquent Performance Patterns. My goal with this course is to teach Laravel developers how to drastically improve the performance of their Laravel applications by pushing more work to the database layer, all while still using the Eloquent ORM. Be sure to join the mailing list for that if you’re interested!


Filed in: News


Enjoy this? Get Laravel News delivered straight to your inbox every Sunday.

No Spam, ever. We’ll never share your email address and you can opt out at any time.

via Laravel News
Eloquent Subquery Enhancements in Laravel 6.0

Make It Glide With UHMW Tape

Transcript

“Today I have some UHMW tape. It’s a very slippery plastic and so if you need things to slide across each other like you know when you’re pulling out your antique wooden drawers and they just kind of rub and stick. This tape solves that problem.”

Jordan Bunker

[Cool Tools has a YouTube channel with many more tool reviews]

UHMW Tape (TapeCase 423-5 UHMW Tape Roll)

Available from Amazon

via Cool Tools
Make It Glide With UHMW Tape