The document provides an overview of several Python standard library modules for common application building blocks:
1) Modules like getopt, optparse, and argparse can be used to parse command line arguments; readline, cmd, and shlex handle interactive programs and command line processing.
2) The ConfigParser module can be used to manage application configuration files, while the logging module provides APIs for writing log messages to files.
3) Other modules mentioned include atexit for registering shutdown functions and sched for scheduling tasks. Examples are given demonstrating basic usage of the various argument parsing, configuration, and logging modules.
Basics of Iterators and Generators,Uses of iterators and generators in python. advantage of iterators and generators. difference between generators and iterators.
Basics of Iterators and Generators,Uses of iterators and generators in python. advantage of iterators and generators. difference between generators and iterators.
If any class have multiple functions with same names but different parameters then they are said to be overloaded. Function overloading allows you to use the same name for different functions, to perform, either same or different functions in the same class.
If you have to perform one single operation but with different number or types of arguments, then you can simply overload the function.
It tells about functions in C++,Types,Use,prototype,declaration,Arguments etc
function with
A function with no parameter and no return value
A function with parameter and no return value
A function with parameter and return value
A function without parameter and return value
Call by value and address
This presentation covers a detailed overview of python advanced concepts. it covers the below aspects.
Comprehensions
Lambda with (map, filter and reduce)
Context managers
Iterator, Generators, Decorators
Python GIL and multiprocessing and multithreading
Python WSGI
Python Unittests
This presentation contains basics of Python language for anyone novice to start with. Towards the end there is a brute force python script in Kali Linux.
If any class have multiple functions with same names but different parameters then they are said to be overloaded. Function overloading allows you to use the same name for different functions, to perform, either same or different functions in the same class.
If you have to perform one single operation but with different number or types of arguments, then you can simply overload the function.
It tells about functions in C++,Types,Use,prototype,declaration,Arguments etc
function with
A function with no parameter and no return value
A function with parameter and no return value
A function with parameter and return value
A function without parameter and return value
Call by value and address
This presentation covers a detailed overview of python advanced concepts. it covers the below aspects.
Comprehensions
Lambda with (map, filter and reduce)
Context managers
Iterator, Generators, Decorators
Python GIL and multiprocessing and multithreading
Python WSGI
Python Unittests
This presentation contains basics of Python language for anyone novice to start with. Towards the end there is a brute force python script in Kali Linux.
Material ini digunakan untuk kelas teknologi pengenalan pemrograman dengan bahasa pengantar Python http://oo.or.id/py
Dipublikasikan dengan lisensi Atribusi-Berbagi Serupa Creative Commons (CC BY-SA) oleh oon@oo.or.id
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.
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.
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.
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/
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!
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
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.
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
Connector Corner: Automate dynamic content and events by pushing a button
Python advanced 3.the python std lib by example – application building blocks
1. THE PYTHON STD LIB BY EXAMPLE
– APPLICATION BUILDING BLOCKS
John
Saturday, December 21, 2013
2. Brief introduction
• This lesson covers some of the more frequently
reused building blocks that solve problems
common to many applications
• Command-line argument parsing: module
getopt,optparse,argparse.
• Interactive programs: readline, cmd,
shlex,fileinput
• Manage application configuration: ConfigParser
• Manage log file: logging
• Others: atexit, sched etc
3. Module getopt – option parsing
• The getopt() take 3 arguments:
1. The sequeence of arguments to be parsed.
Usually it is sys.argv[1:]
2. Single-character option, following a colon(:)
mean it require an argument. E.g. ab:c:, it mean
a is -a simple flag, while –b and –c require an
argument.
3. It is optional. If used, it is a list of long-style
option names. Having suffix “=“ means ruquire
an argument. E.g [‘noarg’,’witharg=‘]
4. Quick example 1
# file test.py
import getopt
import sys
opts,args = getopt.getopt(sys.argv[1:],’ab:c:’)
for opt in opts:
print opt
•Then run command line “python test.py –a –b valb –c valc”, the output
should be
('-a', '')
('-b', 'val')
('-c', 'val')
5. quick example 2
# file test.py
import getopt
import sys
opts,args = getopt.getopt(sys.argv[1:],’’,[‘opta’,’optb=‘,’optc=‘])
for opt in opts:
print opt
•run command line “python test.py --opta --optb val --optc val”
('--opta', '')
('--optb', 'val')
('--optc', 'val')
8. More options in add_option
method
• option dest: the attribute name
• option default: the default value. also can be set in
set_defaults method.
• option type: convert the argument string to specific type,
e.g. int, float,string
• option choices: validation use a list of candidate strings. e.g.
choices=[‘a’,’b’,’c’] . the valid value should be ‘a’, or ‘b’ or ‘c’
• option help: help message
• option action: store, store_const,store_true,append,acount
9. Module argparse
• argparse added to python 2.7 as a
replacement of optparse.
• Change the OptionParser by ArgumentParser,
and add_option by add_argument in
previous example.
10. More Options of ArgumentParser
• add help automatically:
parser = argparse.ArgumentParser(add_help=True)
• version control: version=‘1.0’ (-v or --version
will show the version number)
11. More options of add_argument
method
• All options in optparse.add_option method.
• option nargs: number of expected
arguments. (? mean 0 or 1 arguments, *
means 0 or all, + means 1 or all).
example
parser.add_argument(‘-c’,nargs=3)
we need write command line “perl -c 1 2 3”
12. Module getpass: handle passowrd
prompts securely
• print a promt and then read input from the user.
• We can change the prompt:
getpass(prompt=‘what is your favorite color?’)
14. brief introduction
• the Cmd class is used as base class for
interactive shells and other command
interpreters.
• It can provide interactive prompt, commandline editing, and command completion.
15. quick example
• method do_greet() connect with command “greet”
• method help_greet() connect with command “help greet”
16. auto-completion
• auto-completion is already enabled in previous
example.
• if user want to do user-defined on auto-completion,
use complete_<comand> (e.g. complete_greet() )
17. Overrite Base Class method
• Method cmploop(intro) is the main
processing loop. Each iteration in cmdloop
call parseline and onecmd.
• Method emptyline: behavior if emptyline.
Default behavior is that rerun previous
command.
• Method default: default method if command
is not found.
18. Running shell command
• An exclamation point(!) map to the do_shell()
method and is intended “shelling out” to run other
commands.
• First import subprocess module.
• Second, define do_shell() method
20. Brief introduction
• The logging module define standard API for
reporting error and status information.
• Both application developer and module
author benefit from this module, but has
different considerations.
22. The level of the events logging
tracks
Level
Numeric
value
When it’s used
DEBU Detailed information, typically of interest only when
G
diagnosing problems.
INFO Confirmation that things are working as expected.
An indication that something unexpected happened, or
WAR
indicative of some problem in the near future (e.g. ‘disk space
NING
low’). The software is still working as expected.
ERRO Due to a more serious problem, the software has not been
R
able to perform some function.
CRITIC A serious error, indicating that the program itself may be
AL
unable to continue running.
10
20
30
40
50
23. Best practice: logging in single file
import logging
logging.basicConfig(level=logging.WARNING) # Only the level
equal or alove this level can be displayed.
logging.debug('This message should go to the log file')
logging.info('So should this')
logging.warning('And this, too')
•Write the log to file:
logging.basicConfig(filename='example.log',level=logging.DEBU
G)
24. Best practice: Logging from
multiple modules
• Define logging config
in main file
• Write log in other files