The Tutorial allows you to perfectly use Objenesis. However, if you want implementation details, tools and more power, you're at the right place.
Depending on your JVM and security manager, Objenesis might not be able to instantiate some of your classes. If that's the case, first, we are highly interested in knowing this limitation.
Then, to prevent this, we provide a TCK to run in your environment. You can find it on our download page. It will print a report to the standard output. Exceptions, if they occur, will be printed out to the standard error. Tests are run against ObjenesisStd and ObjenesisSerializer and are made of every kind of class types you might want to instantiate. So you can check if all of them or at least the kind you want are correctly instantiated.
To launch from the command line, just type
java -jar objenesis-${project.version}-tck.jar
Note that the Objenesis jar is bundled in the TCK so no special classpath is needed.
To launch from within an application server, the easiest is to bundle it in your application
and to call org.objenesis.tck.Main.main()
from your code.
Objenesis also works on Dalvik, the Android VM. So a TCK is also provided for it in the form of an apk. You can also find it on download page. Just use the following command to install and run it.
adb install -r objenesis-tck-android-${project.version}.apk adb shell am instrument -w org.objenesis.tck.android/.TckInstrumentation
If something wrong occurs using Objenesis, you will normally get an ObjenesisException wrapping the real exception. It is a RuntimeException so you don't have to catch it. Some reasons why it fails:
Serializable
.Serializable
throws an exception.ObjenesisBase provides a built-in cache that is activated by default. This cache keeps ObjectInstantiator instances per Class. This improves performance quite a lot when the same Class is frequently instantiated. For this reason, it is recommended to reuse Objenesis instances whenever possibly or to keep is as a singleton in your favorite dependency injection framework.
However, you can always disable the cache if needed.
Objenesis o = new ObjenesisStd(false); // cache disabled
The cache should behave correctly in an application server and not cause any memory leaks.
As you've seen in the Tutorial, Objenesis implementations are determining the best instantiator using a strategy. It might occurs that you need to implement your own strategy. Two possible reasons I can think of are that
public class Sun14Strategy implements InstantiatorStrategy { public ObjectInstantiator newInstantiatorOf(Class type) { // return sun dedicated instantiator return new SunReflectionFactoryInstantiator(type); } }
From there, you can use this new strategy.
// Directly Objenesis o = new ObjenesisBase(new Sun14Strategy()); // Or inside your Objenesis own implementation public class ObjenesisSun14 extends ObjenesisBase { public ObjenesisSun14() { super(new Sun14Strategy()); } }
Also, if Objenesis can't find the right instantiator to use by itself, this doesn't mean it doesn't bundle an instantiator that works on your platform. To try to find one, we provide a nice tool that will run through all the instantiators and tell you which ones work
java -cp objenesis-${project.version}-tck.jar org.objenesis.tck.search.SearchWorkingInstantiator
Some culprits:
Static methods are considered a really bad practice. They can't be mocked or replace easily. Worst, if the class keep a static state, you will fell in class loading issues, memory leaks, module dependencies and so on. We strongly recommend you not to use them.
However, if for some reason that we prefer ignore, you still want to use Objenesis in a static way, you can do so. It's called ObjenesisHelper.
We prefer to provide it knowing that some of you will code it anyway. It a wrapper over an ObjenesisStd and ObjenesisSerializer instance which are kept statically.
It can't be more straightforward to use:
Object o1 = ObjenesisHelper.newInstance(MyClass.class); Object o2 = ObjenesisHelper.newSerializableInstance(MyClass.class); ObjectInstantiator o3 = ObjenesisHelper.getInstantiatorOf(MyClass.class); ObjectInstantiator o4 = ObjenesisHelper.getSerializableObjectInstantiatorOf(MyClass.class);
The instantiator returned by SerializingInstantiatorStrategy
will do the following.
Externalizable
classes won't have a special treatment. If you want one, implement it yourselfreadResolve, readExternal, readObject, readObjectNoData
)


Ticket Prices:
$20 for Adults
$15 for Students
$35 for 2 day pass + one drink voucher
Extra cost for Opening and Closing Gala parties
To celebrate our multiculturalism, provide support for local artists, and bring communities together through uniquely Canadian films by traveling from sea to sea to sea.
We stop in all provinces and territories! From small towns to big cities, follow along to see where we're stopping next and take a look at our full list of films!
New Brunswick - Saint John
Newfoundland and Labrador - Corner Brook
Nova Scotia - Lunenburg
Prince Edward Island - Summerside (Closing Gala)
Ontario - Elora
Quebec - Trois-Rivieres
Alberta - Canmore
Manitoba - Brandon
Saskatchewan - Moose Jaw
British Columbia - Nelson (Opening Gala)
Northwest Territories - Inuvik
Nunavut - Arviat
Yukon - Dawson


--- title: Medical Text keywords: fastai sidebar: home_sidebar summary: "Medical NLP data and models" description: "Medical NLP data and models" ---
fastai.medical.text is coming in late 2019 or early 2020!
fastai.medical.text
from nbdev.showdoc import *


Short description for file.
Long description for file
PHP versions 4 and 5
CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
Licensed under The MIT License Redistributions of files must retain the above copyright notice.
Enter description here...
Enter description here...
Documentation generated on Fri, 06 Nov 2009 10:53:57 +0900 by phpDocumentor 1.4.3


Arada Cinema™
Pause Life and Come Watch a Movie
Home
Cinema Preview
Cinema 1
Cinema 2
Premium
Elegant
Movies
About Us
Trending Now
Book Movie
Saved for later
Watch later
Viuva Herrar
Price: 80ETB
Time: 17:15 - 18:45
Book Movie
Saved for later
Watch later
Invisible Man
Price: 80ETB
Time: 17:15 - 18:45
Book Movie
Saved for later
Watch later
Bad Boys III
Price: 80ETB
Time: 17:15 - 18:45
Book Movie
Saved for later
Watch later
Sonic Hedgehog
Price: 80ETB
Time: 17:15 - 18:45
Book Movie
Saved for later
Watch later
Heza
Price: 80ETB
Time: 17:15 - 18:45
Book Movie
Saved for later
Watch later
Red
Price: 80ETB
Time: 17:15 - 18:45
Book Movie
Saved for later
Watch later
Bloodshoot
Price: 80ETB
Time: 17:15 - 18:45
Book Movie
Saved for later
Watch later
Bad Boys III
Price: 80ETB
Time: 17:15 - 18:45


Dear {{booking.details.first_name}} {{booking.details.last_name}},
{% if booking.admission_payment %}Please find attached the confirmation for your booking number PS{{ booking.id }} and the confirmation for your admission fees number AD{{ booking.admission_payment.id }}.
{% else %}Please find attached the confirmation for your booking number PS{{ booking.id }}.
{% endif %}Print or save the attached confirmation for presentation on arrival and at any time during your stay.
{% if 'imnotusingthisuntilpvsstartstakingbookings' == 'disabled' %}Contact us about your booking
{% for contact in contact_list %}{{ contact.moorings }}
{{ contact.phone }}
{{ contact.email }}
There are extra measures in place to help you to travel safe at Rottnest Island and to ensure the safety of all visitors, staff and community.
Being COVID safe is a shared responsibility so please take the time to familiarise yourself with the safe practices that we ask you to follow during your visit at Rottnest Island.


--- layout: post title: Episode 114 | Robert Martin - Master Craftsman link: http://traffic.libsyn.com/developeronfire/DeveloperOnFire-114-RobertMartin.mp3 length: 54572617 speaker: Dave Rael duration: '00:56:46' subtitle: 'Developer On Fire: Robert Martin' guest_name: Robert Martin image: /assets/images/UncleBobMartin.jpg guest_blog: http://blog.cleancoder.com/ guest_twitter: unclebobmartin episode_number: 114 book_recommendations: - { url: "http://www.amazon.com/dp/0262510871/?tag=devonfir-20", title: "Structure and Interpretation of Computer Programs", author: "Harold Abelson, Gerald Jay Sussman"} - { url: "http://www.amazon.com/dp/0201633612/?tag=devonfir-20", title: "Design Patterns: Elements of Reusable Object-Oriented Software", author: "Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides"} - { url: "http://www.amazon.com/dp/0321125215/?tag=devonfir-20", title: "Domain-Driven Design: Tackling Complexity in the Heart of Software", author: "Eric Evans"} - { url: "http://www.amazon.com/dp/0201896834/?tag=devonfir-20", title: "The Art of Computer Programming, Vol. 1: Fundamental Algorithms", author: "Donald Knuth"} - { url: "http://www.amazon.com/dp/0470229055/?tag=devonfir-20", title: "The Annotated Turing: A Guided Tour Through Alan Turing's Historic Paper on Computability and the Turing Machine", author: "Charles Petzold"} - { url: "http://www.amazon.com/dp/0201895420/?tag=devonfir-20", title: "Analysis Patterns: Reusable Object Models", author: "Martin Fowler"} tags: - { url: "http://www.amazon.com/dp/0262510871/?tag=devonfir-20", title: "Structure and Interpretation of Computer Programs", author: "Harold Abelson, Gerald Jay Sussman"} - { url: "http://www.amazon.com/dp/0201633612/?tag=devonfir-20", title: "Design Patterns: Elements of Reusable Object-Oriented Software", author: "Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides"} - { url: "http://www.amazon.com/dp/0321125215/?tag=devonfir-20", title: "Domain-Driven Design: Tackling Complexity in the Heart of Software", author: "Eric Evans"} - { url: "http://www.amazon.com/dp/0201896834/?tag=devonfir-20", title: "The Art of Computer Programming, Vol. 1: Fundamental Algorithms", author: "Donald Knuth"} - { url: "http://www.amazon.com/dp/0470229055/?tag=devonfir-20", title: "The Annotated Turing: A Guided Tour Through Alan Turing's Historic Paper on Computability and the Turing Machine", author: "Charles Petzold"} - { url: "http://www.amazon.com/dp/0201895420/?tag=devonfir-20", title: "Analysis Patterns: Reusable Object Models", author: "Martin Fowler"} redirect_from: - "/114/" - "/114/" - "/114/" - "/0114/" - "/robert-martin-master-craftsman/" - "/RobertMartin/" - "/Robert-Martin/" - "/Podcast/Episodes/114/" - "/Podcast/Episodes/114/" - "/Podcast/Episodes/114/" - "/Podcast/Episodes/0114/" - "/Podcast/Episodes/robert-martin-master-craftsman/" - "/Podcast/Episodes/RobertMartin/" - "/Podcast/Episodes/Robert-Martin/" ---
Robert Martin (Uncle Bob) (@unclebobmartin) has been a programmer since 1970. He is the Master Craftsman at 8th Light inc, co-founder of the on-line video training company: cleancoders.com, and founder of Uncle Bob Consulting LLC. He is an acclaimed speaker at conferences worldwide, and the author of many books including: The Clean Coder, Clean Code, Agile Software Development: Principles, Patterns, and Practices, and UML for Java Programmers. He is a prolific writer and has published hundreds of articles, papers, and blogs. He served as the Editor-in-chief of the C++ Report, and as the first chairman of the Agile Alliance. He is the creator of the acclaimed educational video series at cleancoders.com.


Make sure the REMOTE server is running
Click on a description title to narrow the scope to just its specs
(see "
?grep" in address bar).
Click on a spec title to see the test implementation.
Click on page title to start over.


mixmo.augmentations.mixing_blocks¶
Mixing blocks inspired from several standard mixing sample data augmentations
Functions
|
Compute masks that toggle entire channels on and off |
|
Compute masks for CowMix lam is overridden by Cowmask’s parameters https://github.com/google-research/google-research/tree/master/milking_cowmask/masking |
|
Compute masks for CutMix |
|
Compute Gaussian kernel, as per the scipy.signal implementation |
|
Compute masks for MixUp (constant masks) |
|
Multivariate CutMix generalization (see paper) lam is a tuple here (simplex) that gives the proportion between n inputs CutMix(A, MixUp(B,C,…)) |
|
Computes masks for M>2 inputs (requires lam tuples) |
|
Multivariate MixUp generalization lam is a tuple here (simplex) that gives the proportion between n inputs |
|
Random mask pixels drawn from uniform distribution |
|
Compute masks for PatchUp mixing https://github.com/chandar-lab/PatchUp |
|
Wrapper function for PatchUp hard masking (2d variant) |
|
Wrapper function for PatchUp soft masking |
|
Compute the corner coordinates of a random rectangular box such that area_box/area_image=lam |
|
Computes masks for two inputs (traditional MSDA methods) |
|
Wrapper function for channel concat mixing |
|
Wrapper function for vertical concat mixing |
|
Compute masks for Channel/Horizontal/Vertical concat (number of images) x channel x (image width) x (image height) |
|
Front facing function that computes the masks/lams for any number of inputs |
|
Main function to mix manifolds in network |


--- title: The Royal Orthopaedic Hospital NHS Foundation Trust layout: gb ---
| Resource | Fetch | Format | Columns | Data | Valid | Entries | Oldest | Latest | Total (GBP) | |
|---|---|---|---|---|---|---|---|---|---|---|
| Spend over £25,000 at The Royal Orthopaedic Hospital NHS Foundation Trust | ||||||||||
| February 2012 | ✔ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| June 2012 | ✔ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| January 2011 return | ✘ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| November 2010 return | ✘ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| October 2010 return | ✘ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| March 2012 | ✔ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| April - September 2010 return | ✘ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| December 2010 return | ✘ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| April 2011 return | ✘ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| April 2012 | ✔ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| January 2012 | ✔ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| April - December 2011 | ✔ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| July 2012 | ✔ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| March 2011 return | ✘ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| May 2012 | ✔ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| May 2011 return | ✘ | ✘ | ✘ | ✘ | ✘ | 0 | ||||
| February 2011 return | ✘ | ✘ | ✘ | ✘ | ✘ | 0 |
| Resource/Stage | Error | |
| February 2012 | ||
| extract | HTML file detected | |
| June 2012 | ||
| extract | HTML file detected | |
| March 2012 | ||
| extract | HTML file detected | |
| April 2012 | ||
| extract | HTML file detected | |
| January 2012 | ||
| extract | HTML file detected | |
| April - December 2011 | ||
| extract | HTML file detected | |
| July 2012 | ||
| extract | HTML file detected | |
| May 2012 | ||
| extract | HTML file detected |


The attributes.data
file defines the object,
link, and container attributes in the database. The file specifies
the name, item type and data type for each attribute
and includes pointers to the files containing
the corresponding attribute values. (See
“Subgraph attribute specification files” in this appendix
for information on defining subgraph attributes.)
attr-name item-type data-type filename
where
attr-name
is the name of the
attribute
item-type
is one of
O
(object), L
(link), or
C
(container)
data-type
is one of the types listed
in the DataTypeEnum
class; see below for instructions for
specifying attribute type for multi-dimensional attributes
filename
is the base name (filename
without extension) of the file containing the corresponding
attribute values; filenames typically follow the naming conventions
described in “Attribute data files”, below.
For multi-dimensional attributes (also known as multi-column
attributes), the data-type
specification
is a comma-separated list of data types, one for each of the
attribute’s dimensions. Proximity requires
that each dimension in a multi-dimensional attribute be named. For
example, a location object attribute might
include an x and
y dimension, both of type
dbl
. The specification for this multi-dimensional
attribute would be
location O x:dbl, y: dbl O_attr_location
This example defines three database attributes—an objtype object attribute, a linktype link attribute, and a count container attribute.
objtype O str O_attr_objtype linktype L str L_attr_linktype count C int C_attr_count


Freecell Solver version 3.10.0 has been released. It is available in the form of a source tarball from the download page.
This release fixes two bugs - one with the --max-iters affecting only the last instance, and one with reading foundations with 0, and implements many small optimisations and cleanups. It also adds some experimental code with the so-called delta-states, where states are compactly encoded based on the original state. This functionality is not available in the main solver yet, but it powers the experimental on-disk-key/value-databases-based solver, which end up not scaling very well during testing.
Enjoy!


About me
I’m Will Jones, but am known to my friends as Will Fonzface for the last 10 years nearly. Post high school I studied Mathematics at University College London (UCL) for my undergraduate (2010-2013), and got into computer programming at around my first year. In my third year I was President of UCL Entrepreneurs, a student run startup society in UCL.
Following this, I took a year out, interning at Google in London for three of these months, wandering and writing across the world for five, and interning at TGAC (a genome sequencing centre in Norwich) for two. This was before starting the Advanced Computer Science MPhil program in the Cambridge Computer Lab, supervised by Pietro Lio’.
Currently I’m undergoing the 4 year Wellcome Trust Program in Mathematical Genomics and Medicine, and I’ve consequently become obsessed with the idea of analysing and elucidated insights from the human genome to understand human variation an disease susceptibility. I am working to build the next generation of products for a time where we will all possess our genetic information, as we now do our passports. Who knows what sort of world we’ll be in, and what services will be available to us, but it excites me.


| open |
/ |
|
| click |
link=Log in |
|
| type |
id=user_email |
<EMAIL_ADDRESS>|
| type |
id=user_password |
welcome123 |
| clickAndWait |
name=commit |
|
| click |
link=Bills |
|
| click |
link=New Bill |
|
| type |
id=bill_store |
JCpenny |
| select |
id=bill_bought_on_1i |
label=2013 |
| select |
id=bill_bought_on_2i |
label=June |
| select |
id=bill_bought_on_3i |
label=13 |
| type |
id=bill_total |
150 |
| clickAndWait |
name=commit |
|
| verifyText |
id=flash_notice |
Bill was successfully created. |
| click |
link=Back |
|
| click |
link=Destroy |
|
| assertConfirmation |
Are you sure you want to destroy the Bill? |
|
| verifyText |
id=flash_notice |
Bill was successfully destroyed. |
| clickAndWait |
link=Logout |
|
| verifyText |
id=flash_notice |
Signed out successfully. |


Summary:
I am an experienced Software engineer with well-developed skills and experience in different areas at the field and have worked as software engineer for more then 7+ years in Syria, Greece and Sweden. I am also a skilled Electronic engineer, and have good understanding of system design and system analy. My strong area is with ASP .Net MVC.


Universum
Sign in
Create new account
Welcome to Universum
Create your account here
Male
Female
Other
Register
Or, have already account?
Log in


List of labels; optional
The set of toolchains this rule has access to.
Targets listed here are the set of toolchains whose Make variables the rule is allowed to access. These rules are either rules that provide theTemplateVariableInfo
provider or special targets for toolchain types built into
Bazel. These include:
@bazel_tools//tools/cpp:current_cc_toolchain
@bazel_tools//tools/cpp:current_java_runtime


Strapper is The AngularJS/Bootstrap/FontAwesome bootstrapper, brought to you by the folks at Lotpath. Check out the Readme for more info.


Genres
Music lovers
Button
Electronic
Hip hop
Indie
Folk
Rock
Punk
Metal
Blues
R&B
Soul
Jazz
Classical
Reggae
Pop
Latin
World
Click on the "Install Now" button to add it to your browser, then click on it when you find a cool track you want to add to your library.
To instantly add tracks to your Openwhyd stream that you find across the web, from any website, we built the Openwhyd "add track" button. Drag the button to your bookmarks bar to install it, and then you can save the new tracks you find and share immediately from sites like Facebook and music blogs. It's super fast and super simple.
Work with track from:
You'll see something like this added to your browser
When you add new items a window will pop up like this
You'll see something like this added to your browser
When you add new items a window will pop up like this
Simply drag the button to the bookmarks bar of your browser, then click "OK" when prompted to choose a name for this bookmark.
To instantly add tracks to your Openwhyd stream that you find across the web, from any website, we built the Openwhyd "add track" button. Drag the button to your bookmarks bar to install it, and then you can save the new tracks you find and share immediately from sites like Facebook and music blogs. It's super fast and super simple.
Work with track from:
You'll see something like this added to your browser
When you add new items a window will pop up like this


The forthcoming Ocean Conference comes at a critical time as the world is strengthening its efforts to mobilize, create and drive solutions to realize the 17 Sustainable Development Goals by 2030. As one of the first milestones of UN Secretary-General Antonio Guterres’ newly launched Decade of Action for the Sustainable Development Goals, the Conference will propel much needed science-based innovative solutions.
The Governments of Kenya and Portugal will co-host the Ocean Conference! Become a part of the collective ambition of the international community to protect the ocean!
Experts will discuss the solutions for a sustainably managed ocean that involves green technology and innovative uses of marine resources. They will be addressing the threats to health, ecology, economy and governance of the ocean - acidification, marine litter and pollution, illegal, unreported and unregulated fishing, and the loss of habitats and biodiversity.
The webinar will have an Opening Segment and a High Level Panel Discussion. DESA/DSDG will prepare summaries of the webinar and post recordings and related materials online.
Mr. Thomson leads UN's advocacy and public outreach efforts inside and outside of the UN system, ensuring that the many positive outcomes of The 2017 Ocean Conference, including the over 1500 voluntary commitments, are analysed and implemented.
Mr. Liu guides UN Secretariat support for the follow-up processes of the 2030 Agenda for Sustainable Development, including the High-level Political Forum on Sustainable Development. Prior to his appointment, Mr. Liu was Vice-Minister for Foreign Affairs of China since 2013.
Since 2014 Miguel de Serpa Soares has continued to make the law of the sea a priority for the UN legal counsel. He often stresses the importance of healthy oceans to the success of the Sustainable Development Goals.
Opening of the Conference
- Election of the two Presidents
- Adoption of the rules of procedure and the agenda
- Election of officers other than the Presidents
- Organization of work
- Appointment of the members of the Credentials Committee
General debate
General debate
General debate
Stay up-to-date on UN Ocean Conference


public class CallableGuaranteedJob
extends java.lang.Object
implements java.util.concurrent.Callable<com.wm.data.IData>
| Constructor and Description |
|---|
CallableGuaranteedJob(com.wm.app.tn.delivery.DeliveryQueue queue,
com.wm.app.tn.delivery.GuaranteedJob job,
com.wm.lang.ns.NSName service,
com.wm.app.b2b.server.Session session,
com.wm.data.IData pipeline,
int retryLimit,
float retryFactor,
javax.xml.datatype.Duration timeToWait,
boolean suspend,
java.lang.String exhaustedStatus)
Creates a new CallableGuaranteedJob which when called invokes the given service against the given job.
|
CallableGuaranteedJob(com.wm.app.tn.delivery.DeliveryQueue queue,
com.wm.app.tn.delivery.GuaranteedJob job,
java.lang.String service,
com.wm.app.b2b.server.Session session,
com.wm.data.IData pipeline,
int retryLimit,
float retryFactor,
javax.xml.datatype.Duration timeToWait,
boolean suspend,
java.lang.String exhaustedStatus)
Creates a new CallableGuaranteedJob which when called invokes the given service against the given job.
|
| Modifier and Type | Method and Description |
|---|---|
com.wm.data.IData |
call()
Invokes the provided service with the provided pipeline and session against the job.
|
public CallableGuaranteedJob(com.wm.app.tn.delivery.DeliveryQueue queue, com.wm.app.tn.delivery.GuaranteedJob job, java.lang.String service, com.wm.app.b2b.server.Session session, com.wm.data.IData pipeline, int retryLimit, float retryFactor, javax.xml.datatype.Duration timeToWait, boolean suspend, java.lang.String exhaustedStatus)
queue
- The delivery queue on which the job queued.job
- The job to be processed.service
- The service to be invoked to process the given job.session
- The session used when invoking the given service.pipeline
- The input pipeline used when invoking the given service.retryLimit
- The number of retries this job should attempt.retryFactor
- The factor used to extend the time to wait on each retry.timeToWait
- The time to wait between each retry.suspend
- Whether to suspend the delivery queue on job retry exhaustion.exhaustedStatus
- The status set on the related bizdoc when all retries of the job are exhausted.public CallableGuaranteedJob(com.wm.app.tn.delivery.DeliveryQueue queue, com.wm.app.tn.delivery.GuaranteedJob job, com.wm.lang.ns.NSName service, com.wm.app.b2b.server.Session session, com.wm.data.IData pipeline, int retryLimit, float retryFactor, javax.xml.datatype.Duration timeToWait, boolean suspend, java.lang.String exhaustedStatus)
queue
- The delivery queue on which the job queued.job
- The job to be processed.service
- The service to be invoked to process the given job.session
- The session used when invoking the given service.pipeline
- The input pipeline used when invoking the given service.retryLimit
- The number of retries this job should attempt.retryFactor
- The factor used to extend the time to wait on each retry.timeToWait
- The time to wait between each retry.suspend
- Whether to suspend the delivery queue on job retry exhaustion.exhaustedStatus
- The status set on the related bizdoc when all retries of the job are exhaused.public com.wm.data.IData call() throws java.lang.Exception
call
in interface java.util.concurrent.Callable<com.wm.data.IData>
java.lang.Exception
- If the service encounters an error.


Bride's murdered dad's police colleagues step in to fill his shoes
When Kourtney Young married Tanner Krietemeir, she had a beautiful day – but one person was missing.
Her dad Donnie was shot and killed in 2005, while working as a police officer.
But her mum Kelly had arranged a special surprise.
She knew that the father-daughter dance was going to be particularly poignant for Kourtney – so she got seven of Donnie’s colleagues to dance to Paul Simon’s Father And Daughter, with her.
Kourtney, from Colorado, U.S., said: ‘It was a surprise my mom had planned.
‘That song was something my dad played for me when I was little and he gave me a necklace with his badge number on it. So that song was special.
‘All those officers were friends of my dad’s and our family, so they were invited to the wedding already.
Advertisement Advertisement
‘I was caught off guard, but it was such a cool thing and a special moment. A lot of those guys are really important to me so it was special to share that moment with them.’
Two of the officers, Jeff Barron and Chris Shotts also walked down the aisle, behind Kourtney and her mum.
One of the dancers, Danny Veith told FoxNews: ‘It was very emotional. I felt despair, like Donnie’s being robbed of this moment.
‘Then I took stock of all that has happened in the last 14 years and looking at Kelly and all she has accomplished in the last 14 years since Donnie’s murder and then seeing Kelsey and Kourtney are these beautiful young women. Little girls no more.
‘I just told her how Donnie was and is proud of her.
‘Being the first to dance with her, I got to see every other officer walk out, very proud, happy fathers.
‘And then as they turned their back to Kourtney to return to our group, every single one of them was crying.’


Chat Cloud FANCY ICON KAPPA
Start analyzing your Twitch.tv chat today by entering your channel name below.
Channel Name
cloud
Let's Go


| 003:181 Khan | : |
Indeed, Allah has heard the statement of those (Jews) who say: "Truly, Allah is poor and we are rich!" We shall record what they have said and their killing of the Prophets unjustly, and We shall say: "Taste you the torment of the burning (Fire)." |
| 003:181 Maulana | : |
Allah has certainly heard the saying of those who said: Allah is poor and we are rich. We shall record what they say, and their killing the prophets unjustly, and We shall say: Taste the chastisement of burning. |
| 003:181 Pickthal | : |
Verily Allah heard the saying of those who said, (when asked for contributions to the war): "Allah, forsooth, is poor, and we are rich!" We shall record their saying with their slaying of the prophets wrongfully and We shall say: Taste ye the punishment of burning! |
| 003:181 Rashad | : |
GOD has heard the utterances of those who said, "GOD is poor, while we are rich." We will record everything they said, just as we recorded their killing of the prophets unjustly, and we will say, "Suffer the retribution of Hell. |
| 003:181 Sarwar | : |
God certainly has heard the words of those who said, "God is poor and we are wealthy". We shall write down what they have said and their murder of the Prophets without reason and We shall tell them to suffer the burning torment. |
| 003:181 Shakir | : |
Allah has certainly heard the saying of those who said: Surely Allah is poor and we are rich. I will record what they say, and their killing the prophets unjustly, and I will say: Taste the chastisement of burning. |
| 003:181 Sherali | : |
And surely, ALLAH has heard the utterance of those who said, 'ALLAH is poor and we are rich.' WE shall record what they have said, and their attempts to slay the Prophets unjustly; and WE shall say, 'Take ye the punishment of the burning;' |
| 003:181 Yusufali | : |
Allah hath heard the taunt of those who say: "Truly, Allah is indigent and we are rich!"- We shall certainly record their word and (their act) of slaying the prophets in defiance of right, and We shall say: "Taste ye the penalty of the Scorching Fire! |
Concepts/Themes Covered: أركان الإسلام > التوحيد > توحيد الله تعالي > تنزيه الله تعالى عن الظلم Pillars of Islam> Islamic> Oneness of Allah> Allah the Exalted is Free of Injustice أركان الإسلام > التوحيد > توحيد الله تعالي > غناه وافتقار الناس إليه Pillars of Islam> Islamic> Oneness of Allah> His Self-Sufficience and People's need of Him أركان الإسلام > التوحيد > الكافرون > صفات الكفار Pillars of Islam> Islamic> The Disbelievers> The Characteristics of the Disbelievers الإيمان > الغيب > النار > أصحاب النار Faith> The Unseen World> Hell-Fire>Hell Fellows تنظيم العلاقات المالية > الغنى > الأغنياء Organizing Financial Relationships>Richness>The Rich الديانات > بنو إسرائيل > معاندتهم و تكذيبهم و قتلهم الأنبياء Religions>Children of Israel> Their Opposition, their Denial and their Killing the Prophets
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


| Class | R10K::Settings::Container |
| In: |
lib/r10k/settings/container.rb
|
| Parent: | Object |
Defines a collection for application settings
This implements a hierarchical interface to application settings. Containers can define an optional parent container that will be used for default options if those options aren‘t set on the given container.
| valid_keys | [RW] |
@!attribute [r] valid_keys
@return [Set<Symbol>] All valid keys defined on the container or parent container. |
Look up a value in the container. The lookup checks the current container, and then falls back to the parent container if it‘s given.
@param key [Symbol] The lookup key
@return [Object, nil] The retrieved value if present.
@raise [R10K::Settings::Container::InvalidKey] If the looked up key isn‘t
a valid key.
Set a value on the container
@param key [Symbol] The lookup key @param value [Object] The value to store in the container
@raise [R10K::Settings::Container::InvalidKey] If the looked up key isn‘t
a valid key.
Define a valid container key
@note This should only be used by {R10K::Settings::ClassSettings}
@param key [Symbol] @return [void]


This is a link to youtube
This is a link to amazon
This is a link to netflix
Hello there,awesome person!


PROTOTYPE
New message
Send to
Subject
Message
Attach a file
Send
Cancel
Mark as read
Mark as unread
Archive
Mark as read
Mark as unread
You have no archived messages
Mark as read
Mark as unread
Reply to all
Attach a file
Send
PROTOTYPE


{% extends 'layouts/layout.html' %} {% from 'button/macro.njk' import button %} {% from 'back-link/macro.njk' import backLink %} {% block pageTitle %} Check your mobile phone {% endblock %} {% block content %}
Enter the 6 digit security code we have sent to {{ data.phoneNumber or '07123456789' }} to confirm this is your mobile phone number.
You need to use this code within 5 minutes or it will expire.
When we are really busy, it may take a bit longer for your code to arrive.
Send the security code again or enter your mobile number to try again.


Traditional - Sri Lanka
This game is played on an Alquerque board:
One player, the Tiger, has 2 stones, the other, the Goat, has 20 stones. They are placed in setup (the stones are played on the intersections - sorry for these software restrictions...):
|
There is a little more information at revue.jeudesociete.org/jeu-baghchal.html (webpage in French).
A possible variant is to add a stacking mechanism to the stacks of goats, so the rule would say: the Goat may take the top goat of a stack and place it on an adjacent cell which does not have a tiger. This way, the goats would have extra exits to tigers attacks.


Stakeholders are very important to any project. Add up to three stakeholders below and give them a picture, name and value provided to them.
What is the value provided to this stakeholder?


A Horizontal Bar chart example showing the X-axis drawing API object
This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.common.key.js"></script>
<script src="RGraph.common.tooltips.js"></script>
<script src="RGraph.common.dynamic.js"></script>
<script src="RGraph.common.drawing.xaxis.js"></script>
<script src="RGraph.hbar.js"></script>
Put this where you want the chart to show up:
<canvas id="cvs" width="600" height="400">
[No canvas support]
</canvas>
This is the code that generates the chart - it should be placed AFTER the canvas tag(s):


We offer campus tours all year. And if you visit during the academic year, you'll have the option to sit in on a class and stay overnight in a residence hall.
We offer campus tours all year. And if you visit during the academic year, you'll have the option to sit in on a class and stay overnight in a residence hall.


|
CANopen FD Master Library
Making your systems precise, reliable and high-quality - 5.10.01
|
CANopen® is an open layer-7 protocol based on CAN (Controller Area Network). CANopen is mainly applied in machines as embedded network system. Moreover, it is used as a general industrial communication system with a data transfer rate of up to 1 Mbit/s.
The CANopen FD Master Library supports the following services:
The CANopen FD Master Library provides a C interface and a C++ interface class for the Qt library. Please refer to CANopen FD Master API overview for details.
Refer to the Version History for details on history and actual version.
Please refer to CANopen FD Master Library Download for installation instructions.


Big Data / PySpark Engineer - San Francisco, CA 94105
Do you view data as an art and a science? So do we.
Avanade leads in providing creative digital services, business solutions and design-led experiences for its clients, delivered through the power of people and the Microsoft ecosystem. Our professionals combine technology, business, and industry expertise to build and deploy solutions to realize results for clients and their customers. Avanade has 34,000 digitally connected people across 24 countries, bringing clients the best thinking through a collaborative culture that honors diversity and reflects the communities in which we operate. We welcome all and seek talented individuals who can bring their whole self to work, build inclusive teams and encourage diversity inside and outside the organization. Majority owned by Accenture, Avanade was founded in 2000 by Accenture LLP and Microsoft Corporation.
How we support you:
We believe in gender equity and an inclusive community. We offer a comprehensive benefits package: generous vacation allowance disability coverage, retirement plans, paid maternity and paternity leave, life insurance, hotel and travel discounts, extended benefits to cover items that support your well-being, health, dental and vision insurance, professional development and paid Microsoft certification opportunities.
About you:
You draw on your considerable experience in bringing data and statistics to life to solve sometimes complex problems, and you’re comfortable looking after several projects at once. You’re able to make your own decisions while at the same time supporting more junior team members.
As a Big Data/PySpark Engineer at Avanade, you will have a deep understanding of the architecture, performance characteristics and limitations of modern storage and computational frameworks, with experience implementing solutions that leverage: HDFS/Hive; Spark/MLlib; Kafka, etc. You will have knowledge in Apache Spark and/or Python programming, deep experience in developing data processing using PySpark such as reading data from external sources, merge data, perform data enrichment and load into target data destinations. Deep experience in developing data processing tasks using PySpark such as reading data from external sources, merge data, perform data enrichment and load into target data destinations. Knowledge of python packaging, azure/data lake, and data bricks. Experience with ML. Manage large volumes of structured and unstructured data and extract & clean data to make it amenable for analysis. 80% travel is required.
Key Technologies:
Must-haves:
Apache Spark
Python
PySpark
Hadoop
SQL
Azure or AWS
Pluses:
Cosmos DB
TensorFlow
Apache airflow
Snowflake
Linux OS
.
Key Role Responsibilities:
Demonstrated expertise working with and maintaining open-source data analysis platforms, including but not limited to:
Pandas, Scikit-Learn, Matplotlib, TensorFlow, Jupyter and other Python data tools
Spark (PySpark), HDFS, Kafka and other high-volume data tools
SQL and NoSQL storage tools, such as MySQL, Postgres, Cassandra, MongoDB and ElasticSearch.
Deep understanding of the architecture, performance characteristics and limitations of modern storage and computational frameworks, with experience implementing solutions that leverage: HDFS/Hive; Spark/MLlib; Kafka, etc.
Technical background in computer science, data science, machine learning, artificial intelligence, statistics or other quantitative and computational science
Hands-on experience using Big Data and statistical analysis tools such as Hadoop/Spark, SQL
Experience transforming Data at a scale using Spark/PySpark
Working experience with Linux OS (Redhat/Ubuntu)
Excellent communication skills (speaking, presenting)
Preferred Years of Work Experience:
You likely have about 2-6 + years of relevant professional experience.


Hi everyone.
I'm a manufacturer of power bikes (energorower.pl) - e.g. bikes generating power from human muscles. I use DC generators delivering 10-20V and up to 15 A. Currently all energy is stored in 12V batteries or used right away to power various DC appliances - I do not use grid tied inverters.
I'm interested in using open energy monitor together with my bikes - for example in fitness clubs, during ecological events, even home/emergency users would happily use some way of monitoring wattshours generated.
I did my share of research and found out that open energy monitor setup will not work with DC current out of the box - some modifications are needed.
But then I found that some people have successes with DC current and open energy monitor (for example http://www.appropedia.org/Measuring_DC_electrical_energy_production_from... ) so it is technically possible.
There are DC meters with free DIY plans (for example http://wattsview.com/?page_id=177) which can be probably used together with Open energy monitor (it uses Hall efffect sensors).
My questions are:
1. Is it indeed possible at all (to measure DC current with OEM)?
2. If so, maybe there is someone able to help me with the design and prototype (pay work)
My email: biuro at energorower.pl
Re: DC current monitoring - help needed
I believe there are users who are monitoring direct current - usually from PV arrays, though that is irrelevant - as well as mains electricity. As you say, the system won't work 'out-of-the-box' (and especially as bought from the shop it is a kit that needs assembly!) but that does allow you the flexibility to take the basic design and customise it to suit your needs. And of course you can customise the software.
Hall effect devices would be a good choice, and especially if they give you a 5 V output that would interface directly to an Arduino running on 5 V, and it is even simpler to divide down the voltage. Then you just need a sketch to calculate watts and accumulate watt-hours, and presumably you'd want a display to communicate that to the user. Would I be right in thinking this would be both a single stand-alone unit and you are going to be networking many of these and recording the data remotely?
Re: DC current monitoring - help needed
First, Robert, thank you for your remarks.
Yes, you are right - I'm thinking about installing single meters on each power bike and then networking them wirelessly to record and display data on screen. That is my basic idea.
As for Hall effect sensor - that one would be suitable for my needs I think - http://www.ebay.com/itm/Hall-Effect-Current-Sensor-For-Hobbyist-Arduino-Compatible-AC-DC-10A-75A-/230991057211?pt=LH_DefaultDomain_2&hash=item35c823d13b
The problem is I'm not electrician nor software developer - I can not customize the design myself...
Re: DC current monitoring - help needed
That sensor looks to be suitable. However, I think you need to find someone local to you who knows how to assemble and test these things. I can tell you what to do in theory at the input end, and I could write the code to handle that part, but I'm no networking expert, I have no knowledge of Arduino networking and so I couldn't help there.
I wonder, is there a technical college or University near you who could use this as a student project?
Re: DC current monitoring - help needed
I'm just wondering if CT nodes (clamps) used in standard OEM setup to measure AC current use Hall effect sensors? If so - maybe only code part need to be adjusted...
Additionally - I found commercial project http://www.theowl.com/products/intuitionpv.php - is it based on OEM? It definitively looks very familiar.
@Robert - could you tell what in theory should be done at the input end?
Re: DC current monitoring - help needed
"I'm just wondering if CT nodes (clamps) used in standard OEM setup to measure AC current use Hall effect sensors? If so - maybe only code part need to be adjusted..."
No, they are what they say they are: current transformers. And transformers don't work on direct current. ("Clamp" isn't a word used in the UK in Electrical Engineering anyway - I always think you mean "Busbar clamp", a mechanical clamp for making a temporary connection to a busbar - when anyone uses that term).
I've no knowledge of Owl products, you might have the convenience of a commercial product but you won't have the flexibility that you could have here.
What you need to at the input: You need to connect the GND of your Arduino to the battery negative. You need to connect the 5 V supply to the Hall effect sensor, and the output to one of the Arduino analogue inputs. Also, you need to connect a voltage divider (two resistors) across the 12 - 20 V battery and the midpoint to a second analogue input, the resistor ratio is chosen to give you 5 V at max battery voltage. Those two inputs then give you current and voltage respectively (I could do a diagram but I'm lazy! ) If you want to power the Arduino off the battery, you might need a second voltage regulator, depending on the battery voltage, to provide the 7-12 V that the Arduino needs.
In terms of the code, in the main program loop you would at regular intervals (probably some tens of times per second) read current and voltage, scale the readings into engineering units (i.e. calibrate them) and do whatever sums you need for charge rate, total charge, etc; then at less frequent intervals (maybe 1/2 second or so) send the values you need to your display or the network (or both) depending on how often you want to update those.


{{content.displayContentType}} | {{ content.duration | pipeDurationTransform: 'hms' }}
{{ content?.uniqueLearners }} 1" i18n> people are studying this person is studying this


Implementation of the Pull-to-Refresh UI Pattern for Android
This project aims to provide a reusable Pull to Refresh widget for Android. It was originally based on Johan Nilsson's library (mainly for graphics, strings and animations), but these have been replaced since.
Repository at https://github.com/chrisbanes/Android-PullToRefresh.
The sample application (the source is in the repository) has been published onto Google Play for easy access:
To begin using the library, please see the Quick Start Guide page.
Please see the Customisation page for more information on how to change the behaviour and look of the View.
By default this library is set to Pull Down to Refresh, but if you want to allow Pulling Up to Refresh then you can do so. You can even set the View to enable both Pulling Up and Pulling Down using the 'both' setting. See the Customisation page for more information on how to set this.
Want to see which Apps are already using Android-PullToRefresh? Have a look here. If you have an App which is not on the list, let me know.
Please see the new Changelog page to see what's recently changed.
I will gladly accept pull requests for fixes and feature enhancements but please do them in the dev branch. The master branch is for the latest stable code, dev is where I try things out before releasing them as stable. Any pull requests that are against master from now on will be closed asking for you to do another pull against dev.
Copyright 2011, 2012 Chris Banes
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


I have just finished the first step in my Morning Glory extraction process. Using a traditionally scientific process for a not so traditional result. (Or perhaps the result is traditional thanks to Dr. Albert Hofmann). I purchased about 5 packs of Morning Glory (Heavenly Blue) seeds @.98 each (about 250 seeds) at my local garden supply store. Then I went to my State Liquor store and bought a pint of Grain Alcohol (190 proof, that's 95% alcohol , kids don't drink this at home) for 5 bucks. In a short side note I got a strange look from the woman at the counter when I asked for grain alcohol, 'Are you from town?' she inquired. 'Um. . Yes' I replied. Anyway I had to sign a form stating that I would use the alcohol in a fashion abiding by the law as stated in Code 4, Section 13 blah, blah, blah. The clerk took down my name and telephone number for 'the record'. (Great)
Upon arriving home I placed approximately 250 seeds into a pepper grinder and ground the seeds into a powder, I ran them through twice in order to attain the finest grind possible. I then put the powder into 250ML of Naphta (Otherwise known as Rosonol lighter fluid) and shook vigorously for a bit and then let stand for 20 minutes.
When the 20 minutes were up I poured the mix through a double filter, a paper coffee filter tucked inside a gold coffee filter.  I then place the Morning Glory seeds to the side, save the Naphtha for future use and wait for the pulverized seed to dry.
(Three Hours Later) The powder being thoroughly dry I placed it into a small jar and put in about a shot of alcohol. I will now wait the requisite three days for the active ingredients to be thoroughly absorbed into the alcohol (Shaking vigorously whenever I come upon the jar in my daily activities).
(Three Days Later) I have the liquid here but I'm a bit nervous about the smell of lighter fluid that still seems to be coming up from the mixture. I decide to let the alcohol evaporate and then add another shot.
(Three Days Later) I put the Morning Glory/Grain Alcohol mix through the same filter process listed above. The result was about a shot worth of a grayish cloudy grain alcohol. I add a hefty portion of Orange Juice to the mix and imbibe.
(Three Hours Later) Having taking the mixture and waited for a while I don't think I'm going to be tripping anytime soon. I am affected by the seeds a bit, it's kind of a very low, subtle buzz (You could probably get higher drinking a double espresso with a shot of that grain alcohol). I'm wondering now about the number of the seeds used. I used 250 seeds which according to the FAQ is equal to 'intense meditation' (yeah man). Maybe a different type of seed might be better (I used Heavenly Blue (Ipomoea) from Johnson' Seeds Co.)If I try this again I'll double the amount and see what this does. I might alter the 'extraction' purpose in some way too. Although I'm not sure how. If anyone has had success with this method feel free to e-mail me.
A few words of advice for anyone who reads this and wants to try (Get your step by step directions from the FAQ first of all).1) After you filter the seeds from the Naphtha mix let them *Dry thoroughly*, I included an extra step of letting the grain alcohol/MG mix evaporate because I didn't like those lighter fluid fumes I was getting from the first mix. After evaporating and then adding another shot of grain alcohol the smell was completely gone.
So overall, I'm a little skeptical of this procedure, granted I am feeling a little buzzed as I type these words, but nothing remotely like a glorified *trip*.  Ah hhahaha) Beep bobble thorn. Powwow. Vision (The faculty of sight) sight, perception, perceiving, range of view, optics, eyesight. (Understanding) foresight, discernment, breadth of view, insight, penetration, intuition, kibo, divination, astuteness, keenness, foreknowledge, prescience, farsightedness.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Welcome to my personal portfolio. Here you'll find examples of my various projects. Click through the pages to see photos and/or to get in touch with me.


Mandurah singer features on album
by Vanessa SchmittMANDURAH singer Tiarna Madison (16) has been featured on a new album by contemporary/pop singer Andy Michaels, who asked the young talent to collaborate with him on his latest album Incendiary Heart.
“I found her at a talent quest that I ran in Mandurah last year,” Michaels said.
The album is being played on more than 1000 radio stations and receiving rave reviews overseas.
Michaels is from Perth and delivers songs with a keen sense of melody and poignant lyrics to create a mesmerising music experience.
After suffering an incapacitating car accident in his late teens, Michaels picked up a guitar and from within, a spark ignited.
He has written more than 100 songs that have been in radio rotation around the world, garnering stellar reviews and a worldwide following. He said Incendiary Heart was a powerful, deep, and melodic album with 14 tracks of contemporary/pop songs with thought-provoking lyrics.


& ]]>
test
Loading...
Sorry, your browser doesn't support embedded videos.
Inside a tal!
(
whatever
) a
whatever
"
whatever
"
Whitelines are not stripped away


Here at Jarred's Popsicle Company we strive to keep the lowest and most competetive prices while selling bulk in popsicles. If you find better prices around from a verified source we will match it!


a string to be iterated over.
This parameter is a Stream Sink.
When optimization is on, the implementation will
in some cases start up a separate thread
to evaluate this parameter.
act
the iterator body function.
It takes a single parameter of type string which is a single line of the string.
Semantics
This is an iterator function that iterates
over all lines of a string.


Returns the back mouse button, null if the mouse hasn't
got one.
Returns forth mouse button, null if the mouse hasn't
got one.
Returns fifth mouse button, null if the mouse hasn't
got one.
Returns a single component based on its identifier, or null
if no component with the specified type could be found.
Returns a single axis based on its type, or null
if no axis with the specified type could be found.
Returns the components on this controller, in order of assignment priority.
Returns the components on this controller, in order of assignment priority.
Returns the extra or 5th mouse button, null if the mouse has
fewer than 5 buttons.
Returns the forward mouse button, null if the mouse hasn't
got one.
Returns the left mouse button.
Returns the middle, null if the mouse has fewer than three buttons.
Returns the left or primary mouse button, never null.
Returns the right, null if the mouse is a single-button mouse.
Returns the right or secondary mouse button, null if the mouse is
a single-button mouse.
Returns the side or 4th mouse button, null if the mouse has
fewer than 4 buttons.
Returns the middle or tertiary mouse button, null if the mouse has
fewer than three buttons.
Returns the mouse wheel, or null if no mouse wheel is present.
Returns the x-axis for the mouse ball, never null.
Returns the y-axis for the mouse ball, never null.


In this lecture we will discuss the concept of recursion and examine recursive functions that operate on integers, strings, and lists, learning common idioms for each. As with other topics discussed this quarter, I want to ensure that you have a deliberate and deep understanding of recursion.
The concept of recursively defined (sometimes called inductively defined) data types and recursion is fundamental in many areas of computer science, and this concept should be discussed from many angles in many of your ICS classes; you should become comfortable with seeing and applying recursion. In addition, some programming languages (Lisp is the foremost example) use recursion (and also decision: if) as their primary control structures: any iterative code can be written recursively (and recursion is even more powerful than iteration, as we glimpsed in the EBNF lecture). Even languages that are not primarily recursive all support recursion (and have since the late 1950s), because sometimes using recursion is the best way to write code to solve a problem: best often means simplest, but sometimes it can mean most efficient too.
Python (and C/C++/Java) are not primarily recursive languages. Each has strong features for iterating through data (Python has the most powerful tools for such iteration, including generators). But, it is important that we learn how to write recursive code in Python too. Later in the quarter (next week) we will recursively define the linked list and binary tree data structures and see how to manipulate them, both iteratively (for some functions) and recursively (for all functions). In ICS-46 we will revisit these data structures (and more) many times using C++, and again see how we can manipulate them both iteratively and recursively.
Douglas Hofstadter's Pulitzer-prize winning book, "Godel, Escher, Bach" is an investigation of cognition, and commonly uses recursion and self-reference to illustrate the concepts it is discussing. It is a fascinating book and because it is old, can be purchased quite cheaply as a used book. http://www.amazon.com/G%C3%B6del-Escher-Bach-Eternal-Golden/dp/0465026567
[top]
Recursion is a programming technique in which a call to a function results in another call to that same function. In direct recursion, a call to a function appears in the function's body; in indirect/mutual recursion, the pattern is some function calls some other function ... which ultimately calls the first function.
For some data structures (not many built-into Python) and problems, it is simpler to write recursive code than its iterative equivalent. In modern programming languages, recursive functions may run a bit slower (maybe 5%) than equivalent iterative functions, but this is not always the case (and sometimes there is no natural/simple iterative solution to a problem); in a typical application, this time is insignificant (most of the time will be taken up elsewhere anyway).
We will begin by studying the form of general recursive functions; then apply this form to functions operating on int values, and then apply this form to functions operating on strings and lists. In all these cases, we will discuss how values of these types are recursively defined and discuss the "sizes" of the problem solved.
Suppose that we have the problem of collecting $1,000.00 for charity, with the assumption that when asked, everyone is willing to chip in the smallest amount of money: a penny.
Iterative solution : visit 100,000 people, and ask each for a penny
Recursive solution: if you are asked for a penny, give a penny to this person otherwise visit 10 people and ask them each to collect 1/10 the amount that you are asked to raise; collect the money they give you into one bag; give this bag to the person who asked you
In the iterative version each subproblem is the same; raising a penny. In the recursive solution, subproblems get smaller and smaller until they reach the problem of collecting a penny (they cannot get any smaller: this problem has the smalles size).
The general form of a directly recursive function is
def Solve(Problem): if (Problem is minimal/not decomposable into a smaller problem: a base case) Solve Problem directly and return solution; i.e., without recursion else: (1) Decompose Problem into one or more SIMILAR, STRICTLY SMALLER subproblems: SP1, SP2, ... , SPn
(2) Recursively call Solve (this function) on each smaller subproblem (since they are similar): Solve(SP1), Solve(SP2),..., Solve(SPN) (3) Combine the returned solutions to these smaller subproblems into a solution that solves the original, larger Problem (the one this function call must solve) (4) Return the solution to the original Problem
[top]
We will start by examining a recursive definition for the factorial function (e.g., 5! reads as "five factorial") and then a recursive function that implements it. The definition is recursive because we define how to compute a big factorial in terms of computing a smaller factorial. Note that the domain of the factorial function is the non-negative integers (also called the natural numbers).
0! = 1 N! = N\*(N-1)! for all N>0,
By this definition (and just substitution of equals for equals) we see that
5! = 5*4! = 5*4*3! = 5*4*3*2! = 5*4*3*2*1! = 5*4*3*2*1*0! = 5*4*3*2*1*1
The first definition below is a transliteration of the general code above, decomposing it into just one similar (factorial) but simpler (n-1) subproblem.
def factorial (n): if n == 0: return 1 else: sub_problem = n-1 solved_sub_problem = factorial(sub_problem) solved_n = n*solved_sub_problem return solved_n
The next definition is a simplification of how this function should really be written in Python, without all the intermediate names, which are not needed and don't really add clarity.
def factorial (n): if n == 0: return 1 else: return n*factorial(n-1)
This looks clean and closely mirrors the recursive mathematical description of factorial. In fact, because of the simplicity of this particular recursive function, we can write an even simpler solution using a conditional expression; but I prefer the solution above, because it is more representative of other recursive solutions (to more complicated problems).
def factorial (n): return 1 if n == 0 else n*factorial(n-1)
we can contrast the recursive code with the iterative code that implements the factorial function
from goody import irange def factorial (n): answer = 1; for i in irange(2,n) answer *= i return answer
Note that this function defines two local names (answer and i) and binds 1 to answer and rebinds it to a new value during each execution of the for loop's body. Likewise, i is rebound to a sequence of values produced when the function iterates over the irange(2,n). The recursive function defines no local names and doesn't rebind any names (although each recursive call binds the parameter in the new recursive function call).
Rebinding the values of names make it hard for us to think about the meaning of code (they make it tougher to prove that the code is correct too), and makes it hard for multi-core processors to coordinate in solving a problem. "Functional programming languages" (those that allow binding of a name to computed value, but no rebinding to that names) are more amenable to be automatically parallelizable (can run more quickly on multi-core computers). You'll see more about this in later classes at UCI (e.g., Concepts of Programming Languages).
We can mimic factorial's recursive definition for a function that raises a number to an integer power. Note that the domain of n for this power function requires n to be a natural number (a non-negative integer).
A**0 = 1 (yes, this is even true when A=0) A**N = A*A**N-1 for all N>0
We can likewise translate this definition into a simple recursive Python function
def power(a,n): if n == 0: return 1 else: return a*power(a,n-1)
By this definition (and just substitution of equals for equals) we see that calling power(a,n) requires n multiplications.
power(a,3) = a*power(a,2) = a*a*power(a,1) = a*a*a*power(a,0) = a*a*a*1
Of course we could write this code iteratively as follows, which also requires n multiplications
def power(a,n): answer = 1 for i in irange(1,n): answer *= a return answer
But there is a another way to compute power(a,n) recursively, shown below. This longer function requires between Log2 n and 2*Log2 n multiplications. Here Log2 means the log function using a base of 2. Note Log2 1000 is about 10 (2**10 = 1,024), so Log2 1,000,000 is about 20, Log2 1,000,000,000 is about 30): so, to compute power(a,1000) requires between 10 and 20 multiplications (not the 1,000 multiplcations required by the earlier definitions of power).
def power(a,n): if n == 0: return 1 else: if n%2 == 1: return a*power(a,n-1) else: temp = power(a,n//2) return temp*temp
Here we bind temp once and then use its value, which is fine for functional programming. We could get rid of the local name temp by defining the local function def square(n): n*n inside power and and calling it in the else clause: return square( power(a,n//2) )
def power(a,n): def square(n): return n*n if n == 0: return 1 else: if n%2 == 1: return a*power(a,n-1) else: return square( power(a,n//2) )
For one example power(a,16) computes power(a,8) and returns its result with 1 more multiplication; power(a,8) computes power(a,4) and returns its result with 1 more multiplication; power(a,4) computes power(a,2) and returns its result with 1 more multiplication; power(a,2) computes power(a,1) and returns its result with 1 more multiplication; power(a,1) computes a*power(a,0), which requires 1 multiplication: computing power(a,0) requires 0 multiplications (it just retuns a value).
In all, power(a,16) requires just 5 multiplications, not 16. Note that this function is NOT guaranteed to always use the minimum number of multiplications. Power(a,15) uses 6 multiplication, but computing x3 = x*x*x then x3*(square(square(x3))) requires only 5: see the topic named "addition-chain exponentiation" if you are interested in what is known about the minimimal number of multiplications required for exponentiation.
We will prove that this function computes the correct answer later in this lecture. Truth be told, we can write a fast power function like this iteratively too, but it looks much more complicated and is much more complicated to analyze its behavior and prove it correct.
[top]
Next, we will learn how to hand-simulate a recursive functions using a "tower of call frames" in which each resident in an apartment executes the same code (acting as the function) to compute a factorial: he/she is called by the resident above and calls the resident underneath, when a recursive call is needed (calling back the resident above when their answer is computed). While it is useful to be able to hand-simulate a recursive call, to better understand recursion, hand-smulation is not a good way to understand or debug recursive functions (the 3 proof rules discussed below are a better way). I will do this hand simulation on the document camera, using the following form for computing factorial(5).
Factorial Towers +-----------------+ | n = | | return ... | +-----------------+ | n = | | return ... | +-----------------+ | n = | | return ... | +-----------------+ | n = | | return ... | +-----------------+ | n = | | return ... | +-----------------+ | n = | | return ... | +-----------------+ | n = | | return ... | +-----------------+ ... +-----------------+ | n = | | return ... | +-----------------+
[top]
Now, we will learn how to verify that recursive functions are correct by three proof rules. Even more important than proving that existing functions are correct (to better understand them), we will use these same three proof rules to guide us when we synthesize new recursive functions.
Note that in direct recursion, we say that the function "recurs", not that it "recurses". Recurses describes what happens when you bang your toe into a door the second time. Programmers who use the word recurse are not well educated.
The three proof rules should be simple to apply in most cases. These rules mirror rules for proofs by induction in mathematics.
Prove that the base case problem is processed correctly. Should be easy, because base cases are small and simple.
Prove that each recursive call gets closer to the base case. Should be easy because there are "standard" ways to recur: ints go down by 1 or a factor of 10 (i.e., x//10 has one fewer digit; x%10 has one digit); Strings, tuples, and lists recur on a slices (fewer characters, fewer values).
ASSUMING ALL RECURSIVE CALLS SOLVE THEIR SMALLER SUBPROBLEMS CORRECTLY, prove that the code combines these solved subproblems to solve Problem (the parameter of the function). Should be easy, because we get to assume something very important and powerful: all subproblems are correctly solved.
Here is a proof, using these 3 rules, that the factorial function is correct:
The base case is 0; and according to the recursive mathematical definition, 0! = 1. This function recognizes an argument of 0 and returns 1 for it.
If n is a non-negative number that is not 0 (not the base case), then this function makes one recursive call: n-1 is closer to 0 (the base case) than n is. It is closer by 1: the distance between n-1 and 0 is 1 less than the distance between n and 0.
ASSUMING factorial(n-1) COMPUTES (n-1)! CORRECTLY, this function returns n*factorial(n-1), which is n*(n-1)! which according to the mathematical definition is the correct answer for n!, the parameter to this function.
Notice that the focus of the proof is on ONE call of the function (not like the hand simulation method above). We look at what happens if it is a base case (1) or if it actually recurs (2-3). For the recursive case, we don't worry about more recursive calls, because we get to assume that any recursive calls (on smaller problems, which might be the base case or at least closer to the base cases) compute the correct answer without having to think about what happens during any recursive calls.
Proof that fast-power function is correct (the code is duplicated from above):
def power(a,n): def square(n): n*n if n == 0: return 1 else: if n%2 == 1: return a*power(a,n-1) else: return square( power(a,n//2) )
The base case is 0; and according to the recursive mathematical definition, a**0 = 1. This function recognizes an argument of 0 and returns 1 for it.
If n is a non-negative number that is not 0 (not the base case), then if n is odd, n-1 is closer to 0 (the base case) than n is; if n is even (it must be >= 2), n//2 is also closer to 0 (the base case) than n is.
ASSUMING power(a,n-1) COMPUTES a**(n-1) CORRECTLY AND power(a,n//2) COMPUTES a**(n//2) CORRECTLY. n must be odd or even: if n is odd, this function returns a*a**(n-1), so it returns (by simplifying) a**n, which is the correct answer for the parameters to this function; likewise, if n is even, this function returns the value square(a**(n//2)), which returns (by simplifying) a**n, which is the correct answer for the parameters to this function. For example, for n the even number, 10, square (a**(10//2)) = square (a**5) = (a**5)**2 = a**10.
Again, the focus of the proof is on one call of the function: the parts concern only the base case and the recursive case (now two cases, depending on whether n is odd or even): and for the recursive cases, we don't worry about more recursive calls, because we get to assume that any recursive calls (on smaller problems, closer to the base cases) compute the correct answer without having to think about what happens during the recursion.
What happens if we write factorial incorrectly? Will the proof rules fail. Yes, for any flawed definitions one will fail. Here are three examples (one failure for each proof rule).
def factorial (n): if n == 0: return 0 # 0! is not 1 else: return n*factorial(n-1)
This factorial function violates the first proof rule. It returns 0 for the base case; since everything is multiplied by the base case, ultimately this function always returns 0. Bar bet: you name the year and the baseball team, and I will tell you the product of all the final scores (last inning) for all the games they played that year. How do I do it and why don't I make this kind of bet on basketball teams?
def factorial (n): if n == 0: return 1 else: return factorial(n+1)//(n+1) # n+1 not closer to base case: 0
This factorial function violates the second proof rule. It recurs on n+1, which is farther away from -not closer to- the base case. Although mathematically (n+1)!/(n+1) = (n+1)*n!//(n+1) = n! this function will continue calling factorial with ever-larger arguments: a runaway (or infinite) recursion. Actually, each recursive call can take up some space (to store its argument, see the hand simulation, which requires binding an argument for each recursive call), so eventually memory will be exhausted and Python will raise an exception.
Actually, Python limits the the number of times any recursive function can call itself. We can examine/set the recursion limit by importing the sys module and the calling sys.getrecursionlimit()/sys.setrecursionlimit(some number) functions.
def factorial (n): if n == 0: return 1 else: return n+factorial(n-1) # n+(n-1)! is not n!
This factorial function violates the third proof rule. Even if we assume that factorial(n-1) computes the correct answer, this function returns n added (not multiplied) by that value, so it does not return the correct answer. In fact, it returns one more than the sum of all the integer from 1 to n (because for 0 it returns 1) not the product of these numbers.
In summary, each of these functions violates a proof rule and therefore doesn't always return the correct value. The first function always returns the wrong value; the second function returns the correct value, but only for the the base case; it never returns a value for any other argument; the third function returns the correct value, but only for the the base case.
We can actually prove that these proof rules are correct! Here is the proof. This is not simple, but it is short so I will write the proof here and let you think about it (and reread it a dozen times if you need to).
Assume that we have correctly proven that these three proof rules are correct for some recursive funtion f. And assume that we assert that the function is not correct. We will show that these two assertions lead to a contradiction: if f is not correct, then there must be some problems that it does not correctly solve. And, if there is a problem that f does not correctly solve, there must be a SMALLEST problem that it does not correctly solve: call this problem p.
Because of proof rule (1) we know that p cannot be the base case, because we have proven f recognizes and solves base cases correctly. Since f solves p by recursion, it first recursively solves a problem smaller than p: we know by proof rule (2) that it always recurs on a smaller problem; and we know that f correctly solves this smaller problem, because p, by definition, is the smallest problem that f solves incorrectly. But we also know by proof (3) that if f recurs and correctly solves a smaller problem (as it does for p), it will correctly solve the original problem, p. Therefore, it is impossible to find a smallest problem that f incorrectly solves; so, f must solve all problems correctly.
Well, that is how the proof goes.
[top]
We can construct all the mathematical and relational operators on natural numbers (integers >= 0) given just three functions and if/recursion. We can recursively define the natural numbers as:
0 is the smallest natural number for any natural number n, s(n) (the successor of n: n+1) is a natural number
Now we define three simple functions z(ero), p(redecessor), and s(uccessor).
def z(n): # z(n) returns whether or not n is 0 return n == 0
def s(n): # s(n) returns the successor to n (n+1) return n+1
def p(n): # p(n) returns the predecessor of n, if one exists if not z(n): # 0 has no predecessor return n-1 else: raise ValueError('z: cannot compute predecessor of 0')
Note we should be able to prove/argue/understand the following:
z(s(n)) is always False p(s(n)) is always n s(p(n)) is n if n != 0 (otherwise p(n) raises an exception)
Given these functions, we can define functions for all arithmetic (+ - * // **) and relational ( == <... and all the other relational) operators. For example
def sum(a,b): if z(a): # a == 0 return b # return b: 0 + b = b else: # a != 0 returns sum( p(a), s(b) ) # return (a-1)+(b+1) = a+b
Proof of correctness
The base case is a==0; and according to our knowledge of of mathematics, sum(0,b) is 0+b which is b. This function returns b when the argument a == 0.
If z(a) is not True (a is not 0), then p(a) as the first agument in the recursive call to sum is closer to the base case of 0. Becaue a is not 0, there is a predecessor of (a number one smaller than) a.
Assuming that sum(p(a),s(b)) computes its sum correctly, we have sum(p(a),s(b)) = (a-1)+(b+1) = a + b = sum(a,b), so returning this result correctly returns the sum of a and b.
Another way to define this function is
def sum(a,b): if z(a): # a == 0 return b # return b: 0 + b = b else: # a != 0 returns s(sum( p(a), b ) # return (a-1)+(b) + 1 = a+b
We can als use the3 proof rule to prove this function correctly computes the sum of any two non-negative integers.
We can similarly define the mult function, multiplying by repeated addition.
def mult(a,b): if z(a): # a = 0 return 0 # return 0: 0*b = 0 else: # a != 0 return sum(b, mult(p(a),b)) # return b+((a-1)*b) = b+a*b-b = a*b
Switching from arithmetic to relational operators....
def equal(a,b): if z(a) or z(b): # a = 0 or b = 0 (either == 0) return z(a) and z(b) # return True (if both == 0) False (if one != 0) else: # a != 0 and b != 0 return equal(p(a),p(b)) # return a-1==b-1 which is the same as a==b
We also might find it useful to do a hand simulation of these functions, with the two parameters a and b stored in each "apartment" and passed as arguments.
The right way to illustrate all this mathematics is to write a class Natural, with these methods, and then overload/define __add__ etc. for all the operators. I just didn't have the time to do that now.
[top]
We can define strings recursively: '' is the smallest string a character catenated to the front of a string is a string
Let's use these proof rules to write a reciple for synthesizing (and therefore proving correct as we are writing them) a few recursive functions that process strings. Here is our approach:
Find the base (non-decomposable) case(s) Write the code that detects the base case and returns the correct answer for it, without using recursion
Assume that we can decompose all non base-case problems and then solve these smaller subproblems via recursion Choose (requires some ingenuity) the decomposition; it should be "natural"
Write code that combines these solved subproblems (often there is just one) to solve the problem specified by the parameter
We can use these rules to synthesize a method that reverses a string. We start with
def reverse(s):
def reverse(s): if s == '': # or len(s) == 0 return '' else: Recur to solve a smaller problem Use the solution of the smaller problem to solve the original problem
We can guess the form of the recursion as reverse(s[1:]) note that the slice s[1:] computes a string with all characters but the one at index 0: all the characters after the first. We are guaranteed to be slicing only on non-empty strings (those whose answer is not computed by the base case), so slicing will always be a smaller string. We get to assume that the recursive call correctly returns the reverse of the string that contains all characters but the first.
def reverse(s): if s == '': # or len(s) == 0 return '' else: Use the solution of reverse(s[1:]) to solve the original problem
Now, think about an example. if we called reverse('abcd') we get to assume that the recursive call works: so reverse(s[1:]) is reverse('bcd') which we get to assume returns 'dcb'). How do we use the solution of this subproblem to solve the original problem, which must return 'dcba'? We need to catenate 'a' (the first character, at s[0]) to the end of the reverse of all the other characters: 'dcb' + 'a', which evaluates to 'dbca', the reverse of all the characters in the parameter string. Generally we write this function as
def reverse(s): if s == '': # or len(s) == 0 return '' else return reverse(s[1:]) + s[0]
We have now written this method by ensuring the three proof rules are satisfied so we dont' have to prove them, but note that
the reverse of the smallest string (empty) is computed/returned correctly
the recursive call is on a string argument smaller than s (all the characters from index 1 to the end, skipping the character at index 0, and therefore a string with one fewer characters)
ASSUMING THE RECURSIVE CALL WORKS CORRECTLY FOR THE SMALLER STRING, then by catenating the first character on the end of it, we have correctly reversed the entire string (solving the problem for the parameter)
In fact, we can use a conditional expression to rewrite this code as a single line as well.
def reverse(s): return ('' if s == '' else reverse(s[1:]) + s[0])
Here is a similar recursive function for reversing the values in a list.
def reverse(l): if l == []: # or len(l) == 0 return []; else return reverse(l[1:]) + [l[0]] # [l[0]] for right operand of +
Now we will write a recursive function that returns the string equivalent of an int using the same approach: satisfying the three proof rules. We know that Python's str function, automatically imported from the builtins module) will return the string representation of an int. We can actually now write this function recursively and at the same time prove it is correct.
To start, we assume that the integer is non-negative (and fix this assumption later). Unlike the factorial and power functions, here the size of the integer will be the number of digits it contains: the smallest non-negative integer (0) contains 1 digit, so that is the smallest size problem. So, we start with the header and base case.
def to_str(n): if 0 <= n <= 9: return '0123456789'[n] # 0<=n<=9, so no index error else: Recur to solve a smaller problem # n has at least two digits Use the solution of the smaller problem to solve the original problem
We can guess the form of the recursion as to_str(n//10) and to_str(n%10) because n//10 is all but the last digits in n and n%10 is the last digit. If N has at least d digits (where d>=2), then both n//10 and n%10 will have fewer digits: n//10 has d-1 digits and n%10 has 1 digit.
We get to assume that the recursive call correctly returns the string representation of these numbers.
def to_str(n): if 0<= n <= 9: return '0123456789'[n] # 0<=n<=9, so no index error else: Use the solution of to_str(n//10) and to_str(n%10)
Now, think about an example. if we called to_str(135) we get to assume that the recursive calls work: so to_str(n//10) is to_str(13) which we get to assume is '13' and to_str(n%10) is to_str(5) which we get to assume is '5'. How do we use the solution of these subproblems to solve the original problem? We need to catenate them togther. Generally we write this function as
def to_str(n): if 0<= n <= 9: return '0123456789'[n] # 0<=n<=9, so no index error else: return to_str(n//10) + to_str(n%10)
We have now written this method by ensuring the three proof rules are satisfied. Note that
the to_str of the smallest ints (1 digit) are computed/returned correctly
the two recursive calls are on int arguments that are smaller than n by at least one digit (in fact the second call is always 1 digit).
ASSUMING THE RECURSIVE CALLS WORK CORRECTLY FOR THE SMALLER int , then by catenating the two numbers together, we have correctly found the string representation of the n (solving the original problem)
We make this function work for negative numbers by redefining to_str with its original code in a locally defined function, changing the body of this function by either appending nothing or a '-' in front of the answer, depending on n.
def to_str(n): def to_str1(n) if 0<= n <= 9: return '0123456789'[n] # 0<=n<=9, so no index error else: return to_str(n//10) + to_str(n%10) return ('' if n >= 0 else '-')+to_str1(abs(n)) # or #return (to\_str1(n) if n >= 0 else '-'+to\_str1(-n))
In fact, the following function uses the same technique (but generalizes it by converting to an arbitrary base) to compute the string representation of a number in any base from binary up to hexadecimal: to_str(11,2) returns '1011'
def to_str(n,base=10): if 0<= n <= base-1: return '0123456789ABCDEF'[n] # 0<=n<=9, so no index error else: return to_str(n//base,base) + to_str(n%base,base)
Now let's write a method that has two recursive parameters. Suppose we want to write a same_length function that tests whether the length of its two string parameters are equal, without ever explicitly computing the length of each. With two recursive parameters we have possible 4 base conditions
Parameter 2 Empty Not empty +----------+----------+ Empty | Equal | Not equal| Parameter 1 +----------+----------+ Not Empty | Not Equal| recur | +----------+----------+
In three of the four, we immediately know the answer. If both parameters are empty then the strings have the same length; if one parameter is empty and one isn't, then the strings have different lengths. Only if both are not empty do we need to recur to compute the correct answer.
Here are three ways to write the base cases.
if s1 == '' and s2 == '': return True if s1 == '' and s2 != '': return False if s1 != '' and s2 == '': return False; if s1 == '': return s2 == '' if s2 == '' return False # if got here, s1 != '' if s1 == '' or s2 == '': # if either is empty, will return return s1 == '' and s2 == '' # return True if both empty if s1 == '' or s2 == '': # if either is empty, will return return s1 == s2 # return True if the same (empty)
So we can start this function as
def same_length(s1,s2) if s1 == '' or s2 == '': return s1 == '' and s2 == '' else: Recur to solve a smaller problem # s1/s2 each are not empty Use the solution of the smaller problem to solve the original problem
Now, if Python executes the else: clause then it has two non-empty strings, for each of which we can compute a substring (all the characters after the first). If the substrings have the same length, then the original strings have the same length; if the substrings don't have the same length then the original strings don't have the same length. So, solving this problem for the substrings is exactly the same as solving it for the original strings. So we can write the recursive call as
def same_length(s1,s2): if s1 == '' or s2 == '': return s1 == '' and s2 == '' else: return same_length(s1[1:],s2[1:])
Note that if we compared the lengths of a huge string and a tiny one, we would find that they are different in an amount of time proportional to the tiny string.
[top]
Finally, here are some some simple recursive list processing functions. As with strings, we can slice a list to get a smaller list, with the slice l[1:] especially common and useful.
Could you start from scratch and define this as illustrated above?
We can define lists recursively: [] is a list a value catenated to the front of a list is a list
If there were not len function for lists, we could easily define it recursively as
def len(l): if l == []: return 0 else: return 1 + len(l[1:])
Likewise for a sum function
def sum(l): if l == []: return 0 else: return l[0] + sum(l[1:])
Below, the all_pred function returns True if and only if predicate p always returns True, when called on every value in the list.
def all_pred(l,p): # where p is some predicate whose domain includes l's values if l == []: return True else: return p(l[0]) and all_pred(l[1:],p)
Note that because and is a short-circuit operator, it recurs only as far as the first False value, at which point it does not need to call all_pred(l[1:]) recursively. When we study efficiency, we will discover that the way Python represents lists (as growable arrays) make recursion inefficient compared to iteration, but when we study linked list and trees (briefly this quarter, extensively in ICS-46) we will see for those implementations, recursion is as fast at iteration.
Finally, you might wonder why the base case, all([],p) returns True. What should the function return for an empty list? Well, imagine we are one call before the empty list: a list with one value. What should all([a],p) return. Well, it should return p(a) (True if p(a) is) True for this one-element list. What does the recursive function return: p(a) and all([],p). So we need to solve the equation by determing what all([],p) should be.
p(a) == p(a) and all([],p)
To solve this equation, and determine the value of all([],p), we find that all([],p) must be True (if it were False, p(a) and all([],p) would be the same as p(a) and False, which would always be False, not the required answer of p(a).
Based on this same logic, here are what based cases must be, categorized by the operator before the recursive call.
base case = True ... and recursive-call base case = False ... or recursive-call base case = 0 ... + recursive-call base case = 1 ... * recursive-call base case = -infinity ... max(...,recursive_call) base case = +infinity ... min(...,recursive_call)
Generally x op recursive-call(base case) must be x, which it is for all these values. and operators.
[top]
Define a recursive function named is_odd using the functions z, p, and s described in the lecture, which computes whether or not its argument is an odd value.
Define a recursive function named remove, which takes string and a 1-character string, and returns a string with the specified character removed: remove('afghanistanbananastand','a') returns 'fghnistnbnnstnd'.
Define a recursive function named replace, which takes string and two 1-character strings, and returns a string with the first specified character replaced byh the second: remove('potpourri','o','O') returns 'pOtpOurri'.
Define a recursive function named contains, which takes a list and a value as arguments, and returns whether or not the value appears in the list.
Define a recursive function named is_sorted, which takes a list as an argument, and returns whether or not the list of values is non-decreasing (each is >= to the value preceding it).
Define the function equals(s1,s2), which computes whether two strings are == without ever comparing more than 1-character strings.
Write less_than(s1,s2) which computes whether s1 < s2 (where both are strings) without ever comparing more than 1-character strings. The result should be the same as using < (the standard Python comparision).
Write a function named min_stamps that takes an amount as an argument and returns the minimum number of stamps that you need to make that amount. Assume inside the function you would define denominations as a list with all the stamp amounts: e.g., denominations = [1, 2, 5, 12, 16, 24]. With these denominations min_stamps(19) returns 3 (denominations 1, 2, 16 or 2, 5, 12).


comtypes is a pure Python COM package based on the ctypes ffi foreign function library.
While the pywin32 package contains superior client side support for dispatch based COM interfaces, it is not so good to access custom COM interfaces.
comtypes, however, makes it easy to access and implement custom and dual COM interfaces.
Documentation is sparse, there are two documents which are still work in progress:
comtypes.client.html describes the high level client side support, and com_interfaces.html describes how COM interfaces are defined.
If you have ez_setup installed, you can install the lastest comtypes release with easy_install comtypes. Otherwise you should grab it from the sourceforge download page.
The development version can be get with easy_install comtypes==dev, or from the SVN repository.


Marketplace 1.2.6
- Fix: Search results would be limited to the first 100.
- Fix: Searches would occasionally crash after multiple runs.
As always, I'd love to hear any feedback, ideas, or criticisms you may have about Marketplace. Email me with your thoughts.


Recipe for Ugali
Ingredients (4 servings)
4 cups water
4 cups maize meal or corn meal flour
Bring water to a boil in a pan. Add the corn or maize meal and stir with a wooden spoon until the mixture is thick and smooth. Make sure it is not too stiff. Add boiling water if it is too thick. Gather the mixture in the middle of the pan and turn the heat to low. Cover the pan and leave it on low heat for 15-20 minutes, turning occasionally. Flip the ugali onto a plate and, after it cools a bit, form it into a "cake". Slice and serve with chicken, beef, fish or meat stew and a cooked vegetable dish or even sour milk (buttermilk).


User avatars of different sizes can be fetched or loaded inline in HTML.
GET a.wunderlist.com/api/v1/avatar
| Name | Type | Notes |
|---|---|---|
| user_id | integer | required |
| size | integer | optional, values: 25, 28, 30, 32, 50, 54, 56, 60, 64, 108, 128, 135, 256, 270, 512 and original |
| fallback | boolean | optional |
302 Found
This request will redirect you to an url for the avatar of the given user based on the user_id
, if there is no avatar it will redirect a default avatar image.
You don't need to send an X-Access-Token
for this request.
If you add the optional parameter size
to the request it will redirect to an avatar with the given size
.
By adding the optional parameter fallback
with the value false to the request, you will not be redirected to our fallback avatars. If there is no custom avatar uploaded for the given user_id
it will respond with a 204 No Content
and an empty body.
It should go without saying, but all requests must be made using a secure connection. We support a minimum of TLS 1.0.


FROM THE DESK OF MR.JONES ADEX CITY EXPRESS BANK PLC ATTENTION:FRIEND, STRICTLLY A PRIVATE BUSINESS PROPOSAL I AM MR. JONES ADEX, THE MANAGER, BILLS AND EXCHANGE AT THE FOREIGN REMITTANCE DEPARTMENT OF THE CITY EXPRESS BANK PLC. I AM WRITING THIS LETTER TO ASK FOR YOUR SUPPORT AND COOPERATION TO CARRY OUT THIS BUSINESS OPPORTUNITY IN MY DEPARTMENT. WE DISCOVERED AN ABANDONED SUM OF $20.5,000.000.00 (TWENTY MILLION FIVE HUNDRED THOUSAND USD DOLLARS) IN AN ACCOUNT THAT BELONGS TO ONE OF OUR FOREIGN CUSTOMERS WHO DIED ALONG WITH HIS ENTIRE FAMILY OF A WIFE AND TWO CHILDREN IN NOVEMBER 1997 IN A PLANE CRASH. SINCE WE HARD OF HIS DEATH, WE HAVE BEEN EXPECTING.HIS NEXT-OF-KIN TO COME OVER AND PUT CLAIMS FOR HIS MONEY AS THE HEIR, BECAUSE WE CANNOT RELEASE THE FUND FROM HIS ACCOUNT UNLESS SOMEONE APPLIES FOR CLAIM AS THE NEXTOF-KIN TO THE DECEASED AS INDICATED IN OUR BANKING GUIDELINES. UNFORTUNATELY, NEITHER THEIR FAMILY MEMBER NOR DISTANT RELATIVE HAS EVER APPEARED TO CLAIM THE SAID FUND. UPON THIS DISCOVERY, I AND OTHER OFFICIALS IN MY DEPARTMENT HAVE AGREED TO MAKE BUSINESS WITH YOU AND RELEASE THE TOTAL AMOUNT INTO YOUR ACCOUNT AS THE HEIR OF THE FUND SINCE NO ONE CAME FOR IT OR DISCOVERED HE MAINTAINED ACCOUNT WITH OUR BANK, OTHERWISE THE FUND WILL BE RETURNED TO THE BANKS TREASURY AS UNCLAIMED FUND. WE HAE AGREED THAT OUR RATIO OF SHARING WILL BE AS STATEDTHUS: 35% FOR YOU AS FOREIGN PARTNER,60% FOR US THE OFFICAIALS IN MY DEPARTMENT AND 5% FOR THE SETTLEMENT OF ALLLOCAL AND FOREIGN EXPENSES INCURRED BY US AND YOU DURING THE COURSE OF THIS BUSINESS. UPON THE SUCESSFUL COMPLETION OF THIS TRANSFER, I AND ONE OF MY COLLEAGUES WILL COME TO YOUR COUNTRY AND MIND OUR SHARE. IT IS FROM OUR 60% WE INTEND TO IMPORT AGRICULTURAL MACHINERIES INTO MY COUNTRY AS A WAY OF RECYCLING THE FUND.  Your Full Name: ___________________________ Your Complete Address: _____________________________ Name of City of Residence: ____________________ Date of Birth (Day/Month/Year): ____________________ Direct Telephone Number:_____________________ mobile ____________________________ Number: _______________________________________ Fax Number: ____________________________________ NOTE ALSO, THIS TRANSACTION MUST BE KEPT STRICTLY CONFIDENTIAL BECAUSE OF ITS NATURE. I LOOK FORWARD TO RECEIVING YOUR PROMPT RESPONSE. MR. JONES ADEX jonesadex@yahoo.co.uk


Warning Signs:
Health Symptoms:
Coping Methods:
Based on your answers to the stress test we recommend the following:


-
Register a new profile
-
Calculate price and time frame of the shipment
-
Make a shipping request online (saving the template is available)
-
Download invoice for each shipment
-
Track your shipment in your profile:
— Track the shipment’s location
— Know the shipment date on the transportation stage
— Control receiving TLX-RELEASE from the shipper
— Get information on weight measurements and inspection
-
Upload the documents for preliminary customs registration and control the timetable.
-
Receive closing documents and reconciliation reports.
-
Generate and download data of the terminal tracking in Excel


{{> head/head head.defaults}}
A world light years beyond your imagination.
Pixel Force is a mobile game developer based in Helsinki, Finland, with offices in San Francisco, Tokyo, Seoul and Shanghai.
Pixel Force is a mobile game developer based in Helsinki, Finland, with offices in San Francisco, Tokyo, Seoul and Shanghai.
Our goal is to make the best games – games that are played by as many people as possible, enjoyed for years and remembered forever.


App Name
Are you Y3K ready?
Home
About
Download
Staff
About appname
Follow the steps below to download app.
Steps
Press appropriate download button
Press install
Agree to user terms and agreements
Wait patiently
Enjoy the app!


Open Source Contributions
Academic Projects
Implemented ray casting based direct volume renderer to visualize 3D volume data. Scalar field values were mappedto color and opacity using interactive transfer functions. Main application area of volume rendering is medicalimaging where volume data is obtained from X-ray, CT scans, PET scans etc.
Investigated, identified and implemented effective and intuitive visualizations of security analytics, ensuring that the enterprise security incident response teams can not only consume the security analytics results, but also make better informed decisions with regard to its correctness and criticality.
Implemented an absolute minimal Kernel, to understand the basic functionality of how Kernels are developed, build, linked and loaded into the memory. Also wrote drivers for video display manipulation, interrupt handler and a programmable interval timer.
Plagiarism is a serious issue in computer science courses involving assessment of programming assignments. The electronic nature of these assignments means copying others’ work is very easy, and the lack of variation between legitimately independent solutions makes the detection of plagiarized solutions difficult. We implemented augmented Suffix Tree data structure for checking the plagiarism in the codes submitted to various professors at IIITB. Given a set of programming assignments, this implementation checks for the plagiarism among all the files and generates a detailed report of the copied code along with the file names.
Implemented an interactive program that allows the editing and rendering of a mesh surface. The surface is refined through successive subdivision using a standard subdivision scheme. User will be able to edit the shape of the surface by dragging “control points” of the surface.
Implemented a program to simulate the motion of an articulated robot that moves blocks from one conveyor belt to another. Objects were modelled as logical hierarchical structures and a custom scenegraph was implemented in the process. Simple forward kinematics was used to animate the robot.
Implemented an automated traffic signal, which controlled the lights on the basis of traffic analysis, automatically. This system takes into consideration the amount of traffic on each side at a particular instant, unlike the existing system which has a fixed amount of time allocated for a side, based on one time initial calculations.
Hobby Projects
Implemented an educational games suite for 8-15 age group, to help them learn about energy saving. Games comprised of ’Power Sudoku’, ’Bulb Buster’, ’Smart Buyer’.