This deck was used to conduct a hands-on workshop at Mumbai Tech Meetup. It covers an introduction to Go, core language features, Object Oriented features of Go, Concurrency, API Servers and more.
Introduction to go language programming , benchmark with another language programming nodejs , php , ruby & python . how install go . use what IDE . and rapid learnin golang
- Go is a programming language created at Google. It is fast, statically typed, and has garbage collection.
- The tutorial covers Go's history, why it was created, library support, and provides examples of variables, functions, flow control, methods, interfaces, and goroutines.
- The document includes an outline, code examples throughout to demonstrate the concepts, and references additional resources for learning Go.
Go was created at Google to address needs for efficient large-scale programming, fast compilation, distributed systems, multicore hardware, and networked computing. It is a concurrent and garbage-collected systems programming language. A simple web server can be written in Go with just a few lines of code. Go uses communicating sequential processes as its concurrency model and has interfaces but no inheritance. Concurrency is achieved through communicating rather than sharing memory. Parallelism is easy to implement using goroutines, channels, locks, or the once package.
This document provides an overview of the Go programming language. It discusses that Go was initially developed at Google in 2007 and is now an open source language used by many companies. The document then covers Why Go is useful, including its memory management, concurrency support, and cross-platform capabilities. It also summarizes some of Go's basic syntax like packages, functions, variables, types, and control structures. Finally, it discusses some key Go concepts like methods, interfaces, channels, and the net/http package.
This document provides an introduction to the Go programming language. It discusses Go's history, syntax, types, control structures, functions, interfaces, concurrency features using goroutines and channels, and some examples. Key points are that Go was created at Google in 2007 for ease of programming, type safety, memory safety, and concurrency. It has similarities to C syntax but is garbage collected and uses channels for communicating between goroutines.
Go is an open source programming language designed by Google to be concurrent, garbage collected, and efficient. It has a simple syntax and is used by Google and others to build large distributed systems. Key features include garbage collection, concurrency with goroutines and channels, interfaces without inheritance, and a large standard library.
The document discusses the Java Virtual Machine (JVM) and its key components. It explains that the JVM is a virtual computing environment that executes Java bytecode. The bytecode is executed by the JVM using an operand stack. The document also discusses how objects and classes are represented in memory, including details on object headers, class file formats, and the classloading process. It concludes by mentioning the jdb debugging tool for debugging Java programs without an IDE.
New language from Google, static safe compiler, with GC and as fast as C++ or Java, syntax simpler then Python - 2 hour-long tutorial and you can start code.
In this talk Serhii will talk about Go, also known as Golang – an open source language developed at Google and used in production by companies such as Docker, Dropbox, Facebook and Google itself. Go is now heavily used as a general-purpose programming language that’s a pleasure to use and maintain. This introductory talk contains many live demos of basic language concepts, concurrency model, simple HTTP-based endpoint implementation and, of course, tests using build-in framework. This presentation will be interesting for backend engineers and DevOps to understand why Go had become so popular and how it might help to build robust and maintanable services.
Agenda of the presentation:
1. Go is not C, not Java, not anything
2. Rob Pike argument
3. Main ideas and basics
4. Concurrency model
5. Tools
6. Issues
GoLang is an open source programming language created by Google in 2009. It has a large community and was designed for scalability and concurrency. Some key features include being statically typed, compiled, and having built-in support for concurrency through goroutines and channels. Google uses GoLang extensively to build systems that scale to thousands of machines.
These are the slides for the seminar to have a basic overview on the GO Language, By Alessandro Sanino.
They were used on a Lesson in University of Turin (Computer Science Department) 11-06-2018
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija SiskoTrivadis
Go is a programming language created at Google in 2007 as a replacement for C and C++. It is a compiled language that produces native executables and emphasizes simplicity, readability, and concurrency. Key features include a fast compiler, static typing, interfaces, garbage collection, built-in concurrency with goroutines and channels, and a simple package and testing system. Go is used by many large tech companies and is well-suited for building scalable cloud applications.
Go is an exciting new programming language developed at Google that focuses on high performance and easing the developer experience. It has many advantages over other languages like C++ such as having a simple, quick to learn syntax, extremely fast compiler and execution speeds, powerful standard library, easy concurrency with goroutines and channels, and implicit interfaces. While still missing some features like a full IDE, Go shows great promise for building scalable server side applications and performing data processing.
Python is a great programming language. It is a complete tutorial of using this programming language.
This slides is split into two parts, and it is the second part. Another part is at: http://www.slideshare.net/moskytw/programming-with-python-basic.
Learn python in easy steps. This presentation will cover followings
1. Python basics
2. How to write a python code
3. Variable usage & their syntax
4. Strings handling
5. Files handling
6. How to use loops and others.
7. Python Vs C language.
Python was developed by Guido van Rossum and named after the BBC show Monty Python's Flying Circus. It is an interpreted, interactive, and object-oriented programming language that allows developers to write code in fewer lines compared to other languages. Python code is highly readable due to its use of indentation instead of brackets and its support for modular programming.
The document provides an overview of the Python programming language. It discusses that Python is an easy to learn, high-level, open-source programming language. It describes Python's design philosophy of code readability and how it allows programmers to express concepts in fewer lines of code compared to languages like C++ and Java. The document also discusses Python's powerful libraries, wide use across industries, and how to get started with Python programming using the IDLE integrated development environment.
OpenGurukul : Language : C++ ProgrammingOpen Gurukul
This document provides information about C++ classes and objects. It defines what a class is, noting that classes are like structures but with additional features such as data hiding and default private access. An object is defined as an instance of a class. The document discusses access specifiers like public, private, and protected. It also covers static variables and functions, constant functions, and friend functions/classes.
EuroPython 2016 - Do I Need To Switch To GolangMax Tepkeev
Nowadays, there is a lot of buzz about Go. It happened so that for the last 6 months I’ve been mostly programming Go, and frankly speaking I fell in love with this language.
We’ll first do a quick review of the language. Go doesn’t have some language constructs, for example classes and exceptions and at first it may seem hard to write proper Go code, but in practice the language is so easy that I will try to teach you the basics and most important concepts of the language. We’ll further discuss differences and similarities in Go and Python and dive into the cool features of Go.
Finally we’ll talk about why popularity of Go is raising so fast and try to answer the most important question: Do I need to switch to Go ?
Python is an interpreted, open source programming language that is simple, powerful, and preinstalled on many systems. It has less syntax than other languages and a plethora of penetration testing tools have already been created in Python. Python code is translated and executed by an interpreter one statement at a time, allowing it to be run from the command prompt, through command prompt files, or in an integrated development environment. The language uses whitespace and comments to make code more readable. It can perform basic operations like printing, taking user input, performing conditionals and loops, defining reusable functions, and importing additional modules.
Clime is a Python library which lets you convert any module into a multi-command CLI program without any configuration.
It is a short tour of Clime.
The full documentation of Clime: http://clime.mosky.tw/.
The document provides an introduction to the Go programming language. It discusses the history and creators of Go, versions of Go released, key words used in Go, types of operators, and provides examples of basic Go programs for Hello World, values, variables, for loops, if/else statements, switch statements, arrays, slices, functions, multiple return values, pointers, and conclusions. It also includes references at the end.
This document is an introduction to an interactive tutorial on Python idioms and techniques by David Goodger. It discusses Goodger's background and credentials in Python programming. It also provides an overview of topics that will be covered, including Python coding style, whitespace, naming conventions, strings, and comments. The goal is to teach experienced techniques to make code more Pythonic and idiomatic.
Python is a general purpose programming language created by Guido van Rossum in 1991. It is widely used by companies like Google, Facebook, and Dropbox for tasks like web development, data analysis, and machine learning. Python code is easy to read and write for beginners due to its simple syntax and readability. It supports features like object oriented programming, procedural programming, and functional programming.
The document provides an introduction to programming with Python. It discusses key concepts like code, syntax, output, and consoles. It also covers compiling vs interpreting languages, with Python being an interpreted language. The document explains expressions, variables, basic math operations, and functions in Python like print and input. It introduces control structures like if/else statements, for loops, and while loops. It also covers different data types in Python including numbers, strings, lists, and dictionaries.
The document discusses the Java Virtual Machine (JVM) and its key components. It explains that the JVM is a virtual computing environment that executes Java bytecode. The bytecode is executed by the JVM using an operand stack. The document also discusses how objects and classes are represented in memory, including details on object headers, class file formats, and the classloading process. It concludes by mentioning the jdb debugging tool for debugging Java programs without an IDE.
New language from Google, static safe compiler, with GC and as fast as C++ or Java, syntax simpler then Python - 2 hour-long tutorial and you can start code.
In this talk Serhii will talk about Go, also known as Golang – an open source language developed at Google and used in production by companies such as Docker, Dropbox, Facebook and Google itself. Go is now heavily used as a general-purpose programming language that’s a pleasure to use and maintain. This introductory talk contains many live demos of basic language concepts, concurrency model, simple HTTP-based endpoint implementation and, of course, tests using build-in framework. This presentation will be interesting for backend engineers and DevOps to understand why Go had become so popular and how it might help to build robust and maintanable services.
Agenda of the presentation:
1. Go is not C, not Java, not anything
2. Rob Pike argument
3. Main ideas and basics
4. Concurrency model
5. Tools
6. Issues
GoLang is an open source programming language created by Google in 2009. It has a large community and was designed for scalability and concurrency. Some key features include being statically typed, compiled, and having built-in support for concurrency through goroutines and channels. Google uses GoLang extensively to build systems that scale to thousands of machines.
These are the slides for the seminar to have a basic overview on the GO Language, By Alessandro Sanino.
They were used on a Lesson in University of Turin (Computer Science Department) 11-06-2018
Trivadis TechEvent 2016 Go - The Cloud Programming Language by Andija SiskoTrivadis
Go is a programming language created at Google in 2007 as a replacement for C and C++. It is a compiled language that produces native executables and emphasizes simplicity, readability, and concurrency. Key features include a fast compiler, static typing, interfaces, garbage collection, built-in concurrency with goroutines and channels, and a simple package and testing system. Go is used by many large tech companies and is well-suited for building scalable cloud applications.
Go is an exciting new programming language developed at Google that focuses on high performance and easing the developer experience. It has many advantages over other languages like C++ such as having a simple, quick to learn syntax, extremely fast compiler and execution speeds, powerful standard library, easy concurrency with goroutines and channels, and implicit interfaces. While still missing some features like a full IDE, Go shows great promise for building scalable server side applications and performing data processing.
Python is a great programming language. It is a complete tutorial of using this programming language.
This slides is split into two parts, and it is the second part. Another part is at: http://www.slideshare.net/moskytw/programming-with-python-basic.
Learn python in easy steps. This presentation will cover followings
1. Python basics
2. How to write a python code
3. Variable usage & their syntax
4. Strings handling
5. Files handling
6. How to use loops and others.
7. Python Vs C language.
Python was developed by Guido van Rossum and named after the BBC show Monty Python's Flying Circus. It is an interpreted, interactive, and object-oriented programming language that allows developers to write code in fewer lines compared to other languages. Python code is highly readable due to its use of indentation instead of brackets and its support for modular programming.
The document provides an overview of the Python programming language. It discusses that Python is an easy to learn, high-level, open-source programming language. It describes Python's design philosophy of code readability and how it allows programmers to express concepts in fewer lines of code compared to languages like C++ and Java. The document also discusses Python's powerful libraries, wide use across industries, and how to get started with Python programming using the IDLE integrated development environment.
OpenGurukul : Language : C++ ProgrammingOpen Gurukul
This document provides information about C++ classes and objects. It defines what a class is, noting that classes are like structures but with additional features such as data hiding and default private access. An object is defined as an instance of a class. The document discusses access specifiers like public, private, and protected. It also covers static variables and functions, constant functions, and friend functions/classes.
EuroPython 2016 - Do I Need To Switch To GolangMax Tepkeev
Nowadays, there is a lot of buzz about Go. It happened so that for the last 6 months I’ve been mostly programming Go, and frankly speaking I fell in love with this language.
We’ll first do a quick review of the language. Go doesn’t have some language constructs, for example classes and exceptions and at first it may seem hard to write proper Go code, but in practice the language is so easy that I will try to teach you the basics and most important concepts of the language. We’ll further discuss differences and similarities in Go and Python and dive into the cool features of Go.
Finally we’ll talk about why popularity of Go is raising so fast and try to answer the most important question: Do I need to switch to Go ?
Python is an interpreted, open source programming language that is simple, powerful, and preinstalled on many systems. It has less syntax than other languages and a plethora of penetration testing tools have already been created in Python. Python code is translated and executed by an interpreter one statement at a time, allowing it to be run from the command prompt, through command prompt files, or in an integrated development environment. The language uses whitespace and comments to make code more readable. It can perform basic operations like printing, taking user input, performing conditionals and loops, defining reusable functions, and importing additional modules.
Clime is a Python library which lets you convert any module into a multi-command CLI program without any configuration.
It is a short tour of Clime.
The full documentation of Clime: http://clime.mosky.tw/.
The document provides an introduction to the Go programming language. It discusses the history and creators of Go, versions of Go released, key words used in Go, types of operators, and provides examples of basic Go programs for Hello World, values, variables, for loops, if/else statements, switch statements, arrays, slices, functions, multiple return values, pointers, and conclusions. It also includes references at the end.
This document is an introduction to an interactive tutorial on Python idioms and techniques by David Goodger. It discusses Goodger's background and credentials in Python programming. It also provides an overview of topics that will be covered, including Python coding style, whitespace, naming conventions, strings, and comments. The goal is to teach experienced techniques to make code more Pythonic and idiomatic.
Python is a general purpose programming language created by Guido van Rossum in 1991. It is widely used by companies like Google, Facebook, and Dropbox for tasks like web development, data analysis, and machine learning. Python code is easy to read and write for beginners due to its simple syntax and readability. It supports features like object oriented programming, procedural programming, and functional programming.
The document provides an introduction to programming with Python. It discusses key concepts like code, syntax, output, and consoles. It also covers compiling vs interpreting languages, with Python being an interpreted language. The document explains expressions, variables, basic math operations, and functions in Python like print and input. It introduces control structures like if/else statements, for loops, and while loops. It also covers different data types in Python including numbers, strings, lists, and dictionaries.
Python is an interpreted programming language that can be used to perform calculations, handle text, and control program flow. It allows variables to store values that can later be used in expressions. Common operations include arithmetic, printing output, accepting user input, and repeating tasks using for loops and conditional statements like if/else. The interpreter executes Python code directly without a separate compilation step required by other languages.
The document provides an introduction to programming with Python. It discusses key concepts like code, syntax, output, and consoles. It also covers compiling vs interpreting languages, with Python being an interpreted language. The document explains expressions, variables, basic math operations, and functions in Python like print and input. It introduces control structures like if/else statements and for/while loops. It also covers different data types in Python including numbers, strings, lists, and dictionaries.
This document provides an overview of key concepts in programming and Python. It defines terms like code, syntax, output, console, compiling, interpreting, and variables. It explains Python as an interpreted language and shows examples of printing output, taking user input, performing calculations with numbers and math commands, using variables, and basic control structures like if/else and loops. It also covers data types like integers, floats, strings, lists, and how to modify and format them.
This document provides an overview of the basics of Python. It discusses code or source code, syntax, output, the console, compiling vs interpreting, the Python interpreter, expressions, operators, integer and real numbers, math commands, variables, print statements, input, the for loop, range, if/else statements, while loops, logic, and loop control statements. It also covers data types like numbers, strings, lists, sets, and dictionaries.
This document provides an overview of JavaScript, including its history, uses, syntax, variables, data types, operators, conditional statements, loops, functions, and ways to display output. Some key points:
- JavaScript is a scripting language used to add interactivity to HTML pages. It was originally developed by Brendan Eich at Netscape under the names Mocha and LiveScript.
- JavaScript code can be embedded within HTML using <script> tags or linked externally via the src attribute. Common uses include form validation, dynamic updating of content, and interactive effects.
- The language supports variables, arrays, objects, numbers, strings, booleans, and other data types. Conditional statements like if
Go 1.10 Release Party, featuring what's new in Go 1.10 and a few deep dives into how Go works.
Presented at the PDX Go Meetup on April 24th, 2018.
https://www.meetup.com/PDX-Go/events/248938586/
This document provides an overview of various programming concepts including variables, data types, decision making statements, loops, and more. It defines variables as named storage areas that can be manipulated by programs. Common variable types like char, int, float, and double are described along with their characteristics. Syntax and examples are given for if/else statements, switch statements, ternary operators, break, continue, and the various loop structures like for, while, and do-while loops. The document concludes by advertising an online programming course offered by Baabtra and providing contact information.
This document provides an introduction to programming with Python. It discusses several influential early programming languages like FORTRAN, COBOL, LISP, and BASIC. It also covers key Python concepts like expressions, variables, printing output, user input, repetition with for loops and while loops, conditional execution with if/else statements, string processing, and file I/O. The document is intended to teach basic Python syntax and structures to newcomers of the language.
C lecture 4 nested loops and jumping statements slideshareGagan Deep
Nested Loops and Jumping Statements(Loop Control Statements), Goto statement in C, Return Statement in C Exit statement in C, For Loops with Nested Loops, While Loop with Nested Loop, Do-While Loop with Nested Loops, Break Statement, Continue Statement : visit us at : www.rozyph.com
Go is a statically typed, compiled programming language designed at Google in 2007 to improve programming productivity for multicore and networked machines. It addresses criticisms of other languages used at Google while keeping useful characteristics like C's performance, Python's readability, and support for high-performance networking and multiprocessing. Go is syntactically similar to C but adds memory safety, garbage collection, and CSP-style concurrency. There are two major implementations that target multiple platforms including WebAssembly. Go aims to guarantee that code written for one version will continue to build and run with future versions.
The Android code convention document outlines conventions for Android code contributions and projects. It recommends fully qualifying imports, using Javadoc comments, and avoiding generic exception handling. It also notes conventions that don't strongly matter but improve readability, such as consistent indentation and acronym/field naming. The document advises using TODO comments for incomplete code and provides sources for more details on code conventions.
The document discusses programming languages and different types of loops in programming. It provides examples of for, while, and do-while loops. A for loop initializes a variable, specifies a condition, and updates the variable on each iteration. A while loop runs code while a condition is true. A do-while loop runs code once then checks the condition on subsequent iterations. Loops allow code to repeat to produce greater results through repetition.
The document discusses various control flow statements in C programming such as decision control statements (if, if-else, switch-case), looping statements (for, while, do-while loops), break, continue, goto, and functions. It provides examples of using each statement type and explains their syntax and usage. Key aspects like scope of variables, parameter passing methods (call by value, call by reference), and storage classes (auto, static, extern) related to functions are also covered in the document.
This document provides an overview of pre-processor hypertext and core PHP concepts. It discusses software engineering, web programming, and introduces PHP as a scripting language. It covers PHP variables, expressions, operators, conditional statements, functions, arrays, syntax, strings, databases, sessions, cookies, files, email handling, JavaScript, AJAX and XML. It also discusses programming fundamentals like data types, keywords, operators, variables, conditional statements, loops, functions and object-oriented programming concepts.
This document discusses different types of loops in C++ programming including for loops, while loops, do-while loops, and infinite loops. It provides examples of each loop type and explanations of how they work. It also covers switch-case statements, providing an example case statement that prints different outputs depending on the user's input number.
This document discusses different types of loops in C++ programming including for loops, while loops, do-while loops, and infinite loops. It provides examples of each loop type and explanations of how they work. It also covers switch-case statements, providing an example case statement that prints different outputs depending on the user's input number.
Google Cloud Platform Update - NEXT 2017Romin Irani
Presentation from Google Developer Day India held in Ahmedabad in March 2017. The presentation covers key updates from Google Cloud NEXT 2017 and interesting APIs for developers.
Introduction to Google Cloud Machine Learning APIsRomin Irani
Presentation from Google Developer Day Event in Ahmedabad, March 2017. It covers an overview of multiple Cloud Machine Learning APIs like Translate, Vision, Video Intelliigence, Speech and Natural Language.
The Journey to conversational interfacesRomin Irani
This document summarizes the journey to building conversational interfaces using chatbots. It discusses starting with a help desk bot on Slack using NLP and machine learning via API.AI. Both rule-based and AI approaches are covered. The document outlines responding to questions, sending notifications, and analyzing data using the Slack API in Go. It also discusses notifying users, analyzing commands, and improving upon the initial architecture using general AI agents and NLP platforms. Key lessons learned include targeting multiple messaging platforms and choosing an ML engine.
Presentation from Mumbai Tech Meetup on December 13, 2015. This deck presents various updates to the Google Cloud Platform in the last 6+ months. Covers : App Engine, Compute Engine, Cloud Vision API, Cloud Shell, Containers and more.
This presentation gives a high level view of Internet of Things and where it stands today. It also contains a slide on how a Temperature Logger was built out using Arduino, Python and the Google Cloud Platform.
Gradle and Android Studio : Best of FriendsRomin Irani
This document discusses Gradle and its use in Android Studio. It begins with defining Gradle as a build language, dependency manager, and task scheduler that uses Groovy for a build-by-convention approach. It then notes how Gradle makes it easy to create Android projects with multiple modules and build types/flavors in Android Studio. The rest of the document demonstrates Gradle's project structure and basics, use of plugins and tasks, and how to set up multi-module, build type, and flavor configurations to build different variants of an Android app in Gradle and Android Studio.
Powering your Apps via Google Cloud PlatformRomin Irani
Presentation at Google DevFest Ahmedabad, December 2014. This talk gives an overview of Google Cloud Platform and then goes into Cloud Endpoints and building out a simple IoT Project
Development Workshop on ET1, Android and Motorola RhoElementsRomin Irani
This presentation is part of my 2-hour Development Workshop that I conducted at a Motorola Channel Power event. The workshop covered various development options on the ET1 and covered Native Android Development, HTML5 basics and a step by step breakdown of a RhoElements application that integrated device capabilities like barcode scanning.
Talk on Future of Enterprise Mobile App DevelopmentRomin Irani
I spoke on the future of Enterprise Mobile Development at a Motorola Channel Power conference in Yas Island, Abu Dhabi recently. This talk also mentioned about my experiments with Motorola RhoElements - an HTML5 framework
The document summarizes an Android app development webinar. The webinar aims to help attendees understand Android, learn development tools, and build a simple app. It covers what Android is, popular tools like Eclipse and SDK, creating a "Hello World" app, and next steps for learning Android development.
The document provides an overview of HTML5, including its history from 2004 to the present, widespread browser support, and new features such as semantic tags, simplified forms, 2D drawing, audio/video playback, device access APIs, offline storage, and performance improvements. It discusses HTML5's transition from a working group to recommendation status and references for further information.
Smart Computing : Cloud + Mobile + SocialRomin Irani
Smart computing is defined as the integration of hardware, software, and people enabled by cloud, mobile, and social technologies, which are disrupting existing business models; opportunities exist for developers in these areas but challenges include privacy, security, interoperability, and developing a skilled workforce for an increasingly mobile and data-driven business environment. The retail sector was provided as an example domain that can leverage location data, offers, analytics and social/mobile integration to enhance customer experience.
1. The document summarizes HTML5, including its history, key features like semantics, multimedia, forms, and offline capabilities.
2. HTML5 aims to simplify development with new semantic elements, easier form handling, and making audio/video native elements.
3. The geolocation API allows websites to detect a user's location with permission, and features like the app cache and local storage enable offline use of web apps.
Solidworks Crack 2025 latest new + license codeaneelaramzan63
Copy & Paste On Google >>> https://dr-up-community.info/
The two main methods for installing standalone licenses of SOLIDWORKS are clean installation and parallel installation (the process is different ...
Disable your internet connection to prevent the software from performing online checks during installation
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Andre Hora
Exceptions allow developers to handle error cases expected to occur infrequently. Ideally, good test suites should test both normal and exceptional behaviors to catch more bugs and avoid regressions. While current research analyzes exceptions that propagate to tests, it does not explore other exceptions that do not reach the tests. In this paper, we provide an empirical study to explore how frequently exceptional behaviors are tested in real-world systems. We consider both exceptions that propagate to tests and the ones that do not reach the tests. For this purpose, we run an instrumented version of test suites, monitor their execution, and collect information about the exceptions raised at runtime. We analyze the test suites of 25 Python systems, covering 5,372 executed methods, 17.9M calls, and 1.4M raised exceptions. We find that 21.4% of the executed methods do raise exceptions at runtime. In methods that raise exceptions, on the median, 1 in 10 calls exercise exceptional behaviors. Close to 80% of the methods that raise exceptions do so infrequently, but about 20% raise exceptions more frequently. Finally, we provide implications for researchers and practitioners. We suggest developing novel tools to support exercising exceptional behaviors and refactoring expensive try/except blocks. We also call attention to the fact that exception-raising behaviors are not necessarily “abnormal” or rare.
Join Ajay Sarpal and Miray Vu to learn about key Marketo Engage enhancements. Discover improved in-app Salesforce CRM connector statistics for easy monitoring of sync health and throughput. Explore new Salesforce CRM Synch Dashboards providing up-to-date insights into weekly activity usage, thresholds, and limits with drill-down capabilities. Learn about proactive notifications for both Salesforce CRM sync and product usage overages. Get an update on improved Salesforce CRM synch scale and reliability coming in Q2 2025.
Key Takeaways:
Improved Salesforce CRM User Experience: Learn how self-service visibility enhances satisfaction.
Utilize Salesforce CRM Synch Dashboards: Explore real-time weekly activity data.
Monitor Performance Against Limits: See threshold limits for each product level.
Get Usage Over-Limit Alerts: Receive notifications for exceeding thresholds.
Learn About Improved Salesforce CRM Scale: Understand upcoming cloud-based incremental sync.
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMaxim Salnikov
Imagine if apps could think, plan, and team up like humans. Welcome to the world of AI agents and agentic user interfaces (UI)! In this session, we'll explore how AI agents make decisions, collaborate with each other, and create more natural and powerful experiences for users.
F-Secure Freedome VPN 2025 Crack Plus Activation New Versionsaimabibi60507
Copy & Past Link 👉👉
https://dr-up-community.info/
F-Secure Freedome VPN is a virtual private network service developed by F-Secure, a Finnish cybersecurity company. It offers features such as Wi-Fi protection, IP address masking, browsing protection, and a kill switch to enhance online privacy and security .
PDF Reader Pro Crack Latest Version FREE Download 2025mu394968
🌍📱👉COPY LINK & PASTE ON GOOGLE https://dr-kain-geera.info/👈🌍
PDF Reader Pro is a software application, often referred to as an AI-powered PDF editor and converter, designed for viewing, editing, annotating, and managing PDF files. It supports various PDF functionalities like merging, splitting, converting, and protecting PDFs. Additionally, it can handle tasks such as creating fillable forms, adding digital signatures, and performing optical character recognition (OCR).
Who Watches the Watchmen (SciFiDevCon 2025)Allon Mureinik
Tests, especially unit tests, are the developers’ superheroes. They allow us to mess around with our code and keep us safe.
We often trust them with the safety of our codebase, but how do we know that we should? How do we know that this trust is well-deserved?
Enter mutation testing – by intentionally injecting harmful mutations into our code and seeing if they are caught by the tests, we can evaluate the quality of the safety net they provide. By watching the watchmen, we can make sure our tests really protect us, and we aren’t just green-washing our IDEs to a false sense of security.
Talk from SciFiDevCon 2025
https://www.scifidevcon.com/courses/2025-scifidevcon/contents/680efa43ae4f5
AgentExchange is Salesforce’s latest innovation, expanding upon the foundation of AppExchange by offering a centralized marketplace for AI-powered digital labor. Designed for Agentblazers, developers, and Salesforce admins, this platform enables the rapid development and deployment of AI agents across industries.
Email: [email protected]
Phone: +1(630) 349 2411
Website: https://www.fexle.com/blogs/agentexchange-an-ultimate-guide-for-salesforce-consultants-businesses/?utm_source=slideshare&utm_medium=pptNg
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Eric D. Schabell
It's time you stopped letting your telemetry data pressure your budgets and get in the way of solving issues with agility! No more I say! Take back control of your telemetry data as we guide you through the open source project Fluent Bit. Learn how to manage your telemetry data from source to destination using the pipeline phases covering collection, parsing, aggregation, transformation, and forwarding from any source to any destination. Buckle up for a fun ride as you learn by exploring how telemetry pipelines work, how to set up your first pipeline, and exploring several common use cases that Fluent Bit helps solve. All this backed by a self-paced, hands-on workshop that attendees can pursue at home after this session (https://o11y-workshops.gitlab.io/workshop-fluentbit).
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)Andre Hora
Software testing plays a crucial role in the contribution process of open-source projects. For example, contributions introducing new features are expected to include tests, and contributions with tests are more likely to be accepted. Although most real-world projects require contributors to write tests, the specific testing practices communicated to contributors remain unclear. In this paper, we present an empirical study to understand better how software testing is approached in contribution guidelines. We analyze the guidelines of 200 Python and JavaScript open-source software projects. We find that 78% of the projects include some form of test documentation for contributors. Test documentation is located in multiple sources, including CONTRIBUTING files (58%), external documentation (24%), and README files (8%). Furthermore, test documentation commonly explains how to run tests (83.5%), but less often provides guidance on how to write tests (37%). It frequently covers unit tests (71%), but rarely addresses integration (20.5%) and end-to-end tests (15.5%). Other key testing aspects are also less frequently discussed: test coverage (25.5%) and mocking (9.5%). We conclude by discussing implications and future research.
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AIdanshalev
If we were building a GenAI stack today, we'd start with one question: Can your retrieval system handle multi-hop logic?
Trick question, b/c most can’t. They treat retrieval as nearest-neighbor search.
Today, we discussed scaling #GraphRAG at AWS DevOps Day, and the takeaway is clear: VectorRAG is naive, lacks domain awareness, and can’t handle full dataset retrieval.
GraphRAG builds a knowledge graph from source documents, allowing for a deeper understanding of the data + higher accuracy.
How can one start with crypto wallet development.pptxlaravinson24
This presentation is a beginner-friendly guide to developing a crypto wallet from scratch. It covers essential concepts such as wallet types, blockchain integration, key management, and security best practices. Ideal for developers and tech enthusiasts looking to enter the world of Web3 and decentralized finance.
Download Wondershare Filmora Crack [2025] With Latesttahirabibi60507
Copy & Past Link 👉👉
http://drfiles.net/
Wondershare Filmora is a video editing software and app designed for both beginners and experienced users. It's known for its user-friendly interface, drag-and-drop functionality, and a wide range of tools and features for creating and editing videos. Filmora is available on Windows, macOS, iOS (iPhone/iPad), and Android platforms.
Get & Download Wondershare Filmora Crack Latest [2025]saniaaftab72555
Copy & Past Link 👉👉
https://dr-up-community.info/
Wondershare Filmora is a video editing software and app designed for both beginners and experienced users. It's known for its user-friendly interface, drag-and-drop functionality, and a wide range of tools and features for creating and editing videos. Filmora is available on Windows, macOS, iOS (iPhone/iPad), and Android platforms.
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfTechSoup
In this webinar we will dive into the essentials of generative AI, address key AI concerns, and demonstrate how nonprofits can benefit from using Microsoft’s AI assistant, Copilot, to achieve their goals.
This event series to help nonprofits obtain Copilot skills is made possible by generous support from Microsoft.
What You’ll Learn in Part 2:
Explore real-world nonprofit use cases and success stories.
Participate in live demonstrations and a hands-on activity to see how you can use Microsoft 365 Copilot in your own work!
FL Studio Producer Edition Crack 2025 Full Versiontahirabibi60507
Copy & Past Link 👉👉
http://drfiles.net/
FL Studio is a Digital Audio Workstation (DAW) software used for music production. It's developed by the Belgian company Image-Line. FL Studio allows users to create and edit music using a graphical user interface with a pattern-based music sequencer.
Douwan Crack 2025 new verson+ License codeaneelaramzan63
Copy & Paste On Google >>> https://dr-up-community.info/
Douwan Preactivated Crack Douwan Crack Free Download. Douwan is a comprehensive software solution designed for data management and analysis.
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDinusha Kumarasiri
AI is transforming APIs, enabling smarter automation, enhanced decision-making, and seamless integrations. This presentation explores key design principles for AI-infused APIs on Azure, covering performance optimization, security best practices, scalability strategies, and responsible AI governance. Learn how to leverage Azure API Management, machine learning models, and cloud-native architectures to build robust, efficient, and intelligent API solutions
2. Objectives
What is the Go Language all about?
Whirlwind Tour of the Language
See lots of code samples
Hopefully … make you code a little bit too in
this session
Get you interested enough to learn more about
Go!
2
Any Prerequisites?
4. Why use Go?
Modern
Popular
Simple
Fun
Do More With
Less
4
5. Go Language History
Started in 2007 @ Google
Initial Release in 2009
Rob Pike, Robert Griesemer, Ken Thompson
Designed to overcome issues with using Java,
Python and other languages across large code
base
Systems Language General Purpose
Language
Current @ 1.5
Version 1.6 to be released in Feb 2016
5
6. Go Features
Similar to C Language in Syntax
Case sensitive
Only 25 keywords
Cross Platform Binaries
Compiled Language
Statically Typed
Solid and comprehensive Standard Packages
Object Oriented Features
Composition over Inheritance
Open Source
6
7. Popular Projects
Popular with Infrastructure Software Companies
Popular Projects
Docker
CoreOS: etcd, rkt
Kubernetes
InfluxDB, RethinkDB
Hugo
Consule
And more
Great choice for a modern, general purpose
language
7
9. Go Playground
Go Playground :
http://play.golang.or
g
Excellent way to get
familiar with syntax
Run Go code in the
cloud
Save and Share Go
Snippets
Some restrictions
9
10. First Go Project
We will be creating a new Project
Let us call it helloworld
Create this project folder in the GOPATH root
i.e. $GOPATHhelloworld
Open Atom Editor. Add the
$GOPATHhelloworld Project Folder
Create a new file named hello-world.go
10
13. Built-in Types
13
bool
string
int int8 int16 int32 int64
uint uint8 uint16 uint32 uint64 uintptr
byte // alias for uint8
rune // alias for int32
// represents a Unicode code point
float32 float64 complex64 complex128
14. Variable Declaration
Use the var keyword
Format
var <variablename> <type>
var <variablename> <type> = <initialvalue>
Examples:
var phoneModel string = “Samsung S5”
var osName string = “Android”
var price float32 = 40000.0
14
15. Variable Declaration
Use the block declaration to combine multiple
variables
var (
phoneModel string = “Samsung S5”
osName string = “Android”
price float32 = 40000.0
)
15
16. Variable Declaration
Declare multiple variables of the same type as
follows:
var firstName, lastName string = “A”, “B”
var i,j int, k string =10,20,”Hello”
If initializer is present, the type can be omitted:
var i,j = 10,20
16
17. Short Variable Declaration
Use the := short assignment statement instead
of var
The type is implicit i.e. determined by Go
Available only inside a function and not at
package level
function main() {
price := 20.50
firstName := “Gopher”
}
17
18. Constants
18
Declared with the const keyword
They can be character, string, boolean or
numeric
The scope depends on where they are defined
const tax_rate = 10.5
const city = “Mumbai”
19. Go : Zero values
19
Every type has a Zero value
Zero Value Type
0 Numeric
false Boolean
“” String
nil Pointer, channel, struct, func,
interface, map, Slice
24. What are functions?
Functions are the building blocks of Go
programs
An independent section of code
Also known as procedure or subroutine
Can take input parameters
Can return single or multiple return values
Variable number of arguments
Functions are first class citizens in Go. They
can be passed around as any other value.
Anonymous Functions
24
26. Writing a function
Define your function by specifying the following:
func funcname() {
}
This is the simplest way to define a function.
It does not take any input parameters
It does not return any values
E.g.
func sayHello() {
fmt.Println(“Hello”)
}
26
27. Function with input parameters
Define your function by specifying the following:
func funcname(param1 type, param2 type) {
}
This function takes two input parameters
It does not return any values
E.g.
func sayHello(firstName string, lastName string, age
int) {
fmt.Println(“Hello”,firstName,lastName,”You
are”,age,”years old”)
}
27
28. Function with input parameters
If multiple parameters are of same type, you
can use a short-hand way of declaring:
func funcname(param1,param2 type1, param3
type2) {
}
f1(num1,num2 int, name string)
f2(num1 int, firstname, lastname string)
28
29. Function with return values
A function can return a value : single or multiple
func funcname(param1,param2 type1, param3 type2)
(return value types) {
}
f1(num1 int, num2 int) (int) { return 0}
f2(num1 int, firstname, lastname string) (int, string) {
return 1, “Hello”}
f3(num1 int, num2 int) (int, bool) { return false}
f4(num1 int, num2 int) (int, error) {
return 10, nil
//return -1, errors.New(“Some error”)
}
29
30. Variadic functions
The last input parameter can contain multiple or variable number of
arguments
They have to be of the same type
func funcname(param1 type1, …string) {
}
E.g.
func addNumbers(numbers …int) (int) {
}
Invoking it:
addNumbers(1,2,3,4,5)
addNumbers(1,2)
addNumbers(1,2,3,4,5,6,7,8,9,10)
30
32. for construct
The only looping construct available in Go
3 variants
Single condition
Classical For Loop : Initial Value, Final Value,
Increment
Forever Loop
32
33. for : Single Condition
for <condition> {
}
Repeatedly executes the block while the condition
is true
Example:
for i < 3 {
fmt.Println(i)
i++
}
33
34. for : Classical Loop
for i := 1; i<=10; i++ {
fmt.Println(i)
}
i:=1 , both declares, initializes the variable i
34
35. for : forever loop
for {
//do something
//if some condition met , then use break
}
Similar to while true { … } in other languages
Break out of the loop via the break or return
statement
35
36. Sample Code
Go Playground:
http://play.golang.org/p/Z7bKxJ-ljK
36
37. if statement
if statement is a condition followed by a block
The block is executed only if the condition
evaluates to true
if <condition> {
//Some statements
}
if (sum > 100) {
…
}
37
38. if – else statement
if <condition> {
//block 1
} else {
//block 2
}
a:=1
b:=2
if a > b {
fmt.Println(“a is greater than b”)
} else {
fmt.Println(“a is less than or equal to b”)
}
38
40. switch statement
40
switch statement can help in evaluating multiple
conditions
The switch keyword is followed by an expression
and then multiple case statements, out of which
one will be executed
The case data types could be int, float, string,
bool, etc. or even a complex expression / function
call
Unlike other languages, there is no need for the
break statement after each case statement.
A default case statement can be put too in case
none of the case conditions are met.
41. switch statement
switch i {
case 0: fmt.Println("Zero")
case 1: fmt.Println("One")
case 2: fmt.Println("Two")
case 3: fmt.Println("Three")
case 4: fmt.Println("Four")
case 5: fmt.Println("Five")
default: fmt.Println("Unknown Number")
}
41
42. switch statement
42
Notice that there was no break statement
between the case statements
If you want the code to fallthrough like it is in
under languages, use fallthrough
43. switch statement
43
Use commas to separate multiple expressions
in same case statement.
switch i {
case 1,3,5,7,9: fmt.Println(“Odd")
case 2,4,6,8,10: fmt.Println(“Even")
default: fmt.Println("Unknown Number")
}
44. switch – without expression
44
Eliminate the expression in switch statement.
This way, it can evaluate the case expression
switch {
case i < 10: fmt.Println(“Less than 10")
case i>=10 && i <=100 : fmt.Println(“Between 10 and 100")
case somefunc(i) > 200 : fmt.Println(“some statement”)
default: fmt.Println("Unknown Number")
}
45. Sample Code
Go Playground:
if / if - else: http://play.golang.org/p/bA0qVEx_eP
switch :
http://play.golang.org/p/wjwTpPLujg
http://play.golang.org/p/lQQIiLzC1G
http://play.golang.org/p/5rj5Y1hVPR
45
47. Arrays in Go
Fixed length data type for holding elements of
same type
Array can be of any types like int, string, struct,
pointers, etc
Individual element of Array can be accessed
using integer index, using []. For e.g. num[0]
Array index is 0 bound that if Array size is 5,
index ranges from 0 to 4
47
48. Declaring / Initializing Arrays
var iArr = [5]int{}
Creates an Array of length 5
Each element of Array initialized to zero value i.e. 0
iArr := [5]int {0, 1, 2, 3, 4}
Declare and initialize Array iArr of length 5, and with values 0, 1, 2,
3, 4
iArr := [5]int {2: 20, 4: 50}:
Declare and initialize Array iArr of length 5, and will set value at
index 2 and 4 to 20 and 50 respectively
48
49. Accessing Array elements
iArr[2], will access element at index 2 of Array
iArr
iArr[3] = 10, will set 10 as value at index 3
If index is more than length of Array, then an
error is thrown. For e.g. iArr[5] for an integer
Array of 5 elements will thrown the follow error:
“invalid Array index 5 (out of bounds for 5-element
Array)”
49
50. Iterating through Array
Use the for or range statement
var numbers = [5]int{1,2,3,4,5}
for i:=0;i<5;i++ {
//numbers[i]
}
Use built-in len function for length of Array. For e.g.
for i:=0;i<len(numbers);i++ {
//numbers[i]
}
50
51. Iterating through Array
for + range statement allows you to iterate over a collection.
It provides both index and value of each item
var numbers = [5]int{1,2,3,4,5}
for index,value := range numbers {
fmt.Println(index,value)
}
Output:
0,1
1,2
2,3
3,4
4,5
51
52. Iterating through Array
You can ignore any of the index or value , if not
interested
var numbers = [5]int{1,2,3,4,5}
for _,value := range numbers {
fmt.Println(value)
}
var numbers = [5]int{1,2,3,4,5}
for index, _ := range numbers {
fmt.Println(index)
}
Question : Why do you need to ignore any of the return values
that you are not interested in?
52
53. Array Sample code
53
1. Multiple Array examples
http://play.golang.org/p/p-eV7eZXYp
2. Pass by Value to function
3. Using for and range to iterate over
Array
http://play.golang.org/p/nN1Q3R0Z1X
4. A first look at Slices:
http://play.golang.org/p/WarnTGxDaE
54. Arrays : Practical Considerations
Fixed in Length
Arrays are passed by value to function
If the Array data is large in size ( or multi-
dimensional), impact memory and performance
Go has a solution to addressing this that we
shall see in the next section : Slices
54
55. Slices - Overview
Slice data type is similar to an Array
Just like an Array, a Slice too holds elements
of same type
It does not have a fixed length
A Slice allows for dynamic expansion and
shrinking of the Array
It is an abstraction built on top of an Array type
and shares same memory as that of
underlying Array
55
56. Declaring / Initializing
Use make function for creating a Slice
make([]T, length, capacity)
T is the type of element to hold
length, of Slice to be created. It is mandatory to
specify length
capacity, of Slice to be created. It is optional to
specify capacity. In case if not specified , capacity
is assumed to be same as length
56
57. Declaring / Initializing
Slice := make([]int, 5, 10)
This will create Slice of type int, of length 5
and capacity 10.
Slice := make([]int, 5)
This will create Slice of type int, of length 5
and capacity 5.
57
58. Declaring / Initializing
Slice is used in same way as Array.
Slice[0] = 1
Slice[1] = 2
Setting values at index 0 and 1 into Slice
Use function len to find length of Slice
Use function cap to find capacity of Slice
58
59. append function
It is always recommended to use append
method while adding value(s) to Slice
Function append, internally checks if value to
be added in more than the length, it will create
new Array using capacity and add new value.
Call to append always returns new Slice
59
60. Slicing Arrays
So far we created Slice using make function,
which also creates underlying Array for Slice
But we can also create Slice on top of Array
Let us assume Array i := [5] int {1, 2, 3, 4, 5}
Slice := i[1:3]
This will create Slice over Array i, using values starting
from index 1 to 3 i.e. 2, 3, 4.
Slice := i[:]
This will create Slice covering entire Array i.e.
from index 0 to 4.
60
61. Declaring / Initializing
Slice := [] int {1, 2, 3, 4, 5}
Creating Slice in same way as Array. But here
we don’t specify length in the preceding
square brackets
Empty Slices:
Slice := []int {}
Slice := make ([]int, 0)
Creating new Slice from Slice
Slice2 := Slice[1: 3]
61
63. Key points while using Slices
Slice is a reference to an Array
All the Slices on an Array shares same
memory as that of Array
Can create more than one Slice on same
underlying Array
Any changes made to one Slice will be
reflected in other Slices and in Array too
Useful to use a slice instead of entire Array in
case of large amount of data
63
64. Iterating over Slices
Use the range keyword
numbers := []int{100, 200, 300, 400, 500}
for index, value := range numbers {
fmt.Println(index, value)
}
Go Playground
http://play.golang.org/p/P_nSXzxAC1
64
65. Examples
Slice from make function
http://play.golang.org/p/sGQ2WOT1S3
Slice from Literal
http://play.golang.org/p/R60h2f2xt9
append, len and capacity functions
http://play.golang.org/p/gUPJNCelX0
Slices are passed by value to functions
http://play.golang.org/p/nluakS7P-s
Multiple Slices work over the same array
http://play.golang.org/p/BsHTCliECU
Iterating over Slices
http://play.golang.org/p/6Ax7L6Ud7E
65
66. Map
Only key/value paired collection in Go
Map is an unordered collection i.e. order in
which key/value returned is not always the
same
Map, uses a hash table for storing key/value
66
67. Declaring/Initializing
Use function make for creating Map
make(map[key type]value type)
In make function, use keyword map, specify
the type to be used as key in square brackets
and type to be used as value outside square
bracket
m := make(map[int]string)
This will create a Map, with key as int and
value as string
67
68. Declaring/Initializing
We can also create without using make function
m := map[int]string{}
It is also possible to declare and initialize map in
one statement
m := map[int]string {
1: “One”,
2: “Two”,
3: “Three”,
}
68
69. Using Map
Write to map
m[4] = “Four”
This will add, key 4, and assign “Four” as it is value
Read from map
s := m[2]
Will return value for key 2 i.e. “Two”.
In case if key is not present in map, it will return
zero value for type of value.
In our case if we use m[100] and since key 100 is
not present in map, empty string will be returned
as for string, empty string is zero value
69
70. Function len, can be used to determine
length/size of the map
Function delete, to be used to deleting
key/value from map
delete(m, 1)
Will delete key/value pair whose key is 1 from map
m.
If m is nil or key is not present in map, delete will be
no operation
70
Using Map
71. Using Map
i, ok := m[1]
Here 2 values will be returned, 1st the value for key and
2nd boolean to indicate if key/value exists
i := m[100]
Here only value for the key will be returned
_, ok := m[100]
This can be used to check if key/value exists. We
have used blank Identifier (Underscore) as 1st
value to skip it
71
72. Iterating a Map
m := map[int]string{
1: “One”,
2 : “Two”,
3: “Three”,
}
We can iterate over map using range as shown
below
for k, v : range m {
fmt.Println(“Key :”, k, “ Value :”, v)
}
Two values are returned, 1st is key and 2nd is value.
72
75. Structs
Struct is user defined data type
Struct, as the name says is a structure used
for logical grouping of fields/property
If you are familiar with OO language Java, you
can co-relate it with class
A Struct, like most other data types when
passed as parameter to function is passed by
value
75
76. Declaring/Initializing
Following is the template used for declaring a struct
type <name> struct {
}
keyword type is used to define a new type followed with
name of the struct, followed by keyword struct to indicate
that type is a struct
Example
type User struct {
FirstName string
LastName string
Age int
}
76
77. Declaring/Initializing
Just like any other data type, A Struct too can be
declared and initialized in two steps
var u User
This will declare variable of u of type struct User
and initialize it to zerovalue.
We can do declaration and initialization in one
statement as shown below:
u := new(User)
Using new will allocate memory and return
pointer.
77
78. Declaring/Initializing
We can pass values for each of the property to
be initialized at the time of creating an
instance of struct.
u := User{“Fn”, “Ln”, 50}
Here we have passed value as Fn, Ln and 50
which will be set to FirstName, LastName and
Age respectively.
We can also specify property name explicitly in
case if we don’t wish to initialize all the
properties or if we don’t want to follow
sequential approach
u := User{Age: 50, FirstName: “Fn”}
78
79. Accessing
We can access individual fields as follows:
u := User{Age: 50, FirstName: “Fn”}
Here we have not initialized LastName while
creating instance of User. Lets do it now:
u.LastName = “Ln”
Use Println, for printing a Struct including all it
fields
fmt.Println(u)
This will print: {Fn Ln 50}
79
80. Nested Struct
type Address struct {
Building, Area, City, State, Country string
}
type User struct{
…
Address Address
}
u := User{Age: 50, FirstName: "Fn", LastName:"Ln"}
u.Address = Address{"building", "area", "city", "state", "INDIA"}
fmt.Println(u)
Output:
{Fn Ln 50 {building area city state INDIA}}
80
81. Struct : Receiver Methods
Method is a function which is called upon instance. For example:
func (u User) isSeniorCitizen() bool{
isSrCitizen := false
if (u.Age > 60){
isSrCitizen = true
}
return isSrCitizen
}
Note the signature, we are preceding the function name with instance
of user. This is called as receiver and function is called as method
on User.
We can call this method as
u := User{Age: 50, FirstName: "Fn", LastName:"Ln"}
isSrCitizen := u.isSeniorCitizen()
81
83. Interfaces
Interface is a way to add behaviour
It is GoLang’s way to Polymorphism
Interface is a contract that implementer needs to
fulfill
Interface only defines methods with signature
without definition. Definition of methods is left up-
to implementer
Interface leads to IS-A relationship
You can add behaviour anytime by implementing
the Interface method. This is one of the nice
features of the language
83
84. Declaring
type <name> interface{
….
}
Interface is declared using keyword type followed by
name followed by keyword interface
Example
type Shape interface {
printArea()
}
Here we have declared interface of type Shape with
method printArea, which needs to be implemented by
implementer
84
85. Implementation
type Square struct {
side int
}
func (s Square) printArea
(){
fmt.Println(“Area of
Square”, s.side * s.side)
}
type Rectangle struct {
length, breath int
}
func (r Rectangle )
printArea(){
fmt.Println(“Area of
Rectangle”, r.length *
r.breath)
}
85
86. Implementation
func main(){
var s, r Shape
s = Square{5}
r = Rectangle{5, 4}
s.printArea()
r.printArea()
}
Output:
Area of Square 25
Area of Rectangle 20
We have created instance of Square and Rectangle and called printArea()
method on each of them.
86
87. Composition over Inheritance
Go does not support inheritance
It supports Composition via Type Embedding
The design philosophy is to compose large
things from smaller components
Composition over Inheritance helps to keep
the components loosely coupled even as
changes happen in the system + helps with
practical benefits of inheritance
87
88. Composition Example
Composition is Go is done via Embedding the
Type
The embedding struct gets the behaviour of
the embedded Type
It can also access the struct elements directly
It can override the behaviour of Embedded
Type if needed
Though Composition is HAS-A , it is easier to
think of via IS-A
88
89. Interfaces + Type Composition
You can define an Interface with its methods
A Type (Struct) can implement it.
You can then embed that type into any struct
The Embedding Struct can override behaviour
if needed
You can treat all the instances like IS-A type of
that particular Interface
89
90. Hands On
Exercise #7 &
#8
90
http://play.golang.org/p/toycLtAVxz
http://play.golang.org/p/i1Hpf2YA5-
91. Concurrency in Go
What is concurrency?
Concurrency v/s Parallelism
Go routines
Channels
See sample code to see it work
91
93. Threads Anyone?
Usually the execution of things concurrently is
done via an OS Thread
On a single core CPU, only one thread can be
executing at a single time
Threads are resource hungry and not that
lightweight
Go does not use Threads
Instead it uses go routines. Let’s check that.
93
94. go routines
It is a light weight construct
Go manages go routines
Go routines are laid on top of threads
Switching Threads is expensive
Since multiple go routines could be in a
thread, switching is less expensive , therefore
less scheduling of Threads
Faster startup times
Communicating between go routines is via
Channels
94
95. Step 1 : Running Sequentially
Go Playground
http://play.golang.org/p/OCHJV_xbI0
This code invokes two functions , one after the
other
There is no concurrency here
95
96. Step 2 : Introduce go routines
Go Playground
http://play.golang.org/p/VZqsEyZbKG
Simply put the keyword go before the function
call
This will invoke the two functions concurrently
Investigate : What happened?
The program just exited
This is because the main routine ended
immediately
Suggested Fix : Maybe a timer ?
96
97. Step 3 : Introduce a Timer
Go Playground
http://play.golang.org/p/dsno9tkdb0
Introduced the time.Sleep method in both the
go routines so that each one of them allows
the other to run
Additionally, we have put a longer timer in the
main routine so that there is sufficient time for
the go routines to complete
Issue : We cannot keep playing with the timer
97
98. Step 4 : Introducing sync.WaitGroup
Go Playground
http://play.golang.org/p/vavJveNVer
Use a WaitGroup from sync package
In the main routine, you can specify how many
go routines need to finish and one waits for
that
Each go routine will indicate to the Wait Group
that is done
98
99. Go Channels
Synchronization between go routines is done via
Channels
A Channel can be thought of as a pipe that
connects the go routines
Communication means “exchange of data”
Channels take care of safely transmitting data
between the go routines and takes care of sync
operations
Channels
Buffered
Un-buffered (Default)
99
100. Unbuffered Channel
Creation
ch1 := make(chan <datatype>)
Writing to it : ch1 <- somedata
Reading from it : somedata <- ch1
100
101. Unbuffered Channel
Sender go routine will write data to the Channel
Receiver go routine will wait on the Channel
The Sender blocks till the Receiver gets the data
The Receiver blocks till it receives the data
Unbuffered Channel = Combines Communication with
Synchronization
101
102. Unbuffered Channel : Example
Go Playground
http://play.golang.org/p/T8_4wz0fjw
Main routine (RECEIVER) waits for a message
on the channel
go routine (SENDER) – completes it’s task and
sends the message on the channel
Try: Comment out the go f1() line and see
what happens when you try to run!
102
103. Buffered Channel
Creation
ch1 := make(chan <datatype>, size)
Writing to it : ch1 <- somedata
Reading from it : somedata <- ch1
103
104. Buffered Channel
Sender go routine will write data to the Channel
Receiver go routine will wait on the Channel
The number of data blocks that can be written depend
on size
The Sender go routine will not block after writing if the
buffer is still available
The Receiver blocks till it receives the data
Buffered Channel = Semaphore to limit throughput
104
105. Buffered Channel : Example
Go Playground:
http://play.golang.org/p/ft03nGBshb
Create a channel that accepts a string with a
buffer size of 2
Main routine can wait for both go routines to
write to that channel
Try : Uncomment the extra fmt.Println(<-
messageChannel) line
105
106. Buffered Channel : Example
Go Playground:
http://play.golang.org/p/E3YikZ8UEv
Channel that accepts string data type and
buffer size of 5
Go routine sends the 5 messages and since it
is buffered, it is not blocked till the RECEIVER
gets it.
Try : Introduce a timer if you want to sleep in
main routine and get the message later.
106
107. Understand Buffered Channels
Go Playground:
http://play.golang.org/p/4Cbc7BfE7s
The channel size is 5
Notice how the go routine (SENDER) after
publishing 5 messages to the Buffered
Channel BLOCKS on the 6th message till the
RECEIVER starts reading from the channel
107
108. Go & Web Development
Well suited to power web applications
Sweet spot lies in creating Web APIs that can
be consumed by clients
Core packages : net/http and html/template
Web Frameworks:
Martini
Revel
Others
108
109. Powerful standard library to handle Request /
Response pattern
The key component here is http.HTTPHandler
, which encapsulates the Request / Response
109
net/http Package
110. Various HTTP Handlers
net/http provides several HTTP Handlers like
FileServer, NotFoundHandler, etc.
Example : FileServer can be used for Static File
Serving
http.FileServer(root FileSystem)
Using http.ListenAndServe(port,handler) – we can
serve a static site
Create the following file
http://play.golang.org/p/KyRDyXSpm7 in any
server and run the application there. Visit
localhost:8080 in your browser.
110
111. net/http Package
We need to typically
map multiple URL
Paths to their HTTP
Handlers
For e.g.
/add -> Handler 1
/edit -> Handler 2
/delete -> Handler 3
ServeMux in net/htttp
111
ServeMux
HTTP
Router
Handler 1
Handler 2
Handler 3
/add
/edit
/delete
Req
Res
p
112. Sample REST API
Write a REST API for managing Employees
To keep it simple, we will implement single
GET method call /employees to get all
employees
Go Playground
http://play.golang.org/p/ged5yNOekx
112
113. HTTP Networking - Invoking REST API
Use the net/http package
Package http provides HTTP client and server
implementations
Get, Head, Post, and PostForm methods to make
HTTP (or HTTPS) requests
resp, err := http.Get("http://example.com/")
resp, err := http.Post("http://example.com/upload",
"image/jpeg", &buf)
resp, err :=
http.PostForm("http://example.com/form",
url.Values{"key": {"Value"}, "id": {"123"}})
113
114. Sample Code
USD to INR Currency Rate
Invokes a Currency REST API that returns JSON
Data
http://apilayer.net/api/live?access_key=API_KEY&
currencies=INR&format=1
Go Playground
Step 1 : Retrieve JSON Data :
http://play.golang.org/p/H5-JX-1VEP
Step 2 : Parse the JSON Data :
http://play.golang.org/p/Fp8S78V5UC
114
115. Several Other things …
Unit Testing
Go Tools
Go Doc
Take a look at :
https://github.com/avelino/awesome-go
115
116. Naming conventions
Create the test file with name ending in
_test.go
Inside the test file, each test is written in the
following form:
func TestXyz(t *testing.T)
go build ignores the files ending in _test.go
go test will take all the files ending in _test.go
go help test
116
117. Go Documentation
Go provides godoc tool for generating
documentation from source files
You can use it to get information on packages
too
See all documentation
godoc -http=:4000
See specific documentation on a package
godoc math
See specific documentation on a package +
function
godoc strconv Atoi
117