Before the PHP code starts, add the following lines: These two lines set script-wide variables that will allow the errors in your current script to output to screen.
Fatal error C1083: Cannot open include file: ‘iostream.h’: No such file or directory when trying to compile your C / C++ code
This is a common mistake among C programmers who start coding in a new environment with a new compiler such as .NET 1.1 or .NET 2.0. You get the error because the iostream.h file is no longer used with these compilers, instead use the ISO compliant file iostream: #include <iostream>;
How to redirect www requests to non-www URL
If you would like to redirect all the requests to the www version of an URL to the non-www version – for example http://geekpedia.com to http://geekpedia.com – you can do that by placing the following mod_rewrite rule in your .htaccess file: RewriteCond %{HTTP_HOST} ^www.geekpedia.com$ [NC]RewriteRule ^(.*)$ http://geekpedia.com/$1 [R=301,L] The redirect code 301 means Moved Permanently […]
Display Time Left To a Date
A PHP function to display the time between now and a future date supplied as Unix time, in human readable format, using two blocks of time periods (year, month, week, day, hour or minute.)
A complete list of what each IntelliSense icon from Visual Studio .NET means
Here’s what the icons in Intellisense from Microsoft Visual Studio .NET represent: Assembly Delegate Event Interface Namespace Structure Public class Protected class Private class Public constant Protected constant Private constant Public enumeration Protected enumeration Private enumeration Constant inside enumeration Public method Protected method Private method Public property Protected property Private property Public variable Protected variable […]
Search and replace table field contents
The query below will replace all occurences of “Bob Loblaw Law Blog” found in the field “BlogName” field of the Blogs table. All instances of the string are being replaced, and the search is case sensitive. The function is also multi-byte safe.
Google Chrome Beta User Agent String
The first beta version of the Google Chrome browser has an user agent string of its own, and although it will change with the next version, it will most likely follow the same format thus making it safe to implement into your current code: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) […]
How do I set the type of an enumeration?
Usually you don’t specify a type for an enumeration and the default will be considered, which is int.In the following example we change the type to unsigned int (uint):
How To Prevent Hotlinking Using .htaccess
A very easy way to prevent your gif, jpeg, png files (and any other file formats you choose) from being hotlinked in other websites is to use a few mod_rewrite rules in your .htaccess file.
When you have to pass an array to a method, you can directly pass the values without creating the array
If you have to pass an array to the method myMethod you would usually do something similar to this: int[] myArray = new int [3] {23, 48, 96, 114};myClass.myMethod(myArray); But why create an array when you can pass the integers directly? The compiler takes care to pack the integers into an array. myClass.myMethod(23, 48, 96, 114);