Roslyn Syntax Visualizers

Posted in Visual Basic on November 26th, 2011 by Admin

Hi All! A few weeks ago, we announced the Microsoft “Roslyn” CTP. I hope many of you have had a chance to download the CTP and take it for a spin :) If you haven’t, do give it a try.

To recap – in the Roslyn CTP, we are previewing a powerful set of language services APIs that you can use within your apps to reason about VB and C# code. We are also previewing IDE extensibility points for VB and C# that will allow you to build rich code refactorings, quick fixes etc. that run inside Visual Studio.

In this post, I just wanted to point out a couple of tools that you may be interested in if you are working with the CTP – the Roslyn Syntax Visualizers. You can read more about these visualizers and how to install and use them on the following blog post – http://blogs.msdn.com/b/visualstudio/archive/2011/10/19/roslyn-syntax-visualizers.aspx

The visualizers ship as samples in the CTP and allow you to visually inspect and explore Roslyn Syntax Trees (below screenshot shows an example). You can use these visualizers as debugging aids when you develop your own applications / code refactorings using the Roslyn APIs.

clip_image001

Happy Coding! :)

Shyam Namboodiripad
Software Development Engineer in Test (Roslyn Compilers Team)


The Visual Basic Team

Tags: , ,

Tribute to Steve Jobs, Black Friday app sales, and more in this week’s mobile news

Posted in IPhone App Programming on November 26th, 2011 by Admin

The U.S. Patent office pays a nice tribute to Steve Jobs.

According to Microsoft, Winodws phones have had Siri-like functionality for over a year.

Big Fish Games trying to figure out why Apple suddenly removed their app allowing game subscriptions from the App Store.

Here are some Black Friday app sales.

And don’t forget about our giveaway: Win Free Copies of iPhone Application Tune-Up Guide. A must have for all iOS developers.


Mobile Orchard

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

Ernest Adams, world renowned games design consultant & author, talks to Game Careers

Posted in Video Game Programming on November 23rd, 2011 by Admin

Ernest Adams, a game design consultant and formerly a programmer, talks to David Smith of Interactive Selection and Game Careers at GDC Europe in Cologne, Germany. Ernest  is a freelance game designer, writer, and professor, working with the International Hobo Design Group. He has served in the game industry since 1989, and is the author of four books, including the university-level textbook “Fundamentals of Game Design, Second Edition.” He was most recently employed as a lead designer at Bullfrog Productions on the Dungeon Keeper series, and for several years before that was the audio/video producer on the Madden NFL football line for Electronic Arts. Ernest is also the founder and first chairman of the International Game Developers’ Association and a popular speaker at conferences and arts festivals around the world. His website is at http://www.designersnotebook.com. His advice to games designers looking to join the industry as a first job:

“Cultivate an interest in everything. Absolutely everything and anything is useful to a games designer, whether its history, architecture, literature, art, computer programming is a useful skill even for a game designer (you don’t have to be a hardcore one), the ability to draw is a useful skill for a games designer. Learn to think, and play a lot of games… to see how they work, take them apart and think about them. Nowadays it is difficult to get a job at a large company without a college/university degree. A university degree will really help you. There are good ones and bad ones, you need to do some research to see where you are going to go. If you don’t have a university degree, a lot of companies will put your CV in the bin.”

His advice on choosing a university course: “The breadth of the program is good, if it concentrates only on programming its not a great place for a games designer to be. If it concentrates only on Art/animation then its not that good a place for a games designer to be. its better to be in a place that offers all the talents that game development requires because that way you can sample a little of each.” See the full clip here:

Share

Game Careers .BIZ – Video Games School, Jobs in Gaming.

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

VB Support for Microsoft Surface 2.0

Posted in Visual Basic on November 23rd, 2011 by Admin

Touch screen are great and we’ve seen their use on phone and slates but sometimes these screens still just are not big enough.     For those who desire bigger touch screens, Microsoft surface may be the answer.     Microsoft surface has been around a while and there have been significant changes with version 2.0.   Version 2.0 introduces new functionality and support for more compact hardware.    A glance at the Microsoft Surface team web site reveals some incredibly interesting uses for the technology.

The samples provided are a great introduction to writing code for the platform.    VB versions of all the samples have been created and they provide a introduction to what is possible. 

To develop Surface applications using VB requires installation of a few prerequisites:

And for those who feel inspired to create new surface projects from scratch we have included the project templates.    To install these project templates after installing the above prerequisites – you can find then in the Visual Studio Gallery (Tools > Extension Manager) searching on the “VB_Surface” and install the new project templates.

You can now start up Visual Studio and the two surface templates should appear for Visual Basic as well as the existing two C# surface templates.   This is another technology that is now targetable by VB developers and that utilizes the VB Core functionality.

Enjoy….

Spotty


The Visual Basic Team

Tags: , ,

Will I ever blog here properly again.

Posted in Video Game Programming on November 21st, 2011 by Admin

Yes I will blog here again, particularly when I talk about Android Dev, Game Project Dev, and programming of video games and robots.  But for the time being; check out my latest #AltDevBlogADay posting.

 


Programming: Robots & Video Games

Tags: , , , ,

Greg Robinson, COO & Co-founder of Connect 2 Media talks to Game Careers at Develop in Brighton

Posted in Video Game Programming on November 21st, 2011 by Admin

Greg Robinson, COO and Co-founder of Connect 2 Media talks to David Smith of Interactive Selection and Game Careers at Develop in Brighton. Greg has worked within the mobile content arena since 2000. He has lead teams responsible for several ELSPA top ten games working with brands such Sonic, Monopoly, Guitar Hero and Tetris as well as launching several successful original IP’s such as Go Go Rescue Squad. Previously he has held senior management positions at iFone and Hands On Mobile Inc. He tells us what he looks for when recruiting:

“Mainly enthusiasm. When we do interview you see so many people . They come along for the job but don’t come along quite mentally prepared for what the job is. We are a highly professional company and people misunderstand what the games industry is. The games industry is a multi billion enterprise in the UK alone. Its highly professional – but we are not looking for people looking to escape from the real world. Yes its fun, and its a lot of fun, and it certainly beats working in a band, but we demand the highest professionalism. We deal with huge project budgets, high development times and costs and we can’t afford to be anything less than utterly professional. Come along, be enthusiastic, make a difference in your presentation to people. If you come across as enthusiastic, professional and have a love for the subject then you do tend to stand out from everyone else.” See the full clip here:

Share

Game Careers .BIZ – Video Games School, Jobs in Gaming.

Tags: , , , , , , , , ,

iPad 3 rumors, Amazon smart phones, and more in this week’s mobile news

Posted in IPhone App Programming on November 20th, 2011 by Admin

Rumor has it the iPad 3 will be coming out in March, and will be a little bit thicker than the iPad to to accommodate the dual light bar system.

Mobile carriers in the U.S. are having problems meeting demand for the iPhone 4S.

Will Amazon release an iPhone competitor in 2012?

Kids want iPhones, iPads, and iPods for the holidays this year more than ever.

AT&T has the fastest iPhone network and Verizon the most reliable according to this study.


Mobile Orchard

Tags: , , , , , , , , ,

Making UITableViews look not so plain

Posted in IPhone App Programming on November 19th, 2011 by Admin

As most of you probably know, UITableView’s are incredibly useful and versatile views to be using in your applications.
If you have ever tried to customize a UITableView though, you know that as soon as you start adding lots of UIViews, UILabels, and UImageViews to a cells ContentView, that these tableviews start to scroll slower and slower, and become choppier and choppier.

What we are going to explore today is how to remedy that situation.
To download the entire XCode project, you can find it at: http://github.com/elc/ICB_PrettyTableView

We are going to build a simple contact viewer, that will display the phones contacts. For each contact, if they have a first name, last name, email and phone number, they will be displayed within one cell, with different colors. The reason this is useful is because it provides the basics for customizing UITableViewCells that can really start to make your application look nice, and still scroll well.

In this example, we have a standard UITableViewController. We are going to have a couple class variables defined in the header

#import 
#import 
 
@interface ICBTableViewController : UITableViewController
{
    ABAddressBookRef _addressBook;
}
 
@property (nonatomic, retain) NSArray *contacts;
 
@end

ABAddressBookRef _addressBook is defined in our header, so that we don’t have to release it until we dealloc. And the contacts is so that we can hold on to the data for our tableView.
In the main table view controller file we are going to override the – (void)viewDidLoad to provide some initial configuration of the tableView, as well as loading or generating our data. (We will generate fake data for devices or the simulator that don’t have address book data)

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.tableView.backgroundColor = UIColor.blackColor;
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
 
    ABAddressBookRef addressBook = ABAddressBookCreate();
    NSArray *tempArray = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);
    tempArray = [tempArray sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
        NSString *name1 = (NSString *)ABRecordCopyCompositeName((ABRecordRef)obj1);
        NSString *name2 = (NSString *)ABRecordCopyCompositeName((ABRecordRef)obj2);
        return [name1 compare:name2];
    }];
 
    if ([tempArray count] > 0) {
        self.contacts = tempArray;
    } else {
        NSMutableArray *tempMutableArray = [NSMutableArray arrayWithCapacity:100];
        for (int i = 0; i < 100; ++i) {
            NSMutableDictionary *dict = [NSMutableDictionary dictionary];
            if ((i % 9) != 0) {
                [dict setObject:[NSString stringWithFormat:@"FirstName%d", i] forKey:@"firstName"];
            }
            if ((i % 3) == 0) {
                [dict setObject:[NSString stringWithFormat:@"LastName%d", i] forKey:@"lastName"];
            }
            if ((i % 3) == 0 && (i % 2) == 0) {
                [dict setObject:[NSString stringWithFormat:@"emailTest%d@test%d.com", i, i] forKey:@"email"];
            }
            if ((i % 7) == 0) {
                NSString *string = [NSString stringWithFormat:@"%d", i];
                while ([string length] < 10) {
                    string = [string stringByAppendingFormat:@"%@", string];
                }
                [dict setObject:string forKey:@"phone"];
            }
            [tempMutableArray addObject:dict];
        }
        self.contacts = tempMutableArray;
    }
}

As you can see here we have a couple of self.tableView methods we have called to setup the background color, and also the cell separator style.
If you are running this application on a device, or simulator that has contacts, this method will also make a copy of the address book as the data to display. If there is no data in the address book, we create some fake test data just for displaying.
Also don’t forget to include our – (void)dealloc method for releasing our _addressBook variable.

- (void)dealloc
{
    CFRelease(_addressBook);
    [_contacts release];
    _contacts = nil;
}

We have to supply the tableView with our number of rows

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [self.contacts count];
}

The next portion we have to override is the – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath so that we can supply the tableView with our cells.

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
 
    static NSString *CellIdentifier = @"ICBTableViewCellIdentifier";
 
    ICBTableViewCell *cell = (ICBTableViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[ICBTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
//        cell.delegate = self;
        cell.textLabel.textColor = UIColor.whiteColor;
    }
    cell.tag = indexPath.row;
 
    NSObject *object = [self.contacts objectAtIndex:indexPath.row];
    if ([object isKindOfClass:NSDictionary.class]) {
        [cell setDictionary:(NSDictionary *)object];
    } else {
        [cell setRecord:(ABRecordRef)object];
    }
 
    return cell;
}

We are checking each object coming out of our array so that we can determine if we need to call the setDictionary, or setRecord method calls.

Now the meat of this tutorial, extending a UITableViewCell.

In our header we are going to define a bunch of strings that we want to display

#import 
#import 
 
@interface ICBTableViewCell : UITableViewCell
 
@property (nonatomic, retain) NSString *firstName;
@property (nonatomic, retain) NSString *lastName;
@property (nonatomic, retain) NSString *email;
@property (nonatomic, retain) NSString *phone;
//@property (nonatomic, retain) UIImage *image;
@property (nonatomic, retain) NSString *address;
 
- (void)setRecord:(ABRecordRef)record;
- (void)setDictionary:(NSDictionary *)dict;
 
@end

And then our two set methods:

- (void)setRecord:(ABRecordRef)record
{
    self.firstName = [(NSString *)ABRecordCopyValue(record, kABPersonFirstNameProperty) autorelease];
    self.lastName = [(NSString *)ABRecordCopyValue(record, kABPersonLastNameProperty) autorelease];
    self.email = [self getFirstEmail:record];
    self.phone = [self getFirstPhone:record];
    [self setNeedsDisplay];
}
 
- (void)setDictionary:(NSDictionary *)dict
{
    self.firstName = [dict objectForKey:@"firstName"];
    self.lastName = [dict objectForKey:@"lastName"];
    self.email = [dict objectForKey:@"email"];
    self.phone = [dict objectForKey:@"phone"];
    [self setNeedsDisplay];
}

Some tutorials will have you put this next part into a separate UIView subclass, and add that class as the contentView of this UITableViewCell, but I prefer to override the drawRect of the UITableViewCell, and do all my drawing there.

The first thing I am doing is getting the current graphics context so that we can draw to the screen, clipping to the rect that is passed in drawRect:(CGRect)rect, and then depending on whether this cell is even, I am filling the entire rect with an almost black color, or slightly lighter.

- (void)drawRect:(CGRect)rect
{
    CGContextRef ctx = UIGraphicsGetCurrentContext();
 
    CGContextClipToRect(ctx, rect);
    //If even
    if (((self.tag % 2) == 0)) {
        CGContextSetFillColorWithColor(ctx, [UIColor colorWithWhite:0.1f alpha:1.f].CGColor);
    } else {
        CGContextSetFillColorWithColor(ctx, [UIColor colorWithWhite:0.15f alpha:1.f].CGColor);
    }
 
    CGContextFillRect(ctx, rect);

The next thing I am going to figure out is whether I want this text to be centered in the cell, and I am determining this based off whether there is an email field or not.

    //Vertically center our text, if no email
    BOOL isCentered = (self.email == nil);

And now for the meat of the drawRect method. We calculate the size of firstName, draw it offset from the left by 5, and then draw lastName right after it. We also change the color we are drawing between those two.

    CGRect tempRect;
    CGFloat midY = CGRectGetMidY(rect);
    [[UIColor whiteColor] set];
    UIFont *defaultFont = [UIFont systemFontOfSize:16];
    CGSize size = [self.firstName sizeWithFont:defaultFont];
    if (isCentered == NO) {
        tempRect = CGRectMake(5, 0, size.width, size.height);
    } else {
        tempRect = CGRectMake(5, midY - size.height/2, size.width, size.height);
    }
    [self.firstName drawInRect:tempRect withFont:defaultFont];
 
    [[UIColor lightGrayColor] set];
    size = [self.lastName sizeWithFont:defaultFont];
    if (isCentered == NO) {
        tempRect = CGRectMake(CGRectGetMaxX(tempRect)+5, 0, size.width, size.height);
    } else {
        tempRect = CGRectMake(CGRectGetMaxX(tempRect)+5, midY - size.height/2, size.width, size.height);
    }
    [self.lastName drawInRect:tempRect withFont:defaultFont];

Next we find out if phone actually exists, and if so set the color to red, and draw it to the right of lastName. We also have to make sure we aren’t drawing this outside our boundaries, so we check to see where the end is, and if it is outside, we crop it to 5 pixels from the end.

    if (self.phone != nil) {
        [[UIColor redColor] set];
        size = [self.phone sizeWithFont:defaultFont];
        CGFloat end = CGRectGetMaxX(tempRect) + size.width;
        if (end > rect.size.width) {
            size.width = CGRectGetMaxX(rect) - CGRectGetMaxX(tempRect) - 10; //-10 so that we get 5 from the end of last name, and 5 from the end of rect
        }
        if (isCentered == NO) {
            tempRect = CGRectMake(CGRectGetMaxX(rect) - size.width - 5, 0, size.width, size.height);
        } else {
            tempRect = CGRectMake(CGRectGetMaxX(rect) - size.width - 5, midY - size.height/2, size.width, size.height);
        }
        [self.phone drawInRect:tempRect withFont:defaultFont lineBreakMode:UILineBreakModeTailTruncation];
    }

And finally if our email actually exists draw it on the bottom left.

    if (self.email != nil) {
        [[UIColor blueColor] set];
        size = [self.email sizeWithFont:defaultFont];
        tempRect = CGRectMake(5, midY, size.width, size.height);
        [self.email drawInRect:tempRect withFont:defaultFont];
    }

I hope this helps you in configuring UITableViewCells for your own project, and hopefully will let you start to think about the possibilities.

To download the entire XCode project, you can find it at: http://github.com/elc/ICB_PrettyTableView


iPhone Programming Tutorials

Tags: , , ,

Rumor: Apple releasing iOS 5.02 to address battery issues

Posted in IPhone App Programming on November 18th, 2011 by Admin

The rumor going around now is that Apple will release iOS 5.02 to address battery issues iPhone 4S users have been experiencing. This rumor was started by German Mac site Macerkopf.DE earlier today.

This report claims that Apple wants to be able to give 4S users 40 hours of standby and 10 hours of use. It is said this release should be out no later than next week.

Also, according to this site, iOS 5.1 will many changes to Siri voice control but will not be out until early next year because of development expenses, which are said to be quite costly.


Mobile Orchard

Tags: , , , , , ,

Chee Ming Wong, Creative Director for Opus Artz in London talks to Game Careers at Gamescom

Posted in Video Game Programming on November 18th, 2011 by Admin

Chee Ming Wong, the Creative Director at Opus Artz has over 12 years of creative visualization and design experience, working with a diverse range of game & animation developers worldwide such as Visceral Games, Sucker Punch productions, 2K Marin & 2K Australia. His roles include being the External Creative Director on The Edge of Twilight, Art Consultant on Bioshock 2, Dead Space & Infamous franchise and a ardent Wacom Evangelist.

In addition, Dr. Wong also regularly hosts artist workshops, tutorials and articles, and is a keen proponent of continuing art education and the promotion of entertainment arts to the wider public via the auspices of TIGA/UKTI. His works have been published in a variety of international books and magazines.

With a longstanding passion in future space and aerospace technology, Dr. Wong is an official artist for the International Association of Astronomical Artist (IAAA) and also holds a medical doctorate, having specialized in Anaesthetics and Intensive Care Medicine.

His advice for those seeking to find a creative role in the games industry:

“You have to start very early on. There are various forums where you can find out more about being an artist. When you finally do you apply for a games job you have to do the necessary background research. The chances are you will be competing with existing artists already in the feed so you need to be comparable or better than other candidates. Just sending a bland CV is not good enough, you need to personalise things, research, and find out what various styles or requirements each company has. Not everyone might like manga style or melissa style so you need to be very versatile. Apply yourself to various package tools like 3D, also have a strong base in 3D. As long as you have a good graphic of various skills I think you can do very well. The main thing is to be very enthusiastic and keep on trying. Don’t give up, you might have to try 40 or 50 times. That’s normal, its very competitive.

Have the right mind set; if you are not getting much luck with various companies you need to reassess why this is happening. Just asking someone to review your portfolio is not enough. You need to have enough acumen and an understanding of where you are. Sometimes its very hard to go to a friend to ask this.” See the full clip here:

Share

Game Careers .BIZ – Video Games School, Jobs in Gaming.

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