Apple Won't Unlock My iPhone After 2 Years. Finger Pointing.

August 18, 2011 at 5:33 PMAlec Bryte

Yesterday I called both Apple and AT&T to get my phone unlocked after fulfilling my 2 year contract with AT&T. However my request was denied by both parties:

Response from Apple was:

"We don't unlock iPhones. You need to contact your wireless provider."

Surprise surprise!!! The response from AT&T was:

"Apple doesn't provides us with the unlock codes. You have to call them."

Classic finger pointing. I smell a class action.

Oh well. http://www.idownloadblog.com/ here I come. Thank you for being here for us. :)

Posted in:

Tags:

Swtiching to Nook

August 18, 2011 at 5:03 PMAlec Bryte

I've just bought my first E-reader, Nook Touch by Barnes & Noble. I had been resistant to switch to reading books on electronic devices for various reasons.

As a software architect, I already spend too much time looking at a LCD screen. Therefore devices like iPad and Nook Color just won't cut it. I need my eyes to rest.

Nook Touch on the other hand is a black and white device with mechanical pixels, so it looks like a real sheet of paper.

Many early E-readers were sluggish with turning pages, i.e. you'd press Next Page and then wait up to a second for the screen to refresh. The new Nook's page scrolling is almost instant. Great.

I was deciding between Nook and Kindle and went with the former because it's more compact, has a touch screen with keyboard on it showing up at the right moments. Kindle has a real keyboard, which is not used during reading.

I also didn't care about the application support that Kindle had since I already had an iPhone and can play my games on it.

Overall I'm satisfied with the product.

One note though because it feels like a book, there is no background lighting inside the device. Just like reading a normal book. be sure to use Nook in a room with good lighting. If you're sitting at a desk, use a desk lamp.

Last note: I'm donating about 40 books to the local library tonight. A tax write-off and extra space in my overflown bookshelf. Yay!!!

Posted in: General

Tags:

Moving to Another City? Calculate Equivalent Cost of Living

August 10, 2011 at 4:52 PMAlec Bryte

Planning to move to another city?

CNN has a great tool to figure out your equivalent salary at the new place.

http://cgi.money.cnn.com/tools/costofliving/costofliving.html

Posted in: Travel

Tags:

Reactive Extensions Demo

August 4, 2011 at 10:35 AMAlec Bryte

Channel9 has an excellent video on using Reactive Extensions and Observable/Observer patterns when designing asynchronous code. Think of all the code you had to write to throttle UI updades in a WPF grid or make continuous calls to web service when user types into an auto-complete textbox.

All of those scenarios are now easily achieved with Reactive Extensions.

http://channel9.msdn.com/Blogs/codefest/DC2010T0100-Keynote-Rx-curing-your-asynchronous-programming-blues

Posted in:

Tags:

New Song - Rain Again

April 22, 2011 at 2:39 PMAlec Bryte

Jush finished a trance track using Ableton Live 8.2. Enjoy.

Eagle Cyrillik - Rain Again by alec-bryte

Posted in: Music

Tags:

AT&T Mobile Users - Keep Your Phone Off Abroad

June 20, 2010 at 11:06 AMAlec Bryte

Guys,

I've recently visited Aruba for 5 days. When I got my cell phone bill, it was $100 more than usual. The statement contained $1.99/minute charges for the roaming phone calls.

What surprised me was that many of the $1.99 charges I got were for the phone calls I DID NOT PICK UP. Everytime I got an incoming call from a BLOCKED phone number, I just ignored it and let it ring.

It turned out I still got charged for those "conversations."

When I called the AT&T support they said it was by design and that I would charge for those calls anyway because I was connected to the other network. Their suggestion was for me to keep my phone off at all times.

Next time I'm definitely renting a phone in a foreign country.

Posted in: Travel

Tags:

Including Unreferenced Assemblies Into ClickOnce Deployment

October 29, 2009 at 10:43 PMAlec Bryte

Many modern modular application products consist of the main application and several plug-ins. it has become popular to utilize the Unity Framework and Prism for WPF, which allows decoupling of the parts of the application from one another. The plug-ins are loaded at runtime using reflection. Usually the main application has the list of plug-in modules to load defined in its configuration file. Naturally the main application does not need to know of the existence of a particular plug-in or its internal structure until the execution time.

In such Visual Studio solution it makes sense not to add the plug-in projects or assemblies as references to the main application. However this presents the challenge when one needs to deploy the application with the plug-ins via ClickOnce. The ClickOnce architecture doesn’t allow one to include arbitrary files that are not part of the project.

It turns out there is no real harm in adding a project reference or a DLL reference to the main project. It’s true that during the compile time, the referenced assembly is passed to the compiler as the /r:MyReferencedAssembly.dll. However the compiler is smart enough to recognize that the main project makes no use of any of the classes inside the child assembly, and the reference is simply ignored.

For example, in the following screenshots, I used Red Gate’s .NET reflector to show that even though I added a reference to the project called MyPlugIn, the compiled assembly does not have any reference to it.

image

image

I hope this article saves time for another perfectionist developer like me :)

Posted in: .NET | WPF

Tags:

Code Generation Using Templates in Visual Studio 2008 and Higher

September 30, 2009 at 11:58 AMAlec Bryte

If you've ever worked with CodeSmith or any other code generation toolkits, now you can enjoy the same functionality out of the box with Visual Studio 2008 or higher. The code name for it is T4, which stands for Text Template Transformation Toolkit.

The functionality is there but has been poorly documented in 2008 and the UI support is somewhat underdeveloped. This however has been fixed in Visual Studio 2010.

For more information, see Oleg Sych's blog entries on the topic.
http://www.olegsych.com/tag/code-generation/

In addition, there are some videos for it in Kevin Dietz's blog.
http://www.kevindietz.com/2009/03/27/UsingVisualStudio2008T4CodeGenerator.aspx

Finally, Scott Hanselman's blog entry
http://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisualStudioSecret.aspx

Posted in: .NET

Tags:

Padding Images using GDI+

September 9, 2009 at 3:07 PMAlec Bryte

Recently I had to poke around in the good ol’ WinForms code and add some spacing to the images posted onto a form. I wrote a simple helper method for adding that extra space (padding) around the image. Here it is:

 

public static Image PadImage(Image source, int left, int top, int right, int bottom)
{
    Bitmap bmp = new Bitmap(source.Width + left + right, source.Height + top + bottom);
    Graphics g = Graphics.FromImage(bmp);
    g.DrawImage(source, left, top);
    g.Dispose();
    return bmp;
}

Posted in: .NET | WinForms

Tags:

WPF Proportional Panel

January 16, 2009 at 12:59 PMAlec Bryte

Standard Layout

Windows Presentation Framework provides a great flexibility when it comes to the layout. There are several Panel controls a developer may use to position elements, and they include:

  • Canvas - for absolute positioning of elements using (X,Y) coordinates. Useful for drawing custom graphics
  • Grid - most commonly used layout control. Allows dividing area into rows and cells and automatic alignment of controls placed inside the cells.
  • StackPanel - ideal for placing several controls next to each other, horizontally or vertically
  • DockPanel - aligns elements to a particular edge and allows an element to stretch and fill the remainder of the space

Custom Layout

All WPF panels are derived from Panel public class, which means one can create his own custom panel implementation.

In my case, I needed to create a special type of a panel that would resize the child elements based on a given percentage value. For example, assume two elements are in the panel positioned horizontally and the first one has a value of 20%, while the second one is 80%. The width of the first element would be 20% of the total available width, and the remainder would be the 80% of the width taken by the second element.

Here is an example with 4 elements:

ProportionalPanelDemo

Notice how the elements have their widths proportional to their percentage values.

To achieve this behavior we will create a class ProportionalPanel derived from the original Panel class. There we need to override 2 important methods that take care of the layout logic: ArrangeOverride() and MeasureOverride(). Basically, when a panel renders elements, it first asks each child for its current size. It then uses the values to properly position the elements.

        protected override Size MeasureOverride(Size constraint)
        {
            [...]

            double totalProportion = 0.0;
            foreach (UIElement child in this.Children)
            {
                 totalProportion+= GetProportion(child);
            }
            foreach (UIElement child in this.Children)
            {
                if (Orientation == Orientation.Horizontal)
                {
                    childWidth = constraint.Width * (GetProportion(child) / totalProportion);
                    childHeight = constraint.Height;
                }
    [...]

Note that GetProportion() is implemented as an attached property. This allows setting Proportion values on elements inside our panel. Since we want to allow just about any element (TextBox, Grid, ComboBox, Rectangle) to be placed inside the panel, even a custom element, such elements won't have a Proportion property by default. Attached Properties is a new and a very powerful feature in WPF that allows extending of existing classes with custom properties.

Using Proportion attached property, we can set the value as follows:

<ctl:ProportionalPanel Orientation="Horizontal" >
    <TextBlock Text="Apples" ctl:ProportionalPanel.Proportion=".20" />
    <TextBlock Text="Oranges" ctl:ProportionalPanel.Proportion=".15" />
    [....]
</ctl:ProportionalPanel>

Complete Solution

Click below to download a working Visual Studio 2008 solution of the WPF Proportional Panel.
ProportionalPanelDemo.zip (27.24 kb)

Posted in: .NET | WPF

Tags: