Tuesday, February 26, 2008

Implementing the Singleton Pattern in C#

Implementing the Singleton Pattern in C#

Implementing the Singleton Pattern in C#

The singleton pattern is one of the best-known patterns in software engineering. Essentially, a singleton is a class which only allows a single instance of itself to be created, and usually gives simple access to that instance. Most commonly, singletons don't allow any parameters to be specified when creating the instance - as otherwise a second request for an instance but with a different parameter could be problematic! (If the same instance should be accessed for all requests with the same parameter, the factory pattern is more appropriate.) This article deals only with the situation where no parameters are required. Typically a requirement of singletons is that they are created lazily - i.e. that the instance isn't created until it is first needed.

There are various different ways of implementing the singleton pattern in C#. I shall present them here in reverse order of elegance, starting with the most commonly seen, which is not thread-safe, and working up to a fully lazily-loaded, thread-safe, simple and highly performant version. Note that in the code here, I omit the private modifier, as it is the default for class members. In many other languages such as Java, there is a different default, and private should be used.

All these implementations share four common characteristics, however:

  • A single constructor, which is private and parameterless. This prevents other classes from instantiating it (which would be a violation of the pattern). Note that it also prevents subclassing - if a singleton can be subclassed once, it can be subclassed twice, and if each of those subclasses can create an instance, the pattern is violated. The factory pattern can be used if you need a single instance of a base type, but the exact type isn't known until runtime.
  • The class is sealed. This is unnecessary, strictly speaking, due to the above point, but may help the JIT to optimise things more.
  • A static variable which holds a reference to the single created instance, if any.
  • A public static means of getting the reference to the single created instance, creating one if necessary.

Note that all of these implementations also use a public static property Instance as the means of accessing the instance. In all cases, the property could easily be converted to a method, with no impact on thread-safety or performance.

First version - not thread-safe

// Bad code! Do not use!
public sealed class Singleton
{
static Singleton instance=null;

Singleton()
{
}

public static Singleton Instance
{
get
{
if (instance==null)
{
instance = new Singleton();
}
return instance;
}
}
}

As hinted at before, the above is not thread-safe. Two different threads could both have evaluated the test if (instance==null) and found it to be true, then both create instances, which violates the singleton pattern. Note that in fact the instance may already have been created before the expression is evaluated, but the memory model doesn't guarantee that the new value of instance will be seen by other threads unless suitable memory barriers have been passed.

Second version - simple thread-safety

public sealed class Singleton
{
static Singleton instance=null;
static readonly object padlock = new object();

Singleton()
{
}

public static Singleton Instance
{
get
{
lock (padlock)
{
if (instance==null)
{
instance = new Singleton();
}
return instance;
}
}
}
}

This implementation is thread-safe. The thread takes out a lock on a shared object, and then checks whether or not the instance has been created before creating the instance. This takes care of the memory barrier issue (as locking makes sure that all reads occur logically after the lock acquire, and unlocking makes sure that all writes occur logically before the lock release) and ensures that only one thread will create an instance (as only one thread can be in that part of the code at a time - by the time the second thread enters it,the first thread will have created the instance, so the expression will evaluate to false). Unfortunately, performance suffers as a lock is acquired every time the instance is requested.

Note that instead of locking on typeof(Singleton) as some versions of this implementation do, I lock on the value of a static variable which is private to the class. Locking on objects which other classes can access and lock on (such as the type) risks performance issues and even deadlocks. This is a general style preference of mine - wherever possible, only lock on objects specifically created for the purpose of locking, or which document that they are to be locked on for specific purposes (e.g. for waiting/pulsing a queue). Usually such objects should be private to the class they are used in. This helps to make writing thread-safe applications significantly easier.

Third version - attempted thread-safety using double-check locking

// Bad code! Do not use!
public sealed class Singleton
{
static Singleton instance=null;
static readonly object padlock = new object();

Singleton()
{
}

public static Singleton Instance
{
get
{
if (instance==null)
{
lock (padlock)
{
if (instance==null)
{
instance = new Singleton();
}
}
}
return instance;
}
}
}

This implementation attempts to be thread-safe without the necessity of taking out a lock every time. Unfortunately, there are four downsides to the pattern:

  • It doesn't work in Java. This may seem an odd thing to comment on, but it's worth knowing if you ever need the singleton pattern in Java, and C# programmers may well also be Java programmers. The Java memory model doesn't ensure that the constructor completes before the reference to the new object is assigned to instance. The Java memory model underwent a reworking for version 1.5, but double-check locking is still broken after this without a volatile variable (as in C#).
  • Without any memory barriers, it's broken in the ECMA CLI specification too. It's possible that under the .NET 2.0 memory model (which is stronger than the ECMA spec) it's safe, but I'd rather not rely on those stronger semantics, especially if there's any doubt as to the safety. Making the instance variable volatile can make it work, as would explicit memory barrier calls, although in the latter case even experts can't agree exactly which barriers are required. I tend to try to avoid situations where experts don't agree what's right and what's wrong!
  • It's easy to get wrong. The pattern needs to be pretty much exactly as above - any significant changes are likely to impact either performance or correctness.
  • It still doesn't perform as well as the later implementations.

Fourth version - not quite as lazy, but thread-safe without using locks

public sealed class Singleton
{
static readonly Singleton instance=new Singleton();

// Explicit static constructor to tell C# compiler
// not to mark type as beforefieldinit
static Singleton()
{
}

Singleton()
{
}

public static Singleton Instance
{
get
{
return instance;
}
}
}

As you can see, this is really is extremely simple - but why is it thread-safe and how lazy is it? Well, static constructors in C# are specified to execute only when an instance of the class is created or a static member is referenced, and to execute only once per AppDomain. Given that this check for the type being newly constructed needs to be executed whatever else happens, it will be faster than adding extra checking as in the previous examples. There are a couple of wrinkles, however:

  • It's not as lazy as the other implementations. In particular, if you have static members other than Instance, the first reference to those members will involve creating the instance. This is corrected in the next implementation.
  • There are complications if one static constructor invokes another which invokes the first again. Look in the .NET specifications (currently section 9.5.3 of partition II) for more details about the exact nature of type initializers - they're unlikely to bite you, but it's worth being aware of the consequences of static constructors which refer to each other in a cycle.
  • The laziness of type initializers is only guaranteed by .NET when the type isn't marked with a special flag called beforefieldinit. Unfortunately, the C# compiler (as provided in the .NET 1.1 runtime, at least) marks all types which don't have a static constructor (i.e. a block which looks like a constructor but is marked static) as beforefieldinit. I now have a discussion page with more details about this issue. Also note that it affects performance, as discussed near the bottom of this article.

One shortcut you can take with this implementation (and only this one) is to just make instance a public static readonly variable, and get rid of the property entirely. This makes the basic skeleton code absolutely tiny! Many people, however, prefer to have a property in case further action is needed in future, and JIT inlining is likely to make the performance identical. (Note that the static constructor itself is still required if you require laziness.)

Fifth version - fully lazy instantiation

public sealed class Singleton
{
Singleton()
{
}

public static Singleton Instance
{
get
{
return Nested.instance;
}
}

class Nested
{
// Explicit static constructor to tell C# compiler
// not to mark type as beforefieldinit
static Nested()
{
}

internal static readonly Singleton instance = new Singleton();
}
}

Here, instantiation is triggered by the first reference to the static member of the nested class, which only occurs in Instance. This means the implementation is fully lazy, but has all the performance benefits of the previous ones. Note that although nested classes have access to the enclosing class's private members, the reverse is not true, hence the need for instance to be internal here. That doesn't raise any other problems, though, as the class itself is private. The code is a bit more complicated in order to make the instantiation lazy, however.

Performance vs laziness

In many cases, you won't actually require full laziness - unless your class initialization does something particularly time-consuming, or has some side-effect elsewhere, it's probably fine to leave out the explicit static constructor shown above. This can increase performance as it allows the JIT compiler to make a single check (for instance at the start of a method) to ensure that the type has been initialized, and then assume it from then on. If your singleton instance is referenced within a relatively tight loop, this can make a (relatively) significant performance difference. You should decide whether or not fully lazy instantiation is required, and document this decision appropriately within the class. (See below for more on performance, however.)

Exceptions

Sometimes, you need to do work in a singleton constructor which may throw an exception, but might not be fatal to the whole application. Potentially, your application may be able to fix the problem and want to try again. Using type initializers to construct the singleton becomes problematic at this stage. Different runtimes handle this case differently, but I don't know of any which do the desired thing (running the type initializer again), and even if one did, your code would be broken on other runtimes. To avoid these problems, I'd suggest using the second pattern listed on the page - just use a simple lock, and go through the check each time, building the instance in the method/property if it hasn't already been successfully built.

Thanks to Andriy Tereshchenko for raising this issue.

A word on performance

A lot of the reason for this page stemmed from people trying to be clever, and thus coming up with the double-checked locking algorithm. There is an attitude of locking being expensive which is common and misguided. I've written a very quick benchmark which just acquires singleton instances in a loop a billion ways, trying different variants. It's not terribly scientific, because in real life you may want to know how fast it is if each iteration actually involved a call into a method fetching the singleton, etc. However, it does show an important point. On my laptop, the slowest solution (by a factor of about 5) is the locking one (solution 2). Is that important? Probably not, when you bear in mind that it still managed to acquire the singleton a billion times in under 40 seconds. That means that if you're "only" acquiring the singleton four hundred thousand times per second, the cost of the acquisition is going to be 1% of the performance - so improving it isn't going to do a lot. Now, if you are acquiring the singleton that often - isn't it likely you're using it within a loop? If you care that much about improving the performance a little bit, why not declare a local variable outside the loop, acquire the singleton once and then loop. Bingo, even the slowest implementation becomes easily adequate.

I would be very interested to see a real world application where the difference between using simple locking and using one of the faster solutions actually made a significant performance difference.

Conclusion (modified slightly on January 7th 2006)

There are various different ways of implementing the singleton pattern in C#. A reader has written to me detailing a way he has encapsulated the synchronization aspect, which while I acknowledge may be useful in a few very particular situations (specifically where you want very high performance, and the ability to determine whether or not the singleton has been created, and full laziness regardless of other static members being called). I don't personally see that situation coming up often enough to merit going further with on this page, but please mail me if you're in that situation.

My personal preference is for solution 4: the only time I would normally go away from it is if I needed to be able to call other static methods without triggering initialization, or if I needed to know whether or not the singleton has already been instantiated. I don't remember the last time I was in that situation, assuming I even have. In that case, I'd probably go for solution 2, which is still nice and easy to get right.

Solution 5 is elegant, but trickier than 2 or 4, and as I said above, the benefits it provides seem to only be rarely useful.

(I wouldn't use solution 1 because it's broken, and I wouldn't use solution 3 because it has no benefits over 5.)

Friday, February 15, 2008

SQLite on .NET in 3 minutes. Download to querying in no time flat.

SQLite on .NET in 3 minutes. Download to querying in no time flat

SQLite on .NET - Get up and running in 3 minutes.

You found it! The quick and dirty guide to setting up SQLite with .Net in 3 minutes. Small, fast, and ass-kicking like a transactional Jackie Chan. At least that’s what this campy image created just for this post says. (Shout out to righteous graphics dude Brian Cook for the sweet photoshoppery)

SQLite on .Net, small, fast, ass-kicking.

SQLite: The compelling introduction
You’re writing some smallish app. You know the type. Those little one-offs where you clean up some data, scrape your competitor’s web site, change traffic light colors, blah blah blah. It’s cool enough to warrant it’s own solution, but not so big that you are going to tie into your company’s SQL Server instances. Let’s face it, you don’t really need the hassle of dealing power tripping DBA / IT guys for this project, especially now that their delusions of grandeur have been magnified by the return of American Gladiators to prime time.

Enter SQLite: the quick skinny / speed-date overview:
SQLite, if you weren’t already aware, is an open source, tiny (600K!), *zero install*, transactional database. But theres more! SQLite is as fast or faster than some of the big guys you use every day, largely because there is no server process, no listeners, no FD&C Yellow #5, none of that crapola. The database is just a single file and you communicate with it through a linked in library. Think of the old access days, but not really.

SQLite implements most of the SQL-92 standard. All of the query related stuff you actually care about is there, triggers, views, etc. The only thing missing is stored procedures but that’s probably not a requirement for your project, if at all. And no, I don’t want to get in to the old sps vs. not-sps tangent, man thats so aggressively nerdy in a Kirk vs Picard way.

… But I digest….

As the the SQLite home page will happily tell you, “SQLite is the most widely deployed SQL database engine in the world.” It’s used by little guys you may have heard of like, oh, I don’t know, Adobe, Apple, FireFox, GE, Google, Skype, Sun, and several shadow governments best left un-named. The crazy part is that you rarely hear about SQLite as a real .Net Dude / Dudette developer. I think this is because it’s often bundled inside of things you didn’t really think were using a database like FireFox or Google Gears, but the research bears out that this bad boy is more than capable for real-life tasks like being the back-end db for dynamic web sites with some pretty serious traffic.

SQLite is great for that small-mediumish application we already spec-ed out so lets get into the quick and dirty setup to get this hog rockin’ on .NET.

SQLite : The Quick and Dirty Setup for .NET.

1) Download SQLite
While you can get the generic windows binary on the SQLite download page, I’m going to recommend you instead grab the ADO.NET 2.0 Provider for SQLite from sourceforge. I’m not saying this is the most performant version (it does have an ADO wrapper with its attendant malarkey), but it really is a super-easy starting implementation that’s probably good enough for the long haul.

2) Copy the resultant DLL (System.Data.SQLite.DLL) to your project and add a reference.

3) Download and install one of the billions of SQLite GUI clients. I’ve been using the aptly named “SQLite Administrator” (FREE) which has a sweet, Query Analyzer-alike interface. You can find a big list of SLQLite gui clients here http://www.sqlite.org/cvstrac/wiki?p=ManagementTools if you are so inclined.SQLite administrator tool, free and badassed.

4) Through the GUI, create a database and make a test table of whatever floats your boat. The result will be a single file with a .s3db extension.

5) There is no step 5! DONE! You can now query, insert, update, delete, create, truncate, etc, to your heart’s content using the System.Data.SQLite ADO wrapper. Here is a little helper db util type class to show you the basic schleck:

public static DataTable GetDataTable (string sql)

{

DataTable dt = new DataTable();

try

{

SQLiteConnection cnn = new SQLiteConnection(“DataSource=C:CheckoutWorldDominator.s3db”);

cnn.Open();

SQLiteCommand mycommand = new SQLiteCommand(cnn);

mycommand.CommandText = sql;

SQLiteDataReader reader = mycommand.ExecuteReader();

dt.Load(reader);

reader.Close();

cnn.Close();

} catch {

// Catching exceptions is for communists

}

return dt;

}public static int ExecuteNonQuery(string sql)

{

SQLiteConnection cnn = new SQLiteConnection(“Data Source=C:CheckoutWorldDominator.s3db”);

cnn.Open();

SQLiteCommand mycommand = new SQLiteCommand(cnn);

mycommand.CommandText = sql;

int rowsUpdated = mycommand.ExecuteNonQuery();

cnn.Close();

return rowsUpdated;

}

public static string ExecuteScalar(string sql)

{

SQLiteConnection cnn = new SQLiteConnection(“DataSource=C:CheckoutWorldDominator.s3db”);

cnn.Open();

SQLiteCommand mycommand = new SQLiteCommand(cnn);

mycommand.CommandText = sql;

object value = mycommand.ExecuteScalar();

cnn.Close();

if (value != null)

{

return value.ToString();

}

return “”;

}

NOTE: Above code is quicky crap. It’s just to show you the gist.

Some uses for SQLite to consider:

Configs / Settings: SQLite is a good alternative to xml config files or registry settings for things like user account info and application preferences. It supports encryption, so feel free to keep your brilliant patent ideas in there.

Persistent Caching: You can use SQLite as a DB for cache data that needs to persist through reboots / application recycles. Maybe you have some expensive one-time-on-loadup queries from your enterprise db that you cache up and use in your website or app. By timestamping the data into a local SQLite db, you can live through application restarts and only refresh your cache at the threshold you want to.

Slicing and Dicing data: Load in some data and query to your heart’s content. Great for analyzing data at your leisure, worming through subsets of data, etc. Since its just a little db on your on box, no one is going to hassle you. Managers who were once developers will appreciate being to query through data with SQLite vs. using excel as they usually are too crusty to still have permissions on the real db.

Full DB for One-off apps: Sometimes you write a quickie app that just harvests something in a funky way and collects data. You can output the data as you are grabbing it in all kinds of ways, but throwing into a db is ideal.

Linkage to some more in-depth stuff ……….

- SQLite is pretty hip with with the alt.net scene, you can follow on from here to check out a SQLite NHibernate provider, or here for a SQLite Subsonic provider.

- If you are rockin’ the 3.0 framework there is even a SQLite Linq provider.

- For a comprehensive SQLite how-to (emphasizing command line, non-MS specific) : SQLite Tutorial

- And in case you missed it up top, the main SQLite project page is here.

But football in the groin had a football in the groin!Have a good idea for ways to use SQLite in .Net projects? Been hit in the groin with a football for even suggesting using something like this at your company? Have some award-winning successes or outlandish failures already with SQLite? Leave a funky-fresh comment!

Thursday, February 7, 2008

10个最好用搜索网站出炉 试问Google缘何落榜?

10个最好用搜索网站出炉 试问Google缘何落榜?
互联网时代带来不仅仅是技术上的革命,给我们的日常生活也带来实实在在的改变。理论上,来自全世界的消息,新闻以及评论我们都可以通过点击鼠标轻松 浏览。但是如果要准确的找到所要的东西并非易事。用好英国《每日电讯报》介绍的10个独特的搜索网站,也许你才可以在英文资源占主导的互联网上变成一个真 正的 “冲浪者”。

在全世界数以十亿计的网页面前,不少人会感到迷 茫。根据AOL(美国在线服务公司,是美国最大因特网服务提供商之一)的最新研究表明,有一半以上的英国互联网用户承认他们在海量的网络信息中“迷失”。 对于许多人来说,他们的网络历程仅仅从“google”开始,也从“google”结束。

每年“损失”15天

调查显示,有将近三分之一的被调查者把这归罪于网络可得到的信息太多,更多的三分之二的人则表示网上的信息缺乏准确性和可靠性的管理。据统计,想要在网上找信息,却不知如何下手而漫无目的的“闲逛”,这样的时间每年将浪费15天之多。

其中,的确有一些人的上网习惯一开始就没有改变过来。的确,“google”搜索引擎毫无疑问是一个寻找网络资源的必到之地,但是在某些方面,它却做得不是最快和最好的。因为它只是一个被动的搜索,它并没有在所搜索的前后连贯性以及可靠性上给你帮助。

在这里,英国媒体选出的10个最好的搜索网站,每个人都应该把他们放在自己的网页收藏夹里。因为它会帮助你更容易的找到你所想要的信息。这样你就不会在虚拟的网络世界里“迷失”自己。

知识类

世界知识

网站地址:tinyurl.com/2b2kg9

这个网站由CIA(美国中央情报局)提供信息和庞大的统计数据,在这里你可以找到世界上所有国家的情报,包括国旗,地图,历史等等。

问题问答

网站地址:www.answers.com

在这个网站你可以问任何问题,网站不仅会搜索出问题的答案,甚至还会列出相关的问题以供参考。其中你可以点击“超链接”来查看答案的原始来源。

图书索引

网站地址:www.lii.org

有时候网上搜索到的消息并不能让你相信,但是在这里你可以打消这个顾虑。这个由美国的图书管理员运营的网站的正确性和可靠性,连“维基百科”也要参考其答案。它对于健康,生命或者客观物质等等知识的搜索有着更好的结果。

音乐类

音频资料

网站地址:www.skreemr.com

想要在网上找到歌曲的片断,或者一次著名演讲的音频资料吗?skreemr网站能够做到这一切,它的搜索范围包括互联网上能够找到的所有音乐文件的索引。此外,它还可以告诉你在那里可以买到合法的音乐制品。

歌词总汇

网站地址:www.lyricsfreak.com/

和音乐产业中的规范化相比,这个网站给了众多的不入流艺术家更大的舞台。这个网站的歌词数据库,包含了几千支乐队以及独立艺术家创作的歌词。

服务类

软件下载

网站地址:www.download.com

如果想要在网上下载软件,这个网站也许是你的最好选择。在这里,你可以找到几千个软件,其中大部分是免费的,还有一些只是象征性的收费。虽然软件的更新速度很快,但是这里却保留着许多软件的老版本。

搜索一把抓

网站地址:www.turboscout.com

网上的搜索引擎服务不少,却不知道哪一个最好用。turboscout网站集成了70多个搜索引擎的搜索服务,无论是网页,图片,还是博客,音频/视频都可以一网打尽!

休闲类

旅游顾问

网站地址:www.tripadvisor.com

毫无疑问,tripadvisor网站是旅游方面信息做得最好的网站。甚至有人说,在你来过网站之前千万不要提前预定房间。来访者在这里留下最真诚,客观的评价,给你外出旅游提供最好的忠告。

杂志浏览

网站地址:www.fabsearch.com

没有时间去翻阅众多的杂志?也许这个网站可以帮到你,它把《Elle》,《闲谈者》,《名利场》,《vogue》等杂志上最好的话题都拿到了网上,并且按照城市来区分相关问题方便人们的浏览。

经典怀旧

网站地址:www.summize.com

这个网站也许是怀旧人士的最爱,它并不提供最新的信息,但是在这里你可以找到年代久远的游戏,电影,书籍甚至还有电视节目。

15个世界最顶级的技术类博客网站 - 文学城

15个世界最顶级的技术类博客网站
在互网世界当中,博客网站的种类是多的。它中的一些旨在教、帮助人交流作、激灵感,并拓展我的思。而另一些博客则侧重于激 的情感,感到怒,或是们开怀大笑。《电脑世界(Computerworld)》网站的编辑们这秀博客网站搜集整理在了一起, 提供了一份最受他钟爱的博客网站的列表。最后,我根据些博客自身的信息广度、新、网站设计、更新率以及娱乐,将50多位候人的 大名做了减,最得到了15个世界最顶级的技术类博客网站排行榜。

  不份排名的确包含了很大的主成分,但是我们认为它是有史以来的此博客网站的最棒的排行榜之一。份名所涵盖的范非常广泛:从严肃 的技性新,到对电脑戏测评评论,再到新潮消品介。我也在本份名的最后增加了一些誉提名,因为这次排名的争是如此的激 烈,感到很取舍。

  当然了,肯定不会是一个人都同我点。如果你认为有某个博客网站非常的秀,而又没有出在我15名排行榜中的在本文后面的评论当中留言与我分享。

1) 生活客(Lifehacker

http://www.lifehacker.com

  生活客(Lifehacker)的座右表达了它的全部理念:不要而生活,要生活而注技个博客提供了有于各方各面的时间节士,从Firefox络浏览器的快捷操作,到来自时间管理教信徒的谆谆

2) IT工具箱博客(IT Toolbox Blogs

http://blogs.ittoolbox.com

IT工具箱博客(IT Toolbox Blogs)有着一大群斗在第一线IT们讨论于技IT管理的话题。它有一系列专业性的博客在理跟IT安全、数据目管理和其它等等相问题是一个包万象的网站。

3) 硅谷闲话Valleywag

http://valleywag.com

众口金,积毁销。硅谷闲话Valleywag)是专门为那些相信在技中的生死在很大程度上都取决于硅谷周播的闲话的人准的。于那些衷于制造、听播硅谷言的那些人来个网站凭借着其卓越的专业人大

4) Kotaku

http://kotaku.com

Kotaku电脑戏爱好者的加油站。它有跟电脑的一切,从测评,到相讨论和扯淡,再到作弊技巧。里有你所需要的一切,比如某款游到哪里去购买,以及怎样进行玩耍。

5) DangerRoom

http://blog.wired.com/defense

  《连线Wired)》志所推出的事和防博客网站,它向者介个世界上最新、最酷、最令人震撼的事技——更不用提那些丑、争和其它型的事新。网站中提供了视频片。

6) 明(Gizmodo

http://gizmodo.com

  小明(Gizmodo)网站专门为读者挖掘全世界最新、最酷、或是最稀奇古怪的技术发——从高清晰电视、到咖啡机、到力腰,再到USB驱动器。是的,他布那些严肃的技性新

7) O’Reilly 雷达(O’Reilly Radar

http://radar.oreilly.com

是你能够阅读TimO’Reilly(著名的O’Reilly出版公司的始人)和其它人讨论于网程、放源代、知识产权、政策、Web2.0和其它前沿科技的地方。

8) Techdirt

http://www.techdirt.com

  技Techdirt)是一个话题中心,以在当前的互网和电脑领域的热门事件上引激烈争名。流言蜚是它的所简洁是它的特点!

9) Groklaw

http://www.groklaw.net

Groklaw网站的原本存在目的是支持SCO公司IBMNovell公司所起的漫利侵权诉讼,但是不知道什么时候,里的讨论转向了其它方面,话题包括了技、知识产权以及政府法

10) 改造一整天(Hack a Day

http://www.hackaday.com

  想要学样为一个廉价的Linux路由器添加一个USB设备吗?想要制作一个蛇形机器人?或是将自己的XBox360机改造成一台笔本?改造一整天(Hack a Day上提供了些地下室目,以及其它更多有趣的目。个网站是那些真正有一定技,喜自己手改造技术产品的玩家所准的。但与此同,你也可以在发现很多趣,不定会从中开发出一新的好。

11)小玩意儿(Engadget

http://www.engadget.com

  就像可口可和百事可系一,小玩意儿(Engadget)和小明(Gizmodo)就像是一对孪生兄弟。它也是注于技术产品相的介 评论,有候也会有充激情的演辩论。小玩意儿(Engadget)上充制精美的片,而它网站的编辑们还有着广泛的内部渠道,可以在新潮 的技术产还处于先期或早期段,就可以一睹它的芳容。同的,小玩意儿(Engadget)上面也会刊登一些真正非常有趣的手工制作的玩意儿。但 是,我更喜明(Gizmodo)一点。

12) Feedster

www.feedster.com/feedpapers/Technology

  一切都是那的水到渠成。个网站集了各的博客站点,包括技术类、体育、名人八卦、美食、个人体等等等等——只要你能想到的,它都有。 ,它提高了卓越的站内搜索功能,以及一个非常酷的RSS闻阅读软件。它在技里面加入了非常出色的幽默感。真是一个各方面都很秀的网站。

13) 客(ForeverGeek

http://forevergeek.com

  永客(ForeverGeek)是一个非常棒的网站,它有无数的博客文章,覆盖了多话题,从技,到大众新,到好莱坞电影,再到电脑戏测评这绝对是一个客的天堂。假如你想要了解即将上映的好莱巨片《形金》的最新消息,或是阅读一篇有PhotoshopCS3件的测评就是你应该去的地方。

14)的文字(RoughType

www.roughtype.com

Nick Carr(笔名“Does IT Matter?”)撰写的一个思想利的博客,专门讨论与技的各话题趋势。他的文章文笔美,阅读起来津津有味,但是同也会常常激烈那些被批的公司、人物、技和政策。

15) 自助餐(Smorgasbord

www.smorgasbord.net

  作一个那些喜码产品和电脑专门打造的站点,个网站同也提供最新的有于政治和名人的新这种娱乐和技合,自助餐(Smorgasbord身于最秀者的行列。

誉提名:

1) 苹果(Apple)非官方博客 (TUAW)

www.tuaw.com

TUAW多独立的博客——些独立的博客然和苹果公司官方没有正式的系,但是并不意味着他的信息不充分、意没有影响力是一个了解苹果公司相的最好来源。它没有身前15名的唯一原因是它太注于一个话题

2) Elliot Back 的博客(Elliot Back’s blog

http://elliottback.com/wp

  作自封的算机科学家Elliot一件自己所注的事情大放厥,从XML准很糟,到泰坦尼克号的旅客名,再到好莱巨片 《斯巴达300勇士》的影个网站的内容多,但是安排巧妙。此外,他会提供一些非常棒的小士,比如如何增性能,以及屏蔽垃圾件。

3) Ed Foster 的牢骚录EdFoster’s Gripelog

www.gripe2ed.com/scoop

下有一新的博客网站涌了出来,它们专门和曝光那些侵害消益的公司和品,如数码产劣的售后服、粗糙的品外或是其他如此的一些问题,但是EdFoster一行的山鼻祖。看看他最新所注的一些话题:有缺陷的DRMplasma品牌电视机的保陷阱,以及糟糕的移动电话务质量。

4) Gadgetell

www.gadgetell.com

  假如你想要了解最新的数码产品、玩游,以及其他相的一些消息,是一个很棒的网站。

5) 4sysops

http://4sysops.com

  它Windows的管理员们提供了非常秀的小提示和操作教程

如何发掘出更多退休的钱?

如何发掘出更多退休的钱? http://bbs.wenxuecity.com/bbs/tzlc/1328415.html 按照常规的说法,退休的收入必须得有退休前的80%,或者是4% withdrawal rule,而且每年还得要加2-3%对付通胀,这是一个很大...