FeedSkimmer: Tech News
- Subscribe to this feed:
Tech News
A little over 18 months ago I was talking to Stephen Toub (he of the Parallel Computing fame) about parallelism and the kinds of problems it could solve.
I said, naively, "could we solve the million monkey's problem?"
He said, "the what?"
"You know, if you have an infinite number of monkeys and an infinite number of keyboards they will eventually write Shakespeare."
We brainstormed some ideas (since Stephen is a smarter than I, this consisted mostly of him gazing thoughtfully into the air while I sat on my hands) and eventually settled on an genetic algorithm. We would breed thousands of generations of (hypothetical) monkeys a second and then choose which ones would be allowed to perpetuate the species based solely on their ability to write Shakespeare.
We used the .NET 4 Task Parallel Library to make it easier for the algorithm to scale to available hardware. I mean, anyone can foreach over a million monkeys. But loops like that in parallel over 12 processors takes talent, right? Well, kinda. A lot of it is done for you by the Parallelism Features in .NET and that's the point. It's Parallel Processing for the Masses.
We created a WinForms version of this application and I've used it on and off to demonstrate parallel computing on .NET. Then Paul Batum and I went to the Keeping It Realtime conference to demonstrate SignalR this last week. I didn't want to do the same "here's a real-time chat app" or "here's a map that shows its results in real-time" demos that one always does at these kinds of things. I suggested that we port our WinForms Shakespeare Monkey demo to ASP.NET and SignalR and that's what Paul proceeded to do.

When doing something that is crazy computationally intensive but also needs to return real-time results you might think to use node for the real-time notification part and perhaps spawn off another process and use C or something for the maths and then have them talk to each others. We like node and you can totally run node on IIS or even write node in WebMatrix. However, node is good at some things and .NET is good at some things.
For example, .NET is really good at CPU-bound computationally intensive stuff, like, I dunno, parallel matrix multiplication in F# or the like. ASP.NET is good at scaling web sites like Bing, or StackOverflow. You may not think IIS and ASP.NET when you think about real-time, but SignalR uses asynchronous handlers and smart techniques to get awesome scale when using long-polling and scales even more in our labs when using an efficient protocol like WebSockets with the new support for WebSockets in .NET 4.5.
So, we wanted to see if you combined asynchronous background work, use as many processors as you have, get real-time status updates via SignalR over long-polling or Web Sockets, using C#, .NET 4.5, ASP.NET and IIS.
It takes about 80,000 generations of monkeys at thousands of monkey generations a second (there's 200 monkeys per generation) to get the opening line of Hamlet. So that's ~16,000,000 monkeys just to get this much text. As they say, that's a lot of monkeys.
Here's the general idea of the app. The client is pretty lightweight and quite easy. There's two boxes, two buttons and a checkbox along side some text. There's some usual event wireup with started, cancelled, complete, and updateProgress, but see how those are on a monkey variable? That's from $.connection.monkeys. It could be $.connection.foo, of course, as long as it's hanging off $.connection.
Those functions are client side but we raise them from the server over the persistent connection then update some text.
<script src="Scripts/jquery-1.6.4.min.js"></script>
<script src="Scripts/json2.min.js"></script>
<script src="Scripts/jquery.signalR.min.js"></script>
<script src="signalr/hubs"></script>
<script>
$(function () {
$('#targettext').val('To be or not to be, that is the question;\nWhether \'tis nobler in the mind to suffer\n\The slings and arrows of outrageous fortune,\n\Or to take arms against a sea of troubles,\n\And by opposing, end them.');
var monkeys = $.connection.monkeys,
currenttext = $('#currenttext'),
generationSpan = $('#generation'),
gpsSpan = $('#gps');
monkeys.updateProgress = function (text, generation, gps) {
currenttext.val(text);
generationSpan.text(generation);
gpsSpan.text(gps);
};
monkeys.started = function (target) {
$('#status').text('Working...');
$('#targettext').val(target);
$('#cancelbutton').removeAttr('disabled');
};
monkeys.cancelled = function () {
$('#status').text('Cancelled');
$('#cancelbutton').attr('disabled', 'disabled');
};
monkeys.complete = function () {
$('#status').text('Done');
$('#cancelbutton').attr('disabled', 'disabled');
};
$.connection.hub.start({}, function () {
$('#startbutton').click(function (event) {
$('#status').text('Queued...');
monkeys.startTyping($('#targettext').val(), $('#isparallel').is(':checked'));
});
$('#cancelbutton').click(function (event) {
monkeys.stopTyping();
});
});
});
</script>
The magic start with $.connection.hub.start. The hub client-side code is actually inside ~/signalr/hubs. See how that's include a the top? That client-side proxy is generated based on what hub or hubs are on the server side.
The server side is structured like this:
[HubName("monkeys")]
public class MonkeyHub : Hub
{
public void StartTyping(string targetText, bool parallel)
{
}
public void StopTyping()
{
}
}
The StartTyping and StopTyping .NET methods are callable from the client-side via the monkeys JavaScript object. So you can call server-side C# from the client-side JavaScript and from the C# server you can call methods in JavaScript on the client. It'll make the most sense if you debug it and watch the traffic on the wire. The point is that C# and Json objects can flow back and forth which blurs the line nicely between client and server. It's all convention over configuration. That's how we talk between client and server. Now, what about those monkeys?
You can check out the code in full, but StartTyping is the kick off point. Note how it's reporting back to the Hub (calling back to the client) constantly. Paul is using Hub.GetClients to talk to all connected clients as broadcast. This current implementation allows just one monkey job at a time. Other clients that connect will see the job in progress.
public void StartTyping(string targetText, bool parallel)
{
var settings = new GeneticAlgorithmSettings { PopulationSize = 200 };
var token = cancellation.Token;
currentTask = currentTask.ContinueWith((previous) =>
{
// Create the new genetic algorithm
var ga = new TextMatchGeneticAlgorithm(parallel, targetText, settings);
TextMatchGenome? bestGenome = null;
DateTime startedAt = DateTime.Now;
Hub.GetClients<MonkeyHub>().started(targetText);
// Iterate until a solution is found or until cancellation is requested
for (int generation = 1; ; generation++)
{
if (token.IsCancellationRequested)
{
Hub.GetClients<MonkeyHub>().cancelled();
break;
}
// Move to the next generation
ga.MoveNext();
// If we've found the best solution thus far, update the UI
if (bestGenome == null ||
ga.CurrentBest.Fitness < bestGenome.Value.Fitness)
{
bestGenome = ga.CurrentBest;
int generationsPerSecond = generation / Math.Max(1, (int)((DateTime.Now - startedAt).TotalSeconds));
Hub.GetClients<MonkeyHub>().updateProgress(bestGenome.Value.Text, generation, generationsPerSecond);
if (bestGenome.Value.Fitness == 0)
{
Hub.GetClients<MonkeyHub>().complete();
break;
}
}
}
}, TaskContinuationOptions.OnlyOnRanToCompletion);
}
If he wanted, he could use this.Caller to communicate with the specific client that called StartTyping. Inside ga.MoveNext we make the decision to go parallel or not based on that checkbox. This is where we pick two random high quality parent monkeys from our population for a potential future monkey. Hopefully one whose typing looks more like Shakespeare and less like a Regular Expression.
By simply changing from Enumerable.Range to ParallelEnumerable.Range we can start taking easily parallelizable things and using all the processors on our machine. Note the code is the same otherwise.
private TextMatchGenome[] CreateNextGeneration()
{
var maxFitness = _currentPopulation.Max(g => g.Fitness) + 1;
var sumOfMaxMinusFitness = _currentPopulation.Sum(g => (long)(maxFitness - g.Fitness));
if (_runParallel)
{
return (from i in ParallelEnumerable.Range(0, _settings.PopulationSize / 2)
from child in CreateChildren(
FindRandomHighQualityParent(sumOfMaxMinusFitness, maxFitness),
FindRandomHighQualityParent(sumOfMaxMinusFitness, maxFitness))
select child).
ToArray();
}
else
{
return (from i in Enumerable.Range(0, _settings.PopulationSize / 2)
from child in CreateChildren(
FindRandomHighQualityParent(sumOfMaxMinusFitness, maxFitness),
FindRandomHighQualityParent(sumOfMaxMinusFitness, maxFitness))
select child).
ToArray();
}
}
My 12 proc desktop does about 3800 generations a second in parallel.
Big thanks to Paul for the lovely port of this to SignalR and to Stephen Toub for the algorithm.
The code for the SignalR monkeys demo is on my BitBucket. Right now it needs .NET 4.5 and the Visual Studio Developer Preview, but you could remove a few lines and get it working on .NET 4, no problem.
Note that that SignalR works on .NET 4 and up and you can play with it today. You can even chat with the developers in the SignalR chat app in the 'aspnet' room at http://chatapp.apphb.com. Just /nick yourself then /join aspnet.
No monkeys were hurt in the writing of this blog post.
© 2011 Scott Hanselman. All rights reserved.
Since my original article explaining how to get Windows Media Player to single-step a video, I've learned that there's an even easier way.
- Pause the video.
- To single-step forward, Ctrl+Click the Play button.
- To single-step backwrd, Ctrl+Shift+Click the Play button.
Backward-stepping is dependent upon the codec; some of them will go backward to the previous keyframe.
The person who tipped me off to this feature: The developer who implemented it.
Remember: Sharing a tip does not imply that I approve of the situation that led to the need for the tip in the first place.
After literally decades of using Microsoft Word I just found out that it does regex!
I discovered this because I needed to delete comments inserted throughout my book manuscript, in the form . Hundreds of them. I was contemplating exporting to HTML so I could use a text editor that can handle this type of search and replace, but came across an article on how to use regular expressions in Word. Regexes let you use magical incantations that no one understands but that cause text to dance in little circles and transform themselves in puffs of smoke.
For example, to get rid of the pesky markup in my manuscript, I just had to tell the Replace dialogue to use wildcards, and then had it search for \<AU:?\>. The backslashes are necessary so that the angle brackets are not read as regex instructions. The question mark tells Word to find everything between <AU: and >. Simple! And it accepts far more complex regular expressions that. (Here?s a site that lets you test your regular expressions.)
Take a well deserved bow, Microsoft Word! (And then fix auto-numbers.)

If your software garbles this newsletter, read this issue at WindowsSecrets.com.
| YOUR NEWSLETTER PREFERENCES Change Delivery address: eric@exoware.com Alternate address: Locale: Canada M8Y2H1 Reader number: 84649-13263 |
|
| Windows Secrets Newsletter ? Issue 297 ? 2011-07-14 ? Circulation: over 400,000 |
| ADVERTISEMENT
|
| Table of contents TOP STORY: Win7's no-reformat, nondestructive reinstall LOUNGE LIFE: Yikes! My software hates my hardware! WACKY WEB WEEK: Watch out! This photo booth has attitude LANGALIST PLUS: ID those cryptic programs in Control Panel KNOWN ISSUES: Looking for green (energy) in cloud computing PATCH WATCH: Office File Validation patch leads to problems |
| You're receiving only our free content. Use the following link to upgrade and get our paid content immediately: |
| ADVERTISEMENTS
|
| TOP STORY Win7's no-reformat, nondestructive reinstall By Fred Langa Microsoft won't tell you this, but you can do a fast, nondestructive, in-place, total reinstall of Windows 7 without damaging your user accounts, data, installed programs, or system drivers. That means you may never have to do a full, from-scratch reinstall again, even when your system is misbehaving so badly that a full reformat-and-reinstall seems the only answer! As I'm sure you know all too well, from-scratch reinstalls are ordeals. They take hours. And when a reinstall is done, you still have to recreate all your settings, reinstall all your software, and so on. It can take days to fully recover from a total reformat/reinstall. Windows' little known, in-place reinstall takes only a fraction of that time and effort and yet completely rebuilds, repairs, and refreshes an existing Windows installation. It leaves your other software alone (no reinstallation needed!) while also leaving user accounts, names, and passwords untouched. When you're finished, your Windows installation is just as it was before, except that all the system files are fully repaired, refreshed, and ready to go. This nondestructive-reinstall ability has been in Windows since XP. (See this XP reinstall article that I wrote for another publication, years ago, when XP was new.) But ? for reasons unknown ? Microsoft has never made nondestructive reinstalls an official repair. In fact, it's not even listed in Win7's System Recovery Options (Help & How-to page). (Vista users, you're not forgotten! The nondestructive reinstall process for Vista is nearly identical to that described in the rest of this article.) You need three things before you begin First, you need access to a standard Win7 installation DVD. Ideally, you have your original setup DVD tucked away somewhere. But if not, it's perfectly OK to borrow one from a colleague or friend, as long as it's the same 32- or 64-bit version as your installation. Ideally, it should also match the general type ? retail disk or OEM/vendor-supplied disk ? as well. Why is it OK to borrow? A standard Win7 DVD actually contains all editions of Win7. For example, a 32-bit Win7 DVD has all the files for the 32-bit editions of Win7 Home, Win7 Professional, Win7 Ultimate, and so on. Your license key unlocks whichever edition you paid for. This means it's perfectly legitimate for you to use someone else's Win7 setup DVD to install Windows on your system, as long as you use your own, original, paid-for product key during installation. Sharing disks is fine. Sharing keys is not. This also provides an easy workaround for the all-too-common problem of PCs that ship without setup DVDs. As long as you can borrow a standard setup DVD of the same general type (as described above), you should be able to rebuild your system using it, with your own original, unshared product key. And that's the second thing you need: your original 25-character product key. It's usually found on a sticker on your computer or in the paperwork that accompanies a retail copy of Windows 7. If you've lost track of your product key, no problem: you can use a free keyfinder tool to dig it out. One such tool is the excellent, but absurdly named, Magical Jelly Bean (info/download). There also are many other free product keyfinders, as this About.com list shows. The third and final thing you need is a current backup. Although the reinstall process works reliably, it's not infallible. Deep-seated system errors, OEM customizations, hardware trouble, or other variables may foil your reinstall efforts. Having a complete and current backup is a sensible precaution. (See the May 12 Top Story, "Build a complete Windows 7 safety net.") Avoiding problems with Win7 Service Pack 1 If you're not running Win7 SP1, skip ahead to the next section. You can also skip ahead if you're repairing an SP1 setup with a Win7 setup DVD that already contains the SP1 files ? but such disks are still relatively rare as of this writing. If you're still reading this paragraph, then you're most likely attempting to repair a Win7 SP1 setup with an original, pre-SP1 DVD. That's OK, provided you take an important preparatory step. Win7 SP1 replaced many of your original system files with newer versions. If you try to install the older, original Win7 files over the newer SP1 files, the setup process will balk at what it sees as an erroneous downgrade. So, if you're attempting to repair Win7 SP1 with a pre-SP1 DVD, you need to remove SP1 from the target PC before proceeding. Fortunately, that's easy, as Figure 1 shows. ![]() Figure 1. Control Panel's Uninstall an update feature makes it a cinch to get the SP1 files out of the way. Here's how: Open Control Panel's default view and click on Uninstall a program. In the left-hand pane of the uninstall applet, select View installed updates. When the Uninstall an update dialog box opens, scroll down to SP1 ? listed as Service Pack for Microsoft Windows (KB976932) ? and select Uninstall. The system will churn for a while, but when it's done, SP1 will be gone ? and you'll be able to use an original Win7 setup DVD to repair your system. Start your Win7 in-place reinstallation With Windows running ? or limping, if it's badly broken ? insert the Win7 setup DVD. When the AutoPlay dialog box pops up, click to run setup.exe. (See Figure 2.) Alternatively, you can run setup.exe manually by navigating to the DVD drive and selecting the setup file. ![]() Figure 2. Run the Win7 installation DVD's setup.exe from inside your current Windows, either via AutoPlay (shown) or by manual selection. When setup starts to run, the User Account Control asks whether you want to make changes to your PC. Answer Yes. After a few moments, the Win7 installation process starts. (See Figure 3.) ![]() Figure 3. When asked, click Install now to get the ball rolling. Next, you'll see several information screens such as that in Figure 4. ![]() Figure 4. Screens such as this one are just FYI and require no user intervention. After several moments, you'll be asked whether you want to check online for updates related to the installation process, as shown in Figure 5. I recommend that you allow this online access to ensure essential files are current. ![]() Figure 5. It's usually smart to allow the setup program to check for installation-related updates. You can accept or reject the I want to help make Windows installation better option shown further down in the same dialog box. Your reinstall will proceed in the same way, regardless of your answer. Assuming you allowed it, Windows then goes online to collect essential updates. (See Figure 6.) ![]() Figure 6. It normally takes only a few moments to collect any needed installation updates. Now we come to the heart of the matter. Windows asks you Which type of installation do you want? (See Figure 7.) But there's no Reinstall option listed. Instead, you have to bend the normal installation routine to your wishes by selecting the upgrade option. ![]() Figure 7. Tell Windows a little white lie ? that you're upgrading, even though you're really not. You're not really upgrading; you're reinstalling the same version of the OS that's already on the PC. But the upgrade option leaves your files, settings, and programs in place, undisturbed. By pretending that you're upgrading, you can trick the setup program into doing an in-place reinstall! And then, finally, the installation process begins in earnest, as shown in Figure 8. ![]() Figure 8. Depending on the complexity of your setup and the speed of your hardware, reinstallation can take up to several hours. There's no need for you to baby-sit the installation; no further user input is required until near the end. As you check in from time to time, note the progress indicators (see Figure 9) to keep track of the installation's evolution. ![]() Figure 9. The progress bar at the bottom of the screen and the numeric indications (e.g., percent complete) let you easily monitor the process. Windows reboots several times during the installation; you see various information screens? some unusual ? along the way. (See Figure 10.) ![]() Figure 10. Don't be alarmed at unusual-looking screens, such as this one. At the very end of the installation process, you're asked to enter the product key from your original installation of Win7. (See Figure 11.) ![]() Figure 11. When prompted, enter your original product key. You also can elect to either Activate the fresh install of Windows immediately or wait. But unactivated instances of Windows get only limited access to Windows Updates and related services. I recommend activating without delay so you have immediate access to all Windows Update services. If you defer activation, your desktop background will be set to an ominous black with the words This copy of Windows is not genuine (circled in yellow in Figure 12) in the lower-right corner. You'll also see Activation nag screens, as shown in Figure 12. ![]() Figure 12. An unactivated Windows gets an ominous desktop background and recurring nag screens. Personally, I think it's simpler and better to just activate and get it over with. (See Figure 13.) ![]() Figure 13. Once it's activated, your reinstalled Windows desktop background can be set normally, and no further activation nags will appear. By the way, activation is not a one-time-only thing ? Microsoft allows for periodic reactivations of a given product key. Unless you've done several reactivations in a relatively short time, you should have no trouble. But if you do, just follow the remedies listed in the Activation Failed dialog box. As long as your product key is legit, Microsoft will work with you to resolve an accidental activation mishap. Your Win7 reinstall is almost done! At this point, the basic reinstall is finished. Your Win7 setup now has fresh copies of all the original system files. All that's left is to bring the installation up to date. This generally takes several iterations of running Windows Update. (See Figure 14.) Run WU once, let the updates install, and then reboot. Repeat until WU reports that no further updates are available. ![]() Figure 14. Your new Windows installation immediately needs to be brought up to date with the latest security patches from Windows Update. Don't put off this step! When you're done, you have a fully refreshed, up-to-date copy of Windows with all your essential files, settings, and programs intact and working. In fact, if all has gone as planned, the only significant change you'll notice is that the original problem is gone! With just a smidgen of luck and this article, you'll never again have to face a dreaded, start-over-from-scratch reformat/reinstall of Win7!
Fred Langa is a senior editor of the Windows Secrets Newsletter. He was formerly editor of Byte Magazine (1987-91), editorial director of CMP Media (1991-97), and editor of the LangaList e-mail newsletter from its origin in 1997 until its merger with Windows Secrets in November 2006. |
| LOUNGE LIFE Yikes! My software hates my hardware! By Kathleen Atkins When a Lounge member installed SP1, his Windows 7 stopped talking to his monitor. WSG appealed to his fellow Lounge members for assistance ? and they responded with advice. But dissatisfaction still prevails: WSG's monitor just doesn't look as good as it did before SP1. More» The following links are this week's most interesting Lounge threads, including several new questions to which you might be able to provide responses: ? starred posts ? particularly useful If you're not already a Lounge member, use the quick registration form to sign up for free. The ability to post comments and take advantage of other Lounge features is available only to registered members. If you're already registered, you can jump right in to today's discussions in the Lounge. The Lounge Life column is a digest of the best of the WS Lounge discussion board. Kathleen Atkins is associate editor of Windows Secrets. |
| WACKY WEB WEEK Watch out! This photo booth has attitude
|
| BONUS DOWNLOAD
|
| ADVERTISEMENTS
|
| PERMALINKS Use these permalinks to share info with friends We love it when you include the links shown below in e-mails to your friends. This is better than forwarding your copy of our e-mail newsletter. (When our newsletter is forwarded, some recipients click "report as spam," and corporate filters start blocking our e-mails.) The following link includes all articles this week: http://WindowsSecrets.com/comp/110714 Free content posted on July 14, 2011:
You get all of the following in our paid content:
Thanks in advance for your support! |
| YOUR SUBSCRIPTION The Windows Secrets Newsletter is published weekly on the 1st through 4th Thursdays of each month, plus occasional news updates. We skip an issue on the 5th Thursday of any month, the week of Thanksgiving, and the last week of December. Windows Secrets is a continuation of four merged publications: Brian's Buzz on Windows and Woody's Windows Watch in 2004, the LangaList in 2006, and the Support Alert Newsletter in 2008. Publisher: WindowsSecrets.com, 1218 Third Ave., Suite 1515, Seattle, WA 98101 USA. Vendors, please send no unsolicited packages to this address (readers' letters are fine). Editor in chief: Tracey Capen. Senior editors: Fred Langa, Woody Leonhard. Associate editor: Kathleen Atkins. Copyeditor: Roberta Scholz. Program director: Tony Johnston. Contributing editors: Yardena Arar, Susan Bradley, Jan Bultmann, Michael Lasky, Scott Mace, Katherine Murray, Ryan Russell, Lincoln Spector, Robert Vamosi, Becky Waring. Product manager: Andy Boyd. Advertising director: Ed Baker. Subscription manager: Revia Romberg. Trademarks: Microsoft and Windows are registered trademarks of Microsoft Corporation. The Windows Secrets series of books is published by Wiley Publishing Inc. The Windows Secrets Newsletter, WindowsSecrets.com, Support Alert, LangaList, LangaList Plus, WinFind, Security Baseline, Patch Watch, Perimeter Scan, Wacky Web Week, the Logo Design (W, S or road, and Star), and the slogan Everything Microsoft Forgot to Mention all are trademarks and service marks of WindowsSecrets.com. All other marks are the trademarks or service marks of their respective owners. YOUR SUBSCRIPTION PREFERENCES (change your preferences): Delivery address: eric@exoware.com Alternate address: Country: Canada ZIP or postal code: M8Y2H1 Reader number: 84649-13263 Bounce count: 0 Your bounce count is the number of times your server has bounced a newsletter back to us since the last time you visited your preferences page. We cannot send newsletters to you after your bounce count reaches 3, due to ISP policies. If your bounce count is higher than 0 or blank, please visit your preferences page. This automatically resets your bounce count to 0. To change your preferences: Please visit your preferences page. To access all past issues: Please visit our past issues page. To upgrade your free subscription to paid: Please visit our upgrade page. To resend a missed newsletter to yourself: If your mail server filtered out a newsletter, you can resend the current week's issue to yourself. To do so, visit your preferences page and use the Resend link. To get subscription help by e-mail (fastest method): Visit our contact page. Subscription help by facsimile: 206-652-2559 (fax). Emergency subscription help by phone: 206-438-3070 (24 hours). HOW TO SUBSCRIBE: Anyone may subscribe to this newsletter by visiting our free signup page. WE GUARANTEE YOUR PRIVACY: 1. We will never sell, rent, or give away your address to any outside party, ever. 2. We will never send you any unrequested e-mail, besides newsletter updates. 3. All unsubscribe requests are honored immediately, period. Privacy policy HOW TO UNSUBSCRIBE: To unsubscribe eric@exoware.com from the Windows Secrets Newsletter,
|
Read more of this story at Slashdot.
I wasn't cool enough to be in the first wave of invitations, but
I have now got onto Google+, the Maybe Next Big Thing in social networks. It seems somewhat appropriate to mark this Momentous Event by writing a little bit about how I've used social networks so far, and some uninformedspeculation about the impact of Google+
My initial reaction to social networks was suspicion. At heart I'm a misanthropic hermit with enough intelligence to put on a veneer of sociability. So I was never tempted by the early social networks like MySpace, and I still regularly refuse any requests to Link In.
I'd kept half an eye on Twitter, but was slow to get involved. Someone registered the name @martinfowler and started feeding my blog posts into it. I was worried that it may be a squatter, but it was actually a nice programmer who happily handed over the account when I asked for it. Eventually my colleague Doc List got me going on Twitter and now it's a regular part of my life. Shortly afterward I joined Facebook too.
I use the two networks quite differently, which is partly the function of my fate of being a geek celebrity. Twitter is a public facing stream, where anything I tweet goes out 35,000 followers. With Facebook I only link to people who I know personally. At a simple level I can think of Twitter as my professional side and Facebook as my social side - but that's a bit of a stretch since so many of my friends are also professional links.
Twitter is a fascinating social construct. It's a mix of features that I can't imagine someone would design up-front [1]. The 140 character limit is one of those silly technology fiats, yet it works well. As Elliotte Harold tweeted of Google Buzz: "Favorite Buzz feature: I'm not restricted to 140 chars. Least fav Buzz feature: everyone else not restricted to 140 chars :-)". Similarly the asymmetric follow (35,000 follow me, but I only follow 300) coupled with mentions (which get my attention) works better than I would have ever thought if someone described it to me. All in all it allows me to keep a good sense of connection without drowning in the flood of text.
Almost all the people I follow on Twitter are people I know personally. I read pretty much all the tweets from people I follow or people who mention me. I check the stream pretty regularly, several times a day most days. I post a few times a day when at home, a bit less when traveling. I choose my public posts conscious of the fact that I have so many followers, so I try to post things that are interesting to my perception of that crowd. Mostly these are links to interesting articles, which naturally include anything I write. I reply a bit more casually as I see things from friends or mentions. I find Twitter a useful source of web links to read which supplement my regular blog feeds. I also enjoy the feedback on my own contributions that appear whenever I tweet a new post.
With Facebook, I know that people who see my posts are only people I know reasonably well. The other difference is that my non-geek friends don't use Twitter but many do use Facebook. I don't check Facebook so often, usually only once or twice a day. My posts there don't include geek stuff, mostly they are either interesting social things we are doing. One common thing I links to my photo albums.
One issue for me is how to deal with people who are on both services. My approach is to almost never post the same thing to both places, along the geek/social divide. But several of my friends copy all posts to both services. I'm still unsure how to deal with that, I could block them on Facebook, but then I'd miss some conversations.
I use a consistent avatar photo on any site that I use. People are used to recognizing faces, so I think it's only reasonable to use a regular face photo as an avatar. It's frustrating when someone posts and I can't remember who it is because I haven't learned to match their face to their name yet. [2]
Overall I've come to be very glad of both services. The nature of my life means I have friends all over the globe and it's good to keep some low-level regular contact with them. I was never one for sending off emails, and have always disliked phone calls. Posting short messages about what we're up to work well for me.
So how will Google+ fit into this? Of course I don't really know, there's no sensible way of predicting the outcome. The question for me is whether Google offers something that the current Twitter/Facebook combo does not. From the small amount of use I've put it too so far it looks well put together. Circles seem to me to be a very useful feature that matches how I see most people's social interactions. [3] (Although as George Dinwiddie pointed out - remember that Google (and Doubleclick) are in all your circles.)
On the whole I'm very happy with Twitter and will need a lot of persuading to shift off it. Facebook, I'm less excited about and could easily see me moving. The circles notion could be just right for that context.
But the key issue here is that it doesn't matter what I think or do, it's what all my contacts do that counts. I mostly have a Facebook account because people I want to keep in contact with have a Facebook account. If they don't move to Google+ I'm staying with Facebook even if Google+ is nicer. That's why Google+ has a huge mountain to climb, especially since I don't want to check Yet Another Social Network. I suspect there may only be room for one of Google+ and Facebook.
So far this makes Google+ only marginally interesting to me. It's rather like Wave was - a cool idea but of little use if nobody else is using it. What may be the difference is tying in with Gmail. I always got the sense that the Wave and Gmail teams weren't on speaking terms, hence their software never seemed to be either. Google+ allows you to link to people who aren't on Google+ but do have your email address, your posts go to these people as email. I could do with this already for some non-Facebook friends, and it could be an important booster to getting people to use Google+. In general there seems to be a determination with Google+ to tie in with other Google services. This may be the lever they need to shift Facebook, other than their obvious advantage, but it will still be a big challenge.
1: I'm sure that somewhere on the web is a really interesting article on the evolution of Twitter's features and their impact on social interaction. When you find it, please tweet it to me.
2: If you do use a face as your avatar, please use full face only (not head and shoulders) otherwise it will be too small to see. Also make sure there's enough light on your face to be able to see it properly at that small size.
3: I've heard some people say that circles are a big innovation. I find that astonishing, surely it's obvious that people interact differently with different groups of contacts? I think the fact that Facebook didn't do this is that they are fixation in their view of the world that people should be public - which also explains their regular missteps over privacy.

Text messaging, or SMS, has become one of the core elements of the mobile world. Smartphones or dumbphones, prepaid or postpaid, everyone texts. You may not watch videos or take pictures or check your email?or you may do all of that plus download apps on the daily. Either way, you text.
The question is, why do you pay so damn much to do it?
SMS has been called "possibly the greatest ongoing con job of American capitalism" by William Poundstone. Sound sensationalist? Hardly. William points out in his book, Priceless: The Myth of Fair Value, that "the so-called market price of a text message has nothing to do with bandwidth or any technological reality." And he's right. Indeed, the cost of SMS is determined by how much consumers can be persuaded to pay.
In essence, wireless carriers ask you: just how badly can we rip you off?
And the answer is, quite a bit.
A text message is a package of bandwidth?AKA data. We all know that data costs money; that's why some of us stick with our dumbphones and why some of us get heart attacks when our monthly wireless bill rolls in. But when we think of data, we think of data plans; 500 megabytes for $10, two gigabytes for $25, or what have you. Text messaging, as has become fairly standard, is about $5 for unlimited SMS.
And that's the magic of it. Five bucks doesn't seem like a lot of money, and unlimited sounds like a lot of texting. Overall, it seems like a worthwhile feature and as such has become a staple in virtually all modern cellphone plans. Even discount wireless carriers such as Wind Mobile charge this flat fee for unlimited text messages. If those guys feel the price is right, it's gotta be a fair deal, right?
Wrong.
Texting your friend "Hey, what's up, Joe?" costs a wireless carrier roughly 1/1,000 of a penny. That is to say, sending roughly 1,000 text messages should cost, at wholesale pricing, about a single cent. If you send a lot of lengthier texts, it might round up to two cents. The number crunching at this point is simple: unless you're sending 500,000 text messages per month, your wireless carrier is profiting. Most people send under 1,000, and many send less than 100?all the while paying $5.00 per month.
Myriad people have pointed out the unfathomable markup of text messaging. In 2007, one suggest markup was 7,314 percent. In 2009, a markup of 4,900 was calculated. In 2010, in an article titled "America's Biggest Ripoff," the markup was believed to be around 6,500.
The trouble is that consumers don't have a clue about what a text message is really worth?or rather, how damn little a text messaging is really worth. A Simon-Kucher & Partners survey found that consumers believed a multimedia message or email containing photo(s) and/or video(s) was worth roughly 3 to 4 times what a basic text message was worth.
In reality, an MMS or email is anywhere from a thousand to a hundred thousand times more data than an SMS.
Now imagine the people coughing up as much as 20 cents for a single message on pay-as-you-go plans. They're practically throwing money at telcos. But as if this isn't ridiculous enough already, there's icing on the cake: SMS are piggybacked onto cellular networks. This means that text messages occupy, as William puts it, "otherwise unused space in a control channel used for network maintenance." So texting, most of the time, doesn't even cost your wireless carrier that fraction of a penny. It costs them, quite literally, nothing.
From the early 2000s until now, prices for individual text messages on pay-as-you-go plans have quadrupled from an average of 5 cents to 20 cents. This is obviously wildly misaligned with inflation. It is instead more in tune with the rapidly growing volume of text messages: a high-demand, ubiquitous service can be marketed to boast a perceived value that is some ways infinitely greater than its real value.
Now go text this article to your friends. 500,000 of them, if you can.
When Picard and el Kaliouby were calibrating their prototype, they were surprised to find that the average person only managed to interpret, correctly, 54 per cent of Baron-Cohen's expressions on real, non-acted faces. This suggested to them that most people - not just those with autism - could use some help sensing the mood of people they are talking to. "People are just not that good at it," says Picard. The software, by contrast, correctly identifies 64 per cent of the expressions...
Picard says the software amplifies the cues we already volunteer, and does not extract information that a person is unwilling to share. It is certainly not a foolproof lie detector. When I interviewed Picard, I deliberately tried to look confused, and to some extent it worked. Still, it's hard to fool the machine for long. As soon as I became engaged in the conversation, my concentration broke and my true feelings revealed themselves again.
Specs that see right through you
(Thanks, Sally!)
(Image: xray, a Creative Commons Attribution (2.0) image from shockadelic's photostream)
![]()

Brian Krebs looks at the remarkable drop in spam that the Internet has experienced this year (25-50 billion spams/day today, down from a peak of 225 billion spams/day last July), and at the vicious new malware that's appearing as spam-crooks get more desperate. One such vector is TDSS (AKA "TLd-4"), a rootkit that infects your computer, kicks out all the other malware running on it, and then helps hackers distribute malware. Krebs says that there's plenty of gains to be realized by attacking the financial instruments used by criminals and he's promised a series on how these work.
The evolution of the TLd-4 bot is part of the cat-and-mouse game played by miscreants and those who seek to thwart their efforts. But law enforcement agencies and security experts also are evolving by sharing more information and working in concert, said Alex Lanstein, a senior security researcher at FireEye, a company that has played a key role in several coordinated botnet takedowns in the past two years."Takedowns can have an effect of temporarily providing relief from general badness, be it click fraud, spam, or credential theft, but lasting takedowns can only be achieved by putting criminals in silver bracelets," Lanstein said. "The Mega-D takedown, for example, was accomplished through trust relationships with registrars, but the lasting takedown was accomplished by arresting the alleged author, who is awaiting trial. In the interim, security companies are getting better and better about working with law enforcement, which is what happened with Rustock."
Where Have All the Spambots Gone?
Read more of this story at Slashdot.
A little while back, we had a Bring Your own Code called The Disgruntled Bomb that sought to answer, "what is the worst thing a disgruntled employee could leave behind in the source code?"
The comments were great and featured all sorts of solutions. Most were in C and C++, but there were few unique ones like a cronjob and even an incredible one-liner for .NET.
While C and C++ give programmers enough rope to shoot themselves (or build a crazy bomb), managed platforms like .NET and Java limit your options. That is, unless you know where to look. Alexander Keul took advantage of Java's cached boxing conversions to come up with this concept:
package dont.try_this.at_home;
import java.lang.*;
class ValueMunger extends Thread {
public void run() {
while(true) {
munge();
try { sleep(1000); } catch (Throwable t) { }
}
}
public void munge() {
try {
Field field = Integer.class.getDeclaredField( "value" );
field.setAccessible( true );
for(int i = -127; i<=128; i++)
field.setInt(
Integer.valueOf(i),
// either the same (90%), +1 (10%), or 42 (1%)
Math.random() < 0.9 ? i : Math.random() < 0.1 ? 42 : i+1 );
} catch (Throwable t) { ; }
}
}
A simple call to (new ValueMunger()).start(); will spin off a new thread that will randomly redefines the values of integers between -127 and 128, ensuring that maths will never be the same again:
Integer a = 2; Integer b = 3; System.out.println( a + b ); // could be 5, 6, 7, 44, 45, or 84
To extend the fun, this works for Boolean and several other primative types like BigInteger, Long, Short, etc.

"Click Trajectories: End-to-End Analysis of the Spam Value Chain" is a scholarly research paper reporting on a well-designed study of the way that spam works, from fast-flux DNS to bulletproof hosting to payment processing to order fulfillment. The researchers scraped mountains of spam websites, ordered their pills and fake software, and subjected it all to rigorous comparison and analysis. They were looking for spam ecosystem bottlenecks, places where interdicting one or two companies could have a major impact on spam.
Figure 1 illustrates the spam value chain via a concrete example from the empirical data used in this study. On October 27th, the Grum botnet delivered an email titled VIAGRA R Official Site. The body of the mes- sage includes an image of male enhancement pharma- ceutical tablets and their associated prices (shown). The image provides a URL tag and thus when clicked directs the user's browser to resolve the associated domain name, medicshopnerx.ru. This domain was registered by REGRU-REG-RIPN (a.k.a. reg.ru) on October 18th -- it is still active as of this writing. The machine providing name service resides in China, while hosting resolves to a machine in Brazil. The user's browser initiates an HTTP request to the machine, and receives content that renders the storefront for "Pharmacy Express," a brand associated with the Mailien pharmaceutical affiliate program based in Russia.After selecting an item to purchase and clicking on "Checkout", the storefront redirects the user to a payment portal served from payquickonline.com (this time serving content via an IP address in Turkey), which accepts the user's shipping, email contact, and payment information, and provides an order confirmation number. Subsequent email confirms the order, provides an EMS tracking number, and includes a contact email for customer questions. The bank that issued the user's credit card transfers money to the acquiring bank, in this case the Azerigazbank Joint-Stock Investment Bank in Baku, Azerbaijan (BIN 404610). Ten days later the product arrives, blister-packaged, in a cushioned white envelope with postal markings indicating a supplier named PPW based in Chennai, India as its originator.
Click Trajectories: End-to-End Analysis of the Spam Value Chain (PDF)
(via MeFi)
Google is banking on Canada's long-term business relevance with the official launch of its enormous 34,000 square-foot office, a thorough revamping of its originally puny Canadian headquarter.
The hub, perhaps now the most major one in the world outside of Google's home base in the Valley, sits in the Kitchener-Waterloo area, not far from Research in Motion.
Quoth The Globe and Mail:
Outside the company's global headquarters in Mountain View, Calif., few offices have proved as vital to Google as the Kitchener-Waterloo location. Initially, Google's presence in the region was minimal ? the result of the acquisition of a mobile technology company in the area. As Stuart Feldman, Google's vice-president of engineering for the east coast put it, Google's first office had 22 employees and 20 chairs. Today, 170 engineers work at Google's new office, making it the largest in Canada.
The company hosted a gala to unveil its new offices. The event drew MPs, Kitchener city council, and myriad engineers.
Read more of this story at Slashdot.
Read more of this story at Slashdot.
Complexity is the death of software.
And
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it
# Published April 25, 2011
Read more of this story at Slashdot.





By Fred Langa 













By Kathleen Atkins 








When Picard and el Kaliouby were calibrating their prototype, they were surprised to find that the average person only managed to interpret, correctly, 54 per cent of Baron-Cohen's expressions on real, non-acted faces. This suggested to them that most people - not just those with autism - could use some help sensing the mood of people they are talking to. "People are just not that good at it," says Picard. The software, by contrast, correctly identifies 64 per cent of the expressions...