Thứ Năm, 24 tháng 8, 2017

Auto news on Youtube Aug 24 2017

Subaru WRX STI Type RA NBR Special thrashes 'Ring record

Some letter combinations sound illogically alluring when added to the end of a model name, on Japanese performance cars in particular. This car surely falls into that category: the Subaru WRX STI Type RA.

A lighter, more powerful WRX STI with some serious suspension mods, it will be limited to 500 cars only, with sales expected to be concentrated in the USA market.

There have previously been other lighter, more focused Impreza variants called RA released in limited sales spurts since the early '90s. What does RA stand for?.

Subaru has taken the catchily-named WRX STI Type RA NBR Special around the Nurburgring Nordschleife circuit and blitzed the lap record for a four-door car.

The NBR Special whipped around in 6m57s – a full 35 seconds faster than the previous record holder, Alfa Romeo's Giulia Quadrifoglio, at 7m32s.

It's safe to say that the NBR Special is in not-quite-production spec, though. It has everything from a 592bhp boxer engine and a WRC-spec gearbox to plastic windows, a rear wing the size of an ironing board and even DRS.

See the car in action below:. Back to the Type RA road car - what sets it apart from other WRX STI models, apart from rarity?. Less weight, more power and some racy suspension mods.

The roof is made from carbonfibre, the wheels are lightweight BBS 19-inch alloys with sticky 245/35 Yokohama tyres, the third gear ratio has been altered, and there's a shorter overall throw for the manual shift.

In the engine bay, the 2. 5-litre four-cylinder boxer engine has had a modest power increase to around 305bhp, courtesy of a new cold-air intake, new exhaust, altered ECU and upgraded pistons.

What about the handling? There are plenty of corners at the Nurburgring, after all…. Subaru really has got to work here, with inverted front struts, double wishbone rear suspension and new Bilstein dampers all-round.

A new set of generously sized Brembo brakes feature cross-drilled discs, six pistons for the front calipers and two for the rear. And there's a huge rear wing, manually adjustable and made from carbonfibre.

Pricing has not yet been confirmed, but the Subaru WRX STI Type RA is expected to go on sale in time for 2018.

For more infomation >> Subaru WRX STI Type RA NBR Special thrashes 'Ring record - Duration: 3:50.

-------------------------------------------

Subaru WRX STI (2016) review - Duration: 9:39.

Subaru WRX STI (2016) review

America suffered sizeable turbo lag with its launch of the Subaru Impreza Turbo. While the Japanese performance saloon first appeared in 1992, America had to wait for 15 years and the third generation for it to arrive.

By then we knew it as the Subaru WRX and range-topping WRX STI.

Today, in the UK, it's easy to dismiss the WRX STI (no Impreza these days, and no WRX for us) as a curiosity in a line-up dominated by SUVs and crossovers.

The rally championships that built the brand seem about as relevant to modern-day Subaru as they are to Audi. America has been far more proactive in squirting fuel on Subaru's motorsport fire.

When Ken Block first powerslid onto YouTube, he was at the wheel of a WRX, and today Subaru is active in Global Rallycross and national rally championships: Manxman David Higgins has clinched this year's Rally America National Championship, and even his brother Marks production-car lap records of the Isle of Man are set-up by Subaru USA.

A trip over some epic roads north of San Francisco seemed a good chance to revaluate the WRX STI in what is now its most enthusiastic market. Tell me more about the car.

Our car was finished in Pure Red (it was, to be fair, very red), with a $35,490 sticker (around £28.5k, which is now similar to the British price thanks to the recent drop in the British pound) and no optional equipment.

No sat-nav either, so I would require a map-reading navigator, perhaps apt given Subaru's rallying pedigree.

It was a surprisingly enjoyable car to use around Berkeley, California, even at slow speed: that burbly flat-four turbo engine, the surprisingly meaty hydraulically assisted steering, and the closely stacked gears, all of it gelled to deliver that unmistakeable Subaru DNA.

Sure, the doors and boot clang emptily when you shut them, and this is a very easy car to stall when you combine first gear with steering lock, but the STI feels as usable on the daily grind as it does exciting and characterful.

What about on more challenging roads?. Urban pootling was never the plan.

So early one Friday we set off towards Stinson Beach, plotting a route north up the famous Highway 1 a few miles beyond the Golden Gate Bridge, which would then loop right back round and further inland on the Panoramic Highway.

The fun starts a few miles after you've turned off the 101. Highway 1 bucks and coils and drops rapidly downhill towards the Pacific in a flurry of gear shifts, throttle and brake jabs and steering inputs.

The WRX STI feels made for this road. Its firm steering is laser accurate, plenty quick enough and full of feedback to let you know just how hard you can push the Dunlop Sport Maxx tyres.

It's got the chassis to match, too. The body is very tightly tied down, so none of the left-right flicks throw it off-balance, and you quickly gain confidence to attack the corners hard. The brakes make the biggest impression.

Even if you didn't know what was gripping the front discs, it's obvious the WRX STI hasn't left the production line with cheapo sliding calipers; the way the pedal stays firm and wipes off speed so resolutely lets you know there are some proper Brembo four-piston calipers up front.

Does that turbocharged flat-four still measure up?. After the turbo-boosted eagerness that's so noticeable around town, the off-the-leash performance is perhaps a little disappointing. The stats say 296bhp at 6000rpm, with 300lb ft at 4000rpm.

What you feel is a little too much turbo lag when you're jumping on and off the throttle through these plunging turns, and then too narrow a powerband when you get back on the throttle –a shrill warning buzzer keeps reminding you to shift gear.

And that's partly because of the closely stacked gears which, on the flipside, do add a sense of urgency to proceedings. The shift is short, the gate narrow, and the lever very notchy when cold, so it's easy to fluff a shift.

With fluids warmed through, that shift eases, and you soon start punching the lever back and forth far more freely. Even on Friday, Highway 1 can be crowded with dawdling tourist traffic, and overtaking is forbidden over most of the 35mph route.

American drivers do tend to get out of the way more readily than UK drivers, but you'll inevitably find yourself joining a long 20mph queue behind a Winnebago at some time or another.

There's less traffic on Panoramic Highway, which feeds off to the right just as you arrive at Stinson.

The road climbs up and away quickly from the coast and the clusters of housing, flicking through switchbacks with some faster, longer stretches in-between than you'll find on Highway 1. Soon you disappear into the treeline.

While Highway 1 isn't without its clifftop dangers, the Panoramic Highway feels edgier: you're quickly hemmed in by huge trees, and the road drops away from your right-hand side, and tumbles steeply from far above to your left as you head north: get a wheel off the road and most likely the rest of the car will disappear McRae-style into some tree trunks halfway down the hillside.

But this is a great road to drive in the Subaru, and with confidence rising and traffic near non-existent, I start to experiment with the drive settings. What kind of differences do the settings make?.

These novelties can sometimes make pointlessly small differences to a car's dynamics, but twirling the Subaru's centre diff button dramatically transforms its handling.

As default you can leave it in auto, but selecting '+' results in much more understeer for safe but stodgily reluctant progress down the road. Select '-', though, and the WRX STI snaps alive, feeling much more rear-biased, playful and agile.

This isn't only something you can feel on the absolute edge of grip, it's a new-found perkiness that defines the car at lower speeds too. It quickly becomes my default setting, and the markedly difference characteristics instantly remind me whenever I forget.

Eventually you climb up and out of the trees on Panoramic Highway, and the views out over the Pacific are superb – it's the ultimate riposte to the myth that America is full only of long, straight roads.

Verdict.

The Subaru might confound a few expectations. In the UK it seems we've lost interest in this car. We want plusher interiors, premium badges – and things like the Golf R have stolen its thunder.

But there's no doubting the WRX STI is a more mechanical, more charismatic, more exciting thing to drive. It's just taken us a spirited drive on one of America's greatest driving roads to remember it.

For more infomation >> Subaru WRX STI (2016) review - Duration: 9:39.

-------------------------------------------

10. Ferrari or Subaru Video 2 - Processing - FinalCC - Duration: 8:32.

So we are going to move on and start connecting our user interface with our code, alright?

So the first thing we are going to go ahead and do, we are going to click on view controller

here and go to our assistant editor here, so click on that and then we have both and

go back to main story board and now we have both. Now the other thing I would like to

show you here real quick let's close the right panel there, at the bottom left here let's

click on that. This gives us the view controller scene. We did not talk much about it, but

let's click on this and see what is going on. This view controller scene shows us all

the items we have in our view controller so we can actually navigate the tree. As you

can see here, this view is essentially if you click on it again you see it highlights

the entire screen here, entire view. So this view here is the main view which holds all

of our user elements here. As you can see we have here the Ferrari Subaru and as you

click you can see selects what we are clicking. The Ferrari image Subaru and so forth, alright?

So this is a wonderful tool to look at especially when you start having a lot of items in your

screen so sometimes is a little bit confusing to try and figure out what is what. So this

gives you a very nice tree-like hierarchy where you can actually have things laid out

on our screen here. Then the other thing we can do also with our view controller scene

here you can go for instance if you want to connect Ferrari or Subaru with our code you

can actually do the same from here so you can go ahead and hit control and you can see,

right?

You can definitely do that. So it is just another alternative and more often you will

see me opening this view controller here, view controller scene when we progress in

our development, at least now you have an idea of what that is, perfect. let's close

that for now at least.

Alright so now we have our code and we have our view controller here, our story book,

great. So let's start connecting things together here. The first thing we are going to do,

we are going to go ahead and connect these two here, because we will be using them in

the future. So click on the Ferrari, say control, first of all we are going to create in an

outlet. Right?

So we are going to say Ferrari image view, okay?

Say connect now we have our reference there, we are going to do the same with Subaru so

we are going to call this Subaru image view, enter, to connect give some more space there,

and let's actually click on our Subaru here because we want to also be able to reference

this title here so say control and spread at the top here. We are going to call this,

label, enter there it is. Since we are not going to change this A label, this label here

A, or this question here we do not need to connect at all, but we need to connect this

two here. The switch and this label here.

Let's start with our switch, so say control put it here. The first one is going to be

an outlet because we want to be able to access it. We are going to call this outdoor quick

there, and while we are there let's go ahead and create the action now, so just control,

drag and drop. This time make sure you change to action because we want to be able to fetch

the values change this to UI switch and then we are going to call this outdoor switch changed.

So now we have that method there. Just for organizational purposes, let's go take this

and put at the bottom here; that way we have our variables at the top and methods at the

bottom. So let's go ahead now and get this label here and connect there so control and

drag is an outlet let's say we are going to call this Outdoor Yes No Label. There we go,

we have everything set up for our first question. Let's do the same to our second question so

we can go ahead and control again go here. It is going to be an outlet first. We are

going to call this first speech the connect and then also do the same again to get the

actual fact let's put here. This time is going to be an action so make sure it's a UI switch.

So we are going to call this First Switch Changed. Okay say connect and there we go

so we have our method there let's give more space to that, perfect. Now let's go ahead

and do the same with our Yes or No Label here. So go ahead here and this is going to be an

outlet. We are going to go ahead and call this First Yes No Label, and you noticed the

naming here, this is very important. I am making sure that I pick names that are very

meaningful, so that I would know when I say First Yes, No, I know I mean this question

here B, because it says, "Do you enjoy fast cars?".

When you are naming your variables always make sure you find names that are meaningful.

That way you do not get lost sometimes in trying to figure out is this belonging to

this. So if you have really good names then you will have no problem.

Alright let's move on, so what next here, so we have everything done for our big question.

Also the same here now for our C question here, so let's get our slider, so control

put right there. This is an outlet first, so it is like slider I am going to call this

scale slider. Okay so connect now there it is, so click on your slider again control

let's go ahead and put back there and this time it is going to be an action because we

want same thing to happen. We want to be able to fetch the values as users slide left and

right. And now we can now go ahead and call this Scale Slider changed. That is good say

connect and there you have it at the bottom here. let's close the left panel there because

we do not need that anymore. That is good more space so let's go ahead and connect this.

Okay so before we go ahead any further let's go ahead and click on our slider here and

open our right panel there and let's go ahead and give it here a 0, and the maximum

we want to put a 10. There we go, and this button here, let's go ahead and change the

name we are going to call this show results. Perfect. There it is and we forgot to - let's

go ahead since we are here, let's go ahead and connect this button as well.

Let's go ahead and connect the button and your label here. The result label. Show and

drag right here, we are going to start with the action first. So UI button we are going

to call, show result pressed, say connect. So now we have our showResultPressed here,which

when we click on this button it should calculate everything. Let's go ahead and connect our

label here. Control again let's put there. This one we are going to call, final result

label. There it is. We will also need a way to access our show result button not just

the action so let's go ahead and connect that tool here as our variable at the top, so click

and then drag and drop just right here. Let's say it is an outlet the show results button.

Alright. Perfect, so save that. Alright so we have everything connected now so make sure

and the other way you can make sure you can go ahead hover over all of these icons here.

Right?

You can see all the connections so we have our title connection there and you can see

the names for our image view. We have Subaru, we have the outdoor switch, yes or no switch

we have everything here so this will allow us to make sure that we got everything covered.

We have the show result, perfect, that is wonderful.

So in this video we were able to create those connections again from our user interface

to our code so now we have a way of handling everything here dynamically on our code, which

is wonderful. So in the next video we will then dive more into the logic behind this

application here. So I will see you in the next video.

For more infomation >> 10. Ferrari or Subaru Video 2 - Processing - FinalCC - Duration: 8:32.

-------------------------------------------

Subaru WRX STI (2016) long-term test review - Duration: 17:30.

Subaru WRX STI (2016) long-term test review

Usually on those evenings, returning late from work, when I'd have a half-hour journey home, on my own, in the dark, in the wet, and I'd drive like my pants were on fire.

It's not a delicate car, the WRX – it's not a fingertip car, finely balanced on its tiptoes.

Forget potholes – just a slightly irregular surface will have you jiggling around so much your head bobbles on your shoulders.

Yes, there are advantages when it comes to body control on a late-night thrash, but the cost is too high in day-to-day use.

Flat out, the WRX makes you feel like a titan, but around town it can make you feel like a chump.

This stuff makes the WRX feel more dated than the throwback World Rally styling.

But the biggest blow to its appeal doesn't lie in that trade-off, but in what the competition has to offer.

Month 7 running a 2016 Subaru WRX STI: the highs and lows, before it goes.

The end is drawing near for our time with the Subaru, but one thing still stands out. If you're driving in the wet there are few cars that can touch the WRX for cross-country pace.

Month 6 running a 2016 Subaru WRX STI: a pilgrimage to Kielder.

I think it got its nickname, 'Killer' Kielder, because no-one could think of any other words that began with K. In truth, this most famous of all British rally stages was more like 'Krashy' Kielder; maybe 'Kwick' Kielder.

Very often 'Extremely Kold' Kielder. But 'Killer' was the name that stuck. .

And it was a giant killer, in its day: ever since it first appeared as a special stage on the RAC Rally in 1961, it was a daunting and unpredictable place, even for the best drivers in the world.

Back in the 1960s and early '70s, when the British event was in its golden age, the RAC would travel the whole of the UK.

Hard to imagine it now: over the course of four or five days the rally would run for 2500 miles, starting in London (or Bournemouth!); driving up through Wales, stopping off at Oulton Park for a few laps before heading to the Lake District and Scotland.

Then the cars would return (through Kielder) to East Anglia; a few laps of Snetterton, then back to London. Epic.

And if you were to ask any of those drivers which section they feared most, out of the 80-odd special stages, they would probably say 'Kielder'.

Made up of fast, undulating tracks of loose gravel with unforgiving ditches and trees, the drivers would find themselves in this godforsaken forest, with no pace notes, in November, often at night.

Located an hour north-east of Carlisle, hugging the Scottish borders, Kielder Forest was a remote, unwelcoming, almost Gothic place: dark, foggy, and lacquered with black ice. (Unfortunately, not one of these words start with a K.).

Did I say the '70s were the golden era? Maybe it was the 1980s, when Toivonen won the Group B Lancia Delta S4's debut event? Or how about 1995, when McRae and Sainz went into the RAC neck-and-neck in the title race, flat-out in their blue-and-gold Imprezas.

McRae was outrageously quick, but on Kielder's Pundershaw stage – at 36 miles, the longest in the whole FIA World Championship – he smacked a rock and bent his suspension while 'ditch hooking'.

He and co-driver Derek Ringer straightened out the strut using a log (I mean, how do you even do that?) and limped on to the service park in Penrith. From there they won the rally, and the 1995 Championship. .

Such are Kielder's legends and stories; but the last time the forest actually appeared in the RAC/Network Q/(whatever it was called) was in 1996.

The following year, the rally's epicentre moved to Cheltenham and then Cardiff – what was once a UK-wide event with hundreds of thousands of spectators became 'Wales Rally GB': three days in a lorry park outside Swansea, only 20 special stages, many of them the same road run twice.

This is vanilla rallying, bland and corporatised, and no-one even bothers with nicknames any more (except perhaps 'Krap'). . So fast forward 20 years, and I'm driving CAR's long-term-test Subaru WRX up to Kielder.

Like the Rally GB, this iconic Subaru has changed a lot over the last two decades, and I can't help feeling it – like the event – has somewhat lost its way.

A late 1990s Subaru was, and still is, a pert, well-proportioned, surprisingly unadorned car (except for those magnificent gold wheels). It was fast enough, brutish enough, yet also poised and balanced.

Having lived with the new WRX STI for a few months, I get tired of its hard ride, its jerky clutch and its ridiculous rear wing.

It seems to be screaming 'RALLY CAR', yet it doesn't quite go 'The Full McRae', as though Subaru's a bit embarrassed by all that now.

The Type UK comes with dark grey alloys as standard, but you can order gold wheels as a dealer option.

When I call Subaru and suggest we might fit them, the answer comes back, 'Are you being ironic?' To which I replied, 'Er, no, I actually like gold wheels'.

I know I've bemoaned the Subaru model range before, but look at the XV, the Outback, the Levorg; not a hint of WRC glory.

This is a brand determined to move on from those halcyon days, yet it doesn't know what it wants to be instead. .

Next morning we explore (with permission) some of the Forestry Commission gravel tracks that weave through the forest. It's surprising, after getting that bird's-eye view, how open it seems down at ground level, where we find stretches of meadow and wide vistas.

Since 1995, Kielder has been turning itself into an enormous sculpture park, and we come across strange architectural artworks in the trees.

I was expecting it to feel dense and gloomy here, like a grainy 1980s rally DVD showing dark forest and sleet; instead, it feels like the modern, managed parkland it is. . The forest is riddled with gravel tracks.

We're not here to drive like McRae, but you can feel the WRX respond when you ask more of it – short, sharp punches of turbo acceleration, jabbing at the throttle and brake, the STI comes alive when you drive more purposefully, more intensely.

It feels as if it still hankers after gold wheels too. .

This year marks the 30th anniversary of the end of Group B.

While I might want modern rallying to 'man up', no-one would want to return to 1986, but it's sad the death of Henri Toivonen and his co-driver Sergio Cresta in Corsica overshadows one of the best rallies in history, the 1986 Monte Carlo.

In the new, mid-engined 500bhp Delta S4, the young Toivonen looked favourite to win the title. He was leading the Monte when he hit a spectator's car and was bruised so badly he was on painkillers for the rest of the rally.

What followed was one of the greatest drives ever seen: coming from a minute down he drove like an inspired genius, the kind of drive we remember McRae for. He won, and it looked like his destiny was set. .

Month 5 running a 2016 Subaru WRX STI: it aint all bad, on the inside. When car folk talk to me about the Subaru many of them ask about the performance first and the interior second.

Subaru has a reputation for bad plastics and cheap detailing, but I don't find the WRX that offensive – it's not up to German standards, but it's no worse than your average Japanese standards either.

What lets it down is the Alpine sat-nav and sound system: yes it's a colour screen, but it's fiddly to use and it looks so aftermarket.

It suggests trips to Halfords, massive exhausts, and auxiliary boost gauges fitted to the top of the dashboard.

Month 4 running a 2016 Subaru WRX STI: unscheduled hare appointment.

Somewhere out there, there's a rabbit wearing part of my Subaru as a hat. Well, when I say rabbit, I mean a giant hare of the 'mad March' variety, about as big as a greyhound dog.

The hare in question ran out in front of me and collided with the STI's nose (a polite way of saying I ran over it).

I was on a dual carriageway so I couldn't stop immediately, but I knew there'd be damage – it sounded like I'd hit a rock. Yuck.

When I eventually pulled over, I was expecting to find gore, but apart from a bit of brown fluff there was no sign of the poor animal.

Mysteriously, there was also no sign of an entire black plastic shroud around the driver's side fog light.

It was as though the hare had time – during the collision – to get a screwdriver out and carefully prize it off. Anyway, I need to get it fixed – I'll report back next month. .

In the meantime, I thought I'd share my thoughts on the Subaru as a family car. One of the advantages of the original Impreza Turbo that's still true today is that it's based on a practical four-door saloon.

Some might sneer at its humble origins, but it does make the car easier to live with than, say, its BRZ coupe cousin.

Month 3 running a 2016 Subaru WRX STI: never mind the dampers, feel the diff.

I love driving the Subaru fast, but at lower speeds around town the ride is painfully stiff. If it had adaptable suspension, it's like it's permanently set in Race mode.

Unfortunately, it isn't adjustable, so we're stuck with hard dampers even on a pot-holed high street. Passengers jiggle up and down like unwilling parents on a bouncy castle. .

However, in true nerdy, technical Subaru style, the centre differential is adjustable. Perfect for… er, actually I'm not sure why they made the diff adjustable. Unless (like me), you want to get it sideways at every opportunity.

Drive the WRX hard and keep the diff in Auto mode, and the handling's pretty neutral, with a bit of understeer in the wet. It's not painfully intrusive though, and overall you can keep up a wicked pace.

I often take the longer route home from work, down an empty, twisting back road. I'm always astonished at how you can maintain momentum, cross-country, even in a downpour.

However, fiddle with the 'Driver's Control Centre Differential' (or DCCD) and you can manually fix the torque distribution between the front and rear axles.

Subaru explains that adjusting rearward 'sharpens cornering' and forward 'increases traction'; what they're really talking about is oversteer. In my case I only adjust one way, all the way to the back. .

Month 2 running a 2016 Subaru WRX STI: keeping it in the family.

If you felt last month's intro to our new WRX was unfair to Subaru ('a tide of anonymous hatchback and bizarre estates') don't worry, I'm allowed to be rude, I'm an actual Subaru owner.

This diesel Forester is our family workhorse, purchased with my own money (that's like a cat burglar buying his own ladder).

The common genes? They share the same firmly sprung solidity, 4x4 grip and innate balance; but deep down, I just love the brand – the 'Fuji Heavy Industries' badge and the quirky engineering.

Any criticism is just me being cruel to be kind. .

Month 1 running a 2016 Subaru WRX STI: the introduction to our long-term test.

The first time I drove our new Subaru, I filled up with petrol and as I walked into the shop a guy at the cash machine shouted 'Nice car mate!'.

When I came out three minutes later he was standing by the car, staring at it with his young son. 'I've had a few of these,' he said in hushed admiration. He went on to tell me his entire Subaru history.

Welcome to the WRX Club: membership is automatic upon purchase, and the entry fee is £28,995. Since that first night it's happened a lot, and I realise now I'm part of a cult.

While a Lamborghini or Ferrari attracts people who want to take selfies, and a classic car is an invitation to ask questions, the Subaru is a honeypot to a very specific type of enthusiast, of a specific age, who wants to have a specific conversation.

Knowledgable, passionate and clearly with plenty of disposable income, these are the guys (they're all men) who have kept the Subaru brand alive in the UK, despite a range that's become – let's be honest – a bit 'patchy' in recent years.

For more infomation >> Subaru WRX STI (2016) long-term test review - Duration: 17:30.

-------------------------------------------

Subaru XV - Duration: 1:04.

For more infomation >> Subaru XV - Duration: 1:04.

-------------------------------------------

Subaru Forester AUTOMAAT NIEUW DOOR ONS GELEVERD + ONDERHOUDEN - Duration: 0:57.

For more infomation >> Subaru Forester AUTOMAAT NIEUW DOOR ONS GELEVERD + ONDERHOUDEN - Duration: 0:57.

-------------------------------------------

11. Ferrari or Subaru Video 3 - Sample - Processing- Final CC - Duration: 8:56.

So now we are going to go ahead and start putting together a few things here, so whenever

you are trying to build an application it's always a good idea to have a roadmap. Because

if we don't have a roadmap, it makes it a little bit difficult to know what to do, to

know exactly what your application is supposed to do. Now, in cases where we have a smaller

application such like this one here, maybe not a lot of planning is necessary. Nevertheless,

we still need to plan a little bit, because after all it's an application so things need

to be intuitive; you have to have some sort of a guide for yourself so that you know what

exactly you are supposed to do.

So, going back to what this application is supposed to do. Well, we know this application

is a quiz application, which will allow your users to select answers and then the application

will compute a result, in return which will then determine whether they are a Subaru person

or a Ferrari. Now, right then as you can see as we talk about this, as we start putting

together our thought process, you notice a few keywords I've said: I said points, I said

quiz. So, if you go back and start thinking, you notice right away that a test requires

points, because that is how teachers measure whether you understand something or not. Alright?

So, in this case here we need a point system that will allow us to then determine whether

or not the person is a Ferrari person or a Subaru person. So, in that case then, we need

to create a few variables which will hold those points which we can then use to compute

the result we want. Okay, so the first thing we are going to do is we are going to say

var here at the top, right underneath our variables here we created earlier which connect

to our user interface, so we are going to say var say final result and we are going

to make this type int. Okay, say enter. Going back to how to read this we're just creating

a variable, and we are calling this final result and we say is of type Integer which

means this final result here variable, will hold Integers. Now, right away you see there

is a problem here, if you click on that it gives you what's going on, what's the error

about. It says here, class view controller has no initializers. Now, we haven't talked

about classes so, don't worry about what initializers are. Here, what's happening here is that every

time we create a variable inside of this class here we need to initialize it. And Xcode is

so smart and kind enough to tell us exactly what we need to do to fix it.

As you can see here it says: Fix-it stored properly final result without initial value

prevents synthesized initializers. So to fix it, just go and hit enter, and voila, it gives

int is equal to zero. So, essentially we just need to give a zero or initialize every variable

that we create. That way, there is no confusion, that way everything is precise. Again, we'll

talk more about initializers at a later time when we dive into classes and so forth. Good.

So now we have our final result there which by the name I can go back of Naming Convention,

you will infer, you can infer right away that this final result will hold the final result

or the final score of our quiz, which will then determine whether this person is a Ferrari

person or a Subaru. Okay, so let's do the same here, let's go say var outdoor result

tag Int, of course go ahead and say zero. Say var fastCarPoints, we're going to say

it's type of int, let's give it zero for now. And var scalePoints type Int and also give

a zero. Perfect. So we have our variables here. Okay?

They are all initialized to zero. Good.

The first thing we need to look at is the outdoor question here. Now let's click on

our switch here and you look in our inspector here. We can see the switch has a state, obviously

we knew that, but what we need to do here let's go ahead and click here and say off

because we want it to start at off. Let's do the same with our B question here, say

off. Okay, so everything is at zero, or is off. Perfect. Let's close this there. Okay

in our A question what we are trying to accomplish here, we need to get the value as they say

Yes or No, and then change this yes or no label here to whatever they have selected

here. And when that happens we also have to mark a point. So, what we can do here, so

let's go it's outdoor, let's find the outdoorSwitch change so it's going to be in this method

function here. So the first thing we need to do here is let's go ahead and fetch the

result, what users have selected either yes or no. But the first thing we need to do before

we do that, what we are going to do: so we're going to say here first if, now we're going

to go and fetch this element here which is the switch. If you go back here you can see

we actually have created here is the outdoor switch, this one here. Right?

We're going to say outdoorSwitch, say enter so if outdoor switch is not equal to nil and

then we want to proceed. So, what we're doing here, I know we haven't talked about nil,

but this is just a good programming habit to always check if things actually exist,

if they actually have a state. So, what we're doing here is checking if the outdoorSwitch,

this one here, exists it's not equal to nil, it's not m. So we checked if our outdoorSwitch

is not nil, so which means we want to show if this is true so if outdoorSwitch exists.

Then we can go ahead and put another if statement here. Say if switch, if outdoorSwitch.on,

it's a Boolean. If that's true, then here let's put a comment: so we add five points.

So what we are going to do here, we are going to go ahead and say: outdoorResult. There

it is, remember here we created here at the top, so we are now using the variables we

created- is equal to five. Else, we can say then outdoor result is zero. So if they say,

switch is on which means yes I am an outdoor person we are going to give five. If they

say no I'm not, we give zero. At the same time here what we need to do, because remember

we do have our yes or no label here, so what we can do now we can say outdoor yes no label

enter, remember here we created here yes no label, there it is. And now we can go ahead

and change to textProperty.text we want to just to say yes because they have said yes

I am an outdoor person. So we're just changing here for it to say just yes not yes or no.

Let's copy this and paste here, so in case this is, they say no we want to obviously

to say no.

Now, just to test things out here, let's go ahead to our showResult here and what we

need to do here, let's go ahead and say - so when they click on this we just want to check

and see if this is actually working. Let's go ahead and say here print; we want to test

the outdoor results so let's say outdoorResult is we're going to append outdoorResult.

Okay, so now here what's going to happen once we have selected our outdoorSwitch and we

start adding points into our outdoorResult, and of course changing the yes or no click

results. You should see our outdoorResult being printed out. Okay, let's save this and

run. Alright, So here we go. So of course as we have set up we wanted all of them to

be on no, so on false. Okay, so let's click results, show results here, and look at the

bottom here output says outdoor result is zero. Which is good, because we haven't selected

anything here, right?

So, now let's see if this works, so if we go like this, look what happened. It now it

says yes because we said: Are you an outdoor person?

We said yes.

Now let's see if this result is going to change because it should change to five. Now let's

go and say showResult and outdoorResult is five. Let's go back and say no here, showResult

says zero, and this here says no because now we've changed this state to no and text is

no. Perfect!

So it's working perfectly. Wonderful. So we were able to actually get at least the first

question functionality working. In the next video we will continue and do the same to

other methods. Alright, I'll see you in a bit.

For more infomation >> 11. Ferrari or Subaru Video 3 - Sample - Processing- Final CC - Duration: 8:56.

-------------------------------------------

14. Ferrari or Subaru Video 6 - Processing - FinalCC - Duration: 9:12.

Alright so let's proceed here, so now let's go ahead and instead here of just printing

down here, we want to actually go ahead and show at the bottom here because we already

have connected this label here if you look back at the top here - let's go over there

- we have our finalResultLabel, which is this one here. So let's go ahead at the bottom

here let's say, let's go ahead and say finalResultLabel.text. We are going to need to say is equal to please

answer all questions, get rid of this and save. Let's go ahead and copy the same code

here and put where necessary so here we are going to do the same and we can go ahead and

do the same here, except here we are going to go ahead and say "you are a Ferrari person".

Here we are going to say "you are a Subaru person", great.

Alright so let's go ahead and save this and run one more time, alright there it is, it

is running. let's go ahead and check - please answer all questions good, because that is

what we wanted to happen, we have not answered any questions. Let's go ahead and say yes,

let's go ahead and say yes, I do enjoy fast cars and let's put up to here let's show results

and says you are a Ferrari person. Wonderful so it is working as intended. Now the next

thing we need to do here is we want to be able to change our image here depending on

what we ended up being so if you are a Ferrari person we want to make sure that the Subaru

image is gone and we just show the Ferrari image. And in another case where the person

is a Subaru person we obviously want to go ahead and show the Subaru person here instead

of Ferrari. And that is great because we are able to do that because if you look

at our code here, we have already connected our image views here, so we have a Ferrari

image view then a Subaru image view, that is wonderful.

So what we can do there and here instead of this statement here where we are checking

the values, where we are checking whether the person is Subaru or Ferrari person, at

the bottom here we can go ahead and say give a little space there. We can go ahead and

say in this case a Subaru person we can say Subaru image view because that is where we

are interested in .image. So now in our case here we want to hide our Ferrari image here

and just show the Subaru image. So how do we do that?

Well we fetch our Ferrari image view that is we can say .hidden is equal to true and

save that, else in this case here this person is Ferrari that means we have to hide our

Subaru image. So we can say subaruImageView.hidden is equal to true, okay.

So let's save this and run one more time. Alright let's go ahead and say let's say I

want to be outdoor this is fine like that, let's go like this I am a Subaru person and

look at that, the Ferrari image is gone and now we only have the Subaru, great that is

working. So there we go, I am a Ferrari person and the Ferrari is showing there. Now the

next thing here we need to look at is, let's go ahead and run again one more time, if we

go ahead let's say I am an outdoor person yes, do you enjoy fast cars no, let's say

up to three, let's click here. I am a Subaru person, perfect, okay?

Now if I go ahead and change here say no let's say do you enjoy fast cars yes and put up

to ten and click it says I am a Ferrari person and then all of that just vanished so there

is nothing here anymore. So we need to fix that.

What we need to do here is just go ahead here and say ferrariImageView.hidden has to be

false because we need to show a Ferrari image and same here if you look if we say subaruPoints

is greater than ferrariPoints we said you are a Subaru person, which means the Ferrari

image has to be hidden but also the Subaru image has to be shown which is equal to false,

okay?

So now if we want again so let's go ahead, let's say yes here, no and let's put up to

three so I am a Subaru person. Let's go ahead and say no to outdoors and say I like fast

cars up to ten, I am a Ferrari, perfect. So this is working.

So the next thing we need to do is to actually change this Ferrari or Subaru title here to

reflect what the person is now, now that we have all the information that we need. So

if you look closely here let's go at the top we have the title, main title here, okay?

So what we need to do let's go here we can now go ahead and say mainTitle.text, let's

say equals to in this case it is a Ferrari, say Ferrari, exclamation point there. Let's

copy this and here we are going to go ahead and say Subaru. Great!

Let's save this and run one more time, alright so let's give it another test here. So let's

say I am an outdoor person and I do not like fast cars, I should be Subaru person and I

say Subaru, perfect. Change my mind let's say I am not an outdoor person and I like

fast cars and I like up to six there and I am a Ferrari person and this is Ferrari that

is amazing, our application is working indeed.

Now what if I wanted to change let's say the background of the selected car right if I

am a Subaru person I also want to change the background of the image view. Well simply

again we can access all that information here if we look in this case here I am a Ferrari

that means I need to make the imageViewFerrariBackground to change colors. So I can go ahead and say

ferrariImageView.backgroundColor as you can see here and you can see right away it takes

this class called UI color, in order to change our background here right. So if we go say

enter I can go ahead and say it is equal to UI color and there is different ways we can

change our color, but for now let's just use the default ones. Say UI color. - let's give

it white background, alright. Save that and in our case here for Subaru, we are going

to say subaruImageView.backgroundColor is equal to UI color. Let's give it maybe yellow

color, okay?

Let's save that and run, alright it is running let's see, okay let's see if this works. let's

go ahead and say yes and up to here, something like that. Oh there we go look at that Subaru

and change to yellow. And if I change my mind I said I like fast cars and look at that,

perfect. Instead of white let's put maybe red let's say red here, red color, okay?

That would be more exciting I think, let's run one more time alright. So let's I say

I want to be a Ferrari person, so I like fast cars and up there, very nice.

Now the last thing we want to do here, let's go start this and run, let's get rid of this

"You are a..." there, small thing no biggie. Let's double click our main story book into

hit delete key and it's all good save, run one more time and now we should see nothing

in the beginning. Alright as you can see there is nothing here which is exactly what we want.

So let's go show results, please answer all questions working. Okay if we say yes up to

here say result and I am a Subaru person, let's say no here say yes I love fast cars,

result I am indeed a Ferrari person.

Wonderful, congratulations you are able to create a fairly complex application here with

all the tools that we have learned and maybe we learned a few along the way and that is

great. So go ahead and play around with this application this concept here. You can create

your own quizzes your own questionnaires because now you have a basic template that you can

use. So make this application your own. So once you have made those changes for yourself

take screenshots of your application you have seen a little here which is very easy to do,

you can say file, okay?

And say save screenshot click on that and a screenshot will be saved on your desktop

and then you can upload that into the discussions and share with all of us. Alright congratulations

and I will see you in the next videos.

For more infomation >> 14. Ferrari or Subaru Video 6 - Processing - FinalCC - Duration: 9:12.

-------------------------------------------

12. Ferrari or Subaru Video 4 - Processing - FinalCC - Duration: 10:19.

So we do have one functionality actually working. So now it is just a matter of doing the same

thing to other methods here. Okay?

So next we are going to go ahead and do the B questions. So do you enjoy fast cars?

Let's go ahead find the fast car switch, there it is. So we are going to go ahead and

do the same. If fastSwitch, is not equal to nil, checking make sure that - and then we

will say if fastSwitch.on - so if that is indeed on, if they selected yes - then what

we want to do we want to add five points. How do we do that?

Well, we need to go ahead and make sure we get the first switch variable which hold the

points. So we say fastCarPoints, we add five and then we want to change the label let's

say it is yes or no here, so we say fastYesNoLabel.text is equal to yes. Else, meaning if they say

no, then what we need to do is we are going to say fastCarPoints is equal to zero and

then we change our first yes no label text to say no.

That is perfect, instead of outdoor here let's go ahead and say fastCarPoints so we can see

if the fast car points is being incremented or decremented for that matter, so let's run

this. let's go ahead and try out our B here. Show results, it's going to say well, it

is saying outdoor. let's change this to fast car. That way we know exactly what we are

talking about. Stop and run again. Alright, so let's go ahead and say showResult. It should

say fast car result is zero, yes, because we have not said yes or no. let's go ahead

and say yes, now it says just yes which is good so it is updating correctly. let's go

ahead and say showResult and indeed fast car result is five. Great!

So it is working. Okay?

Let's go ahead and do the same to our final question here. Now in our scale slider here

we are going to go ahead again and say if scaleSlider is not nil then we are going to

go ahead and say if scaleSlider. - before we do that, before we start writing our code

here, let's make sure we actually have this label here connected here. I do not think

we do, so let's go ahead let's go at the top here, so make sure yes, I do not think we

do so we forgot that, my bad. Let's go control, let's just pull it out here so it's going

to be an outlet. We are going to call this scaleValueLabel. That works, say connect and

there we have it.

Now we have a reference so we can actually change as users slide left and right. Here

before we do anything let's go back to our slider here, let's create a variable here,

say, var scaleVal, for value, is equal to, now let's go ahead and get the actual value

from our scale. Let's go and say scaleSlider.value, that is where we are going to be getting and

let's go ahead and print those values as we scale value or, let's go ahead and append,

say scale val. Save this, let's see if this is going to work. So, let's go ahead and run

again. So you notice right away when you run we had some warnings, not necessarily errors,

saying "Variable scaleVal was never mutated, consider changing to let." Let's stop this

and put let here so that we do not have those issues anymore. It was not necessarily an

error because our app ran just fine, but since it's a warning, it's always nice to follow

what Xcode tells us. Let's go ahead and run one more time. Okay, now we do not have any

warnings, let's go ahead and see if this works.

As you can see it is working here, it's giving us all the values, but notice that

the values we are getting they are not integers, because they have decimal points, so they

are floats so we need to change that. We just put inside here we are going to go ahead and

put int. So what we do we simply go ahead outside here since we are using these variables

so we can go ahead and say int, then open parenthesis and let's go ahead and close.

That way we are saying that whatever is inside this parenthesis here we are converting them

into int. Now scale value which we are calling here will have integers as opposed to having

floats. Save this one more time and run, it could have actually showing integers. Let's

go ahead and see if this works and there it is, so say seven, eight, nine and all those

great values. Perfect, let's go ahead and make sure we can access the current selected

value from outside the scale slider changed because we need to do that. Here, let's go

ahead and say a scaleSlider.value, of course just to make sure we get actual integer, let's

go ahead and say int and put on one side there, just like we did before. There it is.

Now when we run this, we should be able to click on showResult and we should get - let's

just get rid of this for now - and we should get indeed the current state of our slider

here. Let's go ahead and run, let's say show result, say result is zero, let's move a little

bit there, show result, says result is one, let's move all the way and result is 10. That

is good, that means we are able to actually fetch this scale slider value here which we

instantiated at the top here, scale slider, at the same time we are getting those values

inside of our scaleSliderChanged. Now we know we are able to get our values as needed. Also

we said here we want to be able to change this value here as they slide left or right.

The way we do this, let's go ahead and comment this out. Obviously we are going to go ahead

and fetch our label here, which I think we called - let's see what we called that label--

we called it scaleValueLabel. We are going to go ahead and say scaleValueLabel.text is

equal to - let's append our scaleVal, which is the value that we are getting from our

slider, so this one is there, and then we are going to go ahead and put a forward slash

and then append another value here and we can go ahead and just say 10.

Now here is another thing we can do here. This is perfectly fine, so let's go ahead

and save and run this. We should see things will still work as we want. Let's go slide,

and say two and all of 10 out of 10. That is perfect, that is wonderful. But since we

are learning about Swift, we are learning about Xcode, we are learning about iOS development,

there is another thing we can do here. Instead of just hard coding here, we can just put

the number 10 because we know this is from 0 to 10. What if we decided to say we want

to say zero to 100?

We change this wording here to 0 to 100. Well, we have to come here and change to 100 again.

But there is a better way of doing this, which is, as we know our scale slider here, object

item here, this one here, it has - we clicked on it and let's open our inspector again - it

has the minimum and maximum value.

And we know all of these attributes here that we can access via our Xcode here, that we

can also access those in code, we can actually get the maximum value or minimum value, in

code by using our object scaleSlider. Instead of just putting 10 here, let's go ahead and

dynamically fetch the maximum value of our slider here. How do we do that?

Let's go ahead to make things cleaner, let's go ahead and say let maxVal be equal to scaleSlider.maximumValue,

as you can see there it is, and it is of type float, say enter. Since we want it to be an

integer let's do the same here, let's convert. First we are going to say int, open parenthesis

and close. So now there is maxVal we can use here instead of using just 10, we can append

that here, say maxVal, enter. We created a variable maxVal and we gave it the maximum

value that our slider holds, which essentially is - let's click back here - is this value

here, and this is good programming habit because now, everything is dynamic. If we decided

that we want to change this again to 0 to 200 or 500, then we do not need to change

anything here because this will just fetch whatever we set this to be. Let's go ahead

and save and run again, you will not see any difference but now we know that our application

is indeed dynamic. Let's go ahead and change this, again nothing is changed but we know

everything is dynamic which is good. We stop here, let's go ahead and say result; it should

say result is four because that is what we are displaying here.

We did a lot of things here, in this video, we are getting really close to finishing up

our application, but I want you to go back and start studying while looking back at what

we did here. Because I know it may be a little bit overwhelming, just do not worry too much,

just go back and read this code and type yourself everything. In the next video we will continue

working on this application. We are getting close and I will see you in a bit.

Không có nhận xét nào:

Đăng nhận xét