Try out our Premium Member services: Virtual Legal Assistant, Query Alert Service and an ad-free experience. Free for one month and pay only if you like it.
BEFORE THE NATIONAL GREEN TRIBUNAL (WESTERN ZONE) BENCH, PUNE APPLICATION No. 16 OF 2013 (WZ) CORAM: 1. Hon'ble Shri Justice V.R. Kingaonkar (Judicial Member) 2. Hon'ble Dr. Ajay A. Deshpande (Expert Member) B E T W E E N: NASIK FLY ASH BRICKS ASSOCIATION Through its President Mr. Sunil Mendhekar, Age-47 years, Occ: Business, Office Address: C/o Prakash Engineering Industries, D-28, Street 10, MIDC, Satpur, Nasik-7. ........ Applicant Versus 1) MINISTRY OF ENVIRONMENT AND FOREST (MoEF) Govt of India Paryavaran Bhavan, CGO Complex,Lodhi road, New Delhi-110 003, INDIA 2) MAHARASHTRA STATE POWER GENERATION CO. LTD (MAHAGENCO) Hongkong Bank Building, M.G.Road, Fort, Mumbai-400 001. 3) CHIEF ENGINEER, NASIK THERMAL POPOWER STATION, Eklahare, Tahsil: Nashik, Dist: Nasik. 4) PRINCIPAL SECRETARY, Urban Development Dept., Govt of Maharashtra. 4th Floor, Mantralaya, Mumbai-400032. (J) Appln.. No.16 of 2013 1 5) COMMISSIONER, NASHIK MUN. CORPORATION, Nashik Municipal Corporation, Nashik (East). 6) Collector, Nashik District Maharashtra State PIN: 422002. 7) MAHARASHTRA POLLUTION CONTROL BOARD, Nashik Regional Office, Udyog Bhavan, First Floor, Trimbak Road, Near ITI, Satpur, Nashik-422007. .....Respondents Counsel for Applicant Asim Sarode Adv Ms. Pallavi Talware Counsel for Respondent(s): Krishna D. Ratnaparkhi, for Respondent No.1. Shriram S.Kulkarni, w/Chaitanya B.Nitke for Respondent Nos. 2 & 3. Sudhir Kotwal, for Respondent No.5. M.P.Barhanpurkar DMO, Nasik for Respondent No.6. D.M.Gupte Adv w/Supriya Dangare for Respondent No.7. Date: March 21st , 2014 J U D G M E N T
1. The Applicant - Nashik Fly Ash Association claims to be an Association working on issues related to the fly ash and has filed this Application being aggrieved due to non- implementation of MoEF Notifications, related to fly ash utilization, issued from time to time. The Applicant claims that the Respondents have individually and collectively failed in effectively implementing these Notifications, resulting in inadequate utilization of fly ash which has resulted into over exploitation of natural top soil of earth, causing damages to (J) Appln.. No.16 of 2013 2 the environment. It is also pleaded that due to non-utilization of fly ash for brick manufacturing, the traditional red bricks are continued to be used and though there are norms for use of fly ash, even for manufacturing of the red bricks, yet same are not followed. The brick kilns manufacturing red bricks are also polluting activities as they emit air pollutants.
2. The Applicant submits that the Respondent 1 is Ministry of Environment and Forest, Govt. of India which has issued the Fly Ash notifications and is overall responsible for protection of environment in the country. Respondent No.2 and 3 are operating Nashik Thermal Power Station which is one of the major fly ash generator and needs to comply with the provisions of fly ash Notifications issued from time to time. Respondent 4 and 5 are responsible for urban development activities in Nashik Municipal areas including the regulating construction activities, where fly ash bricks are required to be used as per the Notification. Respondent 6 is Collector, who is responsible for regulating the fly ash use in brick manufacturing units. The Respondent No.7, i.e. Maharashtra Pollution Control Board, (MPCB), has given consent to operate to the Respondent Nos.2 and 3, under the provisions of the Water (Prevention and Control of Pollution) Act 1974 and the Air (Prevention & Control Pollution) Act 1981, and has stipulated that the Respondent No. 3 shall provide full-fledged mechanized arrangements for collection, transportation, loading and unloading of fly ash generated (J) Appln.. No.16 of 2013 3 from various activities in the premises and to achieve 100% fly ash utilization on or before 31st March, 2013.
3. The Applicant also submits that the Chief Engineer, Public Works Department (PWD), Nasik Region, vide circulation dated 20th May, 2000, has clearly instructed that from 1st July, 2000, onwards while constructing the Govt. buildings use of fly ash bricks has been made mandatory in the limits of Nasik, Bhusaval, Jalgaon Municipal areas and within radius of 50 kms from these limits. It is the case of Applicant that in spite of such clear directions issued under the fly ash notification, the construction activities in Nashik area are undertaken without mandatory use of fly ash bricks, and the Respondents are not regulating these activities for the compliance of the Notification.
4. The Applicant submits that the MoEF Notification dated 3rd November, 2009, in Section 11 (1) (ii) stipulates that at least 20% dry ESP fly ash should be made available free of charge to the Units manufacturing fly ash or clay-fly ash bricks, blocks and tiles etc. on priority basis over other users. If demand from such Agencies fall short of 20% of quantity, the balance quantity can be sold or disposed of by the Power Station, as may be possible. The Applicant submits that in spite of such mandatory provisions, the Respondent Nos.2 and 3, have not adhered to the stipulated norms and are not complying with the obligations stipulated in the fly ash Notifications, particularly making at least 20% of dry ESP fly (J) Appln.. No.16 of 2013 4 ash available to the Units manufacturing fly ash or clay-fly ash bricks, blocks and tiles on priority basis. The Applicant further submits that even the traditional brick kilns which are operational in the area, are also not using fly ash as per fly ash Notifications and the concerned Authority - the Collector has failed to take any action against these red brick manufacturing Units.
5. Though there are several prayers in the Application, during course of hearing and arguments, the counsel for Applicant has only pressed for prayers (A),(B) and (C) of the Application and has withdrawn remaining prayers. These prayers pressed on by the Applicant are as under:
(A) The Respondent No.1 to 6 may kindly be directed to implement the MoEF Notification Dated 3rd November, 2009.
(B) The Respondent Nos.2 and 3 may kindly be directed to immediately stay the Tender proposal dated 3/5/2013 and process issued to sale the 80% dry fly ash because it is as per the MoEF Notification.
(C) Directions may kindly be issued to all the Respondents that wherever Thermal Power Stations are set up use of red clay bricks shall be banned completely and only fly ash bricks shall be used.
6. The Respondent No.1 i.e. MoEF, has filed affidavit through Shri. Shrad, Deputy Director of MoEF, which basically deals with various Notifications issued by the MoEF from time to time on the subject of fly ash utilization. It is submitted that as per the amendment Notification (J) Appln.. No.16 of 2013 5 No.S.O.2804 (E), dated 3rd November, 2009, inter alia, provides for utilization of fly ash. The relevant provisions are as under:
"(1) All coal or lignite based thermal power stations would be free to sell fly ash to the user agencies subject to the following conditions namely-
(a) The pond ash should be made available free of any charge on "as is where is basis" to manufacturers of bricks, blocks or tiles including clay fly ash product manufacturing unit(s) farmers, the Central and the State road construction agencies, Public Works Department and to agencies engaged in backfilling or stowing of mines.
(b) At least 20% of dry ESP fly ash shall be made available free of charge to units manufacturing fly ash or clay-fly ash bricks, blocks and tiles on a priority basis over other users and if the demand from such agencies falls short of 20% of quantity the balance quantity can be sold or disposed of by the power station as may be possible.
Provided that the fly ash obtained from the thermal power station should be utilized only for the purpose for which it was obtained from the thermal power station or plant falling which no fly ash shall be made available to the defaulting user."
7. The affidavit further mentions that the responsibility of monitoring and facilitating implementation of this Notification, is that of the State Government level monitoring committee, constituted by the State Government, as per provisions of the Notification. In addition to this, the Committee is also empowered to deal with issues which could not be resolved by Dispute Settlement Committee constituted under said Notification by each coal or lignite based thermal power station and also is empowered to suitably modify (waive/relax) the stipulation under paragraph (1) in case of non-availability of fly ash in sufficient (J) Appln.. No.16 of 2013 6 quantity. The State Level committee is expected to meet once in a month.
8. The Respondent Nos.2 and 3 filed first affidavit on 9th December, 2013 and submitted that the Application has been filed by the Applicant in abuse of process of law and has not been filed with clear hands. It is submitted that as per fly ash Notification of 2009, the thermal power stations are free to sale 80% dry ESP fly ash and at least 20% fly ash should be provided to the brick kilns manufacturers. It further mentions that the Respondent No.2 published an advertisement on 31st March 2013, for distribution of 20% of fly ash on free basis to the brick kilns and other users, as per the Notification. This advertisement was cancelled in view of policy decision of the Respondent No.2, dated 14 th October 2013 and fresh advertisement was published on 27.10.2013. Respondent 3 further issued advertisement on 3rd May, 2013 for sale/disposal of balance 80% dry ESP fly ash. Applicant, through his proprietary firm, M/s. Ashking Enterprises also participated in the tender process, however, was unsuccessful in the technical bid evaluation and failed to compete in further bidding process. The affidavit further mentions various initiatives taken by the Respondent No.2 and in paragraph 18, it mentions that the MoEF Notification merely acts as guidelines to the Respondent No.2, and no- where creates rights in favour of any specific Industry, Body (J) Appln.. No.16 of 2013 7 of Association, Company etc. to lift such desired amount of fly ash.
9. The Respondent Nos.2 and 3 further filed affidavit on 19th January 2014, and submit that the Respondent No.3, has published advertisement dated 27th October, 2013 for distribution of 20% ESP fly ash on free basis and after due scrutiny, total 29 successful applicants were issued orders dated 10th December 2013 to lift total 20% dry ESP fly ash, including M/s Trimurti Industries, in which the Applicant is a partner. The affidavit further goes on to submit that various initiatives are taken by the Respondents to increase fly ash utilization. It is further submitted that the Respondent Nos. 2 and 3 are acting as per the directions given vide MoEF vide various Notifications for utilization of fly ash and as such, any decision regarding utilization of fly ash and its management is policy decision and as such, it would not be proper for this Tribunal to interfere in the same.
10. Shri. Kulkarni, learned Advocate for the Respondent Nos. 2 and 3 vehemently argued the matter and highlighted that fly ash management at a coal fired thermal power station is a complex and skilled job and the Respondent Nos. 2 and 3 are efficiently performing their duties as per the fly ash notification. He admits that before last ten (10) years, the fly ash utilization was not a priority issue and most of thermal power stations were storing fly ash in the ash ponds as a final disposal method. However, since the fly ash notification of (J) Appln.. No.16 of 2013 8 1999, thermal power plants have started prioritizing of fly ash utilization which in fact helped the power station to reduce the fly ash storage and also, the area for such storage within the power plant complex and also, generated a new source of revenue for the power plants. He mentioned that with the increased awareness about beneficial use of fly ash in various ways like fly ash bricks, clay-fly ash bricks, fly ash construction products, use in cement manufacturing, embankments/land-filling etc., the demand of fly ash has increased significantly and therefore, the MoEF has amended the notification keeping in view increased use of fly ash and also, difficulties and constraints faced by thermal power stations, through amendments of 2003 and 2009. He further argued that Nashik Thermal Power Plant is under the Maharashtra State Power Generation Co. Ltd. (MAHAGENCO) and Mahagenco has taken a policy decision regarding 20% fly ash allocation to the units manufacturing fly ash or clay-fly ash bricks, blocks and tiles at thermal plants of Mahagenco on 14th October, 2013, which are comprehensive and self-explanatory. The Mahagenco has laid down a procedure for allotment of 20% fly ash allocation to these units on free basis, following certain due diligence, as envisaged in the notification itself. He further submits the ash generated and utilization of data of Nashik Thermal Power Station for the year 2013, which is as under: (J) Appln.. No.16 of 2013 9
Ash Generation and Utilization Data from April 2013 to December 2013 and Proposed Ash Generation for Month of January 2014 Name of Month Ash Generated in MT Ash Utilized TPS in MT Nashik Apr-13<PHONE_NUMBER>1 TPS May-13<PHONE_NUMBER>86 Jun-13<PHONE_NUMBER>4 Jul-13 83354 51650 Aug-13 96842 59182 Sep-13<PHONE_NUMBER>4 Oct-13<PHONE_NUMBER>1 Nov-13<PHONE_NUMBER>8 Dec-13<PHONE_NUMBER>85 Proposed Ash 130000 Generation for Jan 2014
11. Learned Advocate for the Respondent Nos. 2 and 3 further submits that the Hon'ble High Court Judicature at Madras, by dated 13.6.2013, gave Judgment in Writ Petition No.12295 of 2011 and M.P.No.1 of 2011, regarding providing fly ash on free basis to various units as stipulated in the notification. He referred to paragraph 30 of said Judgment which is as follows:
" 30. Similarly, fly ash, which can be equated to a by-product in the process of generation of electricity, is the property of the generating company. While what can be curtailed by the Ministry of Environment and Forests is the discharge of that pollutant into the atmosphere, the right of the generating company to dispose of the same without causing pollution, cannot be curtailed by the Ministry of Environment and Forests. "
He therefore argued that this judgment has not been stayed by any superior court and therefore is applicable in the instant case also. He relied on Judgment of Hon'ble Bombay High Court in Commissioner of Income Tax vs Godavari Devi Saraf on 27.9.1977 (1978 113 ITR 589 Bom)
12. He further submits that the Applicant has not approached this Tribunal with clean hands and he is one of (J) Appln.. No.16 of 2013 10 the partners in a proprietary firm, called "Ash king Enterprises", who have also submitted the bid for fly ash generated at the Respondent No.3 unit. However, he failed in bidding in the said bid. He further argued that tender notice dated 3rd May, 2013, was related to the sale/disposal of 80% of fly ash. Subsequently, the Respondent No.3, has published advertisement on 27.10.2013 for distribution of 20% ESP dry fly ash to the eligible manufacturers as per the notification. In this tender process, the Respondent No.3, has also issued orders to 29 successful Applicants for lifting 20% ESP dry fly ash including M/s Trimurti Industries, in which the Applicant is a partner. The Applicant has already paid security deposit and has started lifting of fly ash as per the tender conditions. The Respondent Nos. 2 and 3 further submit that they had taken all the necessary pro-active steps for increasing utilization of fly ash and had contacted the potential users, as well as the Govt. Agencies for increased utilization of fly ash. The learned Counsel for Respondent Nos.2 and 3, therefore submits that they have complied with fly ash notification and, therefore, the present Application be dismissed.
13. The Respondent No.5, has submitted affidavit on 21.11.2013 and has submitted that the Nasik Municipal Corporation is undertaking their construction work as per the DSR published by the PWD, Govt. of Maharashtra and has also enclosed copies of the same along with a sample (J) Appln.. No.16 of 2013 11 copy of the sanction issued for various construction activities, wherein use of fly ash bricks and products has been made mandatory.
14. Respondent 6 (Collector) and 7 (MPCB) have also filed separate affidavits. Their affidavits indicate efforts taken by them for implementation of fly ash notification. However, both the affidavits fail to show the compliance level as far as utilization of fly ash by the Thermal power station (generation side) and utilization of fly ash by brick kilns, construction agencies etc. (demand side), and also, actions taken by both Respondents against the agencies non-complying with the Notification.
15. Considering the Application and also arguments of learned Counsel and after going through the relevant record, in our opinion, the following issues arise and need to be determined for adjudication of the present Application:
1. Whether the Respondent Nos.2 and 3, are complying with fly ash notifications as amended from time to time?
2. Whether there is adequate enforcement and monitoring mechanism to regulate utilization of fly ash generated by the Respondent Nos. 2 and 3?
3. What steps need be taken for effective enforcement of fly ash notifications to achieve the target, set out in the notifications?
The reasons along with our findings on the issues are discussed herein below:
(J) Appln.. No.16 of 2013 12
16. We may first proceed with summarization of the important aspects of fly ash notifications for better understanding of the dispute raised in the Application. Fly ash, which causes enormous amount of air pollution and which is considered to be hazardous to the environment, is generated in huge quantity by coal or lignite based thermal power plants. In order to reduce the impact of fly ash on the environment, the Government of India issued a Notification dated 14.9.1999, in exercise of the powers conferred by Sub- Section (1) read with Clause (v) of Sub-Section (2) of Section 3 and Section 5 of the Environment (Protection) Act, 1986.
17. The Final Notification was in three parts, dealing respectively with-
a) Use of fly ash, bottom ash or pond ash in the manufacture of bricks and in other construction activities;
b) Utilization of ash by thermal power plants; and
c) Specification for use of ash based products.
18. The first part of the Notification imposed a prohibition upon any person carrying on the activity of manufacturing clay bricks or tiles or blocks for use in construction activities, without mixing at least 25% of fly ash, if the activity is carried on within the radius of 50 km from the thermal power stations. The second part of the Final Notification contains direction to every coal or lignite based thermal power plant to make available ash for at least ten (J) Appln.. No.16 of 2013 13 (10) years from the date of publication of the Notification without any payment or any other consideration, for the purpose of manufacturing ash based products. The third part relates to promotion of utilization of fly ash products.
19. Subsequently, the Central Government issued an amendment to the above Notification by yet another Notification dated 27.8.2003. By the said Notification, a mandate was issued to all construction agencies engaged in the construction of buildings within a radius of 50- 100 kms from a coal or lignite based thermal power plant, to use fly ash bricks or blocks or tiles or clay fly ash bricks, etc., subject to a minimum percentage mentioned in the order itself. The Amendment Notification preserved intact, the obligation of coal or lignite based thermal power plants to make available ash, for the purpose of manufacturing ash based products for any construction activity. Additionally, the amended Notification stated that the thermal power plants have to ensure availability of fair quantity of ash to each user, including brick kilns.
20. Another amended Notification was issued on 3.11.2009 with several amendments to the original Notification. Out of the several amendments, paragraph (2) is relevant in the present matter and is as follows:
" (1) : All coal or lignite based thermal power stations would be free to sell fly ash to the user agencies subject to the following conditions, namely:-(J) Appln.. No.16 of 2013 14
(i) The pond ash and mound ash should be made available free of any charge on 'as is where is' basis to manufacturers of bricks, blocks or tiles including clay fly ash product manufacturing unit(s), farmers, the Central Government and the State Road Construction Agencies, Public Works Department, and to agencies engaged in backfilling or stowing of mines.
(ii) At least 20% of dry ESP fly ash shall be made available free of charge to units manufacturing fly ash or clay-fly ash bricks, blocks and tiles on a priority basis over other users. If the demand from such agencies fails short of 20% of quantity, the balance quantity can be sold or disposed of by the power station as may be possible.
Provided that the fly ash obtained from the thermal power station should be utilized only for the purpose for which it was obtained from the thermal power station or plant failing which no fly ash shall be made available to the defaulting users".
21. We have gone through various provisions of fly ash notifications related to the enforcement and monitoring aspects. Notification dated September 14th, 1999, stipulates that "the Authority for ensuring the use of satisfied quantity of ash, shall be the concerned Regional Officer of the State Pollution Control Board or, the Pollution Control Committee", as the case may be. It further stipulates that the action plans prepared by coal or lignite based thermal power plants annual implementation report, shall be submitted to the Central Pollution Control Board (CPCB), concerned State Pollution Control Board/Committee and the concerned Regional office of the MoEF. In the amended Notification dated 27th August, 2003, sub-paragraph (2), has been substituted as under:
(J) Appln.. No.16 of 2013 15
"(2) The authority for ensuring the use of specified quantity of ash as per sub-paragraph (1) shall be the concerned Regional Officer of the State Pollution Control Board or the Pollution Control Board, as the case may be.
(2A) the concerned State Government shall be the enforcing and monitoring Authority for ensuring compliance of the provisions of sub-paragraph (1A) A new sub-section (3c) is also added as: (3C) All authorities sanctioning or renewing any land, soil or clay mining lease shall not grant such lease or extension of lease or renewal to clay brick, block or tile manufacturing unit within a radius of one hundred kilometers of the coal or lignite based thermal power plant in cases where the manufacturer does not mix a minimum of 25 per cent by weight of fly ash or pond ash in the manufacture of bricks or blocks or tiles. The cancellation of mining lease shall be decided by the district administration after giving the holder of such lease an opportunity of being heard. To enable the competent authority to verify the actual use of ash, the thermal power plant shall maintain month-wise records of ash made available to each brick kiln."
22. Further through amendment dated 3rd November, 2009, paragraph 2(II), has been inserted, which stipulates that "the concerned State Government or Union Territory, shall be enforcing and monitoring Authority for ensuring compliance of the provisions of sub para (8) (i) and (a) (ii). However, it is noted that the para 8, mainly relates to use of fly ash for stowing of mines and backfilling of open-cast mines. The Notification further in paragraph 3 (7) has provision for constitution of State Level Monitoring Committee for monitoring and facilitating implementation of this Notification, which is to be constituted by concerned State government or Union Territory.
(J) Appln.. No.16 of 2013 16
23. From the above amendments, we find it difficult to carve out and identify the Agency responsible for enforcement of fly ash utilization at the thermal power plant level, though the enforcement Authorities have been defined at the demand side of fly ash utilization i.e. brick kilns, mines, fly ash construction products etc. However, the enforcement Agency at the fly ash generation side for the effective fly ash utilization, is not clearly defined and, therefore, we posed this query to the learned Counsel during the hearing. No clear provision was brought to our notice which identify the enforcement agency for implementation of this Notification. In view of this, we are of the considered view that as this Notification has been issued under provisions of the Environment (Protection) Act, 1986, the Authorities responsible for enforcement of Environment (Protection) Act, 1986, are responsible for enforcement of said Notification and therefore, the MoEF, CPCB and MPCB, are responsible Authorities for enforcement of fly ash Notification, as far as the generation of fly ash and its effective utilization is concerned. However, we find hardly any efforts or actions which have been taken either by MoEF or SPCB for effective enforcement of the Notification.
24. We also posed a query regarding the constitution of State level committee and also, dispute settlement committees as per scheme of the Notification. MPCB could not give information regarding the said committee and also, (J) Appln.. No.16 of 2013 17 number of meetings and its minutes, though MPCB is an important member of this committee. The Respondent 2 and 3 also could not give much information regarding the Local level dispute settlement committee formation and its minutes. This shows the apathy of all the regulatory and monitoring agencies towards effective implementation of the Notification.
25. MPCB has filed its affidavit on 8.1.2014 and has submitted that the MPCB has stipulated suitable conditions for fly ash management and handling, in the consent granted to the Respondent No.3 and is also ensuring the compliance thereof. The relevant condition prescribed by the MPCB is produced as under:
Sr. Type of waste Quantity Treatment/Disposal No 1 Fly ash/Bottom 93240 Shall be sent to Cement Ash Manufacturer and disposed 2 Bottom Ash 23310 as per Govt. of India MT/Month Guidelines Notification vide 3 Ash Sludge 400 MT Month no.SO 763(C) dated 14.9.1999.
4 Metal Scrap 20 MT year By sale Further MPCB has taken bank guarantee of Rs. 120 lakhs towards 100% fly ash utilization on or before 31.12.2013.
26. MPCB has further submitted monthly record of fly ash utilized by the Respondent No.3 from April 2012 to March 2013 and also from April, 2013 to October, 2013. The information is basically in four parts i.e. total ash generated, pulverized ash lifted by Dirk Ltd, pulverized ash lifted by the (J) Appln.. No.16 of 2013 18 parties. However, it does not mention about compliance or non-compliance of targets as stipulated in fly ash notification. MPCB has also further submitted that fly ash collection and handling is presently done manually and mechanical system for collection and handling of ash is not provided by the Respondent No.3. MPCB has also recorded necessity to provide mechanical handing system.
27. The data submitted by Mahagenco i.e. R-3 as mentioned above, reveals that record of fly ash generation is not separately available with Mahagenco under the sub- heads (a) Dry ESP Fly Ash and (b) Pond ash, which is relevant as utilization patterns have been defined and stipulated under these two categories vide the said Notification. However, data submitted by MPCB, surprisingly shows fly ash generation of two categories, namely, pulverized fly ash and pond ash. We are not sure about the source and nature of the pulverized fly ash mentioned in MPCB record. It is, therefore, necessary that thermal power stations, shall maintain record of fly ash generation and its utilization as per categories mentioned in the Notification for effective enforcement and compliance of the Notification. Apparently, it is not clearly established that the Respondent No.3, is providing 20% of dry ESP fly ash on cost free basis to the various users, as stipulated by the Notification, regularly, since 2009. Though, as per the Notification of 2009, the present fly ash utilization need to be more than 90%, which (J) Appln.. No.16 of 2013 19 benchmark is not achieved by the Respondent No.2. Hence, the finding of Issue No.1 is recorded in the 'Negative'.
28. The other areas where fly ash is required to be utilized is brick kilns, clay-fly ash brick kilns and also the construction products. There is no document placed on record by any of the enforcement Agencies i.e. MPCB, Collector and MoEF to demonstrate that any due diligence or measures are taken by these agencies for enforcing provisions of fly ash Notification, than mere mentioning fly ash utilization in the license/permits issued by them. The affidavit of District Mining Officer clearly shows that there are significant variations in the permits granted by the Revenue Department to the brick kiln owners. In some cases, fly ash utilization is stipulated while in many cases it is not even mentioned. Also in many cases, permits/licenses have not been issued, though the traditional clay brick kilns are reported to be in operation. It is also noted that there is no record available regarding number of cases recommended by SPCB for cancellation of leases on account of non-use of fly ash and also, any instance whether the Collector or Municipal Corporation has enforced the use of fly ash bricks and products in the construction activities in their area. It goes to indicate lack of seriousness, apathy and negligence on the part of all these enforcement Agencies in enforcing and regulating utilization of fly ash at demand site i.e. use in (J) Appln.. No.16 of 2013 20 brick kilns, construction activities, embankment etc. and therefore we record finding on Issue No.2 in the 'Negative'.
29. We may now switch over to examine merits of factual contentions advanced on behalf of the Respondent Nos.2 and 3, as well as submission pertaining to applicability of decision of Hon'ble Madras High Court. The contention of the Respondent Nos.2 and 3, is that distribution of fly ash is being done, in accordance with the MoEF Notification dated 3rd November 2009. It is argued that market demand and supply of bricks is variable, in accordance with the construction activities. Therefore, it is contended that the prayer Clause (C) indicated in the Application is illogical and hypothetical. Further, it is argued that since dry fly ash is commercially valuable product and can generate revenue, the directions were amended by permitting Thermal Power Plants to sell dry fly ash with rider to provide "at least" free of cost fly ash to the extent of 20%. It is argued, therefore, that it is discretion of the Respondent No.2 and 3 to decide as to how much they intend to give free of cost quantity of fly ash and to what extent revenue is required to be generated through sale of fly ash. According to the Respondent Nos.2 and 3, such sale of cost free fly ash is the policy decision and the word "at least", as used in the Notification in question, is being wrongly interpreted by the Applicant. It is vehemently argued that the Respondent Nos.2 and 3, are the owners of fly ash generated from power plant and, therefore, have (J) Appln.. No.16 of 2013 21 Authority to decide as to how much quantity they shall distribute free of cost, when stock of fly ash is to be sold. The Respondent Nos.2 and 3, even went to the extent of saying that the Central Government, has exceeded its powers while giving directions to provide fly ash free of cost, to the brick manufacturers under the MoEF Notification.
30. Learned Counsel for the Respondent Nos.2 and 3, has placed heavy reliance a Judgment of learned Single Bench of Hon'ble Madras High Court in Writ Petition No.12295 of 2011, and MP No.1 of 2011, "M/s Tamilnadu Generation and Distribution Corporation Ltd & Anr vs Union of India and Ors" It is submitted by the learned Advocate for the Respondent Nos.2 and 3, that the Judgment of Hon'ble Single Bench of Madras High Court, would govern the issue involved in the present Application and said Dicta will be binding on this Tribunal. He further argued that the Application does not come within ambit of Section 14 of the National Green Tribunal Act, 2010, inasmuch as the jurisdiction of NGT, relates only to deal with "substantial question of environment" which expression is only inclusive and not exhaustive, so as to cover the issues like those which are ventilated through the present Application.
31. We have given anxious thought to the arguments advanced on behalf of the Respondent Nos.2 and 3. At the threshold, we may dislodge contention of the Respondent Nos.2 and 3, as regards jurisdictional issue. Section 14 of the (J) Appln.. No.16 of 2013 22 National Green Tribunal Act, 2010, to the extent it is relevant may be reproduced as follows:
"Section 14: Tribunal to settle disputes: -
1. The Tribunal shall have the jurisdiction over all civil cases where a substantial question relating to environment (including enforcement of any legal right relating to environment), is involved and such question arises out of the implementation of the enactments specified in Schedule I.
2. The Tribunal shall hear the disputes arising from the Questions referred to in sub-section (1) and settle such disputes and pass order thereon.
3. xxx xxx xxx xxx xxx
32. A bare perusal of Sub-section (1) of Section 14, reveals that the NGT, shall have jurisdiction over all civil cases, where substantial question relating to environment is involved. The expression "all civil cases", is of pervasive nature and, therefore, cannot be given restrictive meaning.
Additional words "including enforcement of any legal right relating to environment" as used in Sub-section (1) of Section 14, of the National Green Tribunal Act 2010, will not, in any manner give restrictive meaning to Section 14(1), but will be rather explanatory in nature. In "Mahalaxmi Oil Mills & Anr vs Andhra Pradesh & Ors" SCR, SUPLL (1), 1088, the Apex Court interpreted Section 8 of the Andhra Pradesh General Sales Tax Act, 1957. That was a case, in which expression "Tobacco or any form of Tobacco" as used in Section 8 and in 4 th Schedule, entry 7 of the said Act, was considered for the (J) Appln.. No.16 of 2013 23 purpose of interpretation. Andhra Pradesh High Court, held that though exemption provided under Section 8, read with entry 7, of 4th Schedule of Andhra Pradesh General Sales Tax Act, 1957, was applicable to Tobacco, oil and Tobacco cake, being forms of Tobacco, yet "Tobacco seed" was not Tobacco and that only leaf, stalks and stems of Tobacco plants could be said to be "Tobacco", within meaning of its definition. This view was confirmed by the Hon'ble Supreme Court. The entire interpretative angle in the given case, depended upon use of expression "any form of Tobacco", which "Tobacco seed" of course did not qualify for under the Fiscal Statute. In that case, there was no question of applying interpretation by taking into account "inclusive definition" as such. As a matter of fact, Hon'ble Supreme Court, took into account intention of Legislature while using the said expression "Tobacco or any form of Tobacco" in the local Sales Tax Act. At one place, in paragraph 11, Hon'ble Supreme Court, has observed that:
"Before us, it is urged on behalf of the assesses that the word "tobacco", in its ordinary connotation, takes in the tobacco plant and every plant of it, including the seed. The definition also make it clear that it takes in every form of tobacco, manufactured or unmanufactured. Thus tobacco seeds, not only when they are in their raw unmanufactured state but also when, on manufacture, they manifest themselves in the form of tobacco seed oil or tobacco seed cake will (J) Appln.. No.16 of 2013 24 fall within the definition. On the other hand, on behalf of the State it is submitted that the PG NO 1094 definition, which covers both what the expression means as well as what it includes, is exhaustive. Tobacco seed does not come within the first part of the definition, for the expression "tobacco, cured or uncured, manufactured or unmanufactured" has to be read as a whole and will not take in tobacco seed. It will not come under the second part because it specifically mentions leaves, stalks and stems but leaves out seeds. Since tobacco seeds do not fall within the definition, the oil and cake produced by the crushing of the seeds will not also be covered by the definition or eligible for the consequent exemption."
From above observations, it is amply clear that interpretation of such expression depends on intention of Legislature. As stated earlier, in view of the fact that use of the words "shall have jurisdiction over all civil cases, where substantial question relating to environment" will encompass within its fold all types of civil matters in which environmental issues of substantial nature, are involved. Obviously, we deem it proper to reject the contention of Respondent Nos. 2 and 3 that NGT, has no jurisdiction to deal with issues raked up in the present Application.
33. Coming to the case of "M/s Tamil Nadu Power Generation & Distribution Corporation Ltd vs Union of India & Ors" (Supra), we may pinpoint that the issue involved in that case was of different nature . The MoEF by its order dated (J) Appln.. No.16 of 2013 25 March 18th, 2011, held that any collection of service charges by the Power Generation Plant, would amount to collection of cost and, therefore, would constitute violation of the relevant Notification. The Ministry also observed that expenditure and freight handling of coal etc., are all part of the regular expenses in the operation and that they are factored into cost of power supply to the customers. Therefore, the Power Generation and Distribution Corporation Ltd., was prohibited from recovering collection of service taxes, directly from Traders/Associations as per the MoEF Notification dated September 14th,1999. The said order of MoEF, was held bad in law, by the learned Single Judge of the Hon'ble Madras High Court. The issue involved in the present case is not akin to the issue raised before the learned Single Judge of the Hon'ble Madras High Court. Apart from that, nobody has come forwarded to claim any cost from the Applicant under any order of MoEF nor such order is subject matter of challenge before us. The learned Single Judge of Hon'ble Madras High Court, had not quashed relevant MoEF Notification dated November 3rd, 2009. We may make it clear that legality of said Notification, is not subject matter of challenge before us and, therefore, such issue cannot be subject matter of decision in the present Application.
34. Learned Advocate for the Applicant, however, vehemently argued that said Judgment of Hon'ble Madras High Court will be binding on this Tribunal, for the reason (J) Appln.. No.16 of 2013 26 that it is a Judgment rendered in the exercise of Writ Jurisdiction and will have binding effect. He contended that views of Madras High Court, cannot be brushed aside, only because NGT, is not administratively subordinate to the supervisory jurisdiction of that High Court. Reliance is placed on the observations in case of "Commissioner of Income Tax vs Godavaridevi Saraf" 1978 (2) ELT 624 Bom. We have carefully gone through the observations of the Hon'ble High Court in the given case. What is observed in the given case, is that the Tribunal constituted under the same Act, has no jurisdiction to go into the question of constitutionality of the provisions of that statute. In the said case, provision of the Income Tax Act, was held as unconstitutional, as being violative of Article 19(1) (f) of the Constitution and, therefore such decision of Madras High Court, it was held could not be overlooked, by the Income Tax Tribunal, inasmuch as that provision itself did not exist. This authority has no bearing on the issue involved in the present case. In our opinion, the decision of Hon'ble High Court, may have binding effect, if it is rendered in the same case, in its Writ Jurisdiction. Else, there is certain gray area, which needs to be legally expounded at appropriate time. In any case, the Judgment of learned Single judge of Madras High Court, has no bearing on the issue involved in the present case and, therefore, we are not bound to hold that supply of 20% free ash, as per the (J) Appln.. No.16 of 2013 27 MoEF Notification dated November 3rd, 2009, cannot be claimed by the Applicant.
35. In view of foregoing discussion and reasons recorded hereinabove, we deem it proper to hold that the Application deserves to be partly allowed with certain directions. The Application is, therefore, partly allowed with following directions:
a) The Respondent Nos. 2 and 3, shall hereafter maintain record of fly ash generation and utilization category-wise, as mentioned in the MoEF Notification dated November 3rd, 2009 and publish such data on their website on monthly basis, apart from furnishing the same to other Regulatory Authorities, and shall put the same in the public domain, by the end of each month.
b) The Ministry of Environment and Forests (MoEF) and State Pollution Control Board (MPCB), shall conduct joint inspection of Thermal Power Plants, especially of Respondent Nos. 2 and 3 per month to verify fly ash utilization, as per categories stipulated in the above referred Notification and take suitable action in case of non-compliance for six months hereafter and thereafter verification shall be done on quarterly basis in future, till necessary compliance is achieved.
c) The Respondents, including Respondent Nos.2 and 3, shall take measure for disposal/process or utilization of 20% fly ash to be made available to eligible units, free of cost, in accordance with the mandate of MoEF Notification dated November 3rd , 2009, prior to sale or otherwise, disposal of (J) Appln.. No.16 of 2013 28 remaining 80%, of stock. In case of balance stock of dry ESP ash, further disposal also shall be in terms of MoEF Notification referred to above, and not as per discretion of the Respondent Nos.2 and 3.
d) The Respondent Nos.2 and 3 shall publish all the information related to fly ash use, including the annual reports on their website. Respondent 1 and 7 shall also keep such annual reports submitted by the thermal power stations and also actions taken by them for enforcement of the notification on their website.
e) The Respondent Nos.4, 5 and 6 shall immediately take action for compliance of fly ash notification at the demand side i.e. brick kiln, construction activities etc. Necessary conditions shall be incorporated in consent/permits given for these activities which shall be enforced through necessary visits, document verification etc. They shall conduct joint awareness program for utilization of fly ash in next six (6) months for the potential users regarding the fly ash notification, with the help of Respondent Nos.3 and 4 and also, the Applicant.
f) The Respondent Nos.2 and 3 shall pay cost of Rs.10,000/- to the Applicant. All the Respondents to bear their own costs.
The Application is disposed of in above terms.
.............................................JM (Justice V. R. Kingaonkar) ............................................, EM (Dr. Ajay.A. Deshpande) (J) Appln.. No.16 of 2013 29


Thanks to Lego you can build this project. The project consists in creating Algorithms used for the two most important points: strategy to drop or throw balls, to find and pick up balls in a competition with other robots !

Just clone our repository and follow instructions, you will be ready to go!
" The specialist. Define a problem, he will find you the optimal and most effective solution for you. Tried to optimize the code for all the main functions. During its personnal time, he worked to optimize the throwing and searching system."
"The scientist. Give him your project, he will make it far more efficient. An optimistic guy, always confident in achieving the best results. He worked on the main functions after several hours passed on testing the deep code. "
"The architect. Used to lego from his childhood, he created the main architecture the design and the bluetooth communication system of the Robot. Specialized in web development, he also realized this wonderful website always with a cup of coffee!"


YouTube Video Downloader automatically take "High Quality" Video File from YouTube URL. Paste Your YouTube Video URL (https://www.youtube.com/watch?v=zru82DBCIEw&t=237s) in the below box and Click on "Download" button. Within Second it will generate your YouTube Video Download Button.


@* * Copyright 2023 HM Revenue & Customs * * 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. *@ @(params: Map[String, Any]) @uk.gov.hmrc.hmrcemailrenderer.templates.helpers.html.template_main(params, "You submitted an IPT1 Application for Registration online"){
Dear @params("customerName")
We have received your application to register for Insurance Premium Tax.
Your submission reference is: @params("submissionReference")
If your application is successful, we will send a certificate of registration to your correspondence address. We will issue this within 15 working days of you submitting the IPT1.
The certificate will give your IPT registration number and show your date of registration. It will also tell you when your first return is due.
From HMRC Excise team
}


A small but trustworthy design office.
Let us show you some of our distinguished solutions.
Let’s go on an adventure together! Are you interested in a collaboration, partnership or do you just want to come by and say hello?


Refresh All Lists
Static amp-list, inlined state.
Append items
{{title}}
Static amp-list, async state
{{title}}
Paging amp-list
Show more


Police in fresh plea to find 'loitering' man suspected of robbing 83-year-old woman
The woman was attacked while she was walking in Winton Street, Ardrossan around 2.55pm on Sunday, November 10.
by Eric McGowan, https://www.dailyrecord.co.uk/authors/eric-mcgowan/Police in Ayrshire have renewed an appeal for witnesses after an 83-year-old woman was robbed in Ardrossan.
The woman was approached by an unidentified man and robbed while she was walking on the town's Winton Street around 2.55pm on Sunday, November 10.
She was uninjured but badly shaken as a result of the robbery. Her purse was stolen during the incident.
Detective Sergeant Stephen McCulloch said: “Our inquiries into this robbery are ongoing and we are continuing to appeal for help from the public to identify the man responsible.
"We have established that a man was seen loitering in the doorway of VG Stores on Glasgow Street for some time before the robbery.
"A number of people passed him and we would urge anyone who may have been in the area to come forward.
"He is described as being white, in his 30s, around 5ft 10 in in height with black curly hair.
"We would urge anyone who may have been in the area to come forward. You may not have thought anything of what you saw at the time but it could be of use to our inquiry."
Anyone with information can call 101, quoting incident number 2330 of 10t November, or call Crimestoppers anonymously on 0800 555 111.


Pickers Select date 9-8-2019 edit Augustus 2019 arrow_drop_down chevron_left chevron_right Cancel Oke


49 In a functional program, we often use recursion to construct a list, one item at a time. The in front of block makes a list that has one item added to the front of an existing list, without changing the value of the original list. A nonempty list is processed by dividing it into its ﬁrst item (item 1 of) and all the rest of the items (all but rst of), which are handled through a recursive call: Snap ! uses two different internal representations of lists, one (dynamic array) for imperative programming and the other (linked list) for functional programming. Each representation makes the corresponding built-in list blocks (commands or reporters, respectively) most efﬁcient. It’s possible to mix styles in the same program, but if the same list is used both ways, the program will run more slowly because it converts from one representation to the other repeatedly. (The item ( ) of [ ] block doesn’t change the representation.) You don’t have to know the details of the internal representations, but it’s worthwhile to use each list in a consistent way. D. Higher Order List Operations and Rings There’s an even easier way to select the even numbers from a list: The keep block takes a Predicate expression as its ﬁrst input, and a list as its second input. It reports a list containing those elements of the input list for which the predicate returns true. Notice two things about the predicate input: First, it has a grey ring around it. Second, the mod block has an empty input. Keep puts each item of its input list, one at a time, into that empty input before evaluating the predicate. (The empty input is supposed to remind you of the “box” notation for variables in elementary school: ☐+3=7.) The grey ring is part of the keep block as it appears in the palette: What the ring means is that this input is a block (a predicate block, in this case, because the interior of the ring is a hexagon), rather than the value reported by that block. Here’s the difference: Evaluating the = block without a ring reports true or false; evaluating the block with a ring reports the block itself. This allows keep to evaluate the = predicate repeatedly, once for each list item. A block that takes another block as input is called a higher order block (or higher order procedure, or higher order function).


Define here default values to use, like default owner of Books.
If you like to syncronize with a remote CouchDB activate the remote sync here:


Major Functional Component Diagram
Major functional component diagram for the A3 framework prototype
Process flow for the traditional model of knowledge management
Faculty and student process flow models while utilizing the A3 framework
A3 WBS - Overview
A3 Sitemap
A3 WBS - Algorithms
A3 WBS - External Interfaces
A3 WBS - Database
A3 WBS - Testing
A3 database schema
A3 Algorithm - User Upload
A3 Algorithm - Web Scraping
A3 Algorithm - Basic Analysis
A3 Algorithm - Normalization
A3 Algorithm - Diff Command
A3 Algorithm - Authorization/Access Control
A3 Algorithm - Filtering
A3 framework real world product vs. prototype comparison


WELCOME TO INBOX HEALTH
Less stress. More room. Unsubscribe and Delete instantly from junk mail.
Focus on what matters
Unsubscribe your self from junk emails
Totally new clean inbox.
0
Unique sender.
About Us
Let us make your life easier with a little bit of email management - we identify your subscription emails and list them out for you. All you do is login to your Gmail account, view the list of all your subscription emails that we generate for you (do you even remember signing up for that newsletter? That coupon list? Didn’t think so), and then unsubscribe instantly from the ones you don’t need. This is a free app that will give you more space and organization in your inbox.


Chatter
Home
Messages
(current)
Discover
Notifications
Chatter
Chat with user X
Them
Hello, how are you?
3 minutes ago
Me
Hi I'm so fine, and you?
Just now


 I now know that is in fact not true because I’ve challenged the statement and received the appropriate dumb-stricken, annoyed look.  Though we all might be guilty of being callous and making people victim to our poorly formed questions, there are steps we can take to ask smarter questions that hopefully don’t illicit the dreaded “rtfm” or “stfw” response.
Stack Overflow, a question and answer site for programmers, is a great resource for anyone who may have issues with code or who may simply want to learn new or different methods of doing something. There I found examples of good questions and bad questions, which could probably be improved.
In the following example, we examine the components of a decent question. In this case, the asker is trying to figure out a way to get the date of the previous month in Python.
``` Q: python date of the previous month
I am trying to get the date of the previous month with python. Here is what i’ve tried:
str( time.strftime(‘%Y’) ) + str( int(time.strftime(‘%m’))-1 )
However, this way is bad for 2 reasons: First it returns 20122 for the February of 2012 (instead of 201202) and secondly it will return 0 instead of 12 on January.
I have solved this trouble in bash with:
echo $(date -d”3 month ago” “+%G%m%d”)
I think that if bash has a built-in way for this purpose, then python, much more equipped, should provide something better than forcing writing one’s own script to achieve this goal. Of course i could do something like:
if int(time.strftime(‘%m’)) == 1: return ‘12’ else: if int(time.strftime(‘%m’)) < 10: return ‘0’+str(time.strftime(‘%m’)-1) else: return str(time.strftime(‘%m’) -1)
I have not tested this code and i don’t want to use it anyway (unless I can’t find any other way:/)
Thanks for your help! ```
While the heading of his question could be better, it does convey what he’s trying to figure out. Usually something as brief as “python date of previous month” is what other users would enter in as search terms on Google, making it easily found. Another good thing about the question is that it’s not just a question. The asker shows what he or she has done and that he or she has put in some effort to answer the question. And while it may not be as important as the question itself, the asker shows courtesy, which does increase the chance of getting an answer.
``` A: datetime and the datetime.timedelta classes are your friend.
Like this:
import datetime today = datetime.date.today() first = datetime.date(day=1, month=today.month, year=today.year) lastMonth = first - datetime.timedelta(days=1) print lastMonth.strftime(“%Y%m”) 201202
```
The asker received six possible answers, and he or she was successful in inciting discussion from multiple users. The answers themselves were clear and were devoid of the rumored sarcasm and hostility of “hackers.” Since I myself have referenced this page and found it useful, I can confidently say that it is a good question.
While there are decent questions that benefit everyone, there are those one can ask to create an entirely different effect. In the following example, a user asks how he would, in short, create a desktop application with Facebook.
``` Q: Facebook Desktop Notifier
I am a beginner programmer that have never used anything other than what’s included in a language.
I am trying to create a desktop application that notifies me anytime I get an update onfacebook. How should go about doing this? Thanks in advance.
edit Sorry I was not clear. Is there any way to make a DESKTOP application with facebook? ```
A simple “yes” would have answered the question, but we know that’s not the sort of answer he or she is looking for. Fortunately, someone kindly responded with a link to Facebook’s developer website. The asker should have done more research on his or her potential project. Then further down the road, he or she could have asked more specific and detailed questions that wouldn’t require a thousand-paged response for a sufficient answer.
When we rely on others’ generosity and expertise to provide answers to our questions, it should hold that the question we ask should be one that leads to efficient and effective help that not only benefits us, but also the people we ask and others who might ask the same question in the future. Thus, if you have a question… make it a smart one! Asking questions may not always get you the best answer, but asking them in a way that will make others want to answer them will increase the success of finding a good solution and make it a positive experience on all sides.


Do you have a lot of questions you want to add?
With an import you can upload a lot of quiz questions in one go.
Click here to download an example .csv file with the correct structure for the import to work correctly.
Just keep the top-row unchanged and enter your content below in the specified columns.


Earthquake sources: Fault slip and the Okada model¶
To initiate a tsunami from an earthquake, it is necessary to generate a model of how the seafloor moves, which is generally specified in a dtopo file as described in Topography displacement files.
Fault slip¶
For historic earthquakes, it is generally possible to find many different models for the distribution of slip on one or more fault planes, see for example the pointers at Earthquake source models.
An earthquake subfault model is typically given in the form of a set of rectangular patches on the fault plane. Each patch has a set of parameters defining the relative slip of rock on one side of the planar patch to slip on the other side. The minimum set of parameters required is:
- length and width of the fault plane (typically in m or km),
- latitude and longitude of some point on the fault plane, typically either the centroid or the center of the top (shallowest edge),
- depth of the specified point below the sea floor,
- strike, the orientation of the top edge, measured in degrees clockwise from North. Between 0 and 360. The fault plane dips downward to the right when moving along the top edge in the strike direction.
- dip, angle at which the plane dips downward from the top edge, a positive angle between 0 and 90 degrees.
- rake, the angle in the fault plane in which the slip occurs, measured in degrees counterclockwise from the strike direction. Between -180 and 180.
- slip > 0, the distance (typically in cm or m) the hanging block moves relative to the foot block, in the direction specified by the rake. The “hanging block” is the one above the dipping fault plane (or to the right if you move in the strike direction).
Note that for a strike-slip earthquake, rake is near 0 or 180. For a subduction earthquake, the rake is usually closer to 90 degrees.
Okada model¶
The slip on the fault plane(s) must be translated into seafloor deformation. This is often done using the “Okada model”, which is derived from a Green’s function sollution to the elastic half space problem. Uniform displacement of the solid over a finite rectangular patch specified using the parameters described above, when inserted in a homogeneous elastic half space a distance depth below the free surface, leads to a steady state solution in which the free surface is deformed. This deformation is used as the seafloor deformation. Of course this is only an approximation since the actual seafloor in rarely flat, and the actual earth is not a homogeneous isotropic elastic material as assumed in this model. However, it is often assumed to be a reasonable approximation for tsunami modeling, particularly since the fault slip parameters are generally not known very well even for historical earthquakes and so a more accurate modeling of the resulting seafloor deformation may not be justified.
In addition to the parameters above, the Okada model also requires an elastic parameter, the Poisson ratio, which is usually taken to be 0.25.
Warning
The next two paragraphs are out of date and the geotools collection of tools is being updated and should be improved when 5.2 is released. Some tools are now found in the directory $CLAW/geoclaw/src/python/geoclaw/.
The GeoClaw routine $CLAW/geoclaw/src/python/geoclaw/okada2.py available starting in Version 4.6.3, is an improved version of the original okada.py that allows specifying whether the latitude and longitude provided corresponds to the centroid, bottom center, or the top center of the fault plane (the original assumed top center). The specification of other parameters has also been modified, see the documentation in that file.
The Python module $CLAW/geoclaw/src/python/geoclaw/dtopotools.py provides tools to convert a file specifying a collection of subfaults into a dtopofile by applying the Okada model to each subfault and adding the results together (valid by linear superposition of the solutions to the linear elastic halfspace problems).


This chapter describes commands that are specific to PPTP type links. These commands apply to the currently active link, and are only valid if the currently active link has type pptp.
The PPTP protocol can be most easily understood as just another link layer type, where the link layer medium just happens to be an IP connection. So, for example, instead of configuring a telephone number to dial as you would with a modem, you configure an IP address to connect to. Everything else that's above the link layer functions exactly the same. Hence PPTP allows you to ``tunnel'' PPP frames over IP.
Note that PPTP connections are initiated by a TCP connection from
one machine to another, and that servers usually listen to TCP
port 1723 (and this is the default for port
in the commands below). PPTP also uses the GRE protocol, which
has IP protocol number 47. Your firewall may need to be adjusted
to allows this type of IP packet.
Complete PPTP network topology looks like:
client <- some link type -> PAC <- PPTP tunnel -> PNS
PAC is physical level repeater, which receives PPP connection of some type and forwards it to PNS using PPTP protocol. PNS is a PPP endpoint, which receives PPP frames via PPTP tunnel and processes them.
In simple case, when physical conversion is not required, topology can be simplified to:
client (PAC emulator) <- PPTP tunnel -> PNS
Mpd is able to operate in both PAC and PNS modes. As PAC mpd supports both simple case PAC emulator and complete PAC topologies. Complete PAC can be configured by joining two physical devices using mpd's repeater functionality.
set pptp self ipaddr [ port ]
Sets the local IP address and port for the PPTP connection.
set pptp peer ipaddr [ port ]
Sets the peer IP address and port for the PPTP connection. This command applies to both incoming and outgoing connections. For outgoing connections, this command is required in order to specify where to connect to. For incoming connections, this command is optional; if not given, mpd accepts incoming connections from any host. Otherwise, only connections from the stated IP address (and, optionally, port) are allowed.
set pptp callingnum number
set pptp callednum number
Sets the calling and called telephone number to use when initiating a PPTP connection. For most VPN applications this is ignored, but in certain cases an actual phone number is required. The default is the empty string.
set pptp enable option ...
set pptp disable option ...
Enable and disable PPTP device type options for the link.
The following options are supported:
outcall
In PPTP, each individual PPP connection between two IP hosts (there may be several, and these are not to be confused with the single TCP connection between any two IP hosts), is initiated as either an incoming or an outgoing call. This allows to make an outgoing phone call (by PNS) via a remote access server (PAC), as well as in more common case forward an incoming phone call from an access server (PAC) to a remote PPTP server (PNS).
When this option is enabled, mpd will initiate outgoing calls (PNS); otherwise mpd will initiate incoming calls (PAC). Although it seems that incoming would be more correct, the default is outgoing, as this is consistent with the behavior of the Microsoft PPTP dial-up adapter client.
Mpd will accept either type of call on an incoming PPTP connection.
delayed-ack
Enable delayed ACK's. This can improve throughput on reliable links.
The default is enable.
always-ack
Always include ACK even if already sent. This can improve throughput on unreliable links.
The default is disable.
windowing
Enables the windowing mechanism specified by the protocol. Disabling this will cause Mpd to violate the protocol, possibly confusing some PPTP peers, but usually results in better performance. The windowing mechanism is a design error in the PPTP protocol; L2TP, the successor to PPTP, removes it.
The default is disable.
resolve-once
Enables resolving peer address only once, on startup, or on manual typing in CLI.
The default is enable.
Note that if you are connecting to an NT server, your authentication name must include the NT domain name. For example:
set auth authname "DOMAIN\\username"
For updating Windows 95 and 98 clients so they work properly, see VPN Update for Windows 98 and Dial-Up Networking 1.3 Available


source | inspired in Leah's post
Email address
Password
Repeat password
I have an account I'm new!
By clicking 'Sign up!' above, you confirm that you accept the terms of service.
Forgot your password?
Click 'Recover password' and you will receive an email with instructions. « back to login


I am a 3rd-year Computer Engineering student at the University of Waterloo. I attend Hackathons, do freelance work, and make my own side projects on the side.
I am also the president of Culture and Language Exchange Club at the University of Waterloo. If you are in town, and would like to have a friend that speaks your language, feel free to reach out :) All our club services are free!


The StackOverlow Search Library
May 3, 2017
May 3, 2017
For many college students, finals week is the most stressful time of the year. Like a large number of my peers, I decided to ease this stress by working on something completely unrelated to finals. (Having written that sentence out, I now see how ridiculous using procrastination as a stress-reliever is).
Throughout the year, a select few friends in my CS classes had resorted to asking me and a few other people for help, constantly. I don't mind helping other people out - in fact, it's something that makes me happy. What I do mind, however, is when people ask for help without having tried anything on their own. As a result of this, I decided, tongue-in-cheek, to write small utility to help them out. I decided to write a Java library that, when implemented properly, would automatically search StackOverflow for any exceptions thrown at runtime.
In the first iteration of my project, I decided to simply write a function that could be called in the catch
portion of a try/catch
block. This was simple enough - the function took the general Java exception as its only parameter, then used the browse
capability of the Java Desktop API to open up a new browser tab and search for the exception and its message. As an afterthought, I had the program open up a tab to search Google as well, because (shocking as it may seem), StackOverflow doesn't know everything.
The hard part of this project was figuring out how to compile my Java code into a usable JAR file. At first, I used the jar
command from the Linux terminal. While it worked, it was pretty tedious. Eventually, I discovered and settled on Apache Maven, a "build automation tool" that provides an easy way to test and package Java projects. After porting my project to use Maven (a trivial matter in IntelliJ, my IDE), building each JAR file was as easy as the click of a button.
I'm lazy, so for projects that don't matter I don't test extensively before deployment. (If any potential employers are reading this, I promise that I test incredibly thoroughly when it counts). After giving the library to a friend to play with, we discovered that the messages for some exceptions can contain characters that make StackOverflow throw a fit. Because of this, I was forced to encode the search query I used with the Java URL encoder. I was pretty much good to go after this.
Even though it was "working," I still wasn't quite happy with the project. Not every every Java program utilizes try/catch
blocks, so there were some cases where this library couldn't be used. To fix this, I decided to implement the UncaughtExceptionHandler
interface, which now allows my function to be set as the default exception handler for any Java program - try/catch
not needed!
Right now, the project doesn't support Linux operating systems (kind of ironic, because I have switched to using Linux full-time) because whoever wrote the Java Desktop API didn't give two hoots about Linux integration. The library will be updated when I can find the motivation to look for and implement a Linux workaround. Until then, Linux users will have to do without (sorry to all 3 of you).
You can checkout the finished product here.


Preprocessing¶
irisreader.preprocessing.image_cropper¶
-
class
irisreader.preprocessing.
image_cropper
(offset=0, check_coverage=True)[source]¶ Implements a transformer that cuts out only the non-null regions of an IRIS image (be it SJI or spectra). Null pixels of the image are encoded as -200.
The bounds are found by moving in lines from all sides towards the center until the number of nonzero pixels stops increasing. To make sure everything worked well, the cropped image is checked for negative pixels at the end, throwing an error if more than 5% of the image border pixels or the whole image are negative. In this way, bounds for the image are determined with the fit method while the transform method returns a the cropped image.
- Parameters
offset (integer) – Number of pixels that are removed as a safety border from all sides after the cropping.
check_coverage (boolean) – Whether to check the coverage of the cropped image. It can happen that there are patches of negative values in images, either due to loss of data during transmission (typically a band or a large rectangular patch of negative data) or due to overall low data counts (missing data is no data). image_cropper labels an image as corrupt if >5% of its pixels are still negative after cropping. This might be problematic for lines with low data counts (and therefore many missing pixels) and the user is advised to disable the coverage check for such lines. A method that is able to distinguish missing data arising from transmission errors from missing data due to low data counts could be helpful here.
-
fit
(X, y=None)[source]¶ Determines bounds for the supplied image with the sliding lines approach mentioned in the class description.
- Parameters
X (numpy.ndarray) – 2D image data that is to be cropped, format [y,x]
- Returns
Returns this object with fitted variables.
- Return type
irisreader.preprocessing.image_cube_cropper¶
-
class
irisreader.preprocessing.
image_cube_cropper
(offset=0, check_coverage=True)[source]¶ Implements a transformer that can crop all images of an observed line (be it SJI or spectra) by applying image_cropper to every individual image and identifying corrupt images and outliers.
Corrupt images can either be identified directly when
image_cropper
throws an error because more than 5% of the pixels of the border or the overall image are negative or, however, they can appear as outliers in the bound data returned byimage_cropper
: sometimes whole stripes of data are corrupt, resulting in a rectangular image with for example half the width and the height of the valid image. We thus look for outliers in the data returned byimage_cropper
and degrade them to corrupt images. Outliers are defined here as values that deviate more than 1.5% from the median bound (15 pixels on 1000 pixels).- Parameters
offset (integer) – Number of pixels that are removed as a safety border from all sides after the cropping.
check_coverage (boolean) – Whether to check the coverage of the cropped image. It can happen that there are patches of negative values in images, either due to loss of data during transmission (typically a band or a large rectangular patch of negative data) or due to overall low data counts (missing data is no data). image_cropper labels an image as corrupt if >5% of its pixels are still negative after cropping. This might be problematic for lines with low data counts (and therefore many missing pixels) and the user is advised to disable the coverage check for such lines. A method that is able to distinguish missing data arising from transmission errors from missing data due to low data counts could be helpful here.
-
fit
(X, y=None)[source]¶ Determines the overall cropping bounds and the corrupt images for the supplied data cube.
- Parameters
X (irisreader.iris_data_cube (irisreader.sji_cube / irisreader.raster_cube)) – Data cube object that has to be cropped.
- Returns
This object with fitted variables.
- Return type
-
get_bounds
()[source]¶ Gets the overall bounds recovered by image_cube_cropper.
- Returns
List [ xmin, xmax, ymin, ymax ] for the given data cube.
- Return type
int
irisreader.preprocessing.spectrum_interpolator¶
-
class
irisreader.preprocessing.
spectrum_interpolator
(lambda_min, lambda_max, steps)[source]¶ Interpolates supplied spectra to a certain range and size using cubic splines.
- Parameters
lambda_min (float) – Minimum wavelength.
lambda_max (float) – Maximum wavelength.
steps (integer) – Number of interpolation steps.
-
fit
(X, y)[source]¶ Creates a cubic spline function fitting the supplied spectrum data.
- Parameters
X (numpy.ndarray) – Array of spectra to interpolate (rows are different spectra and columns are wavelength bins)
y (float) – List of wavelength units.
- Returns
This object with fitted variables.
- Return type


Before Change
if instance_specific is None or instance_specific == "0":
instance_specific = {}
else:
instance_specific = [specific.split("=") for specific in instance_specific.split(",")]
instance_specific = {specific[0]: specific[1] for specific in instance_specific}
subsample = instance_specific.get("subsample")
subsample = int(subsample) if subsample is not None else None
arguments = dict(logger=logging.getLogger("pynisher"),
wall_time_in_s=cutoff,
mem_in_mb=self.memory_limit)
After Change
queue = multiprocessing.Queue()
if not (instance_specific is None or instance_specific == "0"):
raise ValueError(instance_specific)
arguments = dict(logger=logging.getLogger("pynisher"),
wall_time_in_s=cutoff,
mem_in_mb=self.memory_limit)


© 2017 David Nadoba. All rights reserved.
traveling-salesman-problem, is a MacOS App written by David Nadoba in Swift to find the shortest path Implementation of different pathfinding algorithms by using a bidirectional and weighted graph data structure `WeightedGraph`.
You can find a generic implementation of such a graph struct in `WeightedGraph.swift` and its related protocols. This was my first macOS App and it uses only cocoa bindings in the `RouteSummaryViewController`.
He wrote this App for the Code Competition "Der Handlungsreisende from IT-Talents.de.
You can download MacOS App (Release v1.0) from github, and view its home page at traveling-salesman-proiblem.
Here are some sceenshots and a video to give you a quick overview:Wegpunkte löschbar
Resolve Issues
© 2018 Carlos D. Santiago, All rights reserved.
This is my forked project of David's work to support documents storage and retreival as well as muttiple windows, enhanced About information, and on-line help.
Track status of my work at its wiki or issues page.
/los "I was a teenage net-random"


// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
//------------------------------------------------------------------------------
// MOSTLY TAKEN FROM OPEN ZEPPELIN.
//------------------------------------------------------------------------------
// Has been modified so that only the deployer can initialise the contract.
// This prevents malicious addresses from "stealing" the contract by
// initialising it with incorrect parameters.
//------------------------------------------------------------------------------
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or
* any kind of contract that will be deployed behind a proxy. Since a
* proxied contract can't have a constructor, it's common to move
* constructor logic to an external initializer function, usually
* called `initialize`. It then becomes necessary to protect this
* initializer function so it can only be called once. The
* {initializer} modifier provided by this contract will have this
* effect.
*
* TIP: To avoid leaving the proxy in an uninitialized state, the
* initializer function should be called as early as possible by
* providing the encoded function call as the `_data` argument to
* {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke
* a parent initializer twice, or to ensure that all initializers are
* idempotent. This is not verified automatically as constructors are
* by Solidity.
*/
abstract contract Initializable {
// Indicates that the contract has been initialized.
bool private initialized_;
// Indicates that the contract is in the process of being initialized.
bool private initializing_;
// Deployer address so that only deployer can initialise preventing
// malicious contract initialising.
address private deployer_;
// NOTE may need to remove this? Needs more thinking
constructor() {
deployer_ = msg.sender;
}
/**
* @dev Modifier to protect an initializer function from being invoked
* twice. Has been modified so only deployer can initialise.
*/
modifier initializer() {
require(
initializing_ || !initialized_,
"Init: Contract is initialized"
);
Erequire(msg.sender == deployer_, "Init: Only deployer can init");
bool isTopLevelCall = !initializing_;
Eif (isTopLevelCall) {
initializing_ = true;
initialized_ = true;
}
_;
Eif (isTopLevelCall) {
initializing_ = false;
}
}
}
|


For demo,
we chose Raspberry Pi
due to
AVAILABILITY
UART
Universal Asynchronous Receiver-Transmitter = Not using clock
SPI
Serial Peripheral Interface Bus = Using clock (Synchronous)
Adaptor
Driver
Robot
package main
import (
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/drivers/gpio"
"gobot.io/x/gobot/platforms/firmata"
)
func main() {
firmataAdaptor := firmata.NewAdaptor("/dev/ttyACM0")
led := gpio.NewLedDriver(firmataAdaptor, "13")
work := func() {
gobot.Every(1*time.Second, func() {
led.Toggle()
})
}
robot := gobot.NewRobot("bot",
[]gobot.Connection{firmataAdaptor},
[]gobot.Device{led},
work,
)
robot.Start()
}
Special thanks to Dhruva Sagar! https://github.com/dhruvasagar/rpicctv
Command
Master
HTTP API
Demo & explanation!


Introduction to Machine Learning with Python - Chapter 1
Essential Tools for Python Machine Learning
NumPy Arrays
%matplotlib inline
import numpy as np
x = np.array([[1,2,3],[4,5,6]])
print("x:\n{}".format(x))
# .format() method will display the array within the {}
x:
[[1 2 3]
[4 5 6]]
SciPy Sparse Matrix
from scipy import sparse
# Create a 2D NumPy array with a diagonal of ones,
# and zeros everywhere else
eye = np.eye(4)
print("\nNumPy array:\n{}".format(eye))
NumPy array:
[[ 1. 0. 0. 0.]
[ 0. 1. 0. 0.]
[ 0. 0. 1. 0.]
[ 0. 0. 0. 1.]]
Sparse Matrix in CSR Format:
# Convert the NumPy array to a SciPy sparse matrix in CSR format
# Only the nonzero entries are stored
sparse_matrix = sparse.csr_matrix(eye)
print("\nSciPy sparse CSR matrix:\n{}".format(sparse_matrix))
# string[with{a},{b},{c}].format('a','b','c')
SciPy sparse CSR matrix:
(0, 0) 1.0
(1, 1) 1.0
(2, 2) 1.0
(3, 3) 1.0
Sparse Matrix in COO Format:
# Create the same sparse matrix using the COO format
data = np.ones(4)
row_indices = np.arange(4)
col_indices = np.arange(4)
eye_coo = sparse.coo_matrix((data, (row_indices, col_indices)))
print("\nCOO representation:\n{}".format(eye_coo))
COO representation:
(0, 0) 1.0
(1, 1) 1.0
(2, 2) 1.0
(3, 3) 1.0
Matplotlib
Used to create scientific plotting in Python
import matplotlib.pyplot as plt
# Generate a sequence of numbers from -10 to 10 with 100 steps
# in between
x = np.linspace(-10, 10, 100)
# Create a second array using sine
y = np.sin(x)
# The plot function makes a line chart of one array against another
plt.plot(x, y, marker="x")
[<matplotlib.lines.Line2D at 0x7f6934911e48>]
Pandas
Useful tool for data wragling and manipulation similar to R DataFrame and SQL. Also powerful in terms of importing data from a wide range of files.
import pandas as pd
# create a simple dataset of people
data = {'Name': ["John", "Anna", "Peter", "Linda"],
'Location' : ["New York", "Paris", "Berlin", "London"],
'Age' : [24, 13, 53, 33]
}
data_pandas = pd.DataFrame(data)
# IPython.display allows "pretty printing" of dataframes
# in the Jupyter notebook
print(data_pandas)
Age Location Name
0 24 New York John
1 13 Paris Anna
2 53 Berlin Peter
3 33 London Linda
mglearn
Data package prepared specific for the text book Introductino to Machine Learning with Python by Andreas C. Müller & Sarah Guido
import mglearn
Checking the versions of packages installed
import sys
print("Python version: {}".format(sys.version))
import pandas as pd
print("pandas version: {}".format(pd.__version__))
import matplotlib
print("matplotlib version: {}".format(matplotlib.__version__))
import numpy as np
print("NumPy version: {}".format(np.__version__))
import scipy as sp
print("SciPy version: {}".format(sp.__version__))
import IPython
print("IPython version: {}".format(IPython.__version__))
import sklearn
print("scikit-learn version: {}".format(sklearn.__version__))
Python version: 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
pandas version: 0.19.2
matplotlib version: 1.5.3
NumPy version: 1.11.3
SciPy version: 0.18.1
IPython version: 5.1.0
scikit-learn version: 0.18.1
Taste of Machine Learning with Iris
Step 1:
Load iris data from scikit-learn package and explore the data.
from sklearn.datasets import load_iris
iris_dataset = load_iris()
print("\nKeys of iris_dataset:\n{}".format(iris_dataset.keys()))
Keys of iris_dataset:
dict_keys(['data', 'target', 'target_names', 'DESCR', 'feature_names'])
The returned iris dataset comes as a bunch object, which is similar to a dictionary. The keys in this dictionary is listed above; we can check out the feature names and target names.
print("\niris_dataset description:\n{}"
.format(iris_dataset['feature_names']))
iris_dataset description:
['sepal length (cm)', 'sepal width (cm)', 'petal length (cm)', 'petal width (cm)']
print("\nTarget names:\n{}"
.format(iris_dataset['target_names']))
Target names:
['setosa' 'versicolor' 'virginica']
Apparently the main three “target categories” are ‘setosa’, ‘versicolor’, and ‘virginica’, and the variables included in the dataset are ‘sepal length’, ‘sepal width’, ‘petal length’, and ‘petal width’. We then need to check out the real data included in the dictionary.
print("Type of data: {}".format(type(iris_dataset['data'])))
# Check out the type of the value to the 'data' key
print("Shape of data: {}".format(iris_dataset['data'].shape))
# Check out the .shape method of the numpy array
print("First five columns of data:\n{}"
.format(iris_dataset['data'][:5]))
# Check out the first few rows
Type of data: <class 'numpy.ndarray'>
Shape of data: (150, 4)
First five columns of data:
[[ 5.1 3.5 1.4 0.2]
[ 4.9 3. 1.4 0.2]
[ 4.7 3.2 1.3 0.2]
[ 4.6 3.1 1.5 0.2]
[ 5. 3.6 1.4 0.2]]
Therefore, in the data (as NumPy array), we will see the numbers corresponding to the four features. What is the first five target values of these five flowers?
print("Type of target: {}".format(type(iris_dataset['target'])))
# Check out the data type of the value with 'target' key
print("Shape of target: {}".format(iris_dataset['target'].shape))
# Check out the dimension of the value
print("Target:\n{}".format(iris_dataset['target'][:5]))
# Check out the contents of the array
Type of target: <class 'numpy.ndarray'>
Shape of target: (150,)
Target:
[0 0 0 0 0]
Out of the 150 flowers included in the dataset, the first five of them are all 0, i.e. setosa.
Step 2:
Split the dataset to create training data (or training set) and test data (or test set).
In standardized machine learning task, use capital X to represent data and use lowercase y to represent labels.
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(
iris_dataset['data'], iris_dataset['target'], random_state=0)
# train_test_split(features, targets, random_state) returns
# X_train, X_test, y_train, y_test
print("X_train shape: {}".format(X_train.shape))
print("y_train shape: {}".format(y_train.shape))
print("X_test shape: {}".format(X_test.shape))
print("y_test shape: {}".format(y_test.shape))
X_train shape: (112, 4)
y_train shape: (112,)
X_test shape: (38, 4)
y_test shape: (38,)
Step 3:
Explore the data with basic visualizations
Pair Plot creates scatterplots for each one of the possible pairs specified in the analysis.
# To visualize the data, we need to transfer the numpy arrays into
# pandas dataframe
iris_dataframe = pd.DataFrame(X_train,
columns = iris_dataset.feature_names)
# Create a scatter matrix from the data frame, color by y_train
grr = pd.scatter_matrix(iris_dataframe, c=y_train, figsize=(15,15),
marker='o', hist_kwds={'bins':20}, s=60,
alpha=.8, cmap=mglearn.cm3)
A quick glance from the data confirms that the dot categories are well seperated for most of the feature pairs, indicating that a machine learning model is doable.
Step 4:
We will build a k-Nearest Neighbors model on the dataset.
All machine learning models in scikit-learn are implemented in their own classes, which are called Estimator classes. The k-nearest neighbors classification algorithm is implemented in the KNeighborsClassifier class in the neighbors module. Before we can use the model, we need to instantiate the class into an object. This is when we will set any parameters of the model. The most important parameter of KNeighborsClassifier is the number of neighbors, which we will set to 1.
# Instantiate a knn class while defining its major parameter: number
# of neighbors
from sklearn.neighbors import KNeighborsClassifier
knn = KNeighborsClassifier(n_neighbors=1)
# Call .fit() method on the knn object to run the algorithm on the
# training data
knn.fit(X_train, y_train)
KNeighborsClassifier(algorithm='auto', leaf_size=30, metric='minkowski',
metric_params=None, n_jobs=1, n_neighbors=1, p=2,
weights='uniform')
The resulted knn model will be automatically modified by the algorithm to best reflect on the training set.
Step 5:
Use the knn model to predict the category of a unlabeled flower.
# Suppose we have a new unlabeled flower as X_new
X_new = np.array([[5, 2.9, 1,0.2]])
# Be sure to always create two-dimensional array for scikit-learn
print("X_new.shape: {}".format(X_new.shape))
X_new.shape: (1, 4)
Call the .predict() method of the knn object with X_new as argument to calculate the estimated Target value.
prediction = knn.predict(X_new)
print("Prediction: {}".format(prediction))
print("Predicted target name: {}".format(
iris_dataset['target_names'][prediction]))
Prediction: [0]
Predicted target name: ['setosa']
However, since we don’t have the actual “correct” answer about this X_new flower, we won’t be able to evaluate the model. Using the X_test and y_test, however, will help us evaluate the model.
# Calculate the predicted values for the X_test
y_pred = knn.predict(X_test)
print("Test set predictions:\n {}".format(y_pred))
Test set predictions:
[2 1 0 2 0 2 0 1 1 1 2 1 1 1 1 0 1 1 0 0 2 1 0 0 2 0 0 1 1 0 2 1 0 2 2 1 0
2]
# Calculate the accuracy of the model
print("Test set score: {:.2f}".format(np.mean(y_pred==y_test)))
# Alternatively, use the .score() method for the knn object
print("Test set score: {:.2f}".format(knn.score(X_test, y_test)))
Test set score: 0.97
Test set score: 0.97
The knn model gives a high accuracy of 0.97 on future cases. For an easier access in future, below is the snippet for knn models:
X_train, X_test, y_train, y_test = train_test_split(
iris_dataset['data'], iris_dataset['target'], random_state=0)
knn = KNeighborsClassifier(n_neighbors=1)
knn.fit(X_train, y_train)
print("Test set score: {:.2f}".format(knn.score(X_test, y_test)))
Test set score: 0.97
Leave a Comment


Stories of Learning
What makes a good story?
What should this story include?
- Something you made
- Why you made it? Who you made it for?
- How you made it
- What it means to you
Good stories often have a beginning, middle, & end
The importance of connecting to something real
- Example: Quentin
- Example: Tara
The importance of having a hook & and end
What other good qualities did this have?
an actual story
compelling images
A good demo of your project
A CLEAR explanation at a "high level" of how it works
Constraints
Few words on slides
At least 3 slides & no notes so it's natural and fun
a beginning, middle, and end.
Good storytelling tools
A hook
A twist


Hands on Postgres Sharding
Notice: Much of this post still applies, but now applies more directly to Citus. Since this post originally published, pg_shard is now deprecated. Citus now has an open source version which offer a superset of the features of pg_shard, as well as a cloud offering. Finally you can find some further guidance for sharding on the Citus blog and docs
Back in 2012 I wrote an overview of database sharding. Since then I’ve had a few questions about it, which have really increased in frequency over the last two months. As a result I thought I’d do a deeper dive with some actual hands on for sharding. Though for this hands on, because I do value my time I’m going to take advantage of pg_shard
rather than creating mechanisms from scratch.
For those unfamiliar pg_shard is an open source extension from Citus data who has a commerical product that you can think of is pg_shard++ (and probably much more). Pg_shard adds a little extra to let data automatically distribute to other Postgres tables (logical shards) and Postgres databases/instances (physical shards) thus letting you outgrow a single Postgres node pretty simply.
Alright, enough talk about it, let’s get things up and running.
Build, install
The rest assume you have Postgres.app, version 9.5 setup and are on a Mac, much of these steps could be easily adapted for other Postgres installs or OSes.
PATH=/Applications/Postgres.app/Contents/Versions/latest/bin/:$PATH make
sudo PATH=/Applications/Postgres.app/Contents/Versions/latest/bin/:$PATH make install
cp /Applications/Postgres.app/Contents/Versions/9.5/share/postgresql/postgresql.conf.sample /Applications/Postgres.app/Contents/Versions/9.5/share/postgresql/postgresql.conf.sample
Edit your postgresql.conf
:
#shared_preload_libraries = ''
TO:
shared_preload_libraries = 'pg_shard'
Then create a file in /Users/craig/Library/Application\ Support/Postgres/var-9.5/pg_worker_list.conf
where craig
is your username:
# hostname port-number
localhost 5432
localhost 5433
You’ll also need to create a new Postgres instance:
initdb -D /Users/craig/Library/Application\ Support/Postgres/var-9.5-2
Then edit that postgresql.conf
inside that newly created folder with two main edits:
port = 5432
To
port = 5433
Finally setup our database then start it up:
createdb instagram
postgres -D /Users/craig/Library/Application\ Support/Postgres/var-9.5-2
Setup
Now you should have two running instances of Postgres, now let’s finally turn on the pg_shard extension, create some tables and see what we have. First connect to your main running Postgres instance, so in this case the the instagram database we first created psql instagram
, then let’s set things up:
CREATE EXTENSION pg_shard;
CREATE TABLE customer_reviews (customer_id TEXT NOT NULL, review_date DATE, review_rating INTEGER, product_id CHAR(10));
CREATE TABLE
Time: 4.734 ms
SELECT master_create_distributed_table(table_name := 'customer_reviews', partition_column := 'customer_id');
master_create_distributed_table
---------------------------------
(1 row)
SELECT master_create_worker_shards(table_name := 'customer_reviews', shard_count := 16, replication_factor := 2);
master_create_worker_shards
-----------------------------
(1 row)
Understanding and using
So that was a lot of initial setup. But now we have an application that could in theory scale to a shared application across 16 instances. If you want a refresher, there’s a difference between physical and logical shards. In this case above we have 16 logical ones and it’s replicated across 2 physical Postgres instances albeit on the same instance.
Alright so a little more poking under the covers to see what happened before we actually start doing something with our data. If you’re still connected go ahead and run \d
, and you should see:
List of relations
Schema | Name | Type | Owner
--------+------------------------+-------+-------
public | customer_reviews | table | craig
public | customer_reviews_10000 | table | craig
public | customer_reviews_10001 | table | craig
public | customer_reviews_10002 | table | craig
public | customer_reviews_10003 | table | craig
public | customer_reviews_10004 | table | craig
public | customer_reviews_10005 | table | craig
public | customer_reviews_10006 | table | craig
public | customer_reviews_10007 | table | craig
public | customer_reviews_10008 | table | craig
public | customer_reviews_10009 | table | craig
public | customer_reviews_10010 | table | craig
public | customer_reviews_10011 | table | craig
public | customer_reviews_10012 | table | craig
public | customer_reviews_10013 | table | craig
public | customer_reviews_10014 | table | craig
public | customer_reviews_10015 | table | craig
(17 rows)
You can see that under the cover there’s a lot more customer_reviews
tables, in reality you don’t have to think about these or do anything with them. But just for reference they’re just plain ole Postgres tables under the cover. You can query them and poke at the data. The now mystical customer_reviews
will actually roll up the data across all your logical shards (tables) and physical shards (spanning across machines).
It’s also of note that in production you might not actually use your primary DB as a worker, we did this more for expediency in setting it up on a local Mac. More typically you’d have 2 or more workers which are not the same a the primary, these were the ports we setup in our pg_worker_list.conf
. A common setup would look something more like:
So now start inserting away:
INSERT INTO customer_reviews (customer_id, review_rating) VALUES ('HN802', 5);
INSERT INTO customer_reviews (customer_id, review_rating) VALUES ('FA2K1', 10);
For extra homework on your own you can now go and poke at where the underlying data actually surfaced.
Conclusion
Yes, there’s a number of limitations that you can learn a bit more about over on the github repo for pg_shard. Though even with those it’s very usable as is, and let’s you get quite far in prepping an app for sharding. While I will say that all apps think they’ll need sharding and few actually do, given pg_shard
it’s minimal extra effort now to plan for such scaling should you need it.
Up next we’ll look at how it’d work with a few languages, so you can get an idea of the end to end experience.


{% extends 'base.html' %} {% load static %} {% block css %} {% endblock css %} {% block content %}
As fast as thou shalt wane, so fast thou growest In one of thine, from that which thou departest; And that fresh blood which youngly thou bestowest Thou mayst call thine when thou from youth convertest. Herein lives wisdom, beauty and increase:
Without this, folly, age and cold decay: If all were minded so, the times should cease And threescore year would make the world away. Let those whom Nature hath not made for store, Harsh featureless and rude, barrenly perish:
Look, whom she best endow'd she gave the more; Which bounteous gift thou shouldst in bounty cherish: She carved thee for her seal, and meant thereby Thou shouldst print more, not let that copy die.


{% extends "layout.html" %} {% block body %} {% if chance %}
Your chance of admittance is {{ chance }}
{% if image_loc %}The Blue features (the features pointing to the left) reduce your chance of admittance and the red ones increase your chance of admittance. The longer the arrow, the larger the effect on your chance.
Note: These values are not entirely accurate. A random factor was involved in the building of the model. The results also depend on the data used to train the data. The model currently used was trained using 500 records. More data could improve the results. To contribute data, contact the creator.
{% endif %} {% else %} Nothing to see here. {% endif %} {% endblock %}