Friday, December 27, 2019

How to Locate TreeView Node By Text

While developing Delphi applications using the TreeView component, you may bump into a situation where you need to search for a tree node given by only the text of the node. In this article well present you with one quick and easy function to get TreeView node by text. A Delphi Example First, well build a simple Delphi form containing a TreeView, a Button, CheckBox and an Edit component—leave all the default component names. As you might imagine, the code will work something like:  if GetNodeByText given by Edit1.Text returns a node and MakeVisible (CheckBox1) is true then select node. The most important part is the GetNodeByText function. This function simply iterates through all the nodes inside the  ATree  TreeView starting from the first node (ATree.Items[0]). The iteration uses the  GetNext  method of the TTreeView class to look for the next node in the ATree (looks inside all nodes of all child nodes). If the Node with text (label) given by  AValue  is found (case insensitive) the function returns the node. The boolean variable  AVisible  is used to make the node visible (if hidden). function GetNodeByText(ATree : TTreeView; AValue:String; AVisible: Boolean): TTreeNode;var Node: TTreeNode;begin Result : nil; if ATree.Items.Count 0 then Exit; Node : ATree.Items[0]; while Node nil dobeginif UpperCase(Node.Text) UpperCase(AValue) thenbegin Result : Node; if AVisible then Result.MakeVisible; Break; end; Node : Node.GetNext; end;end; This is the code that runs the Find Node button OnClick event: procedure TForm1.Button1Click(Sender: TObject);var tn : TTreeNode;begin tn:GetNodeByText(TreeView1,Edit1.Text,CheckBox1.Checked); if tn nil then ShowMessage(Not found!) elsebegin TreeView1.SetFocus; tn.Selected : True; end;end; Note: If the node is located the code selects the node, if not a message is displayed. Thats it. As simple as only Delphi can be. However, if you look twice, youll see something is missing: the code will find the FIRST node given by AText.

Thursday, December 19, 2019

Carefour Missadventure in Russia Essay - 4589 Words

Master of Business Administration Strategic Management Carrefour Misadventure in Russia Supervised By Submitted By John Kalmus Muhammad Omair STU 22782 Submitted To IBAM Word Count 3898 Submission Date 22 January 2011 Carrefour strategy is comprised of following components Organic, Sustainable and Profitable growth Fast return on capital employed Market Leadership through Acquisition Carrefour started business in 1963 by introducing the idea of hyper market by providing thousands of products under one roof. Soon after the success of hyper market Carrefour started targeting the customers with discounted stores. Carrefour is now world Europe largest and world second largest. Carrefour Major Merger and Acquisitions†¦show more content†¦Wal-Mart is also doing strategic alliance to get hold of Chinese market. Even Wal-Mart was planning to acquire kopeyka in Russia for its entry to Russian market however it entry was stopped by X5 market leader of Russian retail by purchasing the company in $1.6 billion. We can say that acquisition is good strategy for Carrefour in countries like China, Russia, India, or Brazil which have many cities with population in millions or in market where it s difficul t to get enter. However Carrefour was the first international retailer in China so it focused on organic growth and kept it at 20% for 2008 but keeping in mind the small acquisition as well. So we can say that Carrefour was quite successful in it strategy of organic growth and acquisition. Wherever it has acquired companies it has achieved its strategy of organic, sustainable growth, with fast return on investment and market leadership. However there are many countries where Carrefour failed like Russia, South Korea, Japan, Slovakia, and Czech Republic, Malaysia, Singapore etc There were many other factors which were cause of its exit from those countries. Still Carrefour has sold it operations in that country to companies like Tesco, E-Led. We can assume that Carrefour could have it strategy to test new markets get

Wednesday, December 11, 2019

Solutions to Lp Problems free essay sample

Furnco manufactures desks and chairs. Each desk uses 4 units of wood, and each chair uses 3 units of wood. A desk contributes $40 to profit, and a chair contributes $25. Marketing restrictions require that the number of chairs produced be at least twice the number of desks produced. There are 20 units of wood available. Using the graph below, determine a production plan that maximizes Furnco’s profit. a) Draw isoprofit lines where the total profit equals 125, 150, 175, and 200. Produce 2 desks and 4 chairs. c) What is the optimal total profit? Point C is (2, 4), where the total profit is $180. 2. A farmer in Iowa owns 45 acres of land. She is going to plant each acre with wheat or corn. Each acre planted with wheat yields $200 profit; each with corn yields $300 profit. The labor and fertilizer used for each acre are given in the table below. 100 workers and 120 tons of fertilizer are available. | |Wheat |Corn | |Labor |3 workers |2 workers | |Fertilizer |2 tons |4 tons | Determine the planting scheme that maximizes total profit. There are four critical points: Point A (at the origin), Point B (where the fertilizer constraint crosses the non-negativity constraint on wheat), Point C (where the fertilizer constraint line crosses the labor constraint), and Point D, where the labor constraint crosses the non-negativity constraint on corn). The best solution is at Point C (20, 20). Plant 20 acres of wheat and 20 acres of corn. d) What is the optimal total profit? The optimal total profit is $10,000. 3. A bank is attempting to determine where its assets should be invested during the current year. At present, $500,000 is available for investment in bonds, home loans, auto loans, and personal loans. The annual rates of return on each type of investment are known to be the following: bonds, 10%; home loans, 16%; auto loans, 13%; and personal loans, 20%. To ensure that the bank’s portfolio is not too risky, the bank’s investment manager has placed the following three restrictions on the bank’s portfolio: †¢ The amount invested in personal loans cannot exceed the amount invested in bonds. †¢ The amount invested in home loans cannot exceed the amount invested in auto loans. No more than 25% of the total amount invested may be in personal loans. Below are various elements of the Excel model used to solve the problem: the spreadsheet model, the Solver parameters, the Solver options, the answer report and the sensitivity report. From cell E8 in the answer report, the optimal portfolio will return 14. 5% ($73,750). c) What would be the improvement in the return on investment if the limit on the total amount invested in personal loans were increased to 30%? We look at cell E20 in the Sensitivity Report, and see that the shadow price is 1%. That means that for every unit of increase in this constraint’s right-hand side, we will realize a 1% improvement in the objective function. If we change the right-hand side of this constraint from 25% to 30% (a change that is within the allowable increase shown in cell G20 of the Sensitivity Report), then the objective function will increase by 0. 05 * 0. 01 = 0. 0005. Our portfolio return would go from 0. 1475 to 0. 1480 (from 14. 75% to 14. 80%). d) If the return on bonds increases from 10% to 13%, what will happen to the optimal allocation of funds? Cell G9 in the Sensitivity Report indicates that the bond return would have to increase by at least 4. 5% before the optimal investment mix would change. Since this is only a 3% increase, the portfolio would not change (although it would become more profitable). 4. Sunco Oil manufactures three types of gasoline (gas 1, 2, and 3). Each type is produced by blending three types of crude oil (crude 1, crude 2, and crude 3). Sunco can purchase up to 5,000 barrels of each type of crude daily. The selling price per barrel of gasoline and the purchase price per barrel of crude oil are given in Table 4. 1 below. | |Selling Price per Barrel | |Purchase Price per Barrel | |Gas 1 |$70 |Crude 1 |$45 | |Gas 2 |$60 |Crude 2 |$35 | |Gas 3 |$50 |Crude 3 |$25 | Table 4. 1 The three types of gasoline differ in their octane rating and their sulfur content. The crude oil blended to form gas 1 must have an average octane rating of at least 10 and contain at most 1% sulfur. The crude oil blended to form gas 2 must have an average octane rating of at least 8 and contain at most 2% sulfur. The crude oil blended to form gas 3 must have an average octane rating of at least 6 and contain at most 1% sulfur. The octane rating and sulfur content of the three types of crude oil are given in Table 4. 2 below. | |Octane Rating |Sulfur Content |Crude 1 |12 |0. 5% | |Crude 2 |6 |2. 0% | |Crude 3 |8 |3. 0% | Table 4. 2 It costs $4 to transform 1 barrel of oil into 1 barrel of gasoline, and Sunco’s refinery can produce up to 14,000 barrels of gasoline daily. Sunco’s customers require the following amounts of each gasoline: gas 1, 3000 barrels per day; gas 2, 2000 barrels per day; gas 3, 1000 barrels per day. The company considers it an obligation to meet these demands. Sunco also has the option of advertising to stimulate demand for its products. Each dollar spent daily in advertising a particular type of gas increases the daily demand for that type of gas by 10 barrels. For example, if Sunco decides to spend $20 daily in advertising gas 2, the daily demand for gas 2 will increase by 200 barrels. Below are the answer report and the sensitivity report from a Solver optimal solution to this problem. [pic] [pic] [pic] [pic] [pic] a) What is the optimal amount of profit for Sunco? Cell E8 of the Answer Report indicates that the optimal profit is $287,750. ) How much of Crude Oil 2 should Sunco purchase? Cell D40 of the Answer Report indicates that Sunco should purchase 5,000 barrels of Crude Oil 2. c) How much of the Crude Oil 2 will be used to make Gas 3? Cell D18 of the Answer Report indicates that none of the Crude Oil 2 will be used to make Gas 3. d) The marketing director insists that Sunco needs to spend $500 advertising Gas 1. What will this do to the net profit? According to the Sensitivity Report. 500 barrels of Crude Oil 2 are available on the spot market. How much should Sunco offer per barrel for this commodity? According to the Sensitivity Report (cell E36), Sunco should offer no more than $20. 90 per barrel. f) Assuming that the seller agrees to Sunco’s price, how many barrels of Crude Oil 2 should they buy? Cell G36 of the Sensitivity Report indicates that Sunco would be interested in as much as 400 barrels at a price of no more than $20. 90. g) 500 barrels of Crude Oil 3 are available on the spot market. How much should Sunco offer per barrel for this commodity?

Tuesday, December 3, 2019

Transportation In The 19th Century During The First Half Of The 19th C

Transportation in the 19th Century During the first half of the 19th century, improvements in transportation developed rather quickly. Roads, steamboats, canals, and railroads all had a positive effect on the American economy. They also provided for a more diverse United States by allowing more products to be sold in new areas of the country and by opening new markets. Copied from ideas begun in England and France, American roads were being built everywhere. In an attempt to make money, private investors financed many turnpikes, expecting to profit from the tolls collected. Although they did not make as much money as expected, these roads made it possible for cheaper (not cheap) domestic transportation of goods. It still cost more to transport a ton of freight a few miles over land than it did to send it across the Atlantic Ocean. But because of turnpikes, for the first time, goods were able to make it over the formidable Appalachian mountains. The steamboat was the first economic al means of inland transport. It was faster and cheaper then the rafts used before them. Additionally, the steamboats made it possible to travel back up the Mississippi, allowing farmers and lumbermen to come down by raft, and travel home in the luxurious comfort of a steamboat after selling their goods. This also made the northwest less self-dependent because it was now able to purchase southern goods. While steamboats sparked the economy on the western frontier, canals became increasingly popular on the east coast. Although expensive ($25,000 per mile), and difficult to build, canals were an important source for those farmers and merchants who needed a cheap method of inland transportation. The water allowed horses, once only able to pull a ton of materials, to now pull over a hundred tons with the same amount of work. These canals were not only economical for exporters, but also for the state. Tolls alone collected from the Erie Canal had, by 1825, already paid for the entire p roject ($7,000,000), and now was making a substantial amount of profit. Even though it had not totally expanded yet, the cheapest, most economical method of transportation was the railroad. Speed, durability, and safety all contributed to the success of it. State legislatures and the national government all provided aid to the railroad companies by decreased the tax on rail iron. During this time period, manufacturing also boomed. New ideas and inventions made it faster to produce products. However, it is because of these new modes of transportation that this was ever able to occur. The cotton gin, invented by Eli Whitney, would never have been able to develop fully if the transportation system did not make it easy to obtain cotton from the south. With these new technological breakthroughs, American economic growth was significantly increased. By allowing cheaper importation and exportation of goods, manufacturers were able to produce more of these products. Also, it opened new m arkets to different places. In the northwest, where coffee was an expensive luxury (costing almost seventeen cents per pound), it was now a common item. The steamboat reduced the price by over thirteen cents. Also, our new transportation system helped other regions work together. And aside from material items, our country benefited economically from tourism. Any tourist to the New York area would not miss "The Great Western Canal." So although manufacturing did have a significant role in developing the American economy, it is because of transportation that manufacturing could have ever improved. Transportation In The 19th Century During The First Half Of The 19th C Transportation in the 19th Century During the first half of the 19th century, improvements in transportation developed rather quickly. Roads, steamboats, canals, and railroads all had a positive effect on the American economy. They also provided for a more diverse United States by allowing more products to be sold in new areas of the country and by opening new markets. Copied from ideas begun in England and France, American roads were being built everywhere. In an attempt to make money, private investors financed many turnpikes, expecting to profit from the tolls collected. Although they did not make as much money as expected, these roads made it possible for cheaper (not cheap) domestic transportation of goods. It still cost more to transport a ton of freight a few miles over land than it did to send it across the Atlantic Ocean. But because of turnpikes, for the first time, goods were able to make it over the formidable Appalachian mountains. The steamboat was the first economic al means of inland transport. It was faster and cheaper then the rafts used before them. Additionally, the steamboats made it possible to travel back up the Mississippi, allowing farmers and lumbermen to come down by raft, and travel home in the luxurious comfort of a steamboat after selling their goods. This also made the northwest less self-dependent because it was now able to purchase southern goods. While steamboats sparked the economy on the western frontier, canals became increasingly popular on the east coast. Although expensive ($25,000 per mile), and difficult to build, canals were an important source for those farmers and merchants who needed a cheap method of inland transportation. The water allowed horses, once only able to pull a ton of materials, to now pull over a hundred tons with the same amount of work. These canals were not only economical for exporters, but also for the state. Tolls alone collected from the Erie Canal had, by 1825, already paid for the entire p roject ($7,000,000), and now was making a substantial amount of profit. Even though it had not totally expanded yet, the cheapest, most economical method of transportation was the railroad. Speed, durability, and safety all contributed to the success of it. State legislatures and the national government all provided aid to the railroad companies by decreased the tax on rail iron. During this time period, manufacturing also boomed. New ideas and inventions made it faster to produce products. However, it is because of these new modes of transportation that this was ever able to occur. The cotton gin, invented by Eli Whitney, would never have been able to develop fully if the transportation system did not make it easy to obtain cotton from the south. With these new technological breakthroughs, American economic growth was significantly increased. By allowing cheaper importation and exportation of goods, manufacturers were able to produce more of these products. Also, it opened new m arkets to different places. In the northwest, where coffee was an expensive luxury (costing almost seventeen cents per pound), it was now a common item. The steamboat reduced the price by over thirteen cents. Also, our new transportation system helped other regions work together. And aside from material items, our country benefited economically from tourism. Any tourist to the New York area would not miss "The Great Western Canal." So although manufacturing did have a significant role in developing the American economy, it is because of transportation that manufacturing could have ever improved.