[CSS 3] Give Your Website Rounded Corners with Pure CSS!

Back in the CSS 2 days, giving images or div elements rounded corners was quite a hassle. The simple option was to use a function that someone had already written in jQuery. If you preferred to do it yourself, you had to design rounded-corner images and overlay them on each other. In short, it was very complicated. But in CSS 3 you no longer need such cumbersome tricks. You can just set it directly in your CSS! ...

April 16, 2011 · 2 min

Generating QR Codes Directly in the Browser With jQuery.qrcode

There are many ways to draw a QR Code. You can write your own function to draw it, or you can use an API someone else provides. For example, using the Google Chat API to generate a QR Code is the API approach. The jquery.qrcode covered in this post uses a function someone else wrote to generate the code. At first I couldn’t tell the difference between jquery.qrcode and the Google Chat API. Later I learned that the Google Chat API sends the data to Google’s servers to generate the code, while jquery.qrcode draws it directly in the browser. ...

April 8, 2011 · 1 min

Printing Triangles: Top-Left, Bottom-Left, Top-Right, Bottom-Right

These were some examples my programming teacher used when teaching loops in class. I think the problems themselves aren't hard, but they're great for practicing loops and training your reaction speed. Also, my VB skills have gotten a lot rusty... So I'm attaching the C++ code for everyone to look at. Go study it yourselves~ ...

March 21, 2011 · 1 min

[C++] How to Do Exponentiation and Square Roots (sqrt, pow)

In some programming languages, you can do exponentiation directly with the ^ operator. But while working on a problem, I found out that in C++, you have to use the pow function to do exponentiation. This article introduces two functions: pow, which does exponentiation for you, and sqrt, which takes square roots. ...

March 18, 2011 · 1 min

[C++] Reversing Numbers and Strings (Applications: Type Conversion, String Handling, Loops)

This is a fairly simple problem: it just reverses a number or a string. For example, input "linroex" and the output is "xeornil", or input 123 and get 321. The solution isn't hard. In C++, you can access a string like an array, so we set up a loop whose end value is the length of the input string. On each pass, we move the last remaining character of string X to the first position of string Y. When the loop finishes, the reversal is complete. ...

March 6, 2011 · 2 min

How to Detect IE and Apply the Matching Code? (The If IE Technique)

If you are a web designer, the thing you hate most when designing pages is browser compatibility. Every browser supports CSS and JavaScript differently. Your CSS might look perfectly fine in Chrome, but show different results in Firefox. This happens most often with IE, because IE has the weakest support for CSS and JavaScript. Other browsers might just look a little different, while in IE the effect may not show up at all… So this article shows you how to apply specific code or CSS only to IE, or only to non-IE browsers. ...

February 28, 2011 · 2 min

[Google API] Generating QR Codes with the Google Chart API, with PHP Example Code

In this post, I’ll show you how to make QR codes with the Google Chart API. A QR code is the two-dimensional barcode that’s very popular right now. Generating a 2D barcode used to be a hassle, but with the Google Chart API, you can quickly generate a QR code from just a URL. I originally planned to write a post dedicated to the Google Chart API, but I decided to split it up instead~ (I also happened to come across the site Shadow’s Tech Database, which introduces it, and I couldn’t resist writing about it~) ...

February 24, 2011 · 1 min

[Python] The First Step into the Python World: HelloWorld (Printing Text and Writing Comments)

Almost every programming language book starts with a first practice program, which is Hello World. Hello World means making the program print "HelloWorld". In this article, we will show you how to write your first Python program and briefly explain some basic Python usage....

February 20, 2011 · 2 min

[Python] Python Interpreter Installation Tutorial

Recently I've been playing around with Google Storage, so I dusted off a Python book that had been gathering dust and read through it. Together with the documentation on Google Code, I wrote a small automatic backup program. It's still very simple, so I won't publish it yet. But writing it made me realize that Python is a fairly easy programming language. In terms of ease of learning and rigor, it's about on par with VB. In terms of verbosity, though, Python wins over VB (I mean VB is the wordier one XD). For example, an if statement in VB has to be written as if.....then.......end if, while in Python you just write if....: to get started. Indentation also matters a lot in Python. If the indentation is wrong, the program won't run, because the interpreter uses indentation to decide where selection structures, loops, and so on end. Personally, I'd recommend Python to beginners, since it lets you write very neat code ~...

February 18, 2011 · 3 min

Does Your Program Need to Run as Administrator? Make a .NET Program Run as Administrator by Default~

Sometimes when you develop a program in Visual Studio, it may need administrator privileges, for example to access system folders or to use certain high-level WinAPIs. On Windows XP, using administrator privileges is not a big deal. But if you want your program to run on Windows 7 or Vista, you have to grant the program administrator rights, or it will run into problems halfway through. Generally, you can ask users to right-click the program and select “Run as administrator,” but that feels odd, because users would have to set it up themselves. Actually, there is another way to make your program run as administrator by default, so users don’t need to configure anything. ...

February 16, 2011 · 1 min