Posted by Max | Posted in .net | Posted on 15-07-2010
0
.NET framework provides number of classes to generate RSS 2.0 and ATOM feeds. Using them is easier then creating valid feed file using XmlWriter. Here is an example in C# how System.ServiceModel.Syndication classes could be used to produce valid RSS 2.0 feed.
Read the rest of this entry »
Posted by Max | Posted in .net | Posted on 13-07-2010
0
Generating XML using string concatenation is not a good programming practice, since there is a chance that XML entities like “<” won’t be properly encoded and will result in invalid XML file. It also opens the door to serious security vulnerability known as Cross-site scripting (XSS) attack if result XML is displayed as web page. .NET framework has a number of methods to produce valid XML file output. The following example shows how XmlTextWriter and XDocument classes could be used to generate XML as UTF-8 encoded string.
Read the rest of this entry »
Posted by Max | Posted in books | Posted on 10-07-2010
0

With recent release of Kindle reader application for Android I had a look on selection of electronic books available from Amazon Kindle store. Generally electronic books for Kindle cost less than its printed version, but there are some exceptions. For example, “Bad science” books is just 2 cents cheaper than a paper book.
Read the rest of this entry »
Posted by Max | Posted in gadgets | Posted on 10-07-2010
0

On eBay you can find a lot of gadgets you won’t find in your local electronic store. One of these items is GSM to SIP gateway. This device allows to make and receive VOIP calls from your regular mobile phone at any place where your mobile works.
Device requires SIM card from any GSM phone provider (any Australian provider, except Three, will do), wired Internet connection (plugs to your ADSL router) and some configuration using web based interface. You can get device on eBay for approximately AU$135 . It can save you lots of money if you call fixed numbers from your mobile (VOIP call to fixed number in Australia will cost you from 0 to 15 cents per call, depending on provider). You can also get DID number in any Australian city and map it to this gateway which will transfer incoming VOIP calls to your mobile using mobile network.
I don’t expect this type if device to be sold at any mobile carrier outlet, since it reduces their revenues, so purchasing it online is the only option.
Related links:
- GSM to SIP gateways on eBay
- Voipstunt – VOIP provider. Pay 10 Euro and get free calls to landlines in 30 countries including Australia.
- DID Worldwide – get local phone number in more than 70 countries and map it to your SIP phone gateway, Skype or our regular phone line. Local DID numbers for all capital cities and some others available from $8 per month
Posted by Max | Posted in .net | Posted on 08-07-2010
0
This code sample written in C# calculates fibonacci number for specified position.
[TestClass]
public class Fibonacci
{
[TestMethod]
public void GetFibonacciNumberTest()
{
//0, 1, 2, 3, 4, 5, 6, 7
//0, 1, 1, 2, 3, 5, 8, 13
Assert.AreEqual(0, GetFibonacciNumber(1));
Assert.AreEqual(1, GetFibonacciNumber(2));
Assert.AreEqual(2, GetFibonacciNumber(3));
Assert.AreEqual(3, GetFibonacciNumber(4));
Assert.AreEqual(8, GetFibonacciNumber(6));
Assert.AreEqual(6765, GetFibonacciNumber(20));
}
private static int GetFibonacciNumber(int n)
{
int first = 0;
int second = 1;
int result = 0;
if(n == 1) return first;
if (n == 2) return second;
for(int i=1; i<n; i++)
{
result = first + second;
first = second;
second = result;
}
return result;
}
}
Posted by Max | Posted in sql | Posted on 02-07-2010
0
Unique sequential number could be assigned in SQL Server using Common table expression and UPDATE statement.
;WITH RankedTable AS
(
SELECT *, row_number() OVER(PARTITION BY DepartmentID ORDER BY LastName) AS RowNumber
FROM Users
)
UPDATE RankedTable
SET Rank = RowNumber
Posted by Max | Posted in books | Posted on 30-06-2010
0
Programming books usually have very short life span. Very few people would buy ASP.NET 2.0 book if version 4.0 is already released. So the book with original price of $50 is now being sold for $5.

But the are some exceptions. Books on software architecture, object-oriented design are still useful. So if you are interested in getting whose books go to Basement Books store which is located near Central station where you can get the following books for very good price.
For a complete list of computer books available at the store visit this page.



Posted by Max | Posted in WTF | Posted on 30-06-2010
0
Showing old and new prices is a good marketing trick, but I’m not sure if that works if price has actually increased by 15 cents.

Or did not change at all:

Grocery bags: Black is new “green”

Targeted advertisement in male toilet:
