What is up you guys welcome back to another one if you are new to the channel I am Gold Pony and today we are in the new 2019 Audi A4 courtesy of some motor cars in McKenna expert PA. But so we are in this one today because I woke up this morning it was 10 degrees out ton of snow on the ground I figured what better car to drive in this snow than an Audi with the Quattro all wheel drive system so without further ado let's start with pricing. So there will be a few different trim levels available for the 2019 Audi A4 first one being the premium that is going to start at $37,400 then the premium plus which is the one we have today that one starts at $42,900 and lastly the prestige that starts at $46,200. But so when it comes to the power plan on the A4 there is actually two different engine setups for this one the standard engine setup is going to come from a 2 liter turbo charge 4 cylinder engine putting out 188 horsepower at 4,200 rpm and 236 pound feet of torque available to around 1,400 rpm power is going to be sent to the front wheels with that engine setup there was 7 speed dual clutch with paddle shifters and with that 1,060 time is going to come in at approximately 7.1 seconds with MPG numbers coming in at 27 in the city 34 on the highway but then there is the optional engine setup once again a 2 liter turbo charge 4 cylinder but with this one power output is going to be cranked up to 248 horsepower 5,000 rpm 273 pound feet of torque available at 1,600 rpm power for this engine setup is going to be sent to all four wheels through Audi's Quattro all-wheel drive system and that power again sent to the ground through a 7 speed dual clutch giving with 0 to 60 time approximately 5.6 seconds with MPG numbers coming in at 23 in the city 34 on the highway and by the way if you were interested in that engine setup simply add $4,600 to any of those prices I previously said but so that before we do any kind of accelerations in the A4 I did want to mention the drive modes are as Audi calls them drive select that button is going to be located just underneath the climate control options there but that is going to give you comfort auto dynamic and individual on what do you say let's put it in dynamic mode here and basically what there's driving modes are actually going to do is adjust the throttle response the shift points and the steering sensitivity as well we'll get a little more into that later but for now I think it is time let's do a quick little acceleration in this 2019 Audi A4 let's see how quickly we can get this one here up to speed definitely a very nice acceleration and the paddle shifters also tested out during that they are lightning quick that is one thing I have always loved about Audi the paddle shifters have amazing response times when you hit them definitely a quite nice acceleration in the 2019 A4 and so but then to go along with that acceleration braking is equally important and so the brake setup is actually going to differ slightly depending on the engine setup that you go with for that 188 horsepower engine you're going to get 12.4 inch ventilated front discs in the back 11.8 inch solid rear discs but if you go with the 248 horsepower engine setup that is going to bump you up to 13.3 inch ventilated front discs and 13 inch ventilated rear discs so you're going to get slightly more braking power with the larger engine setup which makes sense so figured I'd mention that it's so far in my short test drive today the braking feel is definitely quite nice there's no delays to the pedal or anything like that but so the touching on suspension and handling a little bit first thing I want to mention to you guys is when you do put it in that dynamic driving mode the steering feel definitely tightens up so it more instantly points you in the direction that you want to go gotta love that but so up front you will find a five-link independent steel spring suspension in the back exact same thing and it did want to mention there is a sport package that has an additional $750 but that's going to give you a little firmer tuning also lowers the ride height by 23 millimeters and it gives you some sport seats as well if you're interested but as far as the ride quality goes I have had absolutely no issues A4 definitely rides quite nice especially on these somewhat punishing Pennsylvania roads with snow on them in random places today so no issues there cabin noise or lack thereof is also very nice not a whole lot of exterior wind noise coming into the cabin so that is definitely on point and when it comes to visibility this is the A4 so it is going to have better visibility than let's say the A5 Sportback with a more fastback like design so visibility is definitely very nice with the A4 and I did want to also mention with that visibility is if you decided to go with the Prestige Quattro all-wheel drive setup you will get a head up display as well so when it comes to forward visibility therefore you're going to be able to keep your eyes on the road much better because it's going to be illuminated onto your windshield so you're going to have that speed limit and the speed that you're currently going illuminated up there so you can better keep your eyes on the road but enough with the driving dynamics you guys let's check out the exterior of this 2019 Audi A4 and so now taking a look up front in the center there you will find that Audi single frame front grille with the quattro designation if you went that route to the side xenon plus headlights with led daytime running lights will come standard and they will actually come with the automatic feature as well meaning when it starts to get dark out the headlights will turn on automatically for you so you don't have to worry about that led headlights will come with the premium plus trim level and up so therefore that is what you are looking at right now then make your way to the side you will find power adjustable heated side mirrors with integrated turn signals looking down at the wheel setup they will come sized up at 17 inches and they will be five spoke alloy wheels with a premium and then 18 inch double five spoke alloys if you go with the premium plus or prestige make your way to the back you will find an integrated rear spoiler back there along with led tail lights and rear fog lights just below them and just below all of that there is dual exhaust outlets with chrome tips so you guys know what we have to do next as always here is that exhaust clip it's open now since we are around back to open that rear hatch there is a button on the key fob so simply press that if you like but if you go with a premium plus trim level and up it is actually a hands free trunk so if your hands are full with groceries or other things you don't actually have to take the key out of your pocket just get close enough to the trunk there but once opened up cargo capacity is going to come in in an even 13 cubic feet and take a look in the cargo area you will find cargo tie down hooks along with grocery hooks as well and netting on the right side there but if all of that was not enough space for you there is a 40 20 40 split meaning the rear seats do fold down for quite a bit of extra space if you needed it there then make your way to the rear leg room that comes in at 35.7 inches so for reference i mean even six feet tall this is how much space i have back there did one also mention standard is three zone climate control so yeah driver and passenger can set their own temperature but rear passengers is its own zone so they can set their own temperature back there as well that's definitely pretty nice and of course where there's rear passengers back there they will get an armrest with cup holders as well but then make your way to the front seats leather seating will come standard on every single trim level and there will be eight-way power adjustable front seats with powered lumbar as well and heated for both driver and passenger taking a look at the steering wheel it is tilt and telescoping and again it will come leather wrapped for every single trim level and then when it comes to the startup let me first start by showing you guys the key here you do of your lock unlock and that button to pop the rear hatch and the key does have a heavier weight to it as well so a very high-end key if you will but nonetheless once inside all you need to do is simply put your foot on the brake and press the engine start button which is located just by the driver's right knee there and then once started up if you were looking for that Audi virtual cockpit that is going to come with the premium plus all-wheel drive and up and that is what we have today so definitely an amazing gauge setup there and by the way to control what is on that gauge setup since it is all digital after all there are steering wheel mounted controls on the left side there so of course you have your tachometer and speedometer and a digital speedometer as well but you can also check out your average modulus per gallon you can check out your radio settings but perhaps my favorite part about that Audi virtual cockpit is the navigation you can check out up there you can check it out in a smaller kind of screen or if you press the view button on the steering wheel there that is going to illuminate the navigation across basically the full gauge setup up there and that is what I love about Audi's virtual cockpit right there but nonetheless let's make our way to overall interior quality here homely controls will come standard for every single trim level so you got your garage door openers and be an LED interior lighting again standard across all trims as well as an auto deeming rear view mirror and a power sunroof as well again this is all standard across everything there but perhaps the first thing I noticed when I got in this particular A4 is the texturized wood grain trim throughout this one for instance just to the right of the shifter you got it there but also on the doors and it ties its way into just above the dash as well with the quattro lettering but anyways this is an Audi so the fit and finish is definitely on point but now let's make our way to the tech display there is a seven-inch color touchscreen display that comes with a premium and premium plus if you go with the prestige trim level however that will bump that screen size up to 8.3 inches again still color touchscreen either way you will get bluetooth and audio streaming as well as android auto and apple carplay meaning if you have a smartphone simply hook it up to the A4 and you have free navigation up on that screen as well as the ability to like and dislike your Pandora songs up there you can also check out of course your radio settings up there and since I mentioned it when it comes to the sound system for the premium you will get a 10 speaker Audi sound system for the premium plus and prestige however that will bump that sound system up to 19 speakers and there will be a bang and olfsen sound system with 755 watts and so I think you guys know what we have to do next here let's turn on the radio so we got playing this morning and let's test out the clarity this one bass is ridiculous on the A4 you can definitely feel that it's like massaging seats I must it was so nice but yeah more than enough clarity the bass again is totally crazy so absolutely no issues with the sound system here but so then last thing on the tech display I wanted to mention is when you do put the A4 in reverse you will find a rear view camera for every single trim level letting you know who or what is behind you and in addition to that there is a top view camera if you go with the prestige all wheel drive as well so you can see what's in front of you and to the sides as well if you wanted to but either way that is going to lead me into safety and so to start there are front side and side curtain airbags in the back there is latch aka lower anchors and tethers for children for the rear car seats also back there rear child door locks tire pressure monitoring system will also come standard premium plus trim level is going to add Audi side assist with Audi pre sense rear and the prestige is going to add Audi pre sense city and pre sense basic and what that's going to do is help detect other vehicles and pedestrians and it can also initiate emergency braking at speeds up to 50 miles per hour as well and so but that is about it for this one you guys thank you so much for watching be sure to like the video and subscribe feel free to follow me on social media at the bottom of the screen there and I will see you guys in the next video stay gold


Imagine an industry where transparency reigns, clinical trials prioritize safety, and access to medicines transcends financial barriers. This is not a utopia, but a path we can pave with collaboration. Regulators, doctors, patients, and yes, even pharma itself, all working in unison. The battle for ethical pharma is not fought on distant battlefields, but in every doctor's office, pharmacy queue, and policy debate. Here's another truth that pharma companies are keeping from you. The Chicoil PEMF therapy system. This non-intrusive, contactless system emerges as the ultimate wellness solution you've been looking for. Comment to explore further into this revolutionary approach, and follow us for more eye-opening revelations.


Hey folks, welcome back for another episode of Code Club. In a recent episode, I showed you a variety of ways of building vectors. Some are better than others, right? I also showed you a variety of ways of getting values out of those vectors. Well, I got a lot of really positive feedback from that episode and people asked questions down in the comments. And as I was kind of doing some additional reading on related things, a number of other questions came to mind. And so I thought it'd be fun to go ahead and add that to our testing system, see how these different methods compare that people have suggested. Also, I think I can make our testing approach a bit more robust so that we can see the true impact of changing the size of our vectors and what influence or impact that might have on generating the vector, as well as getting values back out of the vector. So let's head back over to our benchmark marking dot r script. If you want to get a copy of this script down below in the description as a link to the GitHub repository where we're storing everything and the link that you'll find down there is to the current state of the repository as I'm speaking right now and going to write this code. There's also a link there for the end of the episode. I would strongly encourage you to code along with me because I think you'll get the most out of it. And also along the way, you might have your own questions. And so you might want to, you know, fold those questions into the analysis I'm doing to see how you might get be able to answer the question that you have. Here again, we have benchmarking dot r. We load a variety of different libraries. So micro benchmark will allow us to do the benchmarking tidyverse will allow us to do some data manipulation that'll make things easier. RCPP here will allow us to write code in C plus plus. So we saw that that version actually was blazingly fast so much faster than all the other code. And then I have a variety of functions here. And so the first was growing a vector using the C function. This showed to be the worst. Then we had vector grow br. Basically what this did was define output to be a numeric vector and then using square brackets, we went ahead and then fill this in. We also then pre allocated a vector. So not just naming it as a numeric vector, but saying it had a certain number of values in it. And then go ahead and fill it in vector colon. What we're doing is we're giving a value so the size of the vector, and then we're using the colon notation. So one colon five would give you 12345 right. And then what we're doing is squaring all those values. We're another approach to generating a vector of numbers is the seek function here. And then we also have a couple of functions vector s supply and vector l apply. And so what s supply does is it takes a vector of values kind of like we had up here with this colon notation. And then we can use this anonymous function to iterate over all values of one through x. An astute observer noticed that my vector l apply and s supply functions did the same exact thing that this should really be l apply. Ah, so let me go ahead and change that to l apply before I forget. And what l apply does is that actually, I maybe I should step two steps back. So vector l apply will take a vector of numbers from one to x. So again, say one to five. And then for each of those values individually, it'll square each of those values, right? And so that returns a list. So l apply returns a list. S supply is the same thing, except it converts the list into a vector if it can do so. Okay, so we got that fixed. That's problem number one resolved. Finally, then we also have we're sourcing source CPP. So we're compiling C plus plus code on benchmarking CPP, which is a C plus plus version of how I would go about generating this vector of squared values in C plus plus. So I will go ahead and load all this good stuff into our and then go ahead and run micro benchmark. So to remind ourselves what this looks like, we I sorted the output of the micro benchmark according to the median time. So micro benchmark basically ran all of those functions 100 times. And so then outputs it as a table. And we then wrote some de player code to sort these and descending order of median time to run the function where we have n, again, that n was 10 to the four, n divided by 100 would be 100, right? And so that means that the vector in this case was 100 units long. Whereas up here, it was 10,000 units long, right? And so what we can see again is that growing it with that C function is horrible. It takes so long. But supply and l apply. I think before I had them running at the same time, of course, because I gave them the same function. And so what we see here now is that l apply is a smidge faster than supply. Again, supply is converting that list into a vector. Regardless, it's slow, right? And so we can also see things like growing by brackets where we defined output to be a vector. And then we kind of filled it in using the square bracket notations. And then pre allocating the space is where we start to see some really significant improvements in speed. And the seek function is again, it's a bit of an artificial construct because rarely are we going to have such evenly spaced data that we can iterate over or vectorize over. And so the seek and the colon are really doing the same types of thing. But of course, we see that our C plus plus version of the function is much faster than everything else. Of course, also in here, I have dividing by 100. I think for now I'm going to go ahead and remove all that code from my micro benchmark here to kind of keep things a little bit more clear since I'm actually going to be adding stuff. And that might make things a little bit more confusing. Okay, that's a bit simpler. Again, we have eight different ways of building a vector. And we're going to add a few more to this. And so I want to just kind of keep things a little bit more simple. And we'll come back to this issue of how these times vary by the size of a vector before we're all done. There's two approaches that I want to build that make use of a pipe. And so what we could do would be something fairly similar to what we had up here with vector colon. And so again, I could do say one colon five, and that will give me a vector of values one to five, you might be used to doing is using a pipe like this from the tidy verse that actually comes from a package called mag Ritter. So we can use an anonymous function in line in a pipeline like this. Again, we had an anonymous function up here, right? So what I could do is we'll have two sets of parentheses. In the first set of parentheses, we use the anonymous function definition. Right. And then we have a second set of parentheses. My understanding is that that second set of parentheses tells our to basically run this first function. It's a little bit weird, but anonymous functions are kind of weird too. Anyway, let's go ahead and replace this then with our anonymous function. And so that will be the backslash parentheses x, like we did up here, and then I to the second, right. And so if that works, that doesn't work because I was looking at this I instead of x, which is what I meant to put here, right? And so that then gets us the squares. I'm going to go ahead and replace those x's with Is. And so that does what we want, right? So this is again, very similar to what we did up here. The, the function here is taking one to five, and it's inserting it as the argument I and raising it to the second power. It's different than what's happening here in this s apply and L apply. What's different is that in s apply and L apply, it squares each value sequentially. Whereas here, it takes the whole vector and squares all the values of the vector at once. It's a subtle but important difference. And if you recall, before how we talked about, you know, pre allocating the memory, this is a bit more like what's happening in s apply and L apply than what we're seeing here, right? And so, but this raises an interesting question also that this is the magrider pipe. We might also want to do the base pipe. So I'm going to go ahead and call this a vector magrider function x, right? And then we'll use this as one to x, right? And then I'm going to also do the base pipe. And we'll go ahead and replace this to be base. And then this will be that'll be x also, right? Oh, I need to change the pipe. So let's go ahead and use that. And so let me just double check that that works. Again, by replacing this pipe. Good, that works too. This might show a difference in performance between using magrider and using the base pipe. The base pipe is seen more as syntax, where what's going to happen is the base pipe will basically take this function and put this in as the argument before it executes it, right? So it's basically at a syntactic level, rewriting your code, and then running the code. Whereas, as I understand it, again, the magrider pipe is much more of a function that this is a function that is going to execute this, and then take that value and put it into this. And again, these are subtle differences. And so maybe it will maybe it won't have a difference on performance. We'll do the experiment and we'll see. So let's go ahead and save that and we'll go ahead and insert that into our micro benchmark setup. And so we'll do vector base on N. And then we'll do vector magrider on N. We'll give that a run. And I forgot to load my functions to something I did last time I recall. So let's try that again. And now it's running and we'll find the result. All right, so that completed. And let's find our pipes. So we now see our magrider pipe and our base pipe down here. So it was actually run really fast, better than seek, but not as good as the colon. And what we do see is that the magrider pipe is about 50% slower than the base pipe. Again, you're not going to usually notice this difference when you're doing your day to day data analysis. But it's important to remember that that pipe is has differences, right? And there's certainly things that the magrider pipe will do that the base pipe won't do currently. And so there are reasons that you would want to perhaps keep using the magrider pipe. And I have a previous episode where I talk about the differences in the pipes. And I think I may have found a situation that was an odd situation where the magrider pipe did better than the base pipe. In this case, certainly, at least for this size of vectors, the base pipe does better speed wise than the magrider pipe. So that's cool. All right. So that was an interesting suggestion that I'm glad someone asked about that allows us to compare these two different pipes, as well as something new for making anonymous functions. Related to the L-apply and S-apply functions is the map set of functions from the per package. I'm curious to see how those perform relative to S-apply and L-apply. I think per comes with tidyverse, but we'll go ahead and load it anyway just to be explicit. So we'll do per with the three R's there. Go ahead and load that and then come back down here. And the syntax is going to be very similar to what we saw with L-apply and S-apply. If I do map and I do one colon, let's do five for now, and then I do my anonymous function, wrong back back slash, not back tick. And then I do I and then I squared. This then returns actually a list. And we know it's a list because we can see the double bracket notation, right? So it's a list with five elements, and each element has a one seat vector in each of those. So this is a lot like the output from L-apply, right? So if we had run L-apply instead of map, we'd see L-apply. What are you doing? I don't want all that stuff. Sometimes RStudio throws stuff because it's trying to be helpful. And again, we get the same same output, right? But again, we want a vector of type double. And so there's a variety of map functions. And so to get a vector of type double, we'll do DBL. And this then generates output that is very much like what we saw with S-apply, right? So if I do S-apply instead, we get that. All right, so let's turn this into a function. So we'll call this vector underscore map. And we'll then do function x. And then with our curly braces, close that off. And again, I want to be sure to change this five to an x. And so now we have our vector map function loaded. And we can then add that into here. And we'll do vector map with n. And we see that vector map is about the same speed a little bit slower actually than S-apply. But by no means is it as bad as vector grow. I think vector map has some of those nice features that makes it easier to use. But we can see that it clearly takes a performance hit. And there are a variety of other map functions related to map DBL, map CHR, which returns a character, logical. There's a DFR, which will allow you to concatenate together data frame rows. The final thing I want to test out is something that I learned recently while reading in Hadley Wickham's Advanced R book. There's a new second edition out. I guess maybe it's not super new at this point. There's a version available online. But I like having the physical copy to look through things. One of the things that he talks about is that his convention is to use double brackets whenever you're expecting to get one value out and single brackets when you expect to get a collection of values out. What does that mean? Well, if we say look at my favorite vector of letters, lowercase letters, and we do letters with a single bracket, and I'd said like two, I'll get a B. And if I do 20, I'll get a T. I could also do letters with two brackets. I actually didn't know this was possible until I read it in the book. And you get a B. And so typically we use that double bracket notation, or at least I do with lists. And that will give you back the vector that is in that seat of the list. So the single brackets, as I mentioned, allows you to return a collection of values, right? So if I did 20 colon 22, I'd get TuV. If I tried that with double bracket notation, so say 20 colon 22, it complains, right? So again, double bracket notation returns only a single value, single bracket can return one or many values. Hadley Wickham's point is that to kind of keep the mental model straight, he likes to use double brackets whenever you're expecting one value, single brackets when you're expecting multiple values. I was wondering whether or not there's any kind of performance difference between using a single bracket and a double bracket. Kind of suspect not, but hey, we've got a testing rig here. So let's go ahead and check it out. And so I'm going to come back up here to where we had a vector pre-alloc, and this is using the single bracket. So I'll go ahead and modify this to be sng. And then I'll go ahead and copy this. And I'll make vector pre-alloc dbl. And I will put double brackets around my eye there and make sure you've got that loaded. And then I'll come back down here and vector pre-alloc sng. And we'll go ahead and add the dbl. And so what we find is that we actually get pretty similar performance. In this case, we got a median runtime that's a little bit faster by double brackets than single brackets. If we run it again, I bet we'll get very similar, or perhaps even the opposite result. Let's give that a shot. And so again, there's a little bit of play. There is some stochasticity to how these bench markings run, so I try not to take them as like absolute critical values. But again, thinking about them in terms of relative performance, they're certainly on their own class. There's not a huge difference between uses single and a double. And I suspect if we kind of did this a few times, we'd see that they were all really close, certainly within a percent of each other. Anyway, I like that idea of using the double bracket for a single value and a single bracket for multiple values. In some ways, that's counterintuitive, right? Because if you have more brackets, you'd expect more values, at least I would. So that might take some time for me to retrain my brain. All right, well, these are the different additional tests that I wanted to add. One thing that we did when we started messing around with these microbenchmarking studies today was that there were a whole collection of functions that I was running with n divided by 100. Those function calls allowed us to see how the performance compared based on the size of the vector. And so we did that with two points and divided by 100 or 110,000. And so it's possible that the performance would scale uniformly. So if you double the number of values in the vector, that performance wouldn't change at all. It might be you double the values and you double the time. It might be that you double the values and you quadruple the time. That'd be quadratic. And then there's values in between there. And so with two time points, it's really hard to get a sense of that. The other problem with two time points is that you don't get a sense of the overall overhead of basically setting things up. There is a cost to running the function that has nothing to do with the size of the vector. You might think of that if you were to plot the data with time on the y-axis and your n on the x-axis as being like the y-intercept. So if you gave it no sequences or if we did like one value, what would that scale like? So let's go ahead and modify our code so that we can generate that plot. And so that's what we're going to do with the rest of our time here today. And I will go ahead and create a function that I'll call mb by n. And we'll go to function and we'll give it the n parameter, right? And then our open brace. And I'll go ahead and tab that over as the body of my function. And so then it will use n as the input. And so now I have my function. So I could do mb by n. And let's give it the value of 10. And then we see how long it takes to run for a vector of size 10, right? Very similar type of relationship that we saw before. Although, I guess in this case, running by the colon is actually faster than by c++. I think we saw this in the last episode that a bigger n, you certainly see the benefit of running it in c++. So we want to try this with multiple n values, okay? And so we'll do a map function. We could also do s apply or l apply. But again, the benefit of map is that we can take the output as data frame rows and we can concatenate together data frame rows, right? So we could do map and then the function will be dfr. And then we'll go over our ends. And then we'll pass that into mb by my fingers aren't working by n. And I need to define an ends vector. And so we'll do that with the c function. So again, c function is fine. Don't use the c function to grow, don't iterate with the c function, right? So let's try it with one and see what happens 10 100 1000. Let's go up to 2500 5000 7500 10,000 12500 15,000. Okay. So we'll do that that's loaded. And then we'll go ahead and run our map dfr function and generate our data frame for our 12 different functions at however many different ends I have here. So it's going to take a little bit of time because it took some time for running just to 10,000, much less all these other values. So that ran through, we had 10 values. So we could do like length on NS, we got 10, right? So we had 10 ends that we used, and we had 12 tests. So we get 120 rows and two columns. One thing I'm noticing is that we don't have a column for the end, right? And so I think the easiest way to do that would be to go ahead and add a mutate to our function, we do like n equals n. And that way, then if I run mb by n on, say one, then I get a column for n of one, right? Cool. I'm also going to go ahead and save this because that did take a minute or two to run. And I will go ahead and call this mb data. We'll run that and then we'll have that stored. And then we'll be ready to take mb data and go ahead and generate a figure from that. So let's go ahead and make sure everything looks good with mb data. And we again see that we've got 120 rows, we could look at the tail on this and see that yeah, it goes out to 15,000 with our different median times. There's probably stuff in our function here that we don't need like this arrange. We don't need that if we're going to go into a plot, but whatever, we'll leave it. So let's make a plot. It's been a while since I made a plot here in CodeClub. I'm excited. So we'll do mb data and we'll pipe that to ggplot aes. On the x-axis, I'm going to put my n on my y. I'm going to put my median time, right? And we'll go ahead and then do color equals expr. That makes the plotting window. Let's go ahead and make the line. So we'll do geom line. Very good. And so we see one is off the charts. This looks kind of quadratic the way it's increasing more than linearly. I suspect this is the vector gross cn. I'd like to go ahead and clean up my legend a bit. There's a lot of extraneous information in here that we really don't need. So I'll go ahead and do a mutate on my expr variable. And we're going to use str replace. And I'm going to use, we're going to modify expr. And I'm going to use a regular expression to get out the stuff between the underscore and the first underscore and the first open parenthesis, right? So I'm going to do vector underscore. And then I'm going to use a set of parentheses with a period star inside of it, the period star inside of the parentheses the period star means match any character, zero or more times, which is basically match everything. And then those parentheses don't mean match your parentheses, but means save the information that's in here for the replacement value. Now, I don't want the whole thing. I want to remove the parenthesis n. And so I will then do backslash backslash parentheses to match an open parenthesis and back back close parenthesis to match that. And then I will for my replacement value, I'll then do back back one. And so running that, we now see that we've gotten rid of the vector underscore and the n. And I will go ahead and fold that in to the rest of my pipeline here. So our legend has been cleaned up here, right? Maybe we could do some things like labs, x equals size of vector, y equals median time in I think I believe it's in nanoseconds. So this is going to be really impossible to see because we've got 12 different colors on a rainbow gradient. And it's really difficult. I know that this gross C is this green line, because in our initial benchmarking, that was the one that was off the charts. But these others are going to be really hard to see. Maybe what we'll do first is zoom in. And so I'll go ahead and do a cord cartesian with y lim. And let's go from zero at the bottom to let's say like one e to the six to a million. That allows us to zoom in a bit. Maybe let's come back to like five million. Yeah, that's we can play with it. But that works well for now. Now let's turn our attention to the colors, right? And so let's go ahead and I'll do scale color manual. And then the values are going to be the color values. I don't care about setting specific colors for specific values. I think what I want to have is four colors, and then three shapes, right? And so then I can put one shape, use one shape for each, each color, or basically have four colors and three shapes off 12 combinations. And then each condition will have its own unique combination of color and shape. So what we'll do is we'll then do a repeat on four colors. And so I will do tomato, which is kind of this reddish color Dodger blue, gray. And then let's also do orange. Nope, I got a spelt orange right. And maybe I'll do dark gray. Dark, not darn, dark gray. And then I'm going to repeat that three times, right? Because I've got four colors, I'm going to repeat three times. Let's go ahead and add a plus to that. I now see that I've got those four colors repeated three times. I'd like to go ahead and add a shape to that. And so if I in here in my AES do shape equals expr, it's going to complain because I have 12 values. And so you can't have more than six shapes because things get hard. So what we want to do is go ahead and then add scale shape manual. And we'll then do values equals wrap. And then here we'll do see, and I'm going to do square a triangle in a circle. And those values I think are 15, 17 and 19. And here I did wrap three times, right? There's an argument for wrap that you can use, which is each. So I can do each equals four. And so to show you the difference here, if I run this, this gets me my 12 colors. And this then gets me my 12 shapes. And so you'll see that like these first four values, the 15, which I think is a square, will correspond to these four colors. And then 17, which I think is a triangle, will go to these four. And then the circle will be those four. So we'll have one shape for each of the colors, right? So this should work. If I put a plus at the end here, I'm not getting any symbols showing up. And I'm remembering that I did geom line, I didn't add geom point. So let's go ahead and do geom point. This is good. There's might be some things I would change like getting rid of that background. Why don't I go ahead and do that because that always drives me nuts. I'll do a theme classic. And that cleans up the background a bit. Maybe it doesn't matter, but it matters to me. And so we see, first of all, this line that's going off the charts is the orange with a square. And sure enough, that's the grow by using the C function. And then followed by this gray triangle and gray circle. So the gray circle is s apply, the gray triangle is map. And I'm going to guess that the red tomato triangle is L apply. Sure enough, it is good. And then we've got grow by using the bracket. And so that was defining that output was a numeric vector, but not defining its length. And then down here, these next two lines, you can see this orange triangle on top of the circle. You can kind of see it behind the circle there, that those are pre allocated using either the double bracket or the single bracket. So again, no difference between those. This yellow or orange, I should say, circle is the sequence. And then further down, we have other things that are kind of hard to see, but are going to be things like the colon and the RCPP, the MagRitter pipe, as well as the base pipe are probably down there, right? So if I zoom in even further, I'm going to leave that there, because I kind of like that resolution for making say like a thumbnail, right? So let's go to, let's do one e to the six.  Let's go even further. Let's go one e to the five. Yeah. So this allows us to zoom in pretty well. And so we see the RCPP are those blue circles. And as I mentioned, the colon does better this blue square does better at smaller size vectors, but at larger vectors than the RCPP version starts to do fair amount better. And then this base pipe is a little bit slower than using the colon. And maybe there's a small performance hit for, for using that base pipe, but really not much at all. And then the MagRitter pipe is a little bit slower still. So let's go ahead and scale back and see how these things are changing generally.  And so we can see that at least the ones that are on the screen, not including the gross see all appear to be varying linearly, right? Like so some of these like RCPP appear to be constant, but clearly when we drilled in, it was going up linearly. I think what's important to remember is that although they're scaling linearly, they don't all scale at the same rate. Again, if you if you double the number of sequences, they're all going to take twice as long to run. But that that initial period, right of like your end sequences going to two and that n, the time it takes to run those n is going to vary. So let's go back even further. Maybe I'll go ahead and remove that line altogether. We can then see as I think I mentioned earlier, this gross C line is quadratic, right? I don't know that it's exactly n squared, but it's getting there, right? And so that's really the absolute worst approach that we could possibly be using is to be iterating and growing a vector using the c function. Anyway, let's go ahead and put this back to the scale that I want to use for thumbnail. So I think it's easy to look at a list of options like this and say, Oh, we should be doing RCPP, or we should be using the colon or oh, we should be using seek, or we should be using base are right. And so there's reasons why you may or may not do that, right? So depending on your problem, the colon may work great, it might not work at all, right? And so there might be situations like where if you're concatenating together data frame rows, where map, even though it's going to be slower than L apply or some of these other approaches, the map might be the preferred way to go. Certainly, if you're concatenating together data frames, then that's probably going to be easier to do than looping or binding things together by rows or all sorts of things, right? So you can't think of this as a one size fits all. One thing that I think is pretty clear is that writing the code in C++ is a lot faster and perhaps more generalizable to a bunch of different set of problems. So the thing to remember is that writing things in C++ is not as trivial or not as easy, I should say, as writing it in R. Not everybody knows C++. You may not know C++. And so should you go learn C++ so that you can improve upon your performance by, you know, a couple milliseconds or seconds even? No, that's crazy. If you're in a situation, like I think we are in developing an R package, then, you know, the if it takes me longer to write things in C++, and it saves you a potential user seconds or minutes, then I think it is worth it, right? Because if you take the time that you save as a user, and then scale that across however many users we end up getting for this, then it could certainly pay back that time that I invested just many fold, and will then make the package that much nicer for people to use, than it would have been if I'd have done everything in pure R. Another downside to doing it in C++ is that like maintaining the code is a real, right? And if I want people to contribute to this project down the road, and everything's written in pure C++ with a thin R wrapper, I'm not going to get people to help me. Because again, not many people know C++. And so there's all these tradeoffs. And so I'd really encourage you not to look at this list of options for generating a vector and say, oh, I've got to use the fastest possible one. Because again, for most situations, the time performance doesn't matter. What's going to matter to you as a R programmer is how long it takes you to write that R code. All right, I think we've said enough about vectors for now, probably for a long time, actually, the next episode, we're going to do a similar type of analysis looking at building lists and getting values out of lists. Lists are a lot like vectors, but they're different, right? And so we'll see some similar yet some different approaches that we can use to generating and getting access to a list. What do you think of this idea of using double square bracket notation for getting out a single value and single square bracket notation to get multiple values? Let me know down below in the comments, where you fall on this. I think it's something that I might try to do going forward in some of my R development. And we'll see if that kind of helps me with my mental model of what this different bracket notation is actually doing under the hood. All right, so that you don't miss that next episode of Code Club, please make sure you subscribe down below and we'll see you next time.


Welcome to this session in the course on computer programming. Today, we are going to discuss some very interesting applications of using matrices to represent digital images. We will discuss the concept of an histogram and we will see how digital images can be easily processed using matrices. First technique recap, we have seen several computational problems involving matrices. The main challenges that we have noted are one, how to represent the problem data by matrices. Remember that in case of simultaneous equations, we use matrices to represent the coefficients of the unknown variables. Further, we need to be very careful about manipulation of index values for rows and columns of matrices. We would have noticed some interesting complications when analyzing the magic square for being a true magic square. There are umpteen such occasions. In this session, we will see how images are stored and processed digitally. We are familiar with the photographs, but these days you use digital images and digital photographs. In particular, we will study the basic image representation using a matrix and we will also see how digital images can be processed by simple matrix operations to enhance the contrast of the given image. Please note that the histogram equalization technique which we will be describing here and the digital images used in this session are directly based on a Wikipedia article given by this link. Those of you are interested and can look at more details at this link. So, we now look at digital images. These are actually a collection of pixel values. The pixel is a picture element and the value of a picture element represents the light intensity. Now, these pixel elements are arranged in a matrix form with certain height and width. So, there are h into w pixels in an image. Each pixel value can be represented either by one bit which means it is a monochrome image, 0 or 1 value that is either black or white. It could be represented by 8 bits which is called a gray scale image. 0 would mean black and 255 will mean white. So, you get all shades of black and white. A color image can be represented by 24 bits where you use 8 bits to represent red, other 8 bits to represent blue and 8 more bits to represent green. For each one byte, you actually can represent a pixel. So, one pixel gets represented by 3 bytes or 24 bits. Please note that one can have 16 million colors if you look at all the possible combinations that can be represented.  We can actually detect somewhere between 200 to 2000 colors. Now, the information about an image is actually stored in a file because there is a large number of pixels. You cannot put them down on a piece of paper or input them or output them ordinarily. Such a file will contain some spatial header information. For example, that file will tell us what is the height, what is the width, what are the types of color present, etcetera, etcetera. And each file will have values for each pixel in the image for every color present depending upon whether it is a color, monochrome or grayscale image. Fingerprint images typically are monochrome or grayscale images and have small size 500 to 300 bytes. But for large images, we need to compress them. There are interesting compression techniques which keep the file size limited. Otherwise, remember that a 12 megapixel camera, that means in single frame it can capture 12 megapixel. Since each pixel can be 3 bytes in color, a single picture can be 36 megabytes size. In order to reduce this size, but without losing the quality, there are compression techniques that have been discovered. The compression can be either lossy or lossless. We will not go into those details except that we note that there are several file formats which have evolved to represent images of different types. So, we have raw images PNG, BMP, TIFF, JEPH, JPEG, XMP. You can refer to the Wikipedia article on the different file formats under the title image file formats. Many of you would have seen these files because invariably on our computers, we have photographs in one of these file formats. We will concentrate on looking at the pixel values of a digital image, assuming that these pixel values can be read inside a matrix. The matrix elements can then be processed further. Each element of a matrix for a grayscale image, for example, would contain a value between 0 and 255, where we said 0 is black, 255 is white. It does not require more than one short end or one care, which is one byte to store a pixel. We now assume that we can read all the pixel values into a matrix and see how they can be processed. First, we introduce the term histogram. This is another statistical term which is used to denote the frequencies or count of number of times an event or incidence occurs. In case of digital images, a histogram table simply indicates how many times a particular value occurs in the image pixel. So, for each possible value, the number of pixels in the image having that value is the entry into the histogram table. Why is histogram important? Let us look at an example. Here is a sample image of size 8 pixels by 8 pixels. It is obviously an artificial image. A pixel is shown as a very big thing, a square thing. Notice the different shades of grey. This one is the brightest, but this is not pure white. This one is the darkest, but this is not pure black. So, this is an image which has a very low contrast. Let us look at the pixel values of this image. Observe that these are the pixel values stored in an 8 by 8 matrix. Observe that the smallest pixel value is actually 52 and not 0. The largest pixel value is 154 and not 255. This is one of the reasons why the contrast of this image is poor. So, this is how the image looks like. I have simply shown the value of the brightest e-pixel here as 154. Let us look at the histogram values which are shown for non-zero pixels. Of course, at 0, 1, 2, 3, 4, up to 51, there are no pixels. There is one pixel with value 52, three pixels with value 55, two pixels with value 58 and so on. Observe that there is one pixel with value 154, but there is no pixel with value 155, 156 and so on. We notice that all values are between 52 and 154 and this results in inadequate contrast. Imagine if this contrast was to be removed, then what we must do is somehow the histogram which is concentrated in a narrow range between 52 and 154 needs to be stretched because the possible pixel values are 0 to 255. So, if we can stretch the histogram such that it covers all possible values, then we might get a picture with a better contrast. This process is called histogram equalization. What we need to do is given the pixel values in an image, we calculate the histogram, we find out some method of mapping an existing pixel value to some new value. A value v should be mapped by a suitable function h of v. So, original value v should become h of v. For example, we would like 52 to be mapped to 0, 154 to be mapped to 255. Of course, we cannot arbitrarily move values from one end to another. All the values which are so transformed must be transformed in proper harmonious relationship with the entire image and that is the reason why we use histogram. First, we calculate the cumulative distribution function or CDF of a histogram. The CDF is simply defined as a number of pixels below a certain value. So, for example, there is only one pixel below 52. There were three pixels at 55. So, below 55, 3 plus 1, 4 pixels are there. Below 58, there are 6 pixels. Below 59, there are 9 pixels and so on. So, this will tell you the cumulative distribution function. Observe that the largest value is 154. So, below 154, there are 64 pixels. Of course, the entry into a cumulative distribution function array 155, 156, etcetera will all have the number 64 because there are 64 pixels less than the next value. Here is the histogram equalization formula. Looks complex, is not it? H of v, if v is a value of an existing pixel, then H of v is given by rounded value of CDF v minus CDF min divided by m into n minus CDF min multiplied by l minus 1. Where from has this formula come? Well, we do not know. Frankly, it does not matter. Those of us who are interested in image processing can figure this out. The beauty of computer programming is if somebody has discovered such formulation, such algorithm, we can actually implement those formally into computational processes, which is what we propose to do. The equalization formula for our example image, where l is 256, m and n are 8 and the minimum CDF is 1 is simply H v is equal to round of this upon 63 into 254. That means for every value v, we can find out what the new value of H will be. Let us look at this example. The CDF of 78 is 46. You can go back and check the cumulative distribution function at 78 was 46. So, a pixel value 78 will have to be equalized. That means it will have to be mapped to a new value using our formula. This formula is H of 78 is equal to round of 46 minus 1 by 63 into 255, which is nothing but round of 0.714286 into 255, which is nothing but 182. So, look how interesting the life is. We do not know how the formula has come by, but we can implement it into an equation and calculate new value. This gives us a equalized value. Each pixel in the image will have to be transformed in this fashion. Each pixel which has a value 78 will now have a value 182 and we can calculate such new value for each pixel in the image. If we do that, we will get the new pixel values after what we call histogram equalization. Notice that in these new pixel values, the smallest value is actually 0. The largest value is 255, which was 154 earlier. All other values are changed, but they are not arbitrarily changed. They are changed harmoniously in relation with the histogram properties of the image. To see how effective this technique is, let us look at the contrast enhancement that we get. Do not you see that this image look much better in contrast? Let us compare these two images. This was the original image. This is the new image. Observe that we have simply implemented a computational procedure by representing the image in a matrix and by doing the histogram equalization. Here is another interesting example. Here is a scene, another grayscale picture. Here also the contrast is not very good. If we actually plot the histogram and the cumulative distribution function, it will look like that. The red color thing is the histogram. Notice that all pixel values are concentrated in a small range somewhere between 100 and something to 200 and this is the cumulative distribution function. If we apply histogram equalization, the cumulative distribution function will become like this and the histogram will be stretched all the way from 0 to 250. When we transform individual pixels as per this equalization formula, the picture that we will get will be this. So, notice this was the original picture with this histogram and cumulative distribution function. We did the histogram equalization using that formula and mapped all the new pixels. The new pixels will now constitute an image which has a much greater control. In short, we have seen how histogram equalization can be done, how digital images can be represented in the next session. We will actually write a program to implement this technique. I would like to tell you that this programming is not very complex at all. In fact, in many embedded systems such as your digital cameras, such histogram equalization programs are written by people. They are embedded into the computers inside your camera and they can be invoked by press of a button. We of course in this course shall study how such programs can be written in C plus plus and executed. Thank you.


This is Kano about a month ago while working out he said he felt like he tore his shoulders right shoulder He said issues moving it around. He wasn't able to do much with it. He didn't even come expecting his miracle tonight He said the Lord healed him and he has no pain. So I just came to visit you and unexpectedly on oh my god God, you're so good. You're like So so how did you injure it? I was going to the gym and I was just doing too much without warming up and then on Monday I started a new a good job at a furniture company. So I'm gonna need my shoulders that God God knows, you know And to Jesus belongs all the glory and to Jesus belongs all the glory Your one desire to know his presence


Hello, I'm Stein. I have 20 years of experience with Super Office CRM and I've had 10 years to build the new customer experience center. And one of the key things there was to build a feedback solution. Now, what is a feedback solution? Well, when we do work for our customer, deliver a product for them, deliver services to them, we do want to know if it meets their expectation and whether there is something we can improve or not. And by using that, we actually are able to improve on our services. And it's quite simple to use if you have the principle rights. One of the most important principles is that feedback you should always listen to. You shouldn't find excuses for why it became the way it became. You should just try to find out, could we do things different to make it better next time? Even if you feel that the customer is to blame, it's very important that you are willing to listen. It's also an opportunity for the individual and the team leader to discuss if things can be improved. And believe me, both processes, product and the way you reply on things can be improved. And by having that as the goal for the discussion, you know that you will always find something that makes you a little bit better every day. One thing that is not so much thought about is that creating a good service is a team responsibility. If individuals try to reach high goals but do it at the cost of the others, you risk that the best people take the easiest tickets and therefore get a free ride. It's important that the team feel that you are together of solving the most difficult ones and that you have a reasonable spread of what you're taking. So work as a team and get the best out of the individuals in that team. Based on such a solution, we have experience that you can really improve on your customer satisfaction score. It's often termed the CSAT score. We improved our team from an 85% ratio to a 95% ratio in the matter of a few months. You can also monitor over time that it remains high and you can improve your product to make it even better. And the best thing at last, you can actually get a second opportunity to solve the customer's problem once you know that they weren't satisfied. So feedback solution, the key to good service.


Hi, I'm Pratik Runtah. I'm the co-founder of Miran, which is a web design studio here in New Delhi. And I'm so happy that ASgeek has finished 10 years. And I cannot believe it's been that long 10 years. I think the first time I came across them was back in 2010, when they were running this dock type HTML5 series. And it's quite fitting that we crossed paths in an event about HTML5. Because thanks to ASgeek, we went on to build quite a few exciting event websites for their host of events like Fifth Elephant, AndroidCon, and GSPOO. But I think our favorite was Meta Refresh, because it was about web design. And we were slightly biased there. But along with giving us an opportunity to make a lot of websites, Havi also gave me the opportunity to get on stage and talk about some of the things that we do. And that was also quite amazing. And I'm always thankful to them for that. I've gone on to speak a few times since then. But that's the first time I got on stage for the movie special. But I think what's the best at is bringing people together and the community together. There's so many people that I've met. In fact, ASgeek and ASgeek events who we've gone on to work with, who we've gone on to collaborate with, some of whom have become friends for life, some of whose weddings I've attended. And Kira and Zeneb have always been people who I drop in to say hello to whenever I'm in Bangalore. And I've also hosted them here in Delhi. And always envious whenever ASgeek would pack up and make their way to the mountains in the summer and hibernate there. And I was like, so envious. That's the company I want to be. But once again, I'm just so glad that they're here and they're doing this valuable work of being in the tech community together. And I wish them all the very best for the next 10 years. And may you guys keep doing more of what you do best.


A young boy from the UK dies after reportedly attempting the viral TikTok blackout challenge. This recent headline left the world heartbroken and made parents all over the world scared for their children. If you don't know, certain acts done on social media are deemed challenges. Then those challenges turn into trends to record yourself doing. Those who enjoy scrolling through TikTok have heard of the Skullbreaker challenge and Penny challenge. We also had to bowing, planking, the mannequin challenge and now the blackout challenge. The blackout challenge also known as the choking game is when you choke yourself to the point of unconsciousness. These viral challenges may seem like a game but they actually represent individuals putting their safety at risk for likes, clicks and views. While social media platforms do the best they can to avoid responsibility. We can't help but wonder how can they let this happen? Let's take a look at the psychology behind these challenges to raise awareness about this widespread problem. As much fun as the challenge might sound there are a lot of psychological reasons you should stop to think about the next social media challenge you attempt. Let's check them out. Number one, misestimation of norms. Behavioral scientist Dr. Gretchen Brian Measles explains that puberty is the time when a child's mind is transitioning into an adult. As they go through different mental and emotional states they're trying to understand what's normal and want to know if they're normal too. They wanna fit in just like anyone else. So when they scroll through their feed and see 20 posts of other people on TikTok doing the Kylie Jenner lip challenge they might think to themselves, wow, everyone's doing it so I must do it too to fit in. Everyone else is doing it so this must be normal. They completely skip over the fact that too much suction in a small area could be harmful to you. Number two, FOMO. FOMO or fear of missing out is the anxiety we feel when we're excluded from pleasurable and rewarding experiences. Studies have shown that this fear is on the rise in today's society due to having their own personal magic mirror to see what everyone is doing at the moment, their phones. A 2020 research paper published in journal social media and society suggests that this fear plays a role in social media use in teenagers which can unfortunately evolve into full blown internet addiction. If they miss one post, one new trend, one new picture, they might be out of the loop and missing out on what everyone else is experiencing. In a study published in human factors in healthcare researchers wanted to examine the motivation behind practicing in dangerous TikTok challenges. One asked, teens who participated in the study mentioned the fear of missing out as one of the motivating factors. When they see trending challenges they might feel like they're missing out on the fun. In reality, they're so preoccupied with that FOMO that they ignore safety and the common knowledge of what can harm human beings. Do you think encouraging more face-to-face interaction could help teens combat FOMO on social media? Share with us in the comments below. Number three, belonging. Brittany Morris, a licensed clinical social worker from Virginia says that children and teens are most susceptible to these dangerous challenges because of the need for belonging. She explains how in those early teen and adolescent years kids desire to be accepted by others. By connecting with their friends they're also discovering their identities based on good or bad peer feedback. Generally, it's a great thing for teens to have a healthy group of friends but sometimes while hanging out they actually have a bad influence on each other. A 2017 research study published in journal sexual and relationship therapy suggests that adolescents find it more difficult to control impulsive behaviors if they're with their peers or if high emotions are involved. Authors also mentioned that social media has the power to influence a teen's decision-making skills by connecting them to their peers. So when their friends participate in such challenges they wanna feel like they belong to the group. When they feel like they belong they feel good about themselves. Being a part of a group can actually be positive and healthy for an adolescent or teen. Do you think there's a way to encourage healthy socializing on social media? Number four, thumbs up. Another important reason is, of course, popularity. Who doesn't wanna feel liked by thousands of people? We shouldn't judge them for wanting to be popular. Popularity is what brings together all of the reasons we mentioned earlier. Feeling like they belong, like they're accepted and appreciated. A 2016 study in the journal psychological science found adolescents were more likely to like popular photos as opposed to those with only a few likes. Even if they depicted risky behaviors the same goes with viral challenges too. The more likes a video gets the more likely they'll be to try it themselves. If they went viral, so can I. How can parents and schools work together to help children build confidence and self-acceptance so they don't look for validation online? And number five, the judgment-making area. It's important to note the biological perspective as well. Teenage and children's veins are still developing. For that reason they don't have the full capacity to really understand the risks that these challenges pose. Clinical psychologist and mental health quality consultant Dr. Desiree Dudley explains that the prefrontal cortex, which is a decision and judgment-making portion of the brain is not fully developed in these young people. That's why they have a harder time considering all the factors that are involved in these challenges than they're unable to make a sound decision. Fancy leggings are one thing. Ignoring common knowledge and personal safety for the approval and acceptance of others, that's a whole different ballgame, one that we hope you consider sitting out of. Do you think there are some other reasons behind these horrible and dangerous trends? Let us know your thoughts. Please share this video with someone who would benefit from it, like a parent, teacher, or even young teen. If you notice the child's internet use is becoming problematic, please consider talking to a mental health professional for additional reading resources and tools to help your child. Feel free to visit links in the description. Let's raise awareness together to help prevent more young lives from leaving us too soon.


All right separate traders good afternoon and welcome on back here this Tuesday, October 26 this post traders talk edition As is every Tuesday at least but here of our afternoon meeting great to see all of our students like Felix and Scott Jeff Patrick all of our traders here inside the cybergroup room and of course if you're joining us on social media once again Facebook Live or YouTube welcome on back I'll tell you what I'm running a little bit empty on the water here So I'll try and be efficient with my time and words, but today has gone full tilt this whole day Just kind of went lopsided and I say that in a lot of different ways I mean the market ended up taking a bit of a drop off So that's first but ended up making a nice little bounce at least by 1 p.m. Eastern it really more So I'm talking about the volatility. I mean just out of nowhere the OCG Entrade really was the one that just went all over the place this stock for the good news that came out on it Ended up, you know dropping off going into the open. We talked about this trade to To great detail inside our traders talk workshop that again We took a we did earlier today inside the cybergroup room, but for the most part You know for all the good news that came out on this stock and for the run-up that we had Well, that went to complete waste Skip here in the chat board just simply writes WTF yeah, I agree right coming back to this trade for the first time I'm sure that would be the first thing that one would say right like how the hell did this stock end up at 919 You know practically underneath where it had even closed yesterday This stock ended up making a big pop in the after hours this morning And you know even after the open ended up making a push back up But man out of nowhere just ended up completely dumping off So I'll tell you what I don't think there has been any other news headlines. That's come out But for the most part just recheck. Oh, actually shoot From where we left off. I'll kind of show you here a couple of snippets though We ended up talking about this at least a bit by 1130 1145 It was some news in regards to their vaccine that WHO seeks further clarification From Barrett biotech on covax and I guess that's OCGN's vaccine So just that headline alone ended up leading to a huge circuit breaker halt on this stock again We showed the chart I'll go back to that in a moment, but you could even see here afterwards though an update from WHO Tells Benzinga The technical advisory group expects to receive these clarifications from the manufacturer by the end of this week and aims to Reconvene for the final risk benefit assessment on Wednesday, November 3rd So what that tells us simply is that the stock is going to be pretty damn volatile At least for the next week and a half two weeks This is not the type of stock that you should be swing trading for any reason long or short But nonetheless as a day trade this is like you know traders paradise here So this ended up getting halted on the way down at first and you know what I always say for stocks that get halted on the way down Regardless of the stock or the reason Almost always that's a wrap. That's game over and with the stock being shortable. Well look what happened Only ended up continuing to dive off later on So that could have made for an incredible opportunity as a trader to you know short and for the afternoon right now This thing just still seems to be you know dropping off quite steadily. I mean, you know again We ended up wrapping up our trend line class yesterday and inside the phase one stock course And if I'm not mistaken, this is actually I did it from the five-minute chart here Give me a quick second to redraw this. It's gonna be on the five minute. It will show just as well I'm sure on the on the minute chart, but let's see. I gotta go back to even 12 p.m. Easter Oh From here Ended up dropping off a bit at first once it ended up popping the trend line You could see instantly it came back down underneath it I'm just using these highs for reference But no we were talking about that in class even before this next halt It's to say that hey if it breaks the trend line and breaks resistance No, the hope would be to see a big move up or at least, you know a temporary squeeze up and then you know It's a react from there Well, what if it were to come back down right below the trend line immediately after breaking above it? That's a huge red flag. So easy to say in hindsight, but that's exactly what happened This doc just got obliterated after and you know for right now. I mean it's on on the way back down I'm sure that we're gonna see another break of support off of nine 40,000 share order and counting on the big currently. I think nine just broke recently here or got tested The low right there nine so probably see a bunch of red on the tape already at nine So a bunch of selling and then also furthermore one thing to point out on this trade because you know I was talking about this earlier, of course I actually ended up going along on it just a moment ago And I took it right from a pretty important price level that we commented on and no right from book map here Even again, you can just be from the trader summit in person conference that we did last week And I went over this specifically in the halts workshop that I taught But you know, we ended up seeing this big opening halt print so to say and he in 827,000 share conglomerate print at nine dollars thirty seven cents. So, you know what? Let's just put a quick line there That's what I was commenting on all throughout the early afternoon, you know, OCG and at nine thirty seven So right over here once it broke through that price going up. I just went right in I was being patient with the trade From there ended up breaking above, you know, nine thirty seven just here on a second go around it You know led to a nice opportunity at least up to ten Unfortunately, I didn't short it from ten on the way back down that would have been quite the short at least from that point But you know, you could even see here once it ended up failing to hold over nine thirty seven boom broke right below it We'll see if we can hold here as resistance coming up But and this is an awesome awesome stock to try and focus on and trade with here So, you know, I'll tell you this is just a small representation of you know The overall day that we've had the I it was the I I nn trade We had bimmy my size you know a lot of these stocks that are or were on the gainers list and where I'm referring to OCG And I mean now that thing is actually down, you know from yesterday's close Let's just go right from top to bottom see what else we have full disclosure I am in one trade right now And and if you were in the trading room just over the last 15 minutes before I started then you know Exactly what stock that is myself and Scott one of our students here. We're talking about it But we'll start off here on I I nn in I don't know what the company does Tell you what for the sake of time and my cotton mouth here So to say we're gonna look to try and expedite the process But for right now, it's making a lower high for as much as this broke out earlier today looks like just a new IPO It seems like this could be a great stock to follow I'm gonna put it on the side list for right now Wouldn't shock me if I end up putting this on the main list, you know at the end of it all But I'd like to see the others first see what else we got Order book pretty thin on this stock or at least you know at times a big spread now the bimmy trade This looks really good so much. So I don't know is this about to get halted Live right now. Is this about to get halted or I guess I should say again Right now. Let's see once Twice three times four times at least this would make at least the fifth hall Right now at least five times Norman. You just said that right there. Yeah, so BIM. I'm hey I'll take it good halts on the way up bad halts on the way down So this thing has been through the ringer also today seemingly and put it on our main list Definitely watch to that 194 price. Definitely watch major resistance up top at two We'll go from there Looking good What's also looking good right now is the trade that I'm in I'll show you folks in just a moment My size now at this point kind of dropping back down this stock has been such a Teaser of a stock for I don't even know at this point like probably since as long as I've been employed At least for like five years, honestly, you know just looking at like the the weekly chart You could just see I mean even here goes to show this stocks been probably split over and over reverse split That is you know for a number of years these pops and drops, you know There's the weekly chart but goes to show this has not been a good swing trade for quite some time You know definitely good day trade when we happen to see good volume volume getting filled on the trade And you know today ran up nice, but at this point right now no big surprise right now to see this pull back I'm gonna pass on this trade for right now, you know Keep it in mind for remainder of the week. Keep it in mind going forward perhaps There was a day trade not a swing trade on this one. All right Let's see what else we got got a bunch of war and so also kind of like populating the percent gainers list So now I'm just trying to like quickly skip over those Perry I guess trying to squeeze up here again, you know for a $29 stock not really that interested in it You know if it was moving moving faster different story It was the best of times and worst of times here on this LIDR. That's for sure and goes to show again Once this gets halted on the way down Almost always that's game over for the most part. That's a wrap I guess you could have had a little you know bounce at some point that you're there but Uh Jaguar not much going on there not the car company, but health company Getting a new car on Thursday. I looked into Jaguar I mean for as well as I have to say I've been doing this past year day trading I'm not paying 750 50 bucks a month for a sedan. You know at least not yet on a lease That's for sure I'm going with Alfa Romeo. Nice Julia All right, I'll hop over to the loser's list for right now fun what goes up comes back down again I mean Fausto harped on this earlier this morning Talk about a short squeeze these short squeezes end up coming back down pretty fast Say the same on VT and R Looking at the daily chart there See what else got James here in the chat board says Jag was the best car I've ever had Oh, I'm sure it's a great car. It's like the F type was my dream car, you know College kid and coming out of college and all that eons ago, but Some point maybe next car. All right the way Bitcoin is moving definitely in the next car. All right Let's see what else we got though folks. I say that in slight jest. All right, NXT pop from Norman. Let's see. Yeah, great call No brainer this NXT the great call definitely going up is I was going from top to bottom. So You got one of us chatting me right now saying check out the Maserati sedan Well, that would probably be in a competition with my F type. Let's see Let's see. All right, I'll tell you what I didn't jump to the stock that I was in I don't know. I guess for some reason I skipped over it. I don't know why that was the case But prog PR oj. That was the stock that I was alluding to so prog definitely gonna put on the main list Now this stocks been a bit of a sleeper throughout the early afternoon the late morning And I really hope this thing doesn't crap the bed now because it'd be really transparent with you I'm not gonna give the number But this is actually my largest share count for a stock above like let's just even say three bucks So, you know, I've been trading a couple thousand shares here and there But this is definitely my biggest position that I've ever traded in terms of the number of shares I guess I could say less or I guess I could say I've traded more for like a 50 cent stock or 40 cent stock But I rarely trade those it's to say this though folks prog I'm putting on this list not because a minute I'm in this trade for a good reason though. We've had too much buying off of four too much buying off the 397 opening print price, you know, I was commenting on that to Scott who's in who's in our trading room now And you know, he's long also on this trade with me from 397 he moved to stop up with me We've hung on this trade since if it's not gonna break any lower There's only one other way it's gonna go at least that's the thought and so far and that's what we're getting 420 is our next big level after that 450 after that five If this thing shoots up to five, I will be made man. Perhaps I'll be getting that F type sooner sooner than later All right, let's see Alan you're in it for also one of our trial members joining us here live I love it. All right, cool. Anyone else is in this trade. Let me know. I don't want to jinx it The sound of that is me knocking on my wood desk. All right, if there's anything else though folks up down left right more than five percent Typed in the chat board. Let me know though here Not a crypto day. We'll talk about Bitcoin and all the good stuff tomorrow I closed out my position that I was in on phantom FTM That thing just exploded the last two days. So You know pushed up even higher after I got out, but I'm happy Talk all about that tomorrow Mark D one of our gold students in from 405. All right. All right. We got to get a pop soon though Sooner than later here tick-tock. We got to get this thing to break that 420 level If not, then I guess I could say the same thing vice versa if it's not going to break any higher Then we might have to see this thing begin to pull back bit of a pennant building right now to live All right, I'll tell you what I'll check Benzinga pro myself I don't see anything else though from YouTube or Facebook live. That's fun I think that we pretty much touched upon them all Look at Kara here. Kara looks pretty good popping up on my Benzinga pro news feed or my signals feed rather It's you know trading not as much volume compared to what we would normally like to see the stock make but that's actually a pretty interesting Reason for me to put this on the afternoon list right now You know, it's more than what the bare minimum we would look for is and you know It's just to say this stock had a huge pop and drop day back here in you know late August time It has a huge gap for it to potentially attempt to fill Not bad not bad up seven and a half percent this Kara stock and the spreads not bad either I mean liquidity checks out pretty decent for right now, you know the more this pushes up the faster It goes that's not going to be the case. So, you know, we'll see if this thing can make its you know Move here soon. All right, I don't know if I talk too fast, but I'm looking at the time here 245 I'm like making great use of time folks and that was that I was the plan But if there's anything else though folks, let me know. Otherwise, I think we're just about good here Actually really quick on the prog trade I was talking about a trend line before and I Mixed up a stock or two. It was the prog tree that had the trend line test And I wrote that in the chat board inside cyber group before I even started this meeting But this is the trend line. I was alluding to the trend line test off the highs So it broke it but now it's got to begin to you know continue to break resistance going up WTRH from John, you know, I did see this trade earlier today The WTRH are actually like, you know prior to starting this meeting. So I appreciate you typing it in now, John Reminding me of it and not only that I think I skipped over it as I was going from top to bottom here Right now though, it's just so flat string such There's so much volume on the order book for it to break So the question is like even if it does move up, how much more is it going to move up? That's the question. That's like kind of the reason why I like the the carrot trade Because the order book isn't really that Liquid, you know, if this thing really wants to go it will and it would get halted fast You know the prog trade itself definitely has a lot of volume on the order book It has to try cut through and that one's even taken sweet time. So that's my only concern It would be like watching the grass grow. I feel like that that's it I hope I'm wrong because that's just that stock treated us pretty nicely over the last month So for right now, I'm not going to put it on the main specialist But wouldn't be a bad idea to keep on like the back end of your side list there All right, folks I think that's just about does it for me for all of us joining us on social media Facebook live YouTube I appreciate you sticking with me here each and every day each and every afternoon If you have any other questions, you would like to ask stocks in which you would like to go over with me on the side Or even crypto feel more than free to do so my email address right here in the chat board Josh at c2 trading calm That's right. That's right. I'm sorry last one from P trader. What about the II and then right? We said we were gonna get back to that. We said it was on the side list Almost finished up without going back to the II and then that's right, you know what it's pushing back up over the last five minutes I'd like to see that, you know, it looks like there's a small iceberg order on the ask at 7 20 at 12 13,000 share order So, you know, that's something to focus on and for right now because of this move up I like this good call. Yeah, I appreciate the reminder of this one on this one again Just getting ahead of myself there All right, so post my email once more though folks Josh at c2 trading calm If you're ready to make the plunge join us live inside our live trading room alongside Lita and Al and James mark John Norman and the hundred forty of us otherwise live feel more than free to do so by going right down to the link on the Banner below there the stream just to get yourself started Otherwise though, I'm gonna just take a small break I'll be back on the mic myself at 3 30 Eastern time folks and then and then we'll go from there All right, I'll talk to you all then


Okay, so let's do a lecture on figuring out the equilibrium constant using the pKa values, okay? So what we're really doing in this type of a problem is, so it's really nice they gave us both the reactants and the products, okay, and they gave us the pKa values, okay? So we've got most of the information that we need. In fact, since we're doing a little lecture, let me actually read the problem that we're going to be lecturing on. It says, given the pKa for acetic acid is 4.76, the pKa for acetylene is 25. Determine the equilibrium constant or the keq of the reaction and indicate which side of the reaction equilibrium favors by drawing in the equilibrium area, okay? So we've got to remember a couple of things in order to do this problem. First off, well, how do we figure out what the equilibrium constant is? There's an actual equation, do you remember that equation by any chance? If you don't, it's all right, I'll help you out. Products over reactants. Yeah, so it's the kA of the reactant acid over the kA of the product acid, okay? So a lot of people want to think it's the products over the reactants because you learned equilibrium constants back in GenChem too, right, that that's what it was, but if you combine, so remember this is an equilibrium reaction, it's the reactants going to the products, but the products going to the reactants too, and when you combine all of that information and then use the pKa values, or the kA values, you actually invert that equation. You can do it algebraically. So try to do it on your own just to convince yourself that that's the kA. But anyways, the kA of the reactant acid and the kA of the product acid. So what do we need to do now is figure out what is the reactant acid and what is the product acid. Well, this problem kind of helps you out, pushes you in towards that answer by showing you that the pKa of this is 4.76, the pKa of this is 25, they don't give you a pKa of this or this, neither does the reading of the problem. So it kind of tells you what's the acid and what's the base. So hopefully by now you've figured out that this is acetic acid, which is the acid base. Okay, so it might be helpful to go over to the other side and write in conjugate acid and conjugate base. But the same thing should be obvious to you that this is the acid due to the fact that it's got a pKa of this, right, so conjugate acid and conjugate base, okay. You might think, well, I don't see, you know, remember a base, what does it have to have? Usually it has lone pairs, right, or a pi bond. In this you might say, well I see a pi bond, but I think that the basic part is over here. You'd be right, this is what I was saying, if you don't remember from Jim Kim that when you have a metal non-metal bond that's actually an ionic bond, not a covalent bond, you'll forget that that carbon there actually has a lone pair and a negative charge like that. Okay, and the acetic proton is this proton here, okay. So recall that and that it'll also help you out. So when and then if you really are worried about it, I think it's right here, NA plus next to it over there, okay. And we can do the same over here, right, so hopefully you see that, does that make sense for what I've said? Okay, cool. So well you might say, well I figured all that out, what's the acid, the reactant acid and the product acid, but I have the pKa, but not the kA. So how do I get the kA from the pKa? Well remember the kA is 10 to the negative pKa, okay, so you're going to have to remember that also in order to do this. So 10 to the negative 4.76, let's do that in our calculators here, okay. And I get 1.74 times 10 to the negative 5, there's no units here, okay. Did you get something like that, okay, wonderful. So we want to do the same thing over here, right. This one's easier because it's not, it's an integer, not an integer, right, so 10 to the negative 25, we'll just write that as 1 times 10, or 1.0 times 10 to the negative 25, okay. Any problems with that one? Okay, so hopefully now it's fairly evident that we can get the keq from this point, right. Okay, so let's just get that keq. So the kA of the reactant acid, 1.74 times 10 to the negative 5, kA of the product acid, 1.0 times 10 to the negative 25, so give my calculator out, put some things in here, okay. So when I do that, I get, so it should be a big number, right, 1.78 times 10 to the 20, and that would be something you would expect, right, because when you take this 5 that's on the bottom, 25 on the bottom, bring that up, then it becomes a positive 25, you add 5, negative 5 plus positive 25, you get 20, okay. So now you've got to ask yourself, because there was an additional portion of the problem, it's a draw in the equilibrium arrows, right, so you've got to ask yourself, is this keq greater than or less than 1, way greater than 1, right, so that means it's going to go towards the product, you just draw in the equilibrium. Any questions on that one? Yeah, does it make sense? Okay, wonderful, you think you could do it on your own? Yes, sir. Okay, wonderful. I'm going to answer some more problems about that.