This document summarizes a class lecture on imperative programming. It discusses list appending vs mutable list appending and how the latter does not create new cons cells. It then compares the performance of list appending vs built-in append for immutable lists. Mutable list reversing is discussed, with an exercise to implement mlist-reverse! efficiently without extra consing. Students are reminded that problem set 5 is due Friday unless they provide feedback on exercises or the online course book, in which case it can be turned in on Monday.
As part of our Qiskit learning, we have this notebook sample that demonstrates the different generic quantum neural network (QNN) implementations provided in Qiskit Machine Learning. The networks are meant as application-agnostic computational units that can be used for many different use cases
New and delete are a thing of the past, with the new features in C++14 and beyond (such as smart pointers and move semantics) memory management is easier and safer. Learn how to use the new constructs of C++14 and beyond to create, move, and free objects in a safer and more efficient manner.
Jokingly casual introduction that scales quickly to the obscure powers of bash script.
Intended to call the attention of devs and ops, and bridge the perception of the complexity on each other sides with things too familiar and yet too far out for both.
A reminder of the capacity we have in our hands if we dare to use it.
It is in portuguese, but the language that counts here is bash script.
As part of our Qiskit learning, we have this notebook sample that demonstrates the different generic quantum neural network (QNN) implementations provided in Qiskit Machine Learning. The networks are meant as application-agnostic computational units that can be used for many different use cases
New and delete are a thing of the past, with the new features in C++14 and beyond (such as smart pointers and move semantics) memory management is easier and safer. Learn how to use the new constructs of C++14 and beyond to create, move, and free objects in a safer and more efficient manner.
Jokingly casual introduction that scales quickly to the obscure powers of bash script.
Intended to call the attention of devs and ops, and bridge the perception of the complexity on each other sides with things too familiar and yet too far out for both.
A reminder of the capacity we have in our hands if we dare to use it.
It is in portuguese, but the language that counts here is bash script.
Go is a language developed by Google with multi-core in mind. Differ from other languages, concurrency is a first-class primitive in Go. This talk covers some useful patterns for dealing with concurrency.
Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013Gregg Donovan
Understanding the impact of garbage collection, both at a single node and a cluster level, is key to developing high-performance, high-availability Solr and Lucene applications. After a brief overview of garbage collection theory, we will review the design and use of the various collectors in the JVM.
At a single-node level, we will explore GC monitoring -- how to understand GC logs, how to monitor what % of your Solr request time is spend on GC, how to use VisualGC, YourKit, and other tools, and what to log and monitor. We will review GC tuning and how to measure success.
At a cluster-level, we will review how to design for partial availability -- how to avoid sending requests to a GCing node and how to be resilient to mid-request GC pauses.For application development, we will review common memory leak scenarios in custom Solr and Lucene application code and how to detect them.
Cluj Big Data Meetup - Big Data in PracticeSteffen Wenz
At the Cluj Big Data Meetup, we shared some insights into TrustYou's big data tech stack. Also we introduced two tools which we've found useful in our production jobs: Apache Pig and Luigi.
Also check out the code samples on GitHub: https://github.com/trustyou/meetups/tree/master/big-data
Slides for the Cluj.py meetup where we explored the inner workings of CPython, the reference implementation of Python. Includes examples of writing a C extension to Python, and introduces Cython - ultimately the sanest way of writing C extensions.
Also check out the code samples on GitHub: https://github.com/trustyou/meetups/tree/master/python-c
Go is a simple language with familiar syntax, but still, there are features, which implementation differs from most part of other programming languages. For example, the idea of CSP implemented as concurrency paradigm is used for parallelism in Go. It looks like a simple API, but under the hood, it is very complicated, but interesting mechanism. We will discuss, how it really works.
(Slides from the speech on Kharkiv Go meetup 14 Sep 2019)
This sample offers insights of how qubit superpositions and entanglements are possible and how these are represented in statevectors, blockspheres and amplitudes when statevector representations are not possible
Course: Programming Languages and Paradigms:
A brief introduction to imperative programming principles: history, von neumann, BNF, variables (r-values, l-values), modifiable data structures, order of evaluation, static and dynamic scopes, referencing environments, call by value, control flow (sequencing, selection, iteration), ...
Go is a language developed by Google with multi-core in mind. Differ from other languages, concurrency is a first-class primitive in Go. This talk covers some useful patterns for dealing with concurrency.
Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013Gregg Donovan
Understanding the impact of garbage collection, both at a single node and a cluster level, is key to developing high-performance, high-availability Solr and Lucene applications. After a brief overview of garbage collection theory, we will review the design and use of the various collectors in the JVM.
At a single-node level, we will explore GC monitoring -- how to understand GC logs, how to monitor what % of your Solr request time is spend on GC, how to use VisualGC, YourKit, and other tools, and what to log and monitor. We will review GC tuning and how to measure success.
At a cluster-level, we will review how to design for partial availability -- how to avoid sending requests to a GCing node and how to be resilient to mid-request GC pauses.For application development, we will review common memory leak scenarios in custom Solr and Lucene application code and how to detect them.
Cluj Big Data Meetup - Big Data in PracticeSteffen Wenz
At the Cluj Big Data Meetup, we shared some insights into TrustYou's big data tech stack. Also we introduced two tools which we've found useful in our production jobs: Apache Pig and Luigi.
Also check out the code samples on GitHub: https://github.com/trustyou/meetups/tree/master/big-data
Slides for the Cluj.py meetup where we explored the inner workings of CPython, the reference implementation of Python. Includes examples of writing a C extension to Python, and introduces Cython - ultimately the sanest way of writing C extensions.
Also check out the code samples on GitHub: https://github.com/trustyou/meetups/tree/master/python-c
Go is a simple language with familiar syntax, but still, there are features, which implementation differs from most part of other programming languages. For example, the idea of CSP implemented as concurrency paradigm is used for parallelism in Go. It looks like a simple API, but under the hood, it is very complicated, but interesting mechanism. We will discuss, how it really works.
(Slides from the speech on Kharkiv Go meetup 14 Sep 2019)
This sample offers insights of how qubit superpositions and entanglements are possible and how these are represented in statevectors, blockspheres and amplitudes when statevector representations are not possible
Course: Programming Languages and Paradigms:
A brief introduction to imperative programming principles: history, von neumann, BNF, variables (r-values, l-values), modifiable data structures, order of evaluation, static and dynamic scopes, referencing environments, call by value, control flow (sequencing, selection, iteration), ...
The objectives of the seminar are to shed a light on the premises of FP and give you a basic understanding of the pillars of FP so that you would feel enlightened at the end of the session. When you walk away from the seminar you should feel an inner light about the new way of programming and an urge & motivation to code like you never before did!
Functional programming should not be confused with imperative (or procedural) programming. Neither it is like object oriented programming. It is something different. Not radically so, since the concepts that we will be exploring are familiar programming concepts, just expressed in a different way. The philosophy behind how these concepts are applied to solving problems are also a little different. We shall learn and talk about essentially the fundamental elements of Functional Programming.
Lisp and prolog in artificial intelligenceArtiSolanki5
lisp programming (to print hello world,to find the area of circle,to print odd number from 1-20, the average of 10,20,30,40,defining macro
,arithmetic operator, comparision operator,logica operator,
decision constructs ( cond, if, when ,case),loops(loop for, do, do times ,do list) predicate ,factorial of a number ,array, string , sequence ,list, exiting from the block , let function , prog function ,formatted output.
PROLOG
(printing hello world in console , use of variable in our query, program to find the minimum of two numbers and the maximum of two numbers ,
prolog program to find the equivalent resistance,
working of arithmetic operator in prolog ,prolog program to find the cube of a number, backtracking ,prolog program to concatenate two list,
prolog program to find length of a list ,
prolog program to print values from 1 to 10 using loop
User Defined Aggregation in Apache Spark: A Love StoryDatabricks
Defining customized scalable aggregation logic is one of Apache Spark’s most powerful features. User Defined Aggregate Functions (UDAF) are a flexible mechanism for extending both Spark data frames and Structured Streaming with new functionality ranging from specialized summary techniques to building blocks for exploratory data analysis.
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for CypherpunksDavid Evans
David Evans
DC Area Crypto Day
Johns Hopkins University
30 October 2015
This (non-research) talk will start with a tutorial introduction to cryptocurrencies and how bitcoin works (and doesn’t work) today. We’ll touch on some of the legal, policy, and business aspects of bitcoin and discuss some potential research opportunities in cryptocurrencies.
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.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
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
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
2. Menu Running time
practice throughout!
Recap: list-append vs. mlist-append!
Aliasing
mlist-reverse!
I haven’t yet written solutions to the Chapter 9 Exercises, but I will do it soon if
at least 3 people provide some evidence that they are trying to solve them!
You can do this by posting your solutions or questions as comments on today’s
class. I also how to see more comments/suggestions for the ElevenLearning
version of the book (post here: http://www.cs.virginia.edu/cs1120/all/2011/on-
line-version-of-course-book). If you do at least one of these, you can turn in
PS5 at Monday’s class with no penalty.
4. Appending vs. Appending!
(define (mlist-append! p q)
(define (list-append p q)
(if (null? p)
(if (null? p) q
(error “Cannot append to empty!”)
(cons
(if (null? (mcdr p))
(car p)
(set-mcdr! p q)
(list-append (cdr p) q))))
(mlist-append! (mcdr p) q))))
Running time in
(Np), Np is number of Running time in
elements in p (Np), number of elements
in p
Number of new cons
cells: (Np) Number of new cons cells: 0
4
5. Does it matter?
To test: Define a procedure to make a list of length n.
5
6. (define (make-list n)
(if (= n 0) null
> (define p1 (make-list 100000))
(cons 0 (make-list (- n 1)))))
> (define p2 (make-list 100000))
> (time (begin (list-append p1 p2) (void)))
cpu time: 78 real time: 77 gc time: 47 (define (make-mlist n)
> (length p1) (if (= n 0) null
100000 (mcons 0 (make-mlist (- n 1)))))
> (define m1 (make-mlist 100000))
> (define m2 (make-mlist 100000)) > (time (begin (list-append p1 p2) (void)))
> (time (mlist-append! m1 m2)) cpu time: 78 real time: 77 gc time: 47
cpu time: 0 real time: 13 gc time: 0 > (time (begin (list-append p1 p2) (void)))
> (mlength m1) cpu time: 78 real time: 83 gc time: 31
200000 > (time (begin (list-append p1 p2) (void)))
> (time (mlist-append! m1 m2)) cpu time: 78 real time: 73 gc time: 31
> (time (begin (list-append p1 p2) (void)))
cpu time: 31 real time: 26 gc time: 0
cpu time: 93 real time: 90 gc time: 31
> (time (mlist-append! m1 m2))
6
7. > (time (begin (append p1 p2) (void)))
cpu time: 0 real time: 1 gc time: 0
> (time (begin (append p1 p2) (void)))
cpu time: 0 real time: 2 gc time: 0
> (define p200k (append p1 p2))
> (define p400k (append p200k p200k))
> (define p800k (append p400k p400k))
What about > (define p1600k (append p800k p800k))
> (length p1600k)
the built-in 1600000
> (time (begin (append p400k p400k) (void)))
cpu time: 0 real time: 6 gc time: 0
append? > (time (begin (append p800k p800k) (void)))
cpu time: 109 real time: 110 gc time: 94
> (time (begin (append p1600k p1600k) (void)))
cpu time: 1045 real time: 1044 gc time: 999
> (time (begin (append p1600k p1600k) (void)))
Possible reason built-in append is so much faster:real time: 160 gc time: 125
cpu time: 171
Internal list representation doesn’t > (time (begin (append p1600k p1600k) (void)))
have to be just cons
pairs (could jump quickly over many cells) 203 real time: 197 gc time: 171
cpu time:
Because lists are immutable, doesn’t have to copy list!
7
8. What about the built-in mappend!
> (require racket/mpair)
> (time (begin (mappend! m1 m2) (void)))
cpu time: 0 real time: 1 gc time: 0
> (time (begin (mappend! m1 m2) (void)))
cpu time: 0 real time: 1 gc time: 0
> (time (begin (mappend! m1 m2) (void)))
8
9. Still waiting…
Favorite response to Exam Question 14:
What topics to you hope to see in the remainder of the
course?:
“I can’t even begin to anticipate
what will come next – most of
what we’ve done so far has
already blown my mind.”
9
16. Reversing
(define (list-reverse p)
(if (null? p) null
(list-append (list-reverse (cdr p)) (list (car p)))))
Running time is in (N2)
where N is number of elements in p.
Number of new cons cells:
for the list-appends: N-1 + N-2 + … + 1 = N2/ 2
+ for the (list (car p)): N
memory use is in (N2)
16
17. mlist-reverse!
Define a mlist-reverse! that reverses the elements of a
mutable list. The output should be a mutable list with
the elements in the reverse order. The number of cons
cells it creates should not scale with the length of the
list. (The input list can be mutated arbitrarily!)
17
18. Charge
PS5 Due Friday
Except as noted earlier: if you post a
comment/suggestion about the
ElevenLearning book or a comment that
suggests you are trying the Chapter 9 book
exercises then it is due Monday