Have you ever dreamt of a ready-to-use platform to make prototyping of an IoT application rapid and effective without having to write any code? Well, ST makes your dream come true! Sensortile.boxpro is the solution. I am the Nissan Flippo Application Development Engineer in Memsug Group at ST, and I'm going to introduce you the first working mode of Sensortile.boxpro, known as the Entry Mode. The Entry Mode enables you to discover the Memsensors functionalities by providing predefined IoT and wearable functions and examples. You can connect your Sensortile.boxpro via Bluetooth by using the ST BLE Sensor app, available both on Google Play and on App Store, on your smartphone, and immediately build your own apps through a graphical interface. Let's go into detail. First of all, let's switch on the board and open ST BLE Sensor app on your smartphone. From the main page of the app, click on Create a new application and select Sensortile.boxpro as board type. A list of example apps categories appears. Select for example Motion. Then select Sense of Fusion Quaternion among the example applications. A brief description of the application and an app overview, schematized as application input, function, output are provided for each example application. If we focus on the Sense of Fusion Quaternion application, the LSM-6, DS-V-16X, IMEMO-6 3-axis, inertial measurement unit and the LIS2-MDL 3-axis compensated magnetometer are used to show the orientation estimation of Sensortile.boxpro in the 3D space. If we look at the block diagram of this app, the accelerometer sensor, gyroscope sensor and the compensating magnetometer are present. The compensating magnetometer is itself an application where the magnetometer is calibrated to compensate its offset. The output of the compensation can be saved. The Sense of Fusion Quaternion function is applied to this input data and the output is streamed to Bluetooth. Now click on Play button, available in the application overview section. The available board list appears. The considered board is identified by its name, in this case stb underscore pro. Click on Play. A pop-up window called Overwrite Board opens. To load the current application on the board, substituting the old one already present, click OK. The application is loaded and the blue LED turns on. A pop-up window appears. If you click on Boards List, you can go to the list of the available boards and select Yours. Otherwise, by clicking on Auto-Connect, you can directly connect to the board. Well done! Here it is MemSensorFusion Quaternion demo. If I move the Sensortile.boxpro, the dice is moving accordingly. This is amazing, isn't it? Explore many more applications of the entry mode and visit the Sensortile.boxpro webpage on st.com for further details.


freedom of the press, freedom of the press. The First Amendment of the U.S. Constitution gives citizens the right to write whatever they want without being punished by the government. There are legal limitations. For example, we are not allowed to lie to get what we want.


Can you get metrics from a complex measure, quite like Jeter and Aco or things like this? I have like 1 minute, 5 seconds or if you need to discuss more please outside because we get closer to the end and then we don't do a delay. First we make a bomb-wise analysis and a massive metric of final product. No. Sorry, I need to give it back. Thank you for the help. I did the restarting. Maybe it doesn't feel the monitor. Yeah. Just hold on, maybe I need to restart because sometimes it helps. Oh. I think Manjaro is too much for his left eye. Hi, I'm Salvo. Teo. Nice to meet you too. It doesn't happen on Windows, right? Yeah. There we go. I told you, if you... Booting lane or something. Yeah. It's Manjaro. One, two, three, four, five, six, seven, eight. This one? You can't hear it, but it's very loud. Wait, I'll take a picture. I can't see it. What? Yeah, but why doesn't it appear on this one? Because it doesn't appear on the monitor. It doesn't appear on the monitor. It's not on the monitor. Is it... Yeah? Okay, we are ready to start. Have your seats and not to get more delays. We are already one, two minutes over. Please. Hello, everyone. My name is Teofil Vavaziano. It's my first peak, so I'm a bit nervous, and please take me easy. Thank you. Thank you very much. This topic, it's about the fraud mitigation using traffic pattern monitoring with CG rates. Fancy title, what can I say? About me. I start at a software developer at ITC SCOM, company that offering VoIP and billing platform implementation since... Sorry, I said it's my first time. I remain without Airbnb. Since 2007, we focusing exclusively on CG rates. I finished my... I taking my bachelor degree in computer science, and after that I joined the master program Big Data. That's my life in a nutshell, I can say. Now, who knows about CG rates? So, who heard about CG rates? Quite a lot of people. CG rates is a real-time enterprise billing suite. It's a fancy title also, but it's like plug and play. That's what CG rates is. It's an open-source software. Full-source are available on GitHub. They don't have private ads in repository. Everything we want to be full transparent. So, you can see the issues, the code. It's entirely free. So, we have a strong and vibrant community behind. So, they help a lot. If, I don't know, let's say we by mistake and made the commit and something's break, the community report, I don't know, let's two or three hours, something like this, and we change, fix it, and that's all. It's performance-oriented. We have our built-in cache system. The primary reason for this is that we want to be fast, like very fast. Imagine that you're querying the database for an object or something. This query can take a bit. Let's say one second. And you get, with the cache system, it's like in a few milliseconds, maybe none a millisecond. It's very, very fast. You don't have the time to start number or you have the result. In my opinion, the most important thing is test-driven development. Have more than 5K test as a part of the build system. We have three types of tests. Unit testing covers the most of code, like, I don't know, conversion function or something. We have integration test and we have call test. We take the calls and simulate how it goes. CG rates also have a modular architecture. Everything has an API, so just take the CG rates and you will find an API for everything. Maybe one percent don't have, but if you open a future guest on GitHub, we can make it. It's easy. I won't talk so much about future reach, just focusing on a few. The main, it's online and offline charging system. So cover both. Multitenancy from day one. Rating engine with derived charging. This means that you can take the CDR and derive as many times as you want. For example, I get a CDR and I want to rate with different rating plans three times or with different four rating plans or, I don't know, just how you configure. Session or event charging with balanced reservation and refunds. This applies in prepaid mode. So let's say that you set a debit interval for an account for 20 seconds. We take the amount from the balance for 20 seconds and if the call ends faster than, we will find the increments. So the balance won't be lost. CDR logging. Throw detection with automatic mitigation. We'll talk immediately. LCR with QS bundles, call statistic, diameter, radius server with process templates. Standard agnostic. That means you can define your own templates for diameter.  How the event will arrive in CG rates and how we'll be sent next. And it's compatible with any standard. So you have full control about what's came in and what's go out. Resource allocation controller. Building high availability and dynamic partitioning support. Agile in developing a future. That's how CG rates evolve through the years. Now you can see in the first picture, the evolution in years, in the middle picture, the activity. Earlier I said that CG rates have a modular architecture. That means in CG rates everything is structured in subsystem. The subsystem can be stand alone. So you can use for everything. And outside the CG rates. Most of the code for them was written. And now we are focusing on fine tuning to increase the speed. I don't know. Fine tuning, you know. And in the right picture, the community. Don't exist a day without a commit. In every day we made a commit, made a change. That's, it's a schema, let's say, about subsystem. Down we have the agents. The agents are like small things that communicate with sessions. And from there, the session happens all the magic. In sessions, create the CDR, refund the increments, all. The agent, talk with the session. And from there, the session send the CDR to CDR server. CDR server can receive CDRs, from session, but only from files. Or from, I don't know, anything you want. After that, you can online exports. Again, for prepaid, after a call end, you just export to somewhere you configure. Or you can store. Or you can send to other subsystem to make other procedures. Like go to stats, calculate some metrics. From there, go to threshold. And, you know, something like this. Now about the fancy title, proud mitigation. Accounting or account service has two methods to handle this. First is action trigger. And the second is threshold. Action trigger is a bit older and soon will be deprecated in favor of threshold. Action trigger is still built-in, so balance operation cannot avoid it. Proud mitigation for resource, for stats CDR for sessions. For all these, you just have to create a connection from resource to threshold. And there you have the proud detection. Now, a bit about threshold service. Like I said earlier, it's a standalone subsystem. It can be used outside of Siege Ray Scope. You can connect internally. You just made a connection as said that it's internal or remotely. It's performance oriented and using filter as accepted list. Some of the advanced functionality, multiple filters, types. These filters are, how to say, are centered. So every subsystem use this. So if you understand a filter for threshold, you understand the filter for each subsystem. Whew, breathe a bit. About the next one, we'll talk about in one, two minutes where I will show you an example of an AP. AP call and how we can set a threshold. Action executed on match. A threshold can execute multiple action. So, for example, let's say you want to be informed about if an account was closed and closed that account. Or you want to, I don't know, receive a CDR and do stuff with them so it can support multiple action. Here, we have an example of API call where we set a threshold profile. The first two, tenant and ID are used to make a unique key. So like a unique identifier for the threshold. So we can have duplicates. So the combination of tenant and ID must be unique. Second, the third, the filter IDs. It says it has two filter. First filter is of type string. The field name is balance ID and the value is default. Just a bit. This one. Okay, so the filter says it's string balance ID default. So the filter will check the event, will check for the field balance ID and will take the value and will compare the value in our case meta default with the value that we put in filter, meta default. And it's a match. The next filter says it's a meta GT, greater than. Will take the value of units and will compare with the value that we are given, 12. So in our case, the value of units is 12.3, which is greater than 12. After that, activation interval. Activation interval says that you want a threshold to be active just for a period of time. One day, one month, one year, 10 years. I don't know. Depends on your max hits. Says that how many events can threshold not support the right term, but how many hits can he take? So for example, in CG rates came an event and from there we sent to threshold. So when a threshold match, we says that it was hidden. So we have max hits, mean hits. Mean hits says that how many hits take to became active. So for example, you gave a penalty. So after three penalty, your threshold became active and it will run only for two process. Mean sleep says that after a threshold was hit, go to sleep. Go and rest a bit until another take your responsibility. Blocker. If you have multiple threshold that match the same event, blocker says execute the first threshold, then stop. It's like a barrier. Weight, it's used for ordering. Imagine that we have two thresholds. Exactly the same, but the weight is different. The threshold with the bigger weight will be executed first, then the others. Like I said earlier, we can have multiple action IDs for threshold. The first action, it's used to disable an account so the account won't be active. The second is to inform. Next, we have an example of process event where this event came from stats. So you see there are metrics. And if you don't like our metrics, you can configure on your own metrics. So for example, meta, sum, Diaz account. That's a custom metric. Or meta average Diaz extra fields. That's also a customized metric. Down there, as a result, we have the idea of the threshold that was heated by the event. There is an event from account, and you can see the event has different fields. Now some use cases. For the accounting, where when monetary balance goes below 2 euro. It's like account, send an event to threshold, threshold verified and says, hey, you only have just 2 euro. So in that moment,


I'd like to introduce Dimitri Trofimov, who's the team lead and a developer on the PyCharm team and is going to talk about profiling. Hi. You are brave people who are interested in profiling and don't afraid of talks marked as advanced. Actually, when I saw this talk in schedule marked as advanced, I was scared a bit myself. It won't be that hard, I hope. So, first, I briefly introduce myself. My name is Dimitri Trofimov. I work for JetBrains, I'm team lead and developer of PyCharm ID. My talk won't be about PyCharm directly, but I will use this debugger as a case study for profiling and optimization. If you want to discuss anything about PyCharm, just come to JetBrains booth in the expo hall to talk with the team. Being involved in the development of PyCharm, I have done a lot of different things. But the runtime aspects of Python, like debugging, profiling and execution, interested me more. Today I want to show you how usage of statistical profiler can help to optimize program. And this program, as I've said already, will be a Python debugger. I will try to stay on a high level using the debugger as an example and touch its details only if necessary. So, let's begin. The best theory is inspired by practice. The best practice is inspired by theory, said Donald Knuth. I like this saying. What I'm going to show today is inspired by practice. It was a real problem and to some extent still is. And the approach, the solution to it that I will show later was also real. It was actually done at some moment. And if you're interested in it, you can look into the code. But also very interesting is that when preparing for this talk, I tried to rationalize things and to look at the process which happened in the past from a bit more theoretical perspective. As if I did that again, but more in the right way. And actually that opened some knowledge for me and gave me some ideas that I will implement in future. And I hope that you find something interesting in this talk too. So, is it happens quite often in our software development work? We start with an issue ticket in the bug tracker. So, the issue says debugger gets really slowed down and it provides a code sample. And so, we see clearly that this issue is about Python debugger in PyCharm. PyCharm debugger. That's some part of the PyCharm that is written in Python. That's the same debugger that is used in PyDev AD. That's an open-source project that is maintained by Fabio Zadroszny, the author of the PyDev. And also it's maintained by PyCharm team. To understand better how the debugger works, I recommend to listen the recording of my talk at EuroPython 2014. This is called Python Debugger Uncovered. But now I will remind some basic concepts. PyCharm Debugger consists of two parts. The part on the IDE side or the visual part is responsible for the interaction with the user. It communicates with the second part that lives in the Python process. This second part, the Python part, receives breakpoints and comments via socket connection and sends back some data if needed. And the data can be the values of variables and stack traces and notifications about breakpoints. So, that's a Python, a part of the Python application with some threads, I.O. and separate event loop. And it's actually always running in the background of the process. And that all can lead to some performance overhead. And the core of the Python debugger is the trace function. That is actually the window through which the debugger looks to the user code and sees what's happening there. Python provides an API for tracing the code. It is a function called setTrace. It gets a trace function as an argument. Then that trace function is executed on every event that happens with the user program. An event like line execution or function call or exception or return from the function. There are a lot of checks that trace function performs. For example, it checks whether there is a breakpoint for a given line and if there is, it generates a suspend event. So, I think you've got an idea how debugger looks like. There are some threads doing communication with the ID in the background and there is a trace function that gets events about executed lines. So, let's go back to the issue ticket. When the code is executed normally, it runs for three seconds. In the debug mode with the breakpoint, it executes for 12 seconds. But in the debug mode with breakpoint, it executes for 18 minutes. It's very long. Let's reproduce the issue, whether it actually exists. So, we open PyCharm and we have this code. Actually, not to wait 18 minutes, we will reduce the code snippet. Actually, about this code snippet is just... Actually, that is a simple function with one iteration through the range. The only interesting thing is that the range is quite big and we have here an increment. So, let's reproduce this issue. We just run it. It was fast. Then we debug it. It was a bit slow but also fast.  Then it works. Yes. So, the issue exists. Let's analyze this issue. So, we have here three different cases. Normal run, debug without breakpoints, and debug with a breakpoint. And actually, as we can place a breakpoint at different lines, there are three more cases. So, it's debug with a breakpoint in the function, debug with a breakpoint in the same file but not in that particular function. And debug plus a breakpoint in some other file. But testing shows that the last case actually behaves the same as debug without breakpoints at all. Breakpoint is some other file doesn't affect performance at all. So, we won't look at that case. So, basically, we have four different cases. So, for our four cases, we have two cases with breakpoint in the function and with breakpoint in the file. The debug works slow. William Edwards, Deming, famous engineer, statistician, and management consultant said, you can't improve what you can't measure. So, before we do anything else, profiling or optimization, we should be able to measure the performance of the thing we want to make faster. In our case, the core of the sample code is in duration. So, we use model time to write how many seconds it took for the duration to complete. So, that will be our simple measurement. And after we apply this measurement to our cases, we see that the two cases with debug with breakpoints actually work 100 times slower than normal run, which is a bit sad, but who knows? Maybe in this particular case with this example, it's not possible to make any better. So, we need to compare this with something, with some program which does the same thing and have more or less the same functionality. And we choose PDB for that. Although it is less functional than PyCharm debugger, but it is sufficient for our comparison. You can place a breakpoint and PDB will stop at it. It is also written in Python, so it is in the same class. It wouldn't make any sense to compare with something written in C, because it has different application. So, and PDB is in standard library, and so it sounds natural to take it as a performance standard. And now we can make a benchmarking. After we took PDB as a standard, we can apply the same measurement to it, and then we can compare results with our debugger, which now will become a baseline in terms of benchmarking. And what we see is that PDB being a bit faster still suffers from the same problem. In the cases where breakpoint is set, the performance drops down dramatically. But still it is a bit faster. It takes five seconds instead of nine. So we can try to reach its performance. And the first thing we need to do to make the code faster is to find a bottleneck. It doesn't make sense at all to optimize parts of the code that doesn't influence the overall performance. And the part that influence the overall performance, the most, called a bottleneck. So let's find it. And the best way to do that is profiling. Profiling is the way to look at your code from a different perspective, to find out what calls what, and how long did it take for that to run. Profiling is a set of statistics that describes how often and how long various parts of your program executed. A tool that can generate such statistics for the given program is called Profiler. Let's use a Python Profiler. But first we need to choose one. So let's learn about Python Profilers available. If you're looking for a Python Profiler, you'll find several of them. The most obvious choices are C Profiler, YAPE, and Line Profiler. C Profiler is a part of the Python Standard Library. It is written in C. Python documentation says about it, C Profiler is recommended for most users. It's an extension with a reasonable overhead that makes it suitable for profiling long-running programs. YAPE Profiler is almost the same as C Profiler. But in addition, it's able to profile separate threads. Line Profilers were different from two previous Profilers. It provides statistics, not about functions that are executed, but about lines inside the functions. Also written in C, it provides a rather high overhead because it traces every line. As C Profiler is a default choice and we don't need the features of YAPE and Line Profiler, at least yet, let's use C Profiler. And we do that in PyCharm. For that case, we will have a bit, our sample code will be changed a bit because we need here to use, at the same time, debugging and profiling. So we will set up debugger from the source code. And we'll put place breakpoint here. And what we do now is we profile it and we continue. So the task started, we wait until it finishes. So, and after that finishes, we see, no, sorry, that is not what I wanted to show. Let's do that one more time. We continue, the task started and we wait until it finishes. Yes. And we look at the call graph. We see here a lot of calls, but actually, if we look closer, we'll see that all of them actually take zero milliseconds. That calls, that are internal calls of debugger. And the calls that took the most of the time, actually, there are two of them, are user code. That's our function and the main work. So basically, what we are seeing here is that Cprofile didn't show us any useful information. Is our debugger unprofileable? Or should we use YAPI or line profiler then? Actually, if we do, we'll see that they don't show anything neither. And so, why is that so? Why is it so? It doesn't work. Okay. To answer this question, we need to learn a bit about how Cprofile, YAPI and line profiler work. Cprofile provides deterministic profiling of Python programs. What does deterministic profiling means? There are actually two major types of profilers, tracing profilers and, or deterministic profilers, and sampling profilers, also called statistical profilers. Tracing profilers, they trace the events of the running program. An event can be a function call or execution of a line. That is the same as we had with the trace function in our debugger. The disadvantage of such profilers is that as they trace all the events, they add significant overhead to the execution. As for the debugging, Python provides an API for the profiling. The function responsible for that is called set profile. It's almost the same as set trace with the only difference that the function that we pass to their profile function isn't called for every line. It's called only for function calls. All these profilers use a set profile or set trace function to set up the profiling. That's why they profile on the user code. Our debugger, which also uses a set trace, turns out to be out of the scope of set profile. All these profilers aren't applicable in our case. So is our debugger unprofileable? Actually, there is another type of profilers. It's called a sample or statistical profilers. Such profilers operate by sampling. A sampling profiler captures the target performance call stack at regular intervals. Sample profilers are typically less specific and sometimes not very accurate, but they allow to run the program at its full speed. So they have less overhead, which in some cases make them actually much more accurate than tracing profilers. Finding a statistical profiler for Python is not that easy as a tracing profiler, as there is no obvious choice. But if you search enough time, we'll find several statistical Python profilers as well. That are StartProf, Plop, Intlv2Namplifier, and VMProf. Let's have a closer look at them to choose the one that we'll use to profile our debugger. StartProf is a sampling profiler written in pure Python. It's open source. It doesn't work, unfortunately, on Windows, only on Mac and Linux. It works, but it's quite minimal. And last time it was updated was long ago. Plop, or Python low overhead profiler, is written in pure Python. So actually it's funny, but it's not that overhead. It's not that low overhead as it could be. And it doesn't work on Windows neither. And its main page on GitHub says that it's a work in progress and it's pretty rough around the ages. So not our choice. Intlv2Namplifier. It is very accurate, has low overhead, but it is proprietary and not open source. You need to buy a license to use it, which may be not the worst thing, but it isn't as suitable in my case as it doesn't work on Mac OS X. And VMProf. VMProf is a lightweight statistical profiler that works for Python 2.7, Python 3, and even PyPy. This profiler was developed by PyPy team that represented a year ago at EuroPy in 2015. And since that has been developed and actively enriched, it's stable state. It is written in C, so it has a really low overhead. It's open source and free. And actually it's very great, it's open source because it allowed me, for example, to add line profile and feature to it during preparation for this talk a week ago, which would be impossible if it weren't open source. So it seems that it's a profiler of our choice. Let's try to use VMProf to profile our debugger. And we do that again in PyCharm. So we'll use another run configuration for that, the same source code, and we press profile button. Do we continue? We wait until the main task finishes. Yes. And after it finishes, we see that we have here a call tree. Actually, that is a nice feature of a sampling profiler that provides you with a call tree where you can see actually how your program was executed with timings. And we see here that the most of the time was taken by our trace function, that is the trace function of our debugger. So that is the bottleneck. Our trace function itself is a bottleneck. Not everything else, not threads, not ION. It's a trace function. So we found bottleneck. What should we do next? To make our program faster, we need to optimize it. And optimization can occur at a number of levels. Typically, the higher levels have greater impact. The optimization can proceed via refinement from higher to lower. At the highest level, the design may be optimized to make best use of the available resources and expected use. The architectural design of the system highly affects its performance. But in our case, we are a bit limited with our design decisions as we need to comply the set-trace API contract. So this optimization level isn't available for us. Given an overall design, a good choice of efficient algorithms and data structures and efficient implementations of these algorithms and data structures come next. Let's see whether we can make an algorithmic optimization. To find the way to optimize our debugger algorithmically, let's ask ourselves a question. Why does debug without breakpoints work so much faster than with breakpoints in the executed file? If we look into the code, we'll find out that in case there is no breakpoints in the current file, the trace function returns none. While if there are any, it returns itself. So in the middle of this function, we get the breakpoint of the file and if there is none, then we just return none. And so if we refer to the documentation again, we see in the last sentence that local trace function should return a reference to itself or another function for further tracing that scope or none to turn off tracing that scope. So actually, if we don't have breakpoints for the file, we turn off the tracing for the scope altogether. That's why it works very fast. And why don't we do the same for, but for functions, not for file? So we can add a little change. We store the name of the function where the breakpoint is placed and then if we don't have breakpoints for a function, there is no need to trace it. We just return none. If we measure the performance of this optimization, we see that our function started to work 110 milliseconds instead of nine seconds, which is a big deal. Beyond general algorithms and their implementation, concrete source code level choices can make significant difference. So our next optimization will be on the source level. But to make such an optimization effectively, we need to go to the source lines level. For that line profiling can be useful. But line profiler won't help us in that case, as it is implemented by trace function. Instead, we use a special mode of VM proof profiler, which was introduced there recently, and it enables capturing line statistic from stack traces. Let's use it and see how it works. We will again run it in patch arm. We'll use another run configuration for that with the line profiler mode enabled. And we use the same source. And we press profile button and we continue. So after it finishes, we see our trace dispatch function. And now what we can do is go to source. And in the source, we see a hit map, which shows us which line took the most of the time. And it's very strange, but the most of the time was taken by this particular line. It was 20% and 330 hits from nearly 1,500. Actually, what that line does is that it checks whether we need to trace this particular thread or not. That's it. So if we see that those two lines in the beginning, they are not related at all to this line. So what we can do is to move this line in the beginning of this function. Let's do that. So we'll just put it here. And also, if I think about how to optimize this source, we can remember that getAtter is not the optimal way to check whether an object has an attribute because getAtter makes a lot different things. So how we can rewrite this is we can write it... Oh, no. It's not very convenient to write it. Okay, I won't type because my setup doesn't allow me to do it. So we rewrite it this way. So we just check whether this attribute, which is used as a mark, is in the dict of the object. And after we check the performance of this, we'll see that this source optimization actually gave us one second. There are several low-level optimizations which aren't available for Python. Being an interpreter, Python doesn't have built, compiled, and assembly phases. Runtime optimization is possible in Python because runtime optimization is, for example, GIT that's just in time optimization, but it's available now only for PyPy and not for Cython. So what to do? Did the optimization reach its limit? Actually, if all high-level optimizations are already done and Python doesn't permit us to go deeper, we need to go beyond Python. Maybe we should rewrite everything in C to improve the performance. But in that case, we will lose the compatibility with Python implementations other than Cpython. For example, gython, ironpython, and PyPy would become incompatible. And having two implementations of the debugger, one in Python and one in C, we will make adding new features a lot more harder. What if we could just leave our Python code as it is but still optimize it a bit on lower level? So solution exists. And it's called Cython. Cython is a static compiler for Python which gives the combined power of Python and C. That is an example of program written in Cython. Know that it looks exactly like normal Python code except that declaration of variables in the second and third line, these declarations have type information which allows Cython compiler to generate more efficient code. So this basically provides us with another level of possible optimization inaccessible before, namely compile optimization. Let's add Cython type information to our trace function implementation. So after we compile our trace function with Cython as a native extension and measure its performance, we'll learn that it made our debugger more than twice as fast, four seconds instead of nine. So now we can compare all three optimizations combined with the baseline, our initial version of debugger and with the PDB, our goal. And we see that we have reached the goal and actually done even better. Yay, happiness. But to better our happiness, I will say that after we compiled our debugger with Cython, it became a native code which can be profiled with VM prop well anymore. So it is unprofileable again, ironically. But there are still ways to profile it which we'll leave out of the scope of this talk today. And the issue, we managed to double the performance for the sample code from the issue ticket. And we made it better than PDB. But still, in this particular case, it works slower than run. And maybe it is possible to make it even to work even more faster given the constraints of the set trace API and so on. But still, maybe there are ways to optimize it. So we'll leave that issue open for a while. Conclusion. Use profilers to find bottlenecks in your code. There are different profilers. Each has its own advantage. Learn about them. Start to optimize things from the higher level to lower. And to optimize Python on a lower level, use Cython. So that's all for today. Thank you for listening. There are links for VM prop profiler and debugger if you are interested in looking into the code. Actually, this feature of LAN profiling was added to VM prof recently. So it's not available in PyCharm yet. But it will be available via a plugin. I will publish it on this week, I hope. So thank you very much. Thank you very much, Dimitri, for this great talk. So the floor is open for questions. May I ask you to wait for us to give you the microphone just because we are recording everything? Thanks. Hi there. My biggest issue is memory profile. Can you help me do that? Actually, in this particular case, memory profiling wasn't an issue. If you're interested in memory profile, I can recommend to look at the VM prof because it supports memory profiling. The only thing it doesn't support yet is profiling of the native memory allocations. But that's actually quite a hard problem in Python. So if you have a pure Python code, VM prof can profile your memory. And actually, in Python 3.5, there is an API for memory profiling. I don't remember how it's called. I think it's called memory profiling. So you can look at it also. Questions? Hi, I'm Mikhail Kowalski. And I wanted to ask maybe a new question. Isn't writing the code in Cyton somehow also rendering it incompatible with other Python implementations? Yes, that's a great question, by the way. Yes, it does. If you just add a CDF into your Python source, it won't be compatible anymore. But what you can do and what we did in PyCharm Debugger is we had these Cyton optimizations optional. So the only change that you need to make in your Python source to be at Cyton compilable is to add these CDF definitions in the beginning. So we used a little template language. So in our source, these CDF definitions are commented out. So the source is running as a normal Python source. But to build Cyton extension, we uncomment these lines and the source became Cyton compilable. I can show you, actually, it's better to see than to say. So here we have, like, this is a custom template small language and it says, if it is Cyton, then we have this header. If it's not Cyton, then it's normal Python. So, actually, this source works for all Python implementations and if we need to compile that, we do it with a setup.py where we uncomment this if in case of this Cyton. Yeah. Any more questions? Well, if not, please join me in thanking Dimitri again. Thank you very much.


Alright, we're going to get started. Anybody comes in? Well, that's just fine. Somebody must have hinted that we're going to be talking about some strange things tonight because we have a room full here. And I'll grant you up front. Yeah, this is going to be a little unusual. You're going to get four weeks of that because what we're going to talk about is going to be pretty foreign to the way we think in a number of ways. So the purpose of doing this is just, like it says, to help you try to think like an Israelite. This is going to be topical. So tonight we're going to talk about impurity and sin, you know, clean and unclean. And what I'm going to do is suggest to you or kind of toss out sort of where the state of best understanding is. This is a lot of strange stuff. We will have to think pretty abstractly to try to follow why in the world some of these laws and concepts are what they are in the Torah in the Old Testament. And scholars have really kind of struggled to do that. So I'm going to present sort of what, again, what the consensus is currently as to what all this stuff means and why it is what it is. Next week we'll talk about sacred space, which is going to tie in with this week. The week after that we'll get into the actual sacrificial system, which will tie into the previous two weeks. And then the last week is a bit of mop up and a bit sort of an appendix to the other three things. But if you are able to sort of grasp why, again, these concepts are what they are, they would actually help you through a lot of the Torah. Because a lot of the Torah is laws, it sacrifices its rituals, and it's just kind of bizarre stuff. It carries through all the way to when you get a temple, tabernacle or a temple. And it will trickle into the New Testament in some kind of interesting ways, again, if you can sort of understand and follow conceptually how it is they're thinking. It's going to be a little strange, it's going to be a little different. Now for tonight, when we talk about impurity and sin, we were talking about cleanness and uncleanness. We're going to start with impurity. If you've read through Torah, the first five books of the Old Testament, this is vocabulary that's going to be familiar. Don't do this because if you do that, you'll be clean or unclean in all these regulations and whatnot. There are actually two categories to an Israelite thinker. Someone who, again, would be a native experiencer of some of these things when you're living during a tabernacle period, where you're living during the time of the temples, and you're living in biblical days, there's actually two parts to this. Ritual and moral. You can become ritually unclean. Ritually has to do with what you as either a person, just an average Israelite, or a priest, what you can do in certain places and what you can't do in certain places, where you're allowed to go and not go in the camp in relation to tabernacle and temple. Ritual uncleanness is really about your participation, your eligibility or your ineligibility to do sacrificial stuff. To bring a sacrifice to get your uncleanness problem taken care of. You have to wait next number of days before you can participate in this or that festival. All of that is about ritual impurity, ritual uncleanness. Fundamentally it has nothing to do with a moral violation. There's no moral guilt. Having said that, there are a couple passages where if you do a moral transgression, lucky you, you're not put to death, but you may not be able to participate in the community. So there's a little bit of overlap, but for the most part, ritual uncleanness is about participation in the whole system, in the community life. Whether that occurs on sacred space, and by sacred space I mean space that only God is supposed to occupy for priests that are like God's substitutes. They're allowed to occupy that space or not. So again, some of these concepts we've already seen are related, sacred space, clean and unclean. Scholars will use terms like holy and common, holy and profane. Holy is that which is connected with God, His space, what He does, objects that are used in His space and common or profane is stuff that everybody can use because it doesn't matter. It's not connected with a specific piece of turf. Ritual impurity is about physical defilement that bars one from sacred space or participation. I'll mention that. Causes and examples. Now I have a quote here from Jonathan Clowns, who's sort of a specialist in ritual and he's put some really good stuff on it. I really like his material. His line here is direct or indirect contact with any one of a number of natural processes and substances. The key word here is natural. You can be rendered ritually unclean by just living normal life. It's unavoidable. Specifics. Childbirth renders of a woman ritually impure, ritually unclean. A skin or scale disease, genital discharges, whether that is ill health or something normal, doesn't matter, you are ritually impure. Carcasses of certain animals, if you touch them, you are ritually impure, unclean. Human corpses, you don't touch a corpse. Even if you have to bury your dead.  You're ritually unclean. Now we're going to talk about what's the logic to some of this stuff in a moment, but again you get the idea of how long your impure varies by whatever category it is, whatever certain status it is, and how you are cleaned and cleansing from impurity means what are the procedures you do so that after a certain period of time you can participate in the community religiously again. This has nothing to do with moral violation, offending God of the moral sense. It's about are you fit to come anywhere close to the presence, to the presence of God in their Tabernacle Temple system. Ritual impurity is natural. It's unavoidable. Hey, guess what? You're going to have babies. You're going to have general discharges. You're going to get skin diseases. Hey, if you like to eat meat, chances are you're going to touch a carcass when you should.  You've got to bury them. You just can't avoid these things. Again, there's no moral fault. The system is going to be designed to teach certain things. So it's unavoidable for humans in human circumstances. It usually doesn't arise from moral violation or sin. I mention that because if you read through Leviticus, the ritual procedure for taking care of ritual uncleanness, it'll say things like, take this bird, take this animal, do this and that, and you shall be cleansed from your sin. We have to realize that we have a translation problem. The Hebrew word for sin and sin offering, kotat, in many circumstances has nothing to do with moral violation. It actually refers to being decontaminated. And it's about doing something to the person to decontaminate them so that they don't contaminate sacred space. So many times in your Torah, when you have this sin or sin offering language, it isn't connected at all to moral violation. And I'll go one step further. We'll go ahead of ourselves because we're going to do a sacrificial system in a couple of weeks. You may not have noticed because I know we just, you know, we read all the Leviticus that we can. When can I go back to Leviticus and read that again? The blood of a sacrifice is never applied to the person who brings the sacrifice ever.  It's never applied to a person. And even when it is applied to any person, there's only two occasions for that. We'll mention that one of that was the ceremony to launch the priesthood system. They were just like, okay, well, let's like hit the reset button. Everybody's like clean, then we can get started with this new priesthood thing that God sort of just gave us here at Sinai. You have nothing to do with moral violation. We tend to read words like sin and sin offering in line with the New Testament. No, no, no, no, no. Don't do that.  It's just that you won't know what in the world is going on. You can't read the Old Testament sacrificial system through the lens of New Testament talk about the blood of Jesus. That's one of the primary problems that we have. You know, it's easy to do that because we're not Israelites. Another quote from Klonz. It is true that the refusal to purify yourself would constitute a transgression, a moral transgression. You're likely to become ritually impure and it's like, man, I don't want to do this. Yeah, it's a heart problem. If you did that, well, then you got a moral problem going on. Okay, as would coming into contact with the sacred while in a state of impurity. Let's say I know I'm impure and it's like, okay, okay God, there. I stepped where I shouldn't do something. You know, then it's a heart problem. Okay, if you're dealing with those circumstances well there, yeah, then you're going to have a moral issue. But the whole system doesn't make being ritually impure sinful in and of itself. Moral impurity on the other hand. We talked about ritual impurity now the moral side. There's this other category of moral impurity and some of these are kind of obvious.  These things we typically think of as big crimes. Those are moral violations very clearly. And there is a category of moral uncleanness that operates separate from ritual uncleanness. Sometimes they overlap just a little bit. But typically they're separate grounds. Now these are frequently described as abominations. It's not the only term that's used. But if something's an abomination, it's very clearly a moral offense. And, again, there's no sacrificial cleansing for a lot of them in the Torah. We'll get to that in a bit. So if you commit a moral offense, there are passages that talk about the person, him or herself is defiled. The land is defiled. There were these things that are tolerated. The land itself, God will look at it as though it is in a state of defilement itself, even though it's just dirt. And then God's sanctuary. This reference in Leviticus 20 is specifically about child sacrifice, molehead.  What God means is, I'm just not, I'm not even going to visit you. I'm not going to live here. My sanctuary itself is like polluted by stuff you're doing in the land, if it's this bad. I'm out of here. This land, the whole land, is no longer fit for my occupation. The land itself is defiled.  That's been made dirty by all of us. And I'm just not going to be there. So the moral defilement was pretty serious. It even extended you to these other things. Corporately, Leviticus 18 actually spends a lot of time talking about this in Leviticus 26 as well. And if there's enough of this going on, God said, I will expel you from the land. In other words, I'm not going to show up here because the whole country, the whole land is polluted. So the solution to that is to kick you out. And if you're gone long enough, then maybe I'll come back or maybe it will be fit for my occupation. So there are all sorts of warnings about not persisting in this kind of thing because you'll be expelled. Of course, when the exile happens, the prophets go and they quote passages like this and say, like, duh, didn't you people realize what was going to happen to you if you did this, that and the other thing? But here's kind of a summary. You've got ritual and moral impurity. Source, again, natural things. The effect is temporary defilement, temporary impurity. And the, I don't know if I thought that was a lie. It's contagious. Ritual impurity is the one that if I'm ritually impure, if I touch a dead body, I'm in a state of ritual impureness. If I touch you and the cooties just got passed on, you're ritually impure now. That isn't the case if I'm just wicked.  You're not rendered unclean by that. But if it's ritual impurity, you are. Again, it's a totally different kind of system. The effect of the moral is frankly worse, desecration of the person, the land, the sanctuary, the whole bit. And in the resolution, there are different rituals that involve bathing and then waiting periods. Here, Clowns lists atonement or punishment and ultimately exile. By atonement, he's referring to restitution, which we'll get to in another week. But moral defilement defiles the center land and sanctuary, not anyone with which he comes into contact. Ritual impurity is like a contagion. Moral impurity is not.  And I didn't go on away by taking a bath. Okay. There's a different set of penalties for that. That's not going away. The solution for that kind of impurity is punishment. You either are put to death or you're exiled from the community. Now the word for that in Torah is the person shall be cut off from his people. And scholars fight over, well, is that also the death penalty or is that just kicked out of the community and don't ever come back? It's probably the latter, but you'll see that have to be. Some crimes, some moral crimes involve restitution.  In a way, period. What I have to do is I do have to bring a sacrifice so I can be purged. I can be decontaminated from what I've done, but I also have to pay restitution to the person who suffered loss. Basically, we're going to overlap between the ritual and the moral there. Even in abstinence, you can cure this by just not doing that stuff, which of course is what the leadership would want. By way of summary, since moral impurity does not produce ritual defilement, sinners, in contrast to those who are ritually impure, are not excluded from the sanctuary. So if I'm a murderer, if I'm still alive, if I went on a holy ground, I didn't defile it. The problem is a ritual impurity. It's moral impurity. You actually had murderers run into the sanctuary. There were a couple of accounts in the Neal test that they didn't defile the sanctuary because the Torah said that their moral crime doesn't defile ritually. It's just a moral problem. They were trying to... They're not going to get me in here because that would be shedding of blood, of course. It didn't work out too well for some of the people who tried it, but that was the thinking. Numbers five, the so-called test for adultery, they bring the woman into the sanctuary. Well, if they assume, and some of them are thinking, well, she's probably guilty, why would they bring her into the sanctuary? Well, the answer is because that's not going to pollute the sanctuary. It's a moral problem. It's not a ritual problem. So again, this seems kind of odd to us, but they have these two categories, and they know what to plunk in each category. On those occasions where moral impurity does defile the sanctuary, like, again, some of that stuff we talked about with mull life, it's not because a sinner has brought him into the sanctuary, it's because of what happens in that mull life case with God. That's more of an issue. Now, there's a long quote here, and I want to read it to you because it's kind of interesting. Clowlands, again, he says, In the case of ritual impurity, a real physical process or event, such as somebody dying or menstruation, loss of blood or whatever, has a perceived effect. It's an impermanent contagion that affects people in certain objects within their reach. In the case of moral impurity, a real physical process or event, which is child sacrifice or adultery, has a different perceived effect. A non-contagious defilement that affects persons, the land and the sanctuary. In both cases, the impurity can be conveyed. Ritual impurity is conveyed by direct and indirect human contact. Moral impurity is conveyed to the land by sins that take place on it. And through the land, the impurity is conveyed in the sanctuary. That's why God has to leave. In both cases, moreover, there are practical legal ramifications that result from the impurity. The ritual impure person must keep away from sacred things. And in some cases, they're barred from certain precincts in sacred space. The morally impure person may be subject to capital punishment, or in the case of unwitting female partners to sexual misconduct, permanent degradation and fewer options for marriage. The innocent party wouldn't be under the death penalty, but again, in the system, there are going to be consequences to that. When the land has been defiled to a great extent, its people are exiled. So that's kind of a summary of the two categories. Now, here's what we kind of want to count. The world's the logic to all of this. Why do you have the two categories? Why in the one place, let's just take one of them. Ritual impurity. Why do some of those things, why were they considered to contaminate someone, to make them ineligible, to be near God or to occupy sacred space? What's the point? You've got bodily flows, contact with the dead, childbirth, all this. What's the point? Now, I'm going to give you, I think it's either four or five. Again, these are sort of the best attempts at consensus. There's no one approach that really explains everything in the Torah, in these two categories. Taken collectively, you can pretty much account for everything. And there are a few outliers, and scholars are typically like, well, you know, we got like 98% of this sort of explain, but there's this other thing over here, I don't know. You're still up against that. But there are some broad principles that really sort of capture the logic. All of them are going to have to do with binary opposition. In other words, they are what they are to teach a binary opposition between us and God. There's a clear differentiation. Life is associated with God, death is not. Blood, semen, skin diseases. Okay, if we take life versus death, this is a broad category. If you look at the bodily fluids that render someone unfit for sacred space, what do blood and semen have in common? They are associated with life.  So they don't have to be medical scholars to know that, hey, that red stuff that comes out of your body, you got to keep that in your body or you're going to die. So the loss of blood is sort of like moving toward death. And to teach the idea that God is associated with life, death is not associated with God. The loss of blood renders you unfit for sacred space and that is supposed to reinforce that lesson. Wholeness, having on your blood, that is associated with life and life is associated with God. So if I lose blood, then I have to do this ritual. I got to wait a certain number of days. There's no Israelite guys going around taking your blood count like with some instrument, okay? We're not talking about anything technological. It's just to reinforce an idea. If you have a demographic, you have a seminal emission at night or you have sex, okay? As a man, you have lost the life giving fluid, that thing which produces life. That makes you ritually impure for a while. Not so that somebody like the Israelite doctor can take a sperm count with his fancy medical instruments. That has nothing to do with it. The idea is that you need to realize that any loss of life, any loss of the life force cannot be associated with the presence of God because God is life. It's a simple object lesson. It sounds kind of weird to our ear, but you know, you can do that often enough, people are going to get the point. This is associated with life. Life is associated with God. If I lose the life force, then I am not fit to be on sacred space because God is there. There's a broad sort of categorization there. Skin diseases, there's a passage in Leviticus that describes skin disease as the person is, their skin is reminiscent of a corpse. Okay? And so the association, the visual association of that skin disease with the dead body is enough to make it a teaching point. You have the skin disease. It looks like you're deteriorating, deterioration, death. We can't have that on sacred space because God is not associated with deterioration and death. So we have to take care of that. Different procedures for doing that. It's Numbers 12, 12. Let her not be like a corpse. This is when Miriam gets punished with leprosy. Let her not be like a corpse. She's decaying and dying. It was made her, you know, unclean. You've got some of these other things. Another idea is imitation of God's nature. So one rationale is binary opposition of life and death. I explained some of the ideas. Number two idea is some of these laws only make sense if the person who undergoes them is sort of viewed as imitating God in some way. That sounds really weird. This one's actually kind of interesting. Sex is one of the places that scholars camp on for this idea. Why does sex make us unfit for sacred space? The answer is because it's being unlike God. Because I mean sex is bad. Oh, God made it and said, it's the multiple.  He doesn't need to reproduce. He has the beginning. He has no end. Because God has no consort. He has no wife, you know, in Israel. I'm thinking God cannot have sex. Therefore, Fremri Kenske, she's passed away now but she was a scholar of ritual studies.  Ancient Israelites and especially ancient Israelite priests and Levites separated themselves from what made them the least God-like. In other words, the point of following these regulations is nothing other than the theological underpinning of the entire holiness code, the imitation of God. So you're eligible to enter the sanctuary if you are in a God-like state. If you have sex, you're disqualified for two reasons. You've lost the life force and you're not imitating God because God doesn't need to reproduce.   He does not need to reproduce in his presence his life.  So if you want to serve as a priest you can't have sex for X number of days before your job obligations. If you do, then you can't do that because to enter sacred space and perform your duty you have to be like a divine proxy or a substitute for God's presence. You were selected in this case because you're from a certain tribe. You were selected to be a stand-in to occupy sacred space to do certain things in the presence of God. And to do that, you have to be God-like. So again, it sounds really weird to our ear. Think about how... I'm sure Dax is like, you know, man, when do we go through the rest of the list? Because it's like, do I really have to like jump through all these hoops just to have a church? Well, thankfully, no. You know, but if you're in the Israelite system there are all these ways of circumscribing your behavior, good behavior, normal behavior because by doing that, you teach people what God is like. This space over here is different from the space on God. God's presence is over here. It's not here. I'm okay over here. But to go over there you have to be in special circumstances, special condition or a special person from a specific tribe. I can't have done this, that, and the other thing.  And you do that by rendering certain places sacred, certain objects sacred. You don't touch them. You don't even go near them. And even if you're allowed to go near them, let's go down to the checklist and see if you're eligible.  Third category, some have argued, and the example again is kind of gross or weird, but it's still part of Torah, that there's an issue of controllable versus uncontrollable. Now, Collins is quoting another scholar here and the issue, believe it or not, is, well, let's start. It's precisely with this regard, at the point that the work of Albert Schwartz is important, noting the conundrum that the routine some will discharge when it gets 15, is less problematized than general to discharges of blood when it gets 15 or flux, also 15. Albert Schwartz introduces the criteria of controllability in the discussion, meaning of ritual purity. Without denying the importance of the notions of sex and death, Albert Schwartz suggests that controllability plays a role in determining which substances defile and how severely they defile. Briefly stated, he argues that the less a process or an event can be controlled, the more likely it is to defile, and he uses the example of excruity. Poop. Okay, there are actually laws about poop in the Torah, and they can't really be accounted for in the other two, the life versus death thing, so some would argue that what you excrete is the opposite of life because your body doesn't use it. So you might be able to get some of that in there, but tears and saliva, why is that okay? Because their excretion is subject to human control, these substances were not considered defiling in ancient Israel. On the other hand, menstrual blood, non-seminal genital discharge are among the most defiling substances since they are the least subject to human control. So again, when this third category is conceived, we're trying to pick up like, okay, what's the logic with tears and saliva and poop? Why is this thing that I discharged from my body? That makes me rich when I'm here, but this other one doesn't. They're trying to figure out a holistic approach to this, so third option is controllability versus uncontrollability. And here's the one we often think of, food or dietary laws. And this, you can go part of the way with some of the things we've already discussed. Let's just take the life and death thing. It's very clear that animals that eat dead animals carry in eaters. Those will render you unclean. So there's this life-death connection. You can't really get this big god-like connection of control, and it doesn't really work. And then there's some oddities, and we're not going to go through the whole list, but we've got flying animals, clean unclean insects, land animals, water animals. And there's no unifying principle that explains why everything is on either side. And so this one is kind of problematic. There's no need to park on which animals here. Traditional explanations have been, well, this is all about hygiene. Again, there are problems. There are some clear instances where, yeah, it might be about hygiene because this animal is kind of, you know, like the pigs always, the easy target here. But there are other animals that, well, they're not like pigs. And they're not unusually dirty.  So there's a bit of a disconnect there. Some say, well, the ones that are forbidden have some association with cults, like religious cults in Israel at the time that other genitals were doing. There are some clear ones for that. But then there are other ones that, well, hey, we offer that animal too, and some of the canvats, what's up with that? Why is that one clean for us since they're killing all the goats all the time? Maybe why aren't goats unclean because they do it? And it just doesn't seem to be a unifying logic to it.  Certain animals are offloads because you have to control the populations and it's good for the ecosystem. Again, there are always exceptions to every approach. And so that's why it's a problem. Now, Mary Douglas is a famous ritual scholar. If you actually do any academic reading a little bit, because she will run into her name, she's pretty important. Not everybody agrees with her, but she's still pretty important. She writes the pattern, she thinks it's about patterns of opposition, especially inclusion and exclusion. Seen in the social structures of a society, it's called that's its ritual system. It's view of the body and its classification of animals. Maybe expected to correspond to and conform one another. So she's saying we might just have these oppositions because they might derive kind of unconsciously or just unconscious is not a good word. They might just have arisen intuitively in Israelite or the ancient patriarchal culture. Because there are certain laws in the Torah that are also found in other law codes, like Hammurabi's law code in the history of sin. You're going to get laws that show up there that show up in Torah. And that's just one law code. There's hundreds of law codes. And there's overlap between the Israelite law code, the Torah, and a lot of those. And so a lot of people, and I would be in this camp, would say a lot of what goes on in Torah is that when God prompted, when he started working with the Israelites, when he prompted the writing of this and that book, there's already a culture in place. God doesn't have to like invent one or this is the Israelite culture. He just takes people where they are and then once certain laws don't have control, crime, and punishment and whatnot, maybe be more tolerant than the Hittites are or something like that, that God works with a culture already in place. And so Douglas argues that, you know, maybe these binary oppositions, this queen and the unclean, maybe it's just sort of intuitive. Maybe, again, it's not a perfect system either. I'll give you one example of that. There are a lot of people who beat on the Bible because of the Zalofa Hadid incident. Anybody know who Zalofa Hadid is? I'm going to go and start from the night. She's the woman that has to go to Moses after her husband dies and she doesn't have sons and ask if she's allowed to have her husband's property. There are no laws permitting female inheritance of land in the Torah. Why is that? Because little characters are sexist.  Again, God didn't prompt anybody to write that down. It was just part of the Israelite culture and Moses says, hey, you know you're right. We're going to let her have that land. But there wasn't a Torah law. They had to actually go to Moses for an opinion, for a ruling, because it's not part of Torah. It's just part of the wider culture. And Moses says, give her the land. But people love to beat on the Bible for stuff like that. What's the basis? Again, it may just not... Again, it may be just cultural, maybe arbitrary, but it's still intentional because no matter what the logic was that produced the clean and unclean animals, once the clean and unclean columns are filled, it still teaches the same thing.  Well, why?  We can't figure out exactly the reason why everything's on the list. Because like this other stuff that has to do with bodily fluids and going this place and that place and doing this ritual and that ritual, it teaches you that you have to live a certain way to be fit to occupy sacred space, to be part of the sacred community, which is Israel, to be part of God's family. You have to conform to what God wants because you're not like God. God is different from you. God's bigger and better than you. He gets to make these rules. He wants to see if you are willing to give up maybe eating something that you really don't like to eat, or you'd like to try. Are you willing to give that up to be part of the community? Maybe it's just that subject. Maybe there doesn't have to be an overriding logic to it. Here's another question. What about parts of clean animals? You actually have this. You have parts of clean animals that they still can't eat. What does that make any sense? Well, if you look at the parts, there are certain instances where they're not allowed to consume blood, which is pretty general. Why aren't the people allowed to consume blood? Because the life isn't a blood. Because you're assuming, you're intaking something, you're ingesting something that belongs to God in sacrifice, or should be spilled out on sacred space, which is God's, because God is the author of the life. It's just, again, it's just designed to teach an idea, to teach an association. It doesn't have to do with hygiene. It doesn't have to do with calorie count. Life belongs connected to the life of the giver. It is not for you. It's for God. So you get blood burned up on the altar. You have to be drained in sacred space. Even when they take the blood, they'll sprinkle the tabernacle or different objects. What will they do with the rest of it? What will they do with the rest of the altar? It's still on sacred space, because life belongs to God. It doesn't belong to you. It belongs to God. It's the same thing with the fat. Fat, even of clean animals, and probably because it retains a lot of blood too. You're only allowed to do certain things with it. The sciatic nerve, this is the Jacob story, nobody wrestles with the angel. It's that forbidden, probably because of the Jacob story. It's associated with divine encounter. So to remember the divine encounter, we don't need that part. It's just a simple idea. Caryon, that has to do with life and death opposition. That was pretty easy.   If you're not a priest, you pretty much forget that. Other examples, the famous or infamous kid boiled his mother's milk. Why is that? Some have proposed it's a humanitarian law. It's cruel to take a baby goat, we'll say, and kill it and then boil it in its own mother's milk. That's just evil. Some will say that it's a humanitarian law. Maybe. Some say it's associated with a cult, specific cult practice. Some people tried to tie that into some ritual text in regard. It doesn't work real well, but people try it.  So there may be something, it may have something to do with Gentile religious practices. The real answer is nobody knows for sure why it ends, but these are the approaches. Now, that's what I wanted to cover next, but this time we can take some questions, but all this is tied to sacred space.  Just to prep a few things. For next time. This is going to take us into the concept of holiness. Have you ever wondered why inanimate objects are called holy? This is why. We only use that object to do this thing at that place. Otherwise, you are not allowed to use it. And we say, well, who cares? Why is that there? Who gives it away? See, we have lost, and I'm not ranting on the way we do church, in the modern era, but if you've ever been in a really, really, really liturgical church, they still have some sense of this.  You don't go there. In fact, the church is designed with a little gate there deliberately. It's not just, hey, we watched an HGTV show, and we kind of like that feature. No, it's there so that when you see any gate, it's like, oh, I'm not supposed to go through the gate, because beyond that, that's where the priest, that's where he does his thing. It's to remind you that certain places in the sanctuary, interesting term, are off limits. Why? Because that guy thinks he's holier than I am? No, it's just to enforce the idea that we come here to do God stuff, and that's the guy who does the God stuff. Because he's a minister. He's a priest. He's a whatever. You know, whatever the type of lives. In Israel, they're just the whole nine yards doing that. You were not supposed to tread in certain places. You were not supposed to touch, much less use certain objects. We only use that cup. One day a year, or every this or that ritual, and only the priest can touch that cup. Why? Because the priest thinks he's better than I am? No. It's to reinforce the idea that in life there are sacred things and non-sacred things. God is different. You want to treat him like he is different. Where God lives should be treated like it's significant. It's not normal. Because God isn't normal. It's not common. Because God isn't common. These are simple ideas. And in the case of Torah, it's just all over the place. But since we don't grow up with temple in evangelicalism, we have maybe, we have communion, we have Christmas and Easter, so our religious calendar is abbreviated compared to a ritualistic system. I mean, it is really, you've got Sabbath, you've got stuff to do on Sabbath, you've got collections of Sabbaths, you know, cycles of Sabbaths, then you've got jubilees, then you've got cycles of jubilees, you've got this festival, that festival. Everything is in order. And some of the priests, we'll talk about this in the fourth week, not cases, but that's harsh. Some of them were just, they were willing to die for what day we hold this thing on. And there's a reason for that. It's a set of ideas that they attached to keeping the calendar. Why it was so important. We've lost pretty much all sense of that. And part of it is because of the New Testament. Where is sacred space now?  This is why, you know, I'm not saying it's a bad thing to be liturgical. You know, in some ways, I mean, when we were in Wisconsin, we went to a church that had an order of service, which I don't remember what the terminology was for, an order of service. It wasn't terribly liturgical or ritual, but they had enough of it that it made you kind of stop and think of where you were at. You know, that was kind of nice. But the reality is, it's okay not to do that because the building isn't where sacred space is unless a bunch of us are there. Because we are the temple. We are sacred space. The whole system changes. So after centuries of embodying sacred space, who are the priests now? That would be the same thing. The same answer to that. Priests are the believers, a concept in the New Testament. Every believer is a priest. Every believer is sacred space. So, theologically, these things have changed. And so it's really tough for us to look back at the Old Testament. We didn't have any of that. They had to do this so that they could draw near to the throne of grace. You don't just assume as an Israeli that you're okay to go worship God. Well, God knows my heart. God knows that I touch that carcass there today and I'm supposed to bring this. He'll let me off the hook here because I'm doing the right thing. Actually, he won't. We assume certain liberties because of Jesus. This is why the language in Hebrews mimics this, but it substitutes Jesus all the time. And it applies the rules to every believer, everywhere the believer is. It's not linked to a plot of gravity. Hebrews 9. The blood of bulls and goats cannot take away sin. Well, you look back in Leviticus and it says, if you do this, your sin is forgiven. Why? The Bible's a contradiction. In the Atheist, another dumb argument from Atheist City. No. It's actually true. All these rituals weren't about sharing moral violation. If you committed a moral offense on abomination, there's no sacrifice for you. You're either put to death or exiled from the community. So the right of Hebrews actually knows what he's talking about. The blood of bulls and goats doesn't take care of these problems. Which is the whole point that Jesus actually does take care of these problems. That's why it's better. That's why the right of Hebrews says, you're insane if you want to go back to that. You don't understand what you're talking about. Oh, I'd rather be exiled or put to death if I happen to make one of these boogers.  That's in the Greek somewhere. You're nuts. There's a point to the logic in the superior system. So anybody have any questions? We'll get into some of the tabernacle stuff and the sacrificial system that needs to come. It's just strange. It's just a totally different way of looking at things. First part of being 7-5 and talking about sex. Paul says, do not deprive one another except perhaps by agreement for a limited time that you may devote yourselves to prayer. But then come together again. Are these sort of the ideas that he is? Yeah, I mean, look at Paul. Paul is a Pharisee. I mean, obviously, he knows the law pretty well. And it's this idea that you... And he's speaking generally. It's creepy. So it's including Gentiles here, too. But it's the idea that you set this aside for a spiritual purpose.  But the logic is the same. In this case, we're not going to do X, Y, or Z so that we can focus over here.  But the idea of sort of getting that spiritual tunnel vision for a while is what you shoot. So, I kind of looked back during that time that sex is far more recreational than what they had to do as well. You know, during that time, they didn't go home and put on Netflix or something like that. And they had larger families, too, because it was just the way the culture was. So you say it's the same thing? I mean, should we then, you know, at times look to sacrifice those things that we might devote ourselves to? I think fasting, you know, like using that as an example of fasting, not just not eating, that gets added. Fast for almost everything. Yeah, yeah. Do you think, given this framework of understanding sort of the two categories, if you will, of violating sacred space or of moral and spiritual impurity, how does that apply to us as believers who are sacred space? Like, are there ways that we virtually can be unclean? Well, what's the language Paul repeat? Well, it's not just Paul, but he repeats what he uses as believers.  We're referred to as, you know, temple stones. We're referred to as temples. Consistently.  And again, this isn't aimed at anybody's eschatology. I just want you to think about it more broadly. We spend so much time thinking about the temple that it's going to be built someday in Israel. And we kind of skip the temple talk of the New Testament. The temple talk of the New Testament starts with Jesus. Okay, when Jesus says in three days I will raise this temple on him. And the very Lord. It took us all these years to build this. You're kind of a lunatic. And John says, no, he spoke of the temple with the body. Now, we can, like, think about it more. But the temple is Jesus' body. The temple is the body of Christ. We are the body of Christ. Post-resurrection. All these things loop together. They're not random statements. That doesn't mean that we're not going to have a eschatology of the temple somewhere. It's just, we're so fixated on that one. We miss New Testament temple language all over the place. Now, if we have time on the last week, there's just some crazy stuff going on like in Ezekiel 40 through 48. Everybody looks at that passage and thinks only of a building in the future. There are almost 70 references. The numbers they use in Ezekiel 40 and 48. There are almost 70 numerals there that are multiples of jubilee numbers. What's the passage Jesus quotes when he begins his ministry in Nazareth? It's Isaiah 61. Who are you in the first few verses? And then the language about healing the broken heart and all this kind of stuff. Look at where that occurs in the Torah. It's Leviticus. It's a jubilee passage. If you plot out the chronology of the life of Jesus, the year that he begins his ministry is a jubilee year. He walks into the synagogue of Nazareth in a jubilee year.  He wasn't kidding. He's like, I gotta come up with a good line. It's my first sermon. Something memorable. No, he's not kidding. Well, we just sort of fly right over. Is Jesus the eschatological temple in 70 jubilee references in Ezekiel 40 and 48? Well, he was. The temple was his body. His body was the temple. And the temple was the body of Christ. That would be us. All these things fit together. Isn't that kind of weird? No, it actually really isn't weird. I mean, it's kind of like right there hidden in plain sight. But we don't think about these things because we have a hard time thinking abstractly, both because of who we are. We're modern. We're nuts and bolts. We're scientific. We're rationalists. We're part of the Enlightenment culture. We're just not used to thinking abstractly, and I'll use the dirty word here, non-literally. Anyway, good little people work. Because we're kind of taught when we see a word, we just decide its meaning is the first thing that pops into our head literally. Well, it might be. There's a lot of that. It might hook into something that is just just way abstract. But in Israel, or in Jewelry, I know what it's talking about because this is more intuitive to that. It's not intuitive to us, but because of what we are and the way we talk to the Holy Scripture, we have these sort of roadblocks that give you a way of reading it through their eyes. It's really hard. It's hard to do. One of the best things you can do, and I want this to become Mike's Laws for Bible study here, one of the best things you can do is going to sound trivial. Look up the cross references. You know, when the printer printed your Bible, he didn't just have, like, white space in the middle. I don't know what to put there. What's this going to screw up? What do I do? I'm going to put verses in there. Just throw verses in there. I don't fill up the space. No, they're actually there for a reason.  I wonder where that is.  If you do that all the time, it's easier to connect dots. It's a habit. It's form. Patterns. How do the New Testament writers use the Old Testament? They use it all the time. They use it in some really interesting way. All that stuff's there to make use of. I don't want to buy it really well. I don't need to use those cross references. You know, not that well. You know, you don't know that well. None of us do. Anybody else? When you were talking about Sexty Five and I thought back, David went to the priest to see if he had anything his men could eat. All he had was the holy bread. He kept it from women in a certain period. He assured me they would have to wait for three days, so it must be okay. That's his link to rationalize this. But it's a good illustration. Because the priest is sort of looking for some justification for that. It's like, okay, we'll give you the bread you're not supposed to eat as long as you're mad and don't violate this other rule. So it kind of washes out the end. That's a good illustration. This might be a kind of a rather traffic. The priest is not having sex. Is that why the Catholic Church why their priests do not, you know, can't marry them enough? I'm not supposed to do that. You know, I think if you read deeply enough in Catholic thought the answer to that would probably be no because the priests weren't prevented from marrying. They were prevented in Israel. Israeli priests could marry. And you might have part of the Catholic argument sort of hook into what we're talking about tonight to make their decision of celibacy holier. But typically they're going to look at things like they're going to kind of model it after, you know, Jesus, Jesus wasn't married. Some of it's going to be a little more historically conditioned. They're going to look for some sort of contemplated model like that because the Old Testament priesthood could marry. But they, I think it's conceivable that they can say, well look this is special and you know, we're going to go, you know, the nth degree here and we're not going to marry Jesus isn't married. Look at the priest here. This made them even more sanctified in certain times. So I think you'd probably run into it but I don't think it's the major argument. Maybe Paul or he said something like, except that first Paul had a mother and lots of that. It does mess it up but they'll deny that too. Paul's status is a little ambiguous.  Paul may have been divorced. He may have been deserted by his wife. We just don't really know. When he's talking about being unmarried which is, write this down, the state of being his spouse then he gets into that. I wish that Paul never like I was. Then he goes into some pragmatic reasons for it. The unmarried term there occurs only four times in the New Testament. They're all in their chapter. It's 1 Corinthians 7. So the real issue, this gets into the divorce of marriage too. If Agametto, the state of being spouseless, here's the key question for that passage as it relates to divorce and remarriage and ostensibly here, peripherally that this question. On what exegetical basis do we exclude divorce from the list of conditions that make you spouseless? In other words, is divorce included in 1 Corinthians 7's references to being unmarried? Because there isn't. Depending on what you think there you're going to take later statements like Paul's in a certain way. You're going to take right around verse 27 or so when Paul says if you're loose from a wife you know, don't seem to be bad if you're bad don't seem to be loose. Nevertheless, hey you know that's basically it's if you marry you don't sin. So when he says if you marry you don't sin is he talking with divorced people too because he's talking about people who are loosed. You know, the ultimate answer is well who really knows for sure and the answer to that is nobody. I suppose it would be death as well. Right, death would count it. I mean how many ways can you be spouseless? Desertion, divorce, death. It's not the state of being an unmarried virgin because there's a separate word in the passage for that but you know that we could conceivably be part of the bigger list. How do we know what Paul was thinking of and not thinking of? Or is he thinking of the whole list or just a copy? We just don't know. That's why it's tough. And if current things was written before Matthew was written it's even more complicated because then Paul doesn't have Jesus and it's seven. I don't know what you do with that. What do you do with that? What Paul has done with it? That's argument. That's pretty much where we're at. Who knows? But anyway, we'll keep it up for you over so thanks for coming. See you next week. We'll talk about sacred space.