How should we teach a new language to folks that already know how to program?
How do we use what we already know to leapfrog the learning process?
Based on my personal experience and snippets of natural language theory, we will try to explore the cheats and pitfalls when learning a new programming language, but also dig into how we can make it easier.
Secure Programming Practices in C++ (NDC Security 2018)Patricia Aas
This talk is for programmers wishing to feel more comfortable navigating the C++ landscape. We will explore the programming culture that has developed around the C++ language. Specifically, we will look at programming patterns that navigate around or through some of the dangerous parts of the C++ language. The goal is to build a set of programming practices based in the “smaller and cleaner language” inside C++. And by doing so, we will also build an awareness around code constructs that can potentially “blows your whole leg off”.
Undefined Behavior and Compiler Optimizations can result in programs that display surprising behavior. In this presentation we look at some examples, and I hope to convince you that you should not reason about Undefined Behavior and that you should take care and use your tools.
The document discusses various programming language concepts and how they are implemented in C# compared to other languages like C++. It provides code examples of concepts like namespaces, operator overloading, optional arguments, structs, properties, and delegates in C# and compares them to their implementation in C++ or other languages. It emphasizes finding the similarities between languages but also pointing out differences or potential "false friends" where the implementation or semantics have drifted from the original.
Software Vulnerabilities in C and C++ (CppCon 2018)Patricia Aas
What does a vulnerability using signed integer overflow look like? Or a stack buffer overflow? How does code like this look and how can we change the way we program to reduce our risk? The first half of this talk will show examples of many different vulnerabilities and describe how these are combined to make the first steps of an exploit. Then we will discuss what kind of programming practices we can employ to reduce the chances of these kinds of bugs creeping into our code.
Secure Programming Practices in C++ (NDC Oslo 2018)Patricia Aas
Bjarne Stroustrup, the creator of C++, once said : “C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off.” He has also said : “Within C++, there is a much smaller and cleaner language struggling to get out.” Both are true.
This talk is for programmers wishing to feel more comfortable navigating the C++ landscape. Motivated by going through well known vulnerability patterns that have been used in exploits for decades, we will explore the programming culture that has developed around the C++ language. Specifically, we will look at programming patterns that navigate around or through some of the dangerous parts of the C++ language. The goal is to build a set of programming practices based in the “smaller and cleaner language” inside C++. And by doing so, we will also build an awareness around code constructs that can potentially “blow your whole leg off”.
The Anatomy of an Exploit (NDC TechTown 2019)Patricia Aas
This document provides an overview of an exploit development process. It begins by discussing how exploits program the "weird machine" of vulnerable programs through memory manipulation. It then walks through developing a stack buffer overflow exploit against a vulnerable C program. Various compiler protections like stack canaries and ASLR are bypassed. The document generates a pattern to find the offset and writes an exploit program to automate writing an exploit string to trigger the vulnerability and redirect execution.
Security vulnerabilities and secure coding is often talked about in the abstract by programmers, but rarely understood. In this talk we will walk through a simple exploit, how it’s developed and how it’s used. The goal is to try to get a feeling for the point of view of an "attacker", and to slowly start looking at exploitation as another programming tool. We will mainly be looking at C and x86_64 assembly, so bring snacks.
C++ for Java Developers (JavaZone 2017)Patricia Aas
The document is a presentation on C++ for Java developers. It introduces C++ concepts like classes, references, pointers, memory management and standard libraries. It emphasizes using modern C++ features like the stack instead of heap for memory, values instead of pointers, and standard libraries. It summarizes that developers should use modern C++ practices like values, references, const, and libraries, but most importantly not use raw pointers like "Banana * b = new Banana();".
Secure Programming Practices in C++ (NDC Security 2018)Patricia Aas
This talk is for programmers wishing to feel more comfortable navigating the C++ landscape. We will explore the programming culture that has developed around the C++ language. Specifically, we will look at programming patterns that navigate around or through some of the dangerous parts of the C++ language. The goal is to build a set of programming practices based in the “smaller and cleaner language” inside C++. And by doing so, we will also build an awareness around code constructs that can potentially “blows your whole leg off”.
Undefined Behavior and Compiler Optimizations can result in programs that display surprising behavior. In this presentation we look at some examples, and I hope to convince you that you should not reason about Undefined Behavior and that you should take care and use your tools.
The document discusses various programming language concepts and how they are implemented in C# compared to other languages like C++. It provides code examples of concepts like namespaces, operator overloading, optional arguments, structs, properties, and delegates in C# and compares them to their implementation in C++ or other languages. It emphasizes finding the similarities between languages but also pointing out differences or potential "false friends" where the implementation or semantics have drifted from the original.
Software Vulnerabilities in C and C++ (CppCon 2018)Patricia Aas
What does a vulnerability using signed integer overflow look like? Or a stack buffer overflow? How does code like this look and how can we change the way we program to reduce our risk? The first half of this talk will show examples of many different vulnerabilities and describe how these are combined to make the first steps of an exploit. Then we will discuss what kind of programming practices we can employ to reduce the chances of these kinds of bugs creeping into our code.
Secure Programming Practices in C++ (NDC Oslo 2018)Patricia Aas
Bjarne Stroustrup, the creator of C++, once said : “C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off.” He has also said : “Within C++, there is a much smaller and cleaner language struggling to get out.” Both are true.
This talk is for programmers wishing to feel more comfortable navigating the C++ landscape. Motivated by going through well known vulnerability patterns that have been used in exploits for decades, we will explore the programming culture that has developed around the C++ language. Specifically, we will look at programming patterns that navigate around or through some of the dangerous parts of the C++ language. The goal is to build a set of programming practices based in the “smaller and cleaner language” inside C++. And by doing so, we will also build an awareness around code constructs that can potentially “blow your whole leg off”.
The Anatomy of an Exploit (NDC TechTown 2019)Patricia Aas
This document provides an overview of an exploit development process. It begins by discussing how exploits program the "weird machine" of vulnerable programs through memory manipulation. It then walks through developing a stack buffer overflow exploit against a vulnerable C program. Various compiler protections like stack canaries and ASLR are bypassed. The document generates a pattern to find the offset and writes an exploit program to automate writing an exploit string to trigger the vulnerability and redirect execution.
Security vulnerabilities and secure coding is often talked about in the abstract by programmers, but rarely understood. In this talk we will walk through a simple exploit, how it’s developed and how it’s used. The goal is to try to get a feeling for the point of view of an "attacker", and to slowly start looking at exploitation as another programming tool. We will mainly be looking at C and x86_64 assembly, so bring snacks.
C++ for Java Developers (JavaZone 2017)Patricia Aas
The document is a presentation on C++ for Java developers. It introduces C++ concepts like classes, references, pointers, memory management and standard libraries. It emphasizes using modern C++ features like the stack instead of heap for memory, values instead of pointers, and standard libraries. It summarizes that developers should use modern C++ practices like values, references, const, and libraries, but most importantly not use raw pointers like "Banana * b = new Banana();".
C++ for Java Developers (JavaZone Academy 2018)Patricia Aas
Introduction to Modern C++ for programmers with a Java background. Maps key C++ concepts to Java concepts and dives into how C++ programmers deal with and think about memory. This intersection is interesting whether you are learning or teaching C++.
Isolating GPU Access in its Own ProcessPatricia Aas
Chromium's process architecture has graphics access restricted to a separate GPU-process. There are several reasons why this could make sense, three common ones are: Security, Robustness and Dependency Separation.
GPU access restricted to a single process requires an efficient framework for communication over IPC from the other processes, and most likely a framework for composition of surfaces. This talk describes both the possible motivations for this kind of architecture and Chromium's solution for the IPC framework. We will demonstrate how a multi-process program can compose into a single window on Linux.
Security vulnerabilities and secure coding is often talked about in the abstract by programmers, but rarely understood. In this talk we will walk through simple exploit attempts, and finally a simple stack buffer overflow exploit, how it’s developed and how it’s used. The goal is to try to get a feeling for the point of view of an "attacker", and to slowly start looking at exploitation as just another programming practice. We will mainly be looking at C and x86_64 assembly, so bring snacks.
Reading Other Peoples Code (NDC Copenhagen 2019)Patricia Aas
Someone else's code. Even worse, thousands of lines, maybe hundreds of files of other peoples code. Is there a way to methodically read and understand other peoples work, build their mental models?
In this talk I will go through techniques I have developed throughout 18 years of programming. Hopefully, you will walk away with a plan on how to approach a new code base. But even more, I hope you walk away with a feeling of curiosity, wanting to get to know your fellow programmers through their code.
C++ for Java Developers (SwedenCpp Meetup 2017)Patricia Aas
The document provides an overview of key differences between Java and C++ for Java developers learning C++. It covers topics like includes and namespaces for importing code, value types versus references, parameter passing, const, classes and structs, static, containers and standard library types. Code examples are provided to illustrate concepts like object creation, references, pointers, lambda expressions, memory management using smart pointers, and using standard containers and algorithms.
Reading Other Peoples Code (NDC London 2019)Patricia Aas
Someone else's code. Even worse, thousands of lines, maybe hundreds of files of other peoples code. Is there a way to methodically read and understand other peoples work, build their mental models?
In this talk I will go through techniques I have developed throughout 18 years of programming. Hopefully you will walk away with a plan on how to approach a new code base. But even more I hope you walk away with a feeling of curiosity, wanting to get to know your fellow programmers through their code.
Handling inline assembly in Clang and LLVMMin-Yih Hsu
The document discusses how inline assembly is processed in Clang and LLVM. It outlines the target-specific logic involved at each stage, including operand constraint validation in Clang, lowering operands to LLVM IR, and printing different operand types in the assembler. Target-specific callbacks for inline assembly handling are scattered throughout Clang and LLVM. The goals are to learn the inline assembly workflow and provide documentation for backend developers to add support.
Embed perl allows a C program to use Perl code and features by adding a Perl interpreter to the C program. It allows calling Perl subroutines from C, evaluating Perl statements, and performing Perl regular expressions. Using embed perl provides access to CPAN modules and Perl's powerful regex engine without needing PCRE. The basic steps are to initialize an interpreter, parse Perl code, run the code, and destruct the interpreter. Output can be captured by overriding Perl's filehandle layers to write to C variables instead of files. Embed perl is not difficult and provides a way to leverage Perl in C and C++ programs.
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策kwatch
The document discusses issues with the Test::More module for testing in Perl and proposes solutions. It notes that Test::More does not encourage writing tests based on specifications, does not structure tests well, and makes it hard to distinguish assertions. It recommends writing tests according to specifications rather than code, using structures like contexts and descriptions to organize tests, and printing output lines on a per-specification rather than per-assertion basis to improve readability. It also proposes functions like spec() and subtest() to help write more specification-based tests with Test::More.
This document discusses Java bytecode fundamentals including:
- Bytecode is composed of one-byte instructions with ~200 opcodes in use
- The javap tool can be used to disassemble classes and view bytecode
- The Java Virtual Machine is stack-based and each thread has a stack frame containing an operand stack and local variables
- Bytecode instructions manipulate the stack and local variables to implement method calls and object initialization
ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...Istanbul Tech Talks
Eric presents ProGuard - the open-source optimizer and obfuscator that is integrated in the Android SDK. ProGuard reduces the size of applications, improves their performance, and makes them more difficult to reverse-engineer. Eric presents some typical results on what to expect from ProGuard, discuss the latest developments and provide some background that should help mobile developers get the best out of ProGuard.
The document contains multiple choice questions about PHP. It tests knowledge of concepts like sessions, arrays, streams, static methods, and security best practices. Key topics covered include the Observer pattern, auto-incrementing keys, extracting arrays, sorting arrays by value, stream metadata, blocking streams, and array intersection.
Exploit Research and Development Megaprimer: Win32 EgghunterAjin Abraham
Exploit Research and Development Megaprimer
http://opensecurity.in/exploit-research-and-development-megaprimer/
http://www.youtube.com/playlist?list=PLX3EwmWe0cS_5oy86fnqFRfHpxJHjtuyf
DEF CON 23 - COLIN O'FLYNN - dont whisper my chipsFelipe Prado
This document summarizes a presentation given by Colin O'Flynn at DEFCON 2015 about physical layer attacks. The objective of the presentation was to teach about various physical layer attacks and show that the tools used are open source and freely available. Many of the hardware tools are commercially available but can also be homemade. The presentation covered topics like side-channel analysis, fault injection, and cryptography attacks on embedded devices and discussed tools like the ChipWhisperer for performing analyses. Code and documentation for the tools are available on the listed websites.
The Anatomy of an Exploit (NDC TechTown 2019))Patricia Aas
Security vulnerabilities and secure coding is often talked about in the abstract by programmers, but rarely understood. In this talk we will walk through simple exploit attempts, and finally a simple stack buffer overflow exploit, how it’s developed and how it’s used.
The goal is to try to get a feeling for the point of view of an "attacker", and to slowly start looking at exploitation as just another programming practice. We will mainly be looking at C and x86_64 assembly, so bring snacks.
The document discusses debugging techniques for finding and removing logical errors from programs. It describes common debugging techniques like print statements, core dump analysis, and execution monitoring. It then demonstrates how to use a debugger called DDD with a sample C program, including how to set breakpoints and conditional breakpoints to pause execution under certain conditions. The document stresses that prevention through writing clear, simple code is better than debugging, and provides some tips to aim for simplicity.
The document discusses Java bytecode and how it compares to other compiled languages. It notes that Java bytecode is stack-based rather than register-based, which makes it easy to interpret but less performant. It provides examples of simple Java code and the resulting bytecode. It also discusses how just-in-time (JIT) compilers and ahead-of-time (AOT) compilers like Jack can optimize bytecode to produce more efficient machine code. Finally, it touches on language features like autoboxing that add overhead at the bytecode level.
The bytecode hocus pocus - JavaOne 2016Raimon Ràfols
The document discusses Java bytecode and how it is generated from Java source code. It notes that javac, the Java compiler, produces bytecode that is stack-based and architecture neutral, whereas other compilers like GCC can optimize for specific platforms. This leads to bytecode that is easy to interpret but less optimized than code from other compilers. It provides examples of simple Java code and the resulting bytecode. It also discusses how just-in-time (JIT) compilers and tools like Jack can optimize bytecode further for the target platform.
The document describes how JBoss Drools can be used to model business rules and requirements by defining rules using a domain-specific language that can validate objects like orders against the defined rules. Drools provides features like declarative rule patterns, object mapping, functions, queries, and templates to define complex validation logic in a more readable way compared to implementing the same logic in Java. Drools also supports defining metadata, classes and integrating with a rules engine and working memory to efficiently execute rules on facts.
Building Maintainable Applications in ApexJeffrey Kemp
The document is the agenda for a talk on building maintainable applications in Apex. It discusses maintainable PL/SQL and using an MVC architecture. It also provides examples of unclear and clear code and emphasizes consistency, readability, and writing code that future maintainers will appreciate. The document includes controversial statements, quotes, and code examples to illustrate techniques for writing maintainable code.
This document discusses techniques for refactoring Ruby code to follow object-oriented principles and design patterns. It provides examples of refactoring a Bhaskara equation solver class to have better encapsulation, organization and separation of concerns. It also discusses ways to make objects more collection-like and use delegation, modules and other techniques to improve code design. The overall goal is to help Ruby developers write more maintainable, understandable and "enterprise-ready" code.
The document summarizes new features in C# 4.0 including optional and named parameters, dynamic typing, tuples, complex numbers, parallel programming, and thread-safe data structures. It also mentions code contracts, memory-mapped files, and the Managed Extensibility Framework.
C++ for Java Developers (JavaZone Academy 2018)Patricia Aas
Introduction to Modern C++ for programmers with a Java background. Maps key C++ concepts to Java concepts and dives into how C++ programmers deal with and think about memory. This intersection is interesting whether you are learning or teaching C++.
Isolating GPU Access in its Own ProcessPatricia Aas
Chromium's process architecture has graphics access restricted to a separate GPU-process. There are several reasons why this could make sense, three common ones are: Security, Robustness and Dependency Separation.
GPU access restricted to a single process requires an efficient framework for communication over IPC from the other processes, and most likely a framework for composition of surfaces. This talk describes both the possible motivations for this kind of architecture and Chromium's solution for the IPC framework. We will demonstrate how a multi-process program can compose into a single window on Linux.
Security vulnerabilities and secure coding is often talked about in the abstract by programmers, but rarely understood. In this talk we will walk through simple exploit attempts, and finally a simple stack buffer overflow exploit, how it’s developed and how it’s used. The goal is to try to get a feeling for the point of view of an "attacker", and to slowly start looking at exploitation as just another programming practice. We will mainly be looking at C and x86_64 assembly, so bring snacks.
Reading Other Peoples Code (NDC Copenhagen 2019)Patricia Aas
Someone else's code. Even worse, thousands of lines, maybe hundreds of files of other peoples code. Is there a way to methodically read and understand other peoples work, build their mental models?
In this talk I will go through techniques I have developed throughout 18 years of programming. Hopefully, you will walk away with a plan on how to approach a new code base. But even more, I hope you walk away with a feeling of curiosity, wanting to get to know your fellow programmers through their code.
C++ for Java Developers (SwedenCpp Meetup 2017)Patricia Aas
The document provides an overview of key differences between Java and C++ for Java developers learning C++. It covers topics like includes and namespaces for importing code, value types versus references, parameter passing, const, classes and structs, static, containers and standard library types. Code examples are provided to illustrate concepts like object creation, references, pointers, lambda expressions, memory management using smart pointers, and using standard containers and algorithms.
Reading Other Peoples Code (NDC London 2019)Patricia Aas
Someone else's code. Even worse, thousands of lines, maybe hundreds of files of other peoples code. Is there a way to methodically read and understand other peoples work, build their mental models?
In this talk I will go through techniques I have developed throughout 18 years of programming. Hopefully you will walk away with a plan on how to approach a new code base. But even more I hope you walk away with a feeling of curiosity, wanting to get to know your fellow programmers through their code.
Handling inline assembly in Clang and LLVMMin-Yih Hsu
The document discusses how inline assembly is processed in Clang and LLVM. It outlines the target-specific logic involved at each stage, including operand constraint validation in Clang, lowering operands to LLVM IR, and printing different operand types in the assembler. Target-specific callbacks for inline assembly handling are scattered throughout Clang and LLVM. The goals are to learn the inline assembly workflow and provide documentation for backend developers to add support.
Embed perl allows a C program to use Perl code and features by adding a Perl interpreter to the C program. It allows calling Perl subroutines from C, evaluating Perl statements, and performing Perl regular expressions. Using embed perl provides access to CPAN modules and Perl's powerful regex engine without needing PCRE. The basic steps are to initialize an interpreter, parse Perl code, run the code, and destruct the interpreter. Output can be captured by overriding Perl's filehandle layers to write to C variables instead of files. Embed perl is not difficult and provides a way to leverage Perl in C and C++ programs.
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策kwatch
The document discusses issues with the Test::More module for testing in Perl and proposes solutions. It notes that Test::More does not encourage writing tests based on specifications, does not structure tests well, and makes it hard to distinguish assertions. It recommends writing tests according to specifications rather than code, using structures like contexts and descriptions to organize tests, and printing output lines on a per-specification rather than per-assertion basis to improve readability. It also proposes functions like spec() and subtest() to help write more specification-based tests with Test::More.
This document discusses Java bytecode fundamentals including:
- Bytecode is composed of one-byte instructions with ~200 opcodes in use
- The javap tool can be used to disassemble classes and view bytecode
- The Java Virtual Machine is stack-based and each thread has a stack frame containing an operand stack and local variables
- Bytecode instructions manipulate the stack and local variables to implement method calls and object initialization
ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...Istanbul Tech Talks
Eric presents ProGuard - the open-source optimizer and obfuscator that is integrated in the Android SDK. ProGuard reduces the size of applications, improves their performance, and makes them more difficult to reverse-engineer. Eric presents some typical results on what to expect from ProGuard, discuss the latest developments and provide some background that should help mobile developers get the best out of ProGuard.
The document contains multiple choice questions about PHP. It tests knowledge of concepts like sessions, arrays, streams, static methods, and security best practices. Key topics covered include the Observer pattern, auto-incrementing keys, extracting arrays, sorting arrays by value, stream metadata, blocking streams, and array intersection.
Exploit Research and Development Megaprimer: Win32 EgghunterAjin Abraham
Exploit Research and Development Megaprimer
http://opensecurity.in/exploit-research-and-development-megaprimer/
http://www.youtube.com/playlist?list=PLX3EwmWe0cS_5oy86fnqFRfHpxJHjtuyf
DEF CON 23 - COLIN O'FLYNN - dont whisper my chipsFelipe Prado
This document summarizes a presentation given by Colin O'Flynn at DEFCON 2015 about physical layer attacks. The objective of the presentation was to teach about various physical layer attacks and show that the tools used are open source and freely available. Many of the hardware tools are commercially available but can also be homemade. The presentation covered topics like side-channel analysis, fault injection, and cryptography attacks on embedded devices and discussed tools like the ChipWhisperer for performing analyses. Code and documentation for the tools are available on the listed websites.
The Anatomy of an Exploit (NDC TechTown 2019))Patricia Aas
Security vulnerabilities and secure coding is often talked about in the abstract by programmers, but rarely understood. In this talk we will walk through simple exploit attempts, and finally a simple stack buffer overflow exploit, how it’s developed and how it’s used.
The goal is to try to get a feeling for the point of view of an "attacker", and to slowly start looking at exploitation as just another programming practice. We will mainly be looking at C and x86_64 assembly, so bring snacks.
The document discusses debugging techniques for finding and removing logical errors from programs. It describes common debugging techniques like print statements, core dump analysis, and execution monitoring. It then demonstrates how to use a debugger called DDD with a sample C program, including how to set breakpoints and conditional breakpoints to pause execution under certain conditions. The document stresses that prevention through writing clear, simple code is better than debugging, and provides some tips to aim for simplicity.
The document discusses Java bytecode and how it compares to other compiled languages. It notes that Java bytecode is stack-based rather than register-based, which makes it easy to interpret but less performant. It provides examples of simple Java code and the resulting bytecode. It also discusses how just-in-time (JIT) compilers and ahead-of-time (AOT) compilers like Jack can optimize bytecode to produce more efficient machine code. Finally, it touches on language features like autoboxing that add overhead at the bytecode level.
The bytecode hocus pocus - JavaOne 2016Raimon Ràfols
The document discusses Java bytecode and how it is generated from Java source code. It notes that javac, the Java compiler, produces bytecode that is stack-based and architecture neutral, whereas other compilers like GCC can optimize for specific platforms. This leads to bytecode that is easy to interpret but less optimized than code from other compilers. It provides examples of simple Java code and the resulting bytecode. It also discusses how just-in-time (JIT) compilers and tools like Jack can optimize bytecode further for the target platform.
The document describes how JBoss Drools can be used to model business rules and requirements by defining rules using a domain-specific language that can validate objects like orders against the defined rules. Drools provides features like declarative rule patterns, object mapping, functions, queries, and templates to define complex validation logic in a more readable way compared to implementing the same logic in Java. Drools also supports defining metadata, classes and integrating with a rules engine and working memory to efficiently execute rules on facts.
Building Maintainable Applications in ApexJeffrey Kemp
The document is the agenda for a talk on building maintainable applications in Apex. It discusses maintainable PL/SQL and using an MVC architecture. It also provides examples of unclear and clear code and emphasizes consistency, readability, and writing code that future maintainers will appreciate. The document includes controversial statements, quotes, and code examples to illustrate techniques for writing maintainable code.
This document discusses techniques for refactoring Ruby code to follow object-oriented principles and design patterns. It provides examples of refactoring a Bhaskara equation solver class to have better encapsulation, organization and separation of concerns. It also discusses ways to make objects more collection-like and use delegation, modules and other techniques to improve code design. The overall goal is to help Ruby developers write more maintainable, understandable and "enterprise-ready" code.
The document summarizes new features in C# 4.0 including optional and named parameters, dynamic typing, tuples, complex numbers, parallel programming, and thread-safe data structures. It also mentions code contracts, memory-mapped files, and the Managed Extensibility Framework.
The document discusses various concepts related to arrays in C programming language including initializing arrays, accessing array elements using subscripts, storage of arrays in memory, bounds checking for arrays, and different sorting algorithms like selection sort, bubble sort, and quick sort that can be applied to arrays. It provides code examples and explanations for initializing, accessing, and sorting integer arrays.
Applying Compiler Techniques to Iterate At Blazing SpeedPascal-Louis Perez
In this session, we will present real life applications of compiler techniques helping kaChing achieve ultra confidence and power its incredible 5 minutes commit-to-production cycle [1]. We'll talk about idempotency analysis [2], dependency detection, on the fly optimisations, automatic memoization [3], type unification [4] and more! This talk is not suitable for the faint-hearted... If you want to dive deep, learn about advanced JVM topics, devoure bytecode and see first hand applications of theoretical computer science, join us.
[1] http://eng.kaching.com/2010/05/deployment-infrastructure-for.html
[2] http://en.wikipedia.org/wiki/Idempotence
[3] http://en.wikipedia.org/wiki/Memoization
[4] http://eng.kaching.com/2009/10/unifying-type-parameters-in-java.html
This document provides information on arrays in C programming. It defines an array as a collection of data storage locations with the same name and data type. It discusses array declaration, initialization, accessing elements using indexes, insertion and deletion of elements, and multi-dimensional arrays. Code examples are provided to demonstrate printing the contents of 1D, 2D and 3D arrays. The document also lists some reference books for learning C programming.
The document discusses various topics related to arrays in C programming language. It begins by defining an array as a collection of data storage locations of the same type and name. It then discusses declaring, initializing and accessing elements of single and multi-dimensional arrays using indices. The document also demonstrates inserting elements into an array, deleting elements from an array, and printing the elements of an array.
NetPonto - The Future Of C# - NetConf EditionPaulo Morgado
The document discusses various new features in C# and .NET, including:
- Async Main method allowing async entry points
- Inferred tuple element names for cleaner tuple syntax
- Default literal expressions avoiding unnecessary casts
- Non-trailing named arguments for more flexible calling syntax
- Pattern matching and switch expressions for more control flows
- Reference semantics for value types for improved performance
- And more proposals still in development like nullable reference types, ranges, and patterns.
It also provides links to documentation and code repositories for further reading.
This document discusses advanced Java debugging using bytecode. It explains that bytecode is the low-level representation of Java programs that is executed by the Java Virtual Machine (JVM). It shows examples of decompiling Java source code to bytecode instructions and evaluating bytecode on a stack. Various bytecode visualization and debugging tools are demonstrated. Key topics like object-oriented aspects of bytecode and the ".class" file format are also covered at a high-level.
The document discusses the Qooxdoo JavaScript framework. It introduces Qooxdoo and how it makes JavaScript programming fun again by allowing developers to write applications that run in browsers. It covers key Qooxdoo features like class definitions, inheritance, static and instance members, mixins, and more. The document includes code examples to demonstrate JavaScript concepts like scoping, closures, and working with 'this'.
This document discusses proven JavaScript best practices for writing better code. It covers topics like always using var to declare variables, avoiding eval(), using object literals instead of the Object constructor, preferring === over ==, ending statements with semicolons, and turning on strict mode. Each topic is demonstrated with examples of bad code and how to fix it. The document aims to help programmers structure their code properly and avoid common pitfalls in JavaScript.
Perl provides many powerful features and modules that allow developers to customize and extend the language. Some popular modules include Moose for object-oriented programming, TryCatch for exception handling inspired by Perl 6, and P5.10 features that backport Perl 6 functionality. While useful, some features like autoboxing and state variables could introduce subtle bugs if misused. Overall, Perl's extensibility makes it a very flexible language that can be adapted to many different use cases.
Perl6 is a powerful programming language that incorporates many programming paradigms including functional, object oriented, reactive, and event based programming. It aims to provide programmers with a toolbox of features to build applications in many different styles. The language includes features like junctions, promises, channels, supplies, sets, roles, and strong support for Unicode. It also allows calling external native libraries and has built-in support for rational numbers, sequences, and lazy evaluation. Perl6 code examples are provided to demonstrate various features like List utilities, junctions, promises, channels/supplies, roles, and native calls. Further reading resources are also referenced.
Perl6 is a powerful programming language that incorporates many programming paradigms including functional, object-oriented, and reactive programming. It has built-in support for concepts like promises to handle asynchronous code, channels for communicating between asynchronous processes, and sets/bags for storing unique values. The language also has features for rational numbers, lazy evaluation, roles for composition, and easy integration with native libraries. Perl6 aims to provide programmers a flexible toolbox to build applications in many different styles.
Every software developer enjoys finding new and clever ways to solve problems. Writing code using his/her wits, intelligent and creativity. However, sometimes being too clever can lead to hard to track bugs, maintainability issues and impossible to understand code. Is all cleverly written code good code, or is it a problem just waiting to happen? In this session, I will show you real world examples of cleverly written code. And show you how we can use clean code principles, refactoring and design patterns, to transform that code from clever code to good code – one that your peers and future self would thank you for writing.
With a new release of Java every six-months, we are getting new features at a faster rate than ever before. In this session, we'll review all the main additions from JDK 9 to JDK 14.
This document discusses Java bytecodes and provides examples of evaluating expressions and decompiling Java bytecode. It begins with an introduction to Java bytecodes and shows the bytecode generated from a Java source code example. Stack-based evaluation of an expression using bytecode operations is demonstrated. The document also shows using javap to disassemble a Java class file and decompiling bytecode back into Java source code.
This document discusses ES6 features and best practices for using them. It covers new features like let and const, arrow functions, classes, modules, destructuring, default parameters, and promises. It emphasizes keeping code simple, using context appropriately, and favoring powerful yet simple features. Tools like Babel, Gulp and Karma are recommended for compiling, building workflows and testing ES6 code.
"How was it to switch from beautiful Perl to horrible JavaScript", Viktor Tur...Fwdays
The document provides biographical information about Viktor Turskyi, including his professional experience as a non-executive director, founder, senior software engineer, and open source developer with over 20 years of experience in IT. It also lists some of his conference talks and delivered projects. The remaining slides provide examples and explanations of JavaScript and Perl concepts like data types, operators, functions, objects and arrays.
The document discusses various Ruby concepts including object-oriented programming (OOP), metaprogramming, blocks, iterators, mixins, duck typing, classes, modules, inheritance, include/extend, yield, enumerable, comparable, symbol to proc, transactions, and file handling. It provides code examples to illustrate these concepts.
Similar to Thoughts On Learning A New Programming Language (20)
NDC TechTown 2023_ Return Oriented Programming an introduction.pdfPatricia Aas
Return Oriented Programming (ROP) is an exploitation technique that folks have often heard of, but don't know the mechanics of. In this talk you will learn how it works, and we will go through some examples to show how it can be used to execute code in contexts where the stack is not executable.
Return Oriented Programming, an introductionPatricia Aas
Return Oriented Programming (ROP) is an exploitation technique that folks have often heard of, but don't know the mechanics of.
In this talk you will learn how it works, and we will go through how it can be used to execute code in contexts where the stack is not executable.
I can't work like this (KDE Academy Keynote 2021)Patricia Aas
Making software products can be fraught with conflicts, where people in different roles may feel sabotaged by others. In this talk I present a model for thinking about the problems we solve and how we solve them, and using that I hope to convince you that team excellence comes from our differences, rather than in spite of them. Hopefully you'll walk away with a deeper understanding of that colleague that never writes tests, or the one that constantly complains that all you do is "make bugs".
Dependency Management in C++ (NDC TechTown 2021)Patricia Aas
C++ has been slow to settle on standardized tools for building and dependency management. In recent years CMake has emerged as the de facto standard for builds, but dependency management still has no clear winner. In this talk I will look into what dependency management might look like in modern C++ projects and how that relates to security.
Introduction to Memory Exploitation (Meeting C++ 2021)Patricia Aas
Stack based exploitation has gotten all the fame, but many platform and compiler mitigations have made it very hard to exploit stack vulnerabilities. Heap based exploits are still very relevant, and since this is black magic for most developers I will here give an introduction to the field.
We keep on thinking we are living in the future, but native exploitation has a rich history, and many times the vulnerabilities and exploitation techniques are decades old. We'll look at some of these, how they have surfaced in recent years and how prepared we are today, armed with modern tooling, to find and fix "classic" vulnerabilities.
We keep on thinking we are living in the future, but native exploitation has a rich history, and many times the vulnerabilities and exploitation techniques are decades old.
We'll look at some of these, how they have surfaced in recent years and how prepared we are today, armed with modern tooling, to find and fix "classic" vulnerabilities.
Introduction to Memory Exploitation (CppEurope 2021)Patricia Aas
Stack based exploitation has gotten all the fame, but many platform and compiler mitigations have made it very hard to exploit stack vulnerabilities. Heap based exploits are still very relevant, and since this is black magic for most developers I will here give an introduction to the field.
Trying to build an Open Source browser in 2020Patricia Aas
A lot of things have been developed over the last 15 years that should make the process of making a browser easier. In this talk we will explore a bunch of different tools, platforms and libraries that could go into making a browser in 2020.
We will also see a live demo of a simple browser built with these OSS projects. We will also discuss the limitations and future work needed to make this work in practice.
Trying to build an Open Source browser in 2020Patricia Aas
A lot of things have been developed over the last 15 years that should make the process of making a browser easier. In this talk we will explore a bunch of different tools, platforms and libraries that could go into making a browser in 2020.
We will also see a live demo of a simple browser built with these OSS projects. We will also discuss the limitations and future work needed to make this work in practice.
DevSecOps for Developers, How To Start (ETC 2020)Patricia Aas
How can you squeeze Security into DevOps? Security is often an understaffed function, so how can you leverage what you have in DevOps to improve your security posture?
Often the culture clash between Security and Development is even more prominent than between Development and Operations. Understanding the differences in how these functions work, and leveraging their similarities, will reveal processes already in place that can be used to improve security. This fine tuning of tools and processes can give you DevSecOps on a shoestring.
Elections: Trust and Critical Infrastructure (NDC TechTown 2019)Patricia Aas
Free and correct elections are the linchpin of democracy. For a government to be formed based the will of the people, the will of the people must be heard. Across the world election systems are being classified as critical infrastructure, and they face the same concerns as all other fundamental systems in society.
We are building our critical infrastructure from hardware and software built by nations and companies we can’t expect to trust. How can this be dealt with in Election Security, and can those lessons be applied to other critical systems society depends on today?
Elections, Trust and Critical Infrastructure (NDC TechTown)Patricia Aas
Free and correct elections are the linchpin of democracy. For a government to be formed based the will of the people, the will of the people must be heard. Across the world election systems are being classified as critical infrastructure, and they face the same concerns as all other fundamental systems in society.
We are building our critical infrastructure from hardware and software built by nations and companies we can’t expect to trust. How can this be dealt with in Election Security, and can those lessons be applied to other critical systems society depends on today?
Survival Tips for Women in Tech (JavaZone 2019) Patricia Aas
Being the only woman on your team can be hard. Many times it’s difficult to know what is only your experience and what is common. In this talk we’ll go through 24 tips (and a few bonus tips) based on well over a decade of experience being the only woman in several teams. If you’re a woman hopefully you’ll walk out with some ideas you can put to work right away, if you’re a man hopefully you’ll walk out with a new perspective and start noticing things in your day-to-day that you didn’t notice before.
https://patricia.no/2018/09/06/survival_tips_for_women_in_tech.html
Patricia Aas is a C++ programmer and security expert who currently works for TurtleSec. She is concerned about issues like election security, privacy, and the lack of oversight and regulation in the technology industry. She believes technology has introduced fragility to important systems like democracy. However, most people do not understand the implications of technological issues and journalists struggle to explain the problems to the general public. This leaves the industry unregulated and unable to have meaningful public debates around ethics and social impacts.
Chromium Sandbox on Linux (NDC Security 2019)Patricia Aas
The Linux Security and Isolation APIs have become the basis of some of the most useful features server-side, providing the isolation required for efficient containers.
However, these APIs also form the basis of the Chromium Sandbox on Linux, and we will study them in that context in this talk.
Keynote: Deconstructing Privilege (C++ on Sea 2019)Patricia Aas
Can you describe a situation that caused you to realize you were privileged?
I have asked many people that question now, and what I have learned is that privilege is an Unconscious Incompetence. Being privileged is a non-event. When we become conscious of it we realize that our privileged experience is not applicable to less privileged people. What happens to them does not happen to us. Only when we become Consciously Incompetent do we realize the need to listen. We need to learn.
In this talk I hope to make you realize that we all have privilege and to start a journey through self reflection to becoming Consciously Incompetent. I hope also to give some indicators and patterns that you can look for in your daily lives to recognize and maybe even to correct imbalances you see.
The document summarizes Patricia Aas' talk on making software secure and fixable. It discusses common security issues such as being unable to roll out fixes, lack of control over dependencies, teams leaving without documentation, bugs in code, and pressure from management to implement insecure features. It provides recommendations to address each issue, such as maintaining version control, auditing dependencies, bringing work back in-house, rigorous testing and reviews, and protecting developers and users. The document also covers designing security notifications and interfaces with a focus on usability over detailed technical explanations.
Why Is Election Security So Hard? (Paranoia 2019) Patricia Aas
What makes the domain and requirements of elections so difficult to solve with computers? In this talk we will go through a lot of the requirements of an election and what motivates them, and show how computers surprisingly often introduce more vulnerabilities than they solve when applied to elections.
When deliberating between CodeIgniter vs CakePHP for web development, consider their respective strengths and your project requirements. CodeIgniter, known for its simplicity and speed, offers a lightweight framework ideal for rapid development of small to medium-sized projects. It's praised for its straightforward configuration and extensive documentation, making it beginner-friendly. Conversely, CakePHP provides a more structured approach with built-in features like scaffolding, authentication, and ORM. It suits larger projects requiring robust security and scalability. Ultimately, the choice hinges on your project's scale, complexity, and your team's familiarity with the frameworks.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
Do you want Software for your Business? Visit Deuglo
Deuglo has top Software Developers in India. They are experts in software development and help design and create custom Software solutions.
Deuglo follows seven steps methods for delivering their services to their customers. They called it the Software development life cycle process (SDLC).
Requirement — Collecting the Requirements is the first Phase in the SSLC process.
Feasibility Study — after completing the requirement process they move to the design phase.
Design — in this phase, they start designing the software.
Coding — when designing is completed, the developers start coding for the software.
Testing — in this phase when the coding of the software is done the testing team will start testing.
Installation — after completion of testing, the application opens to the live server and launches!
Maintenance — after completing the software development, customers start using the software.
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
SOCRadar's Aviation Industry Q1 Incident Report is out now!
The aviation industry has always been a prime target for cybercriminals due to its critical infrastructure and high stakes. In the first quarter of 2024, the sector faced an alarming surge in cybersecurity threats, revealing its vulnerabilities and the relentless sophistication of cyber attackers.
SOCRadar’s Aviation Industry, Quarterly Incident Report, provides an in-depth analysis of these threats, detected and examined through our extensive monitoring of hacker forums, Telegram channels, and dark web platforms.
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
Takashi Kobayashi and Hironori Washizaki, "SWEBOK Guide and Future of SE Education," First International Symposium on the Future of Software Engineering (FUSE), June 3-6, 2024, Okinawa, Japan
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
Looking for a reliable mobile app development company in Noida? Look no further than Drona Infotech. We specialize in creating customized apps for your business needs.
Visit Us For : https://www.dronainfotech.com/mobile-application-development/
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
WhatsApp offers simple, reliable, and private messaging and calling services for free worldwide. With end-to-end encryption, your personal messages and calls are secure, ensuring only you and the recipient can access them. Enjoy voice and video calls to stay connected with loved ones or colleagues. Express yourself using stickers, GIFs, or by sharing moments on Status. WhatsApp Business enables global customer outreach, facilitating sales growth and relationship building through showcasing products and services. Stay connected effortlessly with group chats for planning outings with friends or staying updated on family conversations.
2. @pati_gallardo
TurtleSec
To learn the basics - write an application you know
To learn the middle and remove the accent, maintain it with the feedback of a native speaker
2
35. @pati_gallardo
TurtleSec
[C++] Operator Overloading Use
1. Box first = new Box(new Point(1, 1), 3, 2);
2. Box second = new Box(new Point(3, 4), 3, 3);
3. Box boundingBox = first + second;
@pati_gallardo 35
Some constructs are quite elegant
with operator overloading
37. @pati_gallardo
TurtleSec
[C++] Operator Overloading Definition
1. public static Box operator +(Box left, Box right) {
2. Point top =
3. new Point(Math.Min(left.top().x, right.top().x),
4. Math.Min(left.top().y, right.top().y));
5. Point bottom =
6. new Point(Math.Max(left.bottom().x, right.bottom().x),
7. Math.Max(left.bottom().y, right.bottom().y));
8. int width = bottom.x - top.x;
9. int height = bottom.y - top.y;
10. return new Box(top, width, height);
11. }
@pati_gallardo 37
38. @pati_gallardo
TurtleSec
[C++] Optional Arguments
1. public class OptionalArguments {
2. private static int increase(int x, int y = 2) {
3. return x + y;
4. }
5.
6. [Test]
7. public void TestOptionalArguments() {
8. Assert.AreEqual(5, increase(3));
9. }
10. }
@pati_gallardo 38
39. @pati_gallardo
TurtleSec
[Objective-C] Named Parameters
1. public class NamedParameters {
2. private static int named(int x, int y) {
3. return x + y;
4. }
5.
6. [Test]
7. public void TestNamedParameters() {
8. Assert.AreEqual(5, named(y: 3, x: 2));
9. }
10. }
@pati_gallardo 39
40. @pati_gallardo
TurtleSec
[C++] Struct - value type
1. struct Point {
2. public int x;
3. public int y;
4. }
@pati_gallardo 40
Similar in meaning to C++Drift in Form
In C++ structs are classes with default
public access - in C# structs are
classes that don’t allow inheritance
In C++ all types
are value types
Cognates
42. @pati_gallardo
TurtleSec
[Qt?] Properties
1. public class Properties {
2. public string ReadWriteProperty { get; set; } = "Hello";
3. public string ReadOnlyProperty { get; }
4. // Auto-implemented properties must have get accessors.
5. // public string WriteOnlyProperty { set; }
6. public string PrivateReadWriteProperty { private get; set; }
7. public string ReadPrivateWriteProperty { get; private set; }
8.
9. private string PrivateReadWriteField;
10. public string WrapField {
11. set => PrivateReadWriteField = value;
12. get => PrivateReadWriteField;
13. }
14. }
@pati_gallardo 42
Magic “value”
43. @pati_gallardo
TurtleSec
[C & C++] (Inline) Out Parameters
1. private static int outParam(int x, int y, out int mod) {
2. mod = x % y;
3. return x / y;
4. }
5.
6. [Test]
7. public void TestOutParameters() {
8. int quotient = outParam(25, 5, out var remainder);
9. Assert.AreEqual(0, remainder);
10. Assert.AreEqual(5, quotient);
11. }
@pati_gallardo 43
Passing int
by ref
44. @pati_gallardo
TurtleSec
[] Null-conditional operators ?. and ?[]
1. int GetCoffee(List<Shop> coffeeShops, int index) {
2. // If there are any coffeeShops and
3. // if there is a shop at that index,
4. // please get me that coffee,
5. // if not, just get me 0
6. return coffeeShops?[index]?.Coffee ?? 0;
7. }
@pati_gallardo 44
47. @pati_gallardo
TurtleSec
[C++ & Java] Destructor / Finalize
1. public class DestroyMe {
2. ~DestroyMe() {
3. // Might be called by the
4. // Garbage Collector
5. }
6. }
@pati_gallardo 47
More like Java
finalize
Drift in Meaning
50. @pati_gallardo
TurtleSec
[Java & C++] IDisposable
1. public class DisposeMe : IDisposable {
2. private FileStream fileStream;
3.
4. public void Dispose() {
5. fileStream?.Dispose();
6. }
7. }
@pati_gallardo 50
Similar to Javas
Closeable
Drift in Form
Same semantics
Different syntax
63. @pati_gallardo
TurtleSec
[JavaScript] Anonymous Types
1. var gilmoreGirls =
2. new[] {
3. new { Name = "Loralai", Age = "36" },
4. new { Name = "Rory", Age = "20" }
5. };
@pati_gallardo 63
If you squint it looks
a bit like JS objects
64. @pati_gallardo
TurtleSec
[JavaScript] ExpandoObject
1. public delegate void printMe();
2.
3. [Test]
4. public void Test() {
5. dynamic expando = new ExpandoObject();
6. // Add a field
7. expando.GilmoreGirl = "Rory";
8. Assert.AreEqual("Rory", expando.GilmoreGirl);
9. // Add a function
10. printMe order = delegate { Console.WriteLine("Coffee!"); };
11. expando.getCoffee = order;
12. expando.getCoffee();
13. }
14.
@pati_gallardo 64
Full on JS!