Hi everybody, it is Swing Jam with Xtrades and today I'm going to be doing a general market update. The goal of this video is to highlight sectors that are most likely going to get rotation in or bullish inflow while avoiding or shorting those sectors that seem to be relatively weak and to help members strategize a game plan to come up with the next two to four weeks of price action. So the first stock we're looking at today is Apple. As we can see, this purple level seems to be the key support level as of late. It had two bounces from this head and shoulders pattern we saw end up leading to a retest of this old former high at 157. Apple then formed this inverse head and shoulders but seemed to fail and are now making lower lows and lower highs. If we get a break below this purple support, it should be a nice easy draw down to 162.27. As we can see, that's some short term resistance here. It also lines up with 100 SMA. That was decent support back in October and the start of the year. So I think that's most of what will happen as we're seeing a lot of outflow out of tech. We're also getting lower highs from January 2022 to February 2022. Next is cloud computing. The chart's a bit messy but the key thing here is to look at this recent 21-16 level. As we can see, this is one of the only ETFs to actually break its local low and it's with increase in volume as we will see. It's a common theme with these stocks that are retesting their local lows. This is not something I want to be buying right now. The major confluence point of 22-43, we can see that all of these moving averages are rolling over and if we're comparing this to QQQ, QQQ has been riding this anchored view up here that's from the September 2020 highs. As we could see, cloud is around 20% below those. So this is a stock or an ETF that I'd be looking to avoid at all costs. Next is gold. This has been one of the most relative strength sectors we've seen in the past week and a half. If you look at the weekly timeframe, this purple level is showing a lot of significance. As we could see, support became resistance, became support again and it has been resistance recently. But on the weekly timeframe, we just broke above that level with volume. As we could see, now we're retesting this red level. It's not as strong, but it's decent. It's a daily level. So I have a weekly level and we're forming an inside candle on the daily. So what I like to see here is by the end of the week, so by Friday we get a close above 178. That would be pretty bullish. We don't see that. We'll most likely see some sort of continued consolidation while the 8 and 20 SMA try to meet up with price or a gap fell back to 174. Next is IBB. I would remain pretty bearish on the sector. If you look at the sector chart, so that is IBB versus spot on the weekly, we could see it showing a lot of relative weakness. Really hasn't been leading since 2015, but even the entirety of 2021, it's been making lower highs and lower lows. So this is not a sector that I'd be trying to buy with the recent recent weakness and stocks like Moderna and Pfizer. It doesn't really make a lot of sense to try to go along this sector. And we did break again the local confluence point. You'll see that as a common theme in this video, which is below 129.81. We broke below that. So the game plan, you can either try to buy this local low dip at 121.94, but I don't think that's a great buying opportunity. It was old resistance. So it is possible it could become strong support and it might give a two or three day setup which could back test this 128 level. But as we could see, if we go towards the 2021 area, we could see this is a large distribution range with a clear breakdown back test and continuation towards the downside. So I don't really see any sort of risk to reward setup that would result in any swinging of any sort of longs in the sector. Next is IWM, definitely the strongest major ETF. We're talking about SPI QQQIWM. This is definitely the strongest one. As we could see, we're just below the 20 SMA and this green anchor VWOP, but I still think that this sector is the strongest out of the three. However, on the weekly timeframe, this sector is very, very weak. We don't even need any charting annotations here.  We back tested this old support, which became new resistance. And now we're getting four candles in a row with large upper wicks, two of those testing this down trending eight SMA. So it's very clear that there's not many buyers stepping in. I think that the goal should be to try to sell most stocks as I don't really see any sort of buying pressure coming in. And shorting this towards $191 wouldn't be a bad idea. There's better setups in other sectors, but I am not very bullish here. Next is Chinese internet stocks. We had a gap down and gap and go towards the downside. Notice how we opened right below the two key anchor VWOPs and we gapped below the two key moving averages. This is not something to be bullish in. We had large volume coming in Friday and there's a good chance we test $33.66. This is Microsoft's pretty quick one here. Head and shoulders is forming. It's a real head and shoulders in the sense that it's actually making lower lows. I see a lot of people in the x-trades chat, sorry, signaling head and shoulders when they're making higher highs than neckline. That is not a real head and shoulders. It either needs to be flat or making lower lows and this one does qualify. And again, it broke below the confluency level at 301 back tested it and then started down trending. So the odds are that the magnet level or the next major support will be retested next week at 282.46 and lines up with the year to date anchor VWOP from 2021 and the resistance we saw in July and the support we saw in October and January. Next is QQQ. The major anchor VWOP to watch here is the one from the September 2020 highs. We saw one retest, the second one, the third, and this is the fourth. Every retest is getting weaker bounces. So I don't really see this as being a good buying opportunity. As we go zooming into the sectors like cloud computing, the ETFCLOU, which we covered earlier in the video, we see that that one's actually making lower lows. So I don't really see this dip buying opportunity as a good risk to reward setup. We're making those lower highs, those lower lows, and it broke that very key confluence level of 354. We back tested it and rejected it pretty hard. Next is SPI. Magnet level is looking very similar to Microsoft as it most likely will test this 429 level as there's really no good support until then. You could say this level right here at 435 is decent. If we open above it, there's a chance we might rally back to 441, but I don't really see this as a good setup. We had a range from November to January. We broke down. We retested this red resistance level. We tried to gap up and reclaim the 50 SMA, but it failed and we've been downtrending. As you could see when SPI rallies, it likes to use the 50 SMA as support. So the fact that this is one of the first times we've seen in a very long time where we tried to retest it, we couldn't even reclaim it, and then started making lower lows, that's a very bearish sign. Next is TAN. This in healthcare, I'm the most bearish on as we could see. We've seen relative weakness since the start of 2021. Key lower highs in the making. We kind of got a bear flag setup with a back test and a breakdown. If we look at the two major stocks, EMPH had the nice earnings report, but it hit the resistance and faded very heavily. Solar edge didn't really do much on its earnings report. Had a slight gap up, but hasn't really been able to make anything. If we look at the rest of the components of solar, like sun W, we could see that we've seen immense relative weakness. I mean, from the 2021 highs of the recent local support, we're seeing minus 93%, while for TAN, we're down around 50%. So with XLE, which I'll cover later in the video, showing a lot of relative strength, it's a pretty safe bet that we'll most likely see at least a retest of 57.85. Next is Tesla. This stock has had two major turning points in the change of character. The first one was 11.821. As we could see from this candle, we saw a lot more volatility, especially towards the bearish side. Before then, we didn't really get consecutive bearish candles with large spreads close to each other. Now we're seeing that with a lot more commonality and the ranges are a lot more volatile and they're not as clean as we've seen prior. The second one was this more recent gap down on 124.2022. And for the first few days, the volatility was pretty steep, but then it kind of started flattening out and making a very small range. We had a breakdown back test and a breakdown with a lower low. It's okay. I think it's a pretty clear sign to say that the market movers, the big money, whatever you want to call them, is selling anything above 9.36. I mean, we have like six, seven upper wicks here. And we've had a very basic reclaim of the 20 SMA that's been pretty terrible. It lasted for a day or two and continued to fall. And we're getting all these moving averages starting to roll over. This is the minor confluence area in this purple box and we've seemed to reject that area. So it's possible we retest this 9.8 level again, but I'm seeing no indication that we're going to actually break above this level and retest only like 9.78. And if you look at the weekly timeframe, we could see more lower lows with more lower highs. Next is XLC. This is the weakest spider ETF that I've seen. As you could see, these major interview ops have all been getting broken recently. The local low that spies formed that has not been broken yet on 1.24.2022. It was even broken last week. So it was a pretty clear indication that this would be leading towards the downside. Broke the two yellow anchor view ops, but now it's bottoming at this old resistance level. It's a decent spot if you want to try to day trade it or do a one or two day swing. I could see the setup, but for me personally, selling that's having this much relative strength, I don't think that's a good idea. It's a much more likely chance that it will retest 64 before 70. Next is XLE. Definitely the strongest sector in 2022. While most sectors have been seeing a 20% decrease in price. This one actually saw a 20% increase in price. It's holding this 20 SMA now and starting to form a range. If you're trying to do any sort of swing trades, even longer term investments, I think energy is definitely going to be one of the best sectors to look at. With the possible Ukraine and Russia conflict that could cause XLE to hit this weekly resistance level at 80, it makes sense to even have just a little exposure in case that happens. We'll most likely see a pretty strong rally. One of the only sectors to actually hold the 20 SMA continuously and make higher highs and higher lows. This is a clear definition of a relative strength. And if you're looking to do any bullish action, I'd be focusing here. For the shorter term, wouldn't be surprised if we pulled back to 65, as we had a large rally, having consolidation or a minor pullback after a large rally is healthy. What I don't want to see is a close below the 50 SMA. Then it would look a lot weaker structurally. Next is XLV. We're having a double head and shoulder setup. The first one already broke down and finalized. That's the one in red. The second one is the one in green. So we could see lower lows on the neckline and clear shoulder head and shoulder formation. The 50 SMA was used as the resistance point to launch the rejection or making lower highs and lower lows. The recent confluence point, which we've seen at 130, was back tested. It had three moving averages and an anchor view up there that rejected. So again, not much to be bullish here on. I think a pretty safe bet would be a retest of 125. It's possible that QQQ anchor view up that's been holding very good support. That's a timber of 2020 high could be seen as the low. But most likely I think XLV is heading to 118. Sector's been very weak. I think there's a pretty good risk to reward that this does get tested. Next is metals and mining. One of the only sectors of recently to have a really nice clean base and a breakout look at the weekly timeframe. Very nice tight price action and a breakout. I wish the weekly close was a little bit stronger, but we're seeing a lot of volume flow in there. So we could see this major purple level. The midline of the range is all the weekly resistance. As we've seen recently, we consolidated within that zone and we had a strong breakout. Consolidated again and had a strong breakout above the local resistance. We are bull flagging into support here. We go to the smaller time frames. You'll see that if we go to two hour. This sort of support old resistance now becoming new support is looking pretty good. We'd like to cover the sector ETF XME versus spy. This is a very good way to visually see relative strength in the sector. And as we could see, these two had a sort of a range here. We had a mini breakout at this purple level or dark pink, sorry. And retested this another dark pink level. This one in particular, this 0.11 level is very good weekly resistance. So I think any sort of breakout here would definitely lead to a test of this white level and most likely lead to this other test at 0.13. This would most likely indicate that XME if we go to the XME weekly chart will probably want to hit this, sorry. Want to hit this 57 level, but it could get all the way up to 66. Since it's been consolidating for almost a year on the weekly time frame, it could really move pretty quickly. And the fact that it's making higher highs and higher lows and using the eight SMA as a rally point is very bullish. I'm gonna do a very quick recap here of what was covered in this video. The first thing is, TAC is very weak to making lower lows, lower highs in the recent confluence areas like 354 for QQQ and for a spy of 442 and 444 we've seen clear breakdowns of. Look at the more specifically those sector ETFs like cloud computing is very, very weak even selling out an even cover in this video like ARC. Again, very weak, we also have TAN, very, very weak. Things that are also weak are healthcare and biotech. These are sectors we look into short. Things that are showing strength, things that you should be bullish and things that are better for longer term holds as money rotates out of tech. It's gonna most likely find its way into metal and mining. Maybe even gold if the Ukraine situation happens, we could see a quick rally to maybe even 190 if we go to XLE energy. These stocks are making higher highs, higher lows and holding those key moving averages. Could even go to those steel stocks, even though sector ETF is flat. Look at NUE as of late making those higher highs and higher lows. So hope you guys enjoyed this video and I hope you guys have a great trading week.


Welcome to the Edge Caching Dynamic Apps talk. So we're going to talk about content delivery networks. So who here knows what content delivery networks are or uses them? OK, awesome. So my name is Michael May. And my love affair with content delivery networks started a couple years ago when I started a company with my friend Richard Schneemann down in Austin, Texas, called CDN Sumo. And CDN Sumo is a Heroku add-on. The idea being for it to be super easy and quick to get performance benefits with a content delivery network and without actually having to know too much about how they work. So at the end of last year, CDN Sumo was acquired by a company called Fastly. And Fastly is a content delivery network that's built on the open source varnish cache. So today we're going to talk about caching and some ideas that make caching work. We're going to talk about content delivery networks and how those actually work. We're also going to talk about some interesting and innovative features in some content delivery networks that enable this thing called dynamic edge caching. And then finally, we will talk about how you can integrate dynamic edge caching into your Ruby and Rails apps. So the whole idea behind caching is that I have a piece of data. It lives somewhere, whether that's a hard drive or a database wherever it is. And I access that piece of data pretty often. So I want to make that access quicker. And the way you do this is by moving that data closer to where it's being accessed and also moving it into some sort of storage that works faster than where it normally lives. And so also a side effect of caching is that when you cache data, you can also reduce load on the original storage location where that data lives. So let's start out and define some terminology that I'm going to use. The first is cache hit. And this is just when requested data is contained in the cache. Now the inverse of that is a cache miss. And that's when the data is not in the cache. There's also this thing called the hit ratio, which is the percentage of accesses that result in a cache miss. So the higher your hit ratio, the better performance you're going to see. There's also purge, which is when you remove data from the cache. And your origin is just your HTTP application server. And finally, the edge is an HTTP caching server. Now so caches generally are much, much smaller in storage space than your original storage location. So we need some sort of strategy to determine what should live in the cache. And so one of the ways, one of these strategies is called least recently used, also known as LRU. And so if we were to define an interface for how this worked, we'd need a set method, which puts things into the cache. We'd also need a get method, which would take things out of the cache. Now these get and set methods are also going to do something else. Because caches have a limited amount of storage, so we need to keep track of how long a piece of data has lived in the cache. So the way we do this is the get method. When it puts something in the cache, it will also move a reference to the head of the cache. And the head of the cache being the location of the cache that was most recently accessed. Now the set method is also going to, if the cache is full, call a prune method. And so this prune method will just remove an object from the tail of the cache. And the tail of the cache here is an object that's been in the cache for the longest amount of time without being accessed. So LRU is just a strategy to determine what data should live in the cache. And if we were to implement this, we could use two different data structures. We use a hash table to store the actual data. This gives us those constant time get and set functions. And then we could use something like a doubly linked list to track the time since last use. So I'm going to briefly mention all of the different types of caches. So at a very foundational low level, you have the CPU and hardware cache. And on top of that, you have main memory, which is a cache for your hard disk. And then on top of that, you have software caches and application caches. And then further up, you have things like memcache d and varnish cache. And at the very top, we have content delivery networks, which we are going to talk about. So a content delivery network is a globally distributed network of cache servers. And so the way this works is when people request data, those requests are routed to edge caches. If the data lives in the cache, that request will be immediately returned to the user. Otherwise, the cache will go out to your origin server, fetch that data, store it in the cache, and then pass it back to the user. Now this edge cached circle in the middle actually looks like this. So we have edge caches all over the world. And we call these pops, which stands for points of presence. And so the way that this works is say you have a user who is in Sydney, Australia. And your application server is in Ashburn, Virginia. Now there are many thousands of miles between Ashburn, Virginia, and Sydney, Australia. So it takes a long time for data to travel there. So the whole idea behind content delivery networks is to offload as much data as possible from the application server and put it somewhere closer to the user. And that's the whole idea behind content delivery networks. Now traditionally, when you think of content delivery networks, you think of them as typically only caching static content. And so static content being things like images, JavaScripts, style sheets, things that don't change very often. And now the good thing about static content is that it's super easy to edge cache, right? Because we have things like the asset pipeline, which is super easy to use. You define an asset host config. You set that to your CDN URL. And then when you compile your assets, the asset pipeline does its thing and automatically builds your reviews with the links out to the CDN. So that's super great and super easy to do. My thinking on why content delivery networks typically only cache data is because caching data is an inherently hard problem. And then so when you distribute your caches all over the world, it just multiplies that complexity. So let's stick into content delivery networks. And let's talk about how data and requests actually get to the edges. Then we'll talk about controlling this content using HTTP headers. And then we'll talk about some lesser known interesting CDN features. So how data gets to the edge, the first thing we need to know is that there are two types of CDNs. There are push CDNs and there are also pull CDNs. So the way that push CDNs work is when you manually sync your content out to the edges. And this usually happens when assets change. So if you add some new images or you update a piece of JavaScript, you're going to have to manually go out and also sync those to the edge nodes. So one of the downsides of doing this with push CDNs is that it can be harder to keep your assets in sync, simply because we're human and we can forget to do stuff. One of the other things to note here is that if you have a lot of content and you're pushing this content out to your edge and your origin server is under a high load, this is just going to increase your load there. So that's the thing to watch out with push CDNs. Now the other type of CDN and the one that we're going to talk about for the rest of the talk is called a pull CDN. And the way this works is that the CDN actually pulls content from your origin server. So this is great for us as developers because we get seamless updates when content changes. So we don't have to worry about syncing data to the edge. Now however, there is a small latency cost on the first requests that you make. And that is because pull CDNs act as reverse proxies. And if you're not familiar with a reverse proxy, it's just a HTTP server that sits between your user and your origin. So when requests are made by your user, they first hit the HTTP proxy server. And then the proxy forwards those requests onto your origin. And if we look at how this works for pull CDNs on the first request, the user makes that request for a piece of data that request is routed to the edge. That data is not going to live there because it's the first request. So that cache will then make a request to the origin. The origin passes that data back to the cache. The cache caches it and then forwards the request back to the user. So that's kind of a long process. But on your second, third, and any subsequent requests, these will be super fast because when your user makes a request, they'll go to the edge node. And the edge node can come back directly to your user with that content. So you'll note that if there's a large distance between your user and your origin server, this is where content delivery networks come in. So now let's talk about how requests get to the edge. And when requests are routed, they're usually routed to the edge closest to where you are located. And the way this happens is when the client makes a request, this request triggers a DNS lookup. And DNS will resolve this request to a specific geographical region and then forwards that request onto the CDN edge. So this is a pretty high level view of this. There are a lot of people that I work with who know way more about this than I do. But this will just give you a good idea of how those requests are routed. So now we know how requests get to the edge and how your content gets to the edge. Let's talk about how to control that content. And the way we do that is with HTTP headers. So there's this thing called the cache control HTTP header. And I'm sure many of you have used these and are familiar with them. The way that the cache control header works is it defines what requests can be cached and for how long to cache them. So the whole idea behind cache control is to prevent any sort of caches interfering with the normal request and response cycle. And if you remember the LRU strategy that we talked about, using cache control headers will override any default caching mechanism that's built in. So there's a number of directives that we can specify the cache control. The most common is the max age. And we pass in a time in seconds. And so cache control max age, this defines how long the response should be kept in the cache. And this request, and this directive, is respected by all shared caches and private caches. So here when we're talking about shared caches, we're talking about a content delivery network. And we're talking about private caches. We're talking about the browser. And generally, you use max age as kind of an umbrella strategy to say, hey, cache this. There's another directive in cache control called private. And the way that private works is it indicates to shared caches that this response cannot be cached. However, private caches, likely browser, can cache it. So you generally use private when your responses contain some type of sensitive user-specific information that you don't want to live in a public shared cache. Now there's also another directive called s max age, which is a little less known. And s max age indicates how long to keep a response fresh, i.e. cached. And this is only respected by shared caches. So browsers won't honor this. And this is really useful if you want to set different cache links for your CDN and your browser. You can also specify for things not to be cached. So you can use no cache, or you can use max age by setting it to 0. There's also another HTTP header called surrogate control. And here surrogate refers to reverse proxies. And so in a similar fashion, you can specify a max age. And what this surrogate control max age header does is indicates how long to keep the response cached. However, it's only respected by reverse proxies, like a pull content delivery network. So here's an example where we're setting both the cache control and the surrogate control. We're setting cache control to 3,600 seconds, which is 30 minutes. And we're setting surrogate control to a long time, which happens to be a year. So what happens here is the surrogate control header will take priority over cache control. And the surrogate will cache this content for one year. The browser will cache it for 30 minutes. So this is useful if, for instance, you want your users to periodically update your content, just in case something changes. So they always have the freshest version of the content. But that content will live on the edge for as long as you specify up until you update it. Now, also an interesting thing to note is that the surrogate control header is sometimes stripped out by the surrogate cache. And if you think about it, this just kind of intuitively makes sense, since browsers and private caches won't honor this. We might as well just strip the bits out and save the bandwidth and not send it to the browser. Now we're going to talk about some interesting features that you might not know that content delivery networks, some content delivery networks, have. And before we talk about the first one, we have to know a little something about good old transmission control protocol, also known as TCP. And this is a protocol that web browsers use to connect to servers. So it's important for us to know something about this. But specifically what we need to know is how TCP establishes connections. And this happens with this thing called the TCP handshake, also known as a three-way handshake. So what happens here is when the client wants to connect to the server, the client will first send a SYN, which specifies some synchronization data. The server, when it receives that SYN, will send back a SYN-ACC, which is an acknowledgment that it got the client's request. And some more synchronization data. And then when the client receives the SYN-ACC, it will, again, send an acknowledgment back to the server. And then data can start to flow through this connection. So this is a pretty long process. And depending on your connection, this can take 100 milliseconds or something. So that's a lot of latency to do just for opening up a connection. So there's something called HTTP Keep Alive. And this is actually an HTTP Keep Alive header. So the way it looks is connection keep-live. And what this does is keep the TCP session open for an extended period of time. So what we're doing here is eliminating this TCP handshake that has to happen by connection, by instead keeping the connection open. Now when we're talking about Keep Alive and content delivery networks, what this means is that edge nodes will do Keep Alives with your origin server. So this means you will get faster cache misses, because when the edge has to go back to your origin to request content, that connection will already be open.  In some content delivery networks call this dynamic site acceleration or DSA. So the next thing we're going to talk about is instant purging. And the way this works is this goes from right to left. So the way this works is when a user or someone or whatever updates a piece of content on your origin, when that update happens on your origin server, the origin will issue a purge request out to the nearest edge. And so when the edge receives that purge, it will do the purge and then pass that on to all of its nearest neighbors. And you basically recursively do this until some period in time when you determine that all of your edges have purged this data from the cache. This is actually a pretty hard distributed systems problem. We have an engineer at Fastly who's done some research and given talks on this. It's really interesting. So I put the link up here. It's brusespang.com slash bimodal. And slash bimodal because the algorithm that we use is called bimodal multicast. So at Fastly, when we do these purges, they have an extremely quick. So they happen globally in less than 300 milliseconds. So when you think about it, that's an extremely fast time for anything to happen globally. And so because these purges happen so fast, this is actually what enables dynamic caching at the edge. And we have a blog about our Instant Purging feature if you're interested, fastly.com slash blog slash building fast and reliable purging system. So Instant Purge enables dynamic caching. So we're going to explain what that is. We are going to use an example to explain Rails fragment caching as well because that is a type of dynamic caching. And then we're going to map how that works to edge caching. And processes are very similar. So first we need to define what dynamic content is. And dynamic content is data that changes frequently. However, frequently changing data doesn't mean that it's continuously changing. So there's periods of time when this data is not being changed. And so dynamic caching is when we cache this data in between when it's being changed. And this can be extremely beneficial when your dynamic data is being requested multiple times. So to give you an example of some things that we can dynamically cache, we can do things like API requests, comment threads, news articles, product inventories, and even things like search results. So the way that dynamic caching works, there's three steps. So the first one is that you need unique cache keys. The second step is that you need to bind a piece of data to these keys. And the third is that you need to purge this data when it changes using the cache key. So as an example, let's take a look at Rails fragment caching. And so the way this works is in your views, you define things that you want to be cached with the cache keyword, and then you provide a cache key. So this will prevent generating your entire views every time and can speed up how your views are built. And now when that data changes in your controller, you will issue, you'll call the expire fragment method with your cache key. And that issues a purge and removes that data from the cache and then updates it once it's regenerated. So I want to tell you that if you understand and can do Rails fragment caching, you can also do dynamic edge caching. The processes are very similar. So just to look at a real world example real quick, let's take a look at a dynamic page like Pinterest. So if we were to cache this dynamic content here, we might break it up like this. So the first thing that we might want to cache is these individual pins, right? This entire thing. If we wanted to take it a step further, we could cache the user content here, the avatar and the name of the user. And then if we wanted to go even further, we could cache things like the number of repins and number of likes, things like that. And of course, since these images and avatars are static, we can also cache those. So this is just kind of a strategy to give you an idea of how you might break up some of these dynamic things to cache. And so what happens is when this data updates, you issue purge requests and the cache is refreshed with the new data. So let's talk about how you dynamically cache things on the edge. So remember, the first step in this process is to create your unique cache keys. And with CDNs, we use these things called surrogate keys, which are your cache keys. And surrogate key is actually an HTTP header that tells the cache to associate a key with a particular set of data. So step two is to bind a piece of data to this key. And the way we do this is we set surrogate key response headers on HTTP get methods. So as an example here, we have a product endpoint. We're doing a get for a specific product. And so on the response in the headers, there's this surrogate key header. And here we're specifying two keys. The first is products, which will map to the entire set of products. And the second one is a singular key, product slash ID, and that will map to just the singular product. Now the third thing we need to do is to purge this content when it's updated. So what we do is issue purge requests on HTTP post put delete methods, anything that will update data. So here, following our same example, we have this product endpoint, we're doing a put, we're updating the price. And if this was Rails, we'd have a product controller with an update method. So in that update method and your request handler, you would issue a purge request with your surrogate key. So that will purge this from the cache and then refresh the cache with a new data. So let's talk about now how we can do this with Ruby on Rails. So heads up, there's a gem called Fastly Rails, github.com slash fastly slash fastly Rails. And this contains a lot of helpers that I'm about to show you to make it super easy to do this. So the first step, right? The first step was to create unique cache keys. So in Rails land, what we do is we're gonna extend our models with surrogate key instance methods. So the way this looks, here's our product model. We're defining a thing called a resource key. And so this will be a unique key for a singular instance of a product. There's also a thing called the table key. And this is going to be a key that will map to the entire set of products. So that's step one, creating cache keys. Step two is to bind data to these cache keys and the way we do that in Rails is we add helpers to Action Controller to set up these helpers. So in our products controller, the first thing you'll notice is that we have this before filter called set cache control headers. And you'll also notice that we're only doing this on index and show methods, which are our HTTP get methods. So what this method looks like, we're setting cache control response header and also surrogate control response header. And we can define whatever values we want for this to live in the cache. You'll also note here, the last line here, we are stripping out the session data so we're not sending any session data or cookies to the public cache. And the reason we're doing this is because session data is private data and we generally don't want it to live in a public shared cache. Now back to the products controller, we have our index and show methods. You'll notice that we are, before we respond with our data, we are setting the surrogate key header. And in index, we're using the table key. And in show, we're using the record key because the table key maps to the entire set of products which index does. And the record key maps to a singular one, so it maps to show. The way this method looks is just like this. You set the surrogate key header response key to the key that you pass in. So there's the first two steps. The third step is to add purge instance methods to your models. And what this looks like is here we have a create action in our products controller. So after we create a new product and save it in the database, we'll issue a purge all. And so this purge all will purge the entire set of products from the cache and then subsequently regenerate the cache with the new data and this product that we just created will be contained in that. So likewise, we can do that with the update method. So after we do the save, we call purge. That will delete this product from the cache and it will get refreshed on the next request. And likewise, we can also do for delete. This works the same way as create. After we delete it in the database, we do a purge all. That will purge the entire set of products and then refresh it so that the product we deleted will not be there. So there's the three steps to integrating dynamic edge caching with your Rails app. And all of this stuff I talked about is in the Fastly Rails gem. Now if you decide that you wanna go and do this to your Rails app, the best way that I found to do this is to take an iterative approach and go kind of end point by end point controller by controller and add this just as a way to keep your sanity. So that's about all. And so just to wrap up and hit some key points. If you're not already offloading static assets for your web apps onto a content delivery network, you should do that because things like the asset pipeline make it super easy. And you can get really great performance gains just from doing that alone. The second thing is that we talked about instant purging and HTTP keep lives. And so purging is what enables this dynamic caching to happen on the edge. And if you do decide to add this to your Rails apps, which I hope you do because your users will love you, take advantage of all of those helpers that exist in Fastly Rails. And so that's all I have. Thank you so much for listening and thanks to all the organizers of Garuko.


Big 12, speaking to one of the best teams in the country. They've had a very inconsistent year, you're talking about Baylor, you're talking about Kansas. What is the handicap in the Big 12, BJ? Yeah, it's, I don't really have much interest in taking the top four seats. Kansas is very weird. They've had a ton of close calls this season. They're obviously one of the best offenses in the country, but at two to one, obviously this is a, you know, they're gonna be playing in Kansas City. It's essentially a home tournament for them, but at two to one, I have no interest in betting them. Baylor, they lost their best interior defender, Tachua, middle of the season, and they're also one of the worst teams in defending at the rim. So that's problematic for them. Texas Tech is starting to fade down the stretch. One team I'm kind of looking at as a long shot is Oklahoma at 20 to one. They're starting to come on here. They've won three straight down the stretch and their first round match against Baylor is a really good one. So I just mentioned Baylor's one of the five worst teams in defending at the rim. Well, Oklahoma is sixth in the country in two point field goal percentage and shooting around 60% on shot attempts at the rim. So it's a really good match for them here in the first round.  How I feel about Tennessee is that analytically they grayed out really, really well in terms of defense and offense, but there are just times where you watch Texas and they just go through these shooting slumps that just take them completely out of the game. So they're one of the teams I'm going to potentially be avoiding. You know, Kansas also is one of the street your teams in the, obviously in the whole country. So they could fall flat and lose here in the second round or they could, you know, breeze all the way through the tournament, but Oklahoma, the team that's starting to kind of come on, especially at a good price of 20 to one with a pretty good match against Baylor in the first round. I think the Sooners do have a little bit of value here in the tournament. Stucky, agree or disagree? Yeah, I probably would disagree. I think it's going to be hard for Oklahoma to get it done. And then I think Baylor ends up walking to the final because they must be salivating for another, they lost twice to Texas Tech this year in two close games and Texas Tech is kind of headed and I just don't trust their offense, but Kansas is very vulnerable. Just if you watch them, there's just something that's just not right on the defensive end with this team. They can get bullied a little bit inside at times. TCU did that twice. TCU beat them bad at TCU. Then they played two games in a row. Kansas after getting embarrassed comes home, they come out, the crowd insane, one of the best home court advantage in all college, best way to go up double digits. TCU fights all the way back. That game went right down to the wire with Mike Miles, one of the best players in the country, if you haven't seen him for TCU, he was a massive foul trouble the entire game. TCU number one offense, a rebounding team in the country, just extremely physical. So look, I think that they can beat Kansas in the semifinals, it's a good matchup for them. Miles is incredible. The problem is TCU for whatever reason, it just didn't match up well with Texas during the regular season. They lost both meetings fairly easily. So it's like a little conundrum there. If you can find like 25, 30 to one on TCU, just three games in three days, I think that they can certainly make a run here because I think that they match up with, well, with Kansas and who knows, Kansas could go down to Kansas State, if Kansas State is hitting their threes. So yeah, I think TCU is the sleeper, I think Baylor gets there, but Kansas is the vulnerable team. And you might hear a myth this year, you'll hear this every year around this time of year, that it's hard to beat a team three times in the conference tournaments, teams that swept the regular season. Over the past 30 years, teams that swept the regular season have actually covered a 52% clip in the conference tournament. So that is a myth. Just as most time, there's a reason the team got swept, it's because it's maybe not a great matchup. There are exceptions with injuries and things of that nature, but just thought I'd throw that out there. So yeah, if you're looking for, some of these are just fun, like 30 to one, a 25 to one, TCU doesn't shoot a lot of threes, which I don't like, but they just get a ton of offensive rebounds. But some of these are fun.  And for TCU, it's going to be a three day tournament. I'd go with horned frogs.


So this is the, I believe this is the last one, number five on the quiz that I think a few people wanted me to go over. So the question says, for the following E2 reaction, so that's a helpful hint. Remember E2 is a one-step reaction, okay? So propose a structure for the major product and mechanism for the minor product in the reaction. Okay, so I'm going to go ahead and just propose that structure for the major product. Probably you all know what it is. The mechanism seems to be harder for this one for everybody. The major product, of course, this is the exocyclic double bond that's going to be the minor product because it's only one to dye substitute. You can get a more substituted product from this. So remember an E2 reaction takes an alkyl halide, gives you an alkene out of it. So that would be, thank you, put the double bond there or there. That would be the same product. So the major product, of course, is going to be if you want to use a metal. Like that. So if you drew the double bond up here, like I think a couple of you did, that would be fine too. Okay, it's the same product. That's the major product. Okay, so now it reminds us that it's an E2 reaction and it wants us now to identify what the mechanism for the minor product is. So can I erase the major product? Everybody got that now, right? I can erase that part.  In fact, I'm not going to draw the C but I'm going to draw the H's there. And I'll remind us that there are three H's. Eventually you'll only, it'll start drawing one H. So now remember we reacted that with potassium hydroxide to an ethanol, okay? So the potassium hydroxide is going to be the base for this reaction. Remember an E2, that's an elimination reaction, so you need a base. But the potassium, that's just a spectator ion and it doesn't do anything. All your spectator ions, just like always, like we've said a number of times, you just don't even put those in the reaction anymore. You just get rid of them, okay?  You're just showing what bonds are being formed and what bonds are being broken. So anyways, what's going to happen?  You don't have pi bonds here so lone pairs are going to start. So where are we going to start from there? It's going to deprotonate the hydrogen and these electrons are going to make a double one there. Is that a double one? There, and that's going to kick off that chloride, okay? And ta-da, that's the step. That's it, E2.  You have to draw arrows that go to the right way, not the wrong way, okay? And you've got to draw all the arrows in the right steps, okay? So for this one, there's actually more arrows than what we like. You know, we've been seeing a number of reactions with two arrows. This one's an elimination, it's got the three arrows. It just got to recognize that, okay? So for those of us who didn't get that mechanism, write it down. I expect you to be able to do it next time we see it. Okay, any questions on that? Okay, wonderful.


Welcome to the series Photographic Chemistry presented by the Foundation of the American Institute for Conservation of Historic and Artistic Works. This program was made possible by grants from the National Endowment for the Humanities and the Andrew W. Mellon Foundation. Each program in this series is presented as a short video. Depending on your video viewer, you should be able to pause, return to a previous section, or skip ahead to a later section by using a scroll bar or on-screen icons. You will find an outline of the course and short quizzes to test your understanding on the course webpage. Now that we know a little about the chemical and physical properties of the silver halide family, let's see how those chemical and physical properties are leveraged in producing various types of silver halide crystal grains. These conditions are often times referred to as the precipitation conditions. They are the conditions which are found in either the single or the double jet experiment that we discussed earlier. There are usually two conditions, and they involve whether there is an excess of one ion over the other. In the acidic emulsion, there is an excess of halide. Now again, there's a chemical reason for this. The salts of halide, for example, table salt, sodium chloride, is a salt of a strong base sodium hydroxide with a strong acid, which is hydrochloric acid. You put those together, you produce salt and water. Now on balance, which base and which acid is strongest determines what happens to the pH when you dissolve a salt. For example, we'll discuss a lot later, and you know from your experience that when you take baking soda and you dissolve a little bit of that in water, the water becomes kind of slimy. It's on the basic side. That's because baking sodium or sodium carbonate is the salt of a strong base sodium hydroxide and a weak acid, carbonic acid. So that salt, when dissolved back into water, remembers where it came from, and the overall net result is a stronger basic solution. This is why the pH of a bicarbonate solution is somewhere around 9 or 10. In precipitation conditions, the silver halides that are formed by the halide salts, sodium chloride, potassium iodide, and the list that we showed in the emulsification equation, when you place these in water, they tend to be on the acidic side. They tend to make the emulsion more on the acidic side of a neutral pH of 7. Depending upon the salt, this is why it's called a neutral or acid emulsion. It hevers around 5, 6, 7 in pH. And this happens when there's an excess of halide, and it depends on just how much excess there is of the halide that will determine where the pH lies. These are critical adjustments in the emulsification process. Smaller changes in pH, remember, is a large scale. So we get large changes in the availability of H plus ion or acid in the chemistry with changes in pH. Now the other condition is the opposite. And this is because we like to form an emulsion that is in excess of silver. Well to do this, we have to solubilize the silver before it has a chance to make a halide. So we need to stabilize it. And what we use as a stabilizer is ammonia. And so when ammonium hydroxide is added, it's known as an anemonical emulsion, meaning a emulsion that contains ammonia. And what happens is the ammonia stabilizes the silver in solution, the silver ion, so that we can get more of it in the solution to react with the halide. So both of these conditions control the rate of growth. Now let me say before we move on how important these two concepts are. And you'll see why they matter in just a few discussions. In one condition, we have an excess of halide, the acid emulsion. In the other condition, we have an excess of silver in the emulsion. And these will play to determine the crystal shape or what is known as the crystal habit in the emulsion making process. So remember this point as we move forward and you'll begin to see where it becomes important on which condition we choose and which process we use to produce a silver halide emulsion. You have completed this unit. Depending on your video viewer, you should be able to scroll back to any point in the video as desired. The short quiz found in the course materials on the website may help you confirm your understanding of the concepts introduced here. Many thanks to the instructor, production editor, coordinator, and the collaborative workshops in Photograph Conservation Committee for their work to make this program possible.


What's up, everyone? It's your girl Kinsey here from Layton Sports Cards, and I am ripping a personal here for Jeff H You've got a 2022 Panini absolute baseball hobby box. All right, best of luck. Here we go goals against average I don't know. I played like in middle school Middle school and elementary school soccer. I didn't play in high school because it was the same time as basketball and none of those Coaches wanted you to play two sports in high school It's hard trying to play volleyball and basketball Volleyball coaches like well, you need to pick a sport. I was like, well, we shouldn't do that See him ever All right, Jeff here we go Yeah, I didn't play Anything but basketball really after high school To Brian Hayes Hodges, we've got rookie shambas out of 999 race Jose of Ray you to 199 Why storm Jonathan India played college basketball out in Nebraska? Probably could have played volleyball too if I wanted to but The dual sports in college are brutal. We've got dual relic auto to 199 Braxton Garrett We've got a drew Ellis on the bat auto out of 50. These are cool Autos on the bat itself nice you need it yesterday and Dual patches to 99 tools of the trade a mere Garrett's Go open a blaster box somewhere Blake. Do you like oh that's sick? I want to see it Blake opened a mega of was a platinum. No, it's a platinum What's the product anyways pulled a gold Bobby with junior auto to really dullest Garcia Ryan Sandberg historical duels to 99 Tom Siever Mike piazza Pete rose to 199 The 25 purple JD Martinez Crawford stand the man was a platinum. Okay Team tandem of a Rosarita and Brandon Lau to 99 Oh cool. Now. We've got booklet to 50 rookie Josiah Gray for Washington Nice 24 out of 50. All right Jeff that'll do it for your box. Congrats. We'll get the cards right out to you


What's up everyone, Takedown here. Welcome back to another hockey curd video. Today we're gonna be unboxing this mystery tin here, which I'm really excited about. So you used to be able to get these from Walmart mystery tin, mystery boxes, different things like that from MJ Holding. Unfortunately, they do not do them too often. So this one here I did buy from eBay and I'm not gonna say how much I paid, but I'm really excited to open this. This is the first time that I got to open something like this and it's really cool. So inside, there is four factory sealed packs, plus 10 assorted cards, and you could also get extra mystery packs and game used cards as well. So I'm really excited to see what is in here. Now of course they're gonna put the series one at 2015-16 pack right on the front, which is doubtful that you're gonna get that. You likely will get something like this, which is 16-17 series one. So yeah, we're gonna see what is inside here, open it up for the first time and see what we might get. So hopefully we're gonna get something good inside. And I do like the idea of them making their own custom tins. I think that's very unique, but I bet you it costs them a little bit, which is why they don't do it anymore. So right up first, we do have these cards here on top that are not sealed or in anything. They're just loose. So we do have Jonathan Fubro. This is 18-19, so pretty recent. We have Lars Eller, P. K. Subain, which is a nice one. I think I already have that in my collection though. Let's move these ones out of the way. We do have Martin Hazal, Patrick Bergerland, I don't know why today it's not focusing really, but Mike Fisher, who I do collect. I think I already have this one. We do have Cody Hodgson.  Drew Samford, Nathan Horton, Shane Doe. And that's really cool. So we did get one that does have a jersey card in it. This is Eric Stahl, a dual jersey card, which is awesome. So not quite sure the value of this, but that is a cool card and nice addition to my personal collection. That right there might be worth it. I'm not 100% sure. Hopefully we will get more stuff out of this. So let's see what else is in here. So the rest should all be the sealed packs. There should be four sealed packs inside. And we actually got five, which is awesome. So we did get, like I mentioned, it was highly likely that we'd get a 16, 17 series one pack. We did get a 1920 parkhurst, which is thick. We do have a hobby pack for 17, 18 MVP, which I do not care for MVP or parkhurst or score, like I already mentioned. And this is the most common out of these mystery boxes, which is 12, 13 score. Usually MJ Holden does mostly score packs whenever you get them. So if it's a mystery box that they done in the back or in the past, where it's a lot of sealed packs, let's say 10 sealed packs, five of them are gonna be score. Unfortunately, that's just how they work. So since these are score and I do not like them, we're gonna quickly skip through. Chris Neal, let's see who we might get, Andrew Ladd. We do have a Philip Cornette's Hot Rookies, which is not one of the top ones. And we do have Steven Wase Season Highlight, which I've had this card before and I put it in one of my mystery packs. So again, not something that is great, but we did get a Chris Neal, which is likely gonna stay in my PC since I do collect anything him. Next up, we have the next pack here. And again, I'm just gonna skip through, see there's not really any big names. We have Melkin Award Winners. We do have David Becquez, the franchise for St. Louis, which is cool. We do have a Season Highlight, Ryan Nugent Hopkins. So a few decent names, but nothing of real value. We do have an MVP pack here. This is again, a hobby pack, which I don't really care about MVP anyways, but it is nice to get hobby packs out of stuff like this. So I'm gonna skip through here. We have Connor McDavid Checklists. That's really cool. I do collect McDavid. Jamie Ben, Zabanna Jed. This is a puzzle piece card, just like that. You can tell because of the sides. Peke Rene, who is now retired, which is cool, Yossi, John Fintes. So we did get some bigger names, but nothing of real value inside that. Next up, we do have Parkhurst, which again, I'm not a fan of, well, I'm not a fan of a lot of these ones that were included. So let's see if they can redeem themselves here. I'll let it focus. We have Colin White's, DePrincket's, Tatar, Derek Steffen. Got to check. Nick Suzuki, which is cool. We do have a silver border for Leon, which is awesome. Lindholm, Chara, before he switched it up. And Dallin. So some decent names. That Chara is gonna be staying in my personal collection, but the rest isn't of much value to me. We do have one pack left. This is the 1617 series one. Georgie's, let it focus there. Gallagher, Kessil, Acom. Oh, we do have a Phil Kessil canvas card, which is awesome. I do PC him. So that's nice to add to the collection. Getzlaff, Mark Stone, and Hannafin. So the top one here in the packs, out of all the packs, one just flew there, that's fine, is Phil Kessil, which is awesome. So we did get some pretty okay cards. Nothing of great value in my opinion. Nothing that really stands out other than the Phil Kessil canvas card, which we just pulled, which is awesome. I'm a huge fan of Phil Kessil, so that's gonna be a great addition to my personal collection. And we do have this Eric Stahl dual jersey card, which again, I do collect him. I am a fan of his, so that is really cool. But for these mystery boxes here, I'm not sure how much Walmart was charging for them back in the day. I would hope something like this, even though it is in a tin, with this included five sealed packs, but you're only supposed to get four, plus 10 cards, and you're not always guaranteed a jersey card. I put it in the ballpark of around maybe $30, is how much this would be from Walmart. This cost me $40 on eBay, that includes shipping. So not really of the value that I spent on it, but still a really cool item to unbox on the channel, and I am pleased with it. So hope you guys enjoyed this video. I'll see you guys in the next one. Please take care, peace.


The development of cities has led to urban congestion being nearly unavoidable for most large-scale cities. Road planning is an effective way to alleviate urban congestion, which is a classic NP-hard problem and has become an important research hotspot in recent years. A K-means clustering algorithm is an iterative clustering analysis algorithm that has been regarded as an effective means to solve urban road planning problems by scholars for the past few decades. However, it is difficult to determine the number of clusters and sensitively initialize the center cluster. To address this issue, a novel K-means clustering algorithm based on a noise algorithm was developed to capture urban hotspots in this paper. The noise algorithm was employed to randomly enhance the attribution of data points and output results of clustering by adding noise judgment in order to automatically obtain the number of clusters for the given data and initialize the center cluster. For unsupervised evaluation indexes, namely, DB, PBM, SC, and SSC, were directly used to evaluate and analyze the clustering results, and a non-parametric Wilcoxon statistical analysis method was employed to verify the distribution states and differences between clustering results. This article was authored by Xiaowan Ran, Shembing Zhou, Mulay, and others. We are article.tv, links in the description below.


You all got a fire cap for 81s? Working on it right now, sir. You've got to just give me a grid. That's all I need right now. So the grid for 81s? Grid is? It will. 6, 7. Line Bravo. November uniform. That's right. Thank you. That's all a copy on Rebex for 81. I'm waiting for them to get RP right now. They said break. It's just tighter or tighter or so. It's locked out.


The ultimate scam in this world is I literally am one of the only people talking about this. All those in the million therapy with the therapist and psychologists do it. Sometimes people when I do a talk like this, they go, Tire, are you a dog? You're speaking on health. Are you a doctor? Are you you're speaking on psychology? Are you a psychologist?  Do you have a Harvard MBA? I go, have you noticed doctors have failed us? Nobody's healthy in America. Almost nobody. Everybody's unhappy. Psychologists have failed us.  Economists and business teachers have failed it. So I've gone on my own and it's a tragedy that I have to do this. But I do this as an opportunity. I make my mess, my message. You and I are the victim of a time in history.