Sunday, March 3, 2013

Kerry presses Egypt president, military on reform

U.S. Secretary of State John Kerry, left, waves while ending a statement to the media, next to Mohammed Kassem, of World Trading Company, during a meeting with business leaders in Cairo, Egypt on Saturday, March 2, 2013. Cairo is the sixth leg of Kerry's first official overseas trip and begins the Middle East portion of his nine-day journey. (AP Photo/Jacquelyn Martin, Pool)

U.S. Secretary of State John Kerry, left, waves while ending a statement to the media, next to Mohammed Kassem, of World Trading Company, during a meeting with business leaders in Cairo, Egypt on Saturday, March 2, 2013. Cairo is the sixth leg of Kerry's first official overseas trip and begins the Middle East portion of his nine-day journey. (AP Photo/Jacquelyn Martin, Pool)

(AP) ? U.S. Secretary of State John Kerry was wrapping up a visit to deeply divided Egypt on Sunday with an appeal for unity and reform to the country's president and military chief.

A day after warning the country's bickering politicians that they must overcome differences to get Egypt's faltering economy back on track and maintain its leadership role in the volatile Middle East, Kerry was bringing a similar message to President Mohammed Morsi and his defense minister and intelligence chief. The U.S. is deeply concerned that continued instability in Egypt will have broader consequences in a region already rocked by unrest.

U.S. officials said Kerry will raise Egypt's key regional role with Morsi and his top security aides, stress the importance of upholding its peace agreement with Israel, cracking down on weapons smuggling to extremists in the Gaza Strip and policing the increasingly lawless Sinai Peninsula while continuing to play a positive role in Syria's civil war. Yet, with parliamentary elections approaching, his call for harmonizing domestic Egyptian politics is just as important, they said.

Liberal and secular opponents of Morsi's Muslim Brotherhood say they will boycott upcoming elections, and violent clashes between protesters and security forces have created an environment of insecurity, complicating Egyptian efforts to secure vital international aid.

In meetings with Egypt's foreign minister and opposition politicians on Saturday, Kerry said reaching agreement on economic reforms to seal $4.8 billion in International Monetary Fund loans was particularly critical. Closing the IMF deal also will unlock significant U.S. assistance promised by President Barack Obama last year.

But the impact of his message of unity to the opposition was likely blunted as only six of the 11 guests invited by the U.S. Embassy turned up and three of those six said they still intended to boycott the April parliamentary election, according to participants.

Kerry said that the U.S. would not pick sides in Egypt, and he appealed to all sides to come together around human rights, freedom and speech and religious tolerance. Equally essential, he said, is uniting to undertake the reforms necessary to qualify for the IMF package. Those include increasing tax collections and curbing energy subsidies.

However, while expressing sympathy with the passion he heard from the opposition, Kerry suggested U.S. frustration with their tactics even as he maintained that "we're not here to interfere, but to listen."

"The best way to ensure human rights and strong political checks and balances ... is through the broadest possible political and economic participation," Kerry said after meeting Egyptian Foreign Minister Kamel Amr. "We believe that being active, engaging in peaceful participation is essential to building strong communities and healthy democracies."

In an apparent nod to the current stalemate in Washington over the U.S. federal budget, Kerry acknowledged that compromise is difficult yet imperative.

"I say with both humility and with a great deal of respect that getting there requires a genuine give-and-take among Egypt's political leaders and civil society groups just as we are continuing to struggle with that in our own country," he said. 'There must be a willingness on all sides to make meaningful compromises on the issues that matter most to all of the Egyptian people."

The opposition accuses Morsi and the Brotherhood of following in the footsteps of toppled autocrat Hosni Mubarak, failing to carry out reforms and trying to install a more religiously conservative system.

Morsi's administration and the Brotherhood say their foes, who have trailed significantly behind Islamists in all elections since the uprising against Mubarak, are running away from the challenge of the ballot box and are trying to overturn democratic gains.

Egypt's polarization was underscored as Kerry arrived from Turkey on Saturday on the sixth of nine stops in his first official overseas visit as secretary of state. Activists in the Nile Delta city of Mansoura said a 35-year-old protester was killed when an armored police vehicle crushed him to death during anti-Morsi protests Saturday. And, in the restive Suez Canal city of Port Said, a police vehicle ran over five people after marching protesters refused to allow the car through.

Months of such turmoil have scared away tourists and foreign investors, eroding Egypt's foreign reserves by nearly two-thirds of what it was before the uprising. Those reserves, which stand at less than $14 billion, are needed to pay for subsidies that millions of poor Egyptians rely on for survival.

"It is paramount, essential, urgent that the Egyptian economy gets stronger, gets back on its feet and it's very clear that there is a circle of connections in how that can happen," Kerry told business leaders shortly after his arrival. "To attract capital, to bring money back here, to give business the confidence to move forward, there has to be sense of security, there has to be a sense of political and economic viability."

After concluding his meetings in Egypt on Sunday, Kerry will head to Saudi Arabia, the United Arab Emirates and Qatar, where his focus is expected to be the crisis in Syria that dominated his earlier stops in Britain, Germany, France and Turkey, along with concerns about Iran's nuclear program and growing Iranian assertiveness in the Persian Gulf. Kerry is set to return to Washington on Wednesday.

Associated Press

Source: http://hosted2.ap.org/APDEFAULT/cae69a7523db45408eeb2b3a98c0c9c5/Article_2013-03-03-ML-Kerry/id-95034eb6151c4e5ea3a3fa37f34d83da

protandim weightless ellen degeneres jcpenney yeardley love nba all star reserves rock center christine

Britney Spears? Little Sister Jamie Lynn Spears Is Engaged!

Britney Spears’ Little Sister Jamie Lynn Spears Is Engaged!

Jamie Lynn Spears shows off fiance and engagement ringJamie Lynn Spears, 21, announced on Saturday that she is engaged to her boyfriend of three years, Jamie Watson. The singer/actress shared photos of her engagement ring and the happy couple on Twitter with the caption, “Guesssss what?” Spears also shared photos of her 30-year-old boyfriend, now fiance, with her four-year-old daughter Maddie. Jamie Lynn ...

Britney Spears’ Little Sister Jamie Lynn Spears Is Engaged! Stupid Celebrities Gossip Stupid Celebrities Gossip News

Source: http://stupidcelebrities.net/2013/03/britney-spears-little-sister-jamie-lynn-spears-is-engaged/

airhead atherosclerosis steven tyler tropic thunder carnie wilson missing reese witherspoon pregnant

Tuesday, February 26, 2013

Titanic undertaking: Classic ocean liners coming back

Just over a century after the Titanic sank to the bottom of the North Atlantic, an Australian billionaire has officially floated plans to build a successor.

On Tuesday, Clive Palmer, chairman of Brisbane-based Blue Star Line, revealed blueprints for Titanic II, a ?full-scale re-creation? of the illustrious, if ill-fated, ship at a press conference on the Intrepid Air, Sea & Space Museum in New York.

Set to sail in 2016, the ship is one of several ? the QE2 and SS United States are among the others ? that seek, in one or way or another, to recapture the glory days of the great ocean liners and ensure that their legends live on.

First up: Titanic, or more precisely, Titanic II, a modern-day version of the ship that sank on its maiden voyage in April 1912. During today?s press conference, Palmer referred to the original as a ?ship of dreams? and its successor as a ship ?where dreams come true.?

As envisioned, that dream entails building an 883-foot-long, 55,800-ton vessel with space for 2,435 passengers. That?s small by today?s standards ? the Queen Mary 2 measures 151,000 tons; the Oasis of the Seas, 220,000 tons ? but big enough to offer a casino, gymnasium and other features reminiscent of the original.

In other nods to the past, passengers will wear period clothing from 1912 and be able to book passage in first, second or third class.

"It will be 98% the same," Palmer told the BBC last year. Presumably, the other 2% will apply to the welded (not riveted) hull, the modern propulsion system and the addition of enough lifeboats to preclude problems with things that go bump in the night at sea.

While Palmer declined to discuss the cost of the ship, other ocean liner aficionados have expressed doubts about the viability of the project ever since the idea was first floated last year.

?It?s like a Disneyland representation of the Titanic,? said maritime historian Peter Knego. ?You can?t build with wood anymore, you can?t rivet, you can?t do all the things that made the Titanic what she was.?

Nor, says Knego, can you ignore the fact that the vast majority of today?s cruisers prefer ships with waterparks, climbing walls and other resort-style amenities. By comparison, interest in transatlantic crossings, like the ones Titanic II is expected to begin making in 2016, went into sharp decline the moment Pan Am and BOAC began flying jets across the pond in 1958.

?There?s probably a couple thousand people in the world who?d be fascinated by a transatlantic crossing on a replica of the Titanic,? Knego told NBC News. ?It would also have to compete against the Queen Mary 2 and there are times that the QM2 isn?t even full.?

Original ships, alternative uses
While Titanic II seeks to turn back the clock to the glory days of the ocean-liner era, proof that time doesn?t stand still sits, rusting and peeling, at a dock in Philadelphia. Originally launched in 1952, the SS United States was as famous in its day as the Titanic was 40 years earlier but without the morbid associations.

?It?s the most famous ship that didn?t sink,? said Susan Gibbs, executive director of the SS United States Conservancy, which seeks to preserve the vessel. ?It?s still with us and is by many accounts one of the most storied U.S. liners ever built.?

That story, much condensed, goes like this: Entering transatlantic service in 1952, the ship immediately became the unofficial flagship of the U.S. fleet, recognizable for its knife-like bow and red, white and blue funnels. She broke the transatlantic speed record on her maiden voyage and holds the westbound record for fastest passenger service to this day.

?When she was built, she represented the country,? said Knego. ?People were aware of her like they?re aware of the space shuttle now.?

Alas, the subsequent rise of transatlantic jet service essentially killed the market for transatlantic sailings and the ship was taken out of service in 1969. Since then, it?s had several owners, been stripped of its fittings and avoided several dates with the scrapyard.

Since 1996, the ship has sat at the dock in Philadelphia, its hull streaked with rust and its red, white and blue funnels faded to shades of pink and gray. The good news is that the ship is structurally sound and asbestos-free; the bad news is that carrying costs (maintenance, insurance, etc.) average $75,000 per month.

?That?s a heavy lift and one that can?t be borne indefinitely,? said Gibbs, who, it turns out, is the granddaughter of the ship?s designer, William Francis Gibbs. Scrapping the ship remains a threat, ?but everyone involved will work their hearts out to avoid that fate,? she told NBC News.

Those efforts include a grassroots campaign called SaveTheUnitedStates.org and and plans to turn the ship into a waterfront attraction with hotels, retail outlets and a museum dedicated to the ship, 20th century design and the American ingenuity that underscored it.

According to Gibbs, discussions have been undertaken with several municipalities that might host the ship with New York being the most likely venue: ?It was the ship?s homeport during its service career; it attracts a lot of tourists, and it?s a bustling city with high hotel occupancy rates.?

The effort would not come cheap but it?s also not without precedent. The first Queen Mary has been a dockside hotel/tourist attraction in Long Beach, Calif., since the early 1970s, although, it, too, has faced a series of financial setbacks.

More recently, the Queen Elizabeth 2, or QE2, which has been sitting idle in Dubai since 2008, was sold to Oceanic Group, a Singaporean company that plans to turn it into a hotel/attraction in an as-yet-unnamed Asian city.

Given the above, it?s clear that these grand old ships have incredible appeal just as there?s no denying that their futures are marked by ocean-liner-sized question marks. For Clive Palmer, it?s about recapturing the essence of one iconic vessel; for Susan Gibbs, it?s about ensuring that the essence of another isn?t lost forever.

For his part, Peter Knego has his own wish: ?For people who appreciate classic skyscrapers and old movie theaters, scrapping the United States would be like demolishing the Empire State Building,? he told NBC News. ? If only (Palmer) would invest in the ship instead of recreating one that never completed its maiden voyage ...?

Rob Lovitt is a longtime travel writer who still believes the journey is as important as the destination. Follow him at Twitter.

Source: http://www.nbcnews.com/travel/itineraries/titanic-undertakings-can-classic-ocean-liners-make-comeback-1C8543842

diane sawyer Cnn.com Colorado Marijuana Washington Election Results drudge report Presidential Election 2012 Incumbent

Spiderman's webbing would be strong enough to stop a moving train, say physics students

Spiderman's webbing would be strong enough to stop a moving train, say physics students [ Back to EurekAlert! ] Public release date: 25-Feb-2013
[ | E-mail | Share Share ]

Contact: Hannah Tucker
hct16@le.ac.uk
01-162-523-335
University of Leicester

University of Leicester physics students calculate that the strength of Spiderman's webbing is proportional to that of real spiders

In Spiderman 2, the superhero uses his webbing to bring a runaway train to a standstill moments before it plummets over the end of the track. But could a material with the strength and toughness of spiders' web really stop four crowded subway cars? According to University of Leicester physics students, the answer is yes.

A group of three fourth year MPhys students calculated the material properties of webbing needed in these conditions - and found that the strength of the web would be proportional to that of real spiders. Their paper, Doing whatever a spider can, was published in the latest volume of the University of Leicester's Journal of Physics Special Topics.

The journal is published every year, and features original short papers written by students in the final year of their four-year Master of Physics degree. The students are encouraged to be imaginative with their topics, and the aim is for them to learn about aspects of publishing and peer review.

Students James Forster, Mark Bryan and Alex Stone first calculated the force needed to stop the four R160 New York City subway cars. To do this, they used the momentum of the train at full speed, the time it takes the train to come to rest after the webs are attached, and the driving force of the powered R160 subway car. The students found the force Spiderman's webs exert on the train to be 300,000 newtons. They were then able to calculate the strength and toughness of the webs.

They found that the Young's modulus or stiffness of the web would be 3.12 gigapascals. This is very reasonable for spider's silk, which ranges from 1.5 gigapascals to 12 gigapascals in the orb-weaver spiders. The toughness of the silk was calculated as almost 500 megajoules per cubic metre. This is in line with web from a Darwin's Bark Spider - an orb-weaver with the strongest known webbing of any spider.

They conclude that the "friendly neighbourhood" superhero's webbing is indeed a proportional equivalent of that of a real spider and, consequently, it would be feasible for him to stop a moving train.

Alex Stone, 21, from Kingston upon Thames, said: "It is often quoted that spider-webs are stronger than steel, so we thought it would be interesting to see whether this held true for Spiderman's scaled up version. Considering the subject matter we were surprised to find out that the webbing was portrayed accurately."

James Forster, 22, from Wisbech, said: "While our work may not seem to be very serious it has helped teach us about applying physics to varying situations as well as the peer review process through which scientific journals operate. This makes it an invaluable experience to anyone who wants to go into research later in life."

Course leader Dr Mervyn Roy, a lecturer at the University's Department of Physics and Astronomy, said: "A lot of the papers published in the Journal are on subjects that are amusing, topical, or a bit off-the-wall. Our fourth years are nothing if not creative!

"But, to be a research physicist - in industry or academia - you need to show some imagination, to think outside the box, and this is certainly something that the module allows our students to practice.

"Most of our masters students hope to go on to careers in research where a lot of their time will be taken up with scientific publishing - writing and submitting papers, and writing and responding to referee reports.

"This is another area where the module really helps. Because Physics Special Topics is run exactly like a professional journal, the students get the chance to develop all the skills they will need when dealing with high profile journals like Nature or Science later on in life."

###



[ Back to EurekAlert! ] [ | E-mail | Share Share ]

?


AAAS and EurekAlert! are not responsible for the accuracy of news releases posted to EurekAlert! by contributing institutions or for the use of any information through the EurekAlert! system.


Spiderman's webbing would be strong enough to stop a moving train, say physics students [ Back to EurekAlert! ] Public release date: 25-Feb-2013
[ | E-mail | Share Share ]

Contact: Hannah Tucker
hct16@le.ac.uk
01-162-523-335
University of Leicester

University of Leicester physics students calculate that the strength of Spiderman's webbing is proportional to that of real spiders

In Spiderman 2, the superhero uses his webbing to bring a runaway train to a standstill moments before it plummets over the end of the track. But could a material with the strength and toughness of spiders' web really stop four crowded subway cars? According to University of Leicester physics students, the answer is yes.

A group of three fourth year MPhys students calculated the material properties of webbing needed in these conditions - and found that the strength of the web would be proportional to that of real spiders. Their paper, Doing whatever a spider can, was published in the latest volume of the University of Leicester's Journal of Physics Special Topics.

The journal is published every year, and features original short papers written by students in the final year of their four-year Master of Physics degree. The students are encouraged to be imaginative with their topics, and the aim is for them to learn about aspects of publishing and peer review.

Students James Forster, Mark Bryan and Alex Stone first calculated the force needed to stop the four R160 New York City subway cars. To do this, they used the momentum of the train at full speed, the time it takes the train to come to rest after the webs are attached, and the driving force of the powered R160 subway car. The students found the force Spiderman's webs exert on the train to be 300,000 newtons. They were then able to calculate the strength and toughness of the webs.

They found that the Young's modulus or stiffness of the web would be 3.12 gigapascals. This is very reasonable for spider's silk, which ranges from 1.5 gigapascals to 12 gigapascals in the orb-weaver spiders. The toughness of the silk was calculated as almost 500 megajoules per cubic metre. This is in line with web from a Darwin's Bark Spider - an orb-weaver with the strongest known webbing of any spider.

They conclude that the "friendly neighbourhood" superhero's webbing is indeed a proportional equivalent of that of a real spider and, consequently, it would be feasible for him to stop a moving train.

Alex Stone, 21, from Kingston upon Thames, said: "It is often quoted that spider-webs are stronger than steel, so we thought it would be interesting to see whether this held true for Spiderman's scaled up version. Considering the subject matter we were surprised to find out that the webbing was portrayed accurately."

James Forster, 22, from Wisbech, said: "While our work may not seem to be very serious it has helped teach us about applying physics to varying situations as well as the peer review process through which scientific journals operate. This makes it an invaluable experience to anyone who wants to go into research later in life."

Course leader Dr Mervyn Roy, a lecturer at the University's Department of Physics and Astronomy, said: "A lot of the papers published in the Journal are on subjects that are amusing, topical, or a bit off-the-wall. Our fourth years are nothing if not creative!

"But, to be a research physicist - in industry or academia - you need to show some imagination, to think outside the box, and this is certainly something that the module allows our students to practice.

"Most of our masters students hope to go on to careers in research where a lot of their time will be taken up with scientific publishing - writing and submitting papers, and writing and responding to referee reports.

"This is another area where the module really helps. Because Physics Special Topics is run exactly like a professional journal, the students get the chance to develop all the skills they will need when dealing with high profile journals like Nature or Science later on in life."

###



[ Back to EurekAlert! ] [ | E-mail | Share Share ]

?


AAAS and EurekAlert! are not responsible for the accuracy of news releases posted to EurekAlert! by contributing institutions or for the use of any information through the EurekAlert! system.


Source: http://www.eurekalert.org/pub_releases/2013-02/uol-sw022513.php

Magic Mike Anderson Cooper Gay NBA draft 2012 alicia sacramone Don Grady ann curry euro 2012

Afghan president orders US troops out of volatile province on Kabul's flank

President Hamid Karzai has asked US Special Forces to leave Wardak Province, raising concerns about how security might be affected in Afghanistan's capital city.

By Paige McClanahan,?Correspondent / February 25, 2013

Afghan President Hamid Karzai speaks during a press conference at the presidential palace in Kabul, Afghanistan, last month. The Afghan government?s announcement, which was made on Sunday, ordered US Special Forces to immediately cease operations in Wardak Province and to entirely leave the area within two weeks.

Ahmad Jamshid/AP

Enlarge

The Afghan government has demanded that US Special Forces leave a strategic province that lies just to the west of Kabul, claiming in a written statement that American soldiers operating in the region have been ?torturing and even murdering innocent people.? The US-led coalition denies the claims.

Skip to next paragraph

' + google_ads[0].line2 + '
' + google_ads[0].line3 + '

'; } else if (google_ads.length > 1) { ad_unit += ''; } } document.getElementById("ad_unit").innerHTML += ad_unit; google_adnum += google_ads.length; return; } var google_adnum = 0; google_ad_client = "pub-6743622525202572"; google_ad_output = 'js'; google_max_num_ads = '1'; google_feedback = "on"; google_ad_type = "text"; google_adtest = "on"; google_image_size = '230x105'; google_skip = '0'; // -->

The Afghan government?s announcement, which was made on Sunday, ordered Special Forces from the United States ? but not necessarily other countries ? to immediately cease operations in Wardak Province and to entirely?leave the area within two weeks.

In a press conference following the release of the statement, Aimal Faizi, the spokesman for Afghan President Hamid Karzai, suggested that Afghan nationals working with US Special Forces were thought to have committed the violent acts against civilians, not necessarily American soldiers themselves. But the order for US Special Forces to withdraw from Wardak remains intact.

Given Wardak?s proximity to Kabul, the prospect of an American departure from the province has raised concern about how security might be affected in the capital city. Just hours before the Afghan government?s announcement Sunday, Afghan security forces shot dead a suicide bomber who was targeting an intelligence agency office located in Kabul?s diplomatic quarter. Coordinated suicide bombs in two other eastern cities killed three and injured seven within hours of the foiled Kabul attack.

?This decision will have a huge impact on the security situation in Kabul,? says Waliullah Rahmani, a security analyst with the Kabul Center for Strategic Studies. ?Wardak is one of the most volatile provinces. It is a center for the insurgency, which is mainly focused on Kabul.... I don't know why the Afghan president has come to reach such a risky decision.?

The Afghan government cited two examples of alleged abuses by US Special Forces, including one in which nine people ?were disappeared? and another in which a student was taken from his home and found dead two days later, his throat slit. Such episodes have generated ?resentment and hatred? among the people living in Wardak Province, a government statement said.

Coalition disputes claims

The US-led coalition says that such claims are unfounded.

?We looked into the allegations and found no supporting evidence for them,? Brig. Gen. G?nter Katz, a spokesman for the International Security Assistance Force (ISAF), told a press conference in Kabul on Monday morning.

?Afghan officials and ISAF officials are planning talks to discuss the allegations of wrongdoing that were announced yesterday,? he added. ?ISAF takes all allegations of misconduct seriously.??

Wardak Province is a mountainous region whose eastern border lies just 25 miles to the west of Kabul. The province has been the scene of a number of insurgent attacks since the Taliban gained control of Wardak?s remote Tangi Valley nearly two years ago.

The Taliban shot down a US military helicopter in Wardak in August 2011, killing 38 US and Afghan soldiers. An American woman and her Canadian husband disappeared from the region in October of last year; they haven?t been heard from since.?

Whether or not US Special Forces leave Wardak within two weeks, they will almost certainly be out of the province by the end of 2014, in accordance with international plans to withdraw foreign troops and allow Afghan forces to take control of the country?s security.

Speaking to reporters on Monday, Brigadier General Katz stressed that those plans are still moving ahead.

?The [Afghan National Security Forces] are doing very well in pressuring the insurgency,? Katz said. ?The transition process is very well on track and the Afghans are fighting well.?

To the people of Wardak, the transition may not come soon enough.

?The US Special Forces have made things more dangerous here,? Saeed Hashem, a pharmacist, said by phone from Wardak, adding that many people in the region are afraid to leave their houses for fear of potential attacks. ?The Afghan forces should take over control,? he said. ?When that happens, we will be able to defeat the Taliban and the other enemy groups, and Wardak will be safe.?

Source: http://rss.csmonitor.com/~r/feeds/csm/~3/I8N4N3Zg1-U/Afghan-president-orders-US-troops-out-of-volatile-province-on-Kabul-s-flank

suzanne somers colbert colbert report legionnaires disease underwear bomber unclaimed money godspell

Sunday, February 24, 2013

Andy Samberg Recycles MTV Movie Awards Jokes As Indie Spirits Host

'Exact same jokes. They aged well,' the 'SNL' alum tells MTV News of mining his 2009 hosting gig for Saturday's show.
By Kevin P. Sullivan, with reporting by Josh Horowitz


Andy Samberg attends the 2013 Indie Spirit Awards
Photo: Getty Images

Source: http://www.mtv.com/news/articles/1702497/andy-samberg-2013-indie-spirit-awards.jhtml

Ronda Rousey PS4 Google Glass Cecil Hotel Cressida Bonas Kenny Clutch Edward Gorey

Custom Timer Jobs of Copying List Items to Database using Entity Framework


In this article we can try creating a custom Timer Job in SharePoint.? The tools we are going to use are following:

?? Visual Studio 2010
?? SharePoint DevTools from CodePlex

We can start with analysing what is a Timer Job.

What is a Timer Job?


A Timer Job is a periodically executed task inside the SharePoint Server.? It allows us by providing a task execution environment.



For example we can execute tasks like: Sending Emails on every hour, Data Updating on every day, creation of reports on every week etc.

Default Timer Jobs inside SharePoint


There are many Timer Jobs inside SharePoint which do the internal tasks like:
?? Sending emails
?? Validating sites
?? Delete unused sites
?? Health analysis
?? Product versioning
?? Diagnostics
These tasks will be having execution periods like:
1.? Minute
2.? Hour
3.? Day
4.? Week
5.? Month

Manage Timer Jobs


You can see the Timer Jobs from Central Administration > Monitoring > Manager Timer Jobs


Following is the list of some Timer Job Definitions:


You can select each Job Definition and change the schedule or disable it.

Creating a Custom Timer Job Definition


Now we are ready with the basics to proceed with creating a Custom Timer Job.

Scenario


We have a list named Products which is custom template.? Any new product arriving has to be posted to an SQL Server database so that the company website can show it to potential customers.

So the activities involved are the following:

1.? Create Products List inside SharePoint
2.? Create Product Table inside Database
3.? Create the Timer Job Definition
4.? Create Event Receiver
5.? Create the Database Insert Method
6.? Deploy the Timer Job
7.? View the Results

Step 1: Create Products List inside SharePoint

Here is the List Definition: (the list template with data is attached with the article)


You can see that the core columns of the list are:

Column
Description
Title
The name of the Product
Description
About the Product
Price
The price of the Product



The HasPosted column determines whether the item is copied to the Products database.?

After installing the list from template you will can see it is having 2 items:


Step 2: Create Product Table inside Database

Now we need to create the destination database and table.? Following is the table definition.? (the table sql is attached with the article)


Step 3: Create the Timer Job

In this step we can go ahead and create the Timer Job.? For this you require Visual Studio 2010 and the SharePoint templates installed.

Open Visual Studio and create a new Empty SharePoint Project as shown below:


In the next page select your server and use Deploy as Farm solution option:


Click the Finish button after entering the options.

Now add a new class and derive it from SPJobDefinition as shown below.

using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using Microsoft.SharePoint.Administration;
 
 namespace SPTimerJobExample
 {
     public class ProductsJobDefinition : SPJobDefinition
     {
     }
 }

Now replace the above file with the following content.

using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using Microsoft.SharePoint.Administration;
 using Microsoft.SharePoint;
 
 namespace SPTimerJobExample
 {
     public class ProductsTimerJob : SPJobDefinition
     {
         public ProductsTimerJob()
             : base()
         {
 
         }
 
         public ProductsTimerJob(string jobName, SPService service, SPServer server, SPJobLockType lockType)
             : base(jobName, service, server, lockType)
         {
             this.Title = "Products Timer Job";
         }
 
         public ProductsTimerJob(string jobName, SPWebApplication webapp)
             : base(jobName, webapp, null, SPJobLockType.ContentDatabase)
         {
             this.Title = "Products Timer Job";
         }
 
         public override void Execute(Guid targetInstanceId)
         {
             SPWebApplication webapp = this.Parent as SPWebApplication;
             SPContentDatabase contentDb = webapp.ContentDatabases[targetInstanceId];
 
             SPList list = contentDb.Sites[0].RootWeb.Lists["Products"];
 
             CopyItems(list);
         }
 
         private void CopyItems(SPList list)
         {
             foreach (SPListItem item in list.Items)
             {
                 bool hasPosted = (bool)item["HasPosted"];
 
                 if (!hasPosted)
                 {
                     new DbManager().Insert(item);
 
                     item["HasPosted"] = true;
                     item.Update();
                 }
             }
         }
     }
 }

The above code is performing the following activities:

1.? Get the list of items from Products where HasPosted is false
2.? Insert the Product into Database
3.? Mark the item HasPosted to true

We need to include the DbManager class file and will be done in the upcoming step.

Step 4: Create Event Receiver

Now we have to create an event receiver which performs the installation or uninstallation of the Job Definiton.

In the Solution Explorer right click on Feature and use the Add Feature item.

In the appearing dialog change the title to Products Job Definition and the Scope to Site

Now right click on the Solution Explorer > Feature 1 and click Add Event Receiver

Inside the class content of Feature1.EventReceiver.cs place the following code.

??

 const string JobName = "Products Timer Job";
 
         public override void FeatureActivated(SPFeatureReceiverProperties properties)
         {
             SPSite site = properties.Feature.Parent as SPSite;
 
             DeleteJob(site); // Delete Job if already Exists
 
             CreateJob(site); // Create new Job
         }
 
         private static void DeleteJob(SPSite site)
         {
             foreach (SPJobDefinition job in site.WebApplication.JobDefinitions)
                if (job.Name == JobName)
                     job.Delete();
         }
 
         private static void CreateJob(SPSite site)
         {
             ProductsTimerJob job = new ProductsTimerJob(JobName, site.WebApplication);
 
             SPMinuteSchedule schedule = new SPMinuteSchedule();
             schedule.BeginSecond = 0;
             schedule.EndSecond = 5;
             schedule.Interval = 5;
 
             job.Schedule = schedule;
             job.Update();
         }
 
         public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
         {
             DeleteJob(properties.Feature.Parent as SPSite); // Delete the Job
         }

You need to add the using as well:

using Microsoft.SharePoint.Administration;



Step 5: Create the Database Insert Method

In this step we can complete the DbManager class file.? Here we are using Entity Framework associated with .Net 3.5 version.

For this add a new Entity Data Model into the project and map to the Product table which we have created in previous step.


Now create a class file named DbManage.cs and replace it with the following content.


using System;
 
 namespace SPTimerJobExample
 {
     public class DbManager
     {
         public void Insert(Microsoft.SharePoint.SPListItem item)
         {
             using (ProductionModel context = new ProductionModel(GetConnectionString()))
             {
                 Product product = new Product();
                 product.Title = item["Title"].ToString();
                 product.Description = item["Description"].ToString();
                 product.Url = item["Url"].ToString();
                 product.Price = (double)item["Price"];
                 product.PostedOn = DateTime.Today;
 
                 context.AddToProducts(product);
 
                 context.SaveChanges();
             }
         }
 
         public string GetConnectionString()
         {
             string connectionString = new System.Data.EntityClient.EntityConnectionStringBuilder
             {
                 Metadata = "res://*",
                 Provider = "System.Data.SqlClient",
                 ProviderConnectionString = new System.Data.SqlClient.SqlConnectionStringBuilder
                 {
                     InitialCatalog = "YOUR-DB-NAME-HERE",
                     DataSource = @"YOUR-SERVER-NAME-HERE",
                     IntegratedSecurity = false,
                     UserID = "YOUR-USER-ID-HERE",   
                     Password = "YOUR-PASSWORD-HERE",          
                 }.ConnectionString
             }.ConnectionString;
 
             return connectionString;
         }
     }
 }

The above code contains the Insert() method to insert new record into the Product table.

For the time being I am hard coding the connection string.? You need to specify the correct user credentials in the GetConnectionString() method.

Note: Please note that the connection string is loaded from the executing application's configuration file.? In the case of Timer Jobs the configuration file will be OWSTIMER.exe.config residing in the 14hive folder.

Step 6: Deploy the Timer Job

Now we are ready to deploy the Timer Job into the SharePoint Site.? For this right click on the solution and click the Deploy option.

If you get the Deploy Succeeded message we are good.

Step 7: View the Results

Now we can go to the Central Administration to see our Timer Job.? For this open Central Administration web site and go to Monitoring > Review Job Definitions


On clicking the Review Job Definitions link you can see our item as shown below:


Click on the item and in the appearing page click the button Run Now


You can see that the Timer Job is set for 5 Minutes according to our code.

Now we can go back to the Products list and see that the HasPosted is set to True.


Going to the SQL Server Table we can see both the records are inserted there.

?


Troubleshooting Tips

While developing timer jobs, you might need to delete the assembly and feature as well.? Please note the following points for troubleshooting guidance:

?? Features are deployed to the 14hive folder
?? The assembly gets deployed to GAC folder
?? You can use RETRACT option from? Visual Studio
?? You can use GACUTIL to uninstall the assembly
?? You can remove the Feature from 14hive folder

For troubleshooting the Farm Solutions or User Solutions you can use:

?? Central Administration > System Settings > Manage Farm Solutions
?? Central Administration > System Settings > Manage User Solutions


You can Retract or undo the last Retract schedule there.

For checking the Job Status or History you can use:

?? Central Administration > Monitoring >? Check Job Status > Timer Job Status
?? Central Administration > Monitoring >? Check Job Status >? Timer Job History

These screens will show the Success / Failure status of the jobs and any errors associated.? For example an invalid connection string problem is identified as shown below:


Debugging Tips



In some cases the Timer Service hold the old version of assembly.? So the new changes you have done through Visual Studio may not get reflect immediately.? You can change the assembly version and view the GAC to ensure the correct version was deployed.


Plus you can restart the SharePoint 2010 Timer Service from services.msc


Note: In the case of Integrated Security as True in connection strings, the authenticated user would be the Service Account user assigned in the service.

References


Technet on Timer Jobs
Code on Timer Jobs
Solution Removal using PowerShell

Summary


In this article we have explored the Timer Job feature of SharePoint and creating a custom timer job. ?Following are the key points to be remembered:

?? Timer Jobs can be scheduled for automating jobs inside SharePoint 2010
?? SPJobDefinition is the base class for Timer Job
?? Create Event Receiver Feature to create or delete the timer job
?? SPFeatureReceiver is the base class for event receiver
?? The feature gets deployed in the 14hive folder
?? OWSTIMER.EXE is the process executing Timer Jobs

The associated source code along with the list template with data is attached.? You can download and try running it.

Source: http://feedproxy.google.com/~r/DotNetSparkArticles/~3/Vp-ppQeCWhQ/5351-custom-timer-jobs-copying-list-items-to.aspx

breaking dawn part 2 trailer mississippi state chris carpenter chris carpenter dick cheney hcg drops reason rally