text:
Q: почему мы тут пишем int dist = 252; а на втором классе miles хотя я не могу найти между ними связи public class Vehicle {
    public static void main(String args[]) {
        opds minivan = new opds();
        opds sportscar = new opds();
        double gallons;
        int dist = 252;
// присвоить значения полям в объекте minivan
        minivan.passengers = 7;
        minivan.fuelcap = 16;
        minivan.mpg = 21;
// присвоить значения полям в объекте sportscar
        sportscar.passengers = 2;
        sportscar.fuelcap = 14;
        sportscar.mpg = 12;
        gallons = minivan.fuelneeded(dist) ;  // почему тут (dist) а не (miles) ?
        System.out.println("To go " + dist + " miles minivan needs " +
                gallons + " gallons of fuel.");
        gallons = sportscar.fuelneeded(dist);
        System.out.println("To go " + dist + " miles sportscar needs " +
                gallons + " gallons of fuel.");
    }

}

class opds {
    int passengers; // количество пассажиров
    int fuelcap;    // емкость топливного бака
    int mpg;    // потребление топлива в милях на галлон }

    введите сюда код
    double fuelneeded(int miles) {

        return (double) miles / mpg;
    }
}

A: Потому что переменную в одном методе решили назвать dists, а в другом - miles, их имена не обязательно должны совпадать, хотя и хранят одно и то же значение - это просто метка, по которой можно обратиться к значению.
После того, как метод fuelneeded  получит на вход аргумент dists, внутри этого метода он присвоит переданное значение dists своей собственной внутренней (локальной) переменной miles и получим результат miles = dists.
Теперь внутри метода значение, переданное в него, как dists будет известно под меткой miles (такое локальное именование мы указали в сигнатуре этого метода - к полученному значению обращаться по имени miles). Данное имя будет действительно только внутри этого метода .
Передать же в метод вы можете любое значение подходящего типа (здесь типа int): любую переменную или даже просто число:
fuelneeded(500);

внутри метода вы можете обратиться к полученному значению по имени miles
Вообще это основы программирования, передача значений в методы, вам бы надо почитать литературу по теории программирования вообще и на Java в частности. В данном случае о глобальных и локальных переменных, аргументах методов и областях видимости переменных.
Связь между ними такая, что дистанция (расстояние) измеряется в милях. Мы можем говорить, что машина проехала дистанцию 100 (миль) или просто машина проехала 100 миль.

redpajama_set_name: RedPajamaStackExchange


text:
| Listen Live
Students ask why board ousted Bakr
By John Dyer
Globe Correspondent / February 19, 2012
When Lindsay Perdue wanted to drop out of Marlborough High School after enduring bullying and then suffering an illness that kept her out of classes for 84 days, she sought advice from assistant principal Adam Bakr.
"He really gave me the motivation to go back and try,'' said Perdue, 19, who earned her diploma in 2011 and now studies at Quinsigamond Community College in Worcester. "He's the reason I graduated. I can definitely say he changed my life.''
Now Perdue, who spoke at a meeting of the Marlborough School Committee on Tuesday, said she was returning the favor by asking officials to explain why Bakr mysteriously disappeared from the halls of her alma mater about two months ago.
Joining Perdue at the meeting were 30 current high school students and parents who said Bakr was the most beloved of administrators in the city's high school. Wearing T-shirts and holding signs that read "Bring Bakr Back,'' "Bakr is MHS,'' and similar messages, members of the group said Bakr was at work one day in late December and gone the next without explanation. They wanted to know why he suddenly disappeared and why officials wouldn't explain his absence.
Superintendent Anthony Pope, Mayor Arthur Vigeant - who also serves as chairman of the school committee - and school committee members said they couldn't discuss the issue because it is a personnel matter.
Bakr could not be reached for comment. Students said he has been put on administrative leave, but officials wouldn't confirm that assertion. City Comptroller Tom Abel said Bakr was still receiving his $105,400 annual salary.
"This is an issue that needs to be taken care of internally,'' said Vigeant, who along with other committee members allowed the students to speak even though Bakr's employment status wasn't on the evening's agenda.
Before the meeting, Vigeant praised the students' organizing skills.
"The kids did a great job on a lobbying effort,'' he said. "They were close to him. They're concerned.''
High school senior Cairo Mendes was one of the organizers.
"They took out Mr. Bakr out of nowhere. We just don't know why. They won't tell us,'' said Mendes, 18, who said speculation about Bakr's disappearance was buzzing throughout the school community. "This is a man's reputation on the line.''
Mendes created an online petition calling for Bakr to be reinstated that has garnered more than 400 signatures. Nearly 600 Facebook subscribers have indicated they "like'' a Facebook page created by Rebeca Mulin, a 17-year-old senior, to support Bakr.
Shortly before the committee convened, 20 students gathered on Main Street and marched a few blocks with their signs to attend the meeting at the Early Childhood Center on Washington Street.
Students were highly critical of Pope's handling of questions about Bakr's absence, saying he'd been disrespectful and dismissive of their concerns in two recent meetings where he discussed Bakr with students at the high school.
"A number of us felt personally disrespected by the way he spoke,'' Mulin told the School Committee. "He did not communicate but instead lectured us and made us feel very intimidated and also threatened by the tone of his voice.''
Mendes said Pope told a student to "get out of my face'' during an encounter with students who had staged a sit-in protest in support of Bakr in a corridor of the high school. Pope threatened to suspend the student, but ultimately the punishment wasn't carried out, said Mendes.
Speaking to reporters after the School Committee meeting, Pope disputed Mulin's and Mendes's depictions of the encounter. "I absolutely didn't tell a kid to get out of my face,'' said Pope. "That was totally made up.''
Students need to understand that, by law, he couldn't disclose details about Bakr's job status, Pope said. "They aren't being given the answer they want,'' he said. "A lot of it is emotionally charged.''
At the Tuesday meeting, a member of the Marlborough High School Council, a panel of students, parents, and residents who advise administrators, said he thought Pope or another official should give some explanation as to Bakr's departure.
"This seems to be taking an unduly long period,'' said George Whapham, who is Perdue's grandfather. "That's what is feeding all the interest here.''

redpajama_set_name: RedPajamaCommonCrawl


India; 30, January 2017: Sometimes people have to relocate their office and house in different cities and districts of a country due to various reasons. For ensuring utmost safety of the residential and official belongings during relocation, Maurti International Packers and Movers provides specialized packing and moving solutions of the highest quality in all conditions. This company is always prepared to handle the belongings of the clients during the shifting of business or home. It is a licensed and fully insured moving firm that comes with updated equipment to smoothly handle any packing and moving assignment. All its staffs are highly trained, tested, and certified in the job of packing, moving, and loading. All the trucks of this agency are nicely equipped with dollies, straps, and padding.
This agency always emphasizes on moving the official and residential goods with extreme precaution to avoid any damage during the middle of the journey and for this reason it usually employs experienced crews who can move these belongings with utmost care and attention. The customer service team of this company is always prepared to forward a free estimate once receiving the request from the prospective visitors. This company always enjoys a top position in the list of packers and movers in Bhopal as it is always geared up to help clients in all conditions without compromising quality. This specialized firm bears the overall responsibility to help customers in managing their remote relocation task with safety and security benefits.
The company has been able to achieve the tag of as one of the reliable packers and movers in Indore to help people with the task of relocation in different parts of Indore and Madhya Pradesh. It has the required expertise and experience in handling household items like television, refrigerators, washing machine, and other things with utmost carefulness. The loading and unloading of goods is always a risky task to do. Being a front-runner in the industry, it is able to deliver the goods to the new place in their present condition. It possesses a well spread network system in the four fast paced cities of India which includes Pune, Noida, Bangalore, Chandigarh, and so on.
This company emerges as one of the best packers and movers in Bathinda as it can come up with almost all kinds of facilities related to the diverse relocation and transportation needs. The firm always focuses to arrive with the unique packing and moving solutions to easily accommodate the requirements of customers in all circumstances.
Maruti International Packers and Movers provides top-notch packing and moving solutions in different cities of India. It ensures timely delivery of the belongings in good conditions. To know more, customers can visit the official website of this company anytime.


Secure banking options are a priority to all gamblers. There are plenty of different types of online blackjack, including:. An area of interest for any online casino are the amount of games that it offers. By regulating the lottery or any other gambling activity selected , the public can see laws in action- the UK gambling commission would dictate rules around lottery sales, the way lottery tickets are redeemed, where they are sold, and how the winner is paid. Through each review, players can find online casinos that have the best fair play standards.
All online casinos we recommend accept USD at the cashier, so get playing today! Also known as Internet or virtual casinos, top-ranked casinos provide one of the most popular forms of online casino gaming in America.
Casino USA is a premier American online gambling site. We offer all Internet players from the United States of America the best news, information and recommended, shortlisted, leading American sites. Whats the best casino online in America? Which is the best payout online casino in the United States? Our team lists the top casinos for We find the best and biggest online casinos in the USA and bring them to our readers!
They have thoroughly vetted and reviewed all the American sites you see. We will be able to tell you which online American casino for real money is our favorite.
The Casino US team can guide you to the best interactive igambling websites on the internet. This ensures online casino players in the USA will have no trouble depositing and withdrawing funds. Our critical examination will tell you everything you need to know about top American friendly online casino sites. Whether you should play there or not, what USA online slots and table games they offer and give you recommended online casinos to gamble at. Finding the top rated online casinos for real money in America has never been this easy.
The internet casinos industry in the U. Our expert team have seen it all and know what to look out for when it comes to finding a safe, top American casino online. Our team of reviewers places the safety of our readers as their highest priority. We ensure that the best online casino America we recommend meets the highest safety standards in the American online gambling industry.
All American sites offering web-based casino gambling for real money need to have proper security systems in place, as well as other required safety measures. When you play at one of our recommended online American casinos, you are guaranteed a safe experience.
Our recommended casinos provide players with safe online gambling USA. The best way for Internet gamblers at online casino US sites to make sure the sites are legitimate and ensure it is properly licensed and regulated by the appropriate organizations. We will not recommend any US online casinos until we have double checked its license. We also make sure that the onlinecasinos are regularly audited and examined by unbiased third parties.
This makes sure that the US online gambling games are fair. Without a proper licence, casinos cannot be considered for the title of best gambling site. No one wants to have to sit and wait for weeks before they get the money they won. This makes sure our readers get the best online casino USA payouts! These include top rated real money slots, which are also known as fruit machines, one-armed bandits, and pokies.
Some of these include online slot machines, Poker, Blackjack, scratch cards and much more, including less well-known games. Our team has tested these exciting games, which will typically differ from the games found in top-ranked land-based American casinos. We also look back into the history that surrounds many of the best internet games we enjoy at online casinos today. Online American slots are perhaps the most popular game today, both online and in land-based casinos. This is due to being really easy to play and understand.
They offer players a huge variety of themes. They also allow online casino players in the USA to win massive payouts, especially when playing progressive jackpot titles. Slots allow players to just sit back, relax, and have a good time.
Table games are a little less popular with the masses these days, when compared to slots. Players need to understand many of the table games in order to do well, but this does have its advantages.
Table games tend to offer a much lower house edge than online slots. We have been playing at the best online casinos for years now and so we know the ins and outs. Each state takes a different approach to online gambling and many even use geo-location software to prevent players from gambling in their state if a player is based in a state that does not allow online gambling.
These providers have also developed casino games that are available on desktop AND on mobile. Single account, single focus on your satisfaction. Sign up and deposit features allow your to manage your account from anywhere to get right into the action. Click here to claim your signup bonus. Looking for the most rewarding casino experience online? They have various USA deposit options and a 24 hours withdrawal service.


The Coca-Cola Company and our bottling partners have conducted business in Colombia for more than 70 years. More than 2,000 Colombians are employed by Coca-Cola bottlers in Colombia. Bottling plants distribute beverages to approximately 500,000 retailers, creating additional jobs in sales, marketing and shipping.
The Coca-Cola bottling operations in Colombia make beverages by Colombians and for Colombians; beverages are not exported out of the country to any other market, which is our business practice regardless of where we operate in the world.
Over the past several decades, Colombia has experienced much internal conflict, which affects trade union leaders and other people from all walks of life. Despite the volatile environment, The Coca-Cola Company and its bottlers have maintained operations and have worked to provide safe, stable economic opportunities for the people of Colombia.
In a country where violence against union members has deterred all but 4 percent of workers from unionizing, 31 percent of Coca-Cola bottler employees belong to unions. Coca-Cola bottlers enjoy extensive, normal relations with 12 unions in Colombia and currently have collective bargaining agreements in place covering wages, benefits and working conditions. On average, wages for Coca-Cola workers are two to three times higher than the minimum wage.
Through both collective bargaining agreements and their own initiative, Coca-Cola bottlers work with unions and the government to provide emergency cell phones, transportation to and from work, secure housing, and a host of other measures to protect employees. Additional security measures are routinely provided to union leaders and special measures are undertaken when a threat against unionized employees is brought to the attention of the bottler's management. We've also established a 24-hour hotline for employees to confidentially report any workplace concerns and/or complaints.
We share global concerns regarding the unfavorable labor environment in Colombia. Ed Potter, our director of global labor relations, serves on the Applications of Conventions Committee within the International Labor Organization (ILO), which evaluates country implementation of ratified ILO treaties. In late October, Ed was part of a high-level tripartite visit to Colombia and met with government representatives, organizations representing workers and employers, and those responsible for investigating and supervising labor rights in Colombia. The Committee has made a number of recommendations based on its essential findings that impunity with respect to violence against trade unionists continues to exist and that trade unions face several obstacles in both law and practice regarding the full exercise of freedom of association. The ILO recommendations address some of the core issues contributing to the violence in Colombia.
In the spring of 2005, an independent assessment of bottling plants in Colombia by the internationally respected and certified social compliance auditor Cal Safety Compliance Corporation confirmed that workers in Coca-Cola plants enjoy freedom of association, collective bargaining rights, and a work atmosphere free of anti-union intimidation.
We are currently facilitating the design and development of an additional credible, objective and impartial independent third party assessment in Colombia during the first quarter of 2006. The assessment will involve international labor organizations, non-governmental organizations and our most vocal critics. It will be conducted with the cooperation of our Colombian bottling partners.
In December 2005, a major Norwegian financial firm, KLP, announced it is now satisfied that The Coca-Cola Company meets the ethical standards required of companies in which it invests. KLP had raised concerns about our system's labor practices in Colombia but specifically cited the audit conducted by Cal Safety Compliance Corporation as a key factor in its satisfaction that our Company abides by high ethical standards.
A public statement made by SINALTRAINBEC, a Colombian union representing bottler employees, said that it has "not a single indication" that The Coca-Cola Company or any of its bottling partners have links to anti-union violence.
These allegations were the thrust of a lawsuit filed in 2001 against The Coca-Cola Company in a U.S. District Court in Miami; the Company was dismissed as a defendant. We are confident that as the case proceeds, the court will find no evidence against Coca-Cola bottlers.
Earlier this year, we signed a joint statement with the IUF, the international organization for unions in the food and beverage sectors. In that document, we acknowledge that "Coca-Cola workers are allowed to exercise rights to union membership and collective bargaining without pressure or interference. Such rights are exercised without fear of retaliation, repression or any other form of discrimination." We are committed to ongoing dialogue with the IUF.
In July 2003, the IUF posted this statement to its Web site: "Sweeping, unsubstantiated allegations and assertions of the type found in the boycott appeal do nothing to help the cause of the unions that organize and represent Coca-Cola workers around the world, the majority of which are members of the IUF. The call for a boycott of Coca-Cola was unanimously rejected at the recent IUF global meeting that included over 27 IUF-affiliated organizations from 23 countries, representing more than 100 Coca-Cola workers' trade unions around the world."
For as long as we've been in Colombia, Coca-Cola has supported programs that aid children, promote education, and bring relief to victims of the country's ongoing conflict. Earlier this year, we provided $10 million to start the Colombian Foundation for Education and Opportunity, an organization that addresses the needs of victims of violence and is run by a group of well-respected Colombians, including Mr. Carlos Rodriguez (president of the Colombian United Confederation of Workers).


text:
Q: mapping constants to resource strings for lists population and lookup After an extensive search here I still need an expert advice:
Requirements
Requirements are pretty standard: map int consts to strings from resource files so localization will work fine and we can easily create a list of value pairs for dropdown lists in current user language as well as doing backward lookup on int value. Const integers are defined as static in different classes.
So, here is how it's implemented currently and something tells me it can be better and deserves critics:
Dictionary class:
public class TLiteralDic : Dictionary<int, string>
{
    //Lookup method
    public string getLiteral(int key)
    {
        if (ContainsKey(key)) {
            return this[key];
        }
        return string.Empty;
    }
}

Somewhere close to UI layer an extension method to fill dropdown controls is defined like this:
public static void fill(this TLiteralDic dic, DropDownList ddlst)
{
   ddlst.Items.Clear();
   foreach (KeyValuePair<int, string> v in dic) {
      ddlst.Items.Add(new ListItem(v.Value, v.Key.ToString()));
   }
}

Adding pairs (static const int to string from a resource file):
public static class TLiterals
{

private static TLiteralDic _fileStatus;
public static TLiteralDic FileStatus
{
    get
    {
        if (_fileStatus == null) {
            _fileStatus = new TLiteralDic() {
                {TFiles.Status.Cancelled,   Lists.FileStatus_Cancelled},
                {TFiles.Status.Closed,      Lists.FileStatus_Closed},
                {TFiles.Status.OnHold,      Lists.FileStatus_OnHold},
                {TFiles.Status.Open,        Lists.FileStatus_Open},
                {TFiles.Status.Pending,     Lists.FileStatus_Pending},
                {TFiles.Status.Portal,      Lists.FileStatus_Portal}
            };
        }
        return _fileStatus;
    }
}

//... hundred of lists like that, short and long (up to 15 entries)

}

Using in code
Lookup:
textStatus.Text = TLiterals.FileStatus.getLiteral(row.FileStatus);

List fill:
TLiterals.FileStatus.fill(ddlstFileStatus);

Considerations
The idea is to have only one place where the mapping is defined and be able to create a list out of it or do a lookup by int value. Ideally with good performance, minimal memory footprint and coding hassle.
Already considered the following alternatives:

*

*using switch (was used in the past for lookup - a lot of redundant code)

*using reflection

*closures

*JSON, XML

*using T4 class generation in VS2010

No simple or obviously better solution was found so far.
Issues in the current implementation

*

*a lot of repetitive code around the actual list of pairs, ideally must be all hidden and reused

*need to define static private property; the idea was to use "lazy" initialization for lists only when they are retrieved the first time.

*keeping literals in memory after the first use maybe too high price for such simple operation

Advantages with the current implementation

*

*list defined in one place (vs switch lookup and manual list population in 2 different places using the same value pairs)

*reused code for lookup and list filling.

*simplicity to maintain and compile time checks.

Any ideas for a better "beautiful code"? :)
Ideally, I'd like to see something like this when defining the list but it should not initialize until really needed/used:
public static TLiteralDic FileStatus = new TLiteralDic () {
                {TFiles.Status.Cancelled,   Lists.FileStatus_Cancelled},
                {TFiles.Status.Closed,      Lists.FileStatus_Closed},
                {TFiles.Status.OnHold,      Lists.FileStatus_OnHold},
                {TFiles.Status.Open,        Lists.FileStatus_Open},
                {TFiles.Status.Pending,     Lists.FileStatus_Pending},
                {TFiles.Status.Portal,      Lists.FileStatus_Portal}
}

A:
it should not initialize until really needed/used:

you could use lazy instantiation to do this :
Lazy<Dictionary<string, string>> resources = new Lazy<Dictionary<string, string>>(() => new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase));

Sorting the dictionary would also help you speed up the search, using BinarySearch for instance.


Samsung is one of the main cell phone makers in the market. Samsung Galaxy S7 is the lead cell phone with staggering highlights. Samsung dependably stands first in releasing new updates. Samsung Galaxy S7 comes Android Marshmallow out of the box.
Download firmware for Samsung Galaxy S7 above.


Alex and I are wrapping up our conversation on holistic health today by discussing how spiritual and social health each relate to physical health. We love our communities! Especially when they help us eat yummy food...we'll touch on sanctification, social boundaries, and chicken wings (obviously).
"The Very Best Brownies" by Cookie and Kate.
How would you evaluate these areas of your health? Let us know! Leave a comment, send us a question, or find me over on Instagram @ifeelsupernourished.


text:
Ring, maker of "smart" doorbells, snares $109 million
Kia Kokalitcheva
Ring, the maker of a popular doorbell equipped with a security camera, has raised a whopping $109 million in new venture capital funding less than one year after its last round. DFJ Growth, Goldman Sachs Investment Partners and Qualcomm Ventures led the round, with additional participation from Richard Branson, True Ventures, American Family Insurance and Shea Ventures.
Market maturity: According to Ring founder Jamie Siminoff, we're past the initial hype phase of "smart" devices for the home. "Now you're starting to see companies doing $100 million-plus" in revenue, he tells Axios of the market's maturing.
Research firm IHS predicts that the smart home market will move beyond early adopters and into mass adoption, within the next five years or so.
Year of the hub: Unlike some of its peers, Ring's strategy has been to focus on standalone products with a very specific and obvious use, such as the home security camera.
Despite a rough 2016 and a recent lack of new products, Nest, one of the biggest brands in connected home devices, did nail this strategy when it introduced its first product, the "smart thermostat."
But now that such products have given consumers a taste of the so-called "connected home," Siminoff believes they'll finally begin to purchase hubs, which can centrally connect and connect various devices in and out of the home.
While Ring will continue to develop standalone products, it's partnering with bigger companies producing popular hubs to make sure its products are universally available.


As a portrait photographer we like to offer relaxed, professional and friendly portrait photography. We are based in Huddersfield, and also cover Halifax and the wider West Yorkshire. As portrait photographers we love to capture your personality, these can be anything from artistic compositions through to business and more formal headshots. We enjoy thinking outside the box, searching out great locations, outfits and whatever else fits the brief. Portrait photography packages are bespoke as timescales, locations and individual requirements will differ from shoot to shoot. Please contact us to develop a package that works for you.
All photography packages will include an online viewing gallery of all images.
Prints, digital images and canvases can be purchased via the online gallery.
A usb containing all the portrait photography session's fully edited photographs with full printing right can be purchased for £200.


Apples are a fruit that can be enjoyed equally well at harvest or months later. Many Ontario apple growers put their crop into storage so that consumers can eat fresh local apples throughout the fall and winter months.
But how do farmers know the best conditions, temperature and timing for storing their fruit?? And will technology from other parts of the world perform equally well in Ontario, where climate and geography are different?
That's where researchers like Dr. Jennifer DeEll come in. She's the Fresh Market Quality Specialist for Horticultural Crops with the Ontario Ministry of Agriculture, Food and Rural Affairs (OMAFRA) and part of her job includes conducting research into storage technologies for fresh Ontario fruit like apples.
She's just completed a project looking at a technology called SafePod, which could result in longer storage life for apples and better quality fruit when they come out of cold storage.
Apples have long been stored in low oxygen environments, but until now, it had never been possible to determine how low the oxygen levels for a specific variety can go before the fruit's quality begins to suffer.
SafePod measures apples' response to atmospheric stress by monitoring their respiration rate while they are in storage, allowing storage operators to use the lowest safe oxygen concentration possible.
"Growers want to be able to get that oxygen level as low as possible while still maintaining safe levels because the lower the oxygen, the firmer the fruit and the better the quality", she adds.
SafePod is a small unit that can be filled with four bushels of apples and placed into a large commercial cold storage amongst the other bins of apples. It lets storage operators measure the actual respiration of the fruit inside the unit by giving a reading of both oxygen and carbon dioxide levels, which together result in a respiration quotient that can indicate when the apples are becoming stressed.
Levels specific to the crop, growing season, variety and even the orchard the apples come from can be established annually by the storage operator.
Another technology DeEll was involved in testing for Ontario farmers is a new air-tight storage container module that lets farmers store produce in a low oxygen environment. The storage bin lids contain semi-permeable membranes that release carbon dioxide from the bin while maintaining a small concentration of oxygen inside. They're particularly ideal for growers who have cold storage units on their farms, but no controlled atmosphere capabilities, and are looking to extend the shelf life of their fruits or vegetables.
Research like DeEll's allows the industry to test new technologies and share the results with all apple growers instead of each grower having to make his or her own investments and conduct their own trials individually.