Lin's Blog
|
  • Zh-Tw
  • Ja
  • Posts
  • Categories
  • About

[PHP] Listing Files in a Folder with glob, scandir, and readdir

Sometimes you need to write a PHP program that gets a list of the files in a specified folder. For example, I needed this feature when I was making an online hard drive program. Here I’ll introduce three functions that can all do this, though each is used a bit differently: glob, scandir, and readdir. ...

Programming
#PHP
August 17, 2011 · 2 min

Google Dictionary Was Suddenly Shut Down. What Do We Do Now!?

A few days ago, Google Dictionary was shut down without warning, and a lot of people panicked. We had all gotten used to looking up unfamiliar words on Google Dictionary whenever we came across them. Google said the dictionary’s features had been merged into Google Search and Google Translate, so the dictionary had completed its phased mission and it was time to say goodbye~ ...

Web Apps
#Google #Dictionary
August 12, 2011 · 2 min

Why Does My Visual Studio UI Look Different After Compiling?

This is a problem I ran into recently while coding. If you also develop with Visual Studio and have run into a similar issue, where the UI design in VS and the result you get when running the program don’t match, I recommend checking out my fix. It’s a bit silly, but it works well XD ...

Programming
#Visual Studio
August 10, 2011 · 2 min

Opera Unite: Easily Set Up File Sharing, Instant Messaging, and Cloud Music!

Opera Unite is a special feature built into the Opera browser. With Opera Unite, even if you know nothing about computers, you can set up a simple cloud service. Sometimes you have a great song you want to share with a friend. Besides the usual ways of sending files, like instant messaging, MSN, or email, you can also try the built-in Media Player in Opera Unite. Just send your friend the URL, and they can listen to the music right in their browser! You can also set up a WebCam so you can check on things at home while you’re away. Opera Unite has built-in features like that too. In short, Opera Unite is a great service. Normally, to build a website, you have to apply for a domain name and hosting space, and you need basic computer skills. But with Opera Unite, none of that is needed! Your computer is the server, and Opera automatically assigns the domain name. ...

Software
#Opera
August 10, 2011 · 5 min

Changing PHP's Execution Time Limit to Keep Long-Running Scripts from Being Stopped

By default, PHP has a 30-second execution limit. When a program runs longer than 30 seconds, you get an error like this: “Fatal error: Maximum execution time of 30 seconds exceeded”. This is a safeguard against bugs, such as infinite loops or other strange code that could end up bringing the system down. However, sometimes your program really needs to run for more than 30 seconds. For example, you might be processing a very large file in PHP, such as a database backup that can be hundreds of MB, which takes a long time and can easily exceed 30 seconds. My earlier Plurk BOT and spider programs also ran into this easily. Here I’ll show you two ways to adjust this time limit. ...

Programming
#PHP
August 9, 2011 · 2 min

Turn On Google 2-Step Verification and Add Another Lock to Your Google Account with Your Phone!

Some people who play online games may have heard of the “communication lock.” It’s an anti-theft measure that game companies came up with. Before you can log in to your game account, you have to call a dedicated line from the phone number you registered with the game company, and only after the call connects can you log in. This method prevents a lot of gamers from having their accounts stolen. After all, hackers can easily get your username and password, but they surely can’t take your phone too, right? The Google 2-Step Verification I’m introducing today is actually a lot like that communication lock. ...

Security
#Two-Step Verification #Google
August 9, 2011 · 6 min

Doomi: An Adobe AIR-Based ToDoList App to Help You Plan Your Schedule

Doomi is an application built on Adobe AIR technology that helps you create a ToDoList, which is basically a memo list. There are many programs similar to Doomi. For example, Google Desktop has widgets with this kind of function, and even iOS 5 plans to include a built-in ToDoList app called Reminders. What makes Doomi stand out is its intuitive, good-looking interface. You hardly need any tutorial; as soon as you see the interface, you know how to use it. Also, you need to install Adobe AIR before you can use Doomi. ...

Software
#Adobe AIR
August 7, 2011 · 3 min

Have You Seen 'TRON: Legacy'? LightBike 2 Lets You Play Light Cycle Racing on Your iPad!

Have you seen TRON: Legacy? You’ll remember the scene where the main character enters the virtual world and gets thrown into an arena battle. Recently my younger brother introduced me to an iOS app called LightBike 2. It’s available for both iPhone and iPad, and you can play online~ It’s technically a racing game, but its gameplay is very fresh and almost identical to the movie. In LightBike, the bike you’re riding leaves a light wall behind it on the ground. If an opponent crashes into a light wall, they’re out. LightBike has two modes: one where the first player to win three rounds wins, and another where you get three lives and whoever keeps their lives the longest wins. ...

Games
#IPad #App Store
August 6, 2011 · 5 min

An Explanation of the Recent Site Outage

I think many of you noticed that my site was unreachable for the whole day yesterday. Let me explain what happened. It was definitely not because I wanted to give up on the blog XD. The night before last, while I was writing a post, I logged into the wrong host. I have two servers: one for the site and one for writing posts. While I was writing, I accidentally logged into the site server and made some changes there. I didn’t realize my mistake until I finished the post… So the server that runs the site got messed up. The Apache configuration file was overwritten, and unluckily I had no backup of it. I had only backed up the site folder and the database, and I never imagined I would do something this stupid XD. So the site went down for a whole day… ...

Blog
#Blogging
August 5, 2011 · 2 min

How to Defend Against Basic SQL Injection in PHP?

For the past few days I’ve been writing a small program to organize contacts, so I’ve been researching quite a few things. While working on the database side, I wanted to guard against so-called SQL injection, where a malicious string is placed in a parameter to attack the database. So I applied some basic defenses. The following is how to add some basic protection against SQL injection~ ...

Programming
#PHP #SQL #Hardening
August 2, 2011 · 3 min
« Prev  Next 

Categories

All Programming AI SRE Life Hardware Software Blog Travel Web Apps Games Security
© 2026 Lin's Blog · Powered by Hugo & PaperMod