The document discusses loops in Google Go. It begins by showing a basic for loop to iterate through a slice. It then demonstrates an infinite loop and how to recover from a panic. Next, it covers using a range loop to iterate through a slice. Finally, it shows how to write a generic print_slice function that asserts the type of its interface{} parameter.
An introduction to Go from basics to web through the lens of "Hello World", extracted from the Book "A Go Developer's Notebook" available from http://leanpub.com/GoNotebook
Original presentation is Richard Carlsson's at Erlang Factory Bay Area 2009.
Erlangの世界的なイベントの中のEUnitの説明の資料です。分かりやすくEUnitの特徴がまとまっています。翻訳を許可してくれて、オリジナルの資料を送っていただいたRichardさんに感謝したいと思います。
An introduction to Go from basics to web through the lens of "Hello World", extracted from the Book "A Go Developer's Notebook" available from http://leanpub.com/GoNotebook
Original presentation is Richard Carlsson's at Erlang Factory Bay Area 2009.
Erlangの世界的なイベントの中のEUnitの説明の資料です。分かりやすくEUnitの特徴がまとまっています。翻訳を許可してくれて、オリジナルの資料を送っていただいたRichardさんに感謝したいと思います。
JavaOne 2010, Rock Star winning presentation on Fugue and Log4JFugueBrian Tarbox
David Koelle wrote JFugue which is a system for making it easy to do music programming. Brian Tarbox used JFugue to write Log4JFugue which converts and computer program's log file output to a music stream.
"The other day, I was playing with this idea... I wanted to be able to programmatically download a file..."
These are slides from my lightning talk that I gave on https://twitter.com/CodeElixirIO in August 2018.
Phing is a PHP build tool, similar to Apache's Ant. Phing can be used for everything from validating your build, running tests, combining/minifying resources to deploying.
Awesomely descriptive JavaScript with monadsMichal Nowak
"Can unfamiliar pattern from world of statically typed functional languages improve JavaScript world? For sure YES! The elastic nature of JavaScript can handle great ideas from many alien worlds. With a little help of modern tools like monet.js and TypeScript we can achieve awesomely descriptive aesthetics of our code and drop some imperative bloat."
On 19 march 2016 Kuba Strojewski from Evojam gave a speech about monads on meet.js summit JavaScript Conference. Here's his slide deck.
Groovy erfreut sich immer größerer Beliebtheit. Viele "grüne Wiese Projekte" werden damit und vor allem mit dem darauf aufsetzenden Grails Framework realisiert. Will man Groovy in einem bereits existierenden Java-Projekt verwenden bedeutet das nicht automatisch, dass das Projekt dazu grundlegend umgestellt werden muss. Insbesondere im Bereich der funktionalen Tests kann Groovy relativ problemlos integriert werden. Der Vortrag zeigt am Beispiel einer existierenden JSF-Anwendung wie diese mit Hilfe von Groovy und den Frameworks Spock und Geb automatisiert getestet werden kann.
Serge Guelton and Pierrick Brunet (Namek): “Pythran: Static Compilation of Parallel Scientific Kernels”
Abstract: As the use of Python coupled to Numpy/SciPy for numerical computation increases, many tools to optimize performance have emerged. Indeed, this duo has relatively poor performance when compared to scientific codes written in legacy languages like C or Fortran. Cython, Numba, numexpr and parakeet belongs to this new compiler ecosystem. And so does Pythran, a Python to C++11 translator for scientific Python.
Pythran uses a static compilation approach a la Cython, but with full backward compatibility with Python. It does not only turns Python code into C++ code, it also performs Python/Numpy specific optimizations, generates calls to a parallel, vectorized runtime and makes it possible to write OpenMP annotation in the original Python code. It supports a large range of Numpy functions and can combine them in efficient ways: it can optimize highlevel modern Python/Numpy codes and not only Fortran with a Python flavor ones.
This talk presents the existing compilation approach and optimization opportunities for numerical Python, their strengths and weaknesses, then focus on the specificities of the Pythran compiler.
Implementing Software Machines in C and GoEleanor McHugh
The next iteration of the talk I gave at Progscon, this introduces examples of Map implementation (useful for caches etc.) and outlines for addition of processor core code in a later talk.
GoLightly - a customisable virtual machine written in GoEleanor McHugh
A brief overview of the Go programming language and how it might be used to build a simple customisable virtual machine. This is a reduced and updated version of my previous Go virtual machine talks with many code examples.
Finding a useful outlet for my many Adventures in goEleanor McHugh
A talk about my Leanpub-published living eBook: A Go Developer's Notebook. Buy my book? Write your own Book using Leanpub? Learn you some Golang for fun?
JavaOne 2010, Rock Star winning presentation on Fugue and Log4JFugueBrian Tarbox
David Koelle wrote JFugue which is a system for making it easy to do music programming. Brian Tarbox used JFugue to write Log4JFugue which converts and computer program's log file output to a music stream.
"The other day, I was playing with this idea... I wanted to be able to programmatically download a file..."
These are slides from my lightning talk that I gave on https://twitter.com/CodeElixirIO in August 2018.
Phing is a PHP build tool, similar to Apache's Ant. Phing can be used for everything from validating your build, running tests, combining/minifying resources to deploying.
Awesomely descriptive JavaScript with monadsMichal Nowak
"Can unfamiliar pattern from world of statically typed functional languages improve JavaScript world? For sure YES! The elastic nature of JavaScript can handle great ideas from many alien worlds. With a little help of modern tools like monet.js and TypeScript we can achieve awesomely descriptive aesthetics of our code and drop some imperative bloat."
On 19 march 2016 Kuba Strojewski from Evojam gave a speech about monads on meet.js summit JavaScript Conference. Here's his slide deck.
Groovy erfreut sich immer größerer Beliebtheit. Viele "grüne Wiese Projekte" werden damit und vor allem mit dem darauf aufsetzenden Grails Framework realisiert. Will man Groovy in einem bereits existierenden Java-Projekt verwenden bedeutet das nicht automatisch, dass das Projekt dazu grundlegend umgestellt werden muss. Insbesondere im Bereich der funktionalen Tests kann Groovy relativ problemlos integriert werden. Der Vortrag zeigt am Beispiel einer existierenden JSF-Anwendung wie diese mit Hilfe von Groovy und den Frameworks Spock und Geb automatisiert getestet werden kann.
Serge Guelton and Pierrick Brunet (Namek): “Pythran: Static Compilation of Parallel Scientific Kernels”
Abstract: As the use of Python coupled to Numpy/SciPy for numerical computation increases, many tools to optimize performance have emerged. Indeed, this duo has relatively poor performance when compared to scientific codes written in legacy languages like C or Fortran. Cython, Numba, numexpr and parakeet belongs to this new compiler ecosystem. And so does Pythran, a Python to C++11 translator for scientific Python.
Pythran uses a static compilation approach a la Cython, but with full backward compatibility with Python. It does not only turns Python code into C++ code, it also performs Python/Numpy specific optimizations, generates calls to a parallel, vectorized runtime and makes it possible to write OpenMP annotation in the original Python code. It supports a large range of Numpy functions and can combine them in efficient ways: it can optimize highlevel modern Python/Numpy codes and not only Fortran with a Python flavor ones.
This talk presents the existing compilation approach and optimization opportunities for numerical Python, their strengths and weaknesses, then focus on the specificities of the Pythran compiler.
Implementing Software Machines in C and GoEleanor McHugh
The next iteration of the talk I gave at Progscon, this introduces examples of Map implementation (useful for caches etc.) and outlines for addition of processor core code in a later talk.
GoLightly - a customisable virtual machine written in GoEleanor McHugh
A brief overview of the Go programming language and how it might be used to build a simple customisable virtual machine. This is a reduced and updated version of my previous Go virtual machine talks with many code examples.
Finding a useful outlet for my many Adventures in goEleanor McHugh
A talk about my Leanpub-published living eBook: A Go Developer's Notebook. Buy my book? Write your own Book using Leanpub? Learn you some Golang for fun?
going loopy - adventures in iteration with go - Eleanor McHugh - Codemotion M...Codemotion
An exploration of Go through the lens of a very simple task: iterating through a sequence of values. Starting with the basic C-like semantics of Go's for {} loop construct we'll then build through user defined types, type assertions, closures, channels and reflection to demonstrate generalised concurrent iteration. By the end of the talk we'll have covered all of Go's core language features. No familiarity with Go is required.
An introduction to functional programming with goEleanor McHugh
A crash course in functional programming concepts using Go. Heavy on code, light on theory.
You can find the examples at https://github.com/feyeleanor/intro_to_fp_in_go
Crunching data with go: Tips, tricks, use-casesSergii Khomenko
Talk for the first meetup of Munich Golang User Group. Described use-cases from real Go development, covered fetching data from sql database, connecting to Google services like Google Analytics, Google BigQuery, other aspect of building a geolocation application.
Why we are submitting this talk? Because Go is cool and we would like to hear more about this language ;-). In this talk we would like to tell you about our experience with development of microservices with Go. Go enables devs to create readable, fast and concise code, this - beyond any doubt is important. Apart from this we would like to leverage our test driven habbits to create bulletproof software. We will also explore other aspects important for adoption of a new language.
JDD 2016 - Philippe Charrière - Golo, The Tiny Language That Gives Super PowersPROIDEA
Golo is a little dynamic language for the JVM
Golo is built from the first day with invokedynamic
Golo is light (~700 kb) and fast
I'm not a Java Ninja, nor an invokedynamic Ninja, however I can do a lot of (greats) things easily with Golo.
I'm not a Java Ninja, nor an invokedynamic Ninja, however I can do a lot of (great) things easily with Golo.
Golo is easy to learn, to use and to hack
I will present:
- The basics of Golo
- Some specific features of Golo (DynamicObjects, Structures, Functional Types)
- How Golo loves Java and how you can easily develop tools (like small DSL: I use Golo scripts to prepare my GitHub Demonstrations for customers, or even to simulate a CI server)
- And I think I'm not a good developer (but not the worst either), but I can hack Golo and I will explain to you how simple it is
This presentation is on advanced debugging using Java bytecodes (presented in Core Java meetup on 1st October in Accion Labs). If you are a Java developer and are interested in knowing advanced debugging techniques or understanding bytecodes, this presentation is for you.
Generics, Reflection, and Efficient CollectionsEleanor McHugh
This is a talk about how we structure and collate information so as to effectively process it, the language tools Go provides to help us do this, and the sometimes frustrating tradeoffs we must make when marry the real world with the digital.
We'll start by looking at basic collection types in Go: array, slice, map, and channel. These will then be used as the basis for our own user defined types with methods for processing the collected items.
These methods will then be expanded to take functions as parameters (the higher order functional style popularised by languages such as Ruby) and by using Go's Reflection package we will generalise them for a variety of tasks and uses cases.
Reflection adds an interpreted element to our programs with a resulting performance cost. Careful design can often minimise this cost and it may well amortise to zero on a sufficiently large collection however there is always greater code complexity to manage. When the data to be contained in a user defined collection is homogenous we can reduce much of this complexity by using Generics and our next set of examples will demonstrate this.
At the end of this talk you should have some useful ideas for designing your own collection types in Go as well as a reasonable base from which to explore Reflection, Generics, and the Higher-Order Functional style of programming.
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on PyGame Tutorial covers all the basic aspects of creating and running your own simple game. It establishes the concepts needed like images, sounds, geometry etc needed to build your own games using Python. Below is the agenda of this PPT:
What is PyGame?
Installing PyGame
Anatomy of PyGame
Working with Images
Working with Sounds
Working with Geometric Drawings
Working with Fonts and Text
Understanding Input Methods
Understanding Scene Logic
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
The first cut of a talk on the R&D process in software development, including taking an invention to patent.
Includes two sets of code examples. One is Forth implemented in a 1980s dialect of Basic.
The other introduces evolutionary prototyping using a hybrid ruby/bash methodology.
Go for the paranoid network programmer, 3rd editionEleanor McHugh
Draft third edition of my #golang network programming and cryptography talk given to the Belfast Gophers Meetup. Now with an introduction to websockets.
Implementing virtual machines in go & c 2018 reduxEleanor McHugh
An updated version of my talk on virtual machine cores comparing techniques in C and Go for implementing dispatch loops, stacks & hash maps.
Lots of tested and debugged code is provided as well as references to some useful/interesting books.
Digital Identity talk from Strange Loop 2018 and Build Stuff Lithuania 2018 including walkthrough of the uPass system and the design principles behind it.
Don't Ask, Don't Tell - The Virtues of Privacy By DesignEleanor McHugh
This is a fairly technical overview of the considerations involved in architecting software systems to support privacy. Rather than focus on what the law demands - something which can change across time and jurisdictions - it looks at the real problems we need to solve to know as little about the users of computer systems as possible whilst achieving their needs.
Don't ask, don't tell the virtues of privacy by designEleanor McHugh
A very light intro talk on privacy, identity, and designing with the latter to preserve the former.
Probably makes no sense at all without the audio so if it whet's your appetite dig through my other decks on these topics. Most of those have code in for the more technically minded.
An overview of the uPass digital identity system. Covers the core problem domain and the end-to-end stack from liveness to black-box transaction store. Lots of diagrams, references to all the relevant patent applications and so forth.
Implementing Software Machines in Go and CEleanor McHugh
Early draft of a tutorial on techniques for implementing virtual machines and language interpreters. Contains example programs for functional stacks and despatch loops.
The case for building software with privacy as a primary concern with a discussion of how privacy and secrecy differ.
This is followed by an introduction to practical cryptographic techniques with code in Go which can be used to secure both communications channels and data stores.
An introduction to secrecy and privacy in software system design with code examples in Go demonstrating secure transport techniques with https, tcp/tls and encrypted udp.
This talk explores the importance of privacy in internet applications before introducing a range of practical ideas for enhancing their privacy and security.
A reworking of my 2010 RubyConf lightning talk introducing Go via a concurrent implementation of MapReduce. This code is probably buggy as hell and the design awful but it's also a reasonably good intro to the full breadth of Go.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
33. package main
import . "fmt"
!
func main() {
s := []int{0, 2, 4, 6, 8}
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
Going Loopy
!33
http://slides.games-with-brains.net/
34. package main
import . "fmt"
!
func main() {
s := []int{0, 2, 4, 6, 8}
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
Going Loopy
!34
http://slides.games-with-brains.net/
35. package main
import . "fmt"
!
func main() {
s := []int{0, 2, 4, 6, 8}
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
Going Loopy
!35
http://slides.games-with-brains.net/
36. package main
import . "fmt"
!
func main() {
s := []int{0, 2, 4, 6, 8}
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
Going Loopy
!36
http://slides.games-with-brains.net/
37. package main
import . "fmt"
!
func main() {
s := []int{0, 2, 4, 6, 8}
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
Going Loopy
!37
http://slides.games-with-brains.net/
38. package main
import . "fmt"
!
func main() {
s := []int{0, 2, 4, 6, 8}
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
Going Loopy
!38
http://slides.games-with-brains.net/
48. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
for i, v := range s.([]int) {
Printf("%v: %vn", i, v)
}
}
Going Loopy
!48
http://slides.games-with-brains.net/
49. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
for i, v := range s.([]int) {
Printf("%v: %vn", i, v)
}
}
Going Loopy
!49
http://slides.games-with-brains.net/
50. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
for i, v := range s.([]int) {
Printf("%v: %vn", i, v)
}
}
Going Loopy
!50
http://slides.games-with-brains.net/
51. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
if s, ok := s.([]int); ok {
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!51
http://slides.games-with-brains.net/
52. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
if s, ok := s.([]int); ok {
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!52
http://slides.games-with-brains.net/
53. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
if s, ok := s.([]int); ok {
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!53
http://slides.games-with-brains.net/
54. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
if s, ok := s.([]int); ok {
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!54
http://slides.games-with-brains.net/
55. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
if s, ok := s.([]int); ok {
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!55
http://slides.games-with-brains.net/
56. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
if s, ok := s.([]int); ok {
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!56
http://slides.games-with-brains.net/
57. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
switch s := s.(type) {
case []int:
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!57
http://slides.games-with-brains.net/
58. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
switch s := s.(type) {
case []int:
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!58
http://slides.games-with-brains.net/
59. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
switch s := s.(type) {
case []int:
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!59
http://slides.games-with-brains.net/
60. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
switch s := s.(type) {
case []int:
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!60
http://slides.games-with-brains.net/
61. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
switch s := s.(type) {
case []int:
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!61
http://slides.games-with-brains.net/
62. package main
import . "fmt"
!
func main() {
print_slice([]int{0, 2, 4, 6, 8})
}
!
func print_slice(s interface{}) {
switch s := s.(type) {
case []int:
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!62
http://slides.games-with-brains.net/
75. package main
import . "fmt"
!
func main() {
c := make(chan int)
go func() {
for _, v := range []int{0, 2, 4, 6, 8} {
c <- v
}
close(c)
}()
Printf("elements: %vn", print_channel(c))
}
!
func print_channel(c chan int) (i int) {
for v := range c {
Printf("%v: %vn", i, v)
i++
}
return
}
Going Loopy
!75
http://slides.games-with-brains.net/
76. package main
import . "fmt"
!
func main() {
c := make(chan int)
go func() {
for _, v := range []int{0, 2, 4, 6, 8} {
c <- v
}
close(c)
}()
Printf("elements: %vn", print_channel(c))
}
!
func print_channel(c chan int) (i int) {
for v := range c {
Printf("%v: %vn", i, v)
i++
}
return
}
Going Loopy
!76
http://slides.games-with-brains.net/
77. package main
import . "fmt"
!
func main() {
c := make(chan int, 16)
go func() {
for _, v := range []int{0, 2, 4, 6, 8} {
c <- v
}
close(c)
}()
Printf("elements: %vn", print_channel(c))
}
!
func print_channel(c chan int) (i int) {
for v := range c {
Printf("%v: %vn", i, v)
i++
}
return
}
Going Loopy
!77
http://slides.games-with-brains.net/
78. package main
import . "fmt"
!
func main() {
c := make(chan int)
go func() {
for _, v := range []int{0, 2, 4, 6, 8} {
c <- v
}
close(c)
}()
Printf("elements: %vn", print_channel(c))
}
!
func print_channel(c chan int) (i int) {
for v := range c {
Printf("%v: %vn", i, v)
i++
}
return
}
Going Loopy
!78
http://slides.games-with-brains.net/
79. package main
import . "fmt"
!
func main() {
c := make(chan int)
go func() {
for _, v := range []int{0, 2, 4, 6, 8} {
c <- v
}
close(c)
}()
Printf("elements: %vn", print_channel(c))
}
!
func print_channel(c chan int) (i int) {
for v := range c {
Printf("%v: %vn", i, v)
i++
}
return
}
Going Loopy
!79
http://slides.games-with-brains.net/
80. package main
import . "fmt"
!
func main() {
c := make(chan int)
go func() {
for _, v := range []int{0, 2, 4, 6, 8} {
c <- v
}
close(c)
}()
Printf("elements: %vn", print_channel(c))
}
!
func print_channel(c chan int) (i int) {
for v := range c {
Printf("%v: %vn", i, v)
i++
}
return
}
Going Loopy
!80
http://slides.games-with-brains.net/
81. package main
import . "fmt"
!
func main() {
c := make(chan int)
go func() {
for _, v := range []int{0, 2, 4, 6, 8} {
c <- v
}
close(c)
}()
Printf("elements: %vn", print_channel(c))
}
!
func print_channel(c chan int) (i int) {
for v := range c {
Printf("%v: %vn", i, v)
i++
}
return
}
Going Loopy
!81
http://slides.games-with-brains.net/
82. package main
import . "fmt"
!
func main() {
c := make(chan int)
go func() {
for _, v := range []int{0, 2, 4, 6, 8} {
c <- v
}
close(c)
}()
Printf("elements: %vn", print_channel(c))
}
!
func print_channel(c chan int) (i int) {
for v := range c {
Printf("%v: %vn", i, v)
i++
}
return
}
Going Loopy
!82
http://slides.games-with-brains.net/
83. package main
import . "fmt"
!
func main() {
c := make(chan int)
go func() {
for _, v := range []int{0, 2, 4, 6, 8} {
c <- v
}
close(c)
}()
Printf("elements: %vn", print_channel(c))
}
!
func print_channel(c chan int) (i int) {
for v := range c {
Printf("%v: %vn", i, v)
i++
}
return
}
Going Loopy
!83
http://slides.games-with-brains.net/
84. package main
import . "fmt"
!
func main() {
c := make(chan int)
go func() {
for _, v := range []int{0, 2, 4, 6, 8} {
c <- v
}
close(c)
}()
Printf("elements: %vn", print_channel(c))
}
!
func print_channel(c chan int) (i int) {
for v := range c {
Printf("%v: %vn", i, v)
i++
}
return
}
Going Loopy
!84
http://slides.games-with-brains.net/
86. package main
import . "fmt"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] * 2 })
}
!
func print_values(s interface{}) {
switch s := s.(type) {
case func(int) int:
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s(i))
}
case []int:
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!86
http://slides.games-with-brains.net/
87. package main
import . "fmt"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] * 2 })
}
!
func print_values(s interface{}) {
switch s := s.(type) {
case func(int) int:
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s(i))
}
case []int:
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!87
http://slides.games-with-brains.net/
88. package main
import . "fmt"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] * 2 })
}
!
func print_values(s interface{}) {
switch s := s.(type) {
case func(int) int:
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s(i))
}
case []int:
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!88
http://slides.games-with-brains.net/
89. package main
import . "fmt"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] * 2 })
}
!
func print_values(s interface{}) {
switch s := s.(type) {
case func(int) int:
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s(i))
}
case []int:
for i, v := range s {
Printf("%v: %vn", i, v)
}
}
}
Going Loopy
!89
http://slides.games-with-brains.net/
90. package main
import . "fmt"
import . "reflect"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] })
}
!
func print_values(s interface{}) {
switch s := ValueOf(s); s.Kind() {
case Func:
p := []Value{ ValueOf(i) }
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s.Call(p)[0].Interface{})
}
case Slice:
for i := 0; i < s.Len(); i++ {
Printf("%v: %vn", i, s.Index(i))
}
}
}
Going Loopy
!90
http://slides.games-with-brains.net/
91. package main
import . "fmt"
import . "reflect"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] })
}
!
func print_values(s interface{}) {
switch s := ValueOf(s); s.Kind() {
case Func:
p := []Value{ ValueOf(i) }
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s.Call(p)[0].Interface{})
}
case Slice:
for i := 0; i < s.Len(); i++ {
Printf("%v: %vn", i, s.Index(i))
}
}
}
Going Loopy
!91
http://slides.games-with-brains.net/
92. package main
import . "fmt"
import . "reflect"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] })
}
!
func print_values(s interface{}) {
switch s := ValueOf(s); s.Kind() {
case Func:
p := []Value{ ValueOf(i) }
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s.Call(p)[0].Interface())
}
case Slice:
for i := 0; i < s.Len(); i++ {
Printf("%v: %vn", i, s.Index(i).Interface())
}
}
}
Going Loopy
!92
http://slides.games-with-brains.net/
93. package main
import . "fmt"
import . "reflect"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] })
}
!
func print_values(s interface{}) {
switch s := ValueOf(s); s.Kind() {
case Func:
p := []Value{ ValueOf(i) }
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s.Call(p)[0].Interface())
}
case Slice:
for i := 0; i < s.Len(); i++ {
Printf("%v: %vn", i, s.Index(i).Interface())
}
}
}
Going Loopy
!93
http://slides.games-with-brains.net/
94. package main
import . "fmt"
import . "reflect"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] })
}
!
func print_values(s interface{}) {
switch s := ValueOf(s); s.Kind() {
case Func:
p := []Value{ ValueOf(i) }
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s.Call(p)[0].Interface())
}
case Slice:
for i := 0; i < s.Len(); i++ {
Printf("%v: %vn", i, s.Index(i).Interface())
}
}
}
Going Loopy
!94
http://slides.games-with-brains.net/
95. package main
import . "fmt"
import . "reflect"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] })
}
!
func print_values(s interface{}) {
switch s := ValueOf(s); s.Kind() {
case Func:
p := []Value{ ValueOf(i) }
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s.Call(p)[0].Interface())
}
case Slice:
for i := 0; i < s.Len(); i++ {
Printf("%v: %vn", i, s.Index(i).Interface())
}
}
}
Going Loopy
!95
http://slides.games-with-brains.net/
96. package main
import . "fmt"
import . "reflect"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] })
}
!
func print_values(s interface{}) {
switch s := ValueOf(s); s.Kind() {
case Func:
p := []Value{ ValueOf(i) }
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s.Call(p)[0].Interface())
}
case Slice:
for i := 0; i < s.Len(); i++ {
Printf("%v: %vn", i, s.Index(i).Interface())
}
}
}
Going Loopy
!96
http://slides.games-with-brains.net/
97. package main
import . "fmt"
import . "reflect"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] })
}
!
func print_values(s interface{}) {
switch s := ValueOf(s); s.Kind() {
case Func:
p := []Value{ ValueOf(i) }
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s.Call(p)[0].Interface())
}
case Slice:
for i := 0; i < s.Len(); i++ {
Printf("%v: %vn", i, s.Index(i).Interface())
}
}
}
Going Loopy
!97
http://slides.games-with-brains.net/
98. package main
import . "fmt"
import . "reflect"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] })
}
!
func print_values(s interface{}) {
switch s := ValueOf(s); s.Kind() {
case Func:
p := []Value{ ValueOf(i) }
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s.Call(p)[0].Interface())
}
case Slice:
for i := 0; i < s.Len(); i++ {
Printf("%v: %vn", i, s.Index(i).Interface())
}
}
}
Going Loopy
!98
http://slides.games-with-brains.net/
99. package main
import . "fmt"
import . "reflect"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] })
}
!
func print_values(s interface{}) {
switch s := ValueOf(s); s.Kind() {
case Func:
p := []Value{ ValueOf(i) }
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s.Call(p)[0].Interface())
}
case Slice:
for i := 0; i < s.Len(); i++ {
Printf("%v: %vn", i, s.Index(i).Interface())
}
}
}
Going Loopy
!99
http://slides.games-with-brains.net/
100. package main
import . "fmt"
import . "reflect"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] })
}
!
func print_values(s interface{}) {
switch s := ValueOf(s); s.Kind() {
case Func:
p := []Value{ ValueOf(i) }
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s.Call(p)[0].Interface())
}
case Slice:
for i := 0; i < s.Len(); i++ {
Printf("%v: %vn", i, s.Index(i).Interface())
}
}
}
Going Loopy
!100
http://slides.games-with-brains.net/
101. package main
import . "fmt"
import . "reflect"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] })
}
!
func print_values(s interface{}) {
switch s := ValueOf(s); s.Kind() {
case Func:
p := []Value{ ValueOf(i) }
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s.Call(p)[0].Interface())
}
case Slice:
for i := 0; i < s.Len(); i++ {
Printf("%v: %vn", i, s.Index(i).Interface())
}
}
}
Going Loopy
!101
http://slides.games-with-brains.net/
102. package main
import . "fmt"
import . "reflect"
!
func main() {
s := []int{0, 2, 4, 6, 8}
print_values(s)
print_values(func(i int) int { return s[i] })
}
!
func print_values(s interface{}) {
switch s := ValueOf(s); s.Kind() {
case Func:
p := []Value{ ValueOf(i) }
for i := 0; i < 5; i++ {
Printf("%v: %vn", i, s.Call(p)[0].Interface())
}
case Slice:
for i := 0; i < s.Len(); i++ {
Printf("%v: %vn", i, s.Index(i).Interface())
}
}
}
Going Loopy
!102
http://slides.games-with-brains.net/