text:
After reading the 900th morning brew, one article by mike taulty about comparing Rx, TPL and async caught my attention.
Mike tries to explain the history, differences and similarities between all these frameworks, and kudos, that's not an easy thing to do.
Asynchrony, (and I'm not talking parallelism), is a complex topic that fools even the best of us.
Rx and Async and much more similar in that regard, because going off to an other thread is not mandatory, and most operators use either the CurrentThread (timebase priority queue) scheduler or the Immediate (passive wait) scheduler.
This means that the code you are writing is doing some cooperative multi-threading, or fibers-like processing. Everything happens on the same thread, except that work is optionally being queued up, and that thread works as long as there's work left to do, then waits for outstanding operations. These oustanding operations can be I/O completion port bound, like Stream.BeginRead/EndRead.
But back to the comparison, mike is trying to do buffer reading of content from a web response stream, and doing so using the Async CTP's ReadAsync and WriteAsync eases a lot the writing of that kind of code. (Also, the Rx example does not work correctly, but I'll talk about that later in this post.)
These two functions are not tied to the complexity of the BeginRead/EndRead, and behave very much like an IObservable would. Call ReadAsync, you get a Task and wait on it.
Let's jump to the end result and we can get this with Rx based composed operators, using methods symilar to the ReadAsync and GetResponseAsync :
string url = "http://www.microsoft.com";
var webRequest = WebRequest.Create(url);
.SelectMany(wr => wr.GetResponseStream().ToBytes())
b => Console.WriteLine(Encoding.Default.GetString(b))
That way, it is a lot easier to read. ToResponse maps to GetResponseAsync and ToBytes maps to ReadAsync.
I'll concede the complexity of the SelectMany operator that is related to the fact that IObservable deals with sequences (the duality with IEnumerable). What we would need is more like a IObservableValue that returns only one value. At that point, an appropriate operator would be something like SelectOne, but that's an other topic I'll discuss soon.
This one is easy, and is pretty much an encapsulation of the code provided in Mike's Rx example :
public static IObservable ToResponse(this WebRequest request)
var asyncGetResponse = Observable.FromAsyncPattern(
request.BeginGetResponse, request.EndGetResponse);
return Observable.Defer(asyncGetResponse);
The use of defer allows the execution of the actual call to GetResponse when someone is subscribing to the deffered observable.
That one is a bit tricker :
public static IObservable ToBytes(this Stream stream)
observer =>
byte[] buffer = new byte[24];
var obsReadFactory = Observable.Defer(() => stream.AsReader()(buffer, 0, buffer.Length));
return Observable
.Select(i => buffer.Take(i).ToArray())
// Subscribe on the thread pool, otherwise the repeat operator will operate during the
// call to subscribe, preventing the whole expression to complete properly
_ =>
if (_.Length > 0)
and needs a bit of explaining.
The ToBytes extension is creating a Observable that will be able to control finely the OnNext/OnCompleted events, especially because of the loopy nature of the BeginRead API. Loopy means that in a synchronous mode, you needs to call Read through a loop until you get all you need. The BeginRead/EndRead still expose this loopy nature, but in an asynchronous way.
With Rx, that loop can be introduced with the use of Repeat, the same way a while(true) would do.
The Select operator is pretty straightforward, even if it may not be as fast as a Buffer.BlockCopy, it's pretty conscise.
The SubscribeOn is the tricky part of this method, and is very important for the OnCompleted events to get through. If this operator is not present, the call to the ToBytes method blocks in the Subscribe of the SelectMany operator in the final example. This means that events like OnCompleted get buffered and not interpreted, and the repeat operator will continue indefinitely to turns into loops getting nothing, because noone's unsubscribing. This would be CPU consuming, and memory consuming because the observable expression could not get dispose.
Then in the subscribe, we notify the observer that either there's a new buffer, or that we're done because the EndRead method returned 0 (or an exception).
All this to say that the .NET 5.0 (or whatever it will be called) has a Task friendly BCL that makes it easy to write asynchronous code.
I'm definitely not saying that Rx is as easy as Async will be, but, with a minimum of understanding and abstraction, it can be as powerful and even more powerful because of its ability to compose observables.
Now, for the issues in Mike's Rx sample :
The sample actually shows something, but the CPU will stay at 100% until the process ends.
Asynchrony is a complex topic, very easy to get wrong, even with the best intentions. Parallelism is even more complex (and don't get me started on the lock() keyword).
I'm expecting that People are going to have a hard time grasping it, and I'm worried that Async will make it too easy to make parallelism (not asynchrony this time) mistakes, because it is will be easy to introduce mutating states in the loop, hence hard to reproduce transitory states bugs. Calling "new Thread()" was scary, and for good reasons, but using await will not, but with mostly the same bad consequences.
I'd rather have better support for immutable structures method or class purity and some more functional concepts baked into C#, where the language makes it harder to make mistakes, than trying to bend (or abstract) asynchrony to make it work with the current state of C#.
Then again, I'm not saying Rx is better, it's trying to work around the fact that the BCL and C# 3.0 don't have asynchrony baked in, so the complexity argument still stands.
On the other side, the more developers use Async, the more developers will need async savvy consultants as firemen :)
TLDR: The creation a C# expression tree is not cached, and using it to simulate a methodof keyword is terribly slow. This article is about reconsidering the use of this technique when performance is a concern.
During the development of my last projects, and it's been like that for a while, I've been used to look for ways to express programs in a more declarative or functional way.
LINQ is a pretty good tool to acheive that, as well as fluent interfaces, lamdbas and all those neat language features and tricks.
But there are some times when the language is not there to support patterns, like with the use of the IPropertyChanged interface. The language (and the CLR for that matter) does not publicly support intercepting calls to properties or methods. That can actually be done through Transparent Proxies or dynamic proxy generation, but these are not supported on Windows Phone 7. The latter somehow will on WP7.1.
Anyway, using that interface requires raising an event with a string containing the name of the property that has changed.
The use of metadata in the form of strings is unfortunately not refactoring friendly, and if you change your property name, you've got a bug on your hands.
Since there is no methodof keyword in C#, you could say that the language is against you since there is no direct way to get the name of a property or method at compile time.
This can still be done through reflection with plumbing code that uses Expression Trees to work around it, and it works pretty fine.
That way you can easily write nice wrappers like this one :
public int MyProperty
get { return GetValue(() => MyProperty); }
set { SetValue(() => MyProperty, value); }
That way, you get both the type safety and the refactoring friendly use of INotifyPropertyChanged.
If you crack open the assembly for a property like this one with a disassembler, you get this :
public int MyProperty
return this.GetValue<int>(
Expression.Constant(this, typeof(MainPage)
(MethodInfo) methodof(MainPage.get_MyProperty)
new ParameterExpression[0]));
Expression.Constant(this, typeof(MainPage)),
(MethodInfo) methodof(MainPage.get_MyProperty)
new ParameterExpression[0]),
That's a lot of code !
And worse, that's not the end of it, because you'll have to traverse the expression just to get the "methodof", and then call the "Name" property to get the string. All this for a string that will never change after you've compiled your assembly.
But that would not be that bad if you executed that code once, or ran it on a desktop computer (or you don't care about performance). For desktop and server applications, where the cost of executing that kind of code is (almost) neglectible, you do not care much about that.
But if you execute that code a few million times, or run it on a Windows Phone 7 on the UI thread, you've got a problem. The expression is not cached, neither in a static variable or an instance variable, depending on the context. Sure, you could store it in an expression typed variable, and cache it manually that way, but you'd lose a bit declarativeness.
To make a small comparison, it takes 13 seconds on my Samsung Focus to execute 10,000 gets of the property using expressions, and takes 0.2 milliseconds to do the same using a simple string.
Pretty easy to choose, isn't it ?
That's where you lose the declarativeness away for performance, and cringe a little bit about it when you know that you'll have to chase a bug in the future because of a lazy rename. Still, you can have debug-time only code that walks up the stack and checks that the property actually exists, but you have to execute that code to find the bug.
Hopefully, there are tools like Postsharp that help in that regard, where a post processing step does the reflection once and for all, and injects that missing string. That's direction I'd rather not take, but since there's still no out of the box solution, that can be a good fit.
We're so used to techniques that avoid us to write boring code, but when performance is a concern, it is necessary to reconsider all coding reflexes and think twice before using them.
TLDR: The Reactive Extensions provide a TestScheduler class that abstracts time and allows for a precise control of a virtual time base. Using the Rx Schedulers mecanism instead of real timers enables the creation of fast running unit tests that validate time related algorithms without the inconvients of the actual time.
Granted, the title is a bit provocative, but nonetheless it's still a bad idea to use timer classes like System.Threading.Timer.
Why is that ? Because classes like this one are based on the actual time, and that makes it a problem because it is non-deterministic. This means that each time you want to test a piece of code that depends on time, you'll be having a somehow different result, and particularly if you're using very long delays, like a few hours, you probably will not want to wait that long to make sure your code works as expected.
What you want actually, to avoid the side effect of "real" time passing by, is virtual time.
The reactive extensions are pretty good at abstracting time, with the IScheduler interface and TestScheduler class.
Most operators in the Rx framework have an optional scheduler they can use, like the Dispatcher or the ThreadPool schedulers. These schedulers are used to change the context of execution of the OnNext, OnCompleted and OnError events.
But for the case of time, the point is to freeze the time and make it "advance" to the point in time we need, and most importantly when we need it.
Let's say that we have a view model with a command that performs a lengthy action on the network, and that we need that action to timeout after a few seconds.
Consider this service contract :
public interface IRemoteService
/// Gets the data from the server,
/// returns an observable call to the server
/// that will provide either no values, one
/// value or an error.
IObservable<string> GetData(string url);
This implementation is exposing an observable based API, where the consumer of this contract must take into account the fact that getting data must be performed asynchronously, because it may not provide any value for a long time or even not return anything at all.
Next, a method of a view model that is using it :
public void GetServerDataCommand()
IsQueryRunning = true;
ShowError = false;
.Finally(() => IsQueryRunning = false)
s => OnQueryCompleted(s),
e => ShowError = true
And we can test it using Moq like this :
var remoteService = new Mock<IRemoteService>();
// Returns far in the future
remoteService.Setup(s => s.GetData(It.IsAny()))
Observable.Return("the result")
var model = new ViewModel(remoteService.Object);
// Call the fake server
// Sleep for a while, before the timeout occurs
// Sleep beyond the timeout
// Do we have an error ?
The problem with this test is that it depends on actual time, meaning that it takes at least 16 seconds to complete. This is not acceptable in a automated tests scenario, where you want your tests to run as fast as possible.
We can introduce the use of an injected IScheduler instance into the view model, like this :
.Timeout(TimeSpan.FromSeconds(15), _scheduler)
Meaning that the both Start and Timeout will get executed on the scheduler we provide, for which the time is controlled.
We can update the test like this :
var remoteService = new Mock<IRemoteService>();
var scheduler = new TestScheduler();
// Never returns
remoteService.Setup(s => s.GetData(It.IsAny<string>()))
Observable.Return("the result", scheduler)
.Delay(TimeSpan.FromDays(1), scheduler)
var model = new ViewModel(remoteService.Object, scheduler);
// Call the fake server
// Go before the failure point
// Go beyond the failure point
// Do we have an error ?
When the scheduler is created, it holds of all the scheduled operations until AdvanceTo is called. Then the scheduled actions are executed according to the virtual current time.
That way, your tests run at full speed, and you can test properly your time depedent code.
TLDR: This post talks about how the Reactive Extensions ObserveOn operator changes the execution context (the thread) of the IObservable OnNext/OnComplete/OnError methods, whereas the SubscribeOn operator changes the execution context of the implementation of the Subscribe method in the chain of observers. Both methods can be useful to improve the performance of an application's UI by putting work on background threads.
When developing asynchronous code, or consuming asynchronous APIs, you find yourself forced to use specific methods on a specific thread.
The most prominent examples being WPF/Silverlight and Winforms, where you cannot use UI bound types outside of the UI Thread. In the context of WPF, you'll find yourself forced to use the Dispatcher.Invoke method to manipulate the UI in the proper context.
However, you don't want to execute everything on the UI Thread, because the UI performance relies on it. Doing too much on the UI thread can lead to a very bad percieved performance, and angry users...
I've discussed a few times the use of ObserveOn in the context of WP7, where it is critical to leave the UI thread alone and avoid choppy animations, for instance.
The ObserveOn operator changes the context of execution (scheduler) of a chain of operators until an other operator changes it.
To be able to demonstrate this, let's write our own scheduler :
public class MyScheduler : IScheduler
// Warning: ThreadStatic is not supported on Windows Phone 7.0 and 7.1
// This code will not work properly on this platform.
public static int? SchedulerId;
private int _schedulerId;
private IScheduler _source;
public MyScheduler(IScheduler source, int schedulerId)
_source = source;
_schedulerId = schedulerId;
public DateTimeOffset Now { get { return _source.Now; } }
public IDisposable Schedule<TState>(
TState state,
Func<IScheduler, TState, IDisposable> action
return _source.Schedule(state, WrapAction(action));
private Func<IScheduler, TState, IDisposable> WrapAction<TState>(
Func<IScheduler, TState, IDisposable> action)
return (scheduler, state) => {
// Set the TLS with the proper ID
SchedulerId = _schedulerId;
return action(_source, state);
This scheduler's purpose is to intercept calls to the ISchedule methods (You'll fill the missing Schedule methods by yourself) and flag them with a custom thread ID. That way, we'll know which scheduler is executing our code.
Note that this code will not work properly on Windows Phone 7, since ThreadStaticAttribute is not supported. And it's still not supported on 7.1... Seems like not enough people are using ThreadStatic to make its way to the WP7 CLR...
Anyway, now if we write the following Rx expression :
Observable.Timer(TimeSpan.FromSeconds(1), new MyScheduler(Scheduler.ThreadPool, 42))
.Do(_ => Console.WriteLine(MyScheduler.SchedulerId))
We force the timer to raise OnNext on the ThreadPool through our scheduler, and we'll get the following :
Which means that the lambda passed as a parameter to the Do operator got executed in the context of the Scheduler used when declaring the Timer operator.
If we go a bit farther :
Observable.Timer(TimeSpan.FromSeconds(1), new MyScheduler(Scheduler.ThreadPool, 42))
.Do(_ => Console.WriteLine("Do(1): " + MyScheduler.SchedulerId))
.ObserveOn(new MyScheduler(Scheduler.ThreadPool, 43))
.Do(_ => Console.WriteLine("Do(2): " + MyScheduler.SchedulerId))
.ObserveOn(new MyScheduler(Scheduler.ThreadPool, 44))
.Do(_ => Console.WriteLine("Do(3): " + MyScheduler.SchedulerId))
.Do(_ => Console.WriteLine("Do(4): " + MyScheduler.SchedulerId))
We'll get the following :
Do(1): 42
Do(2): 43
Do(3): 44
Do(4): 44
Each time a scheduler was specified, the following operators OnNext delegates were executed on that scheduler.
In this case, we're using the Do operator which does not take a scheduler as a parameter. There some operators though, like Delay, that implicitly use a scheduler that changes the context.
Using this operator is particularly useful when the OnNext delegate is performing a context sensitive operation, like manipulating the UI, or when the source scheduler is the UI and the OnNext delegate is not related to the UI and can be executed on an other thread.
You'll find that operator handy with the WebClient or GeoCoordinateWatcher classes, which both execute their handlers on the UI thread. Watchout for Windows Phone 7.1 (mango) though, this may have changed a bit.
Using an Rx expression is performed in a least 5 stages :
The third part's execution context is covered by ObserveOn. But for the first two, this is different.
The expression is constructed like this :
var o = Observable.Timer(TimeSpan.FromSeconds(1));
Almost nothing's been executed here, just the creation of the observers for the entire expression, in a similar way IEnumerable expressions work. Until you call the IEnumerator.MoveNext, nothing is performed. In Rx expressions, until the Subscribe method is called, nothing is happening.
Then you can subscribe to the expression :
var d = o.Subscribe(_ => Console.WriteLine(_));
At this point, the whole chain of operators get their Subscribe method called, meaning they can start sending OnNext/OnError/OnComplete messages.
Then you meet that kind of expressions :
// Merge both enumerables into one, whichever the order of appearance
new MyScheduler(Scheduler.ThreadPool, 42)
.Subscribe(_ => Console.WriteLine("Do(1): " + MyScheduler.SchedulerId));
Console.WriteLine("Subscribed !");
This expression will merge the two observables into one that will provide two values, one from Return and one from the timer.
And this is the output :
Subscribed !
Do(1): 42
The Observable.Return OnNext was executed during the call to Subscribe, and has that thread has no SchedulerId, meaning that a whole lot of code has been executed in the context of the caller of Subscribe. You can imagine that if that expression is complex, and that the caller is the UI Thread, that can become a performance issue.
This is where the SubscribeOn operator becomes handy :
// Merge both enumerables into one, whichever the order of appearance
new MyScheduler(Scheduler.ThreadPool, 42)
.SubscribeOn(new MyScheduler(Scheduler.ThreadPool, 43))
.Subscribe(_ => Console.WriteLine("Do(1): " + MyScheduler.SchedulerId));
Console.WriteLine("Subscribed !");
You then get this :
Subscribed !
Do(1): 43
Do(1): 42
The first OnNext is now executed under of a different scheduler, making subscribe a whole lot faster from the caller's point of view.
That might come in handy, but you may not want that as an opt-out because of this scenario :
Observable.FromEventPattern(textBox, "TextChanged")
.SubscribeOn(new MyScheduler(Scheduler.ThreadPool, 43))
.Subscribe(_ => { });
Console.WriteLine("Subscribed !");
You'd get an "Invalid cross-thread access." System.UnauthorizedAccessException, because yo would try to add an event handler to a UI element from a different thread.
Interestingly though, this code does not work on WP7 but does on WPF 4.
An other scenario may be one where delaying the subscription may loose messages, so you need to make sure you're completely subscribed before raising events.
So there you have it :) I hope this helps you understand a bit better those two operators.
Building Windows Phone 7 applications in an agile way encourages the use of Continuous Integration, and that can be done using Team System 2010.
There are a few pitfalls to avoid to get there, but this can be acheived quite easily with great results.
I won't cover the goodness of automated builds, this has already been covered a lot.
Along with the continous integration to create hopefully successful builds out of every check-in of source code, you'll also find the automated execution of unit tests. Team System has the ability to provide nice code coverage and unit tests success rates in Reporting Services reports, where statistics can be viewed, which gives good health indicators of the project.
Unfortunately for us, at this point there are no ways to automatically execute tests using the WP7 .NET runtime. But if you successfuly use an MVVM approach, your view models and non UI code can be compiled for multiple platforms, because they do not rely on the UI components that may be specific to the WP7 platform. That way, we are still able to test our code using the .NET 4.0 runtime with MSTest and Visual Studio 2010 test projects.
To avoid repeating code, multi-targeted files can be integrated into single target projects either by :
Multi-targeted files are using the #if directive and the WINDOWS_PHONE define, or the lack thereof, to compile code for the current runtime target.
There is also the option of creating projects with the Portable Library add-in, but there are some caveats on that side, and there are a few constraints when using this method. You may need to externalize code that is not supported, like UrlDecode.
Testing with MSTest ensures that your code runs successfully on .NET 4.0 runtime, but this does not test on the WP7 runtime. So to be sure that your code is successfully running on it, and since Windows Phone 7 is build on Silverlight 3, tools like the SL3 Unit Test framework can be used to manually run tests in the emulator. This cannot be integrated into the build for now, unfortunately; you'll have to place that in your QA tests.
To be able to buid WP7 applications on your build machine, you need to install the SDK on your build machine, and a Team Build agent and/or controller.
Creating a build definition is done the same way as for any other build definition, except for one detail. You need to set the MSBuild platform to x86 instead of Auto if your build machine is running on a 64 Bits Windows. This forces the MSBuild runtime to use the 32 bits runtime, and not 64 bits, where the SDK does not work properly.
If you don't, when building your WP7 application, you'll find that intriguing message :
Could not load file or assembly 'System.Windows, Version=22.214.171.124'
Which is particularly odd considering that you've already installed the SDK, and that dll is definitely available.
You may also find that if you install that DLL from the SDK in the GAC, you'll get that other nice message :
Common Language Runtime detected an invalid program.
Which is most commonly found when mixing 32 bits and 64 bits assemblies, for which the architecture has been explicitly specified instead of "Any CPU". So don't install that DLL in the GAC and set the MSBuild architecture to x86.
That's it for now, and Happy WP7 building !
TL;DR: While trying to fix the "Black Screen" issue of the Windows Phone 7 flickr app 1.3, I found out that HttpWebRequest is internally making a synchronous call to the UI Thread, making a network call negatively impact the UI. The entire building of an asynchronous web query is performed on the UI thread, and you can't do anything about it.
Edit: This post was formerly named "About the UI Thread performance and HttpWebRequest", but was in fact about Yahoo's Flickr application and was enhanced accordingly.
When programming on Windows Phone 7, you'll hear often that to improve the perceived performance, you'll need to get off of the UI Thread (i.e. the dispatcher) to perform non UI related operations. By good perceived performance, I mean having the UI respond immediately, not stall when some background processing is done.
To acheive this, you'll need to use the common asynchrony techniques like queueing in the ThreadPool, create a new thread, or use the Begin/End pattern.
All of this is very true, and one very good example of bad UI Thread use is the processing of the body of a web request, particularly when using the WebClient where the raised events are in the context of the dispatcher. From a beginner's perspective, not having to care about changing contexts when developing a simple app that updates the UI, provides a particularly good and simple experience.
But that has the annoying effect of degrading the perceived performance of the application, because many parts of the application tend to run on the UI thread.
You'll find that the HttpWebRequest is a better choice in that regard. It uses the Begin/End pattern and the execution of the AsyncCallback is performed in the context of ThreadPool. This performs the execution of the code in that callback in a way that does not impact the perceived performance of the application.
Using the Reactive Extensions, this can be written like this :
var request = WebRequest.Create("http://www.google.com");
var queryBuilder = Observable.FromAsyncPattern( (h, o) => request.BeginGetResponse(h, o), ar => request.EndGetResponse(ar));
queryBuilder() /* Perform the expensive work in the context of the AsyncCall back */ /* from the WebRequest. This will be the ThreadPool. */ .Select(response => DoSomeExpensiveWork(response))
/* Go back to the UI Thread to execute the OnNext method on the subscriber */ .ObserveOnDispatcher() .Subscribe(result => DisplayResult(result));
That way, you'll get most of your code to execute out of the UI thread, where that does not impact the perceived performance of the application.
Actually, it will always be (as of Windows Phone NoDo), but there's a catch. And that's a big deal, from a performance perspective.
Consider this code :
public App() { /* some application initialization code */
ManualResetEvent ev = new ManualResetEvent(false);
ThreadPool.QueueUserWorkItem( d => { var r = WebRequest.Create("http://www.google.com"); r.BeginGetResponse((r2) => { }, null);
ev.Set(); } );
ev.WaitOne(); }
This code is basically beginning a request on the thread pool, while blocking the UI thread in the App.xaml.cs file. This makes the construction (but not the actual call on the network) of the WebRequest synchronous, and makes the application wait for the request to begin before showing any page to the user.
While this code is definitely not a best practice, there was a code path in the Flickr 1.3 application that was doing something remotely similar, in a more convoluted way. And if you try it for yourself, you'll find that the application hangs in a deadlock during the startup of the application, meaning that our event is never set.
If you dig a bit, you'll find that the stack trace for a thread in the thread pool is the following :
mscorlib.dll!System.PInvoke.PAL.Threading_Event_Wait() mscorlib.dll!System.Threading.EventWaitHandle.WaitOne() System.Windows.dll!System.Windows.Threading.Dispatcher.FastInvoke(...) System.Windows.dll!System.Net.Browser.AsyncHelper.BeginOnUI(...) System.Windows.dll!System.Net.Browser.ClientHttpWebRequest.BeginGetResponse(...) WindowsPhoneApplication2.dll!WindowsPhoneApplication2.App..ctor.AnonymousMethod__0(...)
The BeginGetResponse method is trying to execute something on the UI thread. And in our example, since the UI thread is blocked by the manual reset event, the application hangs in a deadlock between a resource in the dispatcher and our manual reset event.
This is also the case for the EndGetResponse method.
But if you dig even deeper, you'll find in the version of the System.Windows.dll assembly in the WP7 emulator (the one in the SDK is a stub for all public types), that the BeginGetResponse method is doing all the work of actually building the web query on the UI thread !
That is particularly disturbing. I'm still wondering why that network-only code would need to be executed to UI Thread.
The impact is fairly simple : The more web requests you make, the less your UI will be responsive, both for processing the beginning and the end of a web request. Each call to the methods BeginGetResponse and EndGetResponse implicitly goes to the UI thread.
In the case of Remote Control applications like mine that are trying to have remote mouse control, all are affected by the same lagging behavior of the mouse. That's partially because the UI thread is particularly busy processing Manipulation events, this explains a lot about the performance issues of the web requests performed at the same time, even by using HttpWebRequest instead of WebClient. This also explains why until the user stops touching the screen, the web requests will be strongly slowed down.
In the Flickr application for which I've been able to work on, a lot of people were reporting a "black screen" issue, where the application stopped working after a few days.
The application was actually trying to update a resource from the application startup in an asynchronous fashion using the HttpWebRequest. Because of a race condition with an other lock in the application and UI Thread that was waiting in the app's initialization, this resulted in an infinite "Black Screen" that could only be bypassed by reinstalling the application.
Interestingly enough, at this point in the application's initialization, in the App's class constructor, the application is not killed after 10 seconds if it is not showing a page to the user. However, if the application stalls in the constructor of the first page, the application is automatically killed by the OS after something like 10 seconds.
Regarding the use of the UI Thread inside the HttpWebRequest code, applications that are network intensive to get a lot of small web resources like images, this is has a negative impact on the performance. The UI thread is constantly interrupted to process network resources query and responses.
During the analysis of the emulator version of the System.Windows.dll assembly, I noticed that the BeginGetResponse is checking whether the current context is the UI Thread, and does not push the execution on the dispacther.
This means that if you can group the calls to BeginGetResponse calls in the UI thread, you'll spend less time switching between contexts. That's not the panacea, but at the very least you can gain on this side.
On the good news side, Scott Gu annouced at the Mix 11 that the manipulation events will be moved out the the UI thread, making the UI "buttery smooth" to take his words. This will a lot of applications benefit from this change.
Anyway, let's wait for Mango, I'm guessing that will this will change is a very positive way, and allow us to have high performance apps on the Windows Phone platform.
The Reactive Extensions have been included in Windows Phone 7, which comes out of the box, and that you can include the Microsoft.Phone.Reactive.dll assembly.
This is a good thing, because it participates in the democratization of the Rx framework, and aside from the fact that the namespace is not exactly the same as the desktop version, Microsoft.Phone.Reactive instead of System.Concurrency and System.Linq, there were no major bugs until recently.
A few applications I've worked on that use the Rx framework, a very interesting unhandled exception was popping-up from time to time in my exception tracker. Unlike the double tap issue I found the same way on my Remote Control application, that one was a bit more tricky, see for yourself :
Exception : System.NullReferenceException: NullReferenceException at Microsoft.Phone.Reactive.CurrentThreadScheduler.Trampoline.Run()at Microsoft.Phone.Reactive.CurrentThreadScheduler.EnsureTrampoline(Action action)at Microsoft.Phone.Reactive.AnonymousObservable`1.Subscribe(IObserver`1 observer)at Microsoft.Phone.Reactive.ObservableExtensions.Subscribe[TSource](IObservable`1 source, Action`1 onNext, Action`1 onError, Action onCompleted) at Microsoft.Phone.Reactive.ObservableExtensions.Subscribe[TSource](IObservable`1 source, Action`1 onNext)
This exception popped-up out of nowhere, without anything from the caller that would make that "Trampoline" method fail. No actual parameter passed to the Subscribe method was null, I made sure of that by using a precondition for calling Subscribe.
Well, it turns out that it's actually a bug that is related to the use of the infamous not-supported-but-silent ThreadStaticAttribute, for which I've had to work around to make umbrella work properly on Windows Phone 7.
The lack of a Thread Local Storage creates a concurrency issue around a priority queue that is kept by the CurrentThreadScheduler to perform delayed operations. The system wide queue was accessed by multiple threads at the same time, creating random NullReferenceExceptions.
This means that any call to the Subscribe method may have failed if an other call to that same method was being made at the same time.
In short, do not use the bundled version of Rx in Windows Phone 7 (as of NoDo), but prefer using the latest release from the DevLabs, which does not have this nasty bug.
I've been developing a free application to do some PC remote control on Windows Phone 7, and it's been very instructive in many ways.
To improve the quality of the software, and be notified when an unhandled exception occurs somewhere in my code, or in someone else's code executed on my behalf, I've added a small opt-in unhandled exception reporting feature. This basically sends me back information about the device, most of what's available in DeviceExtendedProperties for device aggregation of exceptions, plus some informations like the culture and, of course, the exception stacktrace and details.
A few recurring exceptions have popped up a lot recently, and one coming often is the following :
Exception : System.InvalidOperationException: Navigation is not allowed when the task is not in the foreground. Error: -2147220989 at Microsoft.Phone.Shell.Interop.ShellPageManagerNativeMethods.CheckHResult(Int32 hr) at Microsoft.Phone.Shell.Interop.ShellPageManager.NavigateToExternalPage(String pageUri, Byte[] args) at Microsoft.Phone.Tasks.ChooserHelper.Navigate(Uri appUri, ParameterPropertyBag ppb) at Microsoft.Phone.Tasks.MarketplaceLauncher.Show(MarketplaceContent content, MarketplaceOperation operation, String context) at Microsoft.Phone.Tasks.MarketplaceDetailTask.Show()
This code is called when a user clicks on the purchase image located on some page of the software, and it looks like this :
The call is performed directly on the image's ManipulationCompleted event.
I've been trying to reproduce it for a few times and I finally got it: The user is tapping more than once on the image.
I can see a few reasons why:
There may be actually more, be this actually tells me a lot.
First, I should be having some kind of visual feedback on the click of that image, to tell the user that he has done something (and also to actually follow the design guidelines)
Second, that even if the feedback is there, that there may always be two subsequent clicks, and one that may be executed after the first has called the MarketplaceDetailTask.Show(), and the application has been deactivated. I cannot do much about it, except handle the exception silently or track the actual application state and not call the method.
I'll go with the exception handler for now as it is not a very critical peace of code, but I'd rather have some way of that tell me that the application cannot do that reliably and not have to handle an exception. The API is rather limited on that side, where the PhoneApplicationService is only raising events and does not expose the current "activation" state.
I'll talk more about some other findings this opt-in exception reporting feature has brought me, with some that seem to be pretty tricky.
Cet article est disponible en français.
When developing .NET applications, unhandled exception in threads have the undesirable effect of terminating the current process.
In the following example :
static void Main(string[] args) { var t = new Thread(ThreadMethod); t.Start(); Console.ReadLine(); } private static void ThreadMethod() { Thread.Sleep(1000); throw new Exception(); }
The basic exception will invariably terminate the process, and to prevent this, the exception needs to be handled properly :
private static void ThreadMethod() { try { Thread.Sleep(1000); throw new Exception(); } catch (Exception e) { // TODO: Log and report the exception } }
This makes classes like System.Threading.Thread, System.Threading.Timer or System.Threading.ThreadPool very dangerous to use if one wants to have an always running application. It is then required that no unhandled exception gets out of the custom handlers for these classes.
Even if it is possible to be notified when an exception has been raised and not handled properly, using the AppDomain.UnhandledException event, most the time this leads to the application being terminated. This termination behavior has been introduced in .NET 2.0, to prevent unhandled exception to be silently ignored.
While this is a very appropriate default behavior, in an enterprise environment, I'm usually enforcing custom static analysis or NDepend rules to prevent the use of these classes directly. This forces new code to use wrappers that provide a very wide exception handler and logs and reports the exception, but does not terminate the process. That also implies that there is still a very valid bug to be investigated, because exceptions should not be handled that late.
In Silverlight for Windows Phone 7, and in any other .NET 3.5 or .NET 4.0 application that uses the Reactive Extensions, it is very easy to switch between threads.
Reactive operators like Timer, BufferWithTime, ObserveOn or SubscribeOn allow for specific Schedulers like ThreadPool, TaskPool or NewThread to be used, and if a subscriber does not handle exceptions properly, it ends up with a terminated application.
The same exemple here also terminates the application :
The Observable.Timer operator uses the System.Threading.Timer class and that makes it vulnerable to the same termination problems. Every subscriber needs to handle exceptions thrown in the OnNext delegate, or the application will terminate.
Also, do not think that the OnError delegate passed to Observable.Subscribe will handle exceptions thrown during the execution of OnNext code. OnError only notifies of errors generated by previous Reactive operators, not the current.
Unfortunately, it is not possible for now to override the default schedulers used internally by the Reactive operators. The only way to handle all unhandled exceptions properly is to use the ObserveOn operator and intercept calls to IScheduler.Schedule methods. Calls can then be decorated with appropriate exception handlers to log and report the exception without terminating the process.
So, to be able to generalize this logging and reporting behavior, I created the AsSafe() extension that I place at the very top of a Reactive expression :
Observable.Timer(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10)) .ObserveOn(Scheduler.ThreadPool.AsSafe()) .Subscribe(_=> ThreadMethod());
And here is the code of this very simple extension method :
Cet article est disponible en francais.
To continue in the same kind of articles about Visual Studio features that have been available for a while now, but are commonly under-used, I'll talk in this post about the Remote Debugger.
Visual Studio has a debugger that allows the debugging of program when running it using F5, or "Debug / Start Debugging". Visual Studio will then start in a special mode that allows step by step execution of the program, use features like BreakPoints, TracePoint, Watches, IntelliTrace, create MiniDumps and many more.
The debugger runs the program on the local machine, and uses the permissions of the locally logged on user.
Nothing out of the ordinary. Well, maybe the Reverse Debugging with IntelliTrace in VS2010, which is very cool.
I don't know about you, but I keep my development PC as stable as possible. I rarely install new software, so that I keep the overall performance stable over time. I will most of the time install new software versions only after having tested them on other PCs to determine their behavior.
Call me maniac, that's what it is :)
But then, what to do when the need for testing an installation program comes up ? Or when you need to debug plugins for NI TestStand or Labview ? Or when the software needs a very specific kind of hardware that cannot be installed on your development PC ? (Rainbow Keys, anyone ?)
The answer is simple : The Remote Debugger ! When possible, I will test and debug my software on a virtual machine, or on a physical machine that has the appropriate environment to execute the software.That way, the development environment stays stable, and I don't need to make installation of software that could add some crapware and eat up the few bytes of RAM left :)
The idea is to continue using the development machine, where the source code is and to connect via the network on a machine that will execute the program. After that, the remote debugging session is very similar to a local session, with the exception of the "Edit and Continue" that is not supported. But most of the time, we can live without it.
It is possible to run the execution on the remote machine by using the "Use Remote Machine" option in the "Debug" tab of a C# project. It is important to note that checking this option implies that all paths specified in "Working Directory" or "External Program" are those of the remote machine.
Aditionnally, Visual Studio will not copy the binaries and PDB files on the remote machine. You have to make the copy of the files at the appropriate location, by using a "Post Build Action", a UNC path in the form of "\\mymachine\c$\temp".
It is also possible to attach to a running process, by using the "Debug / Attach To Process" option. You just need to fill in the "Qualifier" and set the name of the remote debugger, and to choose the process to debug.
Quick hint: The option "Show processes from all users" is not enabled by default. This means that is you want to debug a Windows Service, you will not see it in the list until you enable it.Finally, the "Attach To Process" window is also very useful with local processes. It is a very handy feature to create a memory dump of a process that takes too much memory, and analyze it.
The Remote Debugger is an additional Visual Studio component that is located on the installation media, in the "Remote Debugger" folder. Three versions exist : x86, x64 and ia64 (RIP, Itanium...). If you have to debug a 32 process on 64 bits machine, I advise that you install both the x86 and x64 versions. You will have to choose which remote debugger to run depending on the .NET runtime that is used. You can see which version to use in the "Type" column of the "Attach to Process" window.
Here's what to do :
Note that the firewall on both the development and the remote machine can prevent the remote debugger from working properly. You can temporarily disable it, but make sure to enable it back after. If you only want to enable specific ports, the port 135/TCP is used. The Remote Debugger uses DCOM as its communication protocol.
This is a very common situation that means that the pdb files do not match the loaded binaries. Make sure that you've copied the pdb files at the same time you did the dlls.
The "Debug / Windows / Modules" shows if the debug symbols have been loaded properly, and if it's not the case, the "View / Output / Debug" window will most of the time show why.
Happy debugging !
My name is Jerome Laban, I am a Software Architect, C# MVP and .NET enthustiast from Montréal, QC. You will find my blog on this site, where I'm adding my thoughts on current events, or the things I'm working on, such as the Remote Control for Windows Phone.
Powered by BlogEngine.NET 220.127.116.11
Theme by Mooglegiant


text:
Jobs Corps center to serve state set for groundbreaking todayBy TED SIEFER
New Hampshire Union Leader
August 20. 2013 12:10AM
MANCHESTER — Mayor Ted Gatsas will be joined today by U.S. Labor Secretary Thomas Perez, Gov. Maggie Hassan and members of the state's congressional delegation to break ground on the state Job Corps center, the long-awaited but controversial federal project.
New Hampshire is among the last states in country to build one of the facilities, which provide job training to dropouts and low-income young people. The $31 million complex will be built in northwest Manchester, at 943 Dunbarton Road, where the groundbreaking will take place today at 1 p.m.
Among those slated to speak at the event are Democratic Sen. Jeanne Shaheen and Republican Sen. Kelly Ayotte, who had been on opposite sides of a years-long dispute over whether the proposal would include a Project Labor Agreement, or PLA.
Such agreements, which set prevailing wages and mandate apprentice training, are priorities for labor unions, but are opposed by smaller nonunion contractors. A large majority of New Hampshire contractors are nonunion.
The Job Corps contract originally contained a PLA, but Ayotte and a coalition of independent contractors in New Hampshire and Vermont fought to have it removed, and the U.S. Department of Labor in October agreed to put the contract out to bid without the agreement.
In April, the contract was awarded to Bedford-based Eckman Construction, one of the region's most active builders.
The political leaders, however, appear to be ready to bury the hatchet at the groundbreaking Tuesday. The ceremony "represents a culmination of years of bipartisan work to build the Job Corps Center which will provide young people with job training resources and education," a congressional press release states.
1st District U.S Rep. Carol Shea-Porter is also expected to attend the event.
Mayor Gatsas said the project could bring both revenue to the city and help struggling young people. "It certainly is going to create an awful lot of opportunities to students who may not be headed to college, but to the workforce," Gatsas said.
He added that the city and school district, in conjunction with a partner, are planning to bid to operate the center, which would result in the city having more "local control." Gatsas called the proposal "a first."
The Job Corps program has come in for criticism in recent years, with a 2011 Department of Labor review finding that the program, which had a budget of the $1.7 billion that year, overstated its effectiveness.
One party not celebrating the groundbreaking is the New Hampshire AFL-CIO, which had fought to keep the PLA in the contract.
"If we got the agreement, we could have put people in New Hampshire to work on the project. We could have made sure there was training, safety standards, apprenticeships," said union President Mark MacKenzie. "This could've been a premiere project for doing those kinds of things. What we ended up with was more of the same (for New Hampshire)."

subset: commoncrawl


text:
I think it should be noted (in the first lines of text in the description) on the app store that this is an alpha version and that its only intended for premium members..
a lot of ppl are rating it 1 star because they need to have a premium account in order to acces it.. claiming that the app its misleading.
i think that if ppl know why this isnt letting you watch older episodes for free, they wouldn't rate it that bad...
i think that that little change could make a difference in the ratings.....
btw...is the app going to be offer to everyone (premium/non-premium), or it is always going to require you to be a premium member..
another thing...
why is mitsudomoe season 1 and 2 all mixed up in the app?....
Thanks for the Update...
Hm... the first thing the new version of the app did on my Xperia X10i, when I tried to watch episode 2 of Dragon Crisis, was freeze.
Tried again... and the video is basically unwatchable. Worked for a few seconds, and then got heavy artifacting followed by a complete video (but not audio) freeze.
LiRa89 wrote:
btw...is the app going to be offer to everyone (premium/non-premium), or it is always going to require you to be a premium member..
Shinji said:
"We are still testing and improving the App, so for now it'll be available first for Premium Members only. But don't worry, we are working hard on a free ad-supported streaming version soon, just like on our iPhone app!"
The dilemmas won't end, even if you keep running... The end justiφ's the means
Works great on my droid x, no problems at all
Yay for the update!
If you like piña colada!
Thanks for the info...
work great on my samsung captivate thanks for the update maybe a search bar would be awesome on the next update thanks again
New phone next week looking forward to use it :)
Also on the troll comments apple is apple and android is android is any of them really better? And do the apps make it better?
akacinna wrote:
Wow, you're one of the most ignorant Apple product users I've come across. Educate yourself. Android based smart phones hold the largest market share. That number is in the 40% range currently and is continually rising.
What is your source? Like I said, "Android now has over 26% of the (smartphone) market share." That is according to Gartner's 2010 3rd quarter report. Also, Symbian still holds the largest portion of the market, not Android and not iPhone.
<(**<) <(* *)> (>**)>
Crunchyroll, another thing that I would like to see in a future update is the option to rotate the video's. The reason I ask is my new phone has the volume buttons placed on the side hence they face down when viewing video's horizontally; I like to have them facing up for easy access. That would be a nice touch (no pun intended).
In addition to that, add some of the social networking to the app. I occasionally like to read other's comments on Anime. Forums would be fun to browse as well.
Ok, downloaded the update and it won't play ANY videos. Evo 4g.
If you like piña colada!
Great job on the update, seems I can watch videos now, not getting the error that I was getting when trying to watch.
It worked on my Droid Eris only after deleting and re-installing it. But after that it worked great.
Thank you Crunchyroll! I see updates updates for this app all the time, so thank you for supporting Android!
Your developer(s) might already be aware of this bug, but when you lock the phone with the video player still on the screen, it will start playing the audio of the show after a few seconds.
yay, nice update. the front page interface looks good
and you guys removed the animes that ain't available in your region, so that makes things a lot neater (and help avoid the disappointment i get when i click on a video hopelessly hoping that hey, maybe i can watch it after all!)
and omg the first two pages were a super funny read. HAHAHA.
Giving away all-access guest pass. Talk to me!
The fact that the play button goes gray-ish when you push it instead of a darker shade of orange or a lighter stone with glow on it is horrible.
Worst button design I've seen in a while to be honest.
Is there a direct link to the app?
(Also, the iPhone app store has over 300,000 apps on it. 10 billion downloads)
Can't stop crying.


text:
A fresh cake recipe for you to take advantage of the abundance of sweet, ripe and juicy peaches that are available right now. One of the highlights of summer. Peaches are a winning attraction in this fail proof, easy-to-throw-together-even-on-a-weeknight cake. Spiced up with a heady mix of lemon, cinnamon, ginger and nutmeg, it gives off an undeniably intoxicating scent as it bakes that will quickly fill up the whole house. Perfume for a food goddess.
The cake batter is poured into a springform or cake pan first and the peach slices are arranged over top. As it cooks the peaches start to sink and the batter rises up leaving the tops of the peaches to peek out and tease you. It's buttery and tender with a sturdy crumb. A cake that you will want to eat right away. A cake that will get you in its clutches and not let go until every last crumb is savored. It can be elegant tea party or picnic. Hot tea or sweet tea. With a scoop of vanilla ice cream or a little dab of whip cream. Or all on it's own. No matter how you serve it I hope you find it as unforgettable as I do.
Since I first made it last summer I've thought of it often. And I'm not the only one. Mom and I both clearly remember the swoon-like experience. But we were in dispute over when it was. My Mom insisted it couldn't of been that long ago. The funny thing about writing a blog is you can't argue against the date it was posted. It was almost a year ago to the day that I made it for the second time. Surely I've started a new tradition. A tradition that I love with a cake that loves me right back.
Lemon Ginger Peach Cake
(by Reeni)
1 cup all-purpose flour
2 teaspoons baking powder
Rounded 1/4 teaspoon salt
1 stick (8 tablespoons) unsalted butter, softened
3/4 cup plus 1 tablespoon sugar, divided
2 large eggs
Lemon zest from one lemon
1 teaspoon cinnamon
3/4 teaspoon dried ginger
1/2 teaspoon pure vanilla extract
A pinch of grated nutmeg
3 peaches, firm, ripe, pitted and cut into 1/2-inch-thick wedges
1. Preheat oven to 350°F. Lightly grease a 9-inch springform or cake pan.
2. Whisk together flour, baking powder, and salt. Set aside.
3. In a large mixing bowl beat butter and 3/4 cup sugar with an electric mixer until fluffy. Add eggs 1 at a time, beating after each addition. Beat in lemon, cinnamon, ginger, vanilla and nutmeg. At low speed beat in flour just until combined.
4. Spread batter evenly in pan and arrange peaches over top, they will sink as they bake. Sprinkle 1 tablespoon sugar evenly over top. Bake until cake is golden-brown and top is firm about 45 to 50 minutes. Remove to wire rack and cool 10 minutes, remove side of springform pan, if using a cake pan it's best to slice it right in the pan. Serve warm or at room temperature with whip cream and/or vanilla ice cream.


text:
Diet and Exercise
Feed Goldie a nutritionally balanced quality food, rather than a cheaper blend without essential nutrients. Ask your vet for recommendations. Along with her top-notch diet, give her plenty of exercise that helps her avoid obesity and related health conditions.
Dental Health
Your vet will provide Goldie with dental exams during her physical checkups. Between appointments, brush her teeth often using a canine-friendly toothpaste. If she balks at the pet toothbrush, try cleaning her teeth with a bit of gauze wrapped around your finger. By keeping her teeth clean, you'll minimize the risks of harmful dental disease.
Eye and Ear Care
By checking and cleaning Goldie's eyes weekly, you'll keep her tear ducts open and minimize the potential for irritation. You'll also be in a good position to notice abnormalities that call for your vet's attention. Ask the vet to recommend a gentle eye cleaner.
Your canine companion will benefit from weekly ear cleanings with a vet-recommended ear solution. This consistent attention will help to prevent irritation, and you can detect symptoms before they progress further.
Brushing and Bathing
By brushing Goldie often, you'll stimulate her skin and contribute to better coat health. While you're brushing away, run your hands over her coat and skin. This should allow you to notice anything unusual that deserves veterinary attention. After your active girl goes outside, wash her feet so she'll be less likely to ingest chemicals from grass, sidewalks, or streets.
Bathe your canine companion regularly, as it removes dirt and debris that can irritate her skin and cause troublesome mats. Ask your vet to recommend a gentle shampoo without detergents, fragrances, or colors that could cause allergic reactions. She'll also provide instructions on proper bathing techniques.
When Goldie next visits your veterinarian, she'll be a well-cared-for companion who enjoys her healthy lifestyle. To obtain preventive care advice for your pet, contact us for an appointment.


text:
Music intro for radio or television. Very easy living, sunny.
Like this track? We still have some fine hits!
Offer to audition:
High School - Sales Leader! Composition in the style of pop-punk.
Funny Man – Cheerful positive melody.
The Pursuit of Happiness – This is a corporate miracle!
Little Happiness – Lovely light melody ukulele.
Indie Dance – It's just a dance anthem!
Superhero Trailer – Do you like music from the blockbuster? This is one of them.


text:
Saturday is the reason they play the regular season all the way to the end.
Just when you think you know everything, you know nothing.
Kansas State was No. 1 in the Bowl Championship Series standings but now it's not.
Oregon was No. 2 but now it's not.
Notre Dame was No. 3 in the BCS but will now be . . . No. 1.
And the Southeastern Conference, stunned by top-ranked Alabama's loss last week to Texas A&M, is now back in BCS business.
The take-away question after Saturday's frenzied flurry of action is, "OK, now what?"
Well, here's what: Out of nowhere, and by nowhere we mean Waco, Texas, the Baylor Bears shocked Kansas State, 52-24.
Stanford went to Oregon and stymied the nation's No. 1 offense, pulling out a 17-14 overtime victory.
Sometimes this is how a national title dream dies. Oregon kicker Alejandro Maldonado's field-goal attempt in overtime clanked off the left upright. Stanford took possession but fumbled, the ball jumping away from two Oregon players into the arms of one from Stanford.


text:
Apple Inc.'s profit margins are falling back to levels not seen since sales took off after the 2007 debut of the iPhone, as competition and lack of breakthrough products pressure the company to lower prices.
Concern over falling margins helped prompt a 33% decline in Apple shares from a record high of $705.07 on Sept. 21, making it the worst-performing stock in the Standard & Poor's 500 Index in the same period. Last week, Apple said the board and management are discussing the return of more money to shareholders, after a proposal by Greenlight Capital Inc.'s David Einhorn to pay out more of its $137.1 billion in cash and securities, possibly with higher-yielding preferred stock.
The latest quarter's drop in gross margin to 39% from 45% a year earlier was caused by the introduction of the iPad mini, other products with higher costs and price cuts for existing products, Apple said. Unless Chief Executive Officer Tim Cook unveils a revolutionary new gadget with premium pricing, Apple shares will remain under pressure.
"It will be almost impossible for Apple to maintain the margins it's had in the last few years," David Yoffie, a professor at Harvard Business School, said in an interview. "They've been able to charge pretty much whatever they wanted for their products, but competition is increasing."
A central challenge is slowing sales of the iPhone, Apple's best-selling and most-profitable product that accounts for 56% of revenue. Samsung Electronics Co., HTC Corp. and other rivals are introducing cheaper and feature-laden smartphones and tablets based on Google Inc.'s Android software.
Steve Dowling, a spokesman at Apple, declined to comment.
Margin Pressures
Apple rose 1% to $479.93 at the close in New York.
One product with the potential to be profitable enough to slow the margin slide could be an Apple-branded watch that also makes phone calls, accesses the Web and provides location-tracking services, said Poonam Goyal, an analyst at Bloomberg Industries. A watch with these features might retail for much less than $200, keeping it within the price range that is the fastest-growing portion of the time-piece market and also the most profitable, she said.
Apple could sell millions of the watches, and generate a margin of about 50%, she said. That's about twice the margin Apple might earn by making a TV or selling an inexpensive phone for less-affluent shoppers, said Michael Morgan, an analyst at ABI Research.
The company is developing a wristwatch-like device using curved glass, the New York Times reported yesterday, citing unidentified people familiar with the situation. Natalie Kerris, an Apple spokeswoman, declined to comment on the plans.
Copyright 2014 Bloomberg. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.
Copyright 2014 Bloomberg. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.


text:
ALBUQUERQUE, N.M. (AP) -- An employee of a southeastern New Mexico slaughterhouse that is seeking federal approval to slaughter horses has posted a video online showing him fatally shooting a horse in the head, sparking outrage among animal activists and prompting death threats to the Roswell meat company.
A maintenance contractor with Valley Meat Co. is shown in the video bringing a horse out of its pen, swearing at animal activists, then killing the horse with a single gunshot.
The Albuquerque Journal reports the state Livestock Board executed a search warrant Thursday at the Dexter home of Tim Sappington, who worked in maintenance for the company.
Chaves County Sheriff Rob Coon, whose agency is supporting the Livestock Board, told the newspaper the shooting is being investigated as an animal cruelty case.
Rick De Los Santos, a part-owner of Valley Meat Co., said he has been inundated hate calls and death threats since the video hit the Internet.
"I didn't have anything to do with that video. That's the honest truth," De Los Santos said.
De Los Santos told KOB-TV that Sappington was a contract worker who made the video on his own time and at his own home.
"He shot a horse. That's what he eats. It's not against the law to slaughter your own horse," De Los Santos said. "Now, putting it on YouTube, I would not have done that."
Last year, De Los Santos sued the USDA to resume the inspections necessary to open what would be the nation's first horse slaughterhouse in more than five years. The USDA earlier this month said it has no choice legally but to move forward with the application of Valley Meat and several other companies since Congress lifted a ban on the practice. And the company's attorney, A. Blair Dunn, said earlier this week a final inspection of the plant by USDA officials is expected in early April.
Many animal humane groups and public officials are outraged at the idea of resuming domestic horse slaughter, including New Mexico Gov. Susana Martinez.
But others — including some horse rescuers, livestock associations and the American Quarter Horse Association — support the plans. They point to a 2011 report from the federal Government Accountability Office that shows horse abuse and abandonment have been increasing since Congress effectively banned horse slaughter by cutting funding for federal inspection programs in 2006.
Information from: KOB-TV, http://www.kob.com


text:
Information For
DePaul University Catalog > Degree Requirements > Graduate > College of Education > TEACH: Secondary Education Chemistry (MEd)
The TEACH Program combines a College of Science and Health (CSH) undergraduate Chemistry major or some other disciplinary major with a graduate level College of Education (COE) Master of Education (MEd) Program. Students graduate with a BS in their CSH disciplinary major and a MEd in Education with a Professional Educator License and chemistry endorsement in the State of Illinois.
The program features the integration of disciplinary content with educational foundations and pedagogical content knowledge. The Junior Year Experiential Course, Senior Capstone Course, and three double-counted undergraduate/graduate courses offer students a seamless transition from undergraduate to graduate studies and from major-field coursework to teacher-preparation coursework. For undergraduate disciplinary major requirements, please refer to the appropriate undergraduate program website.
The 5th-year master's level coursework builds on students' undergraduate experiences through a series of integrated courses that include consistent and long-term field experiences culminating in a student-teaching experience during the Spring of students' fifth year. Within the COE, the Junior Year Experiential Course, Capstone Course, and master's level coursework are part of the Department of Teacher Education. This coursework is designed to immerse students into the teaching profession by linking and integrating disciplinary content with an understanding of human development; diverse students; middle-school and secondary education, research on pedagogical content knowledge; the social and cultural contexts of education; and the development and assessment of content-area curricula. The program engages teacher candidates in critical reflection on their teacher development and practice. It fosters engagement in schools through placement of students in field experiences in schools and community agencies. Upon completion of the TEACH Program, teacher candidates measure themselves against the values of the COE conceptual framework through the development of professional portfolios. Values that are part of this framework include: commitment to social justice, critical pedagogy, and positive educational transformation within the context of a Vincentian personalism that honors the dignity of each person.
In addition to completing the requirements for licensure in Illinois, and in aligning with a commitment to preparing students with a global mindset, teacher candidates will also complete the requirements to gain a certificate in Teaching and Learning from the International Baccalaureate Organization. The IB Certificate in Teaching and Learning for the Middle Years Program (MYP) and the Diploma Program (DP) provides teacher candidates the background and expertise to teach in an IB school. The IB Certificate in Teaching and Learning expands the opportunities for teacher candidates and training in IB open expands the vision of inquiry and reflective practice.Students entering the program must be able and willing to participate in a minimum of 140 hours of field experiences in schools and community sites. These field experience hours are completed in conjunction with coursework and are integral to successful completion of the program. As students will be completing requirements to earn the IB Certificate, a majority of the 100-110 hours will be completed in International Baccalaureate Schools. In addition, students must complete a minimum of 10 weeks of full-time student teaching in a designated middle or high school.
Illinois Professional Educator License with endorsement in Secondary Education Science-Chemistry (grades 9-12 or grades 6-12), an Illinois State Board of Education (ISBE) approved program.
Access archived catalogs in the Catalog Archive section.Students are required to follow the Academic Handbook and Code of Student Responsibility.
2001-2012 DePaul University | Disclaimer | Contact Us | Emergency Plan | Consumer Information | Privacy Statement Editor Login


text:
This is an uplifting and joyful pop/soundtrack composition with acoustic guitar, piano and with strings, becoming epic towards the end. This track was especially composed for commercials and corporate videos, trailers, teasers, family scenes etc.
Enhance and promote your upcoming projects, commercials, games or videos with this high quality track composed by ScorePro (available in mp3 and wav).
And please do not forget to rate! Thank You!
ScorePro Productions is a collaboration of international musicians and producers who provide you with first class music for your project, trailers, commercials, corporate videos, new media, video games etc.
We're currently in the process of uploading our tracks to Audiojungle. So please follow us so you won't miss any new uploads
It would be great if you would like our Facebook page so we can stay in contact


text:
The TPA3112D1 is a 25-W efficient, Class-D audio power amplifier for driving a bridge
tied speaker. Advanced EMI Suppression Technology enables the use of inexpensive ferrite bead
filters at the outputs while meeting EMC requirements. SpeakerGuard speaker protection system
includes an adjustable power limiter and a DC detection circuit. The adjustable power limiter
allows the user to set a voltage rail lower than the
chip supply to limit the amount of current through the speaker. The DC detect circuit measures the
frequency and amplitude of the PWM signal and shuts off the output stage if the input capacitors
are damaged or shorts exist on the inputs.
The TPA3112D1 can drive a mono speaker as low as 4Ω. The high efficiency of the
TPA3112D1, > 90%, eliminates the need for an external heat sink when playing music.
The outputs are fully protected against shorts to GND, VCC, and
output-to-output. The short-circuit protection and thermal protection includes an auto-recovery


text:
"Natalie Zina Walschots exposes the fallacies to the 'fake geek girl' argument often made by gatekeepers of the hobby."
That timeline picture in the article is amazing, so true.
No offence I know there are girls on this site so this isn't aimed at you, remember that but there are a lot more fake, female gamers then guys. I've seen so many over the years especially when the Wii made gaming more mainstream and casual.
That "The Cake is a lie" phrase used in the picture is fantastic example because it was something which related to not only video games but also geeks in general aswell because video games had become a big part of the geek culture as a whole. With geek groups over the years becoming popular like a new trend more girls wanted in on it and decided to go along with the flow.
Take Meg from Family guy for example, if you had her in your school she would be the un popular one, if the next COD came out and people started talking about it Meg would get it aswell to talk about it in social groups, just so she can fit it and have something in common with most other people...the only difference in reality though is that instead of face to face she'll get "Shut Up Meg" online through her headset.
Felicia Day for me is using gaming to make her self known, she's an actress but because she's not very well known she uses the gaming industry and her "passion" for video games to stand out and keep her self in a job. Kind of using a gimmick to exploit herself for her own gain at the end of the day. I mean at least with Nathan Fillion you don't really see him do this despite being associated with the video game crowd
I think what girl gamers have to realise real or fake is that gaming has and will always be a guys thing. You can go on about equal rights and how they need to cater to your gender but to be very blunt, tough titties, if you really like the hobby you'll like it for what it is. Back when gaming came out it was targeted for guys mainly, hell look at the PS1 for example, grey, ugly, blocky not something you would try to gain the interest in females and thats where the "lol look at that loser and his video games" stereotype came from, not because people made it up but because it was true. Girls wanted nothing to do with geeks and their video games or computers it wasn't their thing which proves gaming when invented weren't targeting the female audience.
Now I'm not saying their wasn't any female gamers who bought the NES, PS1, Sega Megadrive, that would be silly to say but they wern't the target audience and I think thats what a lot of female gamers have got to understand today, especially when they are online, make a scene, get ripped a part by the large majority of males online then complain how they are treated.
You want to like this hobby, then get with the program or move on.
I can completely relate. Women have an extra hurdle to gain any sort of credit in this hobby because of the gatekeepers.
does anybody know who Pooksie is? She's a hardcore League of Legends player with a video on pornhub. XD
I gamed frequently with a girl back in the early 90's while I was in elementary school. Probably a big reason why I've never considered female gamers to be the unicorn that so many others see them as. Same thing happened in middle school and high school. Even today I know a girl who could probably beat any of you in any fighting game all day long.


text:
"Polaris" is a new type of mobile phones, which has a learning function, and shows a "life log" of users. It combines the functions of a mobile phone, robot, and television. The AI(Artificial Intelligence) of a robot can help us "rearrange" information, and it can provide us with optimized information which facilitate our life.
This is a concept model designed by Tatsuya Matusi.
Japanese Design Blog
- Nendo aims to "design time" with collection of unconventional hourglasses March 29, 2018
- SEBASTIAN CONRAN GIFU COLLECTION January 26, 2018
- Tokyo Signs – Products inspired by the streets of Tokyo November 26, 2017
- Kengo Kuma's V&A museum construction update October 26, 2017
- Japanese eyewear brand JINS collaborated with Jasper Morrison October 17, 2017
Visit us on Facebook
About JPdesign.orgJapanese design is becoming increasing present on the international design scene. Still, there are very few blogs covering Japanese design. Therefore, this blog is exclusively dedicated to Japanese design, i.e. product design, fashion, architecture, and art. Contact us: submit(a)jpdesign.org
About Japanese design shopJapanese design shop carries products that were reported on in JPdesign.org, all designed by Japanese designers. Japanese design shop is part of style-pd,Inc. Please read the following for the terms and conditions. Click here for more information.
Currency Converter


text:
Callahan Makes 34 Saves; Wedell Ties Game with First Career Goal
NEW HAVEN, Conn. – The plan for the Yale women's ice hockey team heading into Saturday's Senior Day game at Ingalls Rink was to have all six active seniors start, and that was exactly what the Bulldogs did. But there was no way to plan what wound up happening after that -- a storybook ending that featured the Class of 2013 prominently. Trailing 2-0 midway through, the Bulldogs rallied to tie the game on a pair of goals by senior forwards Alyssa Zupon and Natalie Wedell. Then, after sophomore forward Lynn Kennedy gave Yale the lead in the third period and junior defenseman Tara Tomimoto added an empty netter, those seniors all were back together on the ice for the final shift. Senior goalie Erin Callahan was at the center of the celebration of the 4-2 victory, as she made 34 saves in her second start of the season.
Along with Callahan, Wedell and Zupon, senior defenseman Jamie Gray, senior forward Jen Matichuk and senior forward Danielle Moncion all got the start Saturday. Senior defenseman Emily DesMeules was unable to play, but she did dress for the first time since her career-ending injury earlier this season.
The win was the latest of several signs of progress the program has made this year, with the seniors featuring prominently in helping the team move forward after a one-win season a year ago.
"Ever since last spring, the seniors have been unbelievable as leaders," said Yale head coach Joakim Flygh. "We talked with them about what we wanted this season to be like, and they took it to heart. They also made strides as players, and that was a big part of us being more competitive this year."
The Bulldogs let the Class of 2013 set the tone early on. But after an evenly played first 15 minutes, the Tigers grabbed the lead when forward Olivia Mucha carried the puck off the boards and fired one from between the circles that found the upper corner of the net over Callahan's shoulder.
The Bulldogs nearly evened it up a minute later when a turnover in the Princeton zone enabled junior forward Paige Decker to get off a shot from close range, but Princeton goalie Kimberly Newell gloved that one.
The Tigers had a penalty late in the first period, and another one early in the second. The Bulldogs were unable to take advantage of either power play, though; even worse, the second Princeton penalty resulted in a shorthanded goal when Tigers forward Brianna Leahy stole the puck at her own blue line and skated in on a breakaway to make it 2-0 at the 4:48 mark.
But Callahan would wind up shutting Princeton out for the final 35:12. She and Newell kept dueling as the second period wore on; shortly after Newell made a kick save to deny Zupon after a nice pass from freshman forward Janelle Ferrara, Callahan stopped a one-timer from close range by forward Cristin Shanahan. Newell then made a nice save on freshman forward Jamie Haddad, who worked a give-and-go with freshman forward Hanna Åström almost to perfection.
The senior class figured prominently in Yale's first goal. After Moncion drew a checking penalty on the Tigers, the Bulldogs took immediate advantage of the power play. Junior forward Aurora Kennedy fired one towards the net from high in the slot, and Zupon deflected it past Newell to bring Yale within 2-1 at the 11:40 mark.
"She's very good at looking for deflections like that, especially on the power play," said Flygh. "She picked that one out of mid-air. She's been close on a lot of those lately, and that was a big goal for us since we were down 2-0. Aurora Kennedy also did a great job getting the puck through."
Yale had to kill off a penalty of its own just 19 seconds after scoring, and the Bulldogs did so successfully. Callahan got a piece of a shot by forward Corey Stearns with her shoulder, and shortly after that the Bulldogs cleared the puck. Forechecking from Wedell helped keep the Tigers from setting up for any more good chances, and Zupon backhanded the puck out of the Yale zone as the penalty expired.
After killing off another penalty later in the second successfully, the Bulldogs went into the third trailing 2-1. They killed off two more penalties early in the third, and have now killed off 36 of their last 37 penalties successfully.
That set the stage for the dramatic comeback in the final 14 minutes. Wedell's first career goal came in memorable fashion. After sophomore forward Lynn Kennedy made a diving effort to get the puck out from behind the net, freshman defenseman Kate Martini put the puck on net from low in the left circle. The rebound went right to Wedell at the far post, and she jammed it in to tie the score 2-2 at 6:48.
"That was one of the more satisfying wins we've had in my three years here, and that goal was a big part of it," said Flygh. "Natalie has worked hard and played well the last couple games. You could just sense the energy that the team got from that goal -- not just because we had scored, but because it was Natalie who scored."
Yale then took the lead four minutes later with a perfectly executed breakout. Taking a feed from Aurora Kennedy in the neutral zone, Åström quickly got the puck to Lynn Kennedy. Kennedy skated in from the left side and sniped one from the circle that beat Newell high on her glove side. It was Kennedy's second goal of the season, after missing 17 games due to injury.
"We've worked on our transitions all year long," said Flygh. "That was a textbook play. Lynn has been playing really well since getting back from her injury. She brings us energy and work ethic."
With its playoff hopes hanging in the balance, Princeton pulled Newell with 2:30 to play. After Callahan made a save on shot by Mucha with two minutes left, the Tigers controlled the puck in the Yale zone with the extra skater for several moments. Callahan made a nice stop with her right leg to deny defenseman Ali Pankowski as the clock ticked to 1:45.
With a minute to play, junior forward Patricia McGauley was able to clear the puck briefly, but the Tigers brought it right back in and Callahan had to make a save on defenseman Gabie Figueroa.
Finally, after they were able to clear the puck, the Bulldogs got their chance at the empty Princeton net. After a shot by Lynn Kennedy was smothered by a diving Tiger player, Haddad tried another shot that was blocked. But the puck eventually came out to Tomimoto, and she fired one in from the blue line with 34.8 seconds left to put the game out of reach.
Fittingly, the seniors were all on the ice again for the final shift. Gray sent the puck out of the Yale zone for one last clear as the final seconds ticked away after the faceoff. Callahan raised her hands in triumph as her teammates mobbed her. It was her first career win.
"Erin played great," said Flygh. "She really took it to heart to work on things with our goalie coach this year, and that paid off today. She remained calm throughout the game, and you could tell that the team played really well in front of her."
Combined with Colgate's 2-1 win at RPI, the loss left Princeton (11-16-2, 6-14-2 ECAC Hockey) out of the ECAC Hockey playoffs for the first time since 2001. Yale (5-20-3, 4-14-3 ECAC Hockey) had been eliminated from playoff contention the previous night, but Flygh was confident that his squad would avoid any letdown in the final home game of the year.
"I wasn't worried, because everyone involved with this program realizes what a great job the seniors have done," Flygh said. "We knew the team would want to win this game for them. A couple shifts in, we knew we were here to play."
No. 3 Cornell clinched the ECAC Hockey regular season title with a 4-0 win at Union. Yale finishes the season at No. 5 Harvard Tuesday at 7:00 p.m.
Report by Sam Rubin '95 (firstname.lastname@example.com), Yale Sports Publicity
Be the first to know what's going on with the Bulldogs -- Follow @YaleAthletics on Twitter, become a fan of Yale Athletics on Facebook!
Watch the Yale All-Access Broadcast for Free on YouTube:


text:
Build Guide by
Not Updated For Current Season
This guide has not yet been updated for the current season. Please keep this in mind while reading. You can see the most recently updated guides on the browse guides page.
Thank You!
Your votes and comments encourage our guide authors to continue
creating helpful guides for the League of Legends community.
Morgana Build
Ability Sequence
Not Updated For Current Season
The masteries shown here are not yet updated for the current season, the guide author needs to set up the new masteries. As such, they will be different than the masteries you see in-game.
I've been perfecting this build since beta, iterating all the way to incorporate every major change to keep it fresh and from the games I've played, this has turned out to be the most optimal build for Morgana if you seek to smash face in the most efficient way. Skill required - Not included.
I have dominated many a game with this hero over my career, one that was filled with mostly Heimerdinger but after the nerf I've come back to my roots. Here are 10 things to keep in mind when mastering this champion:
1. Be sure to start with a Doran's Ring as your first item. Doran's Ring is the most well rounded and efficient item in the game and you will keep it right up until you are ready to start your last item. On your first return, be absolutely certain that you can get Sorcerer Shoes (Do not underestimate 20 Magic Pen) and at least a Blasting Wand to start the Archangel Staff. An Elixir of Brilliance to top it off would be most ideal but unless you were fed a couple of kills, it's not likely that you will be able to afford it.
2. Make sure without any excuse to purchase an Elixir of Brilliance on every return to the base. If anything, that is my secret weapon. So many people skip pots but the bonus it gives beats out a permanent yet lesser item hands down. One of these tacked on to a freshly finished item will make for a heavy lead in damage against the enemy.
3. Tormented Soil is trained up to 3 because at level 3 it is capable of completely killing off the back caster line of creep waves. This ensures you have 3 creeps for cash with every wave and you are free to stack your binding for max damage if you have good aim.
4. One rank of Black Shield until 14 is due to the fact that you will have a steep amount of Ability Power from being stacked with an Elixir. Shield takes 1:1 AP so it will be absorbing around 250-300 damage when you get the first rank at level 10. Providing you have everything set up in the manner I've established.
5. Use your Soul Shackles as a nuke. Do not make it a point to pop it for the slow effect it places. Make sure that when you cast it, it is meant to decimate their health first and slow them second. Don't run away on purpose but don't stay in and die for the second burst. Game sense and personal capability tie into this more than anything. If you know for a fact that you can stay in and hang with the apposing champion long enough for the second burst, do so. Do not turret dive for it and die.
6. Practice practice practice... Morgana has the potential to ruin someone's life when played to the players best ability. Being able to nail someone through a wall or at an angle to stop their escape with Dark Binding is the most clutch capability of Morgana. Once you have mastered Morgana Prime, little to no body at all with be able to escape you. Abuse the range and anticipate your enemies moves well and you will be a Hunter Killer.
7. Black Shield. This is simple, it stops everything. Parley, Ashe's Holocaust Arrow, everything. Snares and slows are void when matched against the power of Black Shield. Use it to stop a snare or a slow if you have to. Don't use it to absorb masses of damage every time, it's so good for every little thing that when you use it only to absorb masses of damage you run the risk of getting trashed through it. Again, this is where game sense and personal capability reign supreme. Mastering your timing with Black shield creates the black to the white of living and dying.
8. Remember that Tormented Soil hits instantly upon placing it. Optimal damage is dealt through dropping soil under the target first and then locking them down with Dark Binding second, though it is extremely tricky to get that Binding to them when placing Soil first. If you can manage it then you'll obliterate their health due to the duration of Tormented Soil compared to Dark Binding. Soil being 5 and Binding being 3.5. The time it takes your Binding to travel and hit the target will be enough time for the full duration of Soil to waste them away under the stranglehold of a full Binding and its initial blast. This mixed with Ignite and the burst of your Soul Shackle guarantees the annihilation of your current target. Binding first and Soil second is not out of the question, it is the common order but Soil > Binding is optimal.
9. Tricking enemy champions into thinking you are out of Mana and helpless anywhere after level 6 is a deceiving strategy for a Morgana with Clarity. Having your Clarity and Ignite ready as well as your ult is a dirty combo to champions who think you are open season. As soon as they get ballsy, make sure you have enough for a Binding at least and don't miss it. Pop Clarity, Soil, Ult, Ignite and watch them waste away. Follow them if you must to watch your second burst of Soul Shackle become the final nail in their swiftly closing coffin.
10. Do not underestimate the power of Morgana, with or against. She can be the most important cog in any vicious hate machine of a team or she can be your boatman on the river, Styx. Either way, give it a try and good luck if you've ever been interested in Morgana.
Do work.
The Mastery Tree for Morgana Prime has been slightly updated to replace Burning Embers in the Offense tree with Presence of the Master in the Utility tree. Personal preference.
I have also updated the item build for Morgana Prime: Lich Bane, while still a very rad item, was swapped out for Rylai's Crystal Scepter simply for its 500 hp and its decent slow. Whether you choose to stick with the Lich Bane method or the new Rylai method is completely up to you. Lich Bane still offers a great deal to the build with the mana to synergize with Archangel Staff, a respectable amount of Magic Resist as well as a little giddy up in movement speed. The spell order remains the same but let us rejoice! Dark Binding was buffed twice over and her ultimate is back to its old self again! Let it be noted that the above guidelines now tailor to the way Dark Binding currently works.
Morgana Prime indeed!


text:
400 Chambers Street
New York, NY 10282
Our monthly furnished rentals at 400 Chambers Street are stylishly designed and feature waterfront views on the harbor. This residence is an elegant homage to Tribeca's rich historic past. For extended stay in Manhattan enjoy amenities including a swimming pool, full service fitness center, and landscaped rooftop terrace and garden. The surrounding neighborhoods include Battery Park City and Tribeca with charming streets, boardwalks, parks and playgrounds.
230 West 55th Street
305 W. 50th Street
60 East 12th Street
105 Duane Street
...and more
New York City, NY
White Plains, NY
Stamford, CT
Boston, MA
Jersey City, NJ
San Francisco, CA
The Financial District
Greenwich Village
Midtown East
Midtown West
Upper East Side
Upper West Side
Keep you up to date with important changes and announcements at Furnished Quarters.


text:
Fits: LX, EX, EX-L, EX-L RES, TOURING NAVI, TOURING NAVI RES
The cargo liner protects your whole cargo area, covering the floor, sides and backs of the 2nd row seats. With installed, the 2nd row seats can still be independently positioned.
**NOTE: This item cannot be installed with the 2nd Row Seat Covers.