Introduction to Object-Oriented Programming Using C++

Posted in Java on August 31st, 2011 by Admin

This tutorial is a collection of lectures to be held in the on-line course Introduction

to Object-Oriented Programming Using C++. (more…)

Free Programming Books

Tags: , , ,

Xango Review – A reputable Report on the Xango Business

Posted in Uncategorized on August 30th, 2011 by Admin

I would like to start by suggesting that i’m NOT a Xango distributor and never are already. Second, I’m not likely to attempt to recruit you to another business as part of my Xango review. My only goal here is to provide you with an unbiased Xango review and let you make the decision yourself if Xango may be the right business for you personally.

Xango like any other MLM company ought to be examined by taking a look at three major elements of the company. The history, products, and above all to a lot of of you out there the comp plan. Here you’re going a neutral critical Xango review.

History:

Xango opened for business in 2002. Once they originally opened up for business they merely sold one product, Xango juice. The organization decided which they would distribute the product using a multi-level marketing distribution channel. I did lots of searches on Xango the organization and also have been able to find almost no that’s negative about it. Xango is really a growing company with more than 400,000 independent distributors worldwide. Spectacular.

Overall, I might rate Xango’s history like a plus plus a reason to join the organization.

Products:

Xango’s main strategy is Xango juice made from parts of the Mangosteen fruit which is suppose to offer you miraculous advantages of xanthones, the super-antioxidant found in the Mangosteen fruit. Although, I haven’t personally tried the Xango juice and should not dispute or read the health benefits, something Used to do notice is the price. To get a case of Xango juice it is 125$! Wholesale is apparently 100$. That strikes me as really high. However, if the benefits of drinking the juice daily are anything like they are saying they are then it could be well worth it.

Overall, I am unable to rate the product having not completed it myself. However, with the price being so high your monthly auto-ship to be involved will also be high. So, it really is something to bear in mind when evaluating Xango.

Compensation Plan:

Xango’s compensation plan pays out 50% of their volume to independent distributors. This can be a very healthy percentage and over the industry average. The residual income from Xango comes from a unilevel comp plan that goes 9 levels deep. Combined with the PowerStart weekly bonuses, the pay plan appears to be solid.

Overall, I’d believe that somebody who has the right system in position might make lots of money with Xango. The comp plan is surely a plus.

End

Xango is a solid company when you decide to join can very lucrative ideal individual. However, it is necessary with any “opportunity” like this you do not get into it blind. Meaning….you should be realistic about what it will take to earn money. And realistically, you need to recruit many people then sell plenty of products.

Achievements in a different Multi level markeing demands having a prosperous strategy.
Continue reading on the Xango Review.

ASP.NET MVC: Displaying Client and Server Side Validation Using qTip Tooltips

Posted in Programming Tips on August 29th, 2011 by Admin

The ASP.NET MVC framework makes it very easy to do both client and server side validation out of the box. Using DataAnnotations on your model properties the framework can display errors to the user client side using jQuery validation or for more complex situations, model errors can be returned using server side validation. Here is an example of a model and corresponding error messages that are displayed to the user on offending fields.

With the [Required] DataAnnotation on the NickName property we get the error message “The Nick name field is required” if the user leaves it blank. Also, the framework realizes that the Age property is an integer and thus if the user enters a value other than a numeric value, it will display and error message.

The functionality is great but the way in which the error messages are displayed is not very aesthetically pleasing. Also, when fields are validated on the client side, if you haven’t built in spaces for the validation text, your form will jump all over the place to make room for the messages. In an effort to make things a little more pleasing to the eye and to avoid unnecessary form re-sizing I’m going to show how you can display both client and server side validation in tooltips using the jQuery plugin qTip. Our goal is to transfer the form displayed above into the following:

You can download the complete solution for this example here.

I will be building off of the example from my last post that showed how to use jQuery UI to build Ajax forms.

The first thing you need to do is download the qTip library, add them to your project, and add references to the jquery.qtip.min.js script and jquery.qtip.css style sheet in your _Layout.cshtml or MasterPage.aspx.

The displaying of client side validation errors is handled in the jquery.validate.unobtrusive.js onError method. We need to alter that method to display the tooltip with the validation message instead of showing the default label. I cannot take credit for figuring out this code. I actually am using the technique presented here with a minor tweak. Open up the jquery.validate.unobtrusive.js script and replace the onError method with the following:

function onError(error, inputElement) {  // 'this' is the form element
    var container = $(this).find("[data-valmsg-for='" + inputElement[0].name + "']"),
    replace = $.parseJSON(container.attr("data-valmsg-replace")) !== false;

    // Remove the following line so the default validation messages are not displayed
    // container.removeClass("field-validation-valid").addClass("field-validation-error");

    error.data("unobtrusiveContainer", container);

    if (replace) {
        container.empty();
        error.removeClass("input-validation-error").appendTo(container);
    }
    else {
        error.hide();
    }

    /**** Added code to display the error message in a qTip tooltip ****/
    // Set positioning based on the elements position in the form
    var elem = $(inputElement),
        corners = ['left center', 'right center'],
        flipIt = elem.parents('span.right').length > 0;

    // Check we have a valid error message
    if (!error.is(':empty')) {
        // Apply the tooltip only if it isn't valid
        elem.filter(':not(.valid)').qtip({
            overwrite: false,
            content: error,
            position: {
                my: corners[flipIt ? 0 : 1],
                at: corners[flipIt ? 1 : 0],
                viewport: $(window)
            },
            show: {
                event: false,
                ready: true
            },
            hide: false,
            style: {
                classes: 'ui-tooltip-red' // Make it red... the classic error colour!
            }
        })

        // If we have a tooltip on this element already, just update its content
        .qtip('option', 'content.text', error);
    }

    // If the error is empty, remove the qTip
    else { elem.qtip('destroy'); }
}

Take a look at the qTip documentation for more information on what each of the options are doing here.

Your site is probably referencing the jquery.validate.unobtrusive.min.js file so make sure you replace that reference with the non-minified version you just updated.

Next, we need to update the DialogForm.js script file we created to do two things when the dialog window is closed; remove all the qTip tooltips and remove the form from the page after it is submitted. It turns out that when closing a jQuery UI dialog window, the constructed elements are not actually removed from the page but rather just hidden. After a successful ajax post and reload of the form, there will be issues rendering the server side validation messages if we don’t remove the submitted form. That is why the form has to be removed when the dialog is closed.

To make these changes, open the DialogForm.js file and add the close function to the dialog generation function.

$(function () {
    // Wire up the click event of any dialog links
    $('.dialogLink').live('click', function () {
        var element = $(this);

        // Retrieve values from the HTML5 data attributes of the link
        var dialogTitle = element.attr('data-dialog-title');
        var updateTargetId = '#' + element.attr('data-update-target-id');
        var updateUrl = element.attr('data-update-url');

        // Generate a unique id for the dialog div
        var dialogId = 'uniqueName-' + Math.floor(Math.random() * 1000)
        var dialogDiv = "<div id='" + dialogId + "'></div>";

        // Load the form into the dialog div
        $(dialogDiv).load(this.href, function () {
            $(this).dialog({
                modal: true,
                resizable: false,
                title: dialogTitle,
                buttons: {
                    "Save": function () {
                        // Manually submit the form
                        var form = $('form', this);
                        $(form).submit();
                    },
                    "Cancel": function () {
                        $(this).dialog('close');
                    }
                },
                // **** START NEW CODE ****
                close: function () {
                    // Remove all qTip tooltips
                    $('.qtip').remove();

                    // It turns out that closing a jQuery UI dialog
                    // does not actually remove the element from the
                    // page but just hides it. For the server side
                    // validation tooltips to show up you need to
                    // remove the original form the page
                    $('#' + dialogId).remove();
                }
                // **** END NEW CODE ****
            });

            // Enable client side validation
            $.validator.unobtrusive.parse(this);

            // Setup the ajax submit logic
            wireUpForm(this, updateTargetId, updateUrl);
        });
        return false;
    });
});

If we run the application at this point then the client side validation messages will be displayed in the qTip tooltips. Now, to display the server side validation messages in qTip tooltips as well.

To demonstrate how to do this I am going to create a custom validation attribute named AgeValidation and add it to our Profile model. This validation can actually be done client side but I want to show how to show the tooltips after a server side validation error, so humor me.

public class Profile
{
    [Required]
    public string Name { get; set; }

    [Required]
    [StringLength(10, MinimumLength=3)]
    [Display(Name="Nick name")]
    public string NickName { get; set; }

    [Required]
    public string Email { get; set; }

    [Required]
    [AgeValidation(ErrorMessage="You must be older than 12 to sign up")]
    public int Age { get; set; }
}

// I know this can be accomplished using the Range validation
// attribute but I have implmented it as a custom validation
// attribute to show how server side validation error messages
// can be displayed using qTip tooltips
public class AgeValidation : ValidationAttribute
{
    public override bool IsValid(object value)
    {
        if (value == null)
            return false;

        int intValue;
        if (!int.TryParse(value.ToString(), out intValue))
            return false;

        return (intValue > 12);
    }
}

Now if the user attempts to submit a Profile model with an age less than 12, a server side validation error message will be added. The trick to displaying the server side validation errors in qTip tooltips is to know how ASP.NET MVC renders the default label with the error message. It turns out that when a validation error message is displayed, ASP.NET MVC creates a span element with the class ‘field-validation-error’ and its contents contain the error message. So, in order to display that message in a tooltip, all we need to do is extract that error message from the span element and load it into a tootip. This can be accomplished by the following javascript function:

$(function () {
    // Run this function for all validation error messages
    $('.field-validation-error').each(function () {
        // Get the name of the element the error message is intended for
        // Note: ASP.NET MVC replaces the '[', ']', and '.' characters with an
        // underscore but the data-valmsg-for value will have the original characters
        var inputElem = '#' + $(this).attr('data-valmsg-for').replace('.', '_').replace('[', '_').replace(']', '_');

        var corners = ['left center', 'right center'];
        var flipIt = $(inputElem).parents('span.right').length > 0;

        // Hide the default validation error
        $(this).hide();

        // Show the validation error using qTip
        $(inputElem).filter(':not(.valid)').qtip({
            content: { text: $(this).text() }, // Set the content to be the error message
            position: {
                my: corners[flipIt ? 0 : 1],
                at: corners[flipIt ? 1 : 0],
                viewport: $(window)
            },
            show: { ready: true },
            hide: false,
            style: { classes: 'ui-tooltip-red' }
        });
    });
});

And lastly, we need to add a reference to the above script on the page that will display the form fields for the Profile model.

@model DialogFormExample.Models.Profile

@using (Html.BeginForm()) {
        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)<br />
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.NickName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.NickName) <br />
            @Html.ValidationMessageFor(model => model.NickName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Email) <br />
            @Html.ValidationMessageFor(model => model.Email)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Age)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Age) <br />
            @Html.ValidationMessageFor(model => model.Age)
        </div>
}

<script src="@Url.Content("~/Scripts/jquery.qtip.validation.js")" type="text/javascript" />

And that’s it. Now you have a form that will display both server and client side validation in qTip tooltips!


Nick Olsen’s Programming Tips

Tags: , , , , , , , ,

Disable the iPhone’s Front Camera

Posted in IPhone App Programming on August 28th, 2011 by Admin

The iPhone 4′s front camera is limited to 640×480 resolution. Although handy for video conferencing, for some apps that’s to small to yield a usable photo. Unfortunately the UIImagePickerController class does not have an option to restrict the user from using the front camera. Although you can check the size of the photo after the user is finished, it’s not great user experience to reject it after they go through the entire process of taking a photo.

One option is to replace the standard camera controls with a custom interface, but that’s a whole lot of work if you just want to prevent the user from taking a photo with the front camera. Fortunately there’s another option: put a transparent button over the “switch camera” button, which will intercept touch events and show an alert dialog. It sounds simple, but as you’ll see there are a few tricks to actually getting this to work.

We’re going to use UIImagePickerController’s cameraOverlayView property to add our button to the view hierarchy. We can’t simply provide a UIButton object though. In the latest iOS SDK, cameraOverlayView is automatically resized to fill the entire screen, while we only want to cover a small corner of it. Instead, we’re going to put the button inside a UIView subclass that will be used for layout and a few other tasks. Go ahead and create this UIView subclass in your project, call it ELCCameraOverlayView, and delete any methods the Xcode template includes by default.

We’ll need a button, so let’s start by giving our new subclass a UIButton instance variable named _button with a corresponding button property. Declare this as you’d declare any synthesized property, but let’s override the default setter method to also add it to the view hierarchy.

- (void)setButton:(UIButton *)button;
{
    if ( _button != button )
    {
        [_button removeFromSuperview];
        [_button release];
        _button = [button retain];
	if ( button != nil )
        	[self addSubview:button];
    }
}

You might create the button in another class (such as a view controller) and assign it to our custom class, but you can also create a standard button in your initWithFrame: method. Note that we still have to call addSubview: here as we’re not using the property accessor method (which is discouraged in init methods).

- (id)initWithFrame:(CGRect)frame;
{
    if ( ( self = [super initWithFrame:frame] ) )
    {
        _button = [[UIButton alloc] initWithFrame:CGRectMake( 240.0f, 0.0f, 80.0f, 80.0f )];
        [self addSubview:_button];
    }
 
    return self;
}

With the button in place, let’s move on to intercepting touch events which would normally go to the “switch cameras” button. We can do this by overriding the UIView methods which are called to determine if an event occurred within a view’s frame or not. Just check to see if the event took place within the button’s frame rectangle.

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event;
{
    if ( [super hitTest:point withEvent:event] == self.button )
        return self.button;
 
    return nil;
}
 
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event;
{
    if ( CGRectContainsPoint( self.button.frame, point ) )
        return YES;
 
    return NO;
}

It may seem like we’re almost done at this point. If you set the camera overlay view to an instance of this class you’ll see the “switch camera” button should no longer work, and if you give the button an action method you can pop up an alert message telling users not to use the front camera. However, if you rotate the phone to landscape mode, you’ll notice that while the “switch camera” button is re-positioned, our custom button is not! To see what I mean, try setting a custom background color on our button so you can see it on screen.

This is a tricky problem. Unlike UIViewController, our UIView subclass does not have any way of telling when the interface orientation is changed. This doesn’t even matter though, since UIImagePickerController doesn’t actually change its interface orientation, it simply re-arranges the camera buttons while remaining in UIInterfaceOrientationPortrait!

The way I’ve solved this problem is to use the accelerometer to determine the device orientation. It might sound complicated, but it’s actually not a lot of work. Start by adding a new instance variable _interfaceOrientation and property interfaceOrientation to your class, of type UIInterfaceOrientation. We’ll also override its setter method to call setNeedsLayout whenever its changed.

- (void)setInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
{
    if ( _interfaceOrientation != interfaceOrientation )
    {
        _interfaceOrientation = interfaceOrientation;
        [self setNeedsLayout];
    }
}

Now let’s move the button whenever the orientation changes, and implement the required UIAccelerometerDelegate method.

- (void)layoutSubviews;
{
    CGFloat width = CGRectGetWidth( self.button.frame );
    CGFloat height = CGRectGetHeight( self.button.frame );
 
    switch ( self.interfaceOrientation )
    {
        case UIInterfaceOrientationPortrait:
        case UIInterfaceOrientationPortraitUpsideDown:
            self.button.frame = CGRectMake( CGRectGetMaxX( self.bounds ) - width, 0.0f, width, height );
            break;
        case UIInterfaceOrientationLandscapeRight:
            self.button.frame = CGRectMake( CGRectGetMaxX( self.bounds ) - width, CGRectGetMaxY( self.bounds ) - height - 50.0f, width, height );
            break;
        case UIInterfaceOrientationLandscapeLeft:
            self.button.frame = CGRectMake( 0.0f, 0.0f, width, height );
            break;
    }
}
 
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration;
{
	CGFloat x = -[acceleration x];
	CGFloat y = [acceleration y];
	CGFloat angle = atan2(y, x);
 
	if ( angle >= -2.25f && angle <= -0.25f )
	{
        self.interfaceOrientation = UIInterfaceOrientationPortrait;
	}
	else if ( angle >= -1.75f && angle <= 0.75f )
	{
        self.interfaceOrientation = UIInterfaceOrientationLandscapeRight;
	}
	else if( angle >= 0.75f && angle <= 2.25f )
	{
        self.interfaceOrientation = UIInterfaceOrientationPortraitUpsideDown;
	}
	else if ( angle <= -2.25f || angle >= 2.25f )
	{
        self.interfaceOrientation = UIInterfaceOrientationLandscapeLeft;
	}
}

We’re almost done! Just make sure to start and stop the accelerometer in your init and dealloc methods.

- (id)initWithFrame:(CGRect)frame;
{
    if ( ( self = [super initWithFrame:frame] ) )
    {
        _interfaceOrientation = UIInterfaceOrientationPortrait;
        _button = [[UIButton alloc] initWithFrame:CGRectMake( 240.0f, 0.0f, 80.0f, 80.0f )];
 
        [[UIAccelerometer sharedAccelerometer] setDelegate:self];
        [self addSubview:_button];
    }
 
    return self;
}
 
- (void)dealloc;
{
    [[UIAccelerometer sharedAccelerometer] setDelegate:nil];
    [_button release];
    [super dealloc];
}

Finished! If you haven’t tested your overlay yet, you can add it to your UIImagePickerController as so.

UIImagePickerController *controller = [[UIImagePickerController alloc] init];
ELCCameraOverlayView *view = [[ELCCameraOverlayView alloc] initWithFrame:controller.view.frame];
 
[view.button addTarget:self action:@selector(selectFrontCamera:) forControlEvents:UIControlEventTouchUpInside];
 
controller.sourceType = UIImagePickerControllerSourceTypeCamera;
controller.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
controller.cameraDevice = UIImagePickerControllerCameraDeviceRear;
controller.delegate = self;
controller.cameraOverlayView = view;
 
[self.navigationController presentModalViewController:controller animated:YES];
[controller release];
[view release];

Don’t forget to provide the button’s action method. You could show an alert, for instance.

- (void)selectFrontCamera:(id)sender;
{
    NSString *title = NSLocalizedString( @"Front Camera Disabled", @"" );
    NSString *message = NSLocalizedString( @"The front camera does not have sufficient resolution.", @"" );
    NSString *button = NSLocalizedString( @"Okay", @"" );
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle:button otherButtonTitles:nil];
 
    [alert show];
    [alert release];
}

I’ve uploaded the complete ELCCameraOverlayView class files here. Leave a comment if you have any questions!


iPhone Programming Tutorials

Tags: , , ,

Get a Wonderful TrustedID Services and Enjoy the Most Unfailing Credit Protection

Posted in Uncategorized on August 27th, 2011 by Admin

Identity safety is no recreation, and TrustedID is right here to assist you maintain your identity secure. According to study and a ton of TrustedID reviews, they provide a vast range of packages to help hold you from turning into a victim of identification theft.

Soon after some investigation, I identified their services to be considerably valuable in ID safety. Not only that, but I’ve identified out that they also have educated and beneficial buyer support. What’s far more, they are backed by a 1 million dollar guarantee. Not a lot of corporations can stay in business extended by paying out individuals kinds of problems.

TrustedID does offer maximum protection for your personalized data. They have an successful program in area for placing fraud alerts on your behalf really should you require them. Then you have these alerts in area, your permission ought to be double-checked and your identity verified, of class, prior to you can take on an additional line of credit score. It a tiny trouble but it really is a lot much better than the headache you’d go through hoping to place collectively a shattered identity.

TrustedID above delivers by delivering fraud monitoring services, on the internet black industry scanning, and scanning of other recognized hazards in which your determine could be stolen. They even offer a CreditLock service. This is generally an account freeze so your personal info can not be accessed. This lets you to immediate the 3 major credit reporting agencies to release your credit reports to third events on your permission only.

This attribute is offered in all states by means of TrustedID at an extra cost.

What if your identification does get stolen?

This is a genuine concern. However, it happens a lot these days. Even so, in this function, TrustedID will be there for you to offer guidance in recovering your identification. They will also be there to help you in supplying information to federal govt businesses like the Federal Trade Commission (FTC) and other regulatory businesses necessary to aid recover your damaged identity.

Backed by their one million dollar assure, they agree to reimburse you of any costs you incur. This involves lost wages, legal costs, or any other expenses that happen as a result of their support not functioning efficiently.

What about their consumer help? Will they be there if you need to have them?

This is 1 way you find out if your identity theft protection service is value the value you spend.

TrustedID has been reviewed as the major identification theft defense services to use due to the fact they have superb buyer aid and help. They have live phone assistance accessible to take your calls twelve hrs each and every day. If you desire, you can also entry their help by means of electronic mail, of class. The most important point about TrustedID help is that they are there and they’re really helpful.

In summary, is TrustedID a solid expense in private identification safety?

Even though they do have a beneficial product and trustworthy firm, they are not the only organization to offer this a lot required services. When you might be searching for an identification protection firm that’s likely to be in your existence for a while, you owe it to oneself to do the study needed to discover the very best feasible worth at the most aggressive cost.

Reliable ID offers a quantity of merchandise and solutions to help their buyers protect by themselves towards identity theft. They specialize in monitoring a person’s credit, even though at the very same time taking further methods to safeguard their identity.

The initial services they supply is ID Necessities, which consists of standard credit monitoring, accessibility to your credit report, and even a score that gives you an notion of a possible identification danger. The ID necessities also delivers extra solutions these kinds of as monitoring a customer’s medical positive aspects or informing you of internet scams and hazardous web sites to stay away from. The strategy is backed by a million dollar warranty prepare, and consumer service is available by phone if you actually want any support or have any questions. The ID Necessities Household and Specific programs are offered via a 2 week trial membership, with rates ranging from $125.00 to $240.00 a yr charged following the 1st 2 weeks.

Another services presented by TrustedID.com is called Credit score Lock. This services adds added defense to your ID Necessities plan. This service simply blocks your credit report from getting launched to anyone without having your permission first. They use all three reporting businesses-Experian, Equifax, and TransUnion. You can management your credit score lock by talking with a buyer support representative from TrustedID.com, releasing credit studies to 3rd events upon request. Adding this services to your TrustedID.com account charges the same as the ID Necessities services, and arrives in discounted household or individual programs with two week trial memberships offered.

TrustedID.com also provides “information breach services” to defend personnel at various firms or organizations from identification theft. Just lately, there has been a large enhance in the range of identification theft victims that have missing millions of bucks when there is a data breach within the business. Utilizing a support referred to as ID Protected, TrustedID.com insures that theft throughout a breach will be minimum, tremendously decreasing the devastating fees that arise in the course of a breach. You can request a quote for this service by going to the website online.

One quite awesome service that is presented by TrustedID.com is id theft defense as an employee advantage at a firm. Since the consequences of your employees falling victim to id theft can suggest hundreds of several hours of perform to remedy the issue, it his extremely encouraged that businesses provide these advantages to workers. In addition to supporting prevent disastrous id theft at the business office, providing this benefit to personnel will help enhance their overall satisfaction with the company they function for. You can go to their website to ask for a personalized quote for this support.

One of the biggest capabilities of the providers offered at Trusted ID.com is their household prepare delivers. Family members will receive huge special discounts when they are all signed up together on 1 strategy, and TrustedID.com delivers the 1st complete program to protect people with id theft safety. TrustedID.com is constantly studying the most recent techniques of id theft, generating new techniques to stay in advance of the criminals who look for to steal private identities. Discover more information about TrustedID by looking at wonderful critiques simply by proceeding to Here.

Steve Jobs retiring, T-Mobile getting the iPhone 5, and more in this week’s mobile news

Posted in IPhone App Programming on August 27th, 2011 by Admin

The <a href=”http://www.macrumors.com/2011/08/25/tampa-bay-bucs-using-ipads-for-game-film-and-playbooks/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+MacRumors-iPhone+%28MacRumors+iPhone+Blog%3A+iOS+News+and+Rumors%29″ target=”_blank”>Tampa Bay Bucs are using iPad 2s</a> for their playbooks and game film.

Rumor has it that <a href=”http://www.mactrast.com/2011/08/iphone-5-to-launch-concurrently-on-sprint-verizon-att-t-mobile/” target=”_blank”>T-Mobile is also getting the iPhone 5</a>.

AirPlay mirroring is supposedly <a href=”http://www.appleinsider.com/articles/11/08/25/inside_ios_5_airplay_mirroring_will_be_its_most_exciting_feature/” target=”_blank”>iOS 5s “most exciting feature”</a>. Hopefully they can do better than that.

<a href=”http://arstechnica.com/apple/news/2011/08/tim-cook-e-mail-to-apple-employees-apple-is-not-going-to-change.ars” target=”_blank”>”Nothing is going to change”</a> with Steve Jobs stepping down and Tim Cook taking over.


Mobile Orchard

Tags: , , , , , , , , , ,

First Look at the New C++ IDE Productivity Features in the Next Version of Visual Studio

Posted in C++ on August 26th, 2011 by Admin

Sumit Kumar

Hi! I am Sumit Kumar, a Program Manager on the Visual C++ team.

Today I will talk to you about some of the exciting new IDE functionality in the next version of Visual Studio that will make you, the C++ developer, more productive with your daily code focused tasks. In this blog post you will get a preview of the new features that help with code understanding and editing. There will be more blog posts talking about other cool new features.

 

 

Code Understanding enhancements

Semantic Colorization

Semantic Colorization helps you quickly scan the code and infer more semantic meaning through enhanced visual feedback in the editor. In addition to the keywords, strings and comments, now other tokens like types, enumerations and macros are colorized; the parameters are in italics and so on. The screenshot below shows an example. Notice how the macros, types, function parameters etc. pop out and make understanding code so much easier.

Semantic colorization

While there are only a few tokens that are colorized differently by default, around twenty different semantic tokens are exposed to the users as shown in the screenshot below.

Fonts and colors

You can customize your IDE to colorize these tokens differently. For example, you could choose to colorize local and global variables differently which could be a handy source understanding aid when the variables are identically named but defined in different scopes.

 

Reference Highlighting

Another great productivity feature that aids you in understanding code is Reference Highlighting. When you place your text cursor on a symbol, all the instances of that symbol in the file get highlighted. Only the true references are highlighted – for example, two symbols with same names in different scopes (say local vs. global) will not be highlighted at the same time. You can use Ctrl+Shift+Up and Ctrl+Shift+Down keys to move between the highlighted references. This means that you no longer have to invoke Find All References if you are simply looking for symbols within a file. The screenshot below shows how all the instances of the variable cxExtentMax inside the function body are highlighted when the cursor is placed on the one referenced in the call to max(). But the variable with same name defined outside the function scope is not highlighted.

Reference highlighting

 

New Solution Explorer

There are a number of tool windows needed for common everyday tasks – for example, Navigate To is used for searching symbols and files, Class View and Object Browser are used for inspecting the members of an object, Find All References is used for, well, finding references, Call Hierarchy is used for finding the calls to and from a function etc. Imagine being able to do all of these operations from a single tool window without having to switch context or sacrifice additional precious screen real-estate. The new Solution Explorer combines most of the functionality of these tool windows into one place, itself! Of course, the other tool windows will still be available in Visual Studio, but the goal of the new Solution Explorer is to significantly reduce the need to invoke them for the most common scenarios. A detailed description of all of the new functionality provided by the versatile new Solution Explorer is a separate blog topic in itself, but here is a sampling:

You can expand your files to see the fields, functions and types contained in the files and the members contained in the types.

New Solution Explorer

It allows you to search your entire solution all the way to the members of individual classes.

New Solution Explorer

You can navigate back and forward between different views of the Solution Explorer and can create multiple instances of Solution Explorer rooted at different nodes if needed. You can also scope the view to just a specific project or file or type.

New Solution Explorer

The view in editor automatically syncs with the view in Solution Explorer. Clicking on a symbol node in the Solution Explorer takes you to the definition of that symbol in the editor. You can also see the relationship between functions such as Calls to, Calls from, References, and Inheritance for functions and types from within the Solution Explorer.

New Solution Explorer

New Solution Explorer

 

 

Code Editing enhancements

The second category of C++ features helps you with editing code faster.

Automatic Display of IntelliSense Member List

In Visual Studio 2010 and previous releases, the IntelliSense member list dropdown had to be explicitly invoked either by typing Ctrl+Space or Ctrl+J or entering a scope resolution operator (::) or element selection operator (. or ->). In the next version, Visual Studio will automatically shows the member list drop down as you type without the need to explicitly invoke it.

Automatic Display of IntelliSense Member List

The automatic display of member list is smart – it does not aggressively display the member list when it does not make sense, for example when typing a declaration, there is no aggressive display of member list.

Automatic Display of IntelliSense Member List

 

Member List Filtering

Not only is the member list displayed automatically, it is also filtered as you type to shrink and show only the relevant members. So you can get a filtered result like the screenshot below just by typing two characters

Member List Filtering     Member List Filtering

Notice that pb is not a prefix or even a substring of the members in the list. The filtering uses a fuzzy logic to find the relevant members quickly. But if you do not like the fuzzy filtering, you can change it to prefix based, or prefix plus camel casing based or turn off the filtering completely.

 

Code Snippets

Code Snippets help you quickly type the boilerplate code with just a couple of keystrokes. Here’s how it works for a switch statement: as you start typing, the IntelliSense member list shows you the relevant code snippet that can be selected by pressing tab.

Code Snippets

Code Snippets

Then modify the expression in the switch statement or just press Enter and the entire skeleton of the switch statement is added for you; you only need to fill in the logic!

Code Snippets

In addition to the switch statement, there are other snippets for basic code constructs available to you – like if-else, for loop, etc. Each of the snippets saves you from unnecessary typing and lets you focus more on your logic, adding up to significant productivity gains over time!

Additionally, the code snippets feature is extensible so you can also create your own snippets, which is as simple as creating a simple XML file and copying it at a certain location. You can also invoke the code snippets from the context menu in the editor and can either insert a snippet or can surround a selection of code with a code snippet (for example with a #ifdef statement).

 

 

Summary

Many of these code understanding and editing features were requested by you, and are squarely intended to make you more productive with C++ development. Your continued feedback will help us make these features better before they ship. Please note that the descriptions and screenshots are from our early internal builds. These features are still under development and could potentially change or not even be included in our final product. In addition to these new features, we have done a lot of work on the IDE but I will save those for future blog posts.


Visual C++ Team Blog

Tags: , , , , , , ,

ASP.NET MVC: Displaying Client and Server Side Validation Using Error Icons

Posted in Programming Tips on August 25th, 2011 by Admin

In a previous post I showed how you could display both client and server side validation using qTip tooltips. In this post I will show how you can display an error icon next to the field that is invalid and then when the user hovers over the icon, display the error message (demonstrated below).

As done previously I will be using the same example project from this post where we created a dialog form which was submitted via Ajax.

You can download the complete solution for this example here.

First, the error icon. I utilized the ui-icon-alert class that comes with jQuery UI to display the error icon. But, to get the icon to display correctly without having to create a containing div element around the icon, we need to add a new class to the jquery.ui.theme.css file. Open up the default jquery.ui.theme.css file or if you have added a custom theme, the jquery-ui-[version number].custom.css file and find the states and images sub section under the Icons section. Add the following css class to the list of classes there.

.ui-state-error-icon { display:inline-block;  width: 16px; height: 16px; background-image: url(images/ui-icons_cd0a0a_256x240.png);  }

This class will allow a 16 x 16px icon from the error images png to be displayed in an empty element.

Next we need to change the onError function in the jquery.validate.unobtrusive.js javascript file. Open that file and replace the onError function with that shown below.

function onError(error, inputElement) {  // 'this' is the form element
    var container = $(this).find("[data-valmsg-for='" + inputElement[0].name + "']"),
    replace = $.parseJSON(container.attr("data-valmsg-replace")) !== false;

    container.removeClass("field-validation-valid").addClass("field-validation-error");
    error.data("unobtrusiveContainer", container);

    if (replace) {

        // Do not display the error message
        //container.empty();
        //error.removeClass("input-validation-error").appendTo(container);

        // If the error message is an empty string, remove the classes
        // from the container that displays the error icon.  Otherwise
        // Add the classes necessary to display the error icon and
        // wire up the qTip tooltip for the container
        if ($(error).text() == "") {
            container.removeClass("ui-state-error-icon").removeClass("ui-icon-alert");
        }
        else {
            container.addClass("ui-state-error-icon").addClass("ui-icon-alert");

            $(container).qtip({
                overwrite: true,
                content: $(error).text(),
                style: {
                    classes: 'ui-tooltip-red'
                }
            });
        }
    }
    else {
        error.hide();
    }
}

Here instead of displaying the error message in associated container, we are displaying the alert icon and wiring up a qTip tooltip to display the error text. (Make sure in your Layout or MasterPage that you reference the jquery.validate.unobtrusive.js javascript file not the jquery.validate.unobtrusive.min.js file.)

If you run the application now all client side errors will be displayed using little error icons as pictured above and if the user hovers over the icon, the error message will be displayed in the tooltip.

To make server side validation messages appear in the same way we need to add another javascript function to each page. Create a new javascript file named jquer.qtip.validation.js and paste the following code into it.

$(function () {
    // Run this function for all validation error messages
    $('.field-validation-error').each(function () {

        // Get the error text to be displayed
        var errorText = $(this).text();

        // Remove the text from the error message span
        // element and add the classes to display the icon
        $(this).empty();
        $(this).addClass("ui-state-error-icon").addClass("ui-icon-alert");

        // Wire up the tooltip to display the error message
        $(this).qtip({
            overwrite: true,
            content: errorText,
            style: {
                classes: 'ui-tooltip-red'
            }
        });
    });
});

Here we are doing the same thing we did for client side validation except we are iterating over all elements with the field-validation-error class and removing its text, displaying the icon, and placing the error message in the tooltip. Make sure that on every form where you have server side validation displayed that you reference the jquery.qtip.validation.js javascript file.

There you have it. Client and server side validation displayed using error icons and tooltips.


Nick Olsen’s Programming Tips

Tags: , , , , , , , ,

Visalus Review – Is Visalus The best Home Based Business?

Posted in Uncategorized on August 24th, 2011 by Admin

Within this Visalus review, I will be answering some key questions if you are currently researching Visalus as his or her home based business? That is Visalus? The facts exactly that they feature their potential customers? May be the income opportunity they offer a legitimate one? Let’s begin my Visalus review.

Visalus can be a overall health company that operates underneath the leadership of co-founder and CEO Ryan Blair. They provide products in relation to weight-loss, anti-aging, and nutrition. The products include nutritional shakes, nutra cookies, and nutritional vitamin supplements to name a few.

Their flagship strategy is their Body by Vi Challenge Kits. These kits range in price from $49 to $249 per month. These challenge kits happen to be well praised by many people, where there certainly are a multitude of testimonials, and before pictures of those who have transformed their lives as well as their bodies using these products.

Visalus has an incentive for their Body by Vi customers to relate this program to others. In case a customer invites 3 friends to participate the process by ordering difficult Kit of equal or greater value to their own personal, the referring customer get the next months kit free of charge.

Visalus offers their products by way of a large network of Distributors, representing the multi-level marketing (MLM) income opportunity they are becoming well-known for.

It is possible to join Visalus being a Basic Distributor for $49. However, if you desire to maximize your profits, and participate in all the various benefits and opportunities that Visalus offers, you need to purchase a professional Success System for $499 or $999. The additional cost from the $999 package would be the 30 additional Sample Packs that you will receive for distribution for your prospects. With all of three packs, you may receive a 30 day trial offer for Vi-Net Pro Marketing System. After your first 1 month, this will cost a supplementary $24 per month.

When you achieve sales, and commence building your company of distributors below you, you’ll have an opportunity to take part in 8 compensation methods that Visalus employs. Included in this are:

Direct selling & Personal Customer Commissions
First Order Bonus
Weekly Enroller’s Pool
Fast Start Bonus
Team Commissions
BMW Bonus
Leadership Pool Bonus
Ambassador Star Bonus

These compensation methods are made to reward not merely customer acquisition, but team building and leadership also. When you start to create a large organization, and boost the sales volumes of your team as a whole, this compensation plan that Visalus employs will end up a really lucrative one.

For me, Visalus is a very legitimate company that provides high demand products in the booming health and fitness industry. This is a multi-level marketing business, so the practices of contacting friends and family, and taking part in home meetings will still apply. For those who have a solid desire to build this business, and have a adoration for the products which they offer, Visalus can be a solid opportunity to partner with.

Of course, If only the finest of luck in your search for any home based business which is suitable for you you.

Achievements in different Multilevel marketing involves which has a effective plan.View my own complete overview of the actual Visalus Scam.

The Visual C++ Weekly Vol. 1 Issue 20 (May 14, 2011)

Posted in C++ on August 23rd, 2011 by Admin

Read in this issue:

  • Boris Jabes: Rock Hard: C++ Evolving
  • Raymond Chen: A function pointer cast is a bug waiting to happen
  • Viva64: How to make fewer errors at the stage of code writing. Part N2
  • ACCU 2011: Scott Meyers on Move Semantics, Perfect Forwarding, and Rvalue references
  • DirectCompute Lecture Series 120: Basics of DirectCompute Application Development
  • CodeProject: INI Reader / Writer Class for MFC and ANSI C++
  • Marius Bancila: Finding Installed Applications with VC++


Visual C++ Team Blog

Tags: , , , ,