text:
Q: $wpdb->insert - inserting multiple rows How do I use $wpdb->insert to insert multiple rows. Here is my code.
for($i=0; $i<=$urlCount; $i++) {
   $stat = $wpdb->insert(
        'WP_URLS',
        array(
            'POSTID' => $post->ID,
            'URL' =>   $_POST['url'.$i]
        )
    );
}

This code works only for the first insert (ie, when $i = 0 , when value is url_0 ). Sometimes the URL count will be more than 100 and sometimes it will be zero. So instead of writing the code for 100 times, I just want to have a simple loop that works for any number of records. Thats the reason I went for loop.
Thank you for the help.
The table structure is
CREATE TABLE WP_URLS (
   POSTID BIGINT NOT NULL,
   URL VARCHAR(254)
);

A: I guess the problem is a pretty simple one. You didn't show the whole code, but I guess the problem is that you're saving the insertion for some unknown reason as string into a var named $stat. Everytime you fill the var with a new query you're overwriting your var. You should use $stat .= $wpdb->insert( ...etc... ) instead. to append to your string. Don't forget to set the var to an empty string before the loop, so you can append: $stat = ''.

Another - imo better way - would be to use an array. Reason: You can easier debug the code. And pls read the comment i/t code.
$stats = array();
for( $i = 0; $i <= $urlCount; $i++ )
{
    $stats[] = array(
        'POSTID' => $post->ID,
        // are you really retrieving **ALL** your urls as "url1", "url2", etc.
        // via some $_POST-ed form?
        'URL' =>   filter_var(
            $_POST["url{$i}"],
            FILTER_VALIDATE_URL,
            FILTER_FLAG_SCHEME_REQUIRED
        )
    );
}

foreach ( $stats as $stat )
    $wpdb->insert( 'WP_URLS', $stat );

A: Even though there is an accepted answer, it works with seperate queries for each insert.
This could be a better solution for inserting data in just one query:
<?php

    /**
     * A method for inserting multiple rows into the specified table
     *
     *  Usage Example:
     *
     *  $insert_arrays = array();
     *  foreach($assets as $asset) {
     *
     *  $insert_arrays[] = array(
     *  'type' => "multiple_row_insert",
     *  'status' => 1,
     *  'name'=>$asset,
     *  'added_date' => current_time( 'mysql' ),
     *  'last_update' => current_time( 'mysql' ));
     *
     *  }
     *
     *  wp_insert_rows($insert_arrays);
     *
     *
     * @param array $row_arrays
     * @param string $wp_table_name
     * @return false|int
     *
     * @author  Ugur Mirza ZEYREK
     * @source http://stackoverflow.com/a/12374838/1194797
     */

    function wp_insert_rows($row_arrays = array(), $wp_table_name) {
        global $wpdb;
        $wp_table_name = esc_sql($wp_table_name);
        // Setup arrays for Actual Values, and Placeholders
        $place_holders = [];
        $row = implode(', ', array_keys($row_arrays));
        $values = array_values($row_arrays);

        foreach (array_values($row_arrays) as $key => $param) {

            if(is_numeric($param)) {
                if($key == 0){
                    array_push($place_holders, " '%d'");
                } else {
                    array_push($place_holders, ", '%d'");
                }

            } else {
                if($key == 0){
                    array_push($place_holders, " '%s'");
                } else {
                    array_push($place_holders, ", '%s'");
                }
            }
        }

        $params = implode('', $place_holders);

        $query = "INSERT INTO {$wp_table_name} (" . $row . ") VALUES (" . $params . ")";

        if($wpdb->query($wpdb->prepare($query, $values))){
            return true;
        } else {
            return false;
        }
    }

Source: https://github.com/mirzazeyrek/wp-multiple-insert

redpajama_set_name: RedPajamaStackExchange


text:
Q: C# Random returning the same value I'm creating only one instance of random but even so the random number is the same.
       int x, y;
        Random random = new Random();
        // Loop through the images pixels to reset color.
        for (x = 0; x < image1.Width; x++)
        {
            for (y = 0; y < image1.Height; y++)
            {
                int randomNumber = random.Next(1, 2);
                if (randomNumber != 1) continue;
                Color pixelColor = image1.GetPixel(x, y);
                Color newColor = Color.FromArgb(255, 255, 255);
                image1.SetPixel(x, y, newColor);
            }
        }

A: You're getting the same number (1) every time, because you're calling Random.Next() with minValue = 1 and maxValue = 2:
Random.Next Method (Int32, Int32)

minValue
The inclusive lower bound of the random number returned.
maxValue
The exclusive upper bound of the random number returned. maxValue must
  be greater than or equal to minValue.

Calling Random.Next(1, 2) will always return 1.
It's not 100% clear what you're trying to achieve, but if you'd like to change only 50% of your colors, you should probably do following:
for (x = 0; x < image1.Width; x++)
{
    for (y = 0; y < image1.Height; y++)
    {
        if (random.Next() % 2 != 1) continue;
        Color pixelColor = image1.GetPixel(x, y);
        Color newColor = Color.FromArgb(255, 255, 255);
        image1.SetPixel(x, y, newColor);
    }
}


Shell has become an 'innovation partner' of Scuderia Ferrari for the next five years as part of a new agreement that will see the pair work closer together than ever before across a number of different projects.The arrangement is said to mark a 'significant new chapter' in a partnership that dates back to the 1930s.
Under the agreement Shell will continue to provide Scuderia Ferrari with a bespoke performance fuels and lubricants package: Shell V-Power race fuel and Shell Helix Ultra motor oil. Beyond that, Shell has also committed to continue to dedicate at least 21,000 man hours and 50 full time technical staff to the partnership every year.
As part of this, Shell will have a permanent technical staff presence at Ferrari's Maranello headquarters going forward, a measure of the increased collaboration to come between the two companies.
Shell's partnership with Ferrari will also stretch beyond Formula 1, with Shell set to provide fuel and lubricants to Ferrari GT teams entering the FIA World Endurance Championship and the Le Mans 24 Hours.


looks so expensive and also lovely at the same time.
design in glamor design was so sensational and also exciting.
99 Dry Cleaning A Wedding Dress 2018 Unique White By Vera Wang Wedding Dresses & Gowns Uploaded by siska on Monday, February 11th, 2019 in category wedding dresses for girls 2019.
See also 70 Dry Cleaning A Wedding Dress 2018 Best Of 124 Best Wedding 2018 Images On Pinterest In 2018 from wedding dresses for girls 2019 Topic.
Here we have another image 55 Dry Cleaning A Wedding Dress 2018 New Maui S Quality Dry Cleaning & Laundry 13 Reviews Dry Cleaning featured under 99 Dry Cleaning A Wedding Dress 2018 Unique White By Vera Wang Wedding Dresses & Gowns. We hope you enjoyed it and if you want to download the pictures in high quality, simply right click the image and choose "Save As". Thanks for reading 99 Dry Cleaning A Wedding Dress 2018 Unique White By Vera Wang Wedding Dresses & Gowns.


The first class was a "Weld a Critter" class over at the Stonybrook Fine Arts in Jamaica Plan MA, and it was excellent.
After a little instruction I laid down my first test bead and was psyched. Dachary put down a decent one, but mine went down extra well for a beginner I thought. Then we set to picking out our pieces and deciding what to make. I went with a Racing Snail.
And Dachary a Mondrian-esque dog.
And I quickly learned how fiddly MIG welding can be. Curves and tight edges require real skill, and my Snail is held together with some of the worst welds I've ever seen. I think a blind man with a soldering gun would have done a better job. Dachary's welds on the other hand, were brilliant for a beginner. I'm totally proud of her.
So, tonight we learned to weld. Not well, but, in a pinch, we can pick up a MIG welder and make things stick.
Tonight was a great experience. We had a blast, and for a few hours we forgot about all our other responsibilities, and just enjoyed learning a new skill together.


Exhibition Opening: Resilient Neighbourhoods – the 107 blog.
The UNSW Built Environment Master of Architecture Social Agency stream uses Sydney as a "living lab" with the objective of creating architects who assist communities by addressing inequality. In 2017, the Master of Architecture students were based at 107 to conceptualise ideas around Resilient Neighbourhoods.
In the gallery from March 2-11 2018, Resilient Neighbourhoods documented the multitude of different ways the students approached this problem.


text:
Sympistis wilsoni is a moth of the family Noctuidae first described by William Barnes and Foster Hendrickson Benjamin in 1924. It is found in the Canadian provinces of Alberta and British Columbia.

The wingspan is about 24 mm.

External links

wilsoni
Moths of North America
Moths described in 1924

redpajama_set_name: RedPajamaWikipedia


Butterfly Valve Castings require high pressure resistance, process demand is very strict; usually need to set pouring system in horizontal mould joints, in order to achieve sequential solidification and ensure effective complement from top to bottom.
Sand casting with low cost is suitable to manufacture the cast iron products, we also have machining equipments to reach the required dimension.
1.What kinds of physical and chemical testing you can provide?
2.What's the minimum wall thickness of the castings you produce?
The minimum wall thickness of the castings we produce is 8mm.
3.Can you list the smelting equipment of your company?
We have 3 models of medium-frequency induction furnaces: 0.5 tons, 2 tons and 3 tons.
We look forward to having the opportunity of providing services for you. Warmly welcome all friends and partners to visit and guide and negotiate the business.


text:
Thomas Coningsby1,2
M, #407491, d. 1695
Thomas Coningsby was the son of Robert Coningsby and Maria Hammond.2 He died in 1695.2
Hereford's Almshouses
Almshouses have been in existence for over a thousand years. The earliest were founded by the Church or by monasteries, and were dependent on donations of land or money as a result of appeals made by these bodies. Later almshouses sprang directly from the charitable inclinations of the wealthy who provided for them in their wills. They were generally intended to house the parish's needy - the poor, the sick and the elderly.
Coningsby Hospital
One of the best known of Hereford's almshouses is the Coningsby Hospital in Widemarsh Street. The site was formerly occupied by a house of the Knights of St. John of Jerusalem, and parts of the hall and chapel date from this period, the 13th century. The almshouse was founded by Sir Thomas Coningsby of Hampton Court, Herefordshire, in 1614. Here he built twelve cottages with stone from parts of the existing structure as well as from the adjacent Blackfriars Abbey. This religious house had fallen into disrepair following the dissolution of the monasteries in 1536 by Henry VIII and had subsequently passed by inheritance to Coningsby's wife, Philippa.
The Hospital was intended as a refuge for eleven 'worn out' soldiers or mariners. The twelfth cottage was occupied by a man placed in charge of the pensioners and given the rank of Corporal. There was also a chaplain to administer to the pensioners spiritual needs who, Coningsby stipulated, had to be from Oxford University. They received free food, fuel, clothing and a small weekly allowance which was paid on Monday mornings after prayers. A uniform was provided which they were required to wear. It consisted of a ginger 'fiston' suit, a hat with a white and red border, a military style jerkin, a 'Monaco' or Spanish-style cap and a sword 'for when he goeth abroad.' The ensemble was completed by 'a seemely gowne of redd cloth reaching downe to the ankle, lined likewise with redd baise.' The twelve men were known as the Coningsby Servitors.
The Coningsby Hospital is still in use, although no longer a charity. Pensioners are entitled to wear the uniform and are chosen by interview. They must still be of good character and be retired servicemen or women or their surviving spouses. The Chapel is still in use as a place of worship and the old dining hall serves as a medieval museum.2 Reference: 292.2
Children of Thomas Coningsby and Phillipa Baskerville
Phillipa Coningsby+2
Ursula Coningsby2
Mary Coningsby2 b. 1649
Elizabeth Coningsby+2 b. 1657
[S4139] Unknown author, Jacksons Papers (n.p.: n.pub., unknown publish date).
[S4132] Robin J Conisbee Wood, online <e-mail address>, Robin J Conisbee Wood (unknown location), downloaded 23 November 2009.
unknown daughter Coningsby1,2
unknown daughter Coningsby is the daughter of Thomas Coningsby and Katharine Waldiffe.2
[S4318] Unknown author, Clutterbucks pedigrees (n.p.: n.pub., unknown publish date). Hereinafter cited as Clutterbucks pedigrees.
Child of unknown daughter Coningsby and Thomas Solley
Thomas Solley2
Ann Patricia Keane1
F, #407494, b. 1 December 1910
Ann Patricia Keane was born on 1 December 1910.2 She is the daughter of Captain George Michael Keane and Violet Ida McKenna.1 She married G/Capt. Christopher Leslie Thompson, son of C. K. Thompson, on 24 July 1934.2
From 24 July 1934, her married name became Thompson.
Children of Ann Patricia Keane and G/Capt. Christopher Leslie Thompson
Christopher Mark Thompson3 b. 1935
Jonathan Michael Adrian Thompson3 b. 1938
Andrew Theodore Thompson3 b. 1941
[S2405] Gerry McKenna, "re: McKenna Family," e-mail message to Darryl Roger Lundy, 28 August 2007. Hereinafter cited as "re: McKenna Family."
George Raleigh1,2
M, #407495, b. circa 1500, d. before 1 April 1546
George Raleigh was born circa 1500 at Thornborough, Farnborough, Warwickshire, EnglandG.1,2 He married Jane Coningsby, daughter of Sir Humphrey Coningsby and Alice Ferebie, in 1529.2 He died before 1 April 1546.2
Reference: 299.2
Children of George Raleigh and Jane Coningsby
Edward Raleigh2
Humphrey Raleigh2
Sibilla Raleigh2
Joan Raleigh2
George Raleigh2
Simon Raleigh+2
Frances Raleigh2 b. c 1521
Thomas Raleigh+2 b. b 1563
[S4153] George Coningsby, a pedigree Coningsby of Hampton Court (n.p.: n.pub., unknown publish date). Hereinafter cited as a pedigree Coningsby of Hampton Court.
Philippa Wintringham1
Philippa Wintringham married Terence Morell McKenna, son of Theodore McKenna and Ethel Margaret Morell Mackenzie, circa 1924.1
From circa 1924, her married name became McKenna.1
Louise Joyce Philipson1
Louise Joyce Philipson married Terence Morell McKenna, son of Theodore McKenna and Ethel Margaret Morell Mackenzie, circa June 1926 at St. George Hanover Square, London, EnglandG.1
From circa June 1926, her married name became McKenna.1
John Coningsby1
M, #407498, b. circa 1637, d. 2 January 1696/97
John Coningsby was born circa 1637 at Aldenham, Hertfordshire, EnglandG.2,1 He was the son of Robert Coningsby and Susanna Hicks.1 He died on 2 January 1696/97 at Aldenham, Hertfordshire, EnglandG.1 He was buried at Aldenham, Hertfordshire, EnglandG.1
Reference: 303.1 Spelt Conisbye in the Parish Records at Aldenham
East Window of Aldenham Church - In Memory of John Coningsby son of Robert C son of Ralph C. Mary his wife d Sept 1719 aged 72.1
Children of John Coningsby and Mary Aram
Thomas Coningsby1 b. b 15 Jun 1679, d. b 1697
Genevieva Coningsby1 b. b 10 Dec 1680
Mary Coningsby+1 b. b 18 Dec 1684, d. 10 Oct 1739
[S4187] Unknown author, Memoirs of Chesters of Chicheley (n.p.: n.pub., unknown publish date).
Mary Aram1
F, #407499, b. circa 1647, d. 8 September 1719
Mary Aram was born circa 1647.1 She died on 8 September 1719 at Aldenham, Hertfordshire, EnglandG.1
Children of Mary Aram and John Coningsby
Thomas Coningsby1
M, #407500, b. before 15 June 1679, d. before 1697
Thomas Coningsby was born before 15 June 1679.2,1 He was baptised on 15 June 1679 at St. Sepulchre, London, EnglandG.1 He was the son of John Coningsby and Mary Aram.1 He died before 1697, without issue.1

redpajama_set_name: RedPajamaCommonCrawl


Going out on a Saturday night is highly overrated when you have these LOGO Lounge French terry crop pants waiting in the wings. The pull-on style is a must when relaxing, while the French terry fabrication ensures a cozy feel while watching your favorite movie. Side pockets mean you can carry your phone around the house with you--putting them a step above sweats. From LOGO Lounge by Lori Goldstein.
LOGO Lounge by Lori Goldstein French Terry Crop Pants w/ Zipper Detail is rated 3.9 out of 5 by 21.
Rated 5 out of 5 by penny4977 from Best lounge pants Purchased in the rosemary, a lovely sage green that goes with all other Logo colors. So comfortable, you think you're wearing your favorite jammies!
Rated 3 out of 5 by Lisa M M from Runs big These run big and if you are petite, they are too long for crop pants. But, the fabric is wonderfully soft and comfy. I'm going to try and wash and hope they shrink a bit.
Rated 5 out of 5 by Southernbelle60 from French Terry cropped pants Just received these today in the mail and immediately tried them on, always do, in case I have to return any items. These were fantastic, loved the color (I got the sage green) and the fit, altho a little bigger, will work with the style of pant and the fact that these are a bit like a high end sweat pant, with cute zippers on the ankles These are so cute, do not know how they launder, because I am washing them now, but I would imagine all should be fine. I always wash all my QVC items in cold wash, gentle cycle, and I hang everything up, after a very limited time in the dryer first. I waited and got these on another lunchtime special ...the price was awesome!! I have become friends with this lunchtime special, I pick up all kinds of D&C and Issac items as well as Susan Graver and save lots of $$$$. Just need to know how to shop! Success again! You will love this item!!
Rated 2 out of 5 by Suejd from Totally off fit Ordered my usual QVC size medium. They were huge! Definitely could've worn a small, which I haven't worn since middle school. Also, I am petite at 5'1" and they were to the floor. Two stars for nice fabric though.
Rated 5 out of 5 by smokin48jj from So comfortable These pants are so comfortable. Wish I had ordered more. If you want a comfy pant that isn't binding anywhere this is the pant for you. I don't like things tight. Please make more in different colors for next year.
Rated 5 out of 5 by atk from Great pants Love these pants. I bought one color to try and then went back and bought the others. I am 5 ft tall and these fit perfectly. It is so hard to find pants the right length. These are so comfortable but also can look dressy. They are a little expensive but most all logo things are.
Rated 5 out of 5 by TUTU from More colors please I love the lite wt material. I can wear this on the hottest of days and be comfortable. I find that I have to size down in the Logo bottoms but the tops are true to size. Please bring these crop pants back in more colors.
Rated 2 out of 5 by missb314 from Back she goes... Item was very thin material and overpriced. I did like the fit but I'm unsure how long these will last and won't take the risk of finding. Sadly, I'll be returning.


The Global Sole BWC with military level AES Encryption Technology. Built in WIFI to make 4G live video transmission. Built in GPS. Qualcomm DSP built in 4G, with Bluetooth and compass function. Full HD video resolution 1080P 30fps, 16MP image resolution, IP67 rain proof and dustproof, wide angle lens 160°, default memory 32GB. with IR function. 1 year warranty. It have a big video recording key at front of the camera for easy touch when in emergency and One-Key Operation to quick start video recording when it was shut down. 3.5" High Light LCD, about 9 hours continuous video recording. Built in 3200mAh lithium battery. Wide range of patented accessories: Crocodile clips, External camera, Magnet mount, Car mount, Charging station.


Best Choice Of 24 Inch White Bathroom Vanity On Elkarclub Home Depot Vanities | Eileendcrowley 24 inch white bathroom vanity with marble top. 24 inch white bathroom vanities and sinks. 24 inch white bathroom vanity with drawers.


text:
Білорусь
 Дятлово — місто в  Гродненській області, адміністративний центр  Дятловського району

 У  Вітебській області:
  Дятлово — село в Оршанському районі
 Дятлово — село в  Бешенковицькому районі


The 7th Annual Taste of Doral™!
Get your forks ready! Taste of Doral™ Month is almost here!
Doral Restaurant Week™ is a restaurant promotion that showcases the vast cultural cuisine that is available around Doral, Florida during the month of July. As a city that is bursting at the seams with more than 200 restaurants, Doral Restaurant Week™ features special 'prix fixe' dining options at Doral's finest restaurants.
As a restaurant, make sure to take advantage of this AMAZING opportunity!
Not only does Doral Restaurant Week™ boost business for your restaurant during the usually slow summer month of July, but it also encourages consumers to explore restaurants they have yet to discover! The fee of restaurant participation in South Florida's premiere restaurant promotion is merely $497 for a full month of effective marketing during July.
Become a Taste of Doral Sponsor!


text:
Govt move to recover 430 acres of industry land in Bengaluru flouts HC orders
As early as June 12, 2009, the Karnataka High Court ruled that the 711 acres is not forest land in the case (WP14649/2007) of the divisional railway manager and others versus the state of Karnataka
Chethan Kumar
August 27, 2015, 14:30 IST
BENGALURU: At a time when the government is under criticism for not being industry-friendly, it has come to light that the revenue department's May 2, 2015 action of handing over 711 acres of land in Kadugodi, Whitefield, to the forest department is against court orders. Of 711 acres, 430 acres belonged to industries and over 200 acres to the Railways.
As early as June 12, 2009, the Karnataka High Court ruled that the 711 acres is not forest land in the case (WP14649/2007) of the divisional railway manager and others versus the state of Karnataka. Later, the government and range forest officer, KR Puram range, challenged this order before a division bench. The division bench too on June 7, 2010, upheld the earlier single bench order.
Also, a review petition (No. RP 272/2010) filed by the government and forest department seeking a review of the HC orders was rejected on September 23, 2011 and their Special Leave Petition was also rejected by the Supreme Court on August 9, 2012.
The 30 industries operating in Kadugodi now complain of harassment by the government and say this move will affect future investments, especially when the government is trying to woo investors with the Global Investors' Meet in November.
"This is a negative move. As it is, a number of industries are trying to shift to other states, and such illogical and illegal action will only add to apprehensions of the industry," said Tallam Dwarkanath, president of the Federation of Karnataka Chambers of Commerce and Industry (FKCCI).
However, Bengaluru Urban DC V Shankar said there were several problems with the land and that it originally was forest land, which is why it was returned to the forest department. On May 2, Assistant Conservator of Forest Nagaraj said records had been changed without following due process. He explained: "The government notification in 1896 clearly shows the area as forest land. The revenue department upheld the same."
But the Kadugodi Industries Association refutes this. "No industry purchased the land fr0m outside agencies or private parties. The land was legally allotted by KIADB as industrial plots as per the industrial policy," association members said.
"Now, after over 60 years of giving away possession of these lands to the revenue and defence departments, and after 45 years of due acquisition for industries and subsequent establishment of industries, the forest department has staked claim over it, which is unfair and calls for government intervention," association president Narayan said.
Bangalore Chamber of Industry and Commerce president Anuj Sharma said: "Land acquisition continues to be a most sensitive issue that needs to be handled such that it addresses the concerns of all stakeholders. Our study on "Ease of Doing Business" indicates that industry views this aspect as one of the critical milestones in deciding where to locate their operations."
V Shankar
Narayan
Karnataka High Court
Kadugodi Industries Association
Motilal Oswal Real Estate to raise Rs 800 crore through fifth property fund


Our GIS, 3D and technical services team is well versed in the leading edge technologies and software applications used to inform and support planning assignments. The team possesses a diverse range of expertise in AutoCAD, GIS, 3D and graphic design software and plays an integral role in supporting a wide range of planning initiatives. Our 3D model making can help in evaluating development alternatives and communicating finalized plans in a visually effective and clear manner.


text:
AFSCME deal still $90 million short of savings goals
CHRIS WETTERICH
SPRINGFIELD -- The agreement between Illinois state government and the American Federation of State, County and Municipal Employees guaranteeing the union no layoffs through June 30, 2012, sets a goal of saving $100 million, but specifies just $10 million in immediate cuts.
While $100 million is the goal, AFSCME and the state have to find only $50 million in savings for the state's pledge of no layoffs and no closure of state facilities to take effect. The agreement sets an Oct. 31 deadline for specifying that $50 million.
The immediate $10 million in savings will be met by "reduction in the use of overtime, expansion of the voluntary furlough program and by in-sourcing work that can be provided more economically if performed by state employees," according to the agreement, which specifies three other areas of potential savings:
-- "Savings in the State Employee Group Insurance Program in addition to the $70 million identified" in a previous agreement signed by AFSCME and the state.
-- "Cost savings in agency operations, purchasing and related matters agreed to by the parties."
-- "Modifications to the terms and conditions of employment."
Too few details?
AFSCME executive director Henry Bayer said such modifications could include a deferral of scheduled pay raises for this fiscal year, which began July 1, if not enough savings can be found in other areas.
"That, of course, they (the state) couldn't do unilaterally," Bayer said. "Our (local) presidents would have to agree to it, and our members would have to agree to it."
During the last fiscal year, the union deferred half of a 2 percent raise it was supposed to get on July 1, 2009, for 11 months, and it deferred half of a 2 percent raise it was supposed to get on Jan. 1, 2010, until June 1, 2010. Union members are to receive 6 percent raises during calendar year 2011.
State Sen. Larry Bomke, R-Springfield, said more detail should have been agreed to before the state signed the agreement.
"I would have preferred they identified the $100 million — where it was going to come from — before the governor consummates an agreement," Bomke said. "To tie the next governor's hands without any concrete savings, it is certainly questionable whether it's a good idea or not.
"We'll have to see if they do identify the additional $40 million."
Ties Brady's hands
The agreement is the second to be signed by the Quinn administration with AFSCME. The no-layoff pledge has prompted criticism of Democratic Gov. Pat Quinn by his Republican opponent in the November governor's race, state Sen. Bill Brady of Bloomington.
Brady said the deal constrains his ability to make budget cuts if he wins. Brady also said it looks like the agreement was reached in exchange for AFSCME's endorsement of Quinn last month. Quinn denies the agreement had anything to do with the endorsement.
An earlier agreement called for $70 million in savings to come from signing a contract with a preferred provider organization for dental services, from a program to push state workers to use more generic prescription drugs and from renegotiation of the state's contract with its pharmacy benefit management firm.
Rep. Raymond Poe, R-Springfield, while acknowledging that the state should be trying to save money, also wants to know where that savings are going to come from.
"When they're talking about saving some of that money, that's all real good … we should be doing that," Poe said. "This thing doesn't give me very many details."
Rep. Rich Brauer, R-Petersburg, said getting the state and the union to work together was a positive step, but he agreed the lack of detail is a big concern.
"We're a little bit lacking on information," Brauer said. "Do they save 100 million by taking health benefits from retirees?"
'Reasonably confident'
Bayer said the details are "what we need to figure out." AFSCME members have submitted "pages and pages" of ideas, such as employees teleconferencing instead of traveling for meetings.
"You're not going to get millions (from travel), but each little piece helps," Bayer said. "We're going to have to be able to identify places where we think they can save money by the end of this month. We're reasonably confident we can hit our goal."
Kelly Kraft, a spokeswoman for the governor's budget office, pointed to nearly $200 million in savings the state is realizing, including $65 million from layoffs and employee attrition at four closed state facilities, $40 million in pay deferrals, $5.2 million in voluntary furlough days and the $70 million the state believes it will save in employee health-care costs.
"No governor before Governor Quinn has cut the budget over $3 billion and achieved this kind of cost savings from AFSCME," Kraft said.
Chris Wetterich can be reached at 788-1523.
To read the agreement, go to http://tinyurl.com/afscmequinn1
Contact Us Support Local Business Advertise Your Business Advertising Terms and Conditions Buy and Sell Help Center My Account Give Feedback Licensing & Reprints
Subscribe Today Newsletters Facebook eNewspaper Archives
© 2023 www.mtshastanews.com. All rights reserved.


text:
/*

This class does what may, at first, appear to be somewhat
reminiscent of a "Rube Goldberg" contraption: When we
set the check and upgrade commands, we end up forking and
spinning off entirely new processes which we communicate
with via a socket/pipe. Why on earth would I do this?

The answer is security. While wpantund doesn't drop
privileges yet, it will have that capability one day.
This setup allows the upgrade and check scripts to run
in a privileged fashion while the rest of wpantund runs
with lower privileges. The idea is that wpantund would be
run initially in a privileged context and then, after
setting up this object, drop privileges.

There are other places where we will likely want to have
this sort of behavior (meaning that this doesn't yield any
immediate increase in security), but this is a good start
in that direction.

-- RQ 2015-10-23

*/

#if HAVE_CONFIG_H
#include <config.h>
#endif

#include "assert-macros.h"
#include <stdio.h>
#include <stdlib.h>
#include "FirmwareUpgrade.h"
#include "socket-utils.h"
#include <errno.h>
#include <syslog.h>
#include "fgetln.h"
#include <unistd.h>
#include <string.h>
#include <fcntl.h>

#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif

using namespace nl::wpantund;

FirmwareUpgrade::FirmwareUpgrade(): mUpgradeStatus(0), mFirmwareCheckFD(-1), mFirmwareUpgradeFD(-1)
{
}

FirmwareUpgrade::~FirmwareUpgrade()
{
	close_check_fd();
	close_upgrade_fd();
}

void
FirmwareUpgrade::close_check_fd(void)
{
	if (mFirmwareCheckFD >= 0) {
		IGNORE_RETURN_VALUE(write(mFirmwareCheckFD, "X\n", 1));
		close(mFirmwareCheckFD);
		mFirmwareCheckFD = -1;
	}
}

void
FirmwareUpgrade::close_upgrade_fd(void)
{
	if (mFirmwareUpgradeFD >= 0) {
		IGNORE_RETURN_VALUE(write(mFirmwareUpgradeFD, "X", 1));
		close(mFirmwareUpgradeFD);
		mFirmwareUpgradeFD = -1;
	}
}

bool
FirmwareUpgrade::is_firmware_upgrade_required(const std::string& version)
{
	bool ret = false;
	uint8_t c = 1;

	require(!version.empty(), bail);

	require_quiet(mFirmwareCheckFD >= 0, bail);

	require_string(write(mFirmwareCheckFD, version.c_str(), version.size()) >= 0, bail, strerror(errno));

	require_string(write(mFirmwareCheckFD, "\n", 1) == 1, bail, strerror(errno));

	require_string(read(mFirmwareCheckFD, &c, 1) == 1, bail, strerror(errno));

	ret = (c == 0);

bail:

	// If this check determined that a firmware upgrade was not required,
	// go ahead and close out our check process so that we don't
	// waste resources.
	if (ret == false) {
		close_check_fd();
		close_upgrade_fd();
	}

	return ret;
}

void
FirmwareUpgrade::upgrade_firmware(void)
{
	require(mUpgradeStatus != EINPROGRESS, bail);

	mUpgradeStatus = EINVAL;

	require(mFirmwareUpgradeFD >= 0, bail);

	require_string(write(mFirmwareUpgradeFD, "1", 1) == 1, bail, strerror(errno));

	mUpgradeStatus = EINPROGRESS;

bail:
	return;
}

void
FirmwareUpgrade::set_firmware_upgrade_command(const std::string& command)
{
	int status = -1;
	pid_t pid = -1;

	if (mFirmwareUpgradeFD >= 0) {
		close(mFirmwareUpgradeFD);
		mFirmwareUpgradeFD = -1;
	}

	pid = fork_unixdomain_socket(&mFirmwareUpgradeFD);

	if (pid < 0) {
		return;
	}

	if (pid == 0) {
		int stdout_fd_copy = dup(STDOUT_FILENO);
		int stdin_fd_copy = dup(STDIN_FILENO);
		FILE* stdin_copy = NULL;
		FILE* stdout_copy = NULL;

		dup2(STDERR_FILENO,STDOUT_FILENO);
		close(STDIN_FILENO);

		if (stdin_fd_copy >= 0) {
			stdin_copy = fdopen(stdin_fd_copy, "r");
		}

		if (stdout_fd_copy >= 0) {
			stdout_copy = fdopen(stdout_fd_copy, "w");
		}

		// Double fork to avoid leaking zombie processes.
		pid = fork();
		if (pid < 0) {
			syslog(LOG_ERR, "Call to fork() failed: %s (%d)", strerror(errno), errno);

			_exit(errno);
		}

		if (0 == pid)
		{
			// Set the shell environment variable if it isn't set already.
			setenv("SHELL",SOCKET_UTILS_DEFAULT_SHELL,0);

			while ((ferror(stdin_copy) == 0) && (feof(stdin_copy) == 0)) {
				int c;
				int ret;

				c = fgetc(stdin_copy);

				switch (c) {
				case '1':
					// Go ahead and leave the parent's process group
					setsid();

					// Execute the requested command.
					ret = system(command.c_str());

					// Inform our parent process of the return value for the command.
					fputc(WEXITSTATUS(ret), stdout_copy);
					fflush(stdout_copy);
					break;

				case 'X':
					fputc(0, stdout_copy);
					fflush(stdout_copy);
					_exit(EXIT_SUCCESS);
					break;

				default:
					fputc(1, stdout_copy);
					fflush(stdout_copy);
					_exit(EXIT_FAILURE);
					break;
				}
			}

			_exit(EXIT_FAILURE);
		}

		_exit(EXIT_SUCCESS);
	}

	// Wait for the first fork to return, and place the return value in errno
	if (waitpid(pid, &status, 0) < 0) {
		syslog(LOG_ERR, "Call to waitpid() failed: %s (%d)", strerror(errno), errno);
	}

	if (0 != WEXITSTATUS(status)) {
		// If this has happened then the double fork failed. Clean up
		// and pass this status along to the caller as errno.

		syslog(LOG_ERR, "Child process failed: %s (%d)", strerror(WEXITSTATUS(status)), WEXITSTATUS(status));

		close(mFirmwareUpgradeFD);
		mFirmwareUpgradeFD = -1;

		errno = WEXITSTATUS(status);

	} else {
		int saved_flags = fcntl(mFirmwareUpgradeFD, F_GETFL, 0);
		fcntl(mFirmwareUpgradeFD, F_SETFL, saved_flags | O_NONBLOCK);
	}
}

void
FirmwareUpgrade::set_firmware_check_command(const std::string& command)
{
	int status = -1;
	pid_t pid = -1;

	if (mFirmwareCheckFD >= 0) {
		close(mFirmwareCheckFD);
		mFirmwareCheckFD = -1;
	}

	pid = fork_unixdomain_socket(&mFirmwareCheckFD);

	if (pid < 0) {
		return;
	}

	if (pid == 0) {
		int stdout_fd_copy = dup(STDOUT_FILENO);
		int stdin_fd_copy = dup(STDIN_FILENO);
		FILE* stdin_copy = NULL;
		FILE* stdout_copy = NULL;

		dup2(STDERR_FILENO,STDOUT_FILENO);

		if (stdin_fd_copy >= 0) {
			close(STDIN_FILENO);
			stdin_copy = fdopen(stdin_fd_copy, "r");
		}

		if (stdout_fd_copy >= 0) {
			stdout_copy = fdopen(stdout_fd_copy, "w");
		}

		// Double fork to avoid leaking zombie processes.
		pid = fork();
		if (pid < 0) {
			syslog(LOG_ERR, "Call to fork() failed: %s (%d)", strerror(errno), errno);

			_exit(errno);
		}

		if (0 == pid)
		{
			// Set the shell environment variable if it isn't set already.
			setenv("SHELL",SOCKET_UTILS_DEFAULT_SHELL,0);

			while ((ferror(stdin_copy) == 0) && (feof(stdin_copy) == 0)) {
				int ret;
				const char* line = NULL;
				size_t line_len = 0;
				std::string escaped_line;

				line = fgetln(stdin_copy, &line_len);

				if (!line || (line_len == 0)) {
					continue;
				}

				if ((line[0] == 'X') && (line[1] == 0)) {
					fputc(0, stdout_copy);
					fflush(stdout_copy);
					_exit(EXIT_SUCCESS);
				}

				// Open quotation
				escaped_line = " '";

				// Sanitize and escape the string
				for(;line_len != 0;line_len--, line++) {
					char c = *line;
					if ((c < 32) && (c != '\t') && (c != '\n') && (c != '\r')) {
						// Control characters aren't allowed.
						syslog(LOG_ERR, "FirmwareCheck: Prohibited character (%d) in version string", c);
						fputc('E', stdout_copy);
						fflush(stdout_copy);
						_exit(EXIT_FAILURE);
					}
					switch (c) {
					case '\'':
						escaped_line += "'\''";
						break;
					case '\n':
					case '\r':
						break;
					default:
						escaped_line += c;
						break;
					}
				}

				// Close quotation
				escaped_line += "'";

				ret = system((command + escaped_line).c_str());

				fputc(WEXITSTATUS(ret), stdout_copy);
				fflush(stdout_copy);
			}

			_exit(EXIT_FAILURE);
		}

		_exit(EXIT_SUCCESS);
	}

	// Wait for the first fork to return, and place the return value in errno
	if (waitpid(pid, &status, 0) < 0) {
		syslog(LOG_ERR, "Call to waitpid() failed: %s (%d)", strerror(errno), errno);
	}

	if (0 != WEXITSTATUS(status)) {
		// If this has happened then the double fork failed. Clean up
		// and pass this status along to the caller as errno.

		syslog(LOG_ERR, "Child process failed: %s (%d)", strerror(WEXITSTATUS(status)), WEXITSTATUS(status));

		close(mFirmwareCheckFD);
		mFirmwareCheckFD = -1;

		errno = WEXITSTATUS(status);
	}
}

bool
FirmwareUpgrade::can_upgrade_firmware(void)
{
	return (mFirmwareUpgradeFD >= 0);
}

int
FirmwareUpgrade::get_upgrade_status(void)
{
	return mUpgradeStatus;
}

int
FirmwareUpgrade::update_fd_set(fd_set *read_fd_set, fd_set *write_fd_set, fd_set *error_fd_set, int *max_fd, cms_t *timeout)
{
	if ((mUpgradeStatus == EINPROGRESS) && (mFirmwareUpgradeFD >= 0)) {
		if (read_fd_set != NULL) {
			FD_SET(mFirmwareUpgradeFD, read_fd_set);
		}
		if (error_fd_set != NULL) {
			FD_SET(mFirmwareUpgradeFD, error_fd_set);
		}
		if (max_fd != NULL) {
			*max_fd = std::max(*max_fd, mFirmwareUpgradeFD);
		}
	}

	return 0;
}

void
FirmwareUpgrade::process(void)
{
	if (mUpgradeStatus == EINPROGRESS) {
		ssize_t bytes_read;
		uint8_t value;

		bytes_read = read(mFirmwareUpgradeFD, &value, 1);

		if ((bytes_read < 0) && (errno != EWOULDBLOCK)) {
			mUpgradeStatus = errno;
		} else if (bytes_read == 1) {
			mUpgradeStatus = value;

			// If the upgrade status was successful, go ahead and close
			// down both checks so that we don't waste resources. This
			// also has the added benefit of preventing upgrade loops.
			if (mUpgradeStatus == 0) {
				close_check_fd();
				close_upgrade_fd();
			}
		}
	}
}

redpajama_set_name: RedPajamaGithub


Industrial Indoor Outdoor Range is used in various applications according to the specifications. We manufacture this product with premium quality raw materials. All these lamps have a wide usage in a large number of applications. These industrial indoor outdoor are fabricated with the best possible quality input material. They are available in different dimensions and shapes according to the requirements of the clients. These range of Space Frame Structures which is available at industry leading prices. These are designed in compliance with the prevailing industry standards. These range provided with various needs of objects for interior decoration.
Banking on our enriched industry experience, we are engaged in offering a huge gamut of Industrial Light Fitting. This Industrial Light fitting offered by us consume less power and is offered at reasonable prices. This superior quality Industrial Light Fitting is fabricated by making use of latest designs. Thus, this Industrial Light Fitting is highly appreciated for its easy maintenance, durability and efficiency.
With the constant support of our expert team, we are engaged in offering a huge assortment of Slim Industrial Light Fitting. We offer this superior make Slim Industrial Light Fitting as per the diverse needs of our client. Being economically priced, this Slim Industrial Light Fitting is very popular in the industry. This Slim Industrial Light Fitting is manufactured using high quality components and parts.
Looking for Industrial Indoor Outdoor Range ?