A DAY IN THE LIFE OF………………

10月 6th, 2008

Things are always crazy at our house. Here’ s a run down of a typical day in the life of a homeschooling, part-time working, home making mom and wife:6:30am -arise, shower, dress - stumbling over suitcase, mound of dirty laundry, and clutter7:00am -ascend to the attic, pull down Hope’s fall winter box of clothes, have daughter try on8:00am -all fall clothes are either on hangers or in a bag to give away8:05am - begin the daunting task of a week’s worth of laundry8:15 am - proceed to kitchen to make waffles. It’s not too hard because I have the mix made up. Hope can plug in the waffle iron, measure 1 cup of mix, buttermilk, crack and egg and she’s good to go. She wants chocolate chips on hers. She’s in luck, there are a few in the bag!8:30 am - time to start school. This is our first year to try this. Hope has a new Latin program and she LOVES it. She picks Latin to start her week. Also, I have the boys up by now to get an early start on chores and school. This place is a train wreck! Sometime Micah makes his own waffle - with chocolate chips too.9:00 am - Latin, Cursive Without Tears Handwriting, and Spelling are complete. I’ve also taken a couple of work calls and have payroll “issues” to deal with. I set Hope up on www.freerice.com to work on her vocabulary while I deal with payroll.9:30 MATH - not Hope’s Favorite and we eventually have a few tears today. Don’t they make a MATH WITHOUT TEARS program TOO? 9:50 Ethan leaves for work at the local diner. He works a double shift on Mondays. We won’t see him until after 8pm.10:00am Mommy needs a break from Hope’s math as bad as Hope does. I switch out laundry and fold the 3 loads that are in baskets (some laundry was left unfolded from last washing).10:30 I check on Micah who is working on Algebra upstairs. He moans he’s OK. I think some protein and fruit would help his thinking power, so we all have apples and peanut butter for a snack.11:00 After more laundry and loading the dishwasher, Hope and I head back to the desk for more school.11:15 Tuna Fish Salad is on the menu today for lunch so I proceed to kitchen to boil a couple of eggs. Return to help Hope. Micah calls for help on ALGEBRA. He’s frustrated because he can’t tell if his calculator rounds the last digit or not. He’s studying terminating and infinite integers. I don’t remember studying this in school. I have to look up the answers and work backwards to be able to help him. 12:00 I continue reading MY SIDE OF THE MOUNTAIN to Micah and Hope. I am enjoying learning the things I should have learned a long time ago, with my kids.12:15 LUNCH TIME. Hope makes GRAPE KOOLAID, we open some fresh LAYS chips and make our sandwiches. We usually go upstairs and watch a 30 minute program like DICK VAN DYKE, or JOHN and KATE PLUS 8. Today we watch VERMINATORS on DISCOVERY. The feature of the day was a house infested with cockroaches. I don’t know why we are watching this while eating lunch?1:00 More laundry. It’s time to hit the books again. I review the first 2 chapters of American History with Hope. I am pleased with her progress. She is frustrated she can’t remember all the names and places. When I asked her who PONCE DE LEON was - she told me, “Wasn’t he the guy who searched for that POND OF YOUTH?” She cracks me up! Micah is finishing his ALGEBRA and starting SCIENCE.2:00 Sometime I unintentionally fall asleep on my bed, which is where I was reading to Hope. I wake up face down, my left arm and hand are asleep, in a pool of drool. Hope has gone AWOL since I fell asleep. Ethan calls and needs a phone number.3:00 I head to town to check the mail at the office. Then head to the bank to deposit a check for work. I’m back home before 4pm. Of course more laundry is washed and dried so I switch and fold again.5:00 Hope is roaming around bored and telling me there’s NOTHING TO DO. So I get her to help me clean my bathroom. Micah cleans the other one. We are all busy cleaning with the stereo cranked up. Things are looking better.6:15 meatloaf and potatoes go in the oven to bake. Richard is home. Micah mops the kitchen voluntarily - because he’s “tired of stepping on crumbs with his bare feet.” He also says he’d like to know what it’s like to have the whole house cleaned at once. ME TOO!7:15 We toss a salad and burn some toast. We eat dinner and watch an episode of DICK VAN DYKE. 8:00 Richard’s phone alerts an appointment. It says WALK.8:30 Richard Hope and I set out on a walk in the dark. Hope thinks it would be fun to walk in her PJ’s. Micah rides his bike. There is no moon tonight, so it’s pretty dark. Ethan arrives home right before we leave.9:00 pm more laundry, load the dishwasher. Porch swing time with hubby9:45 reading with Hope10:00 Tuck Hope in Bed10:15 Ethan and Micah are doing a Literature Through Movies program this year. They settle down with blankets and THE QUIET MAN with Cary Grant. They will watch a total of 17 classics and write essays on each one. This course is refreshing after so many years of books.Switch out laundry again. Thankfully my sheets are clean and dry just in time for bed. I check on a couple of home school programs in my TOP 100 PICKS book.10:35 Clean sheets are on the bed - Richard and I call it a day.Every day is very different around here. There was nothing spectacular about our day. But I am thankful for our time together. It was a good day, just a long and hard one.

Legislation and Regulation for e-Commerce in Kenya

10月 6th, 2008

[#2: Edit Options>MightyAdsense>Adsense Code]

Herebelow is a brief circulated today by the Kenya Private Sector Foundation. This comes in the face of the simultaneous drafting of various key pieces of legislation that will affect e-commerce and online trading in Kenya in general. These include:1) Electronic Transactions Bill2) ICT Bill3) Freedom of Information BillLegislation and Regulation for e-Commerce in Kenya Kenya ICT Federation (KIF) - Briefing Note # 3 - Report - Public Panel 19 June 2008 Electronic commerce (e-commerce) will add at least one percent point growth to Kenya’s overall economic growth within five years. This is contingent upon the adoption of legislation that supports electronic transactions.Kenya, as an emerging economy and regional leader, lags behind in having a legal framework for e-commerce in place. The current situation is an anachronism hampering national development, placing provincial centres at a disadvantage, and harming global competitiveness. Both external and internal trade require the new framework.The Kenyan private sector strongly supports e-commerce legislation, as well as legislation of the Information and Communication Technology sector that guarantees an open market and promotes innovation. Why e-commerce law?Today, legislation supporting electronic transactions represents the single most powerful innovation opportunity in the legal framework of the ICT sector. Legislation is needed to:Legalize e-commerce transactions by recognizing an electronic signatureManage and control e-commerce risksRemove e-commerce barriersKIF has studied drafts currently circulating in the public domain, the Information and Communications Bill, 2008, and the Electronic Transactions Bill, 2007, respectively, both of which are of the highest technical standards. Public panels and hearings with sectors of the economy (including tourism, agriculture, ICT) have been held on 6th and 27th May, 4th June and 19th June. The Kenyan private sector has expressed overwhelming support for urgent legislation of e-commerce. Suggested improvements in Bills - The public panels and hearings to date have yielded the following important issues for improvement in the current Bills: Provisions on who can prosecute are missingLiability of Internet Service Providers must be demarcatedClarification on which commercial documents are excluded from proposed legislationEliminate any ambiguity on admissibility of electronic evidenceNeed for data protection and privacy provisionsThe Bills are more lenient on e-commerce fraud than on traditional fraudRemove inconsistencies in determining crimes and punishmentsProvisions for the inclusion of cyber-crime within the scope of the Extradition ActCreation of an Administrator for e-commerce laws whose functions will be policy implementation and advisory, as a multi-sectoral body with industry associations including KIF, lead regulator Communications Commission of Kenya and co-regulator Central Bank of Kenya Gains in tourism, agriculture, healthcare Industry sectors, notably the tourism industry, are expressing their desire to see e-commerce covered by law. In tourism, on-line travel bookings have exceeded 80% in the USA and 50% in Europe. Decline in off-line bookings is in ample evidence. Those destinations that cannot legally support abundant on-line booking, such as Kenya, will loose market share. E-commerce in agriculture will improve small-holder’s living standards. Great impact is expected notably in the coffee sector that provides livelihood to at least 5 million Kenyans, as well as in the dairy industry. Healthcare efficiency and affordability will improve by on-line health data management systems. Business operators in rural towns and rural centres have also expressed keen interest, as they see scope to address issues of trade efficiency and security in rural Kenya. What is e-commerce E-commerce is a method of trading that replaces paper-based documentation by a mutually binding electronic protocol between buyers and sellers. E-commerce is gaining ground globally and has become an irreversible trend. Many trading partners are already practicing e-commerce, by mutual agreement, also in Kenya. However, e-commerce will reach its full potential when parties that do not know each other are able to trade with full mutual protection under the law. This will benefit large numbers of consumers and businesses, including small-holder farmers, tourism operators, small-scale industry and services providers in almost any business sector. About KIF The Kenya Information and Communication Technology Federation (KIF) represents the ICT industry with Government and with private sector bodies e.g. Kenya Association of Manufacturers and Kenya Private Sector Alliance KEPSA. KIF is a legally registered membership based Association, made up of trade associations and professional bodies within the national ICT industry, as well as commercial corporations. KIF has been accepted as the private sector voice of ICT by Government. KIF contributes ideas to key sectors like healthcare, education, agriculture, construction industry, and last but not least supports e-government development. KIF is a membership-driven organisation. Members bring issues on public policy and industry development forward for KIF to take action. Issues include: innovation promotion, education improvement, duties, taxes and levies, rural ICT investment. KIF has a strong and active network, with excellent relationships with all government agencies. KIF membership is open for market segment associations and individual companies. Membership charges are annual and based on company size.

E-Commerce/M-commerce - which way for Africa?

10月 6th, 2008

[#3: Edit Options>MightyAdsense>Adsense Code]

As pointed out by White African in his blog, there are lots of ideas flying around regarding payment solutions that can both fit and function according to the needs of the broader African populace. Top amongst these is the opportunity (or should we call it challenge) that mobile telephony offers.It has been well documented by the ITU that mobile telephony in Africa is growing faster than in any other part of the world. This is supported by World Bank reports that “The African mobile market has been the fastest-growing market of all regions, expanding at twice the rate of the global market.” There is therefore every reason to see mobile telephony as an avenue towards delivery of financial services to the largely unbanked population of Africa.White African very elaborately says that “What we need is a carrier and bank agnostic ecommerce platform for Africa.” This is further borne out in his discourse on the benefits of such a platform and the potential risks associated with current models that are tied to a single network operator. A couple of years ago during a period of much reflection on the same subject I came across a company that has implemented such a system in South Africa.Wizzit - mobile banking in South AfricaWizzit - is the name of the South African service that provides a cellphone based banking and transaction system. The company deliberately kept a low profile during it’s early days to avoid been stonewalled by the larger banks in South Africa and instead developed it’s product in partnership with a small bank that had enough flexibility and innovation to support the development of the product. The most significant aspect of Wizzit is that it works across all networks i.e. it is not linked or tied to any of the mobile operators - any subscriber with any network can sign up and use the service by simply purchasing a ’starter pack’ for the equivalent of Kshs 60 (US$ 1) at any filling station convenience store or major supermarket.Employing the UnemployedAnother very cool aspect of Wizzit’s intervention is that instead of going the conventional route and hiring a sharp and savvy team of marketers and sales people, they created something called Wizz-Kids and invited unemployed youth; trained them, suited them up in very cool, branded gear and sent them out into the townships, rural areas and nether regions of the country to sign up customers. The initial team of close to 1,000 kids brought in over 10,000 accounts and in excess of 100,000 transactions within the system within the first couple of months. Since it’s launch in 2004 Wizzit has provided thousands upon thousands of South African youth with employment.Banking the UnbankedUsers don’t have to have a bank account, but get a Maestro Debit card with the starter pack, which is linked to their Wizzit account which they can load up with money at any of thousands of agents, post offices and bank branches across the country. Once an account is loaded they can make person to person payments or transfer money to any other Wizzit user or merchant, load up airtime and pay for utilities. For those who need cash, a network of ‘cash back’ outlets at post offices and major supermarkets countrywide is available.What about the rest of Africa?Wizzit’s innovation has had an incredible impact in South Africa but unfortunately has not been ‘exportable’, ‘transferable’ or capable of replication in countries outside of South Africa. In 2005 I made a number of efforts to engage with Wizzit guys and discuss the possibility of bringing the brand and model to Kenya. Unfortunately the fees and percentages that came out of these discussions were unbearable (or to be more precise commercially unviable). And for whatever reason, no one in other countries seems to have been able to put together a similar package of partnerships, agreements, legal loopholes to allow delivery of a similar model (at least none that I know of)So, what can we do about getting something like this going in other parts?

This Week in VUDU: Hellloo 63 HDX Movies [Movies]

10月 6th, 2008

via: Gizmodo (drop this source ”
show all sources)

help
relevance:
Vudu • HDX (tell me more…)
rate it:
|
VUDU has over 120 new HD flicks available for rent this week, but the big news is that half of those films are in their new HDX format—downloadable HD that looks a lot better than the current downloadable, highly compressed “HD” we’re accustomed to. Read on for the full new HD and HDX lists.
HD releases:
All the President’s Men [HD] An American Haunting [HD] Be Kind Rewind [HD] Belly 2: Millionaire Boyz Club [HD] Book of Shadows: Blair Witch 2 [HD] Chaos Theory [HD] CSNY / Deja Vu [HD] Death of a President [HD] Dirty Dancing: Havana Nights [HD] Dirty Harry [HD] Doctor Strange [HD] Fatal Attraction [HD] Fido [HD] Full Metal Jacket [HD] Funny Games [HD] Ghost [HD] House of 1000 Corpses [HD] Invincible [HD] Kickboxer [HD] Mama’s Boy [HD] Mistress [HD] Mr. and Mrs. Smith [HD] My Fellow Americans [HD] Next Avengers: Heroes of Tomorrow [HD] Patriot Games [HD] Saturday Night Fever [HD] Saw [HD] Saw 2 [HD] Signs [HD] Speed Racer [HD] The Naked Gun [HD] The Prestige [HD] Timeline [HD] Training Day [HD] Ultimate Avengers 2 [HD] Ultimate Avengers: The Movie [HD] What’s Eating Gilbert Grape [HD] Xmas Tale [HD] xXx [HD]
HDX Releases:
The Breakfast Club [HDX] Pitch Black (Unrated Director’s Cut) [HDX] Field of Dreams [HDX] Casino [HDX] The Chronicles of Riddick (PG-13 Rated) [HDX] The Fast and the Furious [HDX] Happy Gilmore [HDX] Lord of War [HDX] Requiem for a Dream [HDX] The Last Samurai [HDX] Troy [HDX] Unleashed (Unrated Director’s Cut) [HDX] Stop-Loss [HDX] 21 [HDX] The Jerk [HDX] Uncle Buck [HDX] Weird Science [HDX] Death of a President [HDX] Fido [HDX] Witless Protection [HDX] Sex, Drugs, Rock and Roll [HDX] The Bad News Bears [HDX] Boomerang [HDX] Chinatown [HDX] Harold and Maude [HDX] Bless the Child [HDX] Up in Smoke [HDX] Fatal Attraction [HDX] G.I. Blues [HDX] Ghost [HDX] Patriot Games [HDX] Saturday Night Fever [HDX] Staying Alive [HDX] The Longest Yard [HDX] The Naked Gun [HDX] The Two Jakes [HDX] Tommy Boy [HDX] What’s Eating Gilbert Grape [HDX] The Italian Job [HDX] Star Trek 5: The Final Frontier [HDX] Drugstore Cowboy [HDX] Close Encounters of the Third Kind [HDX] Resident Evil [HDX] Starship Troopers 3: Marauder [HDX] Over Her Dead Body [HDX] Darfur Now [HDX] Mama’s Boy [HDX] Semi-Pro (Unrated) [HDX] Wild West Comedy Show: 30 Days and 30 Nights [HDX] Fool’s Gold [HDX] The Bucket List [HDX] Snow Angels [HDX] Speed Racer [HDX] Run, Fat Boy, Run [HDX] Step Into Liquid [HDX] The Spiderwick Chronicles [HDX] In Bruges [HDX] Signs [HDX] The Prestige [HDX] Invincible [HDX] Cube [HDX] Shaun of the Dead [HDX] The Recruit [HDX]

Into robotics?

10月 6th, 2008

via: Make - All Discussions (drop this source ”
show all sources)

help
relevance:
We're not sure if you'll like this post or not. Rate it to help us learn.
rate it:
|
I am looking for a mentor in the field of robotics. I have an interest in electronics, programming, microcontrollers, control systems, electro-mechanical devices and I am looking for opportunities to gain experience in the design of integrated systems of these technologies (i.e. robotics). I live in San Francisco and recently acquired my BSEE although I work for a consultanting firm where I don’t do much detailed design work. I would like to offer up my services as an unpaid intern or apprentice to a robotics professional or a professor involved in research in this field. What I am looking for is a well structured environment where I can contribute to solutions to real problems with an eye to grad school or a different job in the future. Can anyone offer some guidance as to how I can actualize this? I did well as an undergraduate (3.5+ GPA), have a few years of work experience and references. I have continued to study electronics and programming since graduation and have built a good foundation. Just looking for interesting projects! Any advice would be welcome.
Thanks!
Email this Save to del.icio.us Digg this Technorati Cosmos Links Sphere: Related Content

Well Performing Silverlight Application with XAML On Demand

10月 6th, 2008

With this post I’ll show you how you can extend the user interface of a Silverlight application with additional content downloaded on user’s demand. This is sometimes required if you want to have well performing Silverlight applications. What does it mean? That the content (UI + Assemblies) of an application can be splitted into multiple assemblies and pieces of UI can be organized into different XAML files and therefore downloaded on demand. Thus, at some point, the extra needed content must be brought down to the client.
In order to do that Silverlight comes with a WebClient class, which can be used each time you need to download stuffs from a web server.
In case you just need to download something that can be processed as a string (for instance JS code or plain XAML, but not managed code), then you can use the DownloadStringAsync method of the WebClient class. In this particular case you can then make use of the XAMLReader class in order to parse and transform the downloaded string into a Silverlight tree object, which can then be appended to the UI of the main application (for instance by using a stackpanel control as a placeholder).
If you think about what a more complex Silverlight application might needs, you will probably see that in many scenarios you will need to download not just some XAML but also some related code (for instance a code-behind file), which is compiled into an assembly. So, the next question is, how can I download and integrate extra assemblies into a Silverlight application on demand?
So, in this specific case you are not working with a string, but you are working with binaries which can also include XAML code. To solve this more challenging part, you can use once again the WebClient class, but this time you have to use the OpenReadAsync method, which connects to a specific URL (passed as a parameter) representing the additional xap package you want to download and returns a stream of data. Once you get the stream of data you can extract all the contained assemblies (including the XAML code) and load them in memory. Once the assembly has been loaded in memory you can instantiate the class you need.
In order to execute this big task Silverlight offers you once again some out-of the box classes: the StreamResourceInfo and the AssemblyPart class.
OK, this was just an introduction; let’s now start building our “on-demand” sample solution!
Create a new Silverlight project named MainSLApp within Visual Studio 2008. This will be our main Silverlight application and will be hosted inside a Web Site application (MainSLAppWeb).
Once you have created the project you will notice that 2 XAML files have been created: App.xaml and Page.xaml files (with related code-behind files). If you have a look at the App.xaml file you will see that there is a reference (x:Class=”MainSLApp.App” ) to the App class, which is the main Silverlight Application entry point. If you have a look at the constructor of the App class you can also notice that an handler for the Startup event is registered and that the code defined inside this handler (which runs when the application is instantiated by the Silverlight’s plug-in) instantiates the Page class (new Page();).
public partial class App : Application
{
public App()
{
this.Startup += this.Application_Startup;
this.Exit += this.Application_Exit;
this.UnhandledException += this.Application_UnhandledException;

InitializeComponent();
}

private void Application_Startup(object sender, StartupEventArgs e)
{
this.RootVisual = new Page();
}
…}
The Page class is defined within the Page.xaml.cs file and is bind to the Page.xaml file which represents the User Interface of our application. Now, in order to build our “on-demand” sample application let’s modify the XAML code of the Page.xaml file in the following way (note that the UI is represented by a UserControl):
xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
Width=”450″ Height=”300″>


Main User Interface with “Load Additional Content” Button

By pressing “Load Attitional Content” some extra stuff will appear within the blue area




By replacing the XAML inside the XAML designer you will get the following result:
Note that I have defined a StackPanel control as a placeholder for the additional content to be shown. It’s now time to implement the whole logic responsible for downloading all additional content (xaml + assemblies) from the web server down to the client machine. As mentioned before we are going to use the WebClient class with the OpenReadAsync method and the StreamResourceInfo and AssemblyPart classes.
In order to do that I’ll now implement a helper class named ManagedDownloader. Why this strange name and not just Downloader? Because I don’t want to create confusion between this class and the one available for Javascript.
Let’s add a new SilverlightClassLibrary project and name it SilverlightHelper. Then rename the Class1.cs file and the relative class name to ManagedDownloader.
Let’s now implement ManageDownloader. As first let’s define an event (PackageDownloaded), which will be fired when the ManagedDownloader class has finished downloading the whole xap package. Note that the event argument is of type PackageDownloadedEventArgs and that PackageDownloadedEventArgs implements a public member returning a UserControl (which represents the additional UI).
public class PackageDownloadedEventArgs : EventArgs
{
public UserControl Downloadedobj;
}

public class ManagedDownloader
{
public event EventHandler PackageDownloaded;
}
Now add the following methods to the ManagedDownloader class.
public void LoadPackage(string xapURL, string assemblyName, string userControlClassName)
{
_assemblyName = assemblyName;
_userControlClassName = userControlClassName;

WebClient wc = new WebClient();
wc.OpenReadCompleted += new OpenReadCompletedEventHandler(wc_OpenReadCompleted);
wc.OpenReadAsync(new Uri(xapURL));
}

void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
throw new NotImplementedException();
}
Also, do not forget to add the definition of the 2 private members (_assemblyName, _userControlClassName) to the ManagedDownloader class. If you have a look at the LoadPackage method you see that this method receives the address of the xap package to be downloaded, the assembly’s name to be loaded (assembly which is included in the xap package) and the class name of the UserControl to be instantiated (representing the additional UI). An instance of the WebClient class is then created created. Before calling the OpenReadAsync method (which returns a stream of data representing the xap package defined by the passed URL), an handler for the OpenReadCompleted event is registered (wc_OpenReadCompleted). This handler is called at the point the download of the xap package from the web server down to the client is completed. Let’s implement it.
void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
//e.Result contains the stream representing the xap package

//Extract the assembly from the xap package (zip package)
//and load it into the current application domain
Assembly assembly = LoadAssembly(_assemblyName, e.Result);
}

private Assembly LoadAssembly (string AssemblyName, Stream zipStream)
{
//assemblyURI defines the relative URI that indentifies the resource file to be extracted from the zip file)
Uri assemblyURI = new Uri(_assemblyName, UriKind.Relative);

//Extract and load the assembly containing the additional UI.
//The StreamResourceInfo class provides resource stream information
StreamResourceInfo zipPackageSRI = new StreamResourceInfo(zipStream, null);
StreamResourceInfo assemblySRI = Application.GetResourceStream(zipPackageSRI, assemblyURI);

//An AssemblyPart is an assembly that is to be included in a Silverlight application’s application package (xap)
AssemblyPart assemblyPart = new AssemblyPart();
//Load converts a Stream to an Assembly that is subsequently loaded into the current application domain
Assembly assembly = assemblyPart.Load(assemblySRI.Stream);

return assembly;
}
The LoadAssembly method takes the _assemblyName and the stream representing the xap/zip package (e.Result) and returns the loaded assembly which has been extracted from the original passed stream. I’m not going to describe each single step inside the LoadAssembly method…that’s the reason why I decided to add some comments to the code J.
The returned assembly contains the code behind file and the XAML of the additional content we want to display.
We now need to extract and create an instance of the UserControl representing the additional UI that must be added to the main Silverlight UI application. In order to return the UserControl’s instance we have to raise the PackageDownloaded event and populate the argument of the event by setting the Downloadedobj member to the UserControl’s instance. Add the following code to the wc_OpenReadCompleted event handler:
void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
//e.Result contains the stream representing the xap package

//Extract the assembly from the xap package (zip package)
//and load it into the current application domain
Assembly assembly = LoadAssembly(_assemblyName, e.Result);

if (PackageDownloaded != null)
{
PackageDownloadedEventArgs args = new PackageDownloadedEventArgs();

object userControlobj = assembly.CreateInstance(_userControlClassName);
args.Downloadedobj = userControlobj as UserControl;

//Raise the event
PackageDownloaded(this, args);
}
}
Now that our helper class is ready we just need to use it. But in order to use it we first need to create a new Silverlight Application project containing the additional UI to be displayed. Create a new Silverlight Application project and name it AdditionalUI. When the following dialog appears configure it as follow:
Modify the Page.xaml file content as above
xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
Width=”400″ Height=”100″>







and implement the Button_Click event handler as follow
private void Button_Click(object sender, RoutedEventArgs e)
{
myTextBlock.Text = DateTime.Now.ToLongTimeString();
}
You now need to compile the entire solution by pressing Ctrl+Shift+B. In the ClientBin folder of the web hosting application (MainSLAppWeb) you should now find 2 xap files: the MainSLApp.xap file, representing the main application package and the AdditionalUI.xap file, representing the additional content to be loaded on demand.
We are now ready to use the helper class. Open the Page.xaml file of the MainSLApp project and register an event handler for the click event of the “Load Additional Content” button control.
. . .

. . .

Implement the LoadExtraUI_Click event handler in the following way:
private void LoadExtraUI_Click(object sender, RoutedEventArgs e)
{
ManagedDownloader mdownloader = new ManagedDownloader();
mdownloader.PackageDownloaded += new EventHandler(mdownloader_PackageDownloaded);

mdownloader.LoadPackage(”http://localhost:57561/MainSLAppWeb/ClientBin/AdditionalUI.xap”,
“AdditionalUI.dll”,
“AdditionalUI.Page”);
}

void mdownloader_PackageDownloaded(object sender, PackageDownloadedEventArgs e)
{
myPlaceHolder.Children.Add(e.Downloadedobj);
}
Note that an instance of our helper ManagedDownloader class is created. An handler (mdownloader_PackageDownloaded) for the PackageDownloaded event is registered and then implemented. The PackageDownloaded event fires when our ManagedDownloader helper class has downloaded the xap package defined in the URL (http://localhost:57561/MainSLAppWeb/ClientBin/AdditionalUI.xap), has extracted the assembly (AdditionalUI.dll) and has instantiated the proper class/object (AdditionalUI.Page). Be sure that the provided address is correct (you probably need to change the port number).
Note also that in the event handler the downloaded object (which is our UserControl) is added to the Children collection of the myPlaceHolder StackPanel control we defined before.
You can now start the web application by pressing Ctrl+F5 and if everything is fine, by pressing “Load Additional Content” you will see the additional content downloaded and displayed. It’s now possible to interact with the additional part.
If, for any reason you need to hide or remove the additional UI, it makes sense to save the downloaded object (e.Downloadedobj) in a local variable so that you can avoid downloading again the same UI. To remove the added part it’s enough to call the Remove method from the Children collection of the myPlaceHolder control.
Of course the whole implementation lacks of error handling and could have been written in a more structured way; anyway it gives you an idea how you can implement an on-demand solution.
The final sample application is available as attachment to this post!
Hope it helps,
Ken

Serving Silverlight applications on client PCs without a web server using WCF 3.5

10月 6th, 2008

There are scenarios where you don’t want to have IIS installed on a machine and you still want to serve a Silverlight application for local or remote users. One of this scenario is an embedded machine that controls some machinery that needs to have a local UI and a remote UI.
I have lately run in one of this scenario where an embedded PC needs to control some external switches and motors that sould have a local (touch panel) UI and a couple remote PC, eventually even on mobile devices. Although IIS can be installed on the machine it seems a bit of overkill for serving a .xap file only.
To note that Silverlight is not supported on Windows XP embedded but it will be in the next release called Windows Embedded Standard that should ship in the next few months.
View that you probably don’t have PLC for controlling motors, switches, etc.. in this example I’m building a simple performance monitor with a REST interface and a SL UI that you can be run locally or remotely.
How do I build my own web server? One cool new feature of WCF 3.5 is the new Web Programming Model that is made for building REST services. View that a REST service is nothing more than a HTTP request/response with a XML return I quickly figure out that I could transform it on a custom Web Server. Plus a REST interface would also make sense in this embedded scenario so other devices could easily communicate with the services itself as I will be showing you in this blog.
Basically I need to build a WCF service that has a REST interface for querying the CPU utilization and a service to serve the .HTML page hosting SL and the SL application (.xap)
Let’s start and build the solution:
I first create a console application. Normally you would host your services on a Windows Service but for demo purpose a console app is easier. Now I add a WCF services class called RestService.
In the IRestService.cs I will write the REST interface for the CPU monitoring but also the interface for serving the Html page that will host Silverlight and the .xap. You also need to add a reference to the Sytem.ServiceModel.Web assembly.
IRestService.cs code:
[ServiceContract]
public interface IRestService
{
[OperationContract]
[WebGet(UriTemplate = "")]
Stream GetHtml();

[OperationContract]
[WebGet(UriTemplate = "clientaccesspolicy.xml")]
Message GetPolicy();

[OperationContract]
[WebGet(UriTemplate = "SLCPUClient.xap")]
Stream GetXap();

[OperationContract]
[WebGet(BodyStyle = WebMessageBodyStyle.Bare,
UriTemplate = "/CPU")]
float GetCPU();

}
Basically this will expose the following url:
http://localhost:8001 will serve the .HTML page hosting the SL plug in. GetHtml method
http://localhost:8001/clientaccesspolicy.xml
http://localhost:8001/SLCPUClient.xap will server the .xap file
http://localhost:8001/CPU is the REST interface for getting the CPU utilization.
One thing to notice is that the /CPU is returning a plain XML. So it needs to be parsed in SL. Now for a single float value is not a big issue but if you would return a List containing multiple values it could be a tedious work. One way would be to expose it as a SOAP service but I would like to keep a simple REST interface that should be fully operable even from a browser url. The solution is to use JSON serialization, view that Silverlight has a JSON serializer this should be fairly easy to implement. So we need to add an additional method for getting a JSON payload:
[OperationContract]
[WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json,
UriTemplate = "/CPU?Json=true")]
float GetCPUJson();
Now let’s implement the service itself in the RestSerice.cs:
public class RestService : IRestService
{

public static PerformanceCounter pc = new PerformanceCounter(”Processor”, “% Processor Time”, “_Total”);

public Stream GetHtml()
{
return new FileStream(”TestPage.html”, FileMode.Open, FileAccess.Read);

}

public Stream GetXap()
{
WebOperationContext.Current.OutgoingResponse.ContentType = “application/x-silverlight”;
return new FileStream(”SLCPUClient.xap”, FileMode.Open, FileAccess.Read);
}

public Message GetPolicy()
{

TextReader reader = new StringReader(@”







“);

XmlReader xmlreader = XmlReader.Create(reader);

return Message.CreateMessage(MessageVersion.None, “”, xmlreader);
}

public float GetCPU()
{
WebOperationContext.Current.OutgoingResponse.Headers["Cache-Control"] = “no-cache”;

return pc.NextValue();
}

public float GetCPUJson()
{
return GetCPU();
}

}

You can see that is fairly easy to implement the html and .xap serving methods. One small notice is that you need to set the MIME type for .xap:
WebOperationContext.Current.OutgoingResponse.ContentType = “application/x-silverlight”;

Another very important piece of code that you need to add is the caching directive. If you omit that your browser, so indirectly the SL client, will cache the /CPU request:
WebOperationContext.Current.OutgoingResponse.Headers["Cache-Control"] = “no-cache”;
Now we simply need to add the code for starting the WCF services. If you use only the Web Programmability Model you can skip completely the config file so you should remove or comment out the services part in the app.config file.
Let’s add the code for starting the service on the console startup, Program.cs:
static void Main(string[] args)
{
string url = “http://localhost:8001″;

WebServiceHost host = new WebServiceHost(typeof(RestService), new Uri(url));

host.Open();

Console.WriteLine(”Ready”);

Console.ReadLine();
}

The cool thing about the new web programmability of WCF 3.5 is that you can basically build your own web server in a few line of code.
Now we can try the rest interface by simply starting the console app and open a browser with this url http://localhost:8001/CPU hit F5 a couple of time and you will see the CPU value of your machine.
Now is time to create the Silverlight client that I call SLCPUClient. You can create a project without a web site but it is handy to have one as an easy way to debug.Remeber to add a reference to System.ServiceModel.Web assembly where the JSON serializer class is located.
Normally at this point I right click on the Page.xaml and open it in Blend to build the UI. Here the XAML code that I create with Blend:





Now is time to wire up some code on the Silverlight client:
DispatcherTimer dt = new DispatcherTimer();

public Page()
{
InitializeComponent();
this.Loaded += new RoutedEventHandler(Page_Loaded);
}

void Page_Loaded(object sender, RoutedEventArgs e)
{

dt.Tick += new EventHandler(dt_Tick);
dt.Interval = new TimeSpan(0,0,0,0,200);
dt.Start();

}

void dt_Tick(object sender, EventArgs e)
{
WebClient client = new WebClient();
client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
client.DownloadStringAsync(new Uri(”http://localhost:8001/CPU?Json=true”));

}

void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
float cpuValue;
using (MemoryStream ms = new MemoryStream())
{
byte[] bytes = UnicodeEncoding.Unicode.GetBytes(e.Result);
ms.Write(bytes, 0, bytes.Length);
ms.Position = 0;
DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(float));
cpuValue = (float)serializer.ReadObject(ms);

}

PctRectangle.Width = cpuValue * 2;
CpuLabel.Text = ((int)cpuValue).ToString() + ” %”;
}

Basically I have a timer that every 200 ms will call the service with the ?Json=true and deserialize back the return as float. Then I simply change the width of a green rectangle and display the value as a label too. You could easily have a List to be serialized and deserialized through Json if you need to pass a collection of complex type.
The last thing to do is to copy the .HTML and the .XAP where the console app is executed.you can grab the TestPage.html and the SLCPUClient.xap here WCFSelfHostBlog\SLCPUClient\Bin\Debug (or the release folder) and copy on the debug (or release folder) of the console app: WCFSelfHostBlog\bin\Debug. You could even setup Visual Studio to copy these two files at each compilation.
Now if you run the console application and you open your browser on http://localhost:8001/ you will get the Silverlight apps displaying your CPU usage.
One last touch is to add this code on the console Main method to automatically start Internet Explorer in kiosk mode when you start your console app:
ProcessStartInfo si = new ProcessStartInfo(”iexplore.exe”, “-k \”http://localhost:8001\”");
Process.Start(si);

Pretty cool and easy. Normally I would recommend using WPF for this sort of apps but if you need to control a machinery locally and remotely by different type of PC or MAC or even mobile, Silverlight and WCF 3.5 is surely a viable solution.
Attached you find the full solution. Simply start the WCFSelfHostBlog project and you can test the app.
Have fun
Ronnie Saurenmann

Iraq: The Surge Is Not Working.

10月 6th, 2008

via: digg.com: Stories / Popular (drop this source ”
show all sources)

help
relevance:
We're not sure if you'll like this post or not. Rate it to help us learn.
rate it:
|
MOSUL, Iraq (Reuters) - Eleven Iraqis were killed on Sunday during a U.S. raid on a home in northern Iraq in which a suicide bomber detonated an explosive vest among civilians inside, the U.S. military said. A U.S. military spokesman said it was not…
Email this Save to del.icio.us Digg this Technorati Cosmos Links Sphere: Related Content

Gong Li now a Singapore citizen?

10月 6th, 2008

Source: http://www.asiaone.com/Just%2BWoman/News/Celebrities/Story/A1Story20080826-84297.html
The white chair had a small label with the words ‘Gong Li’.
But no one arrived to sit on it.
At the Supreme Court Auditorium last night, 150 new Singapore citizens gathered to receive their citizenship certificates from Speaker of Parliament Abdullah Tarmugi at the National Citizenship Ceremony.
Gong Li married Singapore businessman Ooi Hoe Seong in a star-studded wedding held in Hong Kong in 1996.
Indian-born scientist Colin Gerard D’Silva, 42, was in the chair next to the one for ‘Gong Li’.
He wondered: Could it really be the acclaimed Chinese actress, star of movies like Red Sorghum, Curse Of The Golden Flower and Memoirs Of A Geisha?
‘I thought it might be her, or someone with the same name,’ said Mr D’Silva, who works in Proctor & Gamble as its associate director of external relations.
Well, the answer is most probably ‘yes’.
Sources had tipped off The Sunday Times that Gong Li, 42, one of China’s most famous actresses, had applied for Singapore citizenship and was supposed to collect her pink IC at the event last night.
She married Singaporean tobacco businessman Ooi Hoe Seong in 1996. He is said to be based in Hong Kong.
When contacted, the authories were tight-lipped about the identity of ‘Gong Li’ although an official expressed surprise that we had heard about it.
An Immigration and Checkpoints Authority spokesman said she was unable to comment on individual cases due to confidentiality issues.
A spokesman for the Ministry of Community Development, Youth and Sports (MCYS), which organised the event, would only say that ‘a person by the name of Gong Li was supposed to be at the event’.
Still, some officials at the event were clearly expecting the superstar to show up. Two were overheard discussing the actress. They even pointed out the actress’ seat - No. 133 - to The Sunday Times.
But she didn’t turn up in the end.
Gong Li was apparently supposed to attend the National Citizenship Ceremony on Saturday but she was a no-show.
When The Sunday Times contacted Gong Li’s friends in Singapore, some were shocked to hear that the actress has become a Singaporean.
Photographer Wee Khim, 44, who last worked with Gong Li in June for a L’Oreal commercial in Thailand, said it was ‘quite a big move’ to switch citizenships.
But celebrity hairstylist David Gan was not surprised at all. He said it was ‘old news’.
‘I knew about it a few months ago. She told me she applied for a Singapore passport. I told her it’s good and I even congratulated her,’ he said in Mandarin yesterday.
Gan, who is in his 40s, revealed that Gong Li had stayed in Singapore for a week in May to apply for the citizenship. He did not ask her why she decided to become a Singaporean.
Noting that he also became a Singapore citizen, the Malaysian-born hairstylist said: ‘Singapore is a good place. She travels a lot and it’s convenient to hold a Singapore passport. A lot of stars like to stay here too. There’s no paparazzi. When I walk down Orchard Road with Gong Li, nothing happens.’
Both Singapore and China do not recognise dual nationality.
To become a Singaporean, an applicant is required to renounce his foreign citizenship at his embassy in Singapore.
The final step would be to attend a citizenship ceremony to collect his Singapore identity card. All new citizens are required to do so and if they can’t attend one ceremony, they will be rescheduled for another.
The ceremony is held at the constituency level or at the national level. In the latter, selected groups are chosen to get their papers in a more formal setting.
Gong Li, who was born in east China’s Shandong province, is most famous for her acclaimed Zhang Yimou movies like Red Sorghum and Judou. She broke into the Hollywood scene in 2005, playing a Japanese geisha in Memoirs Of A Geisha. It was the first of three big English-language productions she has shot since.
Her wedding to Mr Ooi was held at the top-floor restaurant of the Bank of China building in Hong Kong and guests included Lin Ching-hsia, Leslie Cheung and Anita Mui.
Mr Ooi has a daughter, now 30, from a previous marriage, but he keeps a low profile.
In earlier reports, the actress had told the media that she did not intend to make Singapore her home. ‘No, I doubt it. Hong Kong and Beijing will still be my bases because of my work,’ she said in 1996.
She is said to fly to Singapore two to three times a year and enjoys the shopping and food - like bak kut teh (pork ribs soup) and prawn noodles - here.
It is not known how her new identity will affect her work.
Besides her filming commitments, she is also reported to be an elected member of the Chinese People’s Political Consultative Conference (CPPCC), China’s lower house.
Last year, she attended a session of the CPPCC in which she made a proposal on environmental issues.
Some were more than happy to have the Chinese actress become a Singaporean.
Said China-born Jasmine Li, 33, an assistant secretary who became a Singapore citizen last year: ‘Now Singapore will have an extra star.’

Dear Kate: One year.

10月 6th, 2008

Dear Kate,
Today you are one year old. You don’t know this, because we celebrated yesterday. It was more convenient for us, and we have that kind of control over your life until you learn to count and read a calendar. I like to brag about that control because I have to fight you for it in just about every other area these days. Since you learned to crawl, you’ve been testing out a new independent outlook on life, which is described in my baby book as “self-agency” and which seems to boil down to a mission to find and play with, crawl on, or climb up the exact thing in any given room that has the most potential to hurt you. The problem is that you have no depth perception, no ability to judge whether or not your body will fit through a given space, and, as you can see from this picture, no idea what the dining room chairs will taste like once you finally get a mouthful of them.
This month, in various fits of self agency, you have fallen off the couch, slipped backwards in the bathtub, and conked your head on the dining room table, leaving two little bruises on your forehead just in time for your birthday pictures. This is not exactly making me feel like Mother of the Year. But I am told by people who ought to know that you have to start understanding gravity at some point, and this is how it happens. I wish it didn’t have to involve so much falling down, but I actually think that is harder for me than it is for you. You pretty much recover if I offer you a graham cracker, whereas it takes me an hour to get my blood pressure back down after one of your tumbles. Maybe I should try one of those graham crackers.
This month, you have started talking to yourself. I’ve mentioned before how much you babble, but lately it sounds like you’re actually having a conversation. All the inflection is there … your voice goes up and down, you pause in all the right places, you ask questions, and sometimes you even change your voice as if now you are repeating the words of someone else. It’s just that none of it is in English. It’s in baby gibberish. Your favorite non-words right now are “yosh” “dat” and “jish” and you say them so much that we think that you are under the impression that they are actual words. I hate to break it to you, kiddo, but we have no idea what you’re talking about. If you want to get an interpreter in here, that’s fine with us, but in the meantime, we’ll be muddling through with gestures and the few signs you’ve picked up. The words “please”, “eat”, and, oddly enough, “fish” make up your your entire signing lexicon. Not exactly the stuff of great oration. Still, it’s progress.
Among your peers in our circle of friends, you are clearly going to be the last one to walk. I chalk this up to lack of athletic genes from your dad and I, but you are at least starting to show signs of being interested in the process. Right now, this means that you want to spend a lot of time holding onto our hands while you practice walking. It’s one of the few times in my life that I have wished to be shorter, since for me and your very very tall dad, it’s not very comfortable to hold the crouched position required to support you. I find myself torn between wanting you to hurry up and learn to walk and hoping that you take your time. I got a little preview of what life with you walking might be like when we were in Minnesota last week. There was a flight of carpeted stairs. We don’t have stairs in our house. And the stairs at the lake cabin where we were staying looked somewhat dangerous. So of course you were totally in love with …. the stairs! And I was horrified — HORRIFIED– at how quickly you learned to climb them. I stood behind you to act as a buffer while you made your initial attempts and thought “Oh, that’s a pretty complicated move. She probably won’t really get the hang of it until it’s time to go home.” And then, ten minutes later, there we were, halfway up the stairs. I can feel my hair turning gray.
In lieu of stairs, your new task in life is to learn how to climb in and out of the barn animal themed rocking chair Grammy bought you for your birthday. You don’t understand why you can’t just lean forward until you magically aren’t in the chair anymore. I have a feeling gravity is going to catch up with you on that one, too.
Back to your birthday. In the afternoon, we baked you cupcakes, blew up balloons, stripped you down to your diaper and let you go at it. You loved the balloons. You loved the cupcakes until you got freaked out by the stickiness of the icing all over your body and wanted a bath. You loved all the attention you got and the candles and the singing and grandparents talking to you on the phone. It was all about you, and that’s pretty much your favorite kind of shindig.
And then, after we put your sugar-laced self to bed, your daddy and I got dressed up and went out on the town. That’s right, on your birthday, we got a reservation at one of the nicest restaurants in Albuquerque, sat at a beautiful table overlooking the Sandia mountains, and celebrated the fact that we have survived the first year of your life. We intended to go out and have some nice, grown up conversation. But mostly, we talked about you. We marveled at how much you’ve changed since the day we first met you, and how much joy and laughter you have brought us, and everything that we’ve learned this year about you and about each other. And while some of this year has been hard, because change is always hard, we wouldn’t change anything about where we are now.
So as I reach the end of a whole year of writing you these letters, I hope that one day you will read them and know how much we love you. When I think back to one year ago today, it isn’t being in labor that I remember the most, although that was certainly an experience. The strongest memory I have of that day is this:
After you were born and your daddy had gone home to get some sleep because the hospital was so full he couldn’t stay with us, I got settled into my bed and the nurse who was taking care of us brought you to me so that I could feed you. She left us alone, and it was the first quiet moment I could remember in the last 24 hours. It was the middle of the night, probably actually early in the morning by this time, and I was totally exhausted, but I could finally look at you as much as I wanted to. I have been a blessed person all my life, Kate. God has been good to me in so many ways, most of them ways that I take for granted. But sitting there in the first hours of your life, I knew that God had turned to me out of everyone in the world and blessed me with the specific, unique, beautiful little person who I was holding in my arms. Since then all the parts of the Bible that talk about how God loves us as His children have seemed so much more personal to me. That’s not a generic, one-size-fits-all kind of love. That’s a love that knows your name. I hope you never forget that.
Happy first birthday.
I love you,
Mommy
Photo credit, Rebecca Tredway.