This document summarizes the history of C# and .NET Framework versions from Visual Studio .NET Rainer in 2002 to Visual Studio 2010 Dev10. It covers features introduced in each new version of C# and .NET Framework including generics, LINQ, lambda expressions, extension methods, and more. It also briefly discusses the Reactive Extensions for .NET Framework 3.5 which added asynchronous programming capabilities using an observer pattern.
Despite all of the recent interest, concurrency in standard C++ is still barely in its infancy. This talk uses the primitives supplied by C++14 to build a simple, reference, implementation of a task system. The goal is to learn to write software that doesn’t wait.
Introduction to web programming for java and c# programmers by @drpicoxDavid Rodenas
(better presented by @drpicox)
Slides of an introductory course for web programming focusing in basic Javascript and CSS concepts. It assumes knowledge of programming, Java or C#.
One Year of Clean Architecture - The Good, The Bad and The BobOCTO Technology
Après des heures de visionnage de ce sacré tonton, et conscients qu’évidemment, "there is a better way", il était temps de passer à la version supérieure du MVP. C’est ce que nous avons fait, en mettant en place différentes interprétations de la Clean Architecture sur nos missions, sur des applications existantes comme sur du from-scratch.
Nous sommes partis des postulats d’Uncle Bob : avoir une architecture indépendante des frameworks, de l’UI, des back-ends et des BDD. Et par dessus tout : testable. Pour une fois, nous n’avons pas mis la stack technique au centre de notre choix d’architecture. Car comme il le dit si bien, un bon architecte est quelqu’un qui retarde au plus tard les choix des outils. Nous nous sommes concentrés sur les règles métier. En pur java. En pur KOTLIN. Sans librairies.
Ce modèle a révolutionné notre manière de concevoir une application chez nos différents clients (BNP, SNCF, Meetic…). Nous allons vous partager nos fiertés, nos douleurs et les questions qui restent encore ouvertes.
SoCal Code Camp 2015: An introduction to Java 8Chaitanya Ganoo
Java 8 introduced cool new features such as Lambdas and Streams. We'll take a look at what they are how to use them effectively. We'll also walkthrough an example of a lightweight Java 8 service running in AWS cloud, which can read and index tweets into an ElasticSearch cluster
TDD, BDD, ATDD are all methodologies that enable incremental design that is suitable for Agile environments. It seems that every day a new xDD methodology is born with the promise to be better than what came before. Should you use behaviour-driven tests or plain old unit tests? Which methodology is better? And how exactly would it benefit the development life cycle?
In this session, Dror will help to sort out the various methodologies – explaining where they came from, the tools they use, and discussing how and when to use each one. Here we will once and for all answer the question as to whether or not there’s one “DD” to rule them all.
How Data Flow analysis works in a static code analyzerAndrey Karpov
Data flow analysis is a technology for source code analysis, widely used in various development tools: compilers, linters, IDE. We'll talk about it exemplifying with design of a static analyzer. The talk covers classification and various kinds of data flow analysis, neighbouring technologies supporting each other, obstacles arising during development, surprises from C++ language when one tries to analyze the code. In this talk, some errors, detected in real projects using this technology, are shown in detail.
Templates
Generic Programming with Templates
Need for Templates
Definition of class Templates
Normal Function Templates
Over Loading of Template Function
Bubble Sort Using Function Templates
Difference Between Templates and Macros
Linked Lists with Templates
Exception Handling
Principles of Exception Handling
The Keywords try throw and catch
Multiple Catch Statements
Specifying Exceptions
Introduction to C++
Difference between C and C++
Evolution of C++
Procedure Oriented Programming vs Object OrientedProgramming
Key concepts of Object-Oriented Programming
Advantages and Disadvantages of OOP
Operator Overloading
The keyword Operator
Overloading Unary Operator
Operator Return Type
Overloading Assignment Operator (=)
Rules for Overloading Operators
Inheritance
Reusability
Types of Inheritance
Virtual Base Classes
Object as a Class Member
Abstract Classes
Advantages of Inheritance
Disadvantages of Inheritance
Despite all of the recent interest, concurrency in standard C++ is still barely in its infancy. This talk uses the primitives supplied by C++14 to build a simple, reference, implementation of a task system. The goal is to learn to write software that doesn’t wait.
Introduction to web programming for java and c# programmers by @drpicoxDavid Rodenas
(better presented by @drpicox)
Slides of an introductory course for web programming focusing in basic Javascript and CSS concepts. It assumes knowledge of programming, Java or C#.
One Year of Clean Architecture - The Good, The Bad and The BobOCTO Technology
Après des heures de visionnage de ce sacré tonton, et conscients qu’évidemment, "there is a better way", il était temps de passer à la version supérieure du MVP. C’est ce que nous avons fait, en mettant en place différentes interprétations de la Clean Architecture sur nos missions, sur des applications existantes comme sur du from-scratch.
Nous sommes partis des postulats d’Uncle Bob : avoir une architecture indépendante des frameworks, de l’UI, des back-ends et des BDD. Et par dessus tout : testable. Pour une fois, nous n’avons pas mis la stack technique au centre de notre choix d’architecture. Car comme il le dit si bien, un bon architecte est quelqu’un qui retarde au plus tard les choix des outils. Nous nous sommes concentrés sur les règles métier. En pur java. En pur KOTLIN. Sans librairies.
Ce modèle a révolutionné notre manière de concevoir une application chez nos différents clients (BNP, SNCF, Meetic…). Nous allons vous partager nos fiertés, nos douleurs et les questions qui restent encore ouvertes.
SoCal Code Camp 2015: An introduction to Java 8Chaitanya Ganoo
Java 8 introduced cool new features such as Lambdas and Streams. We'll take a look at what they are how to use them effectively. We'll also walkthrough an example of a lightweight Java 8 service running in AWS cloud, which can read and index tweets into an ElasticSearch cluster
TDD, BDD, ATDD are all methodologies that enable incremental design that is suitable for Agile environments. It seems that every day a new xDD methodology is born with the promise to be better than what came before. Should you use behaviour-driven tests or plain old unit tests? Which methodology is better? And how exactly would it benefit the development life cycle?
In this session, Dror will help to sort out the various methodologies – explaining where they came from, the tools they use, and discussing how and when to use each one. Here we will once and for all answer the question as to whether or not there’s one “DD” to rule them all.
How Data Flow analysis works in a static code analyzerAndrey Karpov
Data flow analysis is a technology for source code analysis, widely used in various development tools: compilers, linters, IDE. We'll talk about it exemplifying with design of a static analyzer. The talk covers classification and various kinds of data flow analysis, neighbouring technologies supporting each other, obstacles arising during development, surprises from C++ language when one tries to analyze the code. In this talk, some errors, detected in real projects using this technology, are shown in detail.
Templates
Generic Programming with Templates
Need for Templates
Definition of class Templates
Normal Function Templates
Over Loading of Template Function
Bubble Sort Using Function Templates
Difference Between Templates and Macros
Linked Lists with Templates
Exception Handling
Principles of Exception Handling
The Keywords try throw and catch
Multiple Catch Statements
Specifying Exceptions
Introduction to C++
Difference between C and C++
Evolution of C++
Procedure Oriented Programming vs Object OrientedProgramming
Key concepts of Object-Oriented Programming
Advantages and Disadvantages of OOP
Operator Overloading
The keyword Operator
Overloading Unary Operator
Operator Return Type
Overloading Assignment Operator (=)
Rules for Overloading Operators
Inheritance
Reusability
Types of Inheritance
Virtual Base Classes
Object as a Class Member
Abstract Classes
Advantages of Inheritance
Disadvantages of Inheritance
NDC 2015 이석호 - 인디 게임 개발사의 콘솔 도전기
Nexon Developer Conference 2015의 발표에 사용한 슬라이드입니다
콰트로기어에서 콘솔 게임 '블랙위치크래프트' 개발을 진행하면서
많은 질문을 받은 항목들을 콰트로기어의 사례와 함께 소개하였습니다
콘솔 게임 개발에 관심이 있는 개발자들에게 도움이 되는 정보가 되길 바랍니다
Metaprogramming is a key tool of many Java frameworks, such as Spring and Hibernate. In this talk we will cover how metaprogramming can be implemented on JVM. We’ll look at annotations, reflection, bytecode manipulation and cover metaprogramming patterns you can successfully apply in your projects.
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
HexRaysCodeXplorer: object oriented RE for fun and profitAlex Matrosov
HexRaysCodeXplorer - Hex-Rays Decompiler plugin for easier code navigation. Here are the main features of the plugin:
- Automatic type REconstruction for C++ objects.
- C-tree graph visualization - a special tree-like structure representing a decompiled routine in c_itemt terms. Useful feature for understanding how the decompiler works.
- Navigation through virtual function calls in HexRays Pseudocode window.
- Object Explorer - useful interface for navigation through virtual tables (VTBL) structures.
In this presentation, the authors of HexRaysCodeXplorer will be discussing main functionality of the plugin and its application for reverse engineering. The authors will be presenting the algorithm for C++ type REconstruction. Also a special version of HexRaysCodeXplorer (H2HC edition) will be released with new features developed specially for H2Cconference. New features will be committed to GitHub from the stage.
- What's new in .NET Platform
- What's new in Visual Studio 2017
- What's new in C# 7.0: out variables, Tuples, Pattern Maching, ref locals and returns, Local Functions, More expression-bodied members, throw Expressions, Generalized async return types, Numeric literal syntax improvements
Part presentation, part debate about the future of the language while touching base on the current state of the industry with respect to ES6/ES2015, and the possibilities of using it today in web applications and frameworks, the different options, and the things to keep in mind. Additionally, we will do a walk-through on the new features included in ES7/ES2016 draft, and those that are being discussed for ES8/ES2017.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
5. Agenda
Visual Studio .NET Rainer
.NET Framework 1.0 C# 1.0
Visual Studio .NET 2003 Everett
.NET Framework 1.1, C# 1.2
Visual Studio 2005 Whidbey
.NET Framework 2.0, C# 2,0
.NET Framework 3.0 WinFX
Visual Studio 2008 Orcas
.NET Framework 3.5, C# 3.0
Visual Studio 2010 Dev10
.NET Framework 4.0, C# 4.0
Reactive Extensions for .NET Framework 3.5 SP1
6. Visual Studio .NET Rainer
.NET Framework 1.0 / C# 1.0
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
7. C# 1.0 – Managed Code
Common Type System
Classes
Structures
Enumerations
Interfaces
Delegates
Attributes
Directives
Visual Studio® .NET
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
10. Field
// C#
const int constant = 0;
readonly int readOnlyField;
// C++
static const int constant = 0;
const int readOnlyField;
mutable int mutableField;
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
11. Field (cont.)
Field ≠ variable
default(T) if not initialized
• null if reference type
• 0 if value type
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
12. Method
Member function with CV-qualifier
class Object
{
public:
String ToString() const
{
return const_cast<Object*>(this)
->ToString();
}
virtual String ToString();
};
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
13. Method (cont.)
// C#
void CallByRef(ref int value);
bool TryGetValue(out int value);
// C++
void CallByRef(int& value);
bool TryGetValue(/*out*/int& value);
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
14. Property
Get Method/Set Method ≠ reference to type
// C#
variable = obj.PropertyName;
obj.PropertyName = value
// C++
variable = obj->get_PropertyName();
obj->setPropertyName(value);
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
15. Property (cont.)
Indexed property ≠ index operator []
int this[int index]
{
get { return array[index]; }
set { array[index] = value; }
}
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
16. Property (cont.)
Implementation: lazy evaluation class
class Property<typename T>
{
operator T() const;
Property& operator=(const T&
value);
Property& operator=(const
Property& value);
};
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
17. Property (cont.)
VC 7.1 or higher: property extended storage-
class modifier
virtual TypeName get_PropertyName();
virtual void set_PropertyName(const
TypeName& value);
__declspec(property(get=get_Property
Name, put=set_PropertyName))
TypeName PropertyName;
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
18. Event
Multicast delegate
// C#
obj.EventName += someDelegate;
obj.EventName -= someDelegate;
if (obj.EventName != null) obj.EventName();
// C++
obj->add_EventName(someDelegate);
obj->remove_EventName(someDelegate);
obj->raise_EventName();
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
20. Classes (cont.)
Prevent R6025 – Pure virtual function call
__forceinline void Release()
{
if (--referenceCounter == 0)
{
Finalize();
delete this;
}
}
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
21. Classes (cont.)
Type initializer a.k.a. static constructor
namespace
{
class Static : … ;
Pointer<Static> _static;
}
…
if (_static == NULL)
{
_static.CompareExchange(Pointer<Static>(
new Static), Pointer<Static>(NULL));
}
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
22. Classes (cont.)
Sealed class
template <typename T>
class Sealed
{
private:
friend typename T;
Sealed() { }
~Sealed() { }
};
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
23. Structures
Lightweight – Value types
Default constructor / finalizer
• NEVER let contain unmanaged resources
Expert only
• Box/Unbox cost
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
24. Enumerations
Value types
string[] Enum.GetNames()
TEnum[] Enum.GetValues()
TEnum Enum.Parse(string s)
bool Enum.TryParse(
string s, out TEnum @enum)
TEnum TEnum.MaxValue { get; }
TEnum TEnum.MinValue { get; }
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
26. Delegates
Closures or managed functors
Calling conventions:
• cdecl
• stdcall
• fastcall
• thiscall
• function object
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
27. Delegates (cont.)
#define DEFINE_DELEGATE(TPARAMS, PARAMS,
ARGS)
template <typename TResult TPARAMS>
class delegate<TResult(PARAMS)> …
#define DELEGATE_TPARAMS , typename T1
#define DELEGATE_PARAMS T1 arg1
#define DELEGATE_ARGS arg1
DEFINE_DELEGATE(DELEGATE_TPARAMS,
DELEGATE_PARAMS, DELEGATE_ARGS);
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
28. Attributes
template <typename T>
class CustomAttribute
{
public:
static const int get_Value() { return
value; }
private:
static int value;
};
#define CUSTOM_ATTRIBUTE(Type, _v)
int CustomAttribute<Type>::value = _v
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
29. Directives
using directive (C#) ≈ using directive (C++)
Assemblies are referenced.
#include directive (C++)
package / import declarations (Java)
#define directive
defines a symbol
assigns a value to a symbol
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
30. Visual Studio .NET 2003 Everett
.NET Framework 1.1 / C# 1.2
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
31. C# 1.2 – Bug Fix
IDisposable interface
• IEnumerator interface
foreach (object obj in collection)
// TEnumerator enumerator =
// collection.GetEnumerator();
{
}
// if (enumerator is IDisposable)
// enumerator.Dispose();
Visual Studio® .NET 2003
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
32. Visual Studio 2005 Whidbey
.NET Framework 2.0 / C# 2.0
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
33. C# 2.0 – Generic
Generics
Iterators
Partial Classes
Nullable Types
Anonymous Methods
Static Classes
Property Accessor Accessibilities
Delegates
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
Visual Studio® 2005
34. Generics
System.Collections.Generic
• List<T> std::vector<T>
• Queue<T> std::queue<T>
• Stack<T> std::stack<T>
• LinkedList<T> std::list<T>
• Dictionary<TKey, TValue>
std::map<Key, T>
• HashSet<T> std::set<T>
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
37. Nullable Types
Nullable<T> where T : struct
Coalescing operator ??
int? nullable = null;
int value = nullable ??
default(int);
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
38. Anonymous Methods
// C# 2.0
Func<Type, bool> predicate =
// nested type in C# 1.2
delegate(Type value)
{
return value == default(Type);
};
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
39. Static Classes
Classes which are both abstract and sealed.
public static class Helper
{
public static int GetHash(object obj)
{
return obj.GetHashCode();
}
}
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
40. Property Accessor
Accessibilities
// C# 1.2
public Type PropertyName
{ get { return field; } }
internal void SetPropertyName(Type value)
{ fieldName = value; }
// C# 2.0
public Type PropertyName
{
get { return fieldName; }
internal set { fieldName = value; }
}
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
41. Delegates
string Covariance() …
Func<object> function =
new Func<object>(Covariance);
void Contravariance(object arg);
Action<string> action =
new Action<string>(
Contravariance);
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
42. Delegates (cont.)
// C# 1.2
Action action =
new Action(obj.MethodName);
// C# 2.0
Action action = obj.MethodName;
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
43. Visual Studio 2008 Orcas
.NET Framework 3.5 / C# 3.0
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
44. C# 3.0 – LINQ
Implicitly Type Local Variables and Arrays
Object Initializers
Collection Initializers
Extension Methods
Anonymous Types
Lambda Expressions
Query Keywords
Auto-Implemented Properties
Partial Method Definitions
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
Visual Studio® 2008
45. Implicitly Type Local
Variables and Arrays
// C# 2.0
Dictionary<string, object> dict =
new Dictionary<string, object>();
Type[] types = new Type[]
{ typeof(int) };
// C# 3.0
var dict =
new Dictionary<string, object>();
var types = new[] { typeof(int) };
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
46. Object Initializers
// C# 2.0
SomeKeyValue pair = new SomeKeyValue();
value.Name = “anonymous”;
value.Value = null;
// C# 3.0
var value = new SomeKeyValue()
{
Name = “anonymous”,
Value = null,
};
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
47. Collection Initializers
// C# 2.0
List<int> list = new List<int>();
list.Add(1);
list.Add(2);
// C# 3.0
var list = new List<int> { 1, 2 };
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
48. Extension Methods
static class ComponentExtensions
{
static void DoSomething(
this IComponent component,
T arg) { … }
}
ComponentExtensions.Do(component, arg);
component.DoSomething(arg);
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
49. Anonymous Types
foreach (var value in from row in table
select new
{
Type = row.GetType(),
Hash = row.GetHashCode(),
})
{
Console.WriteLine(“{{ Type = {0}, Hash = {1} }}”,
value.Type, value.Hash);
Console.WriteLine(value);
}
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
50. Lambda Expressions
// C# 2.0
Func<Type, bool> predicate =
delegate(Type value)
{
return value == default(Type);
};
// C# 3.0
Func<Type, bool> predicate =
value => value == default(Type);
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
51. Query Keywords
var q = from c in categories
join p in products
on c.ID equals p.CID
orderby c.ID,
p.Price descending
group p.Price by c.ID into g
let cid = g.Key
where Predicate(cid)
select g.Average();
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
52. Query Keywords (cont.)
var q = categories
.Join(products,
c => c.ID, p => p.CID,
(c, p) =>
new { c = c, p = p })
.OrderBy(_ => _.c.ID)
.ThenByDescending(_ => _.p.Price)
.GroupBy(_ => _.c.ID, _.p.Price)
.Select(g =>
new { g = g, cid = g.Key })
.Where(_ => Predicate(_.cid))
.Select(_ => _.g.Average());
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
53. Auto-Implemented
Properties
// C# 2.0
public Type PropertyName
{
get { return fieldName; }
internal set { fieldName = value; }
}
// C# 3.0
public Type PropertyName
{ get; internal set; }
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
54. Partial Method
Definitions
// Generated.Designer.cs
partial class Generated
{
Generated() { OnInitialized(); }
partial void OnInitialized();
}
// Generated.cs
partial class Generated
{
partial void OnInitialized() { … }
}
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
55. Reactive Extensions for .NET Framework 3.5 SP1
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
More LINQ with System.Interactive – Getting Started by Bart De Smet
59. Observer Design Pattern
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx
More LINQ with System.Interactive – Getting Started by Bart De Smet
60. Observer Design Pattern
(Further reading)
Duality of IEnumerable<T> / IObservable<T>
Reactive Framework Finally Explained
More LINQ with System.Interactive series
VS .NET VS .NET 2003 VS 2005 VS 2008 Rx