The document discusses various topics related to Python including functional programming, object oriented programming, scripting, testing, remoting, parsing, package management, data storage, and performance optimization. Specific Python features and libraries mentioned include list comprehensions, generators, argparse, unittest, NLTK, Redis, MongoDB, virtualenv and pip.
Курс "Программирование на Java". Лекция 07 "Бонус - Головоломки".
Java Puzzlers. Синхронизация и многопоточность. Примитивы. Объекты и классы. Исключения и финализация.
МФТИ, 2016 год. Лектор - Лаврентьев Федор Сергеевич
The goal of this presentation is to broaden your knowledge of Python, exploring some concepts and techniques you might have never heard about. I won't go into too much detail, the goal is only to inspire you to research those features and patterns.
Курс "Программирование на Java". Лекция 07 "Бонус - Головоломки".
Java Puzzlers. Синхронизация и многопоточность. Примитивы. Объекты и классы. Исключения и финализация.
МФТИ, 2016 год. Лектор - Лаврентьев Федор Сергеевич
The goal of this presentation is to broaden your knowledge of Python, exploring some concepts and techniques you might have never heard about. I won't go into too much detail, the goal is only to inspire you to research those features and patterns.
This presentation contains a quick tour in Python world. First by By comparing Java code, and the equivalent Python side by side, Second by listing some cool features in Python, finally by listing downs and ups of Python in usage; when to use python and when not.
Slides from Advaned Python lectures I gave recently in Haifa Linux club
Advanced python, Part 1:
- Decorators
- Descriptors
- Metaclasses
- Multiple inheritance
Currying and Partial Function Application (PFA)Dhaval Dalal
We look at Currying and Partial Function Application (PFA) in Functional Programming. Languages like Clojure don't have currying, but PFA, where has Haskell currying and not PFA, whereas Scala has both, Groovy wants you to call methods like curry() and rcurry(). In OO paradigm, we use DI (dependency Injection) and we will see how this is automatically subsumed using Currying and PFA.
A sprint thru Python's Natural Language ToolKit, presented at SFPython on 9/14/2011. Covers tokenization, part of speech tagging, chunking & NER, text classification, and training text classifiers with nltk-trainer.
This presentation contains a quick tour in Python world. First by By comparing Java code, and the equivalent Python side by side, Second by listing some cool features in Python, finally by listing downs and ups of Python in usage; when to use python and when not.
Slides from Advaned Python lectures I gave recently in Haifa Linux club
Advanced python, Part 1:
- Decorators
- Descriptors
- Metaclasses
- Multiple inheritance
Currying and Partial Function Application (PFA)Dhaval Dalal
We look at Currying and Partial Function Application (PFA) in Functional Programming. Languages like Clojure don't have currying, but PFA, where has Haskell currying and not PFA, whereas Scala has both, Groovy wants you to call methods like curry() and rcurry(). In OO paradigm, we use DI (dependency Injection) and we will see how this is automatically subsumed using Currying and PFA.
A sprint thru Python's Natural Language ToolKit, presented at SFPython on 9/14/2011. Covers tokenization, part of speech tagging, chunking & NER, text classification, and training text classifiers with nltk-trainer.
Basic NLP concepts and ideas using Python and NLTK framework. Explore NLP prosessing features, compute PMI, see how Python/Nltk can simplify your NLP related task.
Nltk natural language toolkit overview and application @ PyHugJimmy Lai
NLTK is a python toolkit for Natural Language Processing. In this slide, the author provides overview for NLTK and demonstrates an application in Chinese text classification.
NLTK - Natural Language Processing in Pythonshanbady
For full details, including the address, and to RSVP see: http://www.meetup.com/bostonpython/calendar/15547287/ NLTK is the Natural Language Toolkit, an extensive Python library for processing natural language. Shankar Ambady will give us a tour of just a few of its extensive capabilities, including sentence parsing, synonym finding, spam detection, and more. Linguistic expertise is not required, though if you know the difference between a hyponym and a hypernym, you might be able to help the rest of us! Socializing at 6:30, Shankar's presentation at 7:00. See you at the NERD.
Natural Language Processing (NLP) is often taught at the academic level from the perspective of computational linguists. However, as data scientists, we have a richer view of the world of natural language - unstructured data that by its very nature has important latent information for humans. NLP practitioners have benefitted from machine learning techniques to unlock meaning from large corpora, and in this class we’ll explore how to do that particularly with Python, the Natural Language Toolkit (NLTK), and to a lesser extent, the Gensim Library.
NLTK is an excellent library for machine learning-based NLP, written in Python by experts from both academia and industry. Python allows you to create rich data applications rapidly, iterating on hypotheses. Gensim provides vector-based topic modeling, which is currently absent in both NLTK and Scikit-Learn. The combination of Python + NLTK means that you can easily add language-aware data products to your larger analytical workflows and applications.
Examples: https://gist.github.com/aditya01933/c6a867e981110885369f06c5a4103644
1. 3 pillars of ruby.
2. Classes and objects.
3. Inheritance - diving deep
4. Meta programming and reflection - diving deep.
5. Power of method missing.
6. Mixins and ducktyping
7. Super - diving deep
8. Yield
9. Closure
10. Block, proc and lambda
11. More meta programming(examples).
12. Ruby open classes.
ITT 2015 - Saul Mora - Object Oriented Function ProgrammingIstanbul Tech Talks
Functional programming is finally a first class citizen in the Cocoa toolset! But, as you may have heard, Swift is not necessarily a pure functional language. And in embracing the functional paradigm, do you need to throw out your knowledge and experience with Object Oriented programming? Saul Mora shows that it turns out you can have your cake and eat it too!
Python classes in mumbai
best Python classes in mumbai with job assistance.
our features are:
expert guidance by it industry professionals
lowest fees of 5000
practical exposure to handle projects
well equiped lab
after course resume writing guidance
Python training slides for beginners that I lecture. Starts from python versions to popular 3 party libraries. Arguments, interactive modes, variable types, language keywords, functions, class etc. If you want to get training please look www.ismailbaydan.com for more details.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
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.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
The Metaverse and AI: how can decision-makers harness the Metaverse for their...Jen Stirrup
The Metaverse is popularized in science fiction, and now it is becoming closer to being a part of our daily lives through the use of social media and shopping companies. How can businesses survive in a world where Artificial Intelligence is becoming the present as well as the future of technology, and how does the Metaverse fit into business strategy when futurist ideas are developing into reality at accelerated rates? How do we do this when our data isn't up to scratch? How can we move towards success with our data so we are set up for the Metaverse when it arrives?
How can you help your company evolve, adapt, and succeed using Artificial Intelligence and the Metaverse to stay ahead of the competition? What are the potential issues, complications, and benefits that these technologies could bring to us and our organizations? In this session, Jen Stirrup will explain how to start thinking about these technologies as an organisation.
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.
Enhancing Performance with Globus and the Science DMZGlobus
ESnet has led the way in helping national facilities—and many other institutions in the research community—configure Science DMZs and troubleshoot network issues to maximize data transfer performance. In this talk we will present a summary of approaches and tips for getting the most out of your network infrastructure using Globus Connect Server.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Essentials of Automations: The Art of Triggers and Actions in FME
Python & Stuff
1. Python & Stuff
All the things I like about Python, plus a bit more.
Friday, November 4, 11
2. Jacob Perkins
Python Text Processing with NLTK 2.0 Cookbook
Co-Founder & CTO @weotta
Blog: http://streamhacker.com
NLTK Demos: http://text-processing.com
@japerk
Python user for > 6 years
Friday, November 4, 11
3. What I use Python for
web development with Django
web crawling with Scrapy
NLP with NLTK
argparse based scripts
processing data in Redis & MongoDB
Friday, November 4, 11
5. Functional Programming
list comprehensions
slicing
iterators
generators
higher order functions
decorators
default & optional arguments
switch/case emulation
Friday, November 4, 11
6. List Comprehensions
>>> [i for i in range(10) if i % 2]
[1, 3, 5, 7, 9]
>>> dict([(i, i*2) for i in range(5)])
{0: 0, 1: 2, 2: 4, 3: 6, 4: 8}
>>> s = set(range(5))
>>> [i for i in range(10) if i in s]
[0, 1, 2, 3, 4]
Friday, November 4, 11
12. Default & Optional Args
>>> def special_arg(special=None, *args, **kwargs):
... print 'special:', special
... print args
... print kwargs
...
>>> special_arg(special='hi')
special: hi
()
{}
>>>
>>> special_arg('hi')
special: hi
()
{}
Friday, November 4, 11
13. switch/case emulation
OPTS = {
“a”: all,
“b”: any
}
def all_or_any(lst, opt):
return OPTS[opt](lst)
Friday, November 4, 11
14. Object Oriented
classes
multiple inheritance
special methods
collections
defaultdict
Friday, November 4, 11
15. Classes
>>> class A(object):
... def __init__(self):
... self.value = 'a'
...
>>> class B(A):
... def __init__(self):
... super(B, self).__init__()
... self.value = 'b'
...
>>> a = A()
>>> a.value
'a'
>>> b = B()
>>> b.value
'b'
Friday, November 4, 11
16. Multiple Inheritance
>>> class B(object):
... def __init__(self):
... self.value = 'b'
...
>>> class C(A, B): pass
...
>>> C().value
'a'
>>> class C(B, A): pass
...
>>> C().value
'b'
Friday, November 4, 11
17. Special Methods
__init__
__len__
__iter__
__contains__
__getitem__
Friday, November 4, 11
18. collections
high performance containers
Abstract Base Classes
Iterable, Sized, Sequence, Set, Mapping
multi-inherit from ABC to mix & match
implement only a few special methods, get
rest for free
Friday, November 4, 11
19. defaultdict
>>> d = {}
>>> d['a'] += 2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'a'
>>> import collections
>>> d = collections.defaultdict(int)
>>> d['a'] += 2
>>> d['a']
2
>>> l = collections.defaultdict(list)
>>> l['a'].append(1)
>>> l['a']
[1]
Friday, November 4, 11
21. Context Managers
>>> with open('myfile', 'w') as f:
... f.write('hellonworld')
...
Friday, November 4, 11
22. File Iteration
>>> with open('myfile') as f:
... for line in f:
... print line.strip()
...
hello
world
Friday, November 4, 11
23. gevent / eventlet
coroutine networking libraries
greenlets: “micro-threads”
fast event loop
monkey-patch standard library
http://www.gevent.org/
http://www.eventlet.net/
Friday, November 4, 11
24. Scripting
argparse
__main__
atexit
Friday, November 4, 11
25. argparse
import argparse
parser = argparse.ArgumentParser(description='Train a
NLTK Classifier')
parser.add_argument('corpus', help='corpus name/path')
parser.add_argument('--no-pickle', action='store_true',
default=False, help="don't pickle")
parser.add_argument('--trace', default=1, type=int,
help='How much trace output you want')
args = parser.parse_args()
if args.trace:
print ‘have args’
Friday, November 4, 11
26. __main__
if __name__ == ‘__main__’:
do_main_function()
Friday, November 4, 11
27. atexit
def goodbye(name, adjective):
print 'Goodbye, %s, it was %s to meet you.' % (name,
adjective)
import atexit
atexit.register(goodbye, 'Donny', 'nice')
Friday, November 4, 11
28. Testing
doctest
unittest
nose
fudge
py.test
Friday, November 4, 11
29. doctest
def fib(n):
'''Return the nth fibonacci number.
>>> fib(0)
0
>>> fib(1)
1
>>> fib(2)
1
>>> fib(3)
2
>>> fib(4)
3
'''
if n == 0: return 0
elif n == 1: return 1
else: return fib(n - 1) + fib(n - 2)
Friday, November 4, 11
30. doctesting modules
if __name__ == ‘__main__’:
import doctest
doctest.testmod()
Friday, November 4, 11
31. unittest
anything more complicated than function I/O
clean state for each test
test interactions between components
can use mock objects
Friday, November 4, 11
32. nose
http://readthedocs.org/docs/nose/en/latest/
test runner
auto-discovery of tests
easy plugin system
plugins can generate XML for CI (Jenkins)
Friday, November 4, 11
33. fudge
http://farmdev.com/projects/fudge/
make fake objects
mock thru monkey-patching
Friday, November 4, 11
34. py.test
http://pytest.org/latest/
similar to nose
distributed multi-platform testing
Friday, November 4, 11
36. Fabric
http://fabfile.org
run commands over ssh
great for “push” deployment
not parallel yet
Friday, November 4, 11
37. fabfile.py
from fabric.api import run
def host_type():
run('uname -s')
fab command
$ fab -H localhost,linuxbox host_type
[localhost] run: uname -s
[localhost] out: Darwin
[linuxbox] run: uname -s
[linuxbox] out: Linux
Friday, November 4, 11
38. execnet
http://codespeak.net/execnet/
open python interpreters over ssh
spawn local python interpreters
shared-nothing model
send code & data over channels
interact with CPython, Jython, PyPy
py.test distributed testing
Friday, November 4, 11
46. import
import module
from module import function, ClassName
from module import function as f
always make sure package directories have
__init__.py
Friday, November 4, 11
48. virtualenv
http://www.virtualenv.org/en/latest/
create self-contained python installations
dependency silos
works great with pip (same author)
Friday, November 4, 11
49. mercurial
http://mercurial.selenic.com/
Python based DVCS
simple & fast
easy cloning
works with Bitbucket, Github, Googlecode
Friday, November 4, 11
54. CPU
probably fast enough if I/O or DB bound
try PyPy: http://pypy.org/
use CPython optimized libraries like numpy
write a CPython extension
Friday, November 4, 11
55. RAM
don’t keep references longer than needed
iterate over data
aggregate to an optimized DB
Friday, November 4, 11
56. import this
>>> import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
Friday, November 4, 11