Good afternoon and welcome to CMC Markets and this Monday market update. Look at the week ahead on the 3rd of April. And it's been a fairly quiet start to the week. We saw European stocks close the quarter in a rather subdued fashion. But it doesn't change the fact that we've still seen a fairly positive start to the year. But before I start looking at the week ahead, let's first and foremost get a little bit of the housekeeping rules out of the way, a risk warning. Anything that I talk about today shouldn't be taken or shouldn't be construed as direct trading advice. What I'm going to be doing is highlighting key levels, potentially directional indicators in terms of what I think might happen. Certainly not what I think will happen because I'm probably as right as often as I'm wrong. Talk about managing risk and trying to mitigate any losses and try to maximise any profits using various trading rules that I generally tend to work fairly well over the course of the past. 20 to 25 years in my time trying to analyse the vagaries of financial market. So basically just getting these risk warnings out of the way. If you do have any questions, please feel free to direct them or reply to this message that I've just sent out over the chat facility. More than happy to answer any questions with respect to what I think an ASSEC class might do, not what I think that it will do, because there are no certainties when it comes to financial markets. But I think what I will be certainly looking at this week is the potential for a move higher or lower in the dollar, because it's going to be a big week for the dollar. And I think the direction of the dollar is likely to dictate where markets go to next. What I certainly have seen is despite the fact that we've seen very strong movements higher in stock markets, the German DAX is approaching a very key resistance level from the previous peaks in 2015. We can see that here on this daily chart. And there is also some evidence that US markets are starting to look, how shall I say it, a little bit tired. We've obviously seen some decent gains over the course of the past few weeks and months on the back of the Trump rally. But what I have noticed is that Mr. Trump isn't having it all his own way. And I think an awful lot of the rally that we've seen over the course of the past few weeks has been predicated on the fact that he probably would. That doesn't now appear to be the case. And I think the things that I'm looking at this week really I think is the Trump reflation trade starting to wear off, certainly in the context of bond markets it does appear to be some evidence that bond prices do appear to be bottoming out and yields appear to be starting to tail off. The inflation picture is looking a little bit mixed now. There is some evidence that the upward price pressure that we've been seeing in terms of prices on the CPI measure is starting to level off a little bit We certainly saw it in those CPI numbers out of the European Union on Friday when we saw a big decline on headline CPI from 2% in February to 1.5% in March. And that's taken a little bit of the sting, I think, out of the euro. It's taken a little bit of the wind out of the euro sales. And I think that has helped also push the DAX higher. But before we get to bullish on the DAX, we do have to look at where the DAX is in relation to where it was in 2015. It's all-time highs there. Also corresponds, these all-time highs in the DAX also corresponded with the lows that we saw in the euro at around about 103.50. So 103.50, 104 coincides with all-time highs on DAX. Now, the euro is looking a little bit weak, but the big question is how much more downside is there in the euro? We've run out. We're starting to run up against resistance around about that 12,390 level. So we do have to be a little bit careful about potentially taking on new long positions on the DAX when you're pushing up against significant all-time highs. So that could, in the short term, limit the downside in euro-dollar, limit the upside in the German DAX. So we do need to be very, very aware of that correlation between the two. If we look at the euro-dollar, we can see a similar sort of scenario playing out. Look at where the all-time, not quite the all-time lows, but the previous lows on the DAX in 2015 coincided with the all-time highs on the DAX. Now, we are slightly below that, and have been slightly below that, at the end of 2016, when we went as low as 103.50. But nonetheless, we've rebounded quite strongly off that. Now, on a weekly chart, we've seen a very strong bearish weekly reversal. But that doesn't necessarily mean that we're going to push strongly lower, because we saw a similar sort of bearish reversal here back at the end of January, and we only saw a modest move lower. So you also need to factor in the context of the move higher. We've seen a rebound off those lows at 103.50. We saw a modest weekly reversal, which took us lower for two or three weeks in a row before we rebounded again. We are at a very, what I would call, an indecisive moment in the context of the euro-dollar. And ultimately, we've only seen three, four positive weeks in a row. We've seen very one strong negative week. But ultimately, what we're seeing here is what I would argue is a potential sideways consolidation within a triangular formation. We do have a trend line coming in from the lows that we saw at the beginning of the year, and that comes in around about 105.80. So I think while we're below this 50-day moving average here and this resistance at around about 107.20, then I think the downside in euro-dollar is likely to be limited to around about 105.80 in the short to medium term. That's really as short or long term as you can make it. If we look at the four hour chart, again, we can see a very strong thrust lower. We are trading around about the lows that we've seen in the past few weeks. But again, we are looking oversold on the four hour chart. Downside is likely to be limited to around about 105.80. Dollar upside is also likely to be fairly limited by the way that the dollar index is trading as well. For me, the price is all important here. And the price is suggesting that there is euro weakness, but I don't think it's going to drop sharply. We can see that borne out by this dollar index chart here. So this is the dollar index. We've got solid support around about 99.00. These series of lows through here, we did have a brief thrust lower there, but we did get a fairly decently bullish turnaround at the beginning of last week. We pushed higher. We're starting to push against the highs of the week. We could potentially push a little bit higher, but we're then pushing against this trend line resistance from the peaks that we saw at the beginning of this year. And this sort of coincides with those lows that we saw in euro dollar. We have to bear in mind that in terms of the dollar index, euro dollar makes up around about 57, 58% of that. So if you're looking at the dollar index, you're also looking at almost a mirror-like comparison with respect to euro dollar. So keep an eye on that trend line resistance there. It sort of coincides with trend line support in euro dollar at around about 105, 80. So there's a decent correlation there. These charts aren't telling me that the euro is going to collapse anytime soon or the dollar is going to surge. So that therefore brings me into the context of what the UK 100 or the FTSE 100 is looking to do. And that gives us a slightly altogether different picture. But once again, it also tells us that ultimately, it's looking a little bit toppy above 7,400, but it's also looking well supported around about 72, 50. And that sort of then presupposes that ultimately we're likely to remain within a broad range for the pound against the dollar. Having said that, I still think there's potentially more upside in sterling dollar than there is in euro dollar. And the reasoning behind that is because the cable chart is looking slightly more impulsive in terms of a potential breakout up or down. Now, what do I mean by that? Well, if we look at the continuation pattern or cart back to the continuation pattern in euro dollar, it's not as conclusive as say, for example, the continuation pattern that we've got here in the cable chart. Now, let's just put to one side all of these other lines, moving averages and what have you here. Let's look at this top line here from the December highs and link those highs through here and also look at the lows from the beginning of the year. Now, this is potentially a triangular consolidation. Now, ultimately triangular consolidations tend to be trend supportive. That doesn't necessarily mean that they will break out in the direction of the prior trend. The prior trend at the moment is down. We can see that quite clearly from the move down from the June highs to the lows that we saw in July, August, back to the levels that we saw here. But ultimately what we're seeing here is there's a decision process going on here with respect to the pound against the dollar. The decision making process is likely to be dictated by the interest rate convergence or divergence that we're seeing with respect to the pound against the dollar. Now, for this, I'm talking my book a little bit. I think the pound is likely to break higher, not lower. Why? Why? Simply because I think the pound is very much predicated on a one-way bet. We're getting an awful lot of predictions that the pound's going to be around 110, 106 by the end of the year. It's very, very difficult to find anyone who thinks that it's going to go up. And that, for one, makes me very, very cautious about being overly short of it. If you're going to be short of it, obviously it's sensible to be short of it near the top end of the recent range. The top end of that recent range is between 126.5 and 127. So if you get a breakthrough 127, you stop loss really needs to be at 127.5 or 128. But look at the interest rate differentials for the pound against the dollar between US and UK rates. If we blow that out to maximum, the pound against the dollar has never been in terms of interest rate differentials this wide. It's never been this wide since date goes back to 1985, 1986. That, to me, suggests that it's very, very stretched. 1.27 basis points. And that sort of begs the question as to whether or not it can get any wider, which then feeds into the debate as to whether or not the Fed can afford to hike rates any further than it already has. We've already seen two rate hikes in the space of three months. Can we see a third? Can we see a fourth? Ultimately, it also then begs the question, what does that mean for Bank of England interest rate policy going forward? Now, at the moment, the market's pricing in the likelihood that, obviously, UK rates are at 0.25%. US rates are around about 1%. So you've got an interest rate differential. It's an upper band of 1%. The interest rate differential there is, therefore, 75 basis points. The market's pricing in 1.27%. So I would argue that the market is already pricing in at least another two Fed rate rises between now and the end of the year, certainly in the context of the 10-year yield. Is that viable? It really depends on whether or not you buy into the Fed or the Trump reflation trade. Now, let's focus on the fact that the Trump reflation trade is predicated on a significant tax reform, significant structural investment, structural reform, and also a health care reform, none of which have happened yet and all of which continue to appear problematic. So how much of the reflation trade needs to be priced back out and how much is already priced in? And that's always a very difficult line to try and... That's always a difficult accommodation to make. But certainly in the context of this chart here, we have got solid resistance at the 200-day moving average, which would appear to suggest that there's big resistance around about 1.2630, 1.2640. Good support around about 1.2380, 1.2390. Therefore, that is your range. Until such times as we break through 1.27, get above the 200-day moving average and break above or break out of this triangular consolidation. If we break out of this triangular consolidation, then your potential target is 1.28, 1.30 over the course of the next few trading sessions. But until such times as we break out of that triangular consolidation, then the range trade is the sensible trade to make. At the moment, the likelihood is we're going to trade 1.2390, 1.26 with a bias to continue that. Until such times we break and close above, close above the 200-day moving average. At the moment, the 50 and the 100-day are trading sideways or looking a little bit flat. So there's very little viability in that. For me, these are the two key levels here on the top side. If we break through them, we're going to have an explosive move towards 1.30 and potentially even higher. Why? Because everyone is positioned to be short of sterling. So that is the risky side of the trade at the moment. There's also another factor feeding into my slightly more positive sterling story, and that's euro sterling. We are still showing a significant reluctance to push higher on euro sterling. The ECB, the European Central Bank, is tapering its bond purchase programme from 80 billion euros a month to 60. So there's been an awful lot of speculation that we could get an increased taper as we head into year-end. Those recent soft inflation numbers that we saw at the end of last week, particularly from Germany and the EU, suggest that it's probably not likely, despite the fact that we saw very strong PMI numbers out this morning, and Germany in particular, 58.3, but we also saw some fairly strong numbers from Italy as well as France. Spain was slightly soft, but nonetheless, the weaker than expected inflation numbers mean that it's likely that the debate about an increased taper is likely to lose a little bit of impetus in the short to medium term. So at the moment for euro sterling, we're gaining a little bit of resistance at around about 85.30, 85.50. That's what I've put in my morning note. That's this resistance level here. You can see that in the chart forum right here. So I try and update these once a day. Euro sterling, sterling dollar, dollar yen, and euro dollar. So we've pushed below 85.50. We're looking for a retest of the lows around about 84, but before we get there, we've got this trend line support coming in at around about 84.50 here. But overall, looking at how euro sterling has behaved over the course of the past month or so, the bias remains towards the downside, resistance at 84.50, and then further resistance here at 86.05, 86.10. This is all about levels. This is all about highs and lows. It's no more sophisticated than that. And ultimately, we have found support around about 84.80. If we need to really get back above this 86 level to diminish the downside pressure that we've seen over the course of the past few trading sessions, and that's borne out by the charts that I've put in there. Also ties in with dollar yen. Slightly weaker dollar index, but we've also found that dollar yen continues to find the error a little bit thin above 112. And again, it's a similar sort of story here. It's about levels. At the moment, we're in a little bit of what I would call a congestion zone. Need to get back through 111.60 to retest this 112.40 area here. But overall, there remains solid support just above 110. So I still am of the opinion that we could retest 110, but for that to unfold, we need to stay below 112.40. So the bias for me on dollar yen still remains to sell into rallies and then chop them out if we go much above 112.50. That is the bias for me. I'm still of the opinion that dollar strength will continue to diminish over the course of the next few trading sessions. And a lot of that will depend obviously on this week's US data. Now, last week we saw US consumer confidence come out at the strongest level since 2017 year high. What is surprising about that is that it's not really been reflected in personal spending or retail sales.  And for me, retail sales are probably more important than consumer confidence. You can ask as many people as you like how confident they feel about the future with respect to their the outlook for their finances. But ultimately, it's whether or not they spend that money. And for me, hard data is better than confidence surveys or anything like that. To my mind, confidence surveys are like reading tea leaves. They're not that reliable. I prefer to look at the hard data and the hard data tells me that we've seen a little bit of a rebound here but ultimately for me we need to see a significant rebound through 112.5. Dollar strength, the data needs to support the confidence and at the moment they're diverging. The USISM manufacturing later today at 3pm, that should point to a continued resilience in the manufacturing sector. But in the Chicago PMI that we saw on Friday, we saw a very weak employment component. So I'll be particularly interested in the employment components of not only the USISM manufacturing number that's due out today but also the non-manufacturing number that's due out on Wednesday. Because that should give us a decent steer as to how strong Friday payroll numbers will be. And if we have a strong payrolls number that will obviously feed into a narrative of potentially a June Fed rate rise. Now, some of the heat has come out of that debate in the context of some comments made by William Dudley of the New York Fed on Friday. And there are a number of Fed policy makers who aren't comfortable with a very steep trajectory of US Fed rate rises on the basis of the fact that ultimately they don't want to see a significant divergence of monetary policy at a time when the strong dollar could act as a headwind for US growth. It's about managing expectations. And on Wednesday, we get the latest Fed minutes. And I think one of the surprises of the March Fed rate rise was the fact that it left its inflation forecasts and its growth forecasts unchanged. So they hiked rates but they remained fairly sanguine about the trajectory for US GDP growth and US inflation growth. And I think the Fed minutes will give us an indication as to whether or not there was consensus on that guidance with respect to the DOT plots and the inflation forecasts or whether or not the Fed is concerned that the inflation forecasts may be a little bit weaker than they are anticipating. And they thought they'd get the Fed rate rise out of the way and then hold a waiting brief until the autumn and potentially hike rates again in September. I think we'll get another Fed rate rise this year. I'm just not convinced that we'll get another two. So that will mean that for me I think means that this week's payroll numbers are going to be very key. I think they're going to come in weaker at around about 175, 176. We'll get a clue on that on Wednesday with the ADP payrolls numbers which come out at 115. But the big question is will wage growth continue to pick up? Because for me that still remains a little bit on the weaker side but if we get a weaker than expected payrolls number and a pickup in wage growth I think that will be more important than the actual payrolls number itself. So looking at the Fed minutes on Wednesday but also looking at the wage growth numbers on payrolls on Friday and see whether or not there's a significant pickup in wage growth over and above the general minimum wage increases that we tend to see at the beginning of the year which tend to skew the numbers. And I think that's the key here. At the beginning of the year you tend to get a pickup in wage growth because minimum wage increases tend to pick up. They tend to skew the numbers upwards but they need to be sustained. And at the moment I'm not convinced of that and you can certainly see that in the context of what US 10 year treasury prices are doing. If we look at the prices of this chart here we can see that these are the bottom for yields. Prices move inversely to yields higher prices lower yields we still remain below the lows for 2017 in terms of yields. So we remain in a little bit of a sweet spot where yields are concerned inflation expectations are probably softening a little bit which means that the prospect of higher prices in the short term is not going to be as dollar supportive as say for example it was in December and in March. And now this is when the Fed hiked rates here and here since the Fed hiked rates on both occasions yields softened. So the likelihood is it's going to continue to play out. So don't just naturally assume that because the market thinks the Fed is going to hiked rates that yields are going to soften. That's certainly not been the case or the yields are going to go up get my narrative the right way around. Every time the Fed hiked rates yields have come off. This is the peak in yields here and here on both occasions yields have softened. So I expect that to continue. Which means the dollar index is likely to continue to trade sideways and that could in turn push the euro or underpin the euro and help push this the pound higher against the dollar. So we've looked at Euro dollar. Euro dollar resistance is around about 107.20. That is really a key level for me going higher. We've already talked about the pound against the dollar. It's been up for three weeks in a row for three weekly closes in a row. That's its best run, incidentally for quite some time. If we look at how the pound has performed over the course of the past few trading sessions the last time it closed higher three weeks in a row was probably all the way back at the beginning of 2016 here and then in August and then it went for a run to the downside. So going to be keeping an eye on whether or not we can actually close higher for a fourth week in a row. The other thing that's making me cautious about the dollar is what gold prices are doing. Gold prices generally tend to come off quite significantly if there's any significant chance that the dollar is going to sell off and we are finding significant resistance at the moment on gold 200 day moving average 1260 but we're not coming crashing off and that suggests to me that ultimately the market is suspicious that the current rebound in the dollar doesn't appear to have any significant legs. Gold prices aren't coming crashing off. Having said that they're finding resistance around about 1250, 1260. The downside I think in any gold sell off is likely to come in at this level around here 1220. In the short term, let's look at this on a four hour chart to see whether or not we've got any clues through here. And we can see there's a little bit of support coming in around about 1240. Let's extend that back through there. So you've got 1240 support, 1239 on a short term basis we are finding that the lows are getting a little bit lower through there. So if gold drops below<PHONE_NUMBER>75 then we could well get a little run to the downside to around about 1230. Just looking at that nice little consolidation through there. So overall on a long term basis I'm bullish on gold but that doesn't mean that we can't drift down through 1239 towards 1220 in the short term before then going back up again. So it's all about perspectives. Your long term perspective and your short term perspective. So short term potentially bearish for a move to 1240 and even 1220. But long term we take the long term chart through here we can see that the longer term uptrend for gold prices still remains intact in a fairly similar fashion as it does for say for example Eurodollar and the pound against the dollar. So we can see that we can come to two different conclusions depending on the time frame for a particular asset class. Let's have a quick look at the Aussie Dollar because that's come under quite considerable pressure over the course of the past few trading sessions. Last week I talked about this bearish and gulfing week. Since then we have come lower rebounded and are now looking to potentially come back to 75.  Yes that does mean that that certainly does sort of fly in the face of some of the recent dates that we've seen but the Aussie does look a little bit on the soft side. We've had three successive down days. Let's look at the weekly chart here. But again we're in a range. Currencies at the moment are fairly benign but ultimately I expect the view of the Australian Dollar economy to show a little bit of a softening. That's borne out by slightly weaker commodity prices as well the copper prices that we talked about last week. They've continued to remain a little bit under pressure from last week. That's likely to weigh on the Australian economy and the fact that the data that we saw out of Australia overnight was slightly on the weaker side and that's likely to keep the RBA on a fairly dovish outlook going forward and that's likely to weigh on the Aussie as well. Looking on the support basis for the Aussie Dollar this low here around about 75.80 on a short term basis bring us back down to these March lows back here at around about 74.90 in the short to medium term. Going to finish up with crude oil have a quick look at that and I talked about this a little bit last week this area around about 53 but also the 50 day moving average could well cap any further advances. We did see a nice little rally last week on Tuesday Wednesday Thursday Friday at the moment we are below the peaks of last week but also this peak here so you're looking around about 53.50 now we've heard an awful lot from OPEC members about the potential for extending the output freeze beyond June they'll probably continue to talk that up but US rig counts continue to rise so for me I think we're still in a range the bottom of that range is around about $50 a barrel on Brent and the mid range is around about 54.55 and then above that 57 but if we look at WTI we can see that here we're running into resistance at around about 50.50 $51 a barrel so keep an eye out for the correlations between the two there is a little bit of probably further upward momentum there but keep an eye on the 50 day moving average because I think the 50 day moving average are not only Brent but WTI could act as a little bit of a break on any rebound higher before we drift back down again so that's crude oil looking a little bit toppy at current levels could go a little bit higher but ultimately I don't expect it to go much above $51 a barrel for WTI okay so also you've got to bear in mind with respect to the Trump trade that Donald Trump will be meeting the Chinese premier Xi Jinping later this week at his Mar-a-Lago resort in Florida and he's already indicated that those talks could be difficult in inverted commas so any prospect of that meeting may be more adversarial than it need be could well actually impact on risk assets and cause a little bit of a downward move in US indices and I'm going to finish up by looking at the S&P 500 looking at the daily chart here had a nice little rebound off the 50 day moving average had a little bit of a reversal on Friday but ultimately looking at $23.70 on the upside on the S&P keep an eye out on that level as a key resistance level there if we break through there then we'll be looking at potentially a move to $23.80 finding a bit of resistance there but ultimately I expect $23.50 $23.80 on the wide of the S&P in the short to medium term as we head in as we look towards non-farm payrolls on Friday now if you want to listen into non-farm payrolls on Friday please feel free to sign up right here it's a non-farm payrolls live coverage registration page you can find that on learn webinars and events and then click on non-farm payrolls there Colin and myself will be covering the data release live $1.15 on Friday look forward to all there otherwise thanks very much for listening I'll be posting this on YouTube later this afternoon so if you have any questions I'll speak to you all on Friday and hopefully you can join me and Colin on Friday for non-farm payrolls thanks very much for listening guys and speak to you all on Friday thanks a lot


Apple Action Wireless has some of the best data rates in wireless on our plans and not to mention an amazing deal on one of our hottest smartphones, but that's all the time I have to explain. See store for details, better service, bigger savings. That's today's Apple Action Wireless. Congratulations are due to Johnson Central's Jordan Blanton for winning the 2017 Dr. Rudy J. Ellis Sports Medicine Center male athlete of the year. Over the course of his years as a Golden Eagle, Blanton has stood out across many platforms. Just to name a few accolades, he was the Class 4A Player of the Year in 2016 for helping lead his team to their first-ever state football title. A Mr. Football Finalist, a two-time state wrestling champion and helped lead the Eagles to the Elite Eight in last season's state baseball tournament. Jordan is currently committed to play baseball at Marshall University and will receive his award at this year's Kentucky Athletic Hall of Fame Induction Ceremony on Thursday June 1st in Louisville.


Everybody forced here ripping 22 23 Donors optic basketball Hobby six box half case number two pick your team got Benjamin W. Bulls Bogey of B with the Pelicans Chen K calves Christopher J Hawks heat and wizards Chun Wei Mavericks Danny C warriors how he bucks T wolves Raptors Jeff M with the Hornets Rockets and Lakers and nets. Oh and clippers and six or sorry Jeff Yeah, all those teams Jeffery H with the thunder John with the Pacers Kai H pistons Kevin T Grizzlies and sons Marcy has the Knicks Marvin and Nuggets Peter G magic Robert P Blazers Ryan s jazz Sean M. Kings Vaughn B Celtics and Victor F with the Spurs. Let's do it Let's do it Yep, three to go in the next one link is in chat you guys All right, so what's the hit of the day so far my bomb of green? I Should I should have taken picture that one? I should have so on rated rookie for the Spurs or the die again here So it's just for all the all-stars if there's a gold or lower will random instead I have a one two three left four five six right for the whole break here It is a two these are gonna go left Left on the all-stars Start off with a chat home gran rated rookie auto hollow Thunder how are hot today? Jeffrey H again. Congrats Jeffrey. There we go clean signature to go. There we go That's how it's done Jeff Jeffrey's killing it right now Keegan Murray and a Zion orange to 199 for the pelicans Definitely a fast start. This is exactly how the other break started out there. We started off hot with a big chat Hollow rated rookie D a bot take Clippers Jane Ivy rated rookie Stefan Trey Hollow the rookies chat home gran thunder tie tie rated rookie Hollow go bear tea wolves Matherin rated rookie for the Pacers with basketball parallel Bogdanovich pistons. I Yeah, I said I said that when we started off you didn't hear it. It's I mean, I'm exactly with you hollow eight and sons I am with you. There's a Jovich base lime green Bertans to 149 for the Mavericks the rookies Keegan Murray Kings Lofton Houston basketball Alec Burke's pistons Two pistons basketball parallels now hollow lights out hardened sixers.  No at all one of 99 Celtics Tatum stargazing red But the size he was that day Hollow Cameron Johnson nets You got Joe the conspiracy theories over here Cameron Johnson nets. Oh nice. So yeah, that trade is all accounted for because um Bridges as well would be a net in this and then obviously we saw Katie as a son earlier So I think all the trades would be accounted for in this So as rosters are right now, so we should see what we should see cards. I mean except have that as a magic, but The trades are accounted for That is a magic. Oh man Hollow lights out Luca Donchich for the Mavericks We'll buy that card and then bust it out in like 20 years. It's a 99 Clint Capella dominators audit for the Hawks people were like, what is that? Is that like it? Is that a custom card? Like what is that? No, I'm back polled, baby think velocity to 79 of Coro calves That was what Kateria Tony did though He was like, I'm hurt. I'm hurt. He's the chiefs. I am ready to play hollow red rookie Trevor Kiehl's with the Knicks And he's a very good player Matthew red rookie Pacers a few days before releases when flawless will go up to the site hollow DeRose and bulls Sohan spurs rated rookie line green Simons blazers to 149. So if Lillard leaves there that that team is basically Simons and sharps true green Whoo calves true green is it calves? I peaked that Nice Donovan Mitchell That's sick Definitely one of his nicer calves cards two of five Donovan Mitchell Cleveland with a sick card here for sure First year as a cab chin congrats chin That's going into a mag definitely one of his nicer Cavs cards ready to Ricky Keegan Murray so far hollow stargazing Lakers is a LeBron James Hollow John Collins Hawks Radio orange Baldwin jr. Rated rookie for the Warriors that one's out of 199 Kiehl's Hollow dominators yokich for the nuggets The NL central standings are so funny right now Pirates first Brewer's second Cardinals last is the one that's like Palo Banda Cara ready to the magic basketball ready to Ricky Diabato Clippers Mr. McNabb you think they're related by first name Donovan Mitchell Donna egg nav Hollow Julius Randall nicks. I'll ask Donnie Donnie would know he must know everything about Donovan McNabb He's wearing a McNabb jersey every now and then party rated rookie Mavericks the rookies chat home green again They are they are a mess which is crazy because their talent is not bad orange cat T wolves to 199 got hollow canard Grizzlies, I did not expect canard Grizzlies, even though I knew that was a thing Riches here guys Optic it looks awesome. Yeah, we had we pulled a Pulled a green mo bomb on the Lakers in the first place Your boy on the Lakers You got nem hard It sucks got lights out hollow a yokich the nuggets, but we didn't pull a pink velocity chat in the first break now sweet an auto here To 99 Sean Kemp. This one's nice silver jet auto clean signature to Sean Kemp Sonics auto here the Don Russ throwback set on card. Yep. It's just a weird like space They made for it rather than like a fade in you I mean That's interesting Sean Kemp go into the thunder thunder or kill it at all all morning so far first case and both breaks belongs to the rich Who all right Dean Dean's gonna get timed out got chat home green rated rookie Red lavert calves. That's out of 99. What's up guys? Westbrook hollow Christian Brown nuggets rated rookie And this design specifically looks so much better than I did on like just regular Don Russ It's a j-dub, right? I like the look of the base rated rookies Hollows a deep Bay Hawks No, it's good Walker Kessler rated rookie jazz lime green Trayman thunder again thunder just continuing to have Parallels and autos and all sorts of stuff to 149 there. Yeah. Well, I mean just said I mean Rated rookie autos have always been on card For like basketball. That's that's one of the things to bars mid-junior rated rookie Rockets With only one a box you're theoretically have less of them. So hollow star gazing. You'll get your nuggets Hollows a bonus Kings like prisms outside of one year has always been sticker Or at least for the last like 10 years or so Walker basketball rated rookie but not T wolves Basketball Basketball Paulo Yeah, and then you'll see you'll still see rookie sticker autos, but I like the inserts Rating threes hollow Mitchell for the Cavs Stop tie photon coming up is Josh Minot T. What was rated rookie a basketball and a photon of Josh Minot Hollows Simons Blazers. So the so the photons are for sure more common than they used to be That is like the fourth of the case. We still have three boxes left David Roddy Orange pj Tucker sixers out of 199 Somehow that guy is always on like a contending team Hollow Deandre Hunter Hawks He's like that guy you get for the playoffs. I just like unnoise the other teams like Star wing that he's guarding Grows him off their game classic It's like the Lance Stevens and blown in LeBron's ear Did it with the bucks did it with the heat I was doing with the sixers Nets Cavs Clips guys, I cannot type right now Yeah, should be all right bosses in the building guys everybody x straight got blue diablo pistons out of 49 hollow stargazing pistons Kate Cunningham Yeah, I'll do that and then any any raider if you like number That's what we just system and any pat bebs. I guess I'm just giving hollow basely for the Suns Pat that bass in the recap PC guy out there Benedict Mather and a rookie blue Conley for the T Wolves. Hey, there's a PC. I think we're just about every player 49 Mike Conley T Wolves I'm sure that I'm sure they do. They're hardcore enough. They got to know Jane Ivy Vaughan new so a raider rookie Ivy pistons Rating threes hollow Luka lime green nerk itch blazers to 149 Nets Cavs Clippers got hollow auto Porto, Jr. Raptors. Hello, Porto, Jr. Holla, Holla Raider rookie Jalen Williams as J. Will Mahalo Hollow herder Kings Jane Hardy with an orange derosin a one out of nine Chicago. Come on now Vince Williams The Dodgers are good again. I see surprise surprise Hollow raider rookie Jaden Hardy Mavericks nice card Hollow Jason Preston Clippers Sohan base Yolk itch Benedict Mather and Pacers on the raider rookie base auto Here we go Pacers Nice card Keegan Murray and a D'Angelo Russell red to 199 for the Lakers D'Angelo Russell Lakers again Just like back in the day Lakers one of those teams I got guys all over the place of products this year But hey, they made the good they made good trades they got a lot better after those trades Just started letting the white Mamba go to work They're like a 12 seed for like 12 and 11 seed they're like, oh well they make it even the play in Dominators Luka hollow for the Mavericks They're like the heat though like you just got to get there and Figure figure it out. Yeah dominators Evan Mobley audits a 99 Cavs You'll Cavs Evan Mobley Well, if you get a if you get an auto with the Cavs in this it's it is a Mobley That that I that I can guarantee you All right, Davis black velocity norm Powell Clippers to 39 Hollow raider rookie Laravia for the Grizzlies He's the one that puts all the descriptions in the cards and stuff, right? Christie got red star gazing Yanis for the bucks the 99. I think Laravia is the guy that inscribes the All the cards because he's a collector Yes, I'm like that hollow trey young hawks on something like the like the bigger cards Hollow James Weisman as a piston Collins with a dylan terry lime green raider rookie out of 149 bulls Christian Brown hollow spurs again, David Robinson, Tim Duncan Patrick Baldwin got Bradley Beal to 199 orange for the for the wizards Rip any more Disney recently? No, I've been wanting to though. How much of the boxes now? 74 170 that's not Horrid that's not horrific. That's not like really really bad As far as like a decent gaming box No, yeah, honestly, it's fun break. So it's well well worked for an increase hollow blazers a little lovely get over there one day My wife would love to rip some of that for sure I'm trying to convince my girlfriend to do the same pink velocity hero to 79 for the heat Yeah, because we liked our pokemon. We haven't known a while. We haven't been to the gaming shop together yet So it's like you gotta get over there hollow davis lakers, but I live in winter garden. So it's like It's like half an hour or so, but like on the weekends. It's just a not fun time to drive that far Hollow sex and jazz It'd be good to go with like one night Yeah, something like that Dyson Daniels rated rookie Right Got a christian wood lime green to 149 for the mavericks and onto the last box All right, so we haven't seen a gold. We haven't seen a gold vinyl. Those are the only parallels we haven't seen though We also need to pull the rated rookie auto black pandora because those are new this year It's only the autos that will have black pandora We're only the rated rookie autos. So hopefully we pull one. Those will probably do really really well The first time in basketball. Oh shag bhaji rated rookie jazz hollow dominators sixers and bead.  Nuggets auto kenyon martin The og kenyon martin. Was there any arguable? That's what i'm saying like Was there anyone that really stood out the way he played the last like Five six weeks of the season just he separated himself. So yeah basketball dfs nets hollow ryan rollins rated rookie for the warriors bow champion rated rookie a blue raining threes tray young hawks out of 49 ice tray hollow padbev magic hollow jared allen calves I wonder if padbev magic cards are a good investment Rated rookie red tarry eason sweet color match. That's out of 99 rockets. Go rockets. Nice card like wesley Hollow, uh, what do you left here? Yannis on that one? On the all stars around there orange all the depot of 199 for the heat We got sam later on with random styles of optic everybody the rookies keegan murray That's right Random styles later on Rating threes hollow jordan pool warriors That's what i'm that's what i'm saying. That's what i'm saying I'm gonna have to get at least a couple of the padbev magic cards malakai random rated rookie spurs Red coal anthony magic Out of 99 you know those memes. I'm gonna tell i'm gonna tell my grandkids. This was whatever That's gonna be me and lily. Oh, yeah, pad pad Patrick Beverly is the best magic player of all time hollow kaminga warriors hollow forney nicks Shade on sharp rated rookie for the blazers Definitely cooled off on this one in the second half of the half case What still a pretty solid rake overall Hit all the big cards up front during rated rookie basketball anthony davis lakers We'll do it's really quick recap here So we did anything under night and anything to 99 or less all rookie color autos and then anything back of course So i got the rookies here got a red tarry eason orange patrick baldwin a hollow hearty is a nice one and then anything under 100 Red coal anthony blue trey young pink velocity tyler hero red yannis white velocity norm powell red russle Blue mike connelly and hamadou d yellow the red lavertz pink velocity okoro Red star gazing tatum dug mcdermott's autos of kenin martin for the nuggets evan moblie cavaliers benendict mather and rated rookie pacers a shun kent that's gonna go to the thunder on the throwback design auto there for the uh The sonics to 99 and a clean capella as well for the hawks Thunder green of five dynamite real cabs And rated rookie auto hollow as chet holmgren and grads thunder that's gonna do it on to number three


So, let me go to another solution that we came up for this problem that good documents are missing, that solution is called textbook companion or TBC in short. So, let us see more about it. Students are good in coding, but not documenting, but India has about 10 lakh engineering students every year. Can we use these students to create documents? We need documents, we are short of documents, unfortunately students do not like documentation even if they are good in coding. So, how do we solve this problem? We have lots of students who can do coding, but we want documentation. So, we decided to address this by solving the inverse problem. What is the inverse problem? Ask the students to write code for existing documents. For students, of course, textbooks are the best documents. So, we said ask them to write Sylab code for solved examples of standard textbooks. Notice this solved examples, we are not talking about unsolved problems. Solved examples, good textbooks give every step, step by step explanation and solution. One can implement it in Sylab and verify the Sylab code line by line and any good student should be able to contribute. So, this is how we started. If they do it for all solved examples of a book, you get one textbook companion and we pay rupees, 12,000 rupees for one textbook companion. As Honduriam, we also give certificate, we also give a link for it. As a matter of fact, there is one student from IIT Madras. He wrote to us saying that thanks to this textbook companion, he got an internship in a Japanese company. So, he was very happy about it. So, the funding for this comes from the funds, the grant that we received from the National Mission on Education through ICT, M.H.R.D., which has been very generous in supporting this activity. So, I would like to invite all students to benefit by this, to contribute to this and also to use this. How does one use it? I am going to explain it shortly. 1000 college students and faculty contributed. These students came from all over India, all parts of India, 600 textbooks were covered and 70,000 examples were coded. If you assume that there are 100 examples in a textbook, then there will be 60,000. Some textbooks have actually more than 100 examples. So, we have 70,000 examples coded. You can download these textbook companions for offline use. So, let me click this. So, this is sylab.in on the left hand side. So, this is the website that we have created and we support at IIT Bombay. By the way, the software sylab is not created by us. Sylab is, in fact, we have given a disclaimer also that it is, of course, we have said that it is a trademark of Inria and sylab enterprises and it has been now bought over by a company. And I will show the link for that here, but let us come here, let us come back to this page and let us go to textbook companion project and you have something called completed books. When we click this, you can see that there are 594 books that have been completed. So, it has, if I just scroll down, you will see that there are indeed 594 books. Here it is. It is possible to get books according to specialization. So, let me do that. Instead of choosing all categories, let me choose electrical engineering, for example. And in that, let me choose, there are more here. Signal processing. Now, if you go through this, you see that in signal processing alone, there are 17 books. So, this is a very popular book, Prokis and Vanillakis, DSP. So, let me click this and it says that download codes. Notice that we are not giving a book, we are only giving sylab code. To understand that code, you need the book. As a result, this is a true textbook companion. It only gives the sylab code, it does not give the book. We cannot copy the book and distribute. That will be a violation of copyright. We do not do such illegal things. So, here if you click this, you can download the entire sylab code. If you click here, you can get the PDF. Let us click this and see what it has. So, it is downloaded here. So, here you are. This is created by Professor Senthil Kumar from IRTT in E-Route. He is a college teacher and let us go down. So, it has all the examples by chapter. You also have it in terms of example number. So, for example, if you want to say exponential decreasing signal, example 2.1.09, let me click this. There it is. Example 2.1.09. So, you can reach this directly and notice that it has code after code after code which is not given in the book. What is given in the book is not reproduced here. As a result, there is no copyright violation at all. As a matter of fact, it is the other way around. We are helping authors of books by giving sylab code. There may be authors who may not have given any code with their book, but we have given sylab code and we have given it for 600, close to 600 books, in fact, 594 as of now and there are some more books in pipeline. Those are undergoing reviews, revision and so on and so forth. Let me just see. We have anything else here? We can download the code for an entire book or a chapter. Let me show you. So, here I showed how to download a PDF version. Let me close this. We are back in the download course that we saw earlier. So, instead of download PDF, if you download here, you will get all the sylab code as a zip file. Instead, you can say that let us open discrete time signals and systems. Chapter 2, let us choose an example. Let us say exponential increasing, decreasing signal. Here is the code. So, I do not have to download the entire book. I have I can choose a chapter. If I click here and download, I will get the zip file for that chapter only. Instead, I can say that I do not want it for the whole chapter. There are too many things. I get confused. I want sylab code for only one example. So, I have selected this. So, let me click this, let me show in finder. I ran it. You see the output. So, it is possible to do that. Let me close this. So, as I told you earlier, you can download the code for an entire book or a chapter or an example. So, which is very useful because you can just go to the example that you like, download only that code, run it and test it.  So, here is the link. Let me click this. So, let me demonstrate it. Let me choose once again electrical engineering. I will choose control systems. I will choose VCCO, frequency domain analysis. See how it is organized. First, the main category, then subcategory in that what is the name of the book and what is the chapter and what is the example. So, let me select that example. I want to choose body plot. The moment I select it, I get the code here. So, this is written by some student, one of your friends from across the country. So, let us execute this. So, it gives the body plot. You can download it if you want. Let us close it and here is the result. Let me zoom it a little bit. You can actually see that. Now, I am going to ask you a quiz. Suppose I increase the gain of this transfer function, let us go to 5000, that is right. You can actually edit this page. So, I have changed this from 2500 to 5000. Now, if I do that, what will happen to gain margin and face margin? I want you to note down. Gain margin is 14, face margin is 31. If I increase the gain, what will happen for this system? Let us go ahead. So, this goes to Garuda Cloud, which is hosted in Bangalore by CDAC. Let me close this. Yes, if you guessed it correct, the margins will come down, 14 has become 8 and 31 has become 17. So, it is possible for you to try out all the 70,000 examples on the cloud. So, how do we use this TBC as a documentation? What do I mean by that? Supposing you want to know how to use Sylab for fast Fourier transform, because you have it in your course. So, open the textbook and there must be an example that shows how to solve fast Fourier transform, how to implement fast Fourier transform. So, that example is given. You go to the textbook companion in Sylab. As 600 books are covered, most likely your textbook also is covered. You go to that chapter, that particular example and open the Sylab code. It tells you how fast Fourier transform is done. What do we do? If your book is not covered, you propose. You propose that you ask a smart classmate in your class to do this for you and that person can create a textbook companion on that book and the problem is solved. It can be used as a documentation as I mentioned. It can be used for what-if studies, like I mentioned for example, like we did for example, increase the gain by 2. You may want to reduce the friction factor by 10. You may want to change the bandwidth of some communication channel and so on and so forth. So, it is very easy. If you are a faculty member, you are teaching the class, just project this and then you can just do this online. Of course, you need internet connection. If you do not have internet connection, use the offline version that I showed you little while ago. It is of course, useful for students also. You want to understand how a particular topic is covered. You want to improve it. So, you can do that. As a matter of fact, I believe that this alone, that is the textbook companion alone is useful to most of the 40 lakh engineering students who are in our colleges at any time. So, for them, Sylab is more than enough. It is only for a very small fraction of the students who may want some extra things which may not be available in Sylab. They might say they want to use some other software. My question to you is, so, for that 1 percent of the students, should you use some other software that will tax all the 99 percent of the students? That is why I say that use Sylab wherever possible and that Sylab is good enough for the 99 percent of the students like we demonstrated. For the remaining 1 percent of the applications, use whatever software, whether it is open source or commercial, whatever it is, but do not impose that commercial software on the 99 percent of the students who can get by with Sylab. It is also true for industry. How many companies solve earth-shattering problems all the time? Very rarely do they solve such problems. For most of them, what is available in Sylab is more than enough and it is absolutely open source. All companies can also use Sylab absolutely free of cost.  Imagine this is something created by us, by our students, by who are funded by our taxpayers made available to the whole world and that is the beauty of open source software. You create a good product and share it and lots of people can benefit by that. Just like Sylab was created by somebody and they left it as open source for all our students to benefit, we also reciprocate in this manner. There is another very nice thing that we have created on top of this textbook companion, code search. Let me show you. Let me click this link. If you click this, it comes here, once again it is in sylab.in website. How did I reach here? Search TBC code search, this is what I find. So, how do I use it? Well, you need to know the name of the command. How do I locate the name of the command? I do a Google search. For example, I wanted to set a problem in partial fraction in Sylab. I had forgotten the command. I had forgotten the syntax. So, I said partial fraction Sylab. So, the very first link is PFSS. So, I know the command name. I found the command name. Now, how do I find examples? I have had many bad experiences of trying to get a working example in the past. And I do a Google search. I get lots of hits, 100,000 hits, but not a useful one. I had to really search one after another to find a working code. But we have solved the problem in our code search here. Remember, the command is PFSS. So, I come here and I search PFSS and I search. It says 140 results found. Where are these from? Remember, I told you that there are 70,000 examples that have been coded by your classmates, students across the country. They have made available, out of the 70,000 examples, 140 of them have used PFSS. The first one is by this circuit analysis book. So, let me go down. Here is a book by Ashok. Here is a book by Babu. Here is a book by Salivahanan. Here is a book by Manke. You keep doing it until you like a book that is displayed. Here is the book by Kofner, which I used when I was a student. I said, hey, you know, I have used this book. Let me view this example. It immediately takes me to the Sylab on cloud that we have seen before. This is example 4.2 in that book. And if you see here, notice that PFSS is here. So, all I have to do is to execute and I get the result. Only the denominator is displayed. That is because after numerator, there is a semicolon. Let me delete it, let me run it and I get numerator also displayed. You can see that partial fraction is with the denominator s minus 2. This is s plus 1, s minus 1 and so on. So, if I do not like this, I can modify it, rerun it, I get an example and so on. So, this is extremely useful for faculty members. If they want to set problems for lab exam, final exam, whatever it is. And you can do this for all kinds of applications. Of course, it will also help you to identify examples for the command that you want to find out.


All right, I've been holding off on this one for long enough. Let's open up the posters that I got for Christmas Hey guys Jeremy here with another red bubble poster review now these are actually all gifts for my brother for Christmas I admittedly wanted to do this very soon after getting me for Christmas, but I wanted to spread it out a little bit Still getting used to the new place at the same time Also, I just done the video for the gifts that I got for friends off of red bubble And I realized that there are times where I will post something about red bubble and then I'll Totally not do anything for sometimes a year. I realized that there was almost two years I think it was two years gap in between my red bubble reviews And I would like to try and be a little more consistent, but at the same time also be kind of money conscious at the same time There are a few posters here that are going to take down and remove some of the ones on the wall here So we've got a few the first one here is one you guys actually might have seen already This one's actually quite Noticable some of you may have seen this Because it was making quite a bit of rounds at the end of 2019 in the beginning of 2020. This is parasite. I Will have this on the floor because there's probably a lot of glare going on right now But this is fantastic detail. I love the symmetry of it. It captures the theme of the film so entirely well It even technically speaking I Could have this either way that is dope I could actually have This poster up whichever way I want I could have it with the rich family on the top I could have it with the trickster family on the top. That is cool I didn't actually notice that detail until just now But that is fantastic attention to detail when comes to making a fan poster and at the time of the recordings for these I actually do not know who made these any of these posters that are here I'm gonna have to get to my brother on that one, but rest assured I'll obviously have the links for these posters in the description below at the very end of the video I'll also probably make a note about who's through once I figure out who made these but this is fantastic. I love it now number two This one admittedly it's actually going to replace Deckard right here where my hand is but it's pretty good. I I think this is fantastic This is a blade runner I really like this one. It's very It's very hard into the day. It just shows the world. It doesn't really talk about the story. It doesn't even have any sort of Note to what story is it's just showing off what the world what the supposed future was going to be and This is fantastic. Actually the end the level of detail in this thing is Extraordinary look at that look at that. That's nuts. I love the Shiva Atari Sinko top here. Yeah, that's really good. I very much like that Again, it's not so much based on the story But it's just showing the world and you got to appreciate the absolutely crazy level of details You've got some rain on top of the umbrellas there. That's nuts And then the last one here this one I'm very happy to have because admittedly I've actually wanted a poster for this movie for quite some time It's into the spider-verse and you could actually have it either way I guess because that is him falling but the advertisements Really had it like this it harkens back to the mug in the bag that I got on the last red bubble order So this is really great. Miles looks fantastic. There's even a little bit of promaprasion along his knees along his head It's kind of got that digitized look So it really is very very akin to that of what the art style of the film was Even kind of the the sketch detail on the city too. It's kind of phasing. I guess you would call it Damn, it makes me want to play the Miles Morales game again. I love it. This is great I can't wait to put this one up on the wall too. Any of those are my latest red bubble posters to talk about Thank you so much, bro for getting me those for Christmas I cannot wait to have the inner dilemma of which one I take off the wall here It admittedly makes it a little bit more difficult now that I've got a dark night in the corner here, which Funny enough, I actually haven't talked about this thing at all and there's a story behind this thing This thing is from a movie gallery that was doing the DVD sales for this movie back in 2009 Okay, I really should talk about that in a different video Anyways guys, I hope you enjoyed this video if you did leave a like and if you're interested more subscribe The links to each of these posters is in the description below So if you guys want to go check those out make sure you do I want to give the credit as credit is due for these artists because they do fantastic work And if you're interested go and find them yourself and go and buy them because it's great to support these guys These guys made great work on this website in the end Thank you ribble for being a store that we can get media like this and I hope you guys enjoyed the video Otherwise, I'll see you next time When I talked about that That there we go. That's a proper way to put it Thanks for watching the video My name is Nits and you might remember me from the animated cult classic TV show undergrads It's been a while, but I'm happy to say the click is finally getting back together in an all-new movie Thanks to a successful Kickstarter campaign But we are still asking for your support to see any and all updates about the upcoming undergrads movie Be sure to check out and like the bring back undergrads Facebook page and with any luck. We'll see you guys soon


It feels like at some point this is going to be like an AA meeting, so I might as well try now. So my plan was to talk a little bit about type hints, what they are and why they're fun, or why they're useful and why you do them for profit. I haven't really prepared a big presentation because I figured this is a thing that it goes best in code. And if you at any point, first off, can everyone see this properly? Should I make anything bigger? I'll take the note, the silence for yes, it's okay. So if there's any questions as you go along, please say it's your hand and ask it. We'll walk it through. I was figuring that towards the end, if you have any particular issue, thing you would like to solve with type hints, we could walk it through together because I could probably talk through examples for a very long time and I don't want to bore you all. So it's better if you get some practical examples. So first off, what are type hints? One of the things that Python doesn't do compared to other languages is that you don't know for sure that whatever thing you put into a variable is necessarily of a particular type. So if I type in foo, I'm putting one, we know now because we see that it is a number. But if I go somewhere else, I don't necessarily know that foo is a number. All the questions, I'm probably going to be very scratching in this recording, but it works. So yeah, so we know here because we can see that it's a number. But we can also do from Python 3.6, 3 and onward, so we can do add a colon. We know now it's an int and we're now told Python that this is supposed to be an integer and wherever you see this variable, you can expect it to respond to whatever messages that you can do on an int, like bit length and so on. Now, most of this just kind of works when you're working in the same file as you defined it, but it doesn't necessarily work when you go outside the current file. So if we take some examples here, so if you want to add something together, so this is my little add method that just takes one and two, puts them together and I want to see what goes with it. This method hasn't been configured to support type int thing, so if I try to do anything with it, it will just go, oh, so there's nothing I can do. I have no idea what's going on here. But I have this thing here that supports type ints where support said that the first thing is an integer, the second thing is an integer, and it returns an integer. And when I do a period here, IntelliJ or PyCharm will tell me that it's an integer and despite not being in the same file, which can get really convenient when you get into a larger code base and you don't even know how many layers through you have and it's passed through, so super, super convenient.  You probably want to fix that because this is going to give you an unexpected behavior, unless you fixed it, but in that case you should have a type int saying that you support multiple types. And here's as well like you wouldn't support an int, whenever you take an int, you shouldn't support a float, but we'll also later see that you can pass in an integer and someone ask for a float because that's normal Python type inting, it just supports that out of the box. And so, yeah. Now, another thing that's fairly common in Python is that we have default arguments and what that is is just that, my examples, by the way, are going to be extremely contrived just because I want to show how the actual type ints work and not so much advanced Python. So I have here a function that takes in a name and then optionally provides some kind of greeting and then you write that out. So this is F formatted strings which available in Python 3.6, fantastic. You don't have to do the annoying format syntax anymore. So also a nice thing to know about. And what I've done here is I just said that I optionally take in something that is a text and by default that's the value none and I just check it. So here it just works as I would expect, returns hello, Björn and I change it to howdy, howdy, Björn and down here I get a warning that this is supposed to be an integer but it's supposed to be a string but I got an integer. But because it's Python, it will actually run, it won't be an issue because like it will just convert that into a string and deal with it. So you can do it on the IDE, you can also do it in the console, so that's a good, I was going to go to that. So on the console there's a little tool called MyPy and MyPy is the type hinting engine that Python uses. So if you do install MyPy you can then run it against a file, so if I run it against my example 2Py it will tell me that on line 10 the second argument to the greeting has an incompatible type int expected optional string. And this, you can run this in your entire code base and now I haven't prepared this because it's in the package and it's all nice and up so I can't run the entire thing but so that's how that kind of works. Sorry, MyPy, no it's a static checker so it doesn't run your code, it just runs through the AST and checks so you don't have to worry about it performing side effects in your code. Another one, union arguments, which is sometimes you have objects that takes any of a certain amount of types, you know duck typing, you want to support anything that kind of looks like this thing. So here's an example using a class that represents a longitude and latitude, a position on a map. And this thing supports either a flow through a decimal which is a fairly reasonable thing because maybe you need to have more precision somewhere or your database returns that or whatever. And the way you define that is you mark it as a union and then you say that I take a union of flow through a decimal and as long I get either of them I will just accept that, that's what we find. I do recommend that you convert it into one of the types when you save it internally though so you're consistent in your external behavior, so that's a good idea. And there should be no, alright it doesn't know what decimal is, okay then we'll deal with that some other day. Yes, so the colon is an indication that this is using a type hint and the equals is what it is, so this is a typo, thank you. The problem when you don't really run your code, you just write it. This is the way I wish it worked at work as well, but there I always get caught. So that's the union argument, so looking at this thing though it gets kind of gnarly when you want to work with this because you're doing this in multiple places and these can get really long, so if you're taking in a function for instance you might say that I want to take any function that takes two integers and return an integer which looks a little bit something like this and if you want to do that in a couple places you pretty soon get kind of bored. So what you can do instead is you can make alias types and the way they work is that you simply put in a name and then you define it as part of that and then you can just use that name wherever you would use that anyways and then the hint and engine will tell you that expected union of these values and then give you a warning from that. So now I have a feeling that my pipe will complain about missing decimal. So here you can see it from the command line, so you can run this on your CI server. So generics, if you've used any like Java or anything like this you'll soon realize that it's kind of useful that there are certain types of problems where it's nice to have the types because I'm supposed to be kind of consistent in what I do. In Python I can just put in whatever I want, so in this case like take you to have a stack which is something that you put things in on and then you remove them from the back. The stack doesn't care whether it takes in a string or an integer or a Pokemon or whatever as long as it is handled in the same way. So you can make a generic stack by defining a type variable that you can name whatever you want in this case t because that's what people usually name a single type variable and then whenever you initialize it you know that you're always going to get out something of type t. Now the sad part here is that IntelliJ or PyCharm doesn't actually support this yet so I can't get any type hinting or help or any help from IntelliJ. It will just use it as if you would normally in Python but MyPy will at least give you warnings if you're using it incorrectly and that will at least still help you catch errors. Now some of the things that if you're building larger code bases in Python especially code that has been around for a long time you probably know that a lot of your data is just dictionaries and hopefully it has some keys and hopefully it's going to be fine. But every so often you're going to be like oh so I'm adding this movie here's the director Steven Spielberg in year something something except that this that's not a movie that's a director and a year of something and he probably wasn't born then because he's definitely older so it would be nice if this also could tell me that oh as I'm inputting this data I know that it is wrong whatever I'm passing in here is never going to be the type of dictionary that I want and you can do that you can use something called type dicts which is part of MyPy extensions and something that is probably coming out with Python 3.7 but it is supported in the recent version of MyPy and the way you create one of these is that you can create a class that derives from type dict and then you just provide parameters and then the type that it uses and that way you can say wherever you get with a movie you know that these values are going to be there or you're supposed to know that they're there as long as people are using MyPy and following through there's also different syntax you can use for this if you would rather do it but personally I like this kind of class syntax because I think it'd be nicer but it's nice to know about and if you if you're using a key that is not in your class it's going to warn you with MyPy I don't think it will warn you if you use a key that's not there there are some settings I haven't explored all of them it will definitely warn you if something is missing that they expect to be there and I would say that generally these are more the structured type of hints that you can get are more towards does it do I live up to the minimal requirements that I'm asking of my code rather than is it only this? yeah exactly so in this case let's just check that so I don't have a hulu in my definition so hopefully it won't complain about that so we confirm what it is actually it is saying that it's an extra so that was different from what I expected does it look like we've got a clean couple? I actually don't know I don't have interest I can't check it out but I think, yeah, I'm sorry I don't know there is a lot of support for the built-in types that are in Python and there's also the discoverability of what hints you have is quite good so if we go into so many of them are American movies no you can use any movie you want absolutely with Python 3 you have full UTF-8 support so you can have any name you want including emojis but not in the names so there is support for name tuples so the exact usage of that I'm not entirely sure of it seems to be similar give it like that so another thing I wanted to mention is structured typing which is if anyone has used go one of the really nice things in Golang is that if you define an interface saying that I want to take an object that has this method on it I don't care what it is you don't have to define it anywhere in your type system as long as it has the method in this case right takes a string and returns nothing I'll just accept it it doesn't matter I don't care what it does under the hood and that's kind of how I would like this thing to work sadly this is not the way Python works by default well actually it is true Python does work like that by default and if you don't know about it it will go boom which also is good but it can make it harder to figure out where something went wrong when you're trying to track down a bug so in typing extensions there is something called a protocol that you can use to define that let's see a protocol which says that any method that takes a right is a text that returns nothing that is allowed in here and then that way it won't complain about it so if I do my py it will warn me that my second object here that has wrote instead of right is not actually a writer class and when I'm going to pass that in it will go boom for me which is not what I wanted and I could just run this code I would get the same warning but if you're living in a large code base and you don't know you may not necessarily know all the deep boughs of it what's going on this might catch you some bugs this it doesn't the thing is that the protocols don't really provide anything apart from the fact that you're just saying that I want an object that kind of looks like this and then my py will tell you whether it's there where the object has that method or these methods that you asked for the type in system in python is heavily reliant on abstract base classes so they do encourage you to use abstract base classes and then you can do at method required I think it is and that will provide you with race not implemented error and you just give it a pass as a method body and most of the built in type in are also dependent on abstract base classes in some way I don't quite understand but they all use them and that way you can implement an iterable which will just work anywhere and anywhere python asks for an iterable as long as you've implemented it correctly it will just work so that's kind of how that goes and so yeah so that's the main types of hints I figured would be a good idea to talk about and why it's useful and the second part is so say that you're all blown away by this and want to start doing this but if you're anything like where I'm at you have a large code base that's been living there for a couple of years and putting this on is going to give you just so many warnings that it's not going to be worth it because you're just going to be spending weeks trying to figure out where everything comes from well it's optional you don't have to get started with it the way you tell my pie that I want to see type in is that you define the return method and then it will go into the method and check what's going on so if you want to start somewhere small like this is some new code that I want to get started with you can just add in that this is where I start add a return value now my pie will check it whenever I ask what's going on so here we see that we have two the string is not an integer we turn it off there's nothing a sweet silence yes is the return type also checking the returns inside the function yes it is so if I were to say that this returns a string or text because we also want to support Python 2 because in Python 3 you always use a string but in Python 2 you probably want to use a unicode and so on so now it's telling us here it's yellow because I expect there to be a return value and there's no return value yet so if I return now 10 it will tell me that this 10 is an integer instead of a string so if I go hello it will then be happy what happens if you return with a variable which was not used with this type in so it could have multiple types it depends on the code so here in this method I return something that it doesn't know what the type is going to be so if I take this thing it doesn't, IntelliJ for instance doesn't know so if I do return a here it will just assume that it's fine because it doesn't know it doesn't have any integer information but if I instead define the b that's a 2 and I do that it will go yellow because it knows that it's not there so the hinting engine that's built into PyCharm and the hinting engine that's used in MyPy are actually different so some of these things are going to work better on the command line some of them are going to work in the editor the advantage of having it built into your editor is of course that you can see it really quickly what you have to change and some of the extra nice benefits is that if you want to change your methods signatures or you want to rename something it has a much better idea than what it used because it actually knows that this variable has been tagged to be of this class type so when I'm three levels deep in some method call it still knows that this is a type writer so when I rewrite that from wrote to write it will just do it so it's really powerful and really kind of allows you to do Python like you do in Java or C sharp or something where you always know what everything is and this has dramatically sped up my development experience this year is there a big difference between text and STR? yeah not here this is mostly I'm doing it because of Python 2 so in Python 2 text is an alias to unicode whereas if I did string and we were using this in Python 2 we would think it would be a binary type or like equivalent to so it's for compatibility between Python 2 and 3 yes so I just got into the habit of always writing it like this we have parts of the code that I write that are Python 2 and Python 3 and that's also something else that sorry nice yeah it is and there's also that you don't have to do this all in like with this syntax if you're on Python 3 you can actually provide your hints like this and it will also pick them up and it will work it's a little bit annoying because it's a comment but it will work as at least some things you can get going and whenever you would expect that oh this variable is an integer so you just add type type and if we go into the position class for instance where I had like this you can either put them like I have here or you can do because they can get really really long especially if you do them inline so all of this also works in Python 2 which is really good because it makes it easier if if you want to do a Python 2 to 3 conversion project I feel like this is also one of those things that can help you out because it's easier to find where everything is and yeah and refactorings good stuff luckily I got the management buy in so no the the advantage I felt like the when I got in there and I wanted to introduce this my team was they weren't they didn't use any of this stuff they were using Atom with some basic Python plug-in so they couldn't easily jump to code they didn't know anything so just showing them like if you add type pins and you're trying to understand that this thing that you defined here that lives in a separate project in the same giant monorepo that we have on the type in thing stuff you can actually understand your code really quickly they really they bought into it quite a quick the only annoying bit is getting them to actually write it because remembering and getting used to it and not wanting to force all code on CI yet to not go green if you haven't added the type pins so overall no the hopefully most people that see this they see that there is some kind of value to it and I'm kind of curious do you think that would type pins be able to add any kind of value to the work that you do on a day-to-day basis or is it more like how would you document the parameter types now since your type pins you don't have to so I don't have to that's true I still would though there are classes where I define this is the argument that I take in here it is I would still define the type because it's still useful and the way it would look like so if I use Python 2 for instance I would do my hints like this and then I would do my doc string below because that's the syntax that mypy and intelligence expects it to be in and then you would just add your definitions to your comments so I expect this to be with the difference that I usually use the Google styles I don't actually know what this format is correct now but I would still do that and that's actually how I started out with type-inting because with IntelliJ or PyCharm at least if you put your types in the documentation string that will also give you all the benefits of always it's the right type can I do the auto-completion on it which is also why so much of the scientific Python stuff kind of works I was using Pandas the other day or PyArrow and discovered that basically everything type-ins out of the box because all the documentation is written with the hints which is fantastic Yes Is there a convenient way to enforce these type-ins in runtime and on the other hand is it a good idea to do so so there's no enforcing in runtime so the you can do is instant checks but like for protocols the structured types there are some ways that work with instance and so on but yeah it's a little bit botchy you can but I would suggest sticking to more traditional duck typing ways of doing it so if I want to be sure that I want a writer and I want to get type-ins to help me out but if I want to make sure and then if it's not there either blow up normally like I try to call this method on your object you don't have it do a check-in say that like does this do this object have this attribute and is it callable so and then just work it from there that would be my suggestion to do instead and because that way you don't have to really worry about like you get some nice way of describing it and a little bit better this idea of how you want your code to work because sadly it is still not Java or something like that but yeah it will happily compile it will happily go boom on you in production so and in my world trying to avoid and going boom is production is part of the big benefits of using type-inting is there some potential to crawl yes so this is also my pie so I haven't gone through my pie completely and figured out all the switches for using it one of the things is that I have a package and I don't have a package because I just made a director with a bunch of example files so it does absolutely support it I just sadly don't know the exact switches for doing it absolutely yes absolutely so it's definitely something to do and there's also a lot of configuration you can do for how it should follow which type of hints it should warn about whether it should yeah I haven't gone through it the documentation is actually quite nice it's relatively straightforward to get into type-in so if you search for my pie and go through the PEPs you'll have a really good understanding of how it works this is the only way to and it will take you because in the past what some people does is use separators to recognize how each of the I didn't know that there was a decorator version before it's not a decorator it's like they write their own decorator and they see the decorator just taking a list of arguments of pipe and then you run the pipe before you run you wrap it around the actual function you want to run but the decorator function basically oh you mean like a insert int or something like that they would just make sure it's an int but it doesn't give you any of that if you want that type of checking you have to do it yourself that's just a it's just a hint it's here to support static analysis making better editors and IDEs it's not there to make things faster or more secure in production now if you you can use it and you can extend it in your own code like this is a critical path or something to help you do that but it's still down to you personally so is there a reason why you use optional as well as text when you're already specifying the format? in this particular case just because I wanted to show what it looked like I wanted a contrived example what you why you would do it is that so in this case I had an optional optional with a value of none and while none is absolutely a valid value I wanted to be that if you don't give me a none I want you to give me a string and then my pie it was looking like that there we are so yeah if I had set this hello here instead I wouldn't have to because it would understand that either it will be a string it will be the string you pass in it will be hello and then my pie is smart enough that there's no need to define it it will just take care of it itself yes so can you do the type to return radians sorry to return radians so the radians conventionally we can't do that but in this particular case can you do that because if you are doing a whole lot like for the whole world so that is a lot quicker so radians it depends on how you want to represent your radians so you want to do it as an example yeah so normally you would have a method that either converts it to a radian or whatever and the question is do you want it to be a float or do you want it to be a class that in turn wraps something else and that's how you work it so you have to decide on how do you want it to look like so for instance I want it to be a class so yeah can you show that yep absolutely let me go up to the position example so say that we now I am not entirely sure how the radian example would look like so let's just assume the most basic thing that I can think of which looks like this and I expect it to have to be a float and then if I said in here I want to convert it it would then return an instance of a class radian and that way you would work it out is there a way to like monkey page libraries that don't support typehands and you have like this one function that you always call and you want to make sure that your code knows what's in which I'm done you can I have had mixed success with doing it so there is there is something called a type shed you that generally gets installed by default the way it works is that you create a file with the same name as the library you want to add to and then you provide stubs like the method you want to use so I was using it for the responses library for instance and responses has a lot of methods that goes something like this and the way you would define it is that when this when it gets back it returns a connection so you would just create a file with a lot of stubs like this and then you would tell you can tell my pi that here's my stub folder and the exact syntax I don't remember but you can absolutely do it in theory you're supposed to be able to distribute it on Pi Pi as well but last time I tried it I couldn't upload it because it didn't get bundled but I think they might have fixed that now so yes how would you do a return type for a constructor method try that and I couldn't find a good way to do it so could you give an example so it's a class and it has a constructor method so it's a class method returning a new instance class so because it's defined inside it doesn't accept the return type so let's call this new because why not so the way you do that is that you do it as a string and that way it knows that because it's very common that sometimes you have to refer to the class you're in but it's not defined otherwise you have to import it so you can do it as a string so this one is a pure Python thing or is it also accepted by Pi Pi Pi also accepted by Pi Pi Pi it's the default way to work around this and the same thing goes that if you have like a nested structure because yeah it's absolutely common to do and that's the way it is okay cool does it plays well I don't think they play well with inheritance yes I would say yes there's a little bit inheritance has its own little issues like I found that sometimes at least PyCharm is a little bit bad at telling me that oh so you inherited from this and you're trying to call this method for some reason it messes up my inheritance chain and thinks method that don't exist exist I don't know exactly what that's about it mostly works the way you expect though so any other questions yes so since functions are nested and objects in Python is there a way to retrieve the type in runtime so if I want to know what was the type in purpose that is a great question I am pretty sure it works because it's supposed to be as part of the commenting system and the method data I have never tried it but I'm pretty sure that it works but sorry for that so anything else otherwise yes yes so if you use the comment based version it works in any version of Python that you can run MyPy on and MyPy itself doesn't care what Python version you use it needs I think MyPy is Python 3.3 or so and above but I don't think MyPy needs to be running the same version of Python that you're checking in Python 2.6 code because luckily those days are behind me but it definitely works in 2.7 cool I think I want to talk with the most questions ever that was my goal if anyone has more questions go to Facebook and just ask them please do ask questions if you have anything more I'll post some links tonight what you can read more about this


Stevenson killed on Mariah Savage, point! Bust eggs, KB left foot serving, match point for Stevenson!