Hello. I'm Phil, and I'm going to talk to you today about code review and how you can become a better developer, hopefully, by doing code review. As a developer, you might think that code review isn't something you really want to do. You want to write code, not read code, but I promise you it can help. So, just a little bit about me. I work with WordPress.com VIP, and we do cloud hosting and support for high-profile, high-traffic WordPress sites. We look after some of the world's biggest runs who are using WordPress every day. We keep their sites secure, scalable, and safe. And we do that through code review. One of the reasons why these runs use this is because we do code review. It's one of the top things that they say is a benefit of the service we offer them. So, hopefully, quite a few of you have seen this. This is the first line of the automatic CREED, automatic being my employer, obviously. And as a developer, you have to learn constantly, all the time, because web development never stays still. And you can do that by doing code review. So, what is code review? You're basically looking at standards, the standards that are around to help you make sure your code is of good quality. You're looking for simple mistakes. Everyone's done the odd missing semicolon thing. Send it to checking, making sure the code does what it's supposed to do, making sure the logic follows through. And also looking for any performance issues. Maybe you've accidentally put in a nasty query that's going to load on every single page of your website, and it's going to take your database down if you get a spike of traffic. So, why do it? So, you want to keep your site safe? You want to make sure it's secure? You want to make sure that it's not easy to hack? You don't want to leak any papers about tax avoidance, for example? You want to make sure that it's scalable? That if you do get a nice big spike of traffic, or you've got a high traffic website, that it's going to handle that traffic? That you're going to be able to take several million page views, for example? You want to make the code readable as well?  This is terrible code. Or you can't understand what it's doing. You've got a bunch of code and it doesn't say anything about what it's actually doing. So you need to make sure it's understandable. Finally, but not obviously not least, is to learn. You can learn a lot by doing code review. You learn from your own mistakes when you've gone back to your code many years later. You see what you've done wrong and you can fix that in the future. You can learn from other developers' code, you can see what they do differently, pick up on different ways to do things just from reading their code. And this is what helps you to become a better developer. You look at code and you see other things, you see mistakes you've made and you can learn those. You can use standards and internalise those and make sure that when you're writing code in the future, that actually you're remembering those lines that you've read before. And you can take that in and think, hang on, previously I might have written this conditional this way, but actually I'm going to write it in this way because I've seen that before and it seemed like a better way to do it. Or I know it's a better way to do it because the standard said so. So there's lots of ways you can do code review. You can do automated code review to start with. One of the ways you can do is use PHP code sniffer. And there's some WordPress coding standards that you can use with PHP code sniffer to automatically look at your code and say, well, this could be better. You should do this conditional in this way, et cetera, et cetera. So it's very, very light touch. You don't have to do a lot. PHP code sniffer will also, if you want it to, can actually rewrite your code to a certain extent to actually help you comply with those standards. There's a thing that we use in VIP called VIP Quick Start and VIP Scanner. Quick Start is a development environment. Some of you may have used varying vagrants before. VIP Quick Start is basically VVV but slightly customised. It comes with VIP Scanner. VIP Scanner will scan your code with the PHP code sniffer and WordPress coding standards but then it will also tell you things that are likely to be issues. It will tell you if you've got a really bad query or it'll tell you if you're using things like extracts that might make your code unsafe. You can do your continued integration testing. So you could use things like PHP code sniffer or other tools as you're committing code into a repository to just check that code as you commit it in and tell you flag any issues there. And there's also a tool called WP Enforcer which is pretty neat. It also includes the coding standards and we'll do some other stuff for you. The best kind of code of view in my opinion anyway is manual code of view. So actually getting somebody else to look at your code, getting someone to read your code. So on VIP this is what we do. Every single bit of code that comes into us we review manually. So we've got something stupid like 10 million lines of PHP and 7 million lines of JavaScript that's all been reviewed by a human being. Maybe even me. And that's one of the best ways because you learn then from each other. You learn what each other does and you learn better ways to do things, better approaches to writing code. It helps you to internalise those standards as well. So the more and more you read code and the more and more you see the same things pop up, you fix the same issues, you actually start to just remember those instinctively. So one of the reasons why I've become a better developer since doing code of view as part of my job is because I can write code and I can instantly know to write it in a different way than I might have done before. Because I've internalised those standards of code of view. Anybody want to offer an opinion as to when not to do code of view? No, because trick question, never. I am guilty of not doing code of view sometimes. Even little changes can break a site so just be careful. Finally, we're hiring. If you want to do code of view and come a better developer then come and join VIP if you like. Or just go and look at our documentation, have a look at the code standards that we hold our clients to and you'll hopefully make your sites more scalable and safer. That's me, thank you. Good morning everybody. My mayor's talk today about why switching to WordPress code standards will ultimately make you a better developer and increase the quality of the code that you're writing. I'm a senior front-end and WordPress engineer at MateDo. We're very proud to be sponsoring this event for the third time. That's my blog and you can catch me on Twitter. A bit about me and my story with coding standards. I've used a little bit of some standards like PSR2 in the past. Never really stuck, moved on from that quite quickly. I'm quite OCD when it comes to things digital really. So I like structure, to have something to stick to, something that's nice and predictable. I've started to work more on team projects a lot more. At my previous agency, I was very much responsible for the whole life cycle of the site. There's very rarely I'd be involved in large team projects, but now at MateDo that's changed an awful lot. I've moved into writing plugins and I'm trying to contribute to CORE an awful lot more now. So I'm a lot more conscious about the quality of my code and how other people are going to perceive my code. At MateDo, we work with an awful lot of external agencies for designer marketing. So again, we're more conscious about the product that we're handing over. That's got to be good quality and they need to be able to get back into that at a later date. So that's something we're aware of. I switched for PHP back in September last year, so I'm still a fairly recent convert to coding standards myself. So what are they? Ultimately, they're rules that your coach should conform to and will be checked against. There's four language-specific standards, so you've got PHP, HTML, CSS and JavaScript. Pleased to say that accessibility coding standards have just landed recently. So with that, it's not so much just one language, it's just the whole site, the plugin, looking at ways to make sure it's more WCAG compliant. Developed for WordPress CORE, official themes and plugins, that was the initial goal of the coding standards. And they've been written by the community for the community, so this is not just one person or one organisation. It's just like, here's the standards, everybody's chipped in a little bit. What surprised me was they've actually existed in some form or other since 2009. Again, I'm quite late to the party here, but I really thought they might have only been around for a year or two, but they've been around for a lot longer than I thought. So what are they not? They're not just for the hardcore. You don't have to have mastery over all the code that's in front of you to use these. Any of us can be using coding standards. They're not just for core contributors. Okay, that might have been the initial target audience for these standards, but any developer doing any kind of WordPress work can be using these standards. It's not a definition of right and wrong. It is just the WordPress way. This is how we do it. While it's open to a debate to a degree, there's no point really arguing these are the standards. That's the way that you code with them. Get on with it and start writing more code. They're not there to make you feel guilty, so you might get a couple of indents incorrect, or you might miss some spacing in a file. It's going to happen first couple of weeks, so I found it quite difficult switching, because I'm used to doing things one way, admittedly, slightly more messy way, but you get there in the end, but it's not to guilt trick people. It's just to provide more of a structure. It's not going to add more complexity to your code. I've actually found in certain situations it's removed complexity in places, which I think is really good. There are just 10 benefits of switching. From my point of view, there are many benefits of switching over, but I just want to run through 10 of my own. Reduce stress. I'm not thinking about it anymore. I'm not worrying. I'm actually writing more code as a result of being less stressed about it. It's more readable. The indentation, the spacing, the structure, naming of things, so much more. It's just so consistent and makes it so much more readable. Much better for teams. All your code is going to look the same. When it was, there's no individual developer's fingerprints. We've all got our little bits and pieces that we do. They're going to be gone. Everybody's singing from the same hym sheet. It's the same code no matter what. Future proofing. So deprecated functions, ignore them. You're always reminded to use new or alternative versions. That's good because if a function is taken out of WordPress and a few releases time and you're still using it then, that's a major issue that you're going to have to rectify then. So this way it's protecting you from that. Faster debugging. So as a result of the code being more readable and easier to scan through, you're going to get to those bugs quicker. You're going to find that line in that error, that notice that you got on the home page. You're going to be able to get to that, suss it out more quickly. It's easier to read and understand, so you can actually be a lot more productive when you're debugging. Things like Yoda conditions are a good example of avoiding really pesky bugs. Typically you would have the constant on the right, the variable on the left, but if you omit one of the equal signs in that, then it's just going to be truthy. It's going to be a silent bug that you might take a little while to actually find. So this way you'll actually get an error if you miss an equal sign here because obviously the expression won't work the way it should do. Better inline documentation as well.  It's really nice. As a result you're going to have much more detailed documentation of your code, which is great for you and it's great for everybody else working on the project. The code is going to be more secure. It's more consistent validation, sanitisation and escaping of the input and the output. So you'll have no shocks, no surprises. Escape all the things, kind of mentality. It is really good. Better database queries because instead of using WPDB, it's always going to encourage you to use WordPress API functions and classes like WP query. Why not leverage existing caching and performance optimisation benefits? Do that. Don't try and touch the database directly when there are many other ways for you to actually do that. The code is a lot easier to maintain. Certainly in the world of open source. If you can put the code down, walk away from the project and know that in three years' time somebody can download the GitHub repo and it's wonderful to read. It matches the standards that they know and love. It's really good for people working on projects in the present but also in the future. I'm just going to briefly touch on what you would need to do to switch for PHP, to sniff the PHP. You need to get, as Phil touched on, PHP co-sniffer. You'd install PHP.cs on your machine. You can use Pair or Composer. If you're on a Mac, you've got Homebrew as an option for that as well. Then you would just add the path to that PHP.cs command on the system to your global path. That means it's in a global installation that you can use across the system. Get the coding standards rules from GitHub. You can get them from using Git, Pair or Composer or if you just fancy downloading them. You can do that the old-fashioned way. Pop them in a suitable directory. I put mine on a dot folder in my user slash daty green on my Mac, so it's hidden away. Very little chance I'm going to delete that folder accidentally and it's a nice and centralized location. Decent code editor. A couple of examples here. I swear by Sublime. Colleagues that make do use Atom, but all of them will have some support, whether it be a plugin or baked in. Just find something that has that plugin ecosystem where you can download something or actually has it. I think PHP Storm has it baked in at the box, which is useful. Then just configure PHP Code Sniffer. Once you've set that up, you've pointed it to where your rules live on your drive. There's various options. You can check on save. You can actually change the way that the errors are made available to you. I just have mine in the taskbar at the bottom, but you can have much more visible, a drop-down that shows you all the errors on the page. As Phil touched on, there are ways in Coesnith where some of the issues that you face can actually be resolved automatically for you. That's a little bit more fiddly to set up, but once it's there, it's a dream to use. Just a quick example of the output. Some basic code here. These are actual messages that will come out. There's no full stop on the inline comment. There should be one space after the if keyword. The parenthesis. There's no space before and after. Yoda condition needs to be used there, so that needs to be reversed to avoid those pesky bugs that are touched on. There should be an extra space before the closing bracket on the third line there. It's just a sample of what the output would be, really. A couple of useful resources. There's the core handbook on coding standards, and then the get-hold repos, really, for PHP Code Sniffer and for coding standards themselves. Just a comment to wrap up. From my point of view, switching to WordPress coding standards has done more than anything else in recent memory to improve the overall quality of the WordPress code I write. I wish I'd switched earlier, and I encourage you all to switch now and root the benefits. Thank you for your time. Hello. Can you hear me? Good morning, everyone. For all the front-end developers in here who thought they were going to get a SASS, Stiley SASS talk, I'm sorry. I'm talking about Software as a Service. So, yes. Can you hear okay? Yes. So, yeah, the dirty part of WordPress, making money out of it. So, last year I moved our agency towards building a product rather than doing client work, and I'm going to be talking about our journey in creating a product, why we chose to create a product, why we chose SASS, and why WordPress is a good platform for building a SASS product. So, I'm going to press space bar. Yeah, there we go. That's me. That's the new product we got, and that's my Twitter, RaisinCo, so feel free to flower with me with lots of lovely tweets. Okay, so, why build a product? The simple answer is scalable. So, it was always a desire of mine to build a more scalable business rather than selling my hours. So, it started out life as a plug-in on the WordPress repository, and I'm going to talk about the journey from repository to its own self-hosted install as a WordPress. So, the problems I had with the repository are three-fold, really. The first is, in an early stage of building a product, it's very hard to know exactly what your product should look like. You make a lot of assumptions and you make a lot of guesswork. Very informed guesswork, mind you, but you're making a lot of guesses, and you need that feedback loop so you can really find product-market fit with what you've created. I found on the repository it quite hard to generate any feedback because there aren't many mechanisms by which you can contact the people who are installing your product. So, if you've got a plug-in in there, you can't capture their emails and you can't integrate any chat system to talk to them, not that I'm aware of, and I think it's against the repository rules. So, once we bid our plug-in out in the wild, it was very hard to say, hey, guys, what do you think of it? What do you like? What don't you like? So, this was our... That was the first version of the plug-in in WordPress in the repository for free. We bid it out for free on the repository because we knew we wanted this feedback period so we could iterate and learn what worked and what didn't work. So, that was the first problem with the repo. The second one is updates. Now, the repository does give you some information about the usage of your plug-in. We can see how many installs we have, but it also tells you which version people are using. We can see that a lot of people weren't updating and it's really frustrating, especially in these early stages. We've got this idea for a product, we want to put it out there. You're getting lots of feedback or you're trying to get feedback and you make a change and nobody's changing, nobody's using the new work, so that was quite frustrating. Even... Yeah, so nobody updates, really. Well, they do, but 40% didn't. Maybe they installed it once and never used it again. Again, you can't get any insight on the repository into how people are using your product, your plug-in. So, that was a bit frustrating. The third one I mentioned is gathering people's information for feedback, also for marketing. You've got this idea, you've got this embryonic business. You want to get some more traction on it. You can't gather those email addresses and that contact with the user. It's hard to market your product. It all led us to moving away from the repository and building it as a self-installed WordPress site so somebody would log in, create an account and use what we have built. All those reasons I just mentioned about the problems with the repository are also the reasons why it was good to have a SaaS because we could get that feedback straight away. We could push an update and it would just be live. I wish we had really foregone the repository route because refactoring the code to work on a self-installed with multiple users was a lot more development. Hayhoe life's all about learning. This is what it looks like now. Completely different because we got a lot of feedback about what worked and what didn't work. Once we're on the SaaS, because we capture people's logins at the beginning, we can then learn and use that to contact them and start an onboarding process, which we couldn't do with the repository.  That helped us refine our product offering. The other reason why SaaS worked out really well for us is the integrations that we could do. Wordpress, as you know, has got such a great ecosystem that many of the services out there will have an existing integration. We could plug in to some fantastic tools and services out there that give us better insight. If we wanted to see how people were using it, we could plug in to the services and how people were using it. We could plug in to fullstory.com, which gave you session capturing, or you could do hotjar, which lets you capture the screen clicks in the, what's the word, heat map. That was really useful to get some insight into user behaviour. Okey dokey, hold on a sec. I think the final point I want to talk about is why use WordPress. The lazy reason we use WordPress is because we're WordPress developers. But really we shouldn't have just jumped into WordPress just because that's what we knew. If you're going to go and build a SaaS business, you should look at all the available options and choose one based on that. But WordPress is fantastic for accelerating your development process because it already has built in a lot of functionality. We had user registrations, we had e-commerce functionality which we required, so we could just pick these different modules and requirements that we had, and that were already out of the box in WordPress and helped us massively accelerate our development programme. It was a really fantastic platform to build a SaaS on. I highly recommend it if anyone has ideas to build a subscription site of any sort, or an online business, then WordPress is really helpful in that respect. Finally, I'm going to give a plug out to the post status podcast who recently did a podcast on SaaS and using it with WordPress, and you can get a much more insightful understanding about the pros and cons from that talk, where they talk about that as well. So, yeah, thank you. So just go ahead and raise your hand if you have a question for one of our three speakers and we have a mic runner who will come around. Hello. I want to ask earlier, the dashboard that you showed us just then, is that a customised version of the WordPress dashboard, or is it a new dashboard using the REST API? Neither. It is a front-end dashboard, so we built a module for the front-end of WordPress, and it does lots of things, it integrates with Google Analytics and helps stores understand their data, but it's all on the front-end of WordPress, so you log in to the site and, as a user, you would never touch the back-end of WordPress. You wouldn't know it was WordPress. That's the idea. Yes, first, thanks for the talks. My question is on the coding standards. So, I know, I think it was some time ago now, I looked at the Codex, but the Codex didn't match the coding standards. Do you know if you all were looking for people to update the Codex to match those standards? I mean, coming in as a newbie, we end up writing not in the standards by default if you just follow those. Too sure on that. I think there's some efforts to improve the Codex side of things at the minute, but, yes, I'm not 100% on that. Sorry, not the best of answers. So, thanks again for the talks. Elliot, I was just curious, you, so Yogo looks like it integrates for WooCommerce customers. Is that what you used for actually building your SaaS product, or did you use something else? Yeah, we use WooCommerce in our site. It's really good, and it's what we know, and it's also really adaptable, so it's a good plug-in to use. My first question was, it was answered, it was why to flip the conditions, the Yoda conditions, but you answered that. So, thanks, because there was an argument at work there. I can now go back, and he said it's wrong, and I said, well, I'm not too sure the whole core would have been flipped, because it's wrong, so thanks. The second question was about the reviewing process that you were saying. Just recommendations on, if I'm reviewing something else's code, obviously I'll be making changes to it. How do you feel that back is a different kind of commission? How do I... What process do you use, basically? I guess it kind of depends... I guess it kind of depends what... You don't have to make that process yourself, so the way we do it is that we get code submitted.  Or they commit code into repository and we review commits individually, and what we do then is we feed back. So we actually say to the developer, this code should probably change because of this, this is the relevant standard, or this is the relevant documentation, then the developer will change it and we'll review it again, and that's how the process works for us. It's probably better that if you're doing code review to actually do it that way so that you've got the developer, the original developer is actually changing their code because that's a better way to learn. If you've got to change your code, then you're more likely to absorb that in and take that in as a thing that you've then learned, you're more likely to absorb that. Rather than me as a reviewer changing your code for you, you're never going to learn. It's like you handing your essay into a teacher and your teacher changing it. That's not going to help you learn. You learn better by just going through that process and doing it because you're unlikely to do that again because it delays you deploying your code and everything. I'd suggest that the way to do it is actually to feed that back directly and have the developer change it. So it's more of a feedback process rather than just going in and changing? Yeah, definitely. Great, thanks. Any more questions? Still have some time? I mostly just do them and don't touch plugins at all, but in Sublime, obviously you've got PHP, Lint and so on, but is there ever going to be, or is there already, an add-in for Sublime that we can use for WordPress standards? Sorry, my area is a little bit bad. Could you just repeat that a bit louder? Sorry, for in Sublime, Sublime Text, is there a plugin that we can use equivalent to the likes of PHP, Lint that we can use specifically for WordPress standards? From what I've seen, there's no WordPress-specific plugin that you can install and that's it. Everything's out of the box. To be honest, I've not looked for a couple of months. I've got a few different apps in there or plugins rather. I've got Sublime, CodeIntel, Lint, CodeSniff, so I've got a bit of a mismash of different things, but if there isn't one that just makes it work out of the box, then there certainly needs to be. It's more for theme and standards for the check after you've created a theme that you can do some sort of review on up there. I've not seen anything on that. One last question. Hi, on the coding standards side, is there anything that you can automatically tie in to do security checks or would that be covered by general code standards? In terms of the sanitisation and validisation? Just craziness that you might put in there. All sorts of things, really. They used to be WP secure.  I've not used anything that's automatically done that. I just base it on the errors repeatedly telling me you forgot to escape this, you forgot to sanitise that, but I've not gone beyond that stage to add anything that automates that side of it any more, really. It's a good point, actually, if there's something out there. There are a few things a lot of the time. It can be a bit more nuanced. It's harder to check security issues with automated code review because sometimes it might be. I can't think of a good example. You kind of have to understand the code and what it's doing and realise that actually that variable just there, the way that variable is formed, it might contain user input and you haven't sanitised it properly and you're only really going to know that by looking at the code and reading it it all might not know that that's coming from user input and that it obviously needs to be sanitised. I think you're more likely to need to do manual code review for those kind of things but I'm sure there is a decent amount of automated stuff that will catch some things but you want to look at it manually for security stuff. Slightly more of an addition to the last one. If you install the word press coding standards for PHP code sniffer it does come with a handful of other coding standards as well which extend it and one of those is the VIP coding standards and while as Phil just said you can't automate the detection of escaping that's been missed and things like that the coding standards will the VIP version will attempt to do it and will catch some of them if not all so you still need to read through but for example I'm in supply when I save something and it's a file I'm not familiar with sometimes it will say you outputted something and we expected an escaping function but we didn't see one instead we saw this or we were expecting WP on slash here but we didn't see it you might want to take another look and go through it but I think another one maybe partially just to kind of pick Phil's brains in terms of how he sends feedback I can be rather sarcastic at times and if anybody's seen my Instagram I've probably had a little bit too much bubbly which is not good when you've done a review and you then have to send feedback and the client is a big company and you don't want to offend them what kind of strategy do you use to write up feedback and make sure that you don't end up saying something untoward because reading code and deciding that this is not good and this isn't good enough for someone that the code is terrible and awful and stuff the consequences how do you get around that and being polite and nice and very politely telling them no I just write your code is terrible, please fix it or more code is terrible by the way that invoice is still outstanding it's a good one it's a good point because as developers we spend a lot of time writing code and we take a lot of pride over our work and what we do so if someone turns around and says actually that's not so great that can be a hard pill to swallow so it's really important if you are doing code review someone is the language you use and the way that you give that feedback is you're not criticising the developer the developer isn't bad the developer isn't a bad person for writing this particular bit of code that might have an issue the code is the problem the code isn't doing perhaps what it needs to do or perhaps isn't doing it in the right way so it's important to use language that reflects that so if there's a Yoda condition or not a Yoda condition for example and it needs to be then you say this condition here would be better off as a Yoda condition so you're not saying anything about the developer you're not saying you've done this condition wrong you're saying that actually that would be better off like this you're not saying it should be you're not saying you must do this you're not telling them what to do you're suggesting that the code would be better if this were to be the case it can be really difficult to get that right and actually that's a lot of what me and Tom do every day is to make sure that we are talking to developers in the most helpful way possible it plays into the learning as well cos we're constantly talking to developers about how it could be better and actually helping them to learn from that to improve their code so that they don't have to wait even longer for their code to be deployed because there's issues with it We are going to have a short break we have about 30 minutes you can go get some more coffee I imagine our speakers will be making themselves available some more questions and want to talk to them your closest and best bet for coffee is in the graduate center so the middle building and we'll see you back here at 10.50 if I'm not mistaken for Julie


And to make a decision, I think that's what happens. What's the worst thing can happen with the decision that you make? It was wrong. Maybe we use a different word. You made a different decision for the situation. I think how we frame it is important. But you have to make a decision.  And you can't. And you can't.  But we've put all these pressure about what you can and cannot do. And so we don't allow you to make decisions. And then we want to be accepted. Yeah, the judgment that comes with the decisions. I don't want more Laurence to not like me because I didn't make the right decision. And you know, I don't care what people think. Yeah, we do care what people think. We care. I don't want to disappoint. I think that probably relates to a lot of you out there. Who disappoint who? You know, I don't want to disappoint my family, friends, etc. I don't want to disappoint myself because when you disappoint yourself, that is a hard thing to live with.


As per the lunar calendar of India, this 13th, 14th of April happens to be the new year. The new year that you celebrate as the 1st of January is made for convenience. The significance of this Indian or Hindu calendar is that it is not just a number game of counting time, but it is about the human experience. It is taking subjective dimension of the human being as to what is happening next 21 days. The sun's energy will be having a maximum positive impact on the northern hemisphere, so it is a time of resurgence, time of blossoming. For every one of you, my best wishes for this new year and may the best be with you. It's my wish and my blessing, you must have a great year.


LifeLink 3 has been named program of the year by the Association of Air Medical Services. The company provides on-scene emergency response and inter-facility transportation. Each year over 100 flight medical services apply for the prestigious award, but this year LifeLink 3 came out on top. This award labels them as a leader in a clinical excellence, safety and a patient first mentality. It's incredible. It's one of the most sought after awards for members of the Ames community in air medical in general, and it really speaks to what this company is about at the core of the company as far as doing the right thing for the patient all the time. LifeLink 3 has seven bases across Minnesota and western Wisconsin. If you've enjoyed this segment of Lakeland News, please consider making a tax-deductible contribution to Lakeland Public Television.


Hey guys, welcome to another battle vid. Now this one is a fun one because we have three brand new laptops, including the MacBook Air M2. And this is a battle between M2 versus Intel 12 gen versus AMD Ryzen 6000. Yes, this is going to be a lot of fun. So let's take a look at the devices we have here and let's start rolling. We'll start off with the M2 MacBook Air. The M2 MacBook Air is a 13.6 inch laptop. You've got a HD Retina display. You've got that notch. You've got, of course, that new design profile. And you've got two USB type C ports that are Thunderbolt that are on the left hand side as well as also MagSafe port for charging. You can use any of this to be to charge. And its starting price is 1199. Now this, of course, is running the M2 chipset. I do have eight gigabytes of RAM. Of course, this is a system and a chip. So it's all integrated together and we'll see how that performs. Now moving over to the Dell XPS 13 plus. This is also a 13.6 inch laptop. It's got, of course, a wider footprint. I really love the look of it. It's got that new flush keyboard and that new flush trackpad look to it. You've also got the kind of touch bar, nom lock. Now the display is 3.5 K. It's almost 4 K. And this is powered by an Intel 12 gen processor. This is the core i7 processor in here. And in terms of RAM, we've got 16 gigabytes of RAM and, of course, Xe graphics, they are two Thunderbolt four ports on this device on either side. Now the last device, of course, is the AMD laptop. This is the ASUS ZenBook 13 OLED. This comes with a 13.3 inch display coming in at a weight of 2.4 pounds. So it's the lightest here with the Dell being the heaviest at 2.73. This also has, of course, the AMD 6000 series processor with AMD radio and graphics built in. So again, everyone has their own graphics chip built into this. Comes with three USB type C ports, two on the right, one on the left. Keyboard layout is a bit different, more raised. You've got a nice trackpad that also kind of changes into a numpad as well, which is actually cool. Both the Dell and the ASUS both have touchscreen displays. Well, of course, you know, the Apple MacBook does not. Now, in terms of hardware, though, I kind of like all of them. They look pretty nice, but I'm leaning more to the Dell with just that really flush more cool look. Now let's move on to displays. We all have some really nice displays on all three devices. The Dell and the ASUS having OLED displays and the Retina display for your M2 MacBook Air. Now, in terms of screen brightness, I have to give it to the Dell coming up first and then the ASUS second and, of course, the MacBook Air M2 third. It's just not as bright as the other two. And the OLED displays just look more vibrant and more rich altogether. So this is where the Dell takes the winning spot there. ASUS second and the MacBook is third. So when it comes to charging, they all use different types of chargers and charging wattage. The Dell XPS 13 plus uses a 60 watt charger. And you've got a lot of cables with that. While the MacBook Air M2 comes with a 30 watt charger with the 8 gigabyte variant I have here. You can get a 65 watt charger with the higher round models or you can buy that separately from Apple. And there's also like a dual port one, I believe. While the ASUS SEMbook 13 OLED comes with a single port 65 watt charger. Now, those are all nice and dandy, but I say nope, clear that all out because I would go with something that I truly like from our channel sponsor, the ArcStation Pro Gone 652. Now, this is a dual port charger. And I like it because it is a 65 watt charger. Now, they do have a 35 and a 45 watt variant. If you need those for your smartphones, what I like this is because the single port use will give me charging on any of these devices right here, which is great. But the dual port to use will give me charging of 40 watts on the very top port and 25 on the bottom, which means I can go ahead and charge my MacBook Air M2 as well as also my Galaxy S22 Ultra and I am good to go. Retails for $54.99 and they currently have a 25% coupon, which you guys can apply and use. So definitely do that if you want to pick this up because this is a great travel charger. And again, we'll work with any of these devices, especially look, Intel, Apple, AMD works at all. Now, I've got to see that we can actually have one charger for all these devices. But what about battery life for all three? Now, we'll start off with the worst battery life in the set here. And that is with the Dell XPS 13 Plus. I was able to get about 10 hours of battery life, maybe 10.5 with it here, especially if you switch to its ultra performance mode, which we'll get to in a second here. Then following up on the second place is the Asus ZenBook 13 OLED. This gave me about 11 to about 12 hours of battery life. And the MacBook Air M2 won this category with roughly about 15 to 16 hours of battery life. Now, Apple says about 18 to me, that is absolutely fantastic and great. And it shows that this is a war course and you can actually take long trips or work long hours while using this device. Let's talk about benchmarks and how that's important. When I first run my benchmarks for both the Intel powered machine, Dell and AMD powered machine from Asus, I did run them on their balance settings. One thing you do have to do for both devices, you want to go in into the device apps for Dell and Asus. And for Dell, you want to go through ultra performance and you want to go to performance mode for the Asus to actually use the full capabilities and run those benchmarks. So I did run my first benchmark with Cinebench R23 here for single performance. The ZenBook came in at last place with a thousand four hundred and twenty five followed by the Dell XPS 13 plus with a thousand four hundred and thirty two. And the MacBook Air M2 came in at the number one spot of a thousand five hundred and ninety six. Now, in multi-core performance here in last place was the MacBook Air M2 at eight thousand one hundred and fifty four were followed by the ZenBook 13 OLED at nine thousand four hundred and thirteen. And then finally, the Dell XPS 13 plus at ten thousand three hundred and eighty three. Now, this is to be noted that both machines, actually, all machines were actually plugged in just to make everything balanced out, because even though the MacBook Air M2 doesn't need to be plugged in for such benchmarks. Now, seeing that all these devices are competitive when it comes to benchmark, let's look at some real world scenarios. So I decided to use, of course, Adobe Premiere, because I can use it across all devices, including the Mac. And in terms of running times, third place, we have the ASUS ZenBook 13 with five minutes and fifty seconds for a ten minute clip coming up. Second is actually the MacBook Air M2 at four minutes and fifty five seconds. And in first place is the Dell XPS 13 plus at four minutes and ten seconds. Now, here's the big caveat here. Both the Intel and AMD machines had to be on, of course, performance mode, and they both had to be plugged in. While the MacBook Air M2 didn't need to be plugged in, there is no mode change in there. OK, so after that, we decided to do some gaming. And of course, you know, we do a lot of gaming on this channel. We looked at two games. Those are, of course, Shadow of the Tomb Raider and Fortnite. Now, on Shadow of the Tomb Raider here, we saw that the MacBook Air M2 got about twenty nine and thirty frames a second for medium and high gameplay, which is actually pretty solid. And all games are run at 1080p, by the way, while the Dell XPS 13 did about twenty eight and twenty nine frames per second, while the ASUS did twenty nine frames per second for both medium and high. So there's a slight edge, but it's pretty much the same thing across the board here with the Shadow of the Tomb Raider. Now, when it came to Fortnite, I'll just put it out here this way. I think Fortnite ran the best on the MacBook Air M2, got closer to 60 frames per second when you're playing Fortnite there. While on the ASUS, which came in kind of second, it was high forties to mid to low fifties in terms of the frame rates, while the Intel 12 gen was at high forties and maybe like 50 or 51. So again, clearly, you can see that the MacBook Air M2 did a much better job here at playing Fortnite. So to me, maybe Apple should stop making gaming laptops or gaming devices. Let's talk about some of the other functionalities with these three laptops. They all have USB type C ports, which means, of course, there's more connectivity for you to do here. So we went ahead and connected them to a monitor using USB C ports. And remember both the Intel machine, the Dell XPS 13 Plus and the MacBook Air M2 both support Thunderbolt, while the AMD machine does not support Thunderbolt, but all have USB 3.2 functionality in there. Now all of them were able to connect to this single monitor and this monitor is from our friends at Cooler Master. Definitely check it out. I do like it and we'll have some more coverage of this monitor later on, but it's got really nice speakers there, USB type C connectivity, Displayport HDMI, also 34 inch curved. But what about multi-monitor connectivity? This is something that plagued the M1 and also AMD devices. Do we see improved functionality here with the Ryzen 6000 and the M2? Both devices do not have multi-monitor connectivity with either the AMD or the M2, while the Intel 12 Gen does have multiple monitor capabilities. As you can see here, just using both ports to connect directly to two different USB type C monitors here. Another edge with the Intel machine with this Thunderbolt connectivity is the fact that you can connect it to an eGPU and have some eGPU functionality as well. That is something that really sets it apart so you can actually have it as a dedicated gaming system and also have as a portable laptop something you can't do a M2 or the AMD machine. Now, if you're going to be using your laptops on a day-to-day basis, audio is very important and all of these systems have some really nice audio. Apple has a quad audio system, but instead of me talking a lot, let's take a listen to all three and see which ones sound the best. I think clearly we can see here that the M2 does a much better job with audio, much cleaner sound all the way through, followed by the Dell XPS 13, which is clean but not as loud and the ASUS ZenBook 13 OLED, which was actually on the much lower end in terms of audio. Since we live in the world where Zoom calls are super important, all three devices have webcams. They're all 720p webcams and to me the quality is not that great in terms of the image quality, but let's take a listen and a look at the microphones and the webcams in action. This is a sample from the ASUS ZenBook 13 OLED, showing you the webcam as well as also a sample of the microphone recording and it shoots at 720p. This is a sample of the Dell XPS 13 plus 720p webcam as well as also the microphone off the webcam itself. Day time, so take a look. Now this is a sample of the 720p camera on the MacBook Air M2 and also a sample of the microphone to see how well it sounds and how it looks. So yeah, there it is. Like I said, the all kind are similar in terms of visual quality. I would say the MacBook Air's microphones are a little crisper and sharper but the visual quality is pretty much the same here all around. So as we come to the end of this battle vid, it is quite impressive to see all three devices giving me something that's quite tangible here and when you look at it through and through there isn't a clear winner but there is a device that does have the edge and I think that is the MacBook Air M2. The reason why is that for the other two devices to either do better or actually perform similar in terms of benchmark results or even functionality, they have to be powered on or they have to be charged or they have to be connected to a power source as opposed to the MacBook Air M2 which doesn't need to do any of that whatsoever and also has the longest battery life in here. Now in terms of other aspects of the devices, I do like what the Dell XPS 13 Plus brings to the table with it's OLED display, it's much more coolest leaker look and I also like the work distribution and lightness of the Asus ZenBook 13 OLED and also the performance you get from there. The one thing I'll say is that look, when you're using any of these two Windows devices either the Intel machine, the AMD machine and you have them powered on for some of the performance mode, they do run really loud, the fans tend to kick up quite loud and that's something you have to deal with and you also have to go into settings to put it into a performance mode as opposed to not doing any of that on the MacBook Air M2. So let me know your thoughts guys. Who do you think actually won this battle for it? Do you think it's the MacBook Air M2? Do you think it's the Dell XPS 13 Plus with the Intel 12th gen or the ZenBook 13 OLED from Asus with the AMD Ryzen 6000? I'd love to know your thoughts because I think this is something a battle that's much closer but also has a win over the slight edge. This is Thundy Esane, thank you and always enjoy your entertainment.


Hello, everyone. Welcome to public speaking. Today's first presenter is Ranjit, and I would ask everyone to give him their full attention. Chantal, could you dim the lights, please? The British imposed a lot of unpopular taxes on the American colonists and didn't let them elect representatives to the British government. In retaliation, the Americans started to boycott British goods. In 1773, Americans in Massachusetts dumped a shipload of British tea into Boston Harbor. This became known as the Boston Tea Party. As punishment, the British imposed laws known as the Intolerable Acts, including the Quartering Act, which made Americans let British soldiers live in their homes. Some of the American colonies created a declaration of rights and grievances which they sent to Britain, but the British just sent soldiers to the colonies to put down any rebellion. This led to the first battles of the Revolution at Lexington and Concord. Thank you, Ranjit.  Now, would anyone like to offer Ranjit constructive feedback about his presentation? Any tips for what he might do differently next time? For example, we were all able to hear what Ranjit was saying? Not really. He needs to speak louder and face the audience. Yes. Great suggestion. Anyone else? He was reading from his paper, so it didn't feel like he was really talking to us, you know? Exactly. It's important when you're speaking to look up every sentence or two and make eye contact with someone in the audience. Anything else that Ranjit could do to appear more relaxed and feel more confident? He could smile more? Yes. Smiling makes us feel relaxed. Oh, and make sure your phone is off before you speak next time. I do have one more suggestion. To connect with listeners, it's a great idea to use a personal story or experience as an example. Can you try that next time? I think so, yes. Next week, my presentation will be about the causes and effects of stress. We look forward to hearing it. Ranjit is first up again today, and I look forward to his new presentation. Jorge, could you dim the lights, please? Good morning. Today I'd like to talk about the causes and effects of stress and how to cope with stress. Stress has many causes, including work or school, life events, changes, or unrealistic expectations of yourself. Some effects of stress include headaches, trouble sleeping, depression, or lack of concentration. I know how hard it can be to deal with stress. Last year I started working after school to save for college, but I didn't have time to do homework and my grades went down. I had trouble sleeping, I only ate junk food, and I stopped hanging out with my friends. Fortunately, I was able to talk with a school counselor to manage my stress. She suggested that I reduce my hours at my job, eat healthy foods, and get some exercise. So I literally started walking home from school and bringing my lunch. I also asked my teachers for extra help. Now I feel better. It's important to recognize when you're stressed and to ask for help. Thank you. Great work, Ranjit. I want you all to reflect on how much stronger today's presentation was. Ranjit looked us in the eyes, he spoke clearly, he smiled at us, and he used a personal anecdote to help us feel more connected to him. Well done. Thank you, sir.


Hi everyone, Joe for jazby's case breaks.com coming at you with a two-box break of 2020 2021 at prism Premier League Soccer the EPL English Premier League Random Club break number six All card ship there are the teams right there some pretty nice stuff in this breakaway release Let's roll it. Let's randomize names and clubs seven times two and a five one Six and Six there's six And seventh and final time we got Jonathan down to Matthew Shearer after seven two and a five seven times for the teams one two three and Seventh and final time after seven we got Everton down to the Sheffield United West Brom combo All right, Jonathan with Everton Andrew with Brighton Hovalbian Robert you got my club Liverpool Matthew with Aston Villa Robb with Man City E 10 with Burnley Jason with Arsenal Caleb with Tottenham Hotspur Robert with Southampton Andrew with Chelsea Teng with Fulham Michael with man United Jarell Newcastle United Chris with wool with Wolves Caleb with Crystal Palace and the Leeds combo ye with the with Westham United Jason with Leicester City and Matthew Shearer with Sheffield United the blades and West Bromwich Albion All right, let's sort this by column B and We'll hit the pause button see if there's gonna be any trades and when we come back We'll have the break My control not working there One keyboard. All right, I'll be right back All right, welcome back folks. There was some trade chatter, but in the end no deals were done But that is that is all right. No big deal Thanks for spending a bit of your your Saturday your Saturday your Thursday with us I'll be here on Saturday though spend some Saturday with me a lot of college basketball to be watched this week And that's gonna be a lot of fun And I'm sure there's some Premier League action happening on the weekend too. Let's take a look Many Premier League acts there is Fulham There's hosting Leeds on Friday tomorrow Saturday slate We got oh, it's an FA Cup weekend Bournemouth and Southampton Facing each other in the FA Cup Everton Is gonna be hosting Man City should be that should be interesting. That should be a good match actually There is some Premier League action happening Brighton will Albion will be hosting Newcastle United and Tottenham the Tottenham Southampton game post phone Oh because Southampton's in the FA Cup, so I guess out of that fixture will be moved elsewhere on Sunday the 21st Looks like Chelsea is hosting Sheffield United in an FA Cup matchup and Leicester City is hosting Man United And then Westham is playing Arsenal Aston Villa hosting Tottenham and this is Premier League action Maybe is there a Monday night game? No, I think on Monday we start a Champions League week PSG and Leone No, that's women's Champions League Australia in a league conca cap men's Olympic qualifier so much soccer going on a lot of footy FA Cup actions and Premier League action this weekend and women's Champions League and tons of college basketball All right. Good luck everybody. Oh kaboom Right out of the gate Jay Rodriguez Kaboom second. That's not gonna fit in a regular top loader. There you go Nice one for Burnley. That's the Burnley shield, right? Yeah, that's Burnley Clarets and that will be for E-10 with Burnley nice one. He's not not a bad player either. He's pretty solid this man city Team logo card is also really nice for Robert. I think these are pretty short-printed. So that should be a lot of fun Right there. All right. Now. Let's see if we got any anyone else. We got Reese Nelson Harry Kane Harry McGuire David Dehea to 195 for man United Here's Jay Rodriguez right there Harry Kane for Tottenham going to Caleb We got Muhammad Saleh nice for Liverpool going to Robert. We got Alexis Mac. Mac Alastair 20 out of 25 For Brighton Andrew with that one nice Obama young card back there Like even some of those common cards could go for a lot in the secondary market. There's Trent There is Tom Kearney to 195 Fulham. That'll be for Tang All right, and the next stack here There's nice emergent Mason Greenwood and a nice Bukal Saka for Jason and Arsenal. It's one of the one of the Probably one of the better players to get in this set That is awesome Jason with Arsenal man United gets the Mason Greenwood There's Ben Osborn I remember these these pulsars are the exclusives to the breakaway set and a nice Phil Foden 55 out of 99 for Man City Robert with that one the Hyunmin Son Another great player to get Caleb Looking for that auto looking for that tried to trade couldn't trade mojo. It's Paul Pogba scored a goal in Europa League action the silver rookie There's Foden again Another rookie. All right, so we got a lot going on here. Here's Fabian Delph for Everton Jonathan so that's to 195. Here's Bruno Fernandez. That's from Michael Golder and man United We got Fulham's Nesquins Cabano for Tang Man City Robert with the Phil Foden Just the base Rookie silvers are always important Ben Osborn Sheffield That'll be for Matthew and the Sheffield West Brom combo and here's Paul Pogba Scored a goal in Europa League action earlier today. All right, that was box one. Here's box two Yes, I hit the bell bell want to make an appearance like what about me? Maybe the bell feels a train whistle in this box here in gold power a one-of-one, maybe Don't be nice. All right, so who are the sad teams in the in the Premier League? It looks like Sheffield United is definitely going down They only have 14 points on the season Next is they're in 20th place in 19th place is West Brom with 18 points Fulham has 26 points So they're battling with pretty much Newcastle and Brighton hoping they don't hoping they could switch out of the relegation spot and Last handful of games can be pretty important for for those clubs right there. I Don't think West Brom and Sheffield have a chance. I think they're pretty much done But Fulham still has a chance to crawl out of the relegation space I think Burnley is clear with 33 points unless they completely S the B Southampton wolves should be fine Leeds Crystal Palace. These are all mid-table teams now Arsenal, Aston Villa, Tottenham Everton, Liverpool Are in sixth place. They're tied with Everton trying to Point-wise it doesn't seem like they're too far off a Champions League spot, but It's gonna be pretty difficult for them. Maybe they'll get fifth. They can get past West Ham United Europa League spot No, that'd be disaster if Liverpool ended up in a relegation battle. I can't imagine that there there must be scenarios Right like what happens if Like what happens if a massive club like Man City or Man United or Chelsea Liverpool?  I Mean, that's disaster right all that TV money is gone There's McAllister For Brighton, that'll be for Andrew all the matchday revenue Although there hasn't really been much during the pandemic, but all that potential matchday revenue in a normal season would be gone. I Think it'd be I don't know what would happen They'd have to sell off a ton of they'd have to sell off all almost all their players There's Nathan Teller There's Timo Werner for Chelsea, that's gonna be for Andrew and Matt Phillips for West Brown That'll be for Matthew They'd have to sell off all of their players and and they'd have to Probably fire a lot of staff a lot of media staff a lot of like social media teams and marketing teams All that would be cut. There's Hector Bellarine for Arsenal Jason Devastator saying Arsenal was headed that way earlier this season. That'd be disastrous There's semi-Age a Jai there's Bernardo said is that any relation to Jai a Jai Jai a Jai is English. Maybe not Is it a common name a Jai? It's not No, no relation. That's for West Brom Matthew. There's Bernardo Silva Man City Robert as to 195 I'm sure Premier League's like the big clubs have like a Plan if that happens if like the worst-case scenario happens there must be like a Small binder behind glass that you'd have to crack with two keys in case of disasters Chris Wood for Burnley. That'll be for ye There's Giovanni Los Elso to 195 for Tottenham. That's for Caleb. There's Mason Mount for Chelsea for Andrew And we got David Dehea 46 out of 99 for Manchester United Michael Golder Joe Wilton Nick Boop Muhammad Salah Tommy Doyle rookie silver wambasaka and McAllister at the end there you have it folks. That was two box random club rate number six of 2020 Penini prism Premier League soccer the EPL. Thanks for watching. I'm Joe. I'll see you next time for another one Little bit later tonight. Bye-bye


هناك ايه في القرآن في صورة البقرة وفرص 132 صورة البقرة وفرص 132 الله سبحانه وتعالى يتحدث عننا يعقوب جيكوب يعقوب يوصف's father of yusuf when he was on his deathbed what does he say to his children? he says وَوَصَّى بِهَا إِبْرَاهِيمُ بَنِيهِ وَيَعْقُوبِ يَا بَنِيهِ إِنَّ اللَّهَ اصطفعَ لَكُمُ الدِّينِ this is what Ibrahim said to his children and this is what Iaqoob said to his children إن الله يصطفع لكم الدين الله chose you to be the standard bearers to be the ones who carry his religion فَلَا تَمُوتُنَّ إِلَّا وَأَنْتُمْ مسلمون إبراهيم ويعقوب they say what do not die unless you are Muslim meaning hold on to your عقيدة when you are experiencing death it's not easy in صورة المؤمنون صورة 23 verse 97 and 98 there is a dua'a that's mentioned that we should all become familiar with وقل ربي أعوذ بك من همزات الشياطين oh Allah I seek refuge with you from the whispering of the satans وأعوذ بك ربي أن يحضرون and I seek refuge with you oh Allah from their presence what is this ayat talking about it's talking about the وسوسة and the presence of شياطين when you're dying because shaitan is not going to leave you shaitan wants to shake you up before you die so you die without faith this is why people used to come to إمام جعفر الصادق عليه السلام they used to say to the Imam أمان باثنين محمد ابن سلمان one of the companions of إمام الصادر he says إن شيعتكم يقولون إن الإمان قسمان أحدهما مستقر وثابت والآخر مستودع ويزول he tells the Imam that your shiaz your followers say that there are two types of faith there's two types of Imam there is faith that is firm it's deep rooted and there is faith that is shaky and depart what does this mean the Imam says it means there are some people when they're dying they panic and they they start having doubts and they relinquish their belief it departs them when they encounter death and there are those who remain firm so then he asks the Imam فعلمني دعاء إن إذا قرأته كمول إماني وستقر أو إمام teach me something that if I do it it will secure my faith because brothers and sisters if your عقيدة if your beliefs are shaky when you're alive what's going to happen to you when you're on your deathbed some of us are عقيدة is weak when we're alive you need to know what you believe and why you believe it so he says to the Imam teach me a دعاء that will secure my faith and it will prevent it from departing me in my last moments the Imam says قل بعد كل فريقة after every prayer after your daily prayers after you finish sit on your moussala don't just grab your phone right away read the following دعاء رضيت بالله ربا وبمحمد النبيا I am pleased with God as my Lord and with Muhammad as my prophet وبالإسلام يدين and I am pleased with Islam as my faith وبالقرآن كتاب and that the Quran is my book and the كعبة is my قبلة وبعليا وليا وإماما and you mentioned the imams اللهم إني رضيت to be him a immat and if you do this if you dictate to your soul your creed you will secure it on the day that you pass away it won't depart


I'm Rymond Szymonowskis and I come from far, far away from Latvia. Where is Latvia? Well, that was the question that was asked by many Americans three years ago during London Olympic Games when US beach volleyball team was knocked out by a Latvian team. And then there were many questions on Twitter. Yeah, so these are Latvian guys. There are many questions on Twitter. Where is Latvia? Do they even have beaches? So I thought they had just vampires and castles and stuff. Well, therefore I wanted to start with a short geography lesson. So at first, according to some movies, vampires live here. But Latvia is located across the Atlantic Ocean in North East Europe, you see there. Well, according to some other movies, this vampire stuff originated in Transylvania, but that's more to the south of the Europe. That's not us. But we have 500 kilometers long beach. And if you didn't know it, so it's 310.686 miles. So we have a lot of beaches, so therefore beware of Latvians when we play beach volleyball. Okay, now back to our topic, date warehouses and multi-dimensional data analysis. Imagine we are building a Rails application which will track product sales to our customers. And we have several models in our Rails application like customers, which have many orders. Then each order is placed on a particular date and can contain several order items. Each order item contains the price and quantity of the product that was bought. And products also belong to product classes. So this is our simple Rails application. And we went also to the last talk and learned that, well, we should use Postgres SQL. So therefore we designed and stored everything in Postgres. And this is our database schema with customers, orders, order item, products, and product classes tables. And so we are proud Rails developer. We made our good-looking Rails application. Then one day our CEO called us and asked us a question. Well, what were the total sales amounts in California in Q1 last year by product families? Okay, we'll find it out. So let's look at our database schema. So where do we store amounts? Okay, we have order items table. There we have an amount column. Okay, we should probably start with that one. And well, we like Rails conventions. We will write everything in Ruby. So we start with order item, some amount. Now the next question is in California. Where we do have this geography? Okay, geography we do have in customers table. Therefore we need to join to order items. Order stable, join customers, and add condition that customers country is USA, state is California. Now in Q1 2014, so where we do have this time information, it's order date in orders table. We have already orders table joined. We need to put condition. So we could translate this condition to that date is between 1st of January and 31st of March. But we would like to stick to the original criteria, and therefore we will extract the year from the date and extract the quarter from the date. And we will use postgres-specific functions for that and we'll limit to that's 2004, first quarter. And finally we need to do it by product families, which means that now we need to join also products, product classes, and then group by product family and get some of that. So we finally got the answer. So it's probably not the shortest query in Rails. And we can take a look that this was what we wrote in Ruby. So this is generated SQL. So probably we wrote it a little bit shorter, but not much. But we could also do it directly in SQL. And we presented the result to our CEO. But then he asked the next question. But also sales cost. Well, we could write a separate query, but this won't be so performant. Therefore we'll modify our query. Unfortunately in Rails relations, we can't make a sum of several columns. Therefore we need to write some tricky stuff. Yes, select explicitly product families, and then some of sales amounts, sales of cost, and then map it just to non-empty attributes. Okay, but then our CEO continues to ask questions. And you need customers count. Okay, we can add also a count of distant customers ID and return that as well. But we start to a little bit to worry that so these are kind of ad hoc questions and we will need, well, each 15 minutes our CEO will call us and we'll need to write some new query. It would be better if we could somehow teach users to write these queries by themselves. So we once tried it and explained so how easy it is to write everything in Rails console and get the result. But unfortunately our business users so didn't understand that. And something's not quite good there. As well as our business is doing pretty well and the amount of orders and order items is growing. And we noticed that when we need to do some aggregated queries on large data volumes, for example, while we tested we copied some production database to our local computer and we got some 6 million lines in order items table. And if we didn't add any conditions that just wanted to aggregate sales amounts, sales cost, and a number of unique customers, it took 25 seconds to do that, so which is not quite good for ad hoc queries. Well, then we asked some consultants what to do and then some consultants came and told that, well, SQL is bad, yeah? You should use no SQL, yeah? Or introduce some Hadoop cluster and write and map reduce jobs in JavaScript which will calculate everything you need. Well, probably also not that we still like SQL and so probably we shouldn't do that. But let's return to some classics. And already 20 years ago, there was one, the first edition of this book was written at the date warehouse toolkit by Ralph Kimball. So I would definitely recommend anyone. So it's now already third edition, anyone interested in the topic, so to read this book. And this book talks about dimensional modeling and what are the main objectives of the dimensional modeling, I'm quoting this book. So we need to deliver data that's understandable and usable to the business users, as well as we need to deliver fast query performance. And how we do this dimensional modeling, so when doing dimensional modeling, so we need to identify, so which are these terms that we see in these business questions, these analytical questions and model our data structures based on that. So let's look again at this question. What were the total sales amounts in California and Q1 2014 by-product families? So the first thing we will always notice there will be some, these so-called facts or measures. These are some numeric measures that we would like to aggregate by some other dimensions. And yeah, and by other dimensions, which means which we can identify in these questions. So we have California, which is kind of customer origin dimension. Then we see some time dimension and we see some product dimension or product family dimension. So when just talking with our business users, we can identify which are these facts, which are these dimensions that we would need to use. And this data modeling techniques and data warehouse techniques suggest that we model our so-called data warehouse, where we will store the data but organized according to these dimensions and facts that we see in these queries. And the typical database schema that is used for that is so-called star schema, because most often that we will see one table in the center and then a lot of tables with foreign keys linked to this central table and therefore it looks like a star. And these are these factor and dimension tables. So let's start from the center. This will be this fact table. So we are using naming convention that will use this prefix for that, for sales data. And always the fact table will contain foreign keys to other dimensions like customer ID, product ID, time ID. And then the measures, numeric measures, we would like to analyze like sales quantity, amount and cost. And then it's linked to the dimension tables. We'll use this naming convention. Start with deep prefix for them. And we see that this is customer's dimension where we see all the customer's attributes. And then there are some special dimensions like time dimension. So instead of extracting some year or quarter dynamically during our queries, we want to pre-calculate them. And therefore for each date that will appear for our sales facts, we'll pre-calculate and store corresponding time dimension record. We'll have some time ID as well as pre-calculated which is this year, quarter, months, both as integers as well as strings which could be represented to users. How we want to represent, for example, quarter name or month name, et cetera. And sometimes we don't have simple star schemas. Sometimes we have these so-called snowflake schemas that some dimensions like product in our case are linked further to some classes or categories dimension like product classes in this case. And if we have a lot of these ones other than our database schema starts to look like. Unique snowflake. And so we will store this star schema in a separate database schema or it could be even separate database if we want to put for performance reasons and how we would manage it from our Rails application. So we create corresponding Rails models on top of these fact and dimension tables. We would have sales, fact, customer dimension, time dimension, product dimension, et cetera. And as these are separate database schema we need to regularly populate this date warehouse schema with the data from our transactional data. And the simplest case would be that we just could regularly repopulate the whole database schema like truncate existing, for example, customers table and then do select from our transactional schema and insert all the necessary fields in our dimension table. Or in case of time dimension so we need to dynamically generate it so we need to select what are all the unique order dates in our case which appear and then we pre-calculate which year, quarter, month they belong and we store these pre-calculated values in our time dimension table. And finally we need to load the facts and in this case we select the data from orders and order items table and extract the sales quantity, sales amount, sales cost and store corresponding foreign key values to our dimension tables. So one thing what we can see there that to simplify time dimension ID generation we are using convention that we will generate time ID as four year digits then two month digits and two date digits so that we always understand what time ID refers to. Now if we return to the original question and how we would solve that so now all our queries will be more standardized so that we always start from the sales fact table and then we join the corresponding necessary dimensions like customers, products, product classes time and we specify conditions on the dimension tables that we need one just USA, California year 2004, quarter one and grew by product families and get the sum. So probably it wasn't a much shorter syntax but at least it is more standardized than we always know how to approach these analytical queries. But still we probably wouldn't teach our users to write these queries directly and we are still limiting us to these two dimensional table models so we want to store everything into these standard two dimensional tables but much better abstraction for these analytical queries is multidimensional data model so let's imagine that we have a multidimensional data cube so probably we can imagine three dimensions but let's imagine that you can imagine multidimensional data cubes with arbitrary amount of dimensions and then in this intersection of dimension values we store measures which correspond to particular dimension values like in our case we have imagine we have sales cube with customer, product and time dimensions and then in intersection for each particular customer, product, time period we store what was the sales quantity sales amount, sales cost and you need customers count for that and there are technologies that well at first in each this dimension some dimensions might be just detailed list of values but some other dimensions could have hierarchies with several hierarchy levels like for example in customer's dimension case in addition to detailed customer's level we have all customers together then we can expand them to individual countries then countries to states then states to cities then cities to individual customers or in case of time dimension we could have even several hierarchies maybe sometimes we want to make the reporting we start by year, quarter, month and individual day and sometimes we want to make weekly reporting and then the same dates we can group together by weeks and then by years where they belong to and there are special technologies that are better suited and which use this multidimensional data model and so they are typically called OLAP technologies where OLAP stands for online analytical processing by subversa traditional OLTP systems which are online transaction processing so these technologies concentrate more on how to do efficiently analytical queries and there are several commercial technologies for that but as well as open source technologies and one of the most popular open source OLAP engine is Mondrian engine by Pentaho and that's a Java library and where you need to write XML so to define some data schemas well we rubies don't like Java and XML so much so therefore a couple years ago I created a Mondrian OLAP gem which is JRuby gem which embeds a Mondrian OLAP Java engine and creates nice Ruby DSL around it so that you can use it from plain Ruby so how let's introduce this Mondrian OLAP in our application so the first thing that we need to define is this Mondrian schema where we do the mapping of these dimensions and the measures that our users will use and which represent these business terms and we need to map them to the fact and dimension tables and columns where the data are stored so let's look at example so we define sales cube and the sales cube will use this fact table f underscore sales then we have defined our dimensions so we define we have customer dimension with this foreign key it will be using the customers table in the data warehouse schema and we specify which are all these levels that we want to use in this dimension and in which particular columns they are stored as well as we define product dimension and time dimension as well and then finally we also describe which will be these measures that we will use in our schema like sales quantity sales amount sales cost which use sum as aggregator but then we have customers count measure which will do the distinct count on customers ID in a sales fact table to get that unique count of customers for particular query and there we use a different aggregator so and now when we look on the same question and how we could get the results using Mongeon OLAP so it's very simple and nice so as we if we look at this so it's a minimum it directly translates the question to our query we tell that from sales cube on columns we want to put as column heading we want to put sales amount on rows we want to put all product families we take from product family level all members and we put this limitation filter that we want to filter just from customers dimension USA California and from time dimension take quarter one 2014 and we get the result so we don't have any technical implementation details which are hidden and created once in this Mongeon schema definition and Mongeon engine as several others internally are using this MDX query language which is one of the most popular query languages for these OLAP tools which looks a little bit similar to SQL but not quite and Mongeon OLAP J ruby jamia does the translation from this query builder syntax to the MDX query language so which will be executed and as a result we get the results object where we can query and get so what are our column headings what are our row headings and what are the cell values so what we are getting there several other benefits of this Mongeon engine is that so when we execute some large MDX query where we do not do any filtering and again I tested it on some six million rows in fact table so initial query also for large query will take some 21 seconds but when we execute the same query second time it executes in 10 milliseconds because Mongeon engine does caching of the results in this multi-dimensional data cube model and it doesn't do caching of these queries it caches the actual results that when we do the new query we it analyzes okay we have already these data cached and these cells these data cube cells we don't have these ones for these ones I generate a corresponding SQL statement to populate the data and as in these analytical solutions so we don't need very up to date information up to the latest second so we typically just regularly populate our date warehouse schema with the data and then while it's populated so it can cache all the results and if many users are asking the same thing so results will be very fast additional benefits are that now we can much easier to introduce additional dimensions based on additional data attributes that we need for example in customers table we had a gender column which stored f or m as values for a female or male and we want to add to our schema additional gender dimension and we can easily create a new gender dimension map to customers table to gender column in addition so for users we want to decode that f means female m means male and we can put this name expression which will be used for generating these names of these dimension numbers or we and then we can use this dimension in the same way as we used in any others and in our queries in addition we can do even more advanced dynamic attribute dimensions for example we have a birth date for our customers and we would like to analyze sales by a customer age and split it to them into several intervals for example less than 20 years 20 to 30 years 30 to 40 etc and but we have a birth date so we need to calculate it dynamically this we can also define a new age interval dimension where we once can specify this more complex expression so that we put there this SQL expression which will dynamically calculate the difference between birth date and current date and then based on this interval it will output either some less than 20 years 20 30 years etc as well as we dynamically generate the new dimension with these values and whenever we make the queries so we we we can it will be up to days to based on what is the current time and finally one of the benefits of this modern engine is that we can make also calculation formulas like we can make these calculated measures for example like profit which is sales amount minus sales cost or margin in percentage which is profit divided by sales amount and we can specify format string that it should use percentage formatting and as a result here we can query these calculated measures in the same way as stored measures and get the results back and also properly formatted and in this MDX calculation formulas so there is well almost everything what you can do in Excel yeah so there's corresponding function in MDX as well so you can do a lot of more advanced calculations there and as a result here these this date model allows to create us also front better user interfaces and for doing ad hoc queries by users so this is a as we don't want to always have to write these by themselves but then these objects what we are using are the same as customers are asking their questions and so this is just example from the easy bi business intelligence application that we are building where we provide just graphical user interface where users can move okay we want this dimension on columns this dimension on rows filter by these dimensions and then view results in table or or in charts and formatted so this is date model is much better for doing these ad hoc queries okay let's switch to couple other topics so we discussed about how to do the queries but let's come back to ETL process so we talked about three letter acronyms SQL MDX so let's talk about in other three letter acronym ETL which means extract transform load in the simplest cases what we looked maybe we can populate our date warehouse just from the operational tables transactional tables in our database but quite often we need many different data sources for our date warehouse some are stored in our transactional databases some are coming from some external sources as CSV files or from REST API and then this process how we extract this information from other sources then we need to transform them probably pass different formats data formats maybe unify and standardize these data to use the same primary foreign keys etc this is this transformation step and finally we populate and load them into our date warehouse so there are several Ruby tools for doing this ETL so one was done by Square named ETL Jam and I want to mention there is one new Jam Kiba for doing this ETL process which is oriented to the row based extraction transformation and loading so this is example from the readme but there you can make some reusable methods that you do some data parsing and then you define some source as a Ruby class and the source could be either CSV or database or something like that and then you can change several transformations and describe in this DSL how you would like to do the transformations and finally you would like to load the data into the database one more thing I wanted to tell that if you do complex transformations then unfortunately Ruby is not the fastest programming language and if you need to process thousands or hundreds of thousands or millions of rows it might be slow but sometimes if we still want to stick with Ruby so maybe we should do it in parallel therefore I recommend to take for example a look at concurrent Ruby Jam which provides several abstractions and one is which is very well suited for this multi-threaded ETL is thread pool that so thread pool is that we can create some fixed or varying size thread pool and we can push jobs to this thread pool and then when it's complete so it gives some result and so then that's probably processed by the next thread pool and which might suit very well this ETL process that we have some data extraction thread pool for example if you fetch some data from external REST APIs it is much faster if it's for example paginated REST API it is much faster start to fetch all the pages already in parallel and not fetch page one by one fetch the first page after the next one et cetera it will be much faster in terms of total clock time to start already let's fetch in parallel first 10 pages then the next 10 pages so we can use thread pool there then if we need to do complex transformation of the data so then we can use the in parallel threads these transformations but there is one pro tip so then please use jruby as jruby can use all your processor cores if you will try to do it in MRI so then unfortunately in MRI just one thread can run in parallel okay or you need to then to make several processes which run in parallel let's look at a very one simple example well we initially looked at single threaded ETL process where we selected unique dates from orders and then we inserted in our time dimension table and but let's make it multi-threaded in this example that initially we created insert date pool with some fixed as fixed thread pool with the default size four and then we select these all the unique dates but then we push pose them to this thread pool and in this thread pool we will do the date insertion but please note also in that case if you're doing multiple threads please always do explicitly check out new connection from active record connection pool as otherwise if you take new database connections it will automatically fetch out the new database connections in new threads but if you'll not give it back you'll run out of database connections and finally we shut down and wait for time dimension and for example in this simple case I did some benchmark also locally on and then I managed to reduce twice the total clock time for loading the data but please also see and be aware that if you will start to increase this thread pool size even more you might start to get worse results because in this case we still are finally inserting all the data in the same postgres table and then postgres might start to do some locking and slow down the process if we try to do insertions in the same table from too many parallel threads so please do benchmark so if you use jruby there are good standard java tools for that like visual of m or vm or jav mission control and yeah regarding jruby you don't need to rewrite all your application jruby you can use it just for your data warehouse project where you populate the data and then do the queries and finally I wanted to give a short overview of traditional versus analytical relational databases as so most of us are when we are working with SQL databases so we think of these traditional databases which are optimized for transaction processing like MySQL or Postgres or Microsoft SQL server or Oracle and they can deal with large tables and but they are optimized for doing a small transactions like inserting updating and selecting small set of results but as we saw then if we try to do aggregations of millions of records so they are not the best technology for that and there are different set of SQL relational databases but which are optimized for analytical processing for example there is one of the pioneers where open source database monitor DB there are several commercial databases like HP Vertical or Infobright but which have also community additions where you can use them up to some significant size of your data or with some limited features as well as if you are using Amazon web services then Amazon provides Amazon Redshift database which is also this SQL analytical database but optimized for analytical queries and what is the main this magical trick that these databases are using for these analytical queries so they mostly use different data storage how they store the data if we look at the traditional databases they mostly use row based storage which means if we have table and row in a table then physically on the database so this all these columns from this row are stored together in one of these file blocks and when we need to for example to do a sum of some numeric amount as we saw let's do some of sales amount then it will need to read practically all our database table because so we need to pick sales amount from here from here from here from here and therefore that's slow and so what most of these analytical databases are doing they are using columnar storage from logical perspective we are still using them as tables with rows but the physical storage is organized by columns so like in in this case so in this the same example all values in the same column will be stored together the next set of columns will be stored together and what's the main benefit now if we need to do some of or count of some column from all records they are all stored together and we can read that much quicker the other benefit is that especially in this date warehouse sales fact tables we have also a lot of repeating values for example these foreign keys or if we store directly already some values which are repeating some classification information and then if they are all stored together they could be compressed much more effectively and therefore yeah these analytical databases also do better compression of the insert data but the major drawback is that the individual transactions when using columnar storage will be much slower if you will now will want to insert these rows one by one in these analytical databases so it will be much slower than in a traditional transactional databases or if you update one by one therefore if you are using this columnar database storage databases analytical databases you typically maybe prepare your date what you would like to have there and then you do bulk import of the whole table or the bulk import just of the changes which will be then much more efficient and I made a also simple example on my local machine as I said that I had generated the sales fact table with six million rows and I did this query which just does the aggregation of sales amount sales cost and the distinct count of customer ID from more or six million rows and grouped by product families and on Postgres so whenever I run it so it was approximately 18 seconds on my local machine then I in virtual machine installed HP Vertica and didn't do any specific optimization configuration there so the first query I run so it took about nine seconds because well it just needed to load and cache the date in memory but each repeated query took just 1.5 seconds so with exactly the same date amount so I got 10 times faster performance so in reality probably you won't get the 10 times better performance all the time but in some studies of real customer data they quite often report some three to five improvement on query speeds which are like this aggregation by and grouped by queries and I did the testing also on Amazon Redshift and got similar results to that with the same dataset and my very unsophisticated recommendation well unscientific recommendation I went to consider what so if you have less than million rows in fact tables so then you probably won't see any big difference so if you get 10 million so then complex queries will be get slower on Postgres MySQL and if it's will be 100 million so so you won't be able to manage these aggregation queries realistic time and so when you have already 10 million and more records in your fact table then for analytical queries you might need to consider these analytical columnar databases so short recap what we did cover so problems with analytical queries using traditional approaches dimensional modeling star schemas monitoring all upon MDX CTL and analytical columnar databases and thank you very much for attention and you can see all these examples I posted on github my arson profile there is a sales app demo application so you can find it there what I showed it and then later also all my slides will be published and thank you very much and I have some two minutes for questions still thank you


Today we are celebrating the 3 millionth application under the Patent Corporation Treaty, the PCT. The PCT is the cornerstone of the international patent system. So it allows an inventor or an enterprise to file a patent application which is valid the application in up to 151 countries. So it's a wonderful efficiency that has been achieved. It has been achieved by an international corporation which is extremely successful It involves all of the patent officers of the world who constitute the network that forms the PCT. Let us not forget the inventors of the invention that is the subject matter of the 3 millionth application and that is the Fraunhofer Institute of Germany. We are very happy, delighted and honoured to have here the occasion of celebrating the 3 millionth patent application which is one of the major and leading organisations for applied research in Europe and we as a non-profit organisation are really delighted to be here at WIPO also due to the fact that we strongly interact with WIPO and your services. The 3 millionth PCT application is actually called Network Rector Analyzer and it's based on our Terrahertz technology. We found that we can use our laser technology to create Terrahertz waves and you can use them to measure for instance electronic devices, their face and magnitude. As a research organisation and technology provider we want our inventions to be sustainable and we want an efficient way to create value there and the PCT system has allowed us to actually go through a very efficient system that works on a worldwide basis and then we'll be able to create new things and license them on a fair basis.