Hash tables are one of the most important data structures in software. Hash tables are built into many programming languages under different names such as dictionaries, associative arrays, hashes, objects, or just hash tables. Now because hash tables are used all over the place, they're carefully optimized and tuned to make your program fast. But sometimes the built-in hash table isn't enough, so I set off to make the perfect hash table. In this video I'll show my journey on making the perfect hash table while also dropping some performance nuggets so you can make your code fast too. So let's start with a simple use case. Let's say we have the days of the week and you want to map numbers to the names. So here we map the number one to the word Monday, number two to the word Tuesday, and so on. How do you implement this? Well one way is to compact all the strings together and put them into an array and then you index into the array by subtracting one from the day number to get the index. Now this is something arrays are very good at, but what if we want to go the opposite direction? What if we want to go from the strings to the numbers? Now we can't just use an array index anymore. What we can do is take the first character of each string, map it to a number, so in this case the letter m is the 13th letter of the alphabet, letter t is the 20th letter of the alphabet, and use that number derived from the first character as the index into an array. This means we end up with a bunch of empty slots in the array, but we're able to access the array quickly. So we call this taking the first character, the hash function. This is one potential hash function. It's not necessarily a good one. We'll discuss better ones later, but this is the essence of a hash table. But there's a problem. What happens if we have two days that start with the same letter? For example, Thursday starts with the letter t. So it would take up the same array slot. Now different hash table schemes do different things in this case, but all general purpose hash tables need to deal with this problem. We don't want this behavior. It kind of slows down the hash table, but it's a fact of life for most hash tables that they have to deal with collisions. But what if we don't want to deal with collisions? Well, what we can do is carefully construct our hash table such that it avoids any collisions in the array. Here's an example hash function where we take the second character and double it and then add that to the first character. This gives us a bunch of unique numbers. From these unique numbers, we can index the table and there's no collisions with our data. This is called a perfect hash function and that's the subject of this video. Pop quiz. What happens if hash function always returns the same index rather than unique indexes? How many keys would need to be checked when you look things up? So let's talk about my real world problem. I'm writing a typescript parser and I need to recognize keywords. In particular, I need to map each keyword to a number. So the most naive solution is a linear search where we go through and do a bunch of string comparisons one after the other. If we find a match, we return the number associated with it. That performs okay. We're able to reach six million lookups per second. Now you may have heard in your computer science class that binary search is a way to cut down the number of searches if we can sort our input data. And in our case, we have our input data sorted, the list of keywords we know ahead of time, we can pre-sort the data. So how fast does a binary search work? Actually, it turns out the binary search was a little bit slower than linear search. Now this talk isn't about binary search. I'm not going to go into the details of why binary search might be a little bit slower than a linear search. But let's try something that's even better than a binary search. We're going to use a hash table. So let's use the standard C++ hash table, which is called unordered map. Unordered map is twice as fast as linear search. So just by switching a basic data structure from a vector, in this case, to an unordered map, we get a 2x performance speedup, which is great. We put in very little work to get a massive gain. But a lot of people say C++'s unordered map is kind of slow. It's stuck in the 1990s in terms of design. So let's look at a more modern hash map implementation, this time from the Rust programming language. It looks like Rust's hash map is not as well optimized as C++'s unordered map, at least for our use case. So performance tip number one, try it. Try the first thing that comes to mind. Enter the performance mindset. The first thing I had in mind was a linear map. I tried it. It works, of course. But then I tried a binary search. I noticed it was a little slower. So then I kept trying other things until I got something that was satisfactory. Off the shelf, hash maps use a hash function that is general purpose. It doesn't know anything about our dataset. It has to look through every character inside of our strings. It doesn't know ahead of time how many characters there are on the string or how many is expected. CPUs like working with a fixed amount of data. But with a general purpose hash function, you can have a key that's one character or 10 characters or five characters. It's a variable number. CPUs don't really like that kind of data. So what we want to do is have our hash function pick a specific number of characters rather than a variable number of characters. That way the CPU doesn't need to do any loops or anything like that. So the fastest hash function that's possible for strings is just taking its length. Because the length is information that's readily available. It's already in number. It can easily be used as the index to the table. The problem is the length is not unique. There are a lot of keywords that are four or five characters long. So we end up with a lot of collisions with this hash function. We need something a little more sophisticated. Something that's more unique is taking the first character. But as we saw with the day of the week example, there are still collisions that can happen. So what if we can pick a set of characters that lead to no collisions, say the first two or maybe the first three. Well, if we look at just the first character, we have some collisions like null and new, both start with n, true and type of, start with t. If we look at the first two characters, this and throw have a common prefix. Let's try looking at the last character. If we take the first and the last character, it's still not unique. We have case and continue, both start with c and end with e. What if we take the first two characters and the last character? Well, unfortunately, declare and delete, both start with d e and end with the letter e. Okay. What if we take the first character in the last two? We also have never a number having a collision. All right. What if we take four characters instead of three? Hey, we get no collisions if we pick these different characters. Let's look at this in more detail. Say we have the keyword debugger. Now this is split into a bunch of different characters. What we would do to select the first two characters is do a 16 bit load, 16 bits meaning two bytes. And for the last two characters, we would also do a 16 bit load. Now our index is a single number, not two numbers. So we need to pack all of these characters into one number. So what we could do is shift one of the pairs up 16 bits, leaving the remaining bits zero. And then we use a bitwise or to bring in the other 16 bits. So we end up with a 32 bit number. Let's look at another example like the let keyword. We do a 16 bit load of the first two characters. We do a 16 bit load of the last two characters. Now notice the middle character, the E, we load twice, but that's fine. There's no real penalty to loading the same character twice. Then we do the same shift that we did before, and the same bitwise or, and we end up with another 32 bit integer. So this is what the code looks like in assembly. We have a 16 bit load. We have another 16 bit load. We have the shift instruction and the or instruction. So there's no loop involved to get the hash. All we have to do is load two things from memory and mix them together for simple instructions. Now in order to make this work, we need to make sure we don't go out of bounds. So first we need a bounce check to make sure we have at least two characters because if you only have one character and you do the 16 bit load, you're out of bounds of your array. So let's see how this performs. We're going to plug this into the standard unordered map in C++ and see how fast it is. Well, we got a significant performance improvement just by changing the hash function. So with a small tweak to something that already exists, we can get a massive performance improvement. So performance tip number two is to make assumptions about your data. In our case, the first and last two characters were unique. Because it was unique, we could feed that as the hash function and end up with few collisions. Now you should make assumptions about your data because your data is never random. There's always some pattern to it. In our case, the pattern is there's uniqueness in the first and last characters and also all of our keys are at least two characters. Pop quiz. Why do we want to pack the characters into a single 32 bit integer? And what else could we assume about the key length? So we discussed using off the shelf general purpose hash tables. But because we have some uniqueness properties in our data set and because we know our data set ahead of time, we can use tools to generate code for the hash table and bake it into our program. So let's look at a few third party libraries that accomplish this. First up is rust phf. As the name implies, this is a rust crate for generating perfect hash tables and perfect hash functions. Let's say we have the key if what it does is hash the if using a normal hash function. In this case, sip hash one three and we get back some number. It uses the bottom bits of that number to look up in a table. Now this isn't the table with the data. This is just the helper table. Once it looked up data from the table, it mixes that with the hash to generate another hash. And that second hash is used as the index into the real table. Now they use this middle table to prevent collisions because if there is a collision, they can just tweak the middle table to make sure there's no collisions. So let's see how this performs compared to the off the shelf hash tables. It looks like we got a small performance improvement compared to the standard rust hash map. However, we're still much slower than the C++ unordered map with our custom hash function. Let's take a look at another library, this time C++ frozen. Now how it works is it takes our key. It hashes it similar to rust phf using an off the shelf hash function. Uses this hash to index into a table just like with rust phf. Then it directly indexes into the result table. Now what's the purpose of this middle table here? Well in the case of collisions, what C++ frozen does is add a marker indicating that the slots in the helper table is not an index, but it's actually some data that needs to be mixed in with the hash. It rehashes the data using the seed to generate a new index. And then it uses that new index to go into the table. So how does this perform compared to rust phf? C++ frozen is much faster, almost twice as fast as rust phf. And it's also significantly faster than our custom hash function. So we're definitely onto something here with this library. Now I said that frozen uses a off the shelf hash function. What if we gave it our own hash function instead? Wow, so it looks like C++ frozen's hash function has some improvements to be made. And if we make those improvements, we get double the performance still. This is looking pretty promising. Let's look at a third library, in this case gperf. Now what gperf does, it takes our key splits it up into characters. It looks up the characters in the helper table. Once it looks up the characters, it adds them together to generate a number. And the number is used as a key to our real hash table. Now this intermediate table is used as part of the hash function. It is not separate from the hash function. So we can't use our custom hash function with this approach. We have to just rely on gperf's hash thing. But let's see how gperf performs on its own. Gperf is beating the pants off of everything so far. It's no wonder many compilers use gperf for keyword recognition and other tasks. Before I made my own custom hash table, I used gperf because it's pretty fast. Let's talk about the new hash table that I made. So similar to rustph and C++ frozen, I use some hash function on the key, and then we directly look up in the table. It's that simple. How do we avoid collisions? How is this a perfect hash table? We're kind of cheating, right? What happens is when we're generating the table, if there's any collisions, we tweak the hash function. And the way we tweak the hash function is by giving it a different seed. So the hash function needs to be seeded, and we start with a seed of one, and then try seed of two and try to seed of three. We keep trying until we get no collisions. And if we do get a collision, we make a bigger table and try it again. Now the hash function we pick, we don't give it the full string, we give it those four characters that we talked about. So let's see how this performs compared to gperf. Well, I tried a bunch of different hash functions because I didn't know which one would perform best. So I tried with fnv1a first because it's public domain and I've used it before. And it doesn't perform as well as gperf. I also tried xxh3 because I heard it was pretty fast, but it turned out to be slower than fnv. I also tried the Intel CRC32 instruction, which is just one instruction on x86 processors. And it was actually faster than fnv1, so that's good. Unfortunately, it's not portable, so that was kind of a downside of it. I also tried a linear congr... congrential congrential... I also tried a basic linear congrential generator as my hash function, and it performed about the same as the CRC32 instruction. Pretty good. Now my suspicion is that the CRC32 function performed worse than it could have because I couldn't use a power of two hash table. And non-power of two hash tables are a bit slower for lookup. So all right, so let's take the best of these hash functions and try some more. So I tried the Intel AES instruction, which should mix better than the CRC32. Unfortunately, it performed worse. I guess it's a bit slower. I also tried a clever hash called the Pearson hash. It's kind of like what gperf uses. It uses a separate table for the lookups, but unfortunately this was slower than the LCG. So I'm not getting the performance that I want. We're not matching gperf. I want to match gperf. That's my goal. So let's take a look at the pseudocode for my algorithm. First we do a bounce check, and I think this is pretty fast. It seemed to be like only two instructions or so, so... Next we load those four characters and then we do the hash. So the loading of the four characters is pretty fast. It's just four instructions as we discussed. The hashing, I tried a bunch of different hash functions, but I'm not certain that we got the fastest. Maybe that's something we can improve later. But now we have this matches key function, which compares the strings of the keys, and turns out that's pretty slow. How do I know this? Well, I profiled it. I tried Intel vTune, which is a profiler for Linux, and I think it also works on Windows. It told me that memcump avx2 movebe is slow, and it's taking about 60% of my CPU. Now memcump is the function I'm using to compare the strings. And the rest of our stuff is taking only 25% of the benchmark time. So clearly memcump is the slow part here. I also profiled gperf and noticed that it wasn't that much of a bottleneck to do the string comparison. So I decided to take a look at gperf's code. So it does a string compare, which is basically the same as a memcump, and it also does a length check, which I'm also doing.  What's that doing? Well, that's checking the first character of the string. And only if the first character matches does it do the string comparison in the length check. So this seemed a bit weird because the string comparison is supposed to be doing the same thing anyway, right? I thought, well, what's the harm? I'll try it. We'll see how my hash table performs with this trick. And we beat gperf, just like that.  Pop quiz. So we saw that checking the first character made it faster. But why does it make it faster? I also decided, hey, if we're checking the first character and that's faster, why not check the first two characters? We already loaded that into memory as part of our hash function. So well, it turns out it's a little slower than just checking the first character. I didn't really investigate why, but there you go. Perf tip number three, see how other people did it. In my case, I looked at gperf to see what trick they were doing to make their string comparisons faster. And I was able to use the same trick to get a massive speedup. But make sure to measure, because there might be some technique you copy from somebody else, but it actually doesn't improve performance and maybe makes things worse. Speaking of seeing how other people did it, I also looked at general purpose hash tables to see what tricks I could learn from them. And one thing I saw is that for collision detection, some hash tables stored the hash inside the table in addition to the string and the value. And this means before checking the string inside the table, they can check the hash inside the table and see if there's a match. So in this case, we would check the hash for the if and see that there's a match. And check the hash for fetch and see that there's no match. So let's see how this performs compared to checking the first character. And it actually performs about the same. Unfortunately, this approach needs a little bit more memory, so I decided to just stick with the check in the first character. So I beat the performance of gperf. What else can we do with our perfect hash table? Well, let's look at our keyword set again. Let's focus in on this keyword, constructor. This is the longest keyword in our set. It takes up 11 characters, which means all of our keys are at most 11 characters. We're using memcomp, but maybe there's a faster way to compare this key with the input key. So let's do a web search. What's the fastest way to compare 11 bytes in C++? Well, our search engine gives us a thing about std byte, but then it points us at memcomp, which is the function we're already using. So that's not really helpful. Let's think about this again. What we want to do is compare the input string constructor with what's in the table constructor all in one go. But if we have a small input, like let's, we want to treat that the same as if it was constructor. So we're going to add some zeros at the end and compare that with what's in the table, which also has zeros at the end. So now the question isn't how do we compare 11 characters, but how do we load 11 characters and then do the comparison? So let's do another web search. This seems a bit more promising, but there's some buzzwords here, like XMM and M256, what are those?  So the XMM we saw in that web search refers to these 16 byte integers or floats, XMM 0 through XMM 15. Now this can be accessed from C++ using the M128I type. So let's say we're able to load them into memory. Now we want to compare the strings. So how do we do that? Well, let's do another web search. And it takes us a while to find, but we end up with this mmCompisturC intrinsic. Now what is this? It stands for multimedia, compare, explicitly sized string, and I can't figure out what the C stands for. Now this is specific to Intel, but I'm on an Intel processor. Let's see how it performs. Now compared to our fastest approach, oh, we got a crash. Well, what's going on here? This is how I was thinking about it.  We zero out the stuff after the string and then do a comparison with the thing in the table. The problem is if we're near the end of the string, then accessing the remaining bytes is out of bounds and that can cause a crash. So what we want to do instead is make sure that the input string has a bunch of trailing zeros in it. Therefore, even though we're kind of out of bounds, it doesn't cause any crash for us. Now if we make sure after we load the input file that we add some null bytes at the end and we run our benchmark and better than our inline hash approach from before. So perf tip number four is to improve your data. In our case, we were able to use CompiStersy without any extra bounds checking by changing the input data to have the null bytes at the end. And in general, the more you can make assumptions about the data, the faster code you can make, and how do you make more assumptions? You can massage your data so those assumptions are valid. Perf tip number five, keep asking questions. Simple web searches can expand your toolbox and think about what your hardware has built in and do some research. Now while developing the CompiStersy thing, I noticed that it requires SSE 4.2. But I want my software to run on older processors where SSE 4.2 is not available. So I developed a version that works on all Intel 64 bit processors. So let's see how that one performs. So it's actually faster than CompiStersy even though CompiStersy is dedicated at string comparisons. While developing the portable move mask approach, I learned about the SSE 4.1 instruction P test. So let's try using that to solve a problem instead. P test is even faster than either CompiStersy or move mask. So let's stick with that, huh? So perf tip number six, smaller isn't always better. The CompiStersy solution was the smallest using only 31 total instructions for the entire algorithm. But it ended up being slower than both move mask and P test which had more instructions. So fewer instructions doesn't necessarily mean faster even if the instruction seems to be dedicated to the specific task you're doing. Pop quiz, can we optimize a string comparison without using special SIMD instructions? For example, just using normal integers. So now our string comparison isn't showing up in Intel VTUNE. So the VTUNE profiler we used earlier tells us about functions. We need to drill down a little bit deeper than functions and get to the assembly instructions. So for that we're going to use a tool called perf. If we perf record our benchmark and then perf report, we get this an assembly printout. This shows us the percent of time taken on the left column and on the right column is the assembly instructions. You can see the instructions color coded based on how hot they are. So let's zoom in to the hot part. If we read carefully we can see this is a string comparison code. We're loading things, we're doing a P test, we're doing some comparisons and then we're returning. I don't see a way to optimize this. There doesn't seem to be any wasted instructions here. So let's try a different approach for profiling. Instead we're going to use perf stat which gives us performance counter data rather than instruction data. And it gives us a lot of data. But let's focus in on these two. Branch misses and L1 decache load misses. Now our branch misses is almost 4% of all branches. Now 4% of branch misses doesn't sound like a lot but each branch miss can cost a lot of time. So let's talk about branches for a little bit. Let's say you have this code if strong health is 4 otherwise health is 1 and we return the health. This might get compiled down to this code. We have the if which is the test and the jump. Now the jump instruction jne is what we call a branch. Sometimes jne will go to another instruction and sometimes it just goes to the next instruction. Branches are something CPUs predict and if they predict incorrectly it could be disastrous for performance. One technique to get rid of branch misses is to get rid of the branches entirely. In this particular program we can avoid branches by using a little bit of math. This formula gives us the same answer but it doesn't use any branches. In fact it only compiles down to one assembly instruction on my machine. But we can't always use this technique right? So let's use something a bit more general. So let's rewrite our if this way. And if our compiler is nice to us it'll generate code like this. So the if used to be a test and a jump now it's a test and a C move. C move not equal in this case. Now there's no branches which means we won't get any branch misses from this code. Unfortunately C++ compilers are very unreliable when it comes to C move so we often need to resort to inline assembly to get the machine code we want. So in our particular example we would convert these jumps into a few C moves. So let's see how C move performed compared to the branching version. Here is a three SIMD approaches we made. And the branchless version of CompiStersi is flying. We're almost at 10 times the speed of the standard hash table. We can also use this technique for the other SIMD approaches like move mask and for P test. Now interestingly in the branch version P test was a bit faster than move mask. But in this case move mask is faster than P test and even CompiStersi is faster than P test. So it's a good idea to try all combinations of the different approaches you try rather than assuming the best one at one time is going to remain the best in the future. Perf tip number seven use multiple profiling tools. I wasn't able to notice the branch miss issue until I used perf stat rather than perf record or vtune. Sometimes your profile can mislead you into thinking something is slow for one reason even though the reason is totally different. Perf tip number eight benchmark on real data. In my case I was benchmarking against keywords and variable names in jQuery which is a real world JavaScript code base. If I instead benchmarked on say just keywords or just variable names I wouldn't have noticed the branch miss issue because it would either always pass or always fail. And if it's if your data is always passing or always failing that's pretty easy for a CPU to predict. Therefore you don't end up with branch misses. But because I use real world data where only 20% of identifiers are actually keywords the CPU wasn't able to predict as well. Therefore there were a lot of branch misses and I was able to optimize for that use case. If you use fake data in your benchmarks you might be optimizing for fake workloads rather than real workloads. Pop quiz could we make the length check at the top of our function branchless. Let's talk about more ideas. After we do the hashing we need to compute the array index. At a low level you take the hash you modulo by the table size you multiply by the entry size and bytes in order to get the byte offset. If our table size is a power of two such as 512 we can use a bitwise and instead of modulo. A bitwise and is much faster than using a modulo and it's something that compiler might do for you but you should probably do by hand if you really care. In the same vein instead of doing a multiplication we can use a bitwise shift if the entry size is a power of two. So in our case we're going to try entry size of 16 which lets us shift left by four. But my thinking is what if we can get rid of the shift? We're already doing a bitwise and what if we could use the bitwise and to clear the bottom bits which kind of acts like a shift. So if we do our address calculation a little bit differently we can get rid of the shift and just do one bitwise and in addition to the addition with the table. So what's this look like at the assembly level? Well on the left we have the original code which does the and that we talked about. It also does some additions and multiplies to get the right address. On the right is our new way of doing things which only has an and instruction. So let's see how this performs. So originally we had a 13 byte entry so let's try a 16 byte entry with this technique. And it performs just a smidge faster or maybe just the same it's hard to tell. One theory is that we made a bigger table because we had to make the entries 16 bytes instead of 13 bytes each. So let's try shrinking the table and seeing if that gives us a performance improvement. Well how do we make the table smaller? As I mentioned earlier the way my hash table works is that we try inserting all the keys with a certain hash function. That doesn't work we change the seed and try inserting all of them again. And we try that a bunch of times and if we can't fit them in after 50,000 attempts we make the table a little bit bigger and then try the process again. But what if we just try harder? What if we do more attempts and don't give up so early? It'll make generation slower but maybe we can get lucky and find a no collision hash table with a smaller size. Here we have a hash table with the default attempts count and it ended up at 262 entries. Now if I crank that up to like a million attempts we end up at 194 entries which performs the same. So it looks like smaller tables doesn't mean better. I mean it might mean better for memory usage or something like that but it doesn't mean better for lookup performance. So in addition to those failed attempts I've had other missteps. I had trouble making compilers generate two 16-bit lows that get merged in together for the character selection. I also couldn't make compilers generate C move instructions that was a real pain. I had to resort to inline assembly and the problem with inline assembly is it's kind of a black box for compilers so they can't optimize that much around the inline assembly. Also the several SIMD approaches that I talked about I had to write like 20 versions of them until I got something that performed well and didn't have a bunch of crashes. In particular generating the mass that took the input string and removed the extra stuff at the end that was kind of tough. Fortunately while I was developing it I learned about the p-test instruction because Clang generated p-test for one of my mask generation approaches. Even though I did struggle making the implementation I did learn something by virtue of Clang optimizing my code. So I did all these optimizations and then realized actually my length check wasn't working properly. I had to go back and rewrite a bunch of the different approaches to make sure they were doing the length check correctly and I had to do the length check slightly differently for each one because of the nature of the string comparison algorithms. So perf tip number nine keep trying new ideas. You will hit a lot of dead ends but you will learn things as you go along. Winners don't give up. Pop quiz. What ideas do you have for my perfect hash table? I myself have more ideas to try but performance is good enough and I've been hacking at this for two weeks so if anybody wants to try these ideas be my guest. So let's take a look at those pop quizzes and see if we can answer them. So the first pop quiz what happens if the hash function always returns the same index? How many keys need to be checked? The answer is bad things. All values are put in the same bucket and the hash lookup function needs to check every single bucket to see is there a match. Lookup devolves into a linear scan for both hits and misses and it's probably slower than blasting through an array. Next pop quiz. Why do we want to pack the characters into a single 32 bit integer? The answer is that some hash functions such as Intel CRC32 instruction work efficiently on 32 bit registers rather than being fed one byte at a time. What else could we assume about the key length than the minimum size? Well the longest keyword has 11 characters and that means we can exit early just like we exit early if the length is less than 2. It also means that all the keywords fit in a 16 bit SIMD register and we tried doing this and it gave us some pretty good speed ups. Now why did checking the first character ourselves make a lookup 50% faster? I'm not 100% sure on this but my guess is because of the early check on lookup failures which are 80% of the time we could avoid calling memcomp. And memcomp is pretty cheap but it's not as cheap as an if statement. Next question. Can we optimize our string comparison without using special SIMD instructions? Well the answer is yes. If what we do is do a memcomp with exactly 12, all compilers will generate a 64 bit load followed by a 12 bit load and we could do the same technique and do some masking so let's try it. Here's our fast branchless SIMD approaches and without using special SIMD instructions we almost got the same performance as our P test approach. That's pretty good. Could we make the length bounce check branchless? Well the answer is yes. But we gotta be careful. If we're looking up a single character identifier such as the letter x well our hash function checks the first two characters which means it'll check out of bounds one character but also it checks the last two characters which means it checks before the string and our string comparison function loads either 12 or 16 bytes depending on the algorithm. So we have to make sure that one byte before and 15 bytes after are allocated and not out of bounds. If we can make this assumption we could just delete the bounce check. So let's see how this compares to our fastest SIMD approach and it's even better. Now this is surprising to me because we're doing all this hashing and all this lookup and all the string comparison stuff for one character variable names. Now I imagine there's a lot of one character variable names but it seems like it's not predictable by the CPU so it's faster to do all this work than to have the CPU mispredict. So perfect tip number 10 is to talk about your optimizations. I didn't have this idea of deleting the bounce check until I made this video and when I made the video I decided well I should probably check the performance of deleting the bounce check because I know it's possible let's try it and I was pleasantly surprised that I made things even faster. So if you talk about your optimizations with people even if you just rub or duck and talk to nobody going through that thinking process can unlock optimization opportunities. And the last pop quiz question was about what ideas you have for my perfect hash table and of course you should leave a comment with your answer below. So that's my journey of making a hash table that is 10 times faster than C++ is built in hash table. Preliminary results say my compiler is about 5% faster overall even though detecting keywords is actually a pretty small part of the compiler. We covered 10 performance tips you can do in your own programs to make things faster. Now none of these are specialized for hash tables or data structures. They're just general performance tips that you can use in your own programs. So I hope you learned something have fun optimizing your code. I want to thank Dave Churchill and other chatters in my Twitch stream who helped me make my perfect hash table even better.


Good morning everyone, and thank you very much for joining us here this morning, where you can learn a little bit more about what it means to be a Carleton student and an FPA program. To help you give some insight into that, today we have three students who are also FPA ambassadors and they can explain to you a little bit what that means. To talk about their experiences and answer any questions that you may have. At the same time, I will first introduce all of the of our ambassadors, and then I'll turn it over to Emma to start us off. So first I'd like to introduce Emma, who's a second year student in the Bachelor of Journalism and she was on the honors list this year. Congratulations. And then Emily is a third year student in the Bachelor of Social Work, who currently works at the Carleton Disability Awareness Center, which is a service offered service center supported by the Carleton University Student Association. Finally, Alina, a third year Bachelor of Social Work student is a huge fan of soccer. She loves playing the sport and watching it as well as one day, her dream is to watch a game at the football stadium in Barcelona, which is called Camp Nou. So without further ado, I'm turning it over to Emma. Hi guys. So yeah, my name is Emma. I'm going into my second year of Bachelor of Journalism and I'll just talk to you guys about a couple points today. So I'll start with things I learned in my program. So one of the first things like when I entered Carleton Journalism, I had no previous experience of journalism like my high school, we didn't touch on that we didn't write any articles I didn't have a school newspaper. So I was a little bit nervous like going into the program because I was thinking what if everyone is already written articles what if everyone is already an expert in this field I was so scared. But the thing is is that we really started the roots of the field so first semester. I remember the classes a lot about the history of journalism so we started with the history of print, talking about like Gutenberg and all that kind of stuff and then we touched on this history of television history of radio. So kind of touching it all like the aspects of journalism because you can go into radio you can go into television. It's just like a really adaptable field. And then we talked about advertisements as well and what that looks like and the history of that as well. We also like second semester was more like practical hands on experience. And I was really nervous. I remember talking about how to interview and I was really nervous about that because going up to people can seem really daunting. I was kind of shy and I'm a little bit shy when it comes to talking to like random strangers, but luckily we were able to talk about that and he gave us like my prof gave us some key points and things like that. So learning about interviews is really cool because again that's like a huge aspect of journalism right. So another thing that I really liked about the journalism program is that the profs and instructors like they all have like experience in journalism. The first semester professor was Alan Thompson who's now the director of the program, and he was really awesome so he gave us like all these funny stories about what it was like working in journalism. He showed us like reels and like clips of him like interviewing people, and that was really neat to see and like hear from an actual journalist like what it's like in the field now. And of course journalism is always changing so it's interesting to see like what it was like before and then applying it to like what it's looking like now because it's really like an adaptable kind of feel like I said before. And he gave us like tons of advice so that was kind of like what I learned and I had gone in there with absolutely no experience with journalism and I came out like I wrote they give you so many opportunities to write as well. I remember I was able to write articles for the Glee paper which is a community paper in Ottawa. So that was like a really neat experience and that gives me like things to show like a portfolio as well which was really cool. One of the things interviewing was definitely one of the top things is I had never done that before because we didn't do that in high school but I really found it interesting. And now I'll talk about like extracurriculars as well because Carlton University has so many extracurricular activities, depending on like what you're interested in they really have it all. When I was in high school I was really involved so I did a lot of things like student council like ambassadors like I'm doing today like, so I'm a faculty of public affairs ambassador and I really love doing that because I love sharing my experiences with potential and new students. So I really like doing that as well. Also, Salkin Buskin, which is the student theater like program, I was able to act with them in a show. And that was really cool to be able to experience that. And yeah, I love being an ambassador as well. And the acting was really cool. I'm also a Frosh facilitator so if you guys are doing Frosh, and you're on the Centours team then I will be one of your Frosh facilitators which is really cool. And we're really adapting it to be online like all the activities that they're planning are really really fun and you still get to that experience of Frosh as well which is really cool. Now some things that I wish I knew when I started university. There's a couple things I wish I knew. First thing is that like you really have to be independent when you're in university. So I came from a relatively big high school but I was still able like my teachers reached out to me asking if I was doing okay. But in university you really need to make those connections yourself because your profs and your TAs like they want to help you like they are willing and they want to help you but you have to reach out and make that connection first, which can definitely seem daunting because sometimes professors can seem a bit intimidating because there's just like experts in their field and they're just like like geniuses and it's just sometimes really scary to reach out. But once you do it's so worth it. I remember I had to reach out to a couple profs like maybe for an extension because something was happening. And they're always like willing to accommodate which is really really nice and TAs as well like a lot of the times TAs mark your assignments as well so it's really interesting to reach out and talk to them to see like what they're also looking for like get their advice because they haven't taken that class before so they like know what they're doing. And TAs like will meet up with you. Office hours are also really important. I didn't go to office hours at all during first semester and I really regret it because sitting down with your prof and like really talking about what they're looking for is so important. I remember I went to office hour in second semester and like we sat down chatted for like an hour and I really felt like she had to help me with the paper that I was writing. And I think my TAs like my TA would sit down and read my paper and say like okay like maybe make some like little switches here and there and so that was really helpful as well. Also, past workshops, I wish I'd known about those sooner. Because with some of the bigger classes there's workshops that you can go to that they can help you, and I didn't go to the past workshops for the first few months of this one class. And then I started going and my mark just like shot up just because the workshops are so helpful and really like really give you like a one-on-one time like with a person that's been experienced in this class. So it's really helpful to give you mock exams like mock tests, like worksheets to work on so that was really helpful as well. Also buying textbooks. I bought all my textbooks ahead of time because I was really excited to buy all this stuff. So it's like I have to get this book I have to get this book, try not to buy your textbooks ahead of time because I had to return like a whole bunch of them because the profs are like oh like I'll give you PDF or like you don't really need that like I'll just send you the chapters that you need to read and I had already bought them it's a lot of money for books sometimes. So I always just wait until like the first or second class when the prof like mentions what the textbook like what the expectations are. That way you don't have to drop like $200 on books before you need them, because I did that. And then I remember being really nervous about making friends, because I didn't have any like I didn't know anyone that was in my program. I remember just being really nervous about going into class and they'd be like oh my god I'm going to sit there by myself and I'll talk to anyone all day like, but it's really really easy to make friends, especially in your program because you guys are all in there like together you're all trying to get through this together. And I know like, so my program most programs do this, like they have group chats. So like we have a group chat on my Facebook and like people are always talking and be like oh like do you guys know when this is due or how have you guys done this and so there's like a bunch of questions that you have people are always willing to help and or meet up or something like that, especially with online school and I'm sure you guys will rely on the group chat a lot just so that you guys can like keep in touch and like kind of know how everyone's doing and things like that because people are always willing to help out. So yeah those are the things I wish I knew. So all that like in high school they stress that university is like a huge transition from high school, and it is like it's definitely a lot different than high school, but it's not as hard as they make it out to be as long as you're reaching out to professors you're reaching out to your TAs, you're using the campus like resources so like academic advisors are really helpful as well. So as long as you're using your resources and not just going at it alone I find that the transition from high school to university is not as hard as they make it out to be. So yeah that's kind of my three points. So I guess I could pass it on to the other ambassadors. In my third year of my bachelor of social work. I have absolutely fallen in love with my program and it's something that I'm really happy that I did. I have like Emma was saying I'm going to start at the bottom of my talking points. One of the most important things that I wish I knew in the first year of my program is office hours. Office hours are so huge and super important to go to. It seems super daunting at first you know you're used to sitting in the middle or maybe the back of the lecture hall and you can only see your professor super tiny all the way up at the front but being able to have that chance to talk with your professor or even your TA is super helpful in being able to gauge what they're actually looking for in the work that you're handing in. I've been to talk about a grade that you got on an assignment that you've already handed in because sometimes you hand something in and you're completely shocked by the grade that you got back. I know one of my first big papers in social work 1001. I got a mark that I was not very happy with and that will for sure happen in your first few classes. But after going and talking to my TA being like what happened. I was able to get the feedback that I needed and completely turns that course around and was able to really make sure that I was getting the grades that I knew that I could get and that I knew were important to me. Similar to what Emma had said also is making new friends. I was kind of the opposite. I'm from Ottawa so I knew a whole bunch of my friends from high school were going to Carlton. I had a whole bunch of classes with my friends and that actually kind of hindered me a little bit from making new friends. And so one of the things that I found to be super important is actually reaching out and making new friends. University is definitely a time where people kind of start to branch out and do their own thing a little bit more. And it's important to remember that those really close friends that you had from high school may not always be your really close friends. And so one of the things that I wish I knew was just participating in a whole bunch of different extracurriculars and really making sure I went out of my way to make new friends, especially with the people in my program. Lena and I are really good friends now, for example, and that's something I'm really happy of. We have a whole bunch of different friends in our program, especially social work. It's a super tight knit program. Everybody knows everybody. And so it's important to be comfortable going out and making new friends, even if you already have friends at Carlton. And then also the importance of extracurricular social work is a career choice that is super dependent on having previous experience and being able to kind of adapt to a whole bunch of different things. So extracurriculars are definitely super, super important for social work students. I know it can be kind of hard to think about, you know, like, oh my goodness, I have five classes, a lot of you guys are probably working part time as well. And so the thought of even having to do an extracurricular can be totally terrifying. But I wish it was something that I got into right away when I started at Carlton. I now work at Carlton Disability Awareness Center, which is a service center on campus that's run by QSA, our student union. And I last year was so thrilled to be working on campus. It was a fantastic opportunity. And it's going to be something that's going to be super helpful to have on my resume when I eventually graduate things like student societies or different committees. I'm on the accessible fund committee, which kind of is there to ensure that QSA events as well as other events on campus are as accessible as they can be to all of the students, all of the faculty and everybody that works at Carlton. So this is a fund that essentially kind of decides where money needs to go in order to make sure that these events are accessible. And again, it's something that's going to be super helpful to have on my resume when I graduate, which seems like it's going to be so far away but it's actually only next year now. And then some things that I learned during my first year. I'm not going to lie to you guys first year can definitely hit you like a brick at certain times. But it also is a completely fantastic experience that I've loved every single second of. One of the first things I learned is time management in high school professor in high school professors teachers, sorry, don't really care too too much you know they're like, I, hand your paper and whenever you know maybe you had a really strict teacher in high school which will definitely be for your benefit. But being able to manage work all five of my courses my extra curriculars. Get an agenda. It's not something that you're used to using get an agenda or use Google calendar put some sticky notes up places so you remember things. It's a memory of a goldfish and so having things posted where I can see them and remember them was super huge for me as well. And then I also went into social work being like politics don't matter I don't care about policy and research that's something that like is never going to be important to me I don't really care too much. Social work is completely flipped in my mindset around. And I'm now actually interested in going into policies and the research area of social work. And I think that it's really important to make sure that you guys are going into your programs whether it's social work or a different FPA program. It's a super open mind about everything. Social work and I'm sure a lot of the other programs as well are pretty broad programs. And there's a million different things that you could do after you graduate. And it's important to make sure that you guys are going in open minded and willing to kind of be like oh this is something I hadn't really thought about before but it's definitely really interesting and you know I want to make a change in this area. I don't really have anything in life without the policies and the politics that are behind healthcare or school or any of that kind of thing. And now I'm kind of realizing that starting from the beginning is definitely what I'm more interested in. So yeah there's tons to learn in your first year and throughout your entire four or five however many years at Carlton. So just make sure you guys are staying open minded and you're trying new things. I'll get over to Alina now. Thanks. Well hey guys my name's Alina. I'm also going into my third year in the social work program at Carlton. Literally you girls have said pretty much everything that I have to say but just a touch up I guess on some points. The textbooks so going on for the first question the textbooks. Absolutely right do not buy them weeks in advance months in advance even because sometimes your professors will. If you're lucky will post the course outline in advance and they'll tell you all the textbooks that you need and all the readings that you'll have to do if you're lucky. But if they do that don't buy the textbooks in advance because even sometimes the teachers will definitely the professors will definitely give you PDFs and things like that. But also there are groups online even on especially on Facebook who don't who they give your give the textbooks that you need. So even like $50 less or sometimes they're even used textbooks that already have like some notes in that they use for their exams. Hint hint nudge and I they really help. And it's super super easier like that so I would definitely recommend checking out those groups on Facebook for your textbooks wise. And further also for the first question about my first year. Going into that program. I knew that I like I knew from past experience especially from my family there are a lot of people in my family who are in the social work field. But other people especially like my younger cousins and other friends of mine from high school they never really knew what social work meant. They always ask what is social work what does that mean what type of job do you can get from them. Well I could list so many and knowing that knowing that I had that option of choosing which area to go into whether it like Emily said policy or like whatever other place there is. I was super thankful and so excited to become part of this. Like small but really great family in social work and really excited to learn and everything so I was really happy to get to meet everyone especially all my group friends and Emily and concluded.  And so much to learn from them not only from class but office hours as well especially the TAs as well. They may not take the exact same course that you're taking right now with them as your TA, but they have been in that program or have taken similar programs and or courses. So they will definitely be a really great help for assignments for exams, even past workshops I remember going to some when I was in the psych 1001 and they help. They help a lot so I definitely definitely recommend doing those. Um, so my for the second question my favorite extracurricular. Well, as the introduction said I am a huge fan of soccer, and one of my favorites extracurricular is playing soccer. I'm not on the team but I do play on the intramurals team. And the reason why I chose to just do the smaller type of teams like intramurals is because it's less of a commitment. Being on a varsity team obviously has its commitments as well and it's very very fun I'm sure of, but having being on the intramurals team, it's just a lot more chill, I find. And having that option of, you know, you have to go to every games of course but you can miss one or two games if you have like an assignment or exam the next day or something like that. But having that option and just being cut it's in the same campus but just being away from all of the work and the program and studying the library area of the campus and being completely on the other side. So this is a really nice environment and just being able to just relax, take that deep breath, big stress reliever especially just, you know, kicking a ball is a great stress reliever letting out all your anger and stress from your exams and assignments and just from the program in general. So that can, that really helps me in my first year and also making friends that helped a lot.  I'm kind of scared at first, scary at first, but it really helps make me make new friends for me. I remember going into my first year right before starting into Carlton in September. We had to write all these like introduction things on Facebook and then I got a direct mail at like a PM from this random guy like opera gear is like oh hey I saw you like soccer like you want to join our team. And then I did it and now they're like my best friends. So honestly just doesn't hurt to reach out like Emily said it's a great opportunity. Even the gym at Carlton and I just started being a gym person, but honestly it's the best experience I got like literally made so many more new friends from it and they're super super amazing even the trainers there. They're super helpful. And also the gym is amazing. But to carry on for my last question. Oh sorry, sorry one other thing, Frosh, I can account for that. From what Emma was saying, the events that they have. I'm also a Frosh facilitator taking ghosts. So let's go. The events that they have for this year, even if it's online are going to be amazing they're going to be super super fun. I know it's gonna be online so it's a little different compared to usual from other universities or other things that you may have, you guys may have heard. But trust me, I guarantee you guys will have still an amazing, amazing time. And also if you guys do it it's also an amazing way to meet new people whether it's in your program or not. It's still an amazing way to meet new people so try it out and it's gonna be a lot of fun. And so for my last one, some things that I wish I knew before, definitely time management as well, but also the resources available. The, not only like office hours, past workshops, things like that, but just peer mentor stuff, like for me. I'm a peer mentor for all of Carleton for first year. I'm a first year Connections. I'm an ambassador for FPA for Faculty Public Affairs. I'm also on a Frosh facilitator for Frosh. A bunch of other stuff going on too, but just those three things that are related to Carleton have helped me understand so much more that you guys think that are available than there really is. Because I was also in my first year, I was a mentee for the first year Connections program, but my mentor like he was part of the soccer team and on varsity and so he never really had that kind of chance or the opportunity to always meet up with me. But because I knew I started to learn that now instead of my first year, I realized that if that was the chance if that was what was happening in my first year I could have had different ways different different opportunities to still have my first year experience through the mentor program. So having that option, having all of these resources available, you can even ask like any of us or your other friends coming in meeting other people that you meet if they have any other connections with any other like mentor programs or things like that just to know all about the resources that are available on campus because trust me they help. They help a lot, even if you're just asking like your professor your TA, sometimes they'll tell you like the big ones the main ones, but from my experience, talking with like other mentors and other people in other programs, they've mentioned so many other smaller ones that actually help as well. So really, really try them out they've helped a lot. And yeah, that's pretty much it for me. Thank you so much. All of that information was very helpful. And I also cannot stress enough that your professors are people don't feel you know intimidated or anything like that. They love it when you approach them with questions they love seeing you in their office hours. So that was definitely a good point that actually all of you mentioned so definitely. So the chat is now open for questions. Emily has put in the chat for us as well. If any of you have questions regarding the Paul Menton Center for students with disabilities. She would happily answer any questions for you. He also has a number of resources available that she would be happy to chat about. So, actually we do just have a question pop up from Matthew. How does one find a mentor. Yeah, so I can answer that. So Matthew, for mentors, there is a program in Carlton called first year connections. I'm just searching up online or even in the Carlton website. For any of you guys actually are highly highly recommended. It's a program where, you know, you get connected with a mentor with an upper gear, and they find some of your similarities so either it's in the same program same faculty. Same interests and things like that. They ask you a bunch of questions just to get to know you as a mentee is a first year better. Yeah, perfect. Thank you Emily. So the link is in the chat. Please, please click on it and fill out all the information that you that is needed to for you to find a mentor and then once the program starts in September, we'll be connecting you with a mentor and so that you guys can start your process together. I hope that answers your question. Fantastic. Thank you both to me and Matthew was also said thank you. And the link that Emily has posted is Carlton dot day slash mentoring slash first dash year dash connections. So if you want to look that up feel free to. So I have a couple questions set aside that are just good for any first year at Carlton to know while we wait for some more questions to come through in the chat. So to all of our ambassadors. How did you find the workload in person versus online. I can take the lead on this one if you guys want. I have a few different learning disabilities, which is why I know so much about accessibility on campus. I've made that a priority. In terms of workload, I would say a lot of it is pretty similar. Though I do really appreciate that with certain online courses and certain professors. It's, you kind of have more of inability to do things on your own time. You're not necessarily 100% set to be online watching a live three hour lecture all once a week every week. You're kind of able to maybe go back rewatch a lecture. And you're it's definitely a benefit for sure. Obviously, there are certain benefits to having in person courses as well. But the professors at Carlton I've been taking online courses this summer to try to get ahead. And all of my professors have been super accommodating they've been super understanding everybody is ridiculously busy and kind of has no idea what's going on right now. And all of the professors have been super accommodating and super nice about everything. In terms of the actual workload. It is about the same you're still going to have assignments to complete you're still going to have quizzes and tests and papers and everything. But, like I was saying before a lot of the times you have different resources available to you so Carlton offers a program called video on demand which is available for a number of different first year lectures. And basically what this means is you can actually pay a little bit extra I believe it's $50 per course to have the ability to go back and rewatch your lectures, and to be able to kind of watch them on your own time. And this is something that's super beneficial, especially for me I have a slow processing disorder. So sometimes going back and being able to rewatch certain parts of a lecture that I didn't understand is super helpful. Wonderful. Thank you Emily for sharing that with us. James has asked, how can I learn which of my courses are synchronous slash asynchronous. I can take this one again. This is something that you should be able to see through your Carlton central timetable. And that's where all of the details for all of your courses can be. And so when you register for your classes some of that information should have already been there. I can see that somebody else pop back in so I don't know if you want to take this away under. Okay, great. I think you should be on the lookout in your course outline, because I think a number of the course instructors will have kept the time that they have assigned in the timetable but also will be preparing materials that you can take and access all the time. So it's probably difficult to do so now but when the course outline becomes available and these should be posted on C Learn late August early September, you should be able to see how which parts of the course are going to be synchronous which parts of the asynchronous or which entire courses are going to be held one way or another. So more to come is the punchline. Thank you both Emily and Dean. So Nikki has asked, how do you sign up for extracurricular activities online. I can take this one unless I'm going to go for it. So technically for extracurriculars. It is a kind of a difference especially because it's going to be online.   And there is a tab for like extracurricular extracurriculars or clubs that are available especially in quesad and things like that. So if you just you know go on that do some research kind of navigate your way and just go through like the tab that are available on the website in the extracurricular area. Those are a really great hit that's how I did mine for extracurriculars. There's also offices that you could search up that take care of extracurricular extracurricular sorry my bad. One of the places other than QSA is SEO it's student experience office. That's where you can find things like fresh stuff peer mentors faculty SEO so things like that they have a bunch of different programs clubs I know for one of them. So it was one event that I did where I got to meet Tessa virtue, the Canadian Olympic figure skater I don't know if you guys know her but I got to meet her through SEO program, which was super super cool one of my, one of my favorite people in the whole Yeah, so she is an amazing person it was a great, great experience through SEO. But yeah so they have. And they could even be I'm not too sure about this but they I'm pretty sure they would be doing events and things like that throughout the year online as well. If you search up Carlton SEO student experience office. They have like the have a list of upcoming events or upcoming things or like past things that they have done for Carlton and for especially for first years and things like that and you could also through that search up. If you aren't already to join fresh as well so great opportunities for those. So I'm going to add something about societies to because each program has like a society I don't know social work probably has a society to right yeah. So a lot of the societies now are taking applications I know like for the journalism society I was a first year representative on them like this past year. And they're taking like online applications like right starting like right now until like September 12. So if you're like in journalism and you're interested in joining the society it's really cool you get to plan activities things like that. I'm an application online it's going to be on their Facebook they posted the link on their Facebook. So if you look up Jay sock I think their their things are up there as well. I'm also going to hop in here quickly and shamelessly plug QSA. So QSA as we mentioned earlier is the Carlton University Students Association and their job is essentially to provide students with different resources and extra curriculars on campus. QSA has a number of different service centers. For example, CDAC so the disability center that I work at. And we have the GSRC which is the Gender and Sexuality Resource Center we have a wellness center rise which is for racialized and Indigenous students on Carlton as well as international students and just we have a food center if everybody if anybody is ever struggling you're more than welcome to use the food center as well. We're always looking for volunteers, but we also offer a number of different programs and events throughout the year. So if you guys are interested. In September CDAC will be running a sex and disability workshop. And there's just a whole bunch of really cool different events throughout the year that you guys are more than welcome to participate in. And QSA will also be offering different kind of like welcome to Carlton packages from the service centers towards the beginning of September so that's something to look out for look out for for sure. Because freebies are also like really cool and everybody loves freebies. So signing up to get one of those packages shipped or delivered to you is definitely a good idea to I'm also going to say one last thing about it. What about the freebies super super good they are awesome honestly I got all my merch from from like the university through that especially through fraud and things like that. And also, going back on Emma's point about the Facebook groups, Facebook groups have helped me so much. Not only with the textbooks and things like that and making friends during like soccer groups and things like that. But they also helped me learn new things and new clubs and activities that are available at Carlton. So if you just search up it's usually like as a kind of like a small tap type of thing under the Carlton University's like Facebook page itself. And they're also different years who have Facebook pages like for us there's like a 20 Carlton University like 2022 graduate. For you guys is probably going to be a Carlton University 2024 graduates page and things like that so there's going to be different years. And through that some alumni also join those groups and they give out really cool links to different clubs and activities I know there's one guy that's been posting constantly and it's super super cool in our group. It's super super cool and it's honestly helped so much you especially because it's online and things like that so it's a great way great area to kind of jump in and learn more about your university. Wonderful. Thank you. James and Nikki have also said thank you within the chat to our ambassadors. And in the chat I've also put in some of the acronyms that were mentioned they were explained while they were talking but I figure if anybody missed it. SEO is the student experience office and Q set is Carlton University Student Association so all of you as students are a part of that automatically. So Dominic has a question I received an email about the eye care's program. How can I connect with the faculty supervisor and see what research they're working on and if they're part of the program. This could be an Andre question. I think it's going to be an Andre question somehow that right now it's quite early to do this I curious will be announced once you're on campus again so for example there was a competition. Last to fill a bunch of spots in the summer that's typically when these these these opportunities are offered. So you should be on the lookout for this in the course of the year you'll get an email message or something. A point that was made in the other sessions is email is your friend, although it doesn't appear to be that at some time it is a it is by far the easiest and most accessible way of getting information from the university because we will send it out to you. So my advice to use to keep an eye on I curious and there are a number of other similar opportunities available to students. So please keep and keep your eyes open in your email and you'll get information over the course of the year. Thank you. So Dominic also says thank you in chat. Emily has been wonderful and been putting in links to what we've been talking about. So Emily's put in admissions.carleton.ca slash student life with regards to extracurriculars and also put in QSA online.ca. And that's where you can access everything about the Carlton University Students Association anybody need help with that. So we don't have any more questions in the chat, but I do have another one for all the investors. What are the differences between a lecture, tutorial and discussion class. Um, this is it's a definitely a question that I had going into my first year to you know you get your schedule and they're forced you to sign up for tutorial and you're kind of like staring at it like I have no idea what this is. Um, so a lecture is kind of the typical format you would think of when you hear lecture and there are different sizes for classes first year you do have to be prepared for a lot of your classes to be bigger. Um, so for example anybody who's in psych 1001 or maybe anthro or sociology 1001. Those are going to be classes with likely several hundred students and the lecture part of that course will happen. Normally would happen in a lecture hall. However, with all of our classes being online. It's kind of up in the air. Um, but that will likely be over zoom or maybe it'll be through video on demand see you will well which is the Carlton University online learning. Um, and so the lecture basically is the professor will talk to you for two to three hours, maybe an hour and a half depending on the class, you will have opportunities to ask questions during a lecture. Um, please don't be afraid to ask your professors questions I know it can be scary but somebody else probably has the same question as you. Um, a tutorial is a little bit different so a tutorial is essentially the same thing as a discussion group however there can be little differences between the two. A tutorial is often run by your TA potentially your professor depending on the course and the format and what the professor prefers. And this will have a much different little activities and little discussions happening throughout the tutorial or the discussion group. They would usually happen in a smaller classroom usually about 30 to 50 students per tutorial. It's a smaller class to begin with and the tutorial may even be as small as like 510 1520 students, depending on your course depending on your program that kind of thing. And yeah so it's a whole bunch of different little activities and discussions, a lot of times they'll help you study for any tests or exams that you have they might have little practice quizzes practice exams. It's for your assignments since they're the ones that'll be grading your assignments and that kind of thing. And in terms of discussion groups they're pretty similar to tutorials. And again it just kind of depends on your professor and your TA and what exactly will happen in those sessions between discussions or activities and that kind of thing. Yeah, I'm going to pop in there I really like discussion groups so I like I to take a history class which journalism students have to take a Canadian history class and is a pretty big class like 100 or so students but then you break off into smaller groups for discussion groups. And I really like that because it gets you the chance to talk to more people in your class that's how I made my friends like in the classes because we'd sit together and discussion groups, and we chat and like we'd, it's really opens up the conversation allows you like see what other people are thinking. I know for some of my discussion groups like I had assignments due in them so like every week like I'd have a lecture and then there was like a paragraph due on like the Wednesday that I had the discussion group. So it's like pretty easy stuff but it was really nice to sit down with the TA kind of discuss what's going on we talk about like what had been talked about in the lecture and kind of recap it. So it's a really great way to kind of work around your understanding of the topic that you're learning so far. And it's a great way to make friends as well.  But I was also equally as terrified to go sit in a room with 30 students who would all be able to see my face and hear what I'm saying when I talk. And honestly, I just want to really reassure you guys and let you know that it will be okay, especially now that things are online, they don't necessarily have to see your face. Even if you do have a professor who requests to be able to see you guys during their lecture online. Don't be afraid. It's honestly everything will be okay. And again, like we were saying before don't be afraid to lean on your professors and your TAs because they are there to help you. I also would like to jump in on that. In terms of lectures. I know I had to take and throw 1001 psych 1001 film 1001 like bunch of 1001 classes that involve maybe 300 200 students and I'm not saying that to scare you. I'm saying that because it's more of an opportunity it's more of a chance sorry that your question will be the exact same question as at least and I'm not exaggerating but it's at least five or 10 other students in class. So honestly asking questions I was scared. I never did it all my mentors, all my professors, all my upper years family who just got out of university things like that they're always like make sure you ask questions you know don't be scared. Do these clubs do this club join us. I was always saying yeah I'll do it I'll do it but I never did. And that's what I regret asking questions was is the best thing to do honestly they are super super helpful. And also, not too sure about online because for me personally I'm sure for Emily as well our classes have been just COL and the video on demand. But for usually for lectures that are really long like two three hours they do have a break in between. So if you like me to go to the bathroom go get like go for a walk even just take a break from the whole entire class, or even go into the chat on zoom and like ask questions to your professor. Honestly there's like a lineup for students I remember when I went into psych. I was all the way at the top always never near anyone else and at the end of class I would always go up to the professor and stand in line and ask my question. And I'd hear the other questions in advance for me from the other students, and I'd hear like the same question as mine. And then two other people in front of me or behind me sorry would also leave because we just got our questions answered. Honestly, don't be afraid to ask your questions they're super super helpful the professors are always going to be there for you, whether in the middle of lecture after lecture even before lectures they're happy to help and answer all of your questions. And things like that so yeah. I remember being scared to like answer a question like my journalism class and it was like 100 or so people and I like raised my hand my professor was like, Yes, Emma and I was like, Oh my gosh she knows my name I was like, I was shocked I was so excited. So like really they like know you they want to answer your questions it seems intimidating it's not and yeah a lot of people have the same questions as you, but I bring so shocked I was like. So that if asking questions is something that you guys are nervous or anxious about.  But it's also important for you guys to reach out if you have questions so if you're nervous to do that in person over the chat, or you're nervous to go to office hours just shoot your professor your T and email. And more often than not they'll get back to you within the next day if not the next day or two. And they'll have a complete answer for what you're looking for, or if they're having a hard time with it then they'll offer to set up office hours with you, and to be able to answer your question a little bit more directly and in person. Thank you all so much. So that does conclude our session.  If not feel free to reach out to me Stephanie boss, I'm the one that sent you all the information for this session. I am more than happy to answer your questions or pass them on to our ambassadors who will be willing to answer as well. And I just wanted to say thank you all again for coming this morning and I wish you all the luck in your academic year. Great well thank you very much everybody for joining us and thank you to Emma, Alina and Emily for hosting this event so effectively. Thank you. Have a great day everyone. Thanks guys.


Hello friends, I am Sanjay Gupta. I welcome you on my YouTube channel. My channel contains more than 800 videos related to various programming languages. You can search those videos through the keyword programming by Sanjay Gupta. You can also search my YouTube channel by typing my name Sanjay Gupta in YouTube. You can subscribe my YouTube channel if you want to follow programming related videos. If you have any queries, you can connect with me by following these details which are available in front of you. Now in this video, I'm going to discuss about shortcut methods of conversion. So first I'm going to discuss binary to octal conversion, then octal to binary conversion, then binary to hexadecimal conversion, then hexadecimal to binary conversion, and then octal to hexadecimal conversion. So I will be discussing how you can apply shortcut methods to perform these conversions. So first we are going to learn how we can convert binary to octal using shortcut method. So here you can see two steps are available. So first step says make group of three bits each starting from the right-hand side if required. Add initial zeros in the leftmost group. So here you have to make the pair of three bits if you want to convert binary number into octal. Second point says convert each group into one octal digit by using the method for binary to decimal conversion. So after making pair, you have to apply this step which is pretty simple. So by applying these two steps, you can convert a binary number into an octal number. So let's have a look on an example so that you can understand both the steps well. So the question is convert 101110 which is a binary number into octal number. So here you can see I have grouped three bits together. So 110 is one pair and 101 is another pair. So here I have created two pairs. Suppose there are total five bits only. Then you can add additional zero on left-hand side of a particular pair where less number of bits are available. So now you can see 110 is converted into six. So this is a binary value 110. It's equivalent. Decimal value is six. So simply you can find out this value. Then 101 which is equivalent to five in form of decimal. Now we can combine five and six to make octal number. So friends, this way you can easily convert a binary number into octal number by making a group of three bits together. So this is the first conversion method or you can say first conversion method by using a shortcut. Now second is octal to binary. So now we have to convert octal number into binary number using a shortcut. So first steps is convert each octal digit to a three digit binary number by using decimal to binary conversion. Second steps is now combine all the resulting binary groups into a single number. So let's have a look on this example so that you can better understand the steps. So this is the value 562 which is octal number. We have to convert it into binary. I have placed 56 and two. Then I have identified binary of two, which is 010 binary of six, which is 110 and binary of five, which is 101. Now if I combine all these binary digits, then this number 101110010. So this is the equivalent binary number for 562, which is an octal number. So friends, this way you can easily convert octal number into binary by this shortcut method after explanation of binary to octal and octal to binary. Now moving to binary to hexadecimal conversion. So here again two steps are available. The first step says make group of four bits each starting from the right hand side if required at initial zeros in the left most group. So in case of octal we created a group of three bits, but in case of hexadecimal you have to create group of four bits. Second step says convert each group into one hexadecimal digit by using the method for binary to decimal conversion. And this second step is same as we discussed in octal. So now the number is 1101011. This is the binary number. We have to convert it into hexadecimal. So I have created group of four, four bits and each group is converted into its equivalent decimal. So 0011 is three 1101 is 13 and in hexadecimal 13 is equivalent to D. If we combine these two digits D3. So finally the equivalent hexadecimal value will be D3. So this way by applying the shortcut method I have converted binary number into hexadecimal number. Fourth is hexadecimal to binary conversion. So here you can see first step is convert each hexadecimal digit to four digit binary number by using decimal to binary conversion. And then combine all resulting binary groups into a single number. So it is equivalent to octal to binary conversion. Here we have to make four digit combinations only. So here you can see the example where 2AB is the hexadecimal number and we have to identify its equivalent binary. So binary of D is 1011, binary of A is 1011, sorry 1010 and binary of 2 is 0010. So individual digits binary formation have identified and then we have to combine all these binary digits<PHONE_NUMBER>11. So this is binary value for 2AB. So this way I have applied shortcut method to convert hexadecimal to binary and binary to hexadecimal. Now last one is convert octal to hexadecimal. So number is 2571 which is octal number and we need to convert it into hexadecimal value. So first we have to convert 2571 into binary. So I have placed 2571 individually and their equivalent binary values are available and I have grouped those values to identify the binary. So 2571 which is octal number, its binary is written here and now we have to make group of four four bits so that we can identify its equivalent hexadecimal number. So here you can see this binary number is grouped into four four bits combinations. Then four bits combination is converted into its equivalent decimal value. So 1001 is 9, 0111 is 7 and 0101 is 5. Then if we put all these digits together, 579, then final outcome is 579 and it is hexadecimal number. So 2571 which is octal number, its equivalent hexadecimal number is 579. So this way I converted octal to hexadecimal. If you want to convert hexadecimal to octal, then first you have to convert hexadecimal to binary and then through binary bits, you can make group of three bits convert each three bits group into decimal and combine all the digits to find out equivalent octal number. So this way I explained you all five shortcut methods to convert a particular number into another. I hope you have understood whatever I have demonstrated in this video. If you want to ask any query, you can connect with me by following these details which are available in front of you. If you want to watch more programming related videos, you can follow my YouTube channel. Thank you for watching this video.