A three-part presentation on the Swift programming language:
• An introduction to Swift for Objective-C developers
• Changes in Swift 2
• What's coming in Swift 2.2 & 3.0
The document discusses three sanitizers - AddressSanitizer, ThreadSanitizer, and MemorySanitizer - that detect bugs in C/C++ programs. AddressSanitizer detects memory errors like buffer overflows and use-after-frees. ThreadSanitizer finds data races between threads. MemorySanitizer identifies uses of uninitialized memory. The sanitizers work by instrumenting code at compile-time and providing a run-time library for error detection and reporting. They have found thousands of bugs in major software projects with reasonable overhead. Future work includes supporting more platforms and detecting additional classes of bugs.
Building High-Performance Language Implementations With Low EffortStefan Marr
This talk shows how languages can be implemented as self-optimizing interpreters, and how Truffle or RPython go about to just-in-time compile these interpreters to efficient native code.
Programming languages are never perfect, so people start building domain-specific languages to be able to solve their problems more easily. However, custom languages are often slow, or take enormous amounts of effort to be made fast by building custom compilers or virtual machines.
With the notion of self-optimizing interpreters, researchers proposed a way to implement languages easily and generate a JIT compiler from a simple interpreter. We explore the idea and experiment with it on top of RPython (of PyPy fame) with its meta-tracing JIT compiler, as well as Truffle, the JVM framework of Oracle Labs for self-optimizing interpreters.
In this talk, we show how a simple interpreter can reach the same order of magnitude of performance as the highly optimizing JVM for Java. We discuss the implementation on top of RPython as well as on top of Java with Truffle so that you can start right away, independent of whether you prefer the Python or JVM ecosystem.
While our own experiments focus on SOM, a little Smalltalk variant to keep things simple, other people have used this approach to improve peek performance of JRuby, or build languages such as JavaScript, R, and Python 3.
Seeing with Python presented at PyCon AU 2014Mark Rees
This document discusses the history and current state of computer vision. It begins with definitions of computer vision from the 1980s, focusing on machine vision and automatically analyzing images. It then provides a 2014 definition that emphasizes duplicating human vision abilities through electronic image perception and understanding using models from various fields. The document notes computer vision involves more than just image capture, including image processing, algorithm development, and display control. It also lists and briefly describes several popular Python libraries for computer vision tasks, such as PIL, Scipy ndimage, Mahotas, PCV, SimpleCV, and OpenCV. It concludes with resources for learning more about computer vision and Python.
[JavaOne 2011] Models for Concurrent ProgrammingTobias Lindaaker
The document discusses models for concurrent programming. It summarizes common misconceptions about threads and concurrency, and outlines some of the core abstractions and tools available in Java for writing concurrent programs, including threads, monitors, volatile variables, java.util.concurrent classes like ConcurrentHashMap, and java.util.concurrent.locks classes like ReentrantLock. It also discusses some models not currently supported in Java like parallel arrays, transactional memory, actors, and Clojure's approach to concurrency using immutable data structures, refs, and atoms.
The document provides an overview of sanitizers, which are dynamic testing tools that detect bugs like buffer overflows and uninitialized memory reads. It focuses on Address Sanitizer (ASan), which detects invalid address usage bugs, and Undefined Behavior Sanitizer (UBSan), which finds unspecified code semantic bugs. ASan works by dividing memory into main and shadow spaces and instruments code to check shadow values for poisoning. UBSan detects issues like integer overflow and out-of-bounds memory access. Both tools are compiler-instrumented to add checks and generate detailed reports of encountered bugs.
Столпы функционального программирования для адептов ООП, Николай МозговойSigma Software
This document provides an overview of functional programming concepts for object-oriented programmers. It discusses the fundamentals of FP including immutability, purity, first-class and higher-order functions, closures, and recursion. It provides examples of these concepts in languages like Lisp, F#, C#, and JavaScript. The document also compares OO and FP concepts and discusses derived FP concepts like partial application, lazy evaluation, and pattern matching.
Bartosz Milewski, “Re-discovering Monads in C++”Platonov Sergey
Once you know what a monad is, you start seeing them everywhere. The std::future library of C++11 was an example of an incomplete design, which stopped short of recognizing the monadic nature of futures. This is now being remedied in C++17, and there are new library additions, like std::expected and the range library, that are much more monad-conscious. I’ll explain what a monad is using copious C++ examples.
Introduction to homomorphic encryption, encryption which allows computations on ciphertext. An overview of key aspects and the ideas that allow these schemes to work is given, as well as examples of how to apply it.
Christoph Matthies (@chrisma0), Hubert Hesse (@hubx), Robert Lehmann (@rlehmann)
The python interpreter converts programs to bytecodes before beginning execution. Execution itself consist of looping over these bytecodes and performing specific operations over each one. This talk gives a very brief overview of the main classes of bytecodes.
This presentation was given as a lightning talk at the Boston Python Meetup group on July 24th, 2012.
Data-oriented design (DOD) focuses on how data is accessed and transformed, rather than how code is organized. This improves performance by minimizing cache misses and allowing better utilization of parallelism. The document provides an example comparing an object-oriented design (OOD) approach that stores related data together in objects, resulting in scattered memory access and many cache misses, versus a DOD approach that groups together data that is accessed together, resulting in fewer cache misses and faster performance.
The document discusses iOS development with blocks and Grand Central Dispatch (GCD). It introduces blocks as a way to encapsulate code similar to functions but with additional features. It describes how to define, call and pass blocks. It then discusses how blocks can be used to replace callbacks, handle notifications, enable concurrent enumeration and sorting. The document concludes with an introduction to GCD, describing it as an open-source threading library that automatically optimizes threading using queues, timers and handlers.
This presentation helps discover some of the specific features of Java 8, (in particular, atomics and parallelism) and start using them effectively.
This presentation by Maksym Voronyi (Software Engineer, GlobalLogic) was delivered at Java.io 3.0 conference in Kharkiv on March 24, 2016, and GlobalLogic Mykolaiv Java Conference on June 11, 2016.
Basic concept of Deep Learning with explaining its structure and backpropagation method and understanding autograd in PyTorch. (+ Data parallism in PyTorch)
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonAMD Developer Central
The document discusses low-level shader optimization techniques for next-generation consoles and DirectX 11 hardware. It provides lessons from last year on writing efficient shader code, and examines how modern GPU hardware has evolved over the past 7-8 years. Key points include separating scalar and vector work, using hardware-mapped functions like reciprocals and trigonometric functions, and being aware of instruction throughput and costs on modern GCN-based architectures.
- InfoQ is a news and community site for software developers with 750,000 unique visitors per month publishing content in 4 languages.
- It posts content from QCon conferences including news, articles, presentations, interviews and books to empower software development through spreading knowledge and innovation.
- QCon conferences are practitioner-driven and designed for influencers of change and innovation, connecting them and catalyzing innovation, and have been attended by over 12,000 delegates since 2007 across 9 cities worldwide.
Presentation from DICE Coder's Day (2010 November) by Johan Torp:
This talk is about making object-oriented code more cache-friendly and how we can incrementally move towards parallelizable data-oriented designs. Filled with production code examples from Frostbite’s pathfinding implementation.
This presentation deals with RealmDB, which is a convenient replacement for SQLite & Core Data in mobile development.
Presentation by Anton Minashkin (Software Engineer, GlobalLogic, Lviv), delivered at Mobile TechTalk Lviv on April 28, 2015.
More details - http://globallogic.com.ua/mobile-techtalk-lviv-2015-report
This talk is a look into some of the surprising performance cases in Java -- with the goal of illustrating a few simple truths about the nature of compilers.
This document summarizes Rachel Andrew's presentation on CSS Grid Layout. Some key points:
- CSS Grid Layout provides a new two-dimensional layout system for CSS that solves many of the problems of previous methods like floats and flexbox.
- Grid uses line-based placement, with grid lines that can be explicit or implicit, to position items on the page. Properties like grid-column and grid-row position items within the grid.
- The grid template establishes the structure of rows and columns. Items can span multiple tracks. Fraction units like fr distribute space proportionally.
- Common layouts like Holy Grail are easily achieved with Grid. The structure can also adapt at breakpoints by redefining
Montreal Girl Geeks: Building the Modern WebRachel Andrew
The document discusses Rachel Andrew's experience building the modern web. It summarizes that Rachel found community and a new career through learning HTML and sharing her knowledge of building websites. Over time, the web became more standardized and accessible, though complexity has also increased with various frameworks abstracting the core technologies of HTML, CSS, and JavaScript. Rachel advocates for developing strong fundamental skills in the core technologies rather than relying too heavily on frameworks.
Swift is a multi-paradigm programming language developed by Apple for iOS, macOS, watchOS, and tvOS. It was inspired by Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and other languages. The document discusses Swift's history, principles, syntax including variables, constants, data types, functions, closures, and control structures. It provides code examples and explanations of Swift's main features.
iOS for Android Developers (with Swift)David Truxall
As an app developer there is always pressure to understand and be able to address both major platforms. At first blush, coding for iOS seems quite different than for Android, perhaps due to the language differences between Objective-C and Java, and of course there is a different IDE and framework. With the introduction of Swift, this chasm seems much smaller. This talk will map Android and Java functionality to similar concepts in iOS using Swift. We’ll see the similarities and differences, focusing on framework concepts, and migrate a simple Android app to iOS.
The document discusses the importance of developing an effective mobile app strategy. It notes that most companies are struggling in this area and recommends taking time to properly assess your current mobile environment before planning your app deployments. The document outlines a 7 step process to create a successful mobile app strategy including assembling the right team, stabilizing your current mobile ecosystem, identifying priority areas for mobile apps, defining key performance indicators, and ongoing management and maintenance of apps.
2015 YEAR IN REVIEW: MOBILE. The most important deals, releases, figures, moments and trends of the passing year. By Monika from mobee dick. Enjoy and have a great 2016!
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1ncT8iO.
From its simple roots as a PHP program, Uber has grown into a complex distributed system deployed across multiple datacenters using multiple databases and programming languages. Matt Ranney covers the evolution of Uber's architecture and some of the systems they built to handle the current scaling challenges. Filmed at qconsf.com.
Matt Ranney is the Chief Systems Architect at Uber. He has a computer science degree which has come in handy over a career of mostly network engineering, operations, and analytics.
InterConnect: Server Side Swift for Java DevelopersChris Bailey
The range of languages and frameworks that are available for building server applications has exploded over the last few years, with the most recent of these being the Swift programming language, which IBM has been backing along with the Kitura application framework. But does this mean that Swift is the future and you should stop developing Java server applications? This session will give you an introduction to where and when you might use Kitura, and take you through the experiences of a long-time Java EE developer building their first Angular.js based Kitura application, and how that compares to building the same application with IBM WebSphere Liberty.
InterConnect: Java, Node.js and Swift - Which, Why and WhenChris Bailey
Java, Node.js, and Swift are three of the most popular and effective programming languages in use today. When presented with an opportunity to choose, it may not be clear which language is best suited for the job. This session will provide a tour of these languages and the use cases for which each is best suited.
This document discusses pair programming and debunks common myths about it. Pair programming involves two people working together on one computer, with one person driving and the other navigating and providing feedback. It is not twice as slow as individual work, works well with most partners, and is effective at all stages of development. Pairing provides benefits like greater code quality, knowledge sharing, learning, and debugging assistance. The document advocates for regular pairing and shares examples of how to structure it, including continuous pairing, ping-pong pairing, and pairing rotations. It also shares the positive results of one company that introduced extensive pairing into their workflow.
This document discusses visualizing data with code and provides information on tools and techniques for data visualization. It lists relevant fields like information design, data science, and cartography. It also lists example visualization tools and techniques like D3, Processing, network graphs, and mapping. Finally, it outlines a process for developing data visualizations that involves looking at the data, creating initial visualizations, asking questions, getting inspiration, refining ideas, and publishing visualizations.
The Future Of Work & The Work Of The FutureArturo Pelayo
What Happens When Robots And Machines Learn On Their Own?
This slide deck is an introduction to exponential technologies for an audience of designers and developers of workforce training materials.
The Blended Learning And Technologies Forum (BLAT Forum) is a quarterly event in Auckland, New Zealand that welcomes practitioners, designers and developers of blended learning instructional deliverables across different industries of the New Zealand economy.
We’re all camping at UX Camp West, so I thought I’d use the metaphor of a tent to share with you my view on the field of User Experience. I will describe the 7 poles of the tent's structure (research, design, evaluation, implementation, business, strategy, and management) and show you some random objects that I found in its corners. It is my goal that afterwards, we can all appreciate the beauty of the big tent, and realise how we contribute to a happy stay.
2 BytesC++ course_2014_c9_ pointers and dynamic arrays kinan keshkeh
The document discusses pointers and arrays in C++. It begins with definitions of pointers, including that a pointer stores a memory address and pointer variable declarations. It then covers various pointer topics like dereferencing pointers, passing pointers to functions, and returning pointers from functions. The document also discusses dynamic memory allocation using pointers, pointer arithmetic, multi-dimensional dynamic arrays, pointers and classes, and the this pointer. Code examples are provided to illustrate many of the concepts. Homework problems at the end involve writing functions to insert into and print a linked list of vehicle records, search the list, compare dates, and print records before a given date.
The document discusses pointers in C programming. It defines pointers as variables that store the memory addresses of other variables. It provides examples of declaring pointer variables and using dereference and reference operators. It also covers pointer arithmetic, pointers to pointers, pointers to arrays, pointers as function arguments, pointers to structures including self-referential structures, enumerations, and bitfields. Key concepts are illustrated with code examples and outputs.
The document discusses arrays and strings in C programming. It covers key topics like:
- Declaring and initializing arrays and accessing array elements. Arrays have 0 as the first index.
- Difference between initialization and assignment of arrays. Arrays cannot be assigned.
- String arrays which are arrays of characters terminated by a null character.
- Common string functions like strcpy(), strcat(), strlen(), strcmp() etc.
- Two dimensional arrays and how elements are stored in row major order in contiguous memory.
- Examples of declaring, initializing and accessing 2D arrays.
The document provides an overview of the Ruby programming language with sections on installation, data types, operators, control structures, methods, classes and modules. It discusses key aspects of Ruby like its object oriented nature, dynamic typing, syntax and cross-platform capabilities. The document serves as a quick tour of the Ruby language covering its basic concepts, structures and features.
This document outlines the course objectives and structure for CS-200 Object Oriented Programming taught by Muhammad Usman. The course will introduce students to object-oriented programming concepts in C++, including applying features to program design and implementation. Students will learn about classes, objects, inheritance and design patterns. The document provides information on textbooks, tools, assignments, exams and contact details for the instructor.
Rust provides memory safety without garbage collection through its ownership and borrowing model that is checked at compile time. Ownership rules ensure that references to resources like vectors remain valid by moving the vector when it is passed to a function. Borrowing allows immutable or mutable references to a resource, but not both at the same time, avoiding data races. Rust achieves performance comparable to C++ through its zero-cost abstractions and moves semantics that avoid unnecessary data copying.
This document summarizes new syntactic features introduced in recent versions of C#, including C# 6.0, 7.0, and 7.1. It provides examples of properties with auto-properties and initializers, lambda expressions used in properties and methods, inline variables, null expressions with null-coalescing and null-conditional operators, throw expressions, local functions, value tuples, and pattern matching. It also briefly mentions features planned for future versions like C# 7.2, 8, and beyond such as read-only references, nullable reference types, and default interface methods.
This document summarizes a JavaScript training by Rick Beerendonk. It covers ECMAScript versions from 2015 to 2017, as well as React and Redux. The training includes components, properties, state, events, actions, reducers and stores. Sample code and slides are available on GitHub. Contact information is provided to sign up for the training.
OSCON Presentation: Developing High Performance Websites and Modern Apps with...Doris Chen
Creating high performance sites and apps is crucial for every developer. In this session, we will explore the best practices and performance tricks, including startup time, UI responsiveness, and Memory efficiency to make your apps running faster and fluid. Come learn the tips, tricks, and tools for maximizing the performance of your sites and apps with JavaScript and HTML5.
This document provides an overview of JavaScript including:
1. It discusses JavaScript data types like strings, numbers, booleans, objects and functions.
2. It covers JavaScript operators, control flow, and functions.
3. It describes how to manipulate strings, numbers, dates, arrays and objects in JavaScript.
Rails-like JavaScript Using CoffeeScript, Backbone.js and JasmineRaimonds Simanovskis
The document discusses using CoffeeScript to write JavaScript code in a more Ruby-like style. It provides examples of CoffeeScript code for functions, objects, classes, and other concepts. CoffeeScript allows JavaScript code to be written in a cleaner syntax that resembles Ruby. This helps address problems with JavaScript code appearing "ugly" and unfamiliar to developers experienced in Ruby. CoffeeScript transpires to regular JavaScript, enabling the Ruby-like code to run in browsers.
C++ Language Basics covers the history of C++, some drawbacks of C, input/output operators, variable declaration, the bool datatype, typecasting, and references. C++ was created in 1979 as an extension of C to support object-oriented programming. It has undergone several updates since then. References allow creating aliases to existing variables, avoiding issues with pointers. Input is handled with cin and output with cout. Variables can be declared anywhere in C++ code unlike in C. The bool datatype represents true and false values.
Rust is a systems programming language that provides memory safety without using a garbage collector. It achieves memory safety through rules of ownership, borrowing, and lifetimes that are checked at compile time. These rules prevent common memory bugs like memory leaks, dangling pointers, and use-after-free errors that are common in C and C++.
This document provides an overview and introduction to building a basic fraction calculator app in Objective-C. It begins with an overview of the project architecture using the MVC pattern with a Fraction model class to represent fractions, a Calculator class to perform operations, and a ViewController class to manage the user interface. It then details the implementation of each class, including the Fraction class with methods for creating, modifying, and performing operations on fractions, the Calculator class for setting operands and performing operations, and the ViewController class for handling user interface events and updating the display.
This document contains program code and notes about programming concepts like procedures, functions, variables, sets, and arrays. It discusses different types of variables, set operations, reading and printing sets, and provides examples of code for inputting and outputting sets. It also provides exercises for students to practice creating programs that work with student data stored in sets and arrays.
This document contains program code and notes about programming concepts like procedures, functions, variables, sets, and arrays. It discusses different types of variables, set operations, reading and printing sets, and provides examples of code for procedures to input and output sets. It also provides exercises asking the reader to write a program to manage student enrollment in math and English classes using sets and arrays.
O quanto você está satisfeito com o código que produz? Mais ainda: o quanto você está satisfeito como profissional? Na busca pela melhoria de nossas aplicações, caímos num grande desafio: melhorar a nós mesmos!
Numa conversa franca e descontraída, Samuel e Victor tentarão apresentar idéias sobre como você pode melhorar seu próprio trabalho e sentir orgulho do que faz.
C++ allows for concise summaries in 3 sentences or less:
The document provides an overview of C++ concepts including data types, variables, operators, functions, classes, inheritance and virtual members. It also covers process and thread concepts at a high level. Code examples are provided to illustrate namespaces, input/output, program flow control, overloading, dynamic memory allocation, and classes. The document serves as a brief review of fundamental C++ and system programming concepts.
The document discusses an introduction to C++ programming. It covers basic C++ concepts like variables, data types, input/output, operators, and functions. It provides examples of simple C++ programs and explains concepts like object-oriented programming, classes, and inheritance. The document is meant to introduce students to C++ as their first object-oriented programming language.
Getting Started with Combine And SwiftUIScott Gardner
The document provides an overview of the key topics that will be covered in a course on getting started with Combine and SwiftUI in iOS, including:
- Basics of the Combine framework for reactive programming
- Differences between UIKit and SwiftUI approaches
- Anatomy of a SwiftUI view and its key properties
- Creating a sample app to demonstrate Combine and SwiftUI
You may have heard about reactive programming. Maybe even checked out RxSwift. But if you're not using it in your daily development, you're really missing out! Rx decimates the boilerplate code you'd have to write to do the same things in the traditional, imperative manner. And, in this day and age where the answer to supporting multiple platforms has given rise to using "lowest common denominator" cross-platform development technologies, Rx shifts the focus back to developers who want to stay true to their platform of choice, by unifying the patterns and operators used to write app code on any platform. Come see how reactive programming with RxSwift will change your life and make you richer than your wildest dreams.
This document provides an introduction to reactive programming with RxSwift. It begins with introductions from the presenter and audience. It then defines reactive programming as working with asynchronous data streams. It provides examples of imperative vs reactive code and discusses benefits like reduced complexity. The bulk of the document demonstrates RxSwift concepts like creating, transforming, filtering, combining, and error handling observables. It addresses common questions and objections around reactive programming and provides additional resources for learning more about RxSwift.
4 Ways To Improve User Interface DevelopmentScott Gardner
4 ways to improve user interface development are:
1. Use custom fonts for icons to provide visual previews.
2. Take advantage of new Xcode features like @IBDesignable to inspect and preview views and properties.
3. Leverage layers to separate interface elements visually.
4. Use PaintCode for what-you-see-is-what-you-get drawing of dynamic colors, shapes and StyleKits.
'Build Your First Website with WordPress' Workshop IntroductionSunita Rai
The presentation is prepared for the "Build Your First Website Free with WordPress" workshop, jointly organized by Go with WP, the WordPress podcast, and Kantipur City College (KCC). The workshop starts on July 20, 2024, and ends on August 10, 2024.
This introductory presentation is designed to introduce WordPress to the students and is presented during the first week.
Exploring the Power of the MaxiBlocks Interface: A Game-Changer for WordPress Websites
Building a website can be daunting, but with the right tools, it becomes an enjoyable and efficient process. Enter MaxiBlocks, an innovative interface designed to enhance the WordPress experience. In this blog, we'll explore the various facets of MaxiBlocks and how it can revolutionize your website-building journey.
Getting Started with WordPress and MaxiBlocks
If you're new to WordPress, getting started might seem overwhelming. MaxiBlocks simplifies this process significantly. The WordPress Getting Started guide on MaxiBlocks provides step-by-step instructions to set up your WordPress site, making it accessible even for beginners.
Why Choose MaxiBlocks for Your Website?
MaxiBlocks stands out among WordPress website builders due to its user-friendly interface and powerful features. It caters to both novices and experienced developers, offering a range of tools that streamline the website creation process.
What Is Integration Testing? Types, Tools, Best Practices, and Morekalichargn70th171
Integration testing is vital to the SDLC where individual software modules are combined and tested. The primary purpose of an integration test is to identify defects that occur when modules interact. By focusing on the interfaces and interactions between modules, integration tests ensure that the components of an application work together as intended.
In today's dynamic business landscape, ERP software systems are essential tools for businesses worldwide, including those in the UAE. These systems cater to the unique needs of the UAE's rapidly changing economy and expanding industries.
This blog examines the top 10 ERP companies in the UAE, highlighting their innovative products, exceptional customer support, and significant impact on the regional business community. These companies excel in providing ERP solutions that enhance efficiency and growth for businesses throughout the UAE.
1. **Odoo**
- Odoo ERP is a comprehensive business management solution with features like accounting, HR, sales, inventory control, and CRM. Its user-friendly interface simplifies processes and boosts productivity. Banibro IT Solutions leverages Odoo to transform business operations.
- **Details:**
- Suitable for: Small, Medium, Large Businesses
- Open Source: Yes
- Cloud-based: Yes (Cloud and On-premises)
- Support: Phone, Chat, Email
- Payment: Yearly, Monthly
- Multi-Language: Yes
- OS Support: Windows, Mac, iOS, Android
- API: Available
2. **Microsoft Dynamics 365**
- Dynamics 365 offers a centralized platform for small and medium-sized businesses, integrating with Microsoft apps and cloud services for scalability. It simplifies data processing with user-friendly interfaces and customizable reporting.
- **Details:**
- Suitable for: Small, Medium, Large Businesses
- Support: Phone, Chat, Email, Knowledge Base
- Payment: One-Time, Yearly, Monthly
- Multi-Language: No
- OS Support: Web App, Windows, iOS, Android
- API: Not specified
3. **FirstBIT ERP**
- Known for serving small and medium-sized businesses, FirstBIT ERP offers comprehensive solutions and exceptional customer service, enhancing productivity and efficiency.
- **Details:**
- Suitable for: Medium, Large Businesses
- Open Source: Yes/No
- Cloud-based: Yes (Cloud and On-premises)
- Support: Phone, Email, Video Tutorials
- Payment: Yearly, Monthly
- Multi-Language: Yes
- OS Support: Web App, Windows, Mac, iOS, Android
- API: Available
4. **Ezware Technologies**
- Ezware Technologies provides top-notch ERP solutions for various industries with user-friendly modules that streamline complex business processes.
- **Details:**
- Suitable for: Small, Medium, Large Businesses
- Support: Phone, Chat, Email, Knowledge Base
- Payment: One-Time, Yearly, Monthly
- Multi-Language: No
- OS Support: Web App, Windows, Mac, iOS, Android
- API: Not specified
5. **RealSoft**
- RealSoft by Coral is popular in Dubai, offering modules for contracting, real estate, job costing, manufacturing, trading, and finance. It's VAT-enabled and affordable for medium-sized businesses.
- **Details:**
- Suitable for: Small, Medium, Large Businesses
- Open Source: No
- Cloud-based: On-premises
-
Literals - A Machine Independent Feature21h16charis
Introduction to Literals, A machine independent feature. The presentation is based on the prescribed textbook for System Software and Compiler Design, Computer Science and Engineering - System Software by Leland. L. Beck,
D Manjula.
Mastering MicroStation DGN: How to Integrate CAD and GISSafe Software
Dive deep into the world of CAD-GIS integration and elevate your workflows to nexl-level efficiency levels. Discover how to seamlessly transfer data between Bentley MicroStation and leading GIS platforms, such as Esri ArcGIS.
This session goes beyond mere CAD/GIS conversion, showcasing techniques to precisely transform MicroStation elements including cells, text, lines, and symbology. We’ll walk you through tags versus item types, and understanding how to leverage both. You’ll also learn how to reproject to any coordinate system. Finally, explore cutting-edge automated methods for managing database links, and delve into innovative strategies for enabling self-serve data collection and validation services.
Join us to overcome the common hurdles in CAD and GIS integration and enhance the efficiency of your workflows. This session is perfect for professionals, both new to FME and seasoned users, seeking to streamline their processes and leverage the full potential of their CAD and GIS systems.
Availability and Usage of Platform-Specific APIs: A First Empirical Study (MS...Andre Hora
A platform-specific API is an API implemented for a particular platform (e.g., operating system), therefore, it may not work on other platforms than the target one. In this paper, we propose a first empirical study to assess the availability and usage of platform-specific APIs. We analyze the platform-specific APIs provided by the Python Standard Library and mine their usage in 100 popular systems. We find that 21% of the Python Standard Library APIs are platform-specific and that 15% of the modules contain at least one. The platforms with the most availability restrictions are WASI (43.69%), Emscripten (43.64%), Unix (6,76%), and Windows (2.12%). Moreover, we find that platform-specific APIs are largely used in Python. We detect over 19K API usages in all 100 projects, in both production (52.6%) and test code (47.4%). We conclude by discussing practical implications for practitioners and researchers.
How Generative AI is Shaping the Future of Software Application DevelopmentMohammedIrfan308637
Generative AI is revolutionizing software development. Find out how it enhances innovation and productivity. https://www.qisacademy.com/blog-detail/the-power-of-generative-ai-in-software-application-development
How to Choose the Right Partner for Outsource Website DevelopmentRollout IT
Choosing the right partner for Outsource Website Development is crucial to ensuring the success of your project. Here are key factors to consider when making this decision.
A result-oriented professional with 10+ years of experience in software delivery, I am an enthusiastic team coach and action-oriented leader. My expertise in Agile processes and Scrum Master role experience of 3+ years has enabled me to successfully lead teams through complex software development cycles using Agile methodologies.
Enhancing Safety Protocols with Permit to Work (PTW) SoftwareCryotosCMMSSoftware
Permit to Work (PTW) software is a digital tool designed to manage the process of issuing, tracking, and closing permits for high-risk work activities. It ensures safety, compliance, and efficiency by standardizing safety protocols, providing real-time visibility into ongoing work, and maintaining comprehensive records for regulatory compliance. PTW software reduces manual errors, enhances communication among teams, and facilitates data-driven decision-making, making workplaces safer and more efficient.
A House In The Rift 0.7.10 b1 (Gallery Unlock, MOD)Apk2me
You can get this game here
Apk2me. Com 👈
About Game
The enthralling visual novel "A House In The Rift" APK takes players on a magical, mysterious, and romantic journey. This game is perfect for mobile devices because it combines interactive storytelling with beautiful visuals and interesting characters. Among visual novels, it stands out for its engaging story and deep character interactions.
Scenario of the Match
As the events of "A House In The Rift" commence, our heroine finds herself abruptly whisked away to a mysterious mansion situated in a rift between dimensions. There are many different magical beings living in the house, and they all have unique histories and personalities. Finding their way around this unfamiliar setting while making new friends and learning the rift's secrets is the protagonist's new challenge. Players' decisions greatly affect the story's trajectory and final result in this dynamic game.
Elements of a Visual Novel
The visual novel aspects of the game are its strongest suit, creating an engrossing story experience. The player has a great deal of say in character conversations, altering the course of events and the relationships between them. Strong prose, interesting plot twists, and fully realized characters. The story progresses thanks to the characters' complex emotions and their interactions, which give weight to every choice.
One defining feature of "A House In The Rift" is the excellent artwork. Beautifully rendered characters and settings breathe life into the game's enchanted world. The story and the audience's emotional investment are both bolstered by the intricate and expressive character designs. The music goes well with the visual presentation, creating an ambiance and setting the mood for various scenes.
How the Game Works
"A House In The Rift" has a number of gameplay mechanics to keep players engaged, although the narrative is the main focus. Activities such as these encompass character management, puzzle solving, and exploration. By venturing into various rooms and areas of the house, players can find hidden treasures and useful objects. A new level of difficulty is introduced by puzzle-solving elements, which demand players to use their critical thinking skills and engage with the world around them.
Another important part of the gameplay is managing your characters. As they interact with the house's residents, players will have to decide how to earn their trust and affection. The story's trajectory and the availability of new scenes and lines of dialogue are both affected by these relationships.
Unlock the Gallery
The ability to unlock galleries is a notable feature of the "A House In The Rift" APK. Unlockable artwork, character profiles, and special scenes become available to players as they advance through the game. As you progress through the story and complete objectives, you'll earn these collectibles as a reward.
🤓 We have compiled the top data breaches and cybersecurity incidents in the first half of 2024, so you don't have to do it...
👁️🗨️ Several high-profile data breaches, along with significant cybersecurity incidents, highlighted the critical need for robust cybersecurity measures in the first half of 2024. For a comprehensive analysis of these challenges and trends, check out SOCRadar's “2024 Mid-Year Cybersecurity Review Report.” Stay informed and prioritize cybersecurity to protect your organization and personal data.
Cloud Databases and Big Data - Mechlin.pptxMitchell Marsh
Cloud databases and big data are revolutionizing how organizations store, manage, and analyze vast amounts of information. Cloud databases offer scalable, flexible, and cost-effective solutions for data storage, allowing businesses to access and manage their data from anywhere with internet connectivity. Big data involves the processing and analysis of extremely large datasets to uncover patterns, trends, and insights that can drive strategic decision-making. Together, these technologies enable companies to harness the power of their data, improve operational efficiency, and gain a competitive edge in the market.
2. About me
• iOS developer since 2010
• Swift since day 1
• Transitioning to Swift
• RayWenderlich.com
• CocoaConf
• Wash U
• Swift 2 Essential Training on lynda.com
• Principal iOS Architect at Care Otter
24. To Swift from Objective-C
NSMutableString *greeting = @"Hello"; var greeting = "Hello"
25. To Swift from Objective-C
NSMutableString *greeting = var greeting = "Hello"
greeting += ", world!"[greeting appendString:@", world!"];
[@"Hello" mutableCopy];
26. To Swift from Objective-C
NSMutableString *greeting = var greeting = "Hello"
[greeting appendString:@", world!"];
[@"Hello" mutableCopy];
greeting = greeting.stringByAppendingString(", world!")
28. To Swift from Objective-C
NSInteger negativeOne = -1;
NSUInteger two = 2; // Int
// Int
let two = 2
let negativeOne = -1
29. To Swift from Objective-C
NSInteger negativeOne = -1;
NSUInteger two = 2; let two: UInt = 2
// Intlet negativeOne = -1
30. To Swift from Objective-C
NSInteger negativeOne = -1;
NSUInteger two = 2; let two = 2 as UInt
// Intlet negativeOne = -1
31. To Swift from Objective-C
NSInteger negativeOne = -1;
NSUInteger two = 2;
// Intlet negativeOne = -1
let two: UInt = 2
let one = negativeOne + twoNSInteger one = negativeOne + two; !
error: ambiguous use of operator '+'
32. To Swift from Objective-C
NSInteger negativeOne = -1;
NSUInteger two = 2;
// Intlet negativeOne = -1
let two: UInt = 2
NSInteger one = negativeOne + two; let one = negativeOne + Int(two)
33. To Swift from Objective-C
NSInteger negativeOne = -1;
NSUInteger two = 2;
// Intlet negativeOne = -1
let two: UInt = 2
NSInteger one = negativeOne + two; let one = negativeOne + Int(two)
let threePointOneFour: Float = 3.14CGFloat threePointOneFour = 3.14;
let π = M_PI // Double, 3.141592653589793
let ! = "What's that smell?"
NSString *greeting = @"Hello!"; let greeting = "Hello!"
let a: Character = "a"char a = 'a';
BOOL thisMuchIs = let thisMuchIs =YES; true
id anyObject = [NSObject new]; let anyObject: AnyObject = NSObject()
let numberOne = NSNumber(integer: 1)
34. To Swift from Objective-C
NSInteger negativeOne = -1;
NSUInteger two = 2;
// Intlet negativeOne = -1
let two: UInt = 2
NSInteger one = negativeOne + two; let one = negativeOne + Int(two)
let threePointOneFour = 3.14 // Doublelet threePointOneFour: Float = 3.14CGFloat threePointOneFour = 3.14;
let π = M_PI // Double, 3.141592653589793
let ! = "What's that smell?"
NSString *greeting = @"Hello!"; let greeting = "Hello!"
let a: Character = "a"char a = 'a';
BOOL thisMuchIs = let thisMuchIs =YES; trueNO;
id anyObject = [NSObject new]; let anyObject: AnyObject = NSObject()
let numberOne = NSNumber(integer: 1)
NSRange range = NSMakeRange(0, 5); let rangeInclusive = 0...5
let rangeExclusive = 0..<5
35. To Swift from Objective-C
NSMutableString *greeting = var greeting = "Hello"
greeting = nilgreeting = nil;
[@"Hello" mutableCopy];
if (greeting) {
// ...
}
!
error: nil cannot be assigned to type 'String'
36. To Swift from Objective-C
NSMutableString *greeting =
greeting = nilgreeting = nil;
[@"Hello" mutableCopy];
if (greeting) {
// ...
}
var greeting: String? = "Hello"
if let greeting = greeting {
// ...
}
greeting?.isEmpty
greeting?.characters.first?.hashValue
var dateOfBirth: NSDate! =
NSDate(timeIntervalSince1970: 20581200)
dateOfBirth.descriptionWithLocale(NSLocale.
currentLocale())
print(greeting!.characters.first!)!
error: unexpectedly found nil while unwrapping an Optional value
37. To Swift from Objective-C
NSMutableString *greeting =
greeting = nil;
[@"Hello" mutableCopy];
if (greeting) {
// ...
}
var greeting: String? = "Hello"
if let greeting = greeting {
// ...
}
greeting?.isEmpty
greeting?.characters.first?.hashValue
var dateOfBirth: NSDate! =
NSDate(timeIntervalSince1970: 20581200)
dateOfBirth.descriptionWithLocale(NSLocale.
currentLocale())
print(greeting!.characters.first!)
//greeting = nil
38. To Swift from Objective-C
let letters = ["A", "B", "C"]NSArray *letters = @[@"A", @"B", @"C"];
39. To Swift from Objective-C
NSArray *letters = @[@"A", @"B", @"C"]; let letters: [String] = ["A", "B", "C"]
40. To Swift from Objective-C
NSArray *letters = @[@"A", @"B", @"C"]; let letters: Array<String> = ["A", "B", "C"]
41. To Swift from Objective-C
NSDictionary *numbers = @{@1 : @"One", @2 :
@"Two", @3 : @"Three"};
NSArray *letters = @[@"A", @"B", @"C"];
let numbers = [1: "One", 2: "Two", 3: "Three"]
let letters = ["A", "B", "C"]
42. To Swift from Objective-C
NSDictionary *numbers = @{@1 : @"One", @2 :
@"Two", @3 : @"Three"};
NSArray *letters = @[@"A", @"B", @"C"]; let letters = ["A", "B", "C"]
let numbers: [Int: String] = [1: "One", 2: "Two",
3: "Three"]
43. To Swift from Objective-C
NSDictionary *numbers = @{@1 : @"One", @2 :
@"Two", @3 : @"Three"};
NSArray *letters = @[@"A", @"B", @"C"]; let letters = ["A", "B", "C"]
let numbers: Dictionary<Int, String> = [1: "One",
2: "Two", 3: "Three"]
44. To Swift from Objective-C
NSDictionary *numbers = @{@1 : @"One", @2 :
@"Two", @3 : @"Three"};
NSSet *uniqueValues = [NSSet setWithArray:@[@1,
@2, @3, @1]];
print(uniqueValues) // [2, 3, 1]
NSArray *letters = @[@"A", @"B", @"C"];
let uniqueValues: Set<Int> = [1, 2, 3, 1]
let letters = ["A", "B", "C"]
let numbers = [1: "One", 2: "Two", 3: "Three"]
let httpResponse: = (200, "OK")
45. To Swift from Objective-C
NSDictionary *numbers = @{@1 : @"One", @2 :
@"Two", @3 : @"Three"};
NSSet *uniqueValues = [NSSet setWithArray:@[@1,
@2, @3, @1]];
print(uniqueValues) // [2, 3, 1]
NSArray *letters = @[@"A", @"B", @"C"];
let uniqueValues: Set<Int> = [1, 2, 3, 1]
let letters = ["A", "B", "C"]
let numbers = [1: "One", 2: "Two", 3: "Three"]
let httpResponse: (Int, String) = (200, "OK")
46. To Swift from Objective-C
NSDictionary *numbers = @{@1 : @"One", @2 :
@"Two", @3 : @"Three"};
NSSet *uniqueValues = [NSSet setWithArray:@[@1,
@2, @3, @1]];
print(uniqueValues) // [2, 3, 1]
NSArray *letters = @[@"A", @"B", @"C"];
let uniqueValues: Set<Int> = [1, 2, 3, 1]
let letters = ["A", "B", "C"]
let numbers = [1: "One", 2: "Two", 3: "Three"]
let httpResponse: (code: Int, text: String) =
(code: 200, text: "OK")
let httpResponseCode = httpResponse.code // 200
let httpResponseText = httpResponse.1 // OK
func getHttpStatus() -> (code: Int, text: String) {
return (200, "OK")
}
47. To Swift from Objective-C
let names = ["Moe", "Larry", "Curly"]
if names.count > 0 {
for name in names {
print(name)
}
}
NSArray *names = @[@"Moe", @"Larry", @"Curly"];
if (names.count > 0) {
for (NSString *name in names) {
NSLog(@"%@", name);
}
}
func printNames() {
guard names.count > 0 else { return }
names.forEach { print($0) }
}
48. To Swift from Objective-C
NSInteger score = arc4random_uniform(101);
switch (score) {
case 100:
// ...
break;
default:
break;
}
let score =
switch score {
default:
break
}
arc4random_uniform(101)
case 99, 100:
print("Top 2%")
fallthrough
case 95...100:
print("Great job!")
case let n where n % 2 == 0:
print(n, "is even")
49. To Swift from Objective-C
NSInteger score = arc4random_uniform(101);
switch (score) {
case 100:
// ...
break;
default:
break;
}
let score =
switch score {
default:
break
}
99
// Prints "Top 2%"
// Prints "Great job!"
case 99, 100:
print("Top 2%")
fallthrough
case 95...100:
print("Great job!")
case let n where n % 2 == 0:
print(n, "is even")
50. To Swift from Objective-C
// In prepareForSegue:sender:…
if let identifier = segue.identifier {
switch (identifier, segue.destinationViewController) {
}
}
case ("ShowControls", is ControlsViewController):
// ...
case ("ShowDetail", is DetailViewController):
// ...
default:
break
51. To Swift from Objective-C
- (void)addThis:(NSInteger)this andThat:(NSInteger)that {
return this + that;
}
52. To Swift from Objective-C
func addThis(this: Int, andThat that: Int) -> Int {
return this + that
}
- (void)addThis:(NSInteger)this andThat:(NSInteger)that {
return this + that;
}
53. To Swift from Objective-C
func addThis(this: Int, andThat that: Int) -> Int {
return this + that
}
- (void)addThis:(NSInteger)this andThat:(NSInteger)that {
return this + that;
}
+ (void)doSomething {
// ...
}
class func doSomething() {
// ...
}
54. To Swift from Objective-C
func addThis(this: Int, andThat that: Int) -> Int {
return this + that
}
- (void)addThis:(NSInteger)this andThat:(NSInteger)that {
return this + that;
}
+ (void)doSomething {
// ...
}
static func doSomething() {
// ...
}
55. To Swift from Objective-C
func addThis(this: Int, andThat that: Int) -> Int {
return this + that
}
- (void)addThis:(NSInteger)this andThat:(NSInteger)that {
return this + that;
}
+ (void)doSomething {
// ...
}
static func doSomething() {
// ...
}
56. To Swift from Objective-C
func addThis(this: Int, andThat that: Int) -> Int {
return this + that
}
- (void)addThis:(NSInteger)this andThat:(NSInteger)that {
return this + that;
}
+ (void)doSomething {
// ...
}
static func doSomething() -> Void {
// ...
}
57. To Swift from Objective-C
func addThis(this: Int, andThat that: Int) -> Int {
return this + that
}
- (void)addThis:(NSInteger)this andThat:(NSInteger)that {
return this + that;
}
+ (void)doSomething {
// ...
}
static func doSomething() {
// ...
}
addThis(1, andThat: 2)
func addThisAndThat(this: Int, _ that: Int) -> Int {
return this + that
}
addThisAndThat(1, 2)
58. To Swift from Objective-C
class SomeClass: NSObject {// SomeClass.h
#import <Foundation/Foundation.h>
@interface SomeClass : NSObject
@property (copy, nonatomic) NSString *title;
- (instancetype)initWithTitle:(NSString *)title;
@end
// SomeClass.m
#import "SomeClass.h"
@implementation SomeClass
- (instancetype)initWithTitle:(NSString *)title {
if (self = [super init]) {
self.title = title;
return self;
}
return nil;
}
@end
let title: String
init(title: String) {
self.title = title
}
}
59. To Swift from Objective-C
class SomeClass: NSObject {// SomeClass.h
#import <Foundation/Foundation.h>
@interface SomeClass : NSObject
@property (copy, nonatomic) NSString *title;
- (instancetype)initWithTitle:(NSString *)title;
@end
// SomeClass.m
#import "SomeClass.h"
@implementation SomeClass
- (instancetype)initWithTitle:(NSString *)title {
if (self = [super init]) {
self.title = title;
return self;
}
return nil;
}
@end
let title: String
init(title: String) {
self.title = title
}
}
60. To Swift from Objective-C
class SomeClass: NSObject {// SomeClass.h
#import <Foundation/Foundation.h>
@interface SomeClass : NSObject
@property (copy, nonatomic) NSString *title;
- (instancetype)initWithTitle:(NSString *)title;
@end
// SomeClass.m
#import "SomeClass.h"
@implementation SomeClass
- (instancetype)initWithTitle:(NSString *)title {
if (self = [super init]) {
self.title = title;
return self;
}
return nil;
}
@end
static var aStaticValue = 1
let title: String
init(title: String) {
self.title = title
}
}
61. To Swift from Objective-C
// SomeClass.h
#import <Foundation/Foundation.h>
@interface SomeClass : NSObject
@property (copy, nonatomic) NSString *title;
- (instancetype)initWithTitle:(NSString *)title;
@end
// SomeClass.m
#import "SomeClass.h"
@implementation SomeClass
- (instancetype)initWithTitle:(NSString *)title {
if (self = [super init]) {
self.title = title;
return self;
}
return nil;
}
@end
class SomeClass: NSObject {
static var aStaticValue = 1
let title: String
init(theTitle: String) {
title = theTitle
}
}
62. To Swift from Objective-C
// SomeClass.h
#import <Foundation/Foundation.h>
@interface SomeClass : NSObject
@property (copy, nonatomic) NSString *title;
- (instancetype)initWithTitle:(NSString *)title;
@end
// SomeClass.m
#import "SomeClass.h"
@implementation SomeClass
- (instancetype)initWithTitle:(NSString *)title {
if (self = [super init]) {
self.title = title;
return self;
}
return nil;
}
@end
class SomeClass: NSObject {
static var aStaticValue = 1
let title: String
init(title: String) {
self.title = title
}
}
63. To Swift from Objective-C
SomeClass *someClass = [[SomeClass alloc]
initWithTitle:@"A Mighty Instance"];
64. To Swift from Objective-C
let someClass = SomeClass(title: "A Mighty Title")SomeClass *someClass = [SomeClass new];
someClass.title = @"A Mighty Instance";
65. To Swift from Objective-C
SomeClass *someClass = [SomeClass new];
someClass.title = @"A Mighty Instance";
let someClass = SomeClass()
error: missing argument for parameter 'title' in call
!
66. To Swift from Objective-C
// SomeClass.h
#import <Foundation/Foundation.h>
@interface SomeClass : NSObject
@property (copy, nonatomic) NSString *title;
- (instancetype)initWithTitle:(NSString *)title;
@end
// SomeClass.m
#import "SomeClass.h"
@implementation SomeClass
- (instancetype)initWithTitle:(NSString *)title {
if (self = [super init]) {
self.title = title;
return self;
}
return nil;
}
@end
class SomeClass: NSObject {
static var aStaticValue = 1
let title: String
init(title: String) {
self.title = title
super.init()
}
}
67. To Swift from Objective-C
// SomeClass.h
#import <Foundation/Foundation.h>
@interface SomeClass : NSObject
@property (copy, nonatomic) NSString *title;
- (instancetype)initWithTitle:(NSString *)title;
@end
// SomeClass.m
#import "SomeClass.h"
@implementation SomeClass
- (instancetype)initWithTitle:(NSString *)title {
if (self = [super init]) {
self.title = title;
return self;
}
return nil;
}
@end
class SomeClass: NSObject {
static var aStaticValue = 1
let title: String
init(title: String) {
super.init()
self.title = title
}
}
!
error: property 'self.title' not initialized at super.init call
68. To Swift from Objective-C
// SomeClass.h
#import <Foundation/Foundation.h>
@interface SomeClass : NSObject
@property (copy, nonatomic) NSString *title;
- (instancetype)initWithTitle:(NSString *)title;
@end
// SomeClass.m
#import "SomeClass.h"
@implementation SomeClass
- (instancetype)initWithTitle:(NSString *)title {
if (self = [super init]) {
self.title = title;
return self;
}
return nil;
}
@end
class SomeClass: NSObject {
static var aStaticValue = 1
?
}
var title: String
69. To Swift from Objective-C
class SomeClass
static var aStaticValue = 1
var title: String
}
// SomeClass.h
#import <Foundation/Foundation.h>
@interface SomeClass : NSObject
@property (copy, nonatomic) NSString *title;
- (instancetype)initWithTitle:(NSString *)title;
@end
// SomeClass.m
#import "SomeClass.h"
@implementation SomeClass
- (instancetype)initWithTitle:(NSString *)title {
if (self = [super init]) {
self.title = title;
return self;
}
return nil;
}
@end
{
?
70. To Swift from Objective-C
Properties
Methods
Subscripts
Initializers
Extensions
Adopt Protocols
Class
✓
✓
✓
✓
✓
✓
Structure
✓
✓
✓
✓
✓
✓
Enumeration
✓
✓
✓
✓
✓
✓
71. To Swift from Objective-C
struct Coordinate {
CGFloat x;
CGFloat y;
CGFloat z;
};
struct Coordinate {
var x: CGFloat
var y: CGFloat
var z: CGFloat
}
72. To Swift from Objective-C
struct Coordinate {
var x: CGFloat
var y: CGFloat
var z: CGFloat
}
struct Coordinate {
CGFloat x;
CGFloat y;
CGFloat z;
NSString *title;
};
!
error: ARC forbids Objective-C objects in struct
73. To Swift from Objective-C
struct Coordinate {
var x: CGFloat
var y: CGFloat
var z: CGFloat
var title: String
}
struct Coordinate {
CGFloat x;
CGFloat y;
CGFloat z;
// NSString *title;
};
74. To Swift from Objective-C
let coordinate = Coordinate(x: 0.0, y: 0.0, z:
0.0, title: "Origin")
struct Coordinate {
var x: CGFloat
var y: CGFloat
var z: CGFloat
var title: String
}
struct Coordinate {
CGFloat x;
CGFloat y;
CGFloat z;
// NSString *title;
};
struct Coordinate coordinate = {10.0, 10.0, 10.0};
75. To Swift from Objective-C
let coordinate = Coordinate(x: 0.0, y: 0.0, z:
0.0, title: "Origin")
enum Heading: Int {
case North, South, East, West
}
struct Coordinate {
var x: CGFloat
var y: CGFloat
var z: CGFloat
var title: String
}
struct Coordinate {
CGFloat x;
CGFloat y;
CGFloat z;
// NSString *title;
};
struct Coordinate coordinate = {10.0, 10.0, 10.0};
typedef NS_ENUM(NSInteger, Heading) {
HeadingNorth,
HeadingEast,
HeadingSouth,
HeadingWest
};
76. To Swift from Objective-C
let coordinate = Coordinate(x: 0.0, y: 0.0, z:
0.0, title: "Origin")
struct Coordinate {
var x: CGFloat
var y: CGFloat
var z: CGFloat
var title: String
}
struct Coordinate {
CGFloat x;
CGFloat y;
CGFloat z;
// NSString *title;
};
struct Coordinate coordinate = {10.0, 10.0, 10.0};
typedef NS_ENUM(NSInteger, Heading) {
HeadingNorth,
HeadingEast,
HeadingSouth,
HeadingWest
};
enum Heading {
case North, South, East, West
}
77. To Swift from Objective-C
let coordinate = Coordinate(x: 0.0, y: 0.0, z:
0.0, title: "Origin")
let movement = Movement.North(distance: 20.0)
struct Coordinate {
var x: CGFloat
var y: CGFloat
var z: CGFloat
var title: String
}
struct Coordinate {
CGFloat x;
CGFloat y;
CGFloat z;
// NSString *title;
};
struct Coordinate coordinate = {10.0, 10.0, 10.0};
typedef NS_ENUM(NSInteger, Heading) {
HeadingNorth,
HeadingEast,
HeadingSouth,
HeadingWest
};
enum Heading {
case North, South, East, West
}
enum Movement {
case North(distance: Double)
case South(distance: Double)
case East(distance: Double)
case West(distance: Double)
}
78. To Swift from Objective-C
- (NSString *)fullName {
return [NSString stringWithFormat:@"%@ %@",
self.firstName, self.lastName];
}
- (void)setTitle:(NSString *)title {
NSLog(@"Old title: %@", _title);
_title = title;
}
struct Person {
let firstName: String
let lastName: String
}
var fullName: String {
return "(firstName) (lastName)"
}
var title: String {
didSet {
print("Old title: " + oldValue)
}
}
80. To Swift from Objective-C
@IBDesignable class DesignableView: UIView { }
extension UIView {
@IBInspectable var borderWidth: CGFloat {
get {
return layer.borderWidth
}
set {
layer.borderWidth = newValue
}
}
@IBInspectable var borderColor: UIColor? {
get {
return layer.borderColor != nil ?
UIColor(CGColor: layer.borderColor!) : nil
}
set {
layer.borderColor = newValue?.CGColor
}
}
@IBInspectable var cornerRadius: CGFloat {
get {
return layer.cornerRadius
}
set {
layer.masksToBounds = newValue != 0
layer.cornerRadius = newValue
}
}
}
81. To Swift from Objective-C
UIView.animateWithDuration(1.0, animations: {
// ...
}, completion: {
print("Done!")
})
[UIView animateWithDuration:1.0 animations:^{
// ...
} completion:^(BOOL finished) {
NSLog(@"Done!");
}];
(finished: Bool) in
82. To Swift from Objective-C
UIView.animateWithDuration(1.0, animations: {
// ...
}, completion: {
print("Done!")
})
[UIView animateWithDuration:1.0 animations:^{
// ...
} completion:^(BOOL finished) {
NSLog(@"Done!");
}];
finished in
83. To Swift from Objective-C
UIView.animateWithDuration(1.0, animations: {
// ...
}, completion: {
print("Done!")
})
[UIView animateWithDuration:1.0 animations:^{
// ...
} completion:^(BOOL finished) {
NSLog(@"Done!");
}];
UIView.animateWithDuration(1.0, animations: {
// ...
}) { _ in
print("Done!")
}
finished in
84. To Swift from Objective-C
UIView.animateWithDuration(1.0, animations: {
// ...
}, completion: {
print("Done!")
})
[UIView animateWithDuration:1.0 animations:^{
// ...
} completion:^(BOOL finished) {
NSLog(@"Done!");
}];
UIView.animateWithDuration(1.0, animations: {
// ...
}) { _ in
print("Done!")
}
var fileContents = {
// Some complex work
return "..."
}()
finished in
85. To Swift from Objective-C
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
let queue = dispatch_get_global_queue(
DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
dispatch_queue_t queue = dispatch_get_global_queue(
DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
__weak ViewController *weakSelf = self;
dispatch_async(queue, ^{
__strong ViewController *strongSelf = weakSelf;
if (!strongSelf) {
return;
}
[strongSelf // ...
});
}
dispatch_async(queue) { [unowned self] in
self.//...
}
}
86. To Swift from Objective-C
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
let queue = dispatch_get_global_queue(
DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
dispatch_queue_t queue = dispatch_get_global_queue(
DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
__weak ViewController *weakSelf = self;
dispatch_async(queue, ^{
__strong ViewController *strongSelf = weakSelf;
if (!strongSelf) {
return;
}
[strongSelf // ...
});
}
dispatch_async(queue) { [weak self] in
if let strongSelf = self {
strongSelf.//...
}
}
}
87. To Swift from Objective-C
protocol HasTitle {
var title: String { get set }
func printTitle()
}
@protocol HasTitle <NSObject>
@property (copy, nonatomic) NSString *title;
- (void)printTitle;
@end
88. To Swift from Objective-C
protocol HasTitle {
var title: String { get set }
func printTitle()
}
@protocol HasTitle <NSObject>
@property (copy, nonatomic) NSString *title;
- (void)printTitle;
@end
struct Book: HasTitle {
var title: String
var pages: Int
func printTitle() {
print("Title: (title) ((pages) pages)")
}
}
struct DVD: HasTitle {
var title: String
var length: Int
func printTitle() {
print("Title: (title) ((length) minutes)")
}
}
89. To Swift from Objective-C
let book = Book(title: "It", pages: 1104)
let dvd = DVD(title: "It", length: 187)
let myCollection: [HasTitle] = [book, dvd]
for item in myCollection {
item.printTitle()
}
// Title: It (1104 pages)
// Title: It (187 minutes)
struct Book: HasTitle {
var title: String
var pages: Int
func printTitle() {
print("Title: (title) ((pages) pages)")
}
}
struct DVD: HasTitle {
var title: String
var length: Int
func printTitle() {
print("Title: (title) ((length) minutes)")
}
}
90. To Swift from Objective-C
let book = Book(title: "It", pages: 1104)
let dvd = DVD(title: "It", length: 187)
let myCollection: [HasTitle] = [book, dvd]
for item in myCollection {
item.printTitle()
}
91. To Swift from Objective-C
let book = Book(title: "It", pages: 1104)
let dvd = DVD(title: "It", length: 187)
let myCollection: [HasTitle] = [book, dvd]
for item in myCollection {
item.printTitle()
switch item {
case is Book:
print("has", (item as! Book).pages, "pages")
case is DVD:
print("is", (item as! DVD).length, "minutes")
default:
break
}
}
92. To Swift from Objective-C
let book = Book(title: "It", pages: 1104)
let dvd = DVD(title: "It", length: 187)
let myCollection: [HasTitle] = [book, dvd]
for item in myCollection {
item.printTitle()
if let book = item as? Book {
print("has", book.pages, "pages")
}
if let dvd = item as? DVD {
print("is", dvd.length, "minutes")
}
}
93. To Swift from Objective-C
struct Array<Element> // ...
struct Dictionary<Key: Hashable, Value> // ...
struct Set<Element: Hashable> // ...
94. To Swift from Objective-C
struct Array<Element> // ...
struct Dictionary<Key: Hashable, Value> // ...
struct Set<Element: Hashable> // ...
struct ItemHolder<T> {
var items: [T]
func randomItem() -> T {
let index = Int(arc4random_uniform(UInt32(items.count)))
return items[index]
}
}
95. To Swift from Objective-C
let numberHolder = ItemHolder(items: [1, 2, 3])
let objectA = SomeClass(title: "A")
let objectB = SomeClass(title: "B")
let objectC = SomeClass(title: "C")
let objectHolder = ItemHolder(items: [objectA, objectB, objectC])
numberHolder.randomItem() // 2
stringHolder.randomItem() // Neil
objectHolder.randomItem().title // A
func randomItemFromArray<T>(items: [T]) -> T {
let index = Int(arc4random_uniform(UInt32(items.count)))
return items[index]
}
let stringHolder = ItemHolder(items: ["Neil", "Geddy", “Alex"])
96. To Swift from Objective-C
• Access control
• Scopes
• Module
• File
• Levels
• Public
• Internal
• Private
97. To Swift from Objective-C
• Access control
• Public
• Highest level of accessibility
• Good for framework API
• Code available throughout defining module
• Available to other modules via import
98. To Swift from Objective-C
• Access control
• Internal
• Default for projects
• Code available throughout defining module
• Cannot be imported
99. To Swift from Objective-C
• Access control
• Private
• Default for playgrounds
• Code available only in defining source file
• Cannot be imported
116. To Swift 2
let someCondition = true
func doSomething() {
if someCondition {
print("Success")
}
}
117. To Swift 2
let someCondition = true
func doSomething() {
guard someCondition else {
return
}
print("Success")
}
118. To Swift 2
let someCondition = true
func doSomething() {
guard someCondition else {
return
}
print("Success")
}
func getBirthdayFromDate(date: NSDate?) -> String {
guard let date = date else {
return ""
}
return date.descriptionWithLocale(NSLocale.currentLocale())
}
119. To Swift 2
let someCondition = true
func doSomething() {
guard someCondition else {
return
}
print("Success")
}
func getBirthdayFromDate(date: NSDate?) -> String {
defer {
print("This will always print")
}
guard let date = date else {
return nil
}
return date.descriptionWithLocale(NSLocale.currentLocale())
}
print(getBirthdayFromDate(nil))
// This will always print
//
120. To Swift 2
let someCondition = true
func doSomething() {
guard someCondition else {
return
}
print("Success")
}
func getBirthdayFromDate(date: NSDate?) -> String {
defer {
print("This will always print")
}
guard let date = date else {
return nil
}
return date.descriptionWithLocale(NSLocale.currentLocale())
}
print(getBirthdayFromDate(NSDate(timeIntervalSince1970: 20581200)))
// This will always print
// Thursday, August 27, 1970 at 12:00:00 AM Central Daylight Time
121. To Swift 2
enum Error: ErrorType {
case A
case B(code: UInt32, function: String)
}
122. To Swift 2
enum Error: ErrorType {
case A
case B(code: UInt32, function: String)
}
func testErrorHandling() throws {
}
guard simulatedErrorA == false else {
throw Error.A
}
guard simulatedErrorB == false else {
let code = arc4random_uniform(10)
throw Error.B(code: code, function: __FUNCTION__)
}
let simulatedErrorA = true
let simulatedErrorB = true
123. To Swift 2
enum Error: ErrorType {
case A
case B(code: UInt32, function: String)
}
func testErrorHandling() throws {
}
guard simulatedErrorA == false else {
throw Error.A
}
guard simulatedErrorB == false else {
let code = arc4random_uniform(10)
throw Error.B(code: code, function: __FUNCTION__)
}
do {
} catch {
}
let simulatedErrorA = true
let simulatedErrorB = true
124. To Swift 2
enum Error: ErrorType {
case A
case B(code: UInt32, function: String)
}
func testErrorHandling() throws {
}
guard simulatedErrorA == false else {
throw Error.A
}
guard simulatedErrorB == false else {
let code = arc4random_uniform(10)
throw Error.B(code: code, function: __FUNCTION__)
}
do {
}
print("Success!")
try testErrorHandling()
print("Uh oh:", error)
catch {
}
let simulatedErrorA = true
let simulatedErrorB = true
125. To Swift 2
enum Error: ErrorType {
case A
case B(code: UInt32, function: String)
}
func testErrorHandling() throws {
}
guard simulatedErrorA == false else {
throw Error.A
}
guard simulatedErrorB == false else {
let code = arc4random_uniform(10)
throw Error.B(code: code, function: __FUNCTION__)
}
do {
}
print("Success!")
try testErrorHandling()
catch Error.A {
print("Error A occurred")
}
let simulatedErrorA = true
let simulatedErrorB = true
126. To Swift 2
enum Error: ErrorType {
case A
case B(code: UInt32, function: String)
}
func testErrorHandling() throws {
}
guard simulatedErrorA == false else {
throw Error.A
}
guard simulatedErrorB == false else {
let code = arc4random_uniform(10)
throw Error.B(code: code, function: __FUNCTION__)
}
do {
}
print("Success!")
try testErrorHandling()
catch Error.A {
print("Error A occurred")
} catch let Error.B(code, function) {
print("Code:", code, "Function:", function)
}
let simulatedErrorA = true
let simulatedErrorB = true
127. To Swift 2
enum Error: ErrorType {
case A
case B(code: UInt32, function: String)
}
func testErrorHandling() throws {
}
guard simulatedErrorA == false else {
throw Error.A
}
guard simulatedErrorB == false else {
let code = arc4random_uniform(10)
throw Error.B(code: code, function: __FUNCTION__)
}
do {
}
print("Success!")
try testErrorHandling()
catch let Error.B(code, function) where code > 4 {
print("Code:", code, "Function:", function)
} catch {
print("Uh oh!")
}
catch Error.A {
print("Error A occurred")
}
let simulatedErrorA = true
let simulatedErrorB = true
128. To Swift 2
enum Error: ErrorType {
case A
case B(code: UInt32, function: String)
}
func testErrorHandling() throws {
}
guard simulatedErrorA == false else {
throw Error.A
}
guard simulatedErrorB == false else {
let code = arc4random_uniform(10)
throw Error.B(code: code, function: __FUNCTION__)
}
do {
}
print("Success!")
try testErrorHandling()
catch let Error.B(code, function) where code > 4 {
print("Code:", code, "Function:", function)
} catch {
print("Uh oh!")
}
catch Error.A {
print("Error A occurred")
}
try! testErrorHandling()
let simulatedErrorA = false
let simulatedErrorB = false
129. To Swift 2
enum Error: ErrorType {
case A
case B(code: UInt32, function: String)
}
func testErrorHandling() throws -> String {
guard simulatedErrorA == false else {
throw Error.A
}
return "Success"
}
do {
let success = try testErrorHandling()
print(success)
} catch {
print("Uh oh!")
}
if let success = try? testErrorHandling() {
// ...
}
let simulatedErrorA = false
let simulatedErrorB = false
130. To Swift 2
enum Error: ErrorType {
case A
case B(code: UInt32, function: String)
}
func testErrorHandling() throws -> String {
guard simulatedErrorA == false else {
throw Error.A
}
return "Success"
}
func performActionThatMightFail() {
do {
try testErrorHandling()
} catch {
print("Uh oh!")
}
}
let simulatedErrorA = false
let simulatedErrorB = false
131. To Swift 2
enum Error: ErrorType {
case A
case B(code: UInt32, function: String)
}
func testErrorHandling() throws -> String {
guard simulatedErrorA == false else {
throw Error.A
}
return "Success"
}
let simulatedErrorA = false
let simulatedErrorB = false
func performActionThatMightFail() throws {
try testErrorHandling()
}
do {
try performActionThatMightFail()
} catch {
// ...
}
135. To Swift 2
UIView.animateWithDuration(1.0, delay: 0.0, options: [.CurveEaseInOut, .Autoreverse], animations: { () -> Void in
// ...
}, completion: nil)
UIView.animateWithDuration(1.0, delay: 0.0, options: [], animations: { () -> Void in
// ...
}, completion: nil)
136. To Swift 2
struct OptionSet: OptionSetType {
}
static let A = OptionSet(rawValue: 1 << 0)
static let B = OptionSet(rawValue: 1 << 1)
static let C = OptionSet(rawValue: 1 << 2)
let rawValue: Int
init(rawValue: Int) {
self.rawValue = rawValue
}
let options: OptionSet = [.A, .B, .C]
if options.contains(.A) {
// ...
}
137. To Swift 2
struct OptionSet: OptionSetType {
}
static let A = OptionSet(rawValue: 1 << 0)
static let B = OptionSet(rawValue: 1 << 1)
static let C = OptionSet(rawValue: 1 << 2)
let rawValue: Int
init(rawValue: Int) {
self.rawValue = rawValue
}
let options: OptionSet = [.A, .B, .C]
if options.contains([.A]) {
// ...
}
138. To Swift 2
struct OptionSet: OptionSetType {
}
static let A = OptionSet(rawValue: 1 << 0)
static let B = OptionSet(rawValue: 1 << 1)
static let C = OptionSet(rawValue: 1 << 2)
let rawValue: Int
init(rawValue: Int) {
self.rawValue = rawValue
}
let options: OptionSet = [.A, .B, .C]
if options.contains([.A, .B]) {
// ...
}
139. To Swift 2
protocol Vehicular {
var passengerCapacity: Int { get }
}
extension Vehicular {
var passengerCapacity: Int {
return 4
}
}
protocol Drivable {
func adjustSpeedToMph(mph: Int)
}
extension Drivable {
func adjustSpeedToMph(mph: Int) {
print("Now traveling at (mph) mph")
}
}
struct Sedan: Vehicular, Drivable { }
let sedan = Sedan()
sedan.passengerCapacity // 4
sedan.adjustSpeedToMph(75) // Now traveling at 75 mph
140. To Swift 2
extension RawRepresentable where RawValue: IntegerType {
}
public protocol RawRepresentable {
typealias RawValue
public init?(rawValue: Self.RawValue)
public var rawValue: Self.RawValue { get }
}