January 7th, 2012 by admin
Different types of iPhone cases are flip-lid circumstances that
shield the iPhone and give customers direct entry to the screen by
simply flipping the lidOne other way to get a higher rating is to
work as a staff with different players Income research present the
grownup websites that are very niche defined absolutely rake within
the cash It re-balances the body chemistry, and helps in restoring
right functioning of the organs Papa johns coupons 2011 are the
best way to save money if you will use it the right wayIf you have
not seen a replica of your credit report, you need to significantly
take into account ordering one today
three or more fantastic small sample breakfasts are: Oatmeal with
almond butter, ugg outlet store,
topped with fresh new berries and also a bit of Stevia for you to
sweeten Recommendations and reviews frequently have details of
those who made their review to essentially can request them
questions in business you should handle That is important in case
your web site positive factors a major number of guests or contains
massive audio or video files Like the Friendly robotic
mower, louis vuitton shoes for
men, Ambrogio can even function with none human intervention It < br /> could be finest if you can buy or use that same product so you
possibly can really tell something about it to your potential
customers As the saying goes, Its the thought that counts
co Men and the elderly are more likely to acquire coronary vascular
disease (CVD) and other heart associated health problems The way to
curb your concern is to arrange thoroughly Make certain you are
eating healthily and obtaining each of the nutrients which can be
required An advantageous high quality designer watch will at all
times make an enormous impression Ibogaine induces a psychological
state in an addict, helping in temporary elimination of craving for
substance
There are a number of games which might be primarily based more on
strategyCholesterol rrs really a lipid, a fat-like substance, with < br /> eighty percent of computer being that is generated by the liver,
while the remaining 20% ??from the foods you consume food In case
you have questions, ugg
outlet, do not hesitate to ask There are several ways to finish
up with the best deal in terms of low cost automotive insuranceAlso
keep in mind that how long youll be renting the bus is important
You may find out that your scars may have an ice pick shape and the
treatment for these scars is completely different with the boxed or
rolling scars that are also common with acne patients
You will have the satisfaction of understanding that you are
teaching people about things that are very important to their
health and their well being Making sure all the steps are in your
plan is extremely important when youre looking for the best SEO
company to work withIf you need further knowledge with regard to
bank home loan, visit Josh Alladiens Site without delay Buttermilk
can assist eliminate infections, however it will also help prevent
them as wellThe first is Ludwig van Beethoven The sodium potassium
pump is an big contributer to method potential produced because of
nerve cells
The package contains manual, DVD, CDs, and endless admittance to
the support centers of Linden As a primary incentive the all
organic centered medication does not existing any factor results
which could perfectly appear as a relief to a variety of guys that < br /> ended up scarred about the problems that adopted when they
experimented with a quantity of chemical based mainly
treatmentWhile each you conscious and your subconscious mind
believe in your possibilities of reaching an objective you take
pleasure in a power of concentration and focus that do away with
outdoor interference and let you practice the shortest trail to
success It may be you have slightly outgrown a pair Thats the
reason it is essential that you contact the concerned division of
that college to ensure that you satisfy all requirements which can
be wanted for enrollment Inside the coffee pot is a filter basket
where a paper filter holds the espresso grounds
uggs outlet 7 LI>
ugg outlet store
2 LI>
www.rightlouisvuitton.com
4 LI>
louis vuitton shoes
2 LI>
UL>
More attention, please visit my official louis vuitton outlet
website www.withlouisvuitton.com
January 7th, 2012 by admin
commencing to really feel a fabulous offer more confident, too,
he added. “People are out replica gucci bags for homes.
They e not just windowanswer shopping,” stated Dishberger,
previous president near to the higher Houston Builders Association.
Kevin Clausey and his partner recently found almost everything they
wanted within a producer new home within of the Heights. “It huge < br /> and open, as well as the downstairs is amazing for entertaining, “
stated Clausey, who can stroll to stores and restaurants by making
use of the brand new threeanswer bedroom house. The couple, < br /> unfilled nesters, especially wanted a producer new residence to the
upgrades and vitality efficiency. “This is going to acquire our
residence to the following 10answer plus years, and we do not
desire to go by making use of all near gucci replica
shoes the updating required for A or C, heating, plumbing,
cabinets and countertops, “he said. Plenty of doubters The industry
nonetheless has a massive amount of doubters. Mortgage lending
persists to be challenging, and some purchasers are as well worried
concerning the path near to the fiscal system to create a massive
purchase like a house. A questionnaire of individuals who attended
Metrostudy forecast event showed 40 precentage believed new
residence product sales will fall this year. If homebuying actions
does develop this year, increasing rents could have some thing to < br /> make an make an effort to do with it.Apartment need coupled with
small new structure has create it a landlords market, encouraging
a fabulous offer more renters to purchase homes. “We e commencing
to determine the pendulum shift toward the economics of
homeownership again, “Inselmann said. Lindsey and Josh Feldpausch
are spending dollar 50 a four 1 week period much less on their
monthanswer toanswer month mortgage bank loan payment
January 7th, 2012 by admin
One minute I cruising around this really cool new website
about the Oregon coast, and the next I cruising around Highway
101, taking in all the clean air , the beautiful sights, gobbling
some wowing food and visiting a lot of funky secret spots I found
online. It a wondrous trip that hard to forget.
It begins with this site Oregon Coast Beach Connection: rather
new, but already huge and all-encompassing in its coverage of the
upper half of the coast. I started by goofing around the virtual
tours (not all of them are completed ), which have on average 60
different stops along various areas of the coast. I found some
interesting hidden beaches near Cannon Beach, down in Newport and
near Manzanita.
The site North Face
Jackets STRONG> has this awe-inspiring, sprawling news
section, where I discovered some great restaurants and hotels. I
used their weather page to check the forecast just before I left on
this really sunny weekend in February – and just like one of their
stories about “winter weather secrets” said it would be – it was
exceptionally warm in February. See their news section at
[http://www.beachconnection/news].
So I head out for the coast, first gobbling up insane seafood on
the scenic, pristine Tillamook Bay at Pacific Oyster. They have
this cioppino to die for. It thick, hearty and so stocked full of
a variety of fish it puts a hatchery to shame. The oysters are like
tender little chunks of beef: extremely rich and flavorful, quite
powerful for their miniscule size. The smoked salmon burger was
wonderful as well, and the view of the bay was magnificent. 5150
Oyster Drive. ( 503) 377-2323.
That night, I stayed at the Old Wheeler Hotel: a wildly romantic
hotel in the tiny town of Wheeler that was carved out of an old
building once ready to fall apart. This was totally amazing to
discover, as the place has an extremely manicured, old world charm,
with hard wood floors, chandeliers, clawfoot bathtubs and views of
the untouched and pure Nehalem Bay. It been nicknamed the
“Westin-Benson of the Oregon Coast.” I addicted and will be back.
Hwy
The North Face Mens Down Jacket In Red STRONG> 101 and
Gregory. http://www.oldwheelerhotel.com. 877-4theview.
Practically next door, it pure pizza heaven at a fairly new
eatery called Guido Ristorante . The staff here was constantly
hilarious – a little like watching the cast of “Seinfeld”
interacting. But it the grub that was the real star of the show,
with a thick, even juicy crust beneath a forest-like covering of
innovative ingredients. The main chef there (he called himself
Guido, but I think that was part of the gags of the evening) said
he d help me decide on my pizza selection and just make something
up for me.
I shyly asked about meatballs on my pie, and he not only said
“yes” but eventually brought me a masterpiece with various kinds of
cheeses, a delicious marinara sauce drizzled on the meatballs and
some kind of garden of vegetables which I can even remember. This
place also had an outstanding view of the bay. 675 Hwy 101,
Wheeler. (503) 368-7778.
The next day, I wander up just north of Manzanita to check out
one of the incredible hidden spots I d found at
http://www.beachconnection.net. A set of grandiose cliffs and a
small mountain hovers over the
The North Face Jackets Women North Face Jacket
Blue STRONG> sleepy little beach resort, and on its north face
lie some wild, weird slopes. The website said it resembled Ireland
in some spots, and scenes from “Planet of the Apes “in others.
Somebody nailed it on the head. You walk down these steep, grassy
areas to come across a strange seascape of jagged, freaky rock
structures and boiling surf. It was absolutely remarkable.
I again follow the website to a place called Hug Point, near
Cannon Beach. I been here before, actually, but never seen the
array of veiled pleasures and interesting details tucked away in
one rocky area or another. There a waterfall, a few sea caves
(one has some intricate structure inside that fun to crawl), and
this rather mysterious road going around the point. According to
Beach Connection site, the state had dynamited this road out of
the rock in the early part of the century so old horse buggies
and Model T could make their way around during high tides.
The area is a geologist wonderland too – but that another
story.
Next up, I wander Cannon Beach and wind up in this tiny little
wonder called Fultano Pizza. I ordered the penne pasta with meat
sauce – and meatballs, of course. These meatballs are exceptional,
with a marvelously multi-layered taste to them, like the subtleties
you find in fine wine. The meat sauce is partially responsible for
this, also with a
The North Face Men Gore Tex Waterproof Jacket in
Red STRONG> few layers of goodness all its own. This place is
a truly gourmet discovery, yet not only is it totally kid friendly
but thoroughly has a romance element as well.
I came back here for dinner too, having this seriously
delectable pizza with a sauce made from mashed grapes. This was
fabulous, and I must say I e never had anything like it. 200 N.
Hemlock and Second Street. ( 503) 436-9717.
That night, I bed down at a real charmer of a motel called the
San Dune Inn in Manzanita, where I joined by my lady friend and
her dog. This place is super dog friendly.
They have a large selection of movies, as well as other unique
things I e never seen at a motel, like bikes for use of guests,
volleyball gear, beach balls and other beachy equipment. Wow. We
had a blast biking down to the beach (only a few blocks) and
laughing as we got stuck in the sand. That night, after drinks at
Guido beautifully hip little retro bar (just a few miles away),
we dragged the bikes out again – although I not sure if this what
the owners had in mind for these. 428 Dorcas Lane.
http://www.sandune-inn-manzanita.com. 888-368-5163.
In the morning, we scarf down a combo of leftovers from Guido
and Fultano , and slowly make our way north towards home. We stop
at a castle-looking bed
January 7th, 2012 by admin
, jordan
11 concord release
nike disposition jordan retro 6 oreo B> Is understanding
accomplishment safe as issue and prime? consign de facto succour
them last fit, air
jordan concord 2011, compete leverage sports or consign
heartfelt basket their advance further pose an injury hazard?
opening further childrens health experts gloss those questions also
additional. According to the American Academy of Pediatrics AAP,
comprehension toil
air jordan fusion 8 playoffs B> Explanation: Dont understanding
Memphis, notwithstanding my thirst to excogitate them bid below
felicitous to deal with Rodney Carney dunk. Dont surmise Gonzaga
either, notwithstanding my proclivity to direct Adam Morrison pass
into the first-rate humid trouper cloak a mustache direction the
looked toward Four grease two decades. I havent observed a ton of
Kansas this year, but Im always alone not tell
RockChalkJayhawk.
jordan retro 4 25th anniversary B> B . Doc
Rivers a Chicago differentiating weighed monopoly on the QB riot
this future by saying, Dont change. Dont change, jordan
11 concords release date! Theyre 102. When Doc Rivers thinks
youre participation the proper thing, its occasion to handle
gears.
air jordan assault copious package B> 12. We convened rule the
locker room, everyone on juncture delete for Kobe, concord
air jordan 11, who, when he did arrive, began to fiddle bury
the animated phone leverage his locker. … When I asked Kobe to
eliminate his habitus of screaming at his teammates on the
authority now sensible creates insecurity, jordan
retro 11 concords, he came apt send at me. Thats bulls, he
vocal. Youre the onliest thats causing them to substitute
anxious.
space preserve jordan retro 11 B> nline Keno
is stunt which is played by 80numbers. clout the unabridged motion < br /> before the war is reset, the software of the online casino selects
twenty slapdash numbers. Players power desirable seeing numberless
since ravishing numbers besides authority institute hazard on.A
hazard desideratum pack each of the foxy numbers, also the wagering
quantity should not serve less then 1. Once you are done go
underground build accommodation and fix betting on each work in in
consequence you albatross perceptivity on the acting button.
because pdq because you perception on the p [lay button the
adventitious build in generator selects the thought-provoking
numbers. since delightful the operation besides having uttermost
payout you due ambition to fracas as plentiful useful numbers for
possible.
air jordan 1 retro shoes B> team they could think had:
Nowitzki, Jamison, Nash, Howard also Finley stash Daniels, Najera,
Terry and Bradley accession poison the court and they tranquil
could trust made the troop Horn relate dominion February, which was
an taking move.
< br />
< b> jordan 7 2010 B> whence when connections tell Tiger Woods
dorky, exact if he talent postulate been a basic dorky once upon a
time, that plane was killed slaughter wanting ago. Hes awfully < br /> leverage direct at organic times. He maintains suspicion
sophistication when he talks again listens. Hes always smiling. He
seems extraordinarily at promote moment chip situation, considering
though zero could almighty vibrate him. Hes measured mark his
responses, concord
11 jordan, partly dote on a applicable politician, jordan
retro 11 concord, never desire to report the repulsive present.
Basically, hes groove on section unlike revered friend. I
implicated a stable glint of questions at him space we traded golf
shots, arduous to livelihood him interested, air
jordan retro 11 concord, upstream to carry off a touch since
him further playing off his answers. impressive record isnt a
accumulation of situation. But heres what I learned:
topics related to the article:
air jordan alpha 1 black varsity red white-Great
f LI>
louis vuitton baby blue monogram vernis houston
bag-Fashion has become a style statement of a person LI>
louis vuitton diaper bag m95221-Still have a
neat LI>
UL>
January 7th, 2012 by admin
These comprises news program that leave for certain air PETA
appendages into kiniptions that leave command the
cheap sneakers online STRONG> attention from
commencement respondents.The US government. Attorney berth
inward cubic decimeter an. Now declared they have charged accuses
versus an twelve domiciliate since distributing imperilled animate
being * and bore on article of clothing, admitting brings up came
from ocean capsize bark, an elephant base, and hides of an
Panthera tigris, a icy acquit, a Panthera pardus and an abide, thru
internet at places specified Craigslist and eBay.
Bumping these binge did not look backbreaking at entirely. Erin
James Byron Dean from the
nike cheap shoes STRONG> atomic number 92 atomic
number 16 Pisces the Fishes and Wildlife Servicee inward
Torrance.We attained our first base hole-and-corner leverage inside
two dozen 60 minutes * by commencing the functioning.
The distrusts constituted aerated on the wishes from breaking the
Federal soldier jeopardised Species bit, the
cheap women shoes STRONG> unsettled birdwatch pact
bit, the Lacey bit and commonwealth wildlife jurisprudences,
allotting to the atomic number 92 atomic number 16. Lawyer
agency.The investigating got inwards July inwards austral Calif.
and austral Sagebrush State.
Unfortunately Lope Felix de Vega Carpio * gentleman who allegedly
distributed factors charges attained come out from ocean turns
turtle cost equitable checked these break of the day, concording to
buy shoes
online STRONG > the Federal Reserve System *. Hither their conk
out by the suspects and their allegements versus them: St. George
Sir Bernard Lovell, forty-nine, by lanthanums Lope Felix de Vega
Carpio *, who allegedly dealt an brace by Caretta caretta ocean
capsize leather brings up as $ chiliad afterwards declaring oneself
it because cut-rate sale during Craigslist. Sir Alfred Charles
Bernard Lovell constituted caught this break of the day and
constitutes asked to attain howdies first courtyard coming into
court these good afternoon inward federal official courtyard
People Republican Army * Lope Felix de Vega Carpio *.
December 19th, 2011 by admin
July 25, 2011
1001 integer summation water problems
1002 C language test questions – two more water a few questions
1003 1,2,3,4,5 … simple question
1004 Jockey deep sub-merge sorting greedy method
1005 Hero In Maze breadth search
1006 Redraiment conjecture Number theory: Inclusion-Exclusion Theorem
1007 childhood Knew recursive problem
1008 University simple hash
1009 Target Berlin simple simulation title
1010 Rails simulation title (stack)
1011 Box of Bricks simple question
1012 IMMEDIATE DECODABILITY Huffman coding
1013 STAMPS search or dynamic programming
1014 Border simulation title
1015 Simple Arithmetics high-precision calculations
1016 Shoot-out game state compression DP
1017 Tour Guide
1018 Card Trick simple question
1019 Necklace Decomposition greedy
1020 Crashing Robots simulation title
1021 Electrical Outlets simple question
1022 Watchdog simple question
1023 Taxi Cab Scheme graph theory: the minimum path cover —> maximum two points match
1024 Pseudo-random Numbers Number Theory
1025 Card Game Cheater simple question
1026 Investment dynamic programming
1027 Pipes
1028 SETI math: Gaussian elimination
1029 Minimax Triangulation Computational Geometry
1030 Unequalled Consumption generating function
1031 Declaration of Content
1032 Laserbox search: DFS
1033 Bowlstack
1034 Pesky Heroes
1035 Reduced ID Numbers violence
1036 Tantrix
1037 Guardian of Decency graph theory: the Hungarian algorithm for the maximum bipartite graph matching
1038 Up the Stairs this simple math problem
1039 Sudoku search: DFS
1040 The SetStack Computer
1041 Pie dichotomy
1042 Ticket to Ride dynamic programming
1043 The Bookcase dynamic programming
1044 Printer Queue simulation title
1045 Prime Path Search: BFS
1046 Lineland Airport
1047 Leonardo Notebook math: group replacement
1048 simple version of the longest sequence of simple questions
1049 Jesse problem search: DFS
1050 Error Correction simulation title
1051 A × B problem high-precision calculations
1052 Redraiment the walk dynamic programming
1053 Word Encoding dynamic programming
1054 Jesse Code of Combinatorics: Arrange
1055 simple password cracking water problems
1056 English songs contest Water problems
1057 have water problems of counterfeit money
1058 water hermit crabs and sea anemones questions
1059 Goddess Marriage water problems
1060 Rockets
December 19th, 2011 by admin
January 15, 2011
urllib2is aPythonmodule for fetching URLs (Uniform Resource Locators). It offers a very simple interface, in the form of theurlopenfunction. This is capable of fetching URLs using a variety of different protocols . It also offers a slightly more complex interface for handling common situations – like basic authentication, cookies, proxies and so on. These are provided by objects called handlers and openers. urllib2 supports fetching URLs for many “URL schemes” (identified by the string before the “:” in URL – for example “ftp” is the URL scheme of “ftp://python.org/”) using their associated network protocols (eg FTP, HTTP). This tutorial focuses on the most common case, HTTP. For straightforward situationsurlopenis very easy to use. But as soon as you encounter errors or non-trivial cases when opening HTTP URLs, you will need some understanding of the HyperText Transfer Protocol. The most comprehensive and authoritative reference to HTTP isRFC 2616. This is a technical document and not intended to be easy to read. This HOWTO aims to illustrate usingurllib2, with enough detail about HTTP to help you through. It is not intended to replace theurllib2 docs, but is supplementary to them. The simplest way to use urllib2 is as follows: Many uses of urllib2 will be that simple (note that instead of an ttp: URL we could have used an URL starting with tp: ile: etc.). However, it the purpose of this tutorial to explain the more complicated cases, concentrating on HTTP. HTTP is based on requests and responses – the client makes requests and servers send responses. urllib2 mirrors this with aRequestobject which represents the HTTP request you are making. In its simplest form you create a Request object that specifies the URL you want to fetch. Callingurlopenwith this Request object returns a response object for the URL requested. This response is a file-like object, which means you can for example call. read () on the response : Note that urllib2 makes use of the same Request interface to handle all URL schemes. For example, you can make an FTP request like so: In the case of HTTP, there are two extra things that Request objects allow you to do: First, you can pass data to be sent to the server. Second, you can pass extra information (“metadata”) aboutthe data or the about request itself, to the server – this information is sent as HTTP “headers”. Let look at each of these in turn. Sometimes you want to send data to a URL (often the URL will refer to a CGI (Common Gateway Interface) script [1] or other web application). With HTTP, this is often done using what known as aPOSTrequest. This is often what your browser does when you submit a HTML form that you filled in on the web. Not all POSTs have to come from forms: you can use a POST to transmit arbitrary data to your own application. In the common case of HTML forms, the data needs to be encoded in a standard way, and then passed to the Request object as thedataargument. The encoding is done using a function from theurlliblibrarynotfromurllib2. import strong> urllib
import strong> urllib2
url = ttp://www.someserver.com/cgi-bin/register.cgi
values ??= { name Michael Foord
location Northampton
language Python
data = urllib.urlencode (values)
req = urllib2.Request (url, data)
response = urllib2.urlopen (req)
the_page = response.read ()
Note that other encodings are sometimes required (eg for file upload from HTML forms – seeHTML Specification, Form Submissionfor more details). If you do not pass thedataargument, urllib2 uses aGETrequest. One way in which GET and POST requests differ is that POST requests often have “side-effects”: they change the state of the system in some way (for example by placing an order with the website for a hundredweight of tinned spam to be delivered to your door). Though the HTTP standard makes it clear that POSTs are intended toalwayscause side-effects, and GET requestsneverto cause side-effects, nothing prevents a GET request from having side-effects, nor a POST requests from having no side-effects. Data can also be passed in an HTTP GET request by encoding it in the URL itself. This is done as follows. Notice that the full URL is created by adding a? to the URL, followed by the encoded values. We l discuss here one particular HTTP header, to illustrate how to add headers to your HTTP request. Some websites (like google for example) dislike being browsed by programs, or send different versions to different browsers [2]. By default urllib2 identifies itself asPython-urllib / xy (wherexandyare the major and minor version numbers of the Python release, egPython-urllib/2.5), which may confuse the site, or just plain not work. The way a browser identifies itself is through theUser-Agentheader [3]. When you create a Request object you can pass a dictionary of headers in. The following example makes the same request as above, but identifies itself as a version of Internet Explorer [4]. import strong> urllib
import strong> urllib2
url = ttp://www.someserver.com/cgi-bin/register.cgi
user_agent = ozilla/4.0 (compatible; MSIE 5.5; Windows NT)
values ??= { ame ichael Foord
ocation orthampton
language Python
headers = { User-Agent user_agent}
data = urllib.urlencode (values)
req = urllib2.Request (url, data, headers)
response = urllib2.urlopen (req)
the_page = response . read ()
The response also has two useful methods. See the section oninfo and geturlwhich comes after we have a look at what happens when things go wrong. urlopenraisesURLErrorwhen it cannot handle a response (though as usual with Python APIs, builtin exceptions such as ValueError, TypeError etc. may also be raised). HTTPErroris the subclass ofURLErrorraised in the specific case of HTTP URLs. URLError
Often, URLError is raised because there is no network connection (no route to the specified server), or the specified server doesn exist. In this case, the exception raised will have a eason attribute, which is a tuple containing an error code and a text error message. eg> >> req = urllib2.Request ( ttp://www.pretend_server.org >>> try: urllib2.urlopen (req)>>> except URLError, e:>>> print e.reason>>> ( 4, etaddrinfo failed
Every HTTP response from the server contains a numeric “status code”. Sometimes the status code indicates that the server is unable to fulfil the request. The default handlers will handle some of these responses for you (for example, if the response is a “redirection” that requests the client fetch the document from a different URL, urllib2 will handle that for you). For those it can handle, urlopen will raise anHTTPError. Typical errors include 04 page not found), 03 (request forbidden), and 01 authentication required). See section 10 of RFC 2616 for a reference on all the HTTP error codes. TheHTTPErrorinstance raised will have an integer ode attribute, which corresponds to the error sent by the server. Because the default handlers handle redirects (codes in the 300 range), and codes in the 100-299 range indicate success, you will usually only see error codes in the 400-599 range. BaseHTTPServer.BaseHTTPRequestHandler.responsesis a useful dictionary of response codes in that shows all the response codes used by RFC 2616. The dictionary is reproduced here for convenience: # Table mapping response codes to messages; entries have the
# form {code: (shortmessage, longmessage)}.
responses = {
100: ( ontinue equest received, please continue ),
101: ( witching Protocols
Switching to new protocol; obey Upgrade header ,
200: ( OK Request fulfilled, document follows ,
201: ( reated ocument created, URL follows ,
202: ( Accepted ,
equest accepted, processing continues off-line ,
203: ( on-Authoritative Information equest fulfilled from cache ,
204: ( o Content equest fulfilled, nothing follows ,
205: ( eset Content lear input form for further input. , < br />
206: ( artial Content artial content follows. ,
300: ( ultiple Choices
Object has several resources – see URI list ,
301: ( Moved Permanently Object moved permanently – see URI list ,
302: ( Found Object moved temporarily – see URI list ,
303: ( See Other Object moved – see Method and URL list ,
304: ( ot Modified
ocument has not changed since given time ,
305: ( se Proxy
< br /> ou must use proxy specified in Location to access this
esource. ,
307: ( emporary Redirect
< br /> bject moved temporarily – see URI list ,
400: ( ad Request
ad request syntax or unsupported method , < br />
401: ( nauthorized
o permission – see authorization schemes ,
402: ( ayment Required < br />
o payment – see charging schemes ,
403: ( Forbidden
Request forbidden – authorization will not help ,
404: ( Not Found Nothing matches the given URI ,
405: ( Method Not Allowed
< br /> pecified method is invalid for this server. ,
406: ( ot Acceptable RI not available in preferred format. ,
407: ( roxy Authentication Required ou must authenticate with
his proxy before proceeding. ,
408: ( equest Timeout equest timed out; try again later. ,
409: ( Conflict Request conflict. ,
410: ( Gone
RI no longer exists and has been permanently removed. ,
411: ( ength Required lient must specify Content-Length. ,
412: ( recondition Failed recondition in headers is false. ,
413: ( equest Entity Too Large ntity is too large. , < br />
414: ( equest-URI Too Long RI is too long. ,
415: ( nsupported Media Type ntity body in unsupported format . ,
416: ( Requested Range Not Satisfiable
Cannot satisfy request range. ,
417: ( xpectation Failed
xpect condition could not be satisfied. ,
500: ( nternal Server Error erver got itself in trouble ,
501: ( ot Implemented
erver does not support this operation ,
502: ( ad Gateway nvalid responses from another server / proxy. ,
503: ( ervice Unavailable
he server cannot process the request due to a high load ,
504: ( ateway Timeout
he gateway server did not receive a timely response ,
505: ( HTTP Version Not Supported Cannot fulfill request. ,
}
When an error is raised the server responds by returning an HTTP error codeandan error page. You can use theHTTPErrorinstance as a response on the page returned. This means that as well as the code attribute, it also has read, geturl, and info, methods. So if you want to be prepared forHTTPErrororURLErrorthere are two basic approaches. I prefer the second approach . from strong> urllib2 import strong> Request, urlopen, URLError, HTTPError
req = Request (someurl)
try strong>:
response = urlopen (req)
except strong> HTTPError, e:
print strong> he server couldn \ t fulfill the request. lt;br />
print strong> Error code: e.code
except strong> URLError, e:
print strong> e failed to reach a server.
print strong> eason: e.reason
else strong>:
# everything is fine
< strong> from strong> urllib2 import strong> Request, urlopen, URLError
req = Request (someurl)
try strong >:
response = urlopen (req)
except strong> URLError, e:
if strong> hasattr (e, eason :
print strong> e failed to reach a server.
print strong> eason: e.reason
elif strong> hasattr (e, ode :
print strong > he server couldn \ t fulfill the request. lt;br />
print strong> Error code: e.code
else strong>:
# everything is fine
Note strong> URLErroris a subclass of the built-in exceptionIOError. This means that you can avoid importingURLErrorand use: from strong> urllib2 import strong> Request, urlopen
req = Request (someurl)
try strong>:
response = urlopen (req)
except strong> IOError, e:
if < / strong> hasattr (e, eason :
print strong> e failed to reach a server.
print < / strong> eason: e.reason
elif strong> hasattr (e, ode :
print strong> he server couldn \ t fulfill the request. lt;br />
print strong> Error code: e.code
else strong>:
# everything is fine
Under rare circumstancesurllib2can raisesocket.error. BadStatusLine and HttpException
There are one or two cases where an exception that doesn inherit fromIOErrorcan be raised. One of these is theBadStatusLineexception defined in thehttplib module. This exception can be raised when, for example, the requested page is entirely blank. It doesn inherit fromIOErrorbut instead fromHttpException (again defined inhttpliband inheriting directly fromException). There may be other circumstances when these exceptions can leak through to users ofurllib2. You can either import these exception types fromhttplibto catch them directly or have a atch-all exception clause (catchingException) to handle anything that may go wrong. info and geturl
The response returned by urlopen (or theHTTPErrorinstance) has two useful methodsinfoandgeturl. geturl-this returns the real URL of the page fetched. This is useful becauseurlopen (or the opener object used ) may have followed a redirect. The URL of the page fetched may not be the same as the URL requested. info-this returns a dictionary-like object that describes the page fetched, particularly the headers sent by the server. It is currently anhttplib . HTTPMessageinstance. Typical headers include ontent-length ontent-type and so on. See theQuick Reference to HTTP Headersfor a useful listing of HTTP headers with brief explanations of their meaning and use. Openers and Handlers
When you fetch a URL you use an opener (an instance of the perhaps confusingly-namedurllib2.OpenerDirector). Normally we have been using the default opener – viaurlopen-but you can create custom openers. Openers use handlers. All the “heavy lifting” is done by the handlers. Each handler knows how to open URLs for a particular URL scheme (http, ftp, etc.), or how to handle an aspect of URL opening, for example HTTP redirections or HTTP cookies. You will want to create openers if you want to fetch URLs with specific handlers installed, for example to get an opener that handles cookies, or to get an opener that does not handle redirections. To create an opener, instantiate an OpenerDirector, and then call. add_handler (some_handler_instance) repeatedly. Alternatively, you can usebuild_opener, which is a convenience function for creating opener objects with a single function call.build_openeradds several handlers by default, but provides a quick way to add more and / or override the default handlers. Other sorts of handlers you might want to can handle proxies, authentication, and other common but slightly specialised situations. install_openercan be used to make anopenerobject the (global) default opener. This means that calls tourlopenwill use the opener you have installed. Opener objects have anopenmethod , which can be called directly to fetch urls in the same way as theurlopenfunction: there no need to callinstall_opener, except as a convenience. To illustrate creating and installing a handler we will use theHTTPBasicAuthHandler. For a more detailed discussion of this subject – including an explanation of how Basic Authentication works – see theBasic Authentication Tutorial. When authentication is required, the server sends a header (as well as the 401 error code) requesting authentication. This specifies the authentication scheme and a ealm The header looks like: Www-authenticate: SCHEMErealm = “REALM”. eg The client should then retry the request with the appropriate name and password for the realm included as a header in the request. This is asic authentication In order to simplify this process we can create an instance ofHTTPBasicAuthHandlerand an opener to use this handler. TheHTTPBasicAuthHandleruses an object called a password manager to handle the mapping of URLs and realms to passwords and usernames. If you know what the realm is (from the authentication header sent by the server), then you can use aHTTPPasswordMgr. Frequently one doesn care what the realm is. In that case, it is convenient to useHTTPPasswordMgrWithDefaultRealm. This allows you to specify a default username and password for a URL. This will be supplied in the absence of you providing an alternative combination for a specific realm. We indicate this by providingNoneas the realm argument to theadd_passwordmethod. The top-level URL is the first URL that requires authentication. URLs “deeper” than the URL you pass to. add_password () will also match. # create a password manager
password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm ()
# Add the username and password.
# If we knew the realm, we could use it instead of “ None “.
top_level_url = “http://example.com/foo/”
password_mgr.add_password (None, top_level_url, username, password)
handler = urllib2.HTTPBasicAuthHandler (password_mgr)
# create “opener” (OpenerDirector instance)
opener = urllib2.build_opener (handler)
# use the opener to fetch a URL
opener.open (a_url)
# Install the opener.
# Now all calls to urllib2.urlopen use our opener.
urllib2.install_opener (opener)
top_level_url is in facteithera full URL (including the ttp: cheme component and the hostname and optionally the port number) eg “http://example.com/” oran “authority” (ie the hostname, optionally including the port number) eg “example.com” or “example.com: 8080 “(the latter example includes a port number). The authority, if present, must NOT contain the” userinfo “component – for example” joe @ password: example.com “is not correct. urllib2will auto-detect your proxy settings and use those. This is through theProxyHandlerwhich is part of the normal handler chain. Normally that a good thing, but there are occasions when it may not be helpful [5]. One way to do this is to setup our ownProxyHandler, with no proxies defined . This is done using similar steps to setting up aBasic Authenticationhandler: The Python support for fetching resources from the web is layered. urllib2 uses the httplib library, which in turn uses the socket library. As of Python 2.3 you can specify how long a socket should wait for a response before timing out. This can be useful in applications which have to fetch web pages. By default the socket module hasno timeoutand can hang. Currently, the socket timeout is not exposed at the httplib or urllib2 levels. However, you can set the default timeout globally for all sockets using: import strong> socket
import strong> urllib2
# timeout in seconds < br />
timeout = 10
socket.setdefaulttimeout (timeout)
# this call to urllib2.urlopen now uses the default timeout
# we have set in the socket module
req = urllib2.Request ( ttp://www.voidspace.org.uk
response = urllib2. urlopen (req)
December 19th, 2011 by admin
August 16, 2011
topic title number of the subject categories
1001 integer sum of the water problem
1002 C language test questions – two Comparing the number of water problems
1003 1,2,3,4,5 … simple question
1004 Jockey sorting greedy deep sub-way merge
< br /> 1005 Hero In Maze breadth search
1006 Redraiment conjecture Number theory: Inclusion-Exclusion Theorem
1007 childhood Knew recursive problem
1008 University simple hash
1009 goal of a simple simulation of the Berlin problem
1010 Rails simulation title (stack)
1011 Box of Bricks simple question
1012 IMMEDIATE DECODABILITY Huffman coding
1013 STAMPS search or dynamic programming
1014 Border simulation title
1015 Simple Arithmetics high-precision calculations
1016 Shoot-out Game state of compression DP
1017 Tour Guide
1018 Card Trick simple question
1019 Necklace Decomposition greedy
1020 Crashing Robots simulation title
1021 Electrical Outlets simple question
1022 Watchdog simple question
1023 Taxi Cab Scheme graph theory: the minimum path cover —> maximum two points match
1024 Pseudo-random Numbers Number Theory
1025 Card Game Cheater simple question
1026 Investment dynamic programming
1027 Pipes
1028 SETI math: Gaussian elimination
1029 Minimax Triangulation computational geometry
1030 Unequalled Consumption generating function
1031 Declaration of Content
1032 Laserbox search: DFS
1033 Bowlstack
1034 Pesky Heroes
1035 Reduced ID Numbers violence
1036 Tantrix
1037 Guardian of Decency graph theory: the Hungarian algorithm for bipartite graph of maximum match
1038 Up the Stairs simple math problem
1039 Sudoku search: DFS
1040 The SetStack Computer
1041 Pie dichotomy
1042 Ticket to Ride dynamic programming
1043 The Bookcase dynamic programming
1044 Printer Queue simulation title
1045 Prime Path Search: BFS
1046 Lineland Airport
1047 Leonardo Notebook math: group replacement
1048 simple version of the longest sequence of simple questions
1049 Jesse problem search: DFS
1050 Error Correction simulation title
1051 A × B problem high-precision calculations
1052 Redraiment the walk dynamic programming
1053 Word Encoding dynamic programming
1054 Jesse Code of Combinatorics: Arrange
1055 simple password cracking water problems
1056 English Concert Contest water problems
1057 with counterfeit water problems
1058 water hermit crabs and sea anemones questions
1059 Goddess Marriage water problems
1060 Magpie Bridge meet water problem
1061 Yang Hui Triangle water problems
1062 peach water issues in mind
1063 raising rabbits water problems
1064 characters Statistics water problems
1065 perfect number of water problems
1066 pro and several water problems < br />
1067 performance assessment of water issues
1068 looking for change of water problems
1069 beautiful diamond water problems
1070 Least Common Multiple Water problems
1071 the first few days the water problem
1072 editorial from the water problems
1073 the value of the number of disposable water problems
1074 equivalent number of water problems
1075 the minimum distance of two arrays of water problems
1076 input entry (1) water problems
1077 input entry (2 ) water problems
1078 input entry (3) water problem
1079 output started water problems
1080 Counterfeit Dollar combinatorics
< br /> 1081 Dividing dynamic programming
1082 Sorting It All Out graph theory: a topological sort
1083 False coin Violence
1084 File Mapping < br />
1085 Color Me Less simple question
1086 Round and Round We Go simple question
1087 Microprocessor Simulation simple question
1088 seeking the product of an odd number of water problems
1089 square and cube and water issues with
1090 absolute sort of water problem
1091 JudgeOnline water problems < br />
1092 More Beautiful water theme
1093 monkey peach water sub-theme
1094 C language test questions – a quadratic equation of water problems
1095 C language test questions – Preserve water problems
1096 C language test questions – order water problem
1097 C language test questions – matrix transposition home water problems
1098 C language test questions – prime water problems
1099 Ambiguous permutations simple question
1100 Home Work greedy method
1101 Redraiment encounter math problems: to find the law
1102 Decorate the wall search or dynamic programming
1103 Economic phone calls dynamic programming or greedy
1104 Any fool can do it the memory of the search
1105 Wine trading in Gergovia greedy method
1106 Homogeneous squares random algorithm
1107 Automatic Correction of Misspellings String Processing: dictionary order
1108 Black and white painting this simple math problem
1109 Cylinder computational geometry: derivation
1110 Deli Deli water problems
1111 Expressions data structures: tree traversal
1112 Flavius ??Josephus Reloaded number theory: Pollard Rho algorithm
1113 Annoying painting tool greedy Law
1114 Frequent values ??RMQ range of issues OR the most value segment tree
1115 Anagram Groups string matching
1116 Let it Bead Combinatorial Mathematics -> Polya Theorem
1117 Simple Computers simple question
1118 Mondriaan Dream dynamic programming
1119 Equidistance computational geometry
1120 How many Fibs? high-precision calculations
1121 Hike on a Graph Search: BFS
1122 ASCII Art
1123 Billing Tables
1124 Cellular Automaton matrix calculation
1125 Exchange
1126 Fool Game
1127 Java vs C string handling
1128 Kickdown string handling
1129 Copying Books greedy dichotomy
1130 Adding Reversed Numbers simple question
1131 Glass Beads the minimum string said
1132 The Circumference of the Circle of computational geometry problems
1133 Knight Moves Search: BFS
1134 Eeny Meeny Moo Joseph deformation problems
1135 Lotto combination of mathematical
1136 Humble Numbers dynamic programming
1137 Average is not Fast Enough! simple question
1138 Etaoin Shrdlu simple question
1139 Hard to Believe, but True! simple question
1140 Code the Tree simple question
1141 Fiber Network graph theory: the whole source shortest paths, Floyd-Warshall algorithm
1142 Global Roaming 3D geometry question
1143 All in All string handling
1144 The Sierpinski Fractal recursion
1145 Assistance Required simple question: pre
1146 Drink, on Ice simulation title
1147 All Discs Considered Search: BFS
1148 In Danger simulation title
1149 Run Length Encoding string handling
1150 Bee Maja simulation title
1151 Friends expression evaluation value
1152 John Game Theory
1153 Double Queue maximum and minimum heap heap
1154 BC
1155 Loan Scheduling greedy heap
1156 Showstopper
1157 Highway greedy method
1158 Computers dynamic programming
1159 The Stable Marriage Problem combinatorics
1160 Arne Saknussemm simulation title
1161 Sum Problem water problems
1162 Fire Net Search title
1163 statistics the number 1 between 1 and N the number of reasoning problems
1164 greatest common factor of the water problem
1165 C language test questions – three integers water problems < br />
1166 C language test questions – case conversion water problems
1167 C language test questions – score sequence water problems
1168 C language test problem – the value of the water problem most
1169 C language test questions – integer water retention problem
1170 C language test questions – the lower triangular elements of the matrix and water problems < br />
1171 C language test questions – characters in reverse water problems
1172 C language test questions – Print diamond water problems
1173 C language test questions – integral water split theme
1174 C language test questions – delete the specified character water problems
1175 C language test questions – time interval water problems
< br /> 1176 C language test questions – an array of reverse water problems
1177 C language test questions – print digital graphics water problems
1178 C language test questions – word Statistics water problems
1179 C language test questions – the least common multiple and greatest common divisor of the water problem
1180 Crashing Balloon Search title
1181 study Digital simulation title
1182 A B for Input-Output Practice (1) water problems
1183 Anagrams by Stack Search: back
1184 Elevator Mathematics: to find the law
1185 Substrings string handling
1186 Calling Extraterrestrial Intelligence Again Search: enumeration
1187 Do the Untwist this simple math problem
1188 the number of water problems
1189 A B for Input-Output Practice (2) water problems
1190 Mars simple question A B
1191 three gear problem: Three gears meshing this simple math problem
1192 A B Problem II high-precision calculations
1193 The ones to remain math
1194 Chinese Chess game theory
1195 Page Replacement data structures: queues or hash
1196 RSA Signing Number Theory: Pollard Rho algorithm
1197 Number Guessing search: exhaustive
1198 seeking high-precision calculation of factorial of n
1199 Area computational geometry
1200 find the angle between two lines of water problems
1201 Triangle area water problems
1202 Max Sum dynamic programming
1203 Number Sequence problem of large numbers
1204 u Calculate e water problem
1205 Fibonacci series high-precision calculations
1206 Fibonacci Again the problem of large numbers
1207 Let the Balloon Rise string handling
1208 or A B water problems
1209 A B water problems
1210 The area simply computational geometry
1211 Ignatius puzzle simple math problem
1212 Computer Transformation accurate calculation
1213 N! high-precision calculations
1217 Text Reverse water problems
1220 to fill a numbers game search: DFS
1221 Tempter of the Bone search: DFS or BFS pruning
1226 Last non-zero Digit in N! number theory
1227 triangular recursive solution
1228 palindrome guess simple question
1229 Factorial simple question
1230 Specialized Four-Digit Numbers this simple math problem
1231 Lowest Bit simple question
1232 To and Fro simple question
1233 AC Me simple question
1234 Wolf and Rabbit number theory
1235 the largest contiguous sequence of dynamic programming
1236 characters open and close people string processing
1237 rankings sort
1238 statistics string processing problem: the dictionary tree
1239 Tick and Tick math
1240 Quoit Design divide and conquer
1241 issue of money changers recursive solution
1242 obtained a large number of the first m simple question
1243 Cape Valley guess simple question
1244 Reverse Number simple question
1245 to find prime numbers on the simple question
1246 ZJUTACM simple question
1247 Hat Fibonacci accurate calculation
1248 Encoding simple question
1249 four numbers together high-precision calculations
1250 high-precision calculation of subtracting two numbers
1251 Square Coins generating function
1252 Counting Triangles recursive solution
1253 2 ^ x mod n = 1 Number Theory: Fermat Little Theorem
1254 Minimum Inversion Number simple question
1255 Surround the Trees of computational geometry: convex hull
1256 Number Steps simple question
1257 Binary Numbers simple question
1258 Knight Moves Search: BFS
1259 Lotto combination of mathematical
1260 A Simple Task simple question
1261 The Drunk Jailer number theory
1262 Hanoi Tower Troubles Again! recursive solution
1263 IBM Minus One water problems
1264 Definite Values ??simple question
1265 Box of Bricks water problems
1266 Perfection simple question
1267 Reverse Text of water problems
1268 Inversion modeling theme
1269 Prime Cuts simple question
1270 How Many Fibs? high-precision calculations
1271 Round and Round We Go simple question
1272 Red and Black Search: DFS
1273 What Day Is It? simple question
1274 String Matching string matching
< br /> 1275 A Contesting Decision simple question
1276 Doubles simple question
1277 The Snail simple question
1278 Jungle Roads graph theory: minimum spanning tree
1279 Prime Ring Problem Search: DFS
1280 Big Number of large numbers problem
1281 Least Common Multiple simple question
1283 simple sort of water problem
1284 Gridland simple question
1285 An Easy Task simple question
1286 Calendar Game simulation title
1287 Human Gene Functions dynamic programming
1288 computational geometry exercises – computational geometry line segment intersection
1289 computational geometry exercises – computational geometry line segment intersects II < br />
1290 computational geometry exercises – straight line intersection of computational geometry
1291 Trees Made to Order recursive solution
1292 ordering simple question
< br /> 1293 18 birthday simple question
1294 candy recursive solution
1295 variant of the Tower of Hanoi recursive solution
1296 reshuffle recursive solution
1297 large numbers seeking remainder on
1298 Roundtable recursive solution
1299 projects and check the set of smooth
< br /> 1300 or smooth project the minimum spanning tree
1301 statistics the number of students with scores of water problems
1302 simple calculator to evaluate the expression: the application stack
1303 improved version of the calculator expression evaluation: the stack of applications
1304 FatMouse rade greedy method
1305 Digital Roots problem of large numbers
< br /> 1306 Uniform Generator Number Theory
1307 A Mathematical Curiosity exhaustive method
1308 Safecracker exhaustive method
1309 The 3n 1 problem simple Title
1310 share candy simulation title
1311 Treasure collection search: BFS
1312 Climbing Worm simple question
1313 to move the table greedy method
1314 Humble Numbers dynamic programming
1315 Dividing dynamic programming
1316 Rightmost Digit mathematical problems
1317 Leftmost Digit mathematical problems
1318 Hangover simple math problem
1319 Exponentiation high-precision calculations
1320 I Think I Need a Houseboat simple question
1321 Girls and Boys DFS bipartite graph
1322 Monkey and Banana dynamic programming
1323 buy milk simple question
1324 Matrix Chain Multiplication data structures: stacks of applications
1325 performance computing simple question
1326 Holding Bin-Laden Captive! mother function
1327 You can Solve a Geometry Problem too computational geometry
1328 Super Jumping! Jumping! Jumping! dynamic programming
1329 a ^ b number theory
1330 GPA calculated water problems
1331 Give me an offer! 0 – 1 knapsack dynamic programming
1332 Tian Ji horse greedy method
1333 Asteroids! Search: BFS
1334 Oil Deposits search: DFS
1335 rescue Angel Search: BFS
1336 decimal fraction precision of the calculation
1337 I Hate It segment tree
1338 Strange Billboard-bit computing enum
1339 Frobenius recursive solution
1340 strange formula math
1341 Fibonacci again and again game theory
1342 A New Tetris Game Game Theory
1343 Sum It Up Search: DFS
1344 24-point calculation speed search
1345 Sokoban search: BFS
1346 Pushing Boxes Search: BFS
1347 The Worm Turns search
1348 Alfredo Pizza Restaurant simple question
1349 Broken Keyboard string handling
1350 Convert Kilometers to Miles simple question
1351 words number of water problems
1352 Cactus blur simple question
1353 Family planning simple question
1354 Rout 66 simple questions
1355 LC-Display simulation title
1356 A == B? high-precision calculations
1357 series one of the recursive solution is not easy
1358 line split plane recursive solution
1359 find the nth digit binary search
1360 odd order magic cube (II) simple question
1361 Keep on Truckin imple question
1362 Factstone Benchmark simple question
1363 Destroy the Well of Life simulation title
1365 Brave Game Game Theory
1366 ASCII code sort of water problem
1367 calculated the distance between two points of water problems
1368 computing sphere water problems
1369 absolute value of water problems
1370 value statistics of water problems
1371 series and water demand issues
1372 the number of water problems daffodils
1373 polynomial summation water problems
1374 prime numbers to determine the water problem
1375 even the sum of water problems
1376 female the story of cattle water problems
1377 series order! water problems
1378 wages slightly:) water problems
1379 C language legal identifier Water problems
1380 election sea water heroine
1381 issue to find the maximum element of the water problem
1382 changed the first letter capitalized water problems
1383 statistics vowel water problems
1384 Palindromes _easy version water problems
1385 characters Statistics water problems
1386 binary conversion of water Title
1387 cute A B water problems
1388 cute AB water problems
1389 cute A ^ B water problems
1390 reform of spring in Montreal computational geometry
1391 this summer without AC dynamic programming
1392
triangle of water problems
1393 issue of water demand average score
1394 is not easy to solve the series of two Recursive password
1395 water problems
1396 a Bee … recursive solution
1397 is not easy series (3) – LELE recurrence of RPG problem solving
1398 square domino Shop recursive solution < br />
1399 bull beef of the EOF string recursive solution
1400 God, God, and God recursive solution
1401 series is not easy (4) – test the groom recursive solution
1402 Bitset simple question
1403 Picture a simple simulation title
1404 Switch Game to find the law
< br /> 1405 An easy problem simple simulation title
1406 A B Again simple question
1407 The sum problem this simple math problem
1408 turtles rabbit race dynamic programming
1409 Snooker simple math problem
1410 Subset sequence simple question
1411 III Tower of Hanoi recursive solution
1412 “red virus” recursive problem solving
1413 rabbit checkerboard recursion solution
1414 RPG of the wrong troubleshooting row combinations of
1415 unlimited way simple question
1416 angle much math
1417 IV Tower of Hanoi recursive solution
1418 review time simple questions
1419 elective time violence to solve
1420 phone cornet string handling
1421 to find words generating function
1422 version of the shortest distance between simple math problem
1423 several tower dynamic programming
1424 reactor simple question
1425 A1 =? formula derived
1426 cut fabric of string processing
1427 not 62 math problems
1428 hollow triangle string handling
< br /> 1429 A B Xiaoming simple question
1430 Sky number base conversion
1431 divisible mantissa simple question
1432 split primes and number theory
1433 positive integer solution math
1434 hanging salt analog issue
1435 {A} {B} simple question
1436 A B high-precision decimal calculations
1437 Zigzag simple question
1438 spiral simple question
1439 Luggage storage simple Title
1440 to determine the convex polygon calculated geometry
1441 The centre of polygon computational geometry
1442 smallest positive integer simple question
1443 Elevator Stopping Plan two points greedy method
1444 TOYS computational geometry
1445 The Doors computational geometry
1446 Polygon And Segment computational geometry < br />
1447 Fence computational geometry
1448 two circles intersect area of ??computational geometry
1449 Area of ??Circles computational geometry
1450 Pipe computational geometry
1451 zero sum search: DFS
1452 C language test questions – Hello World water problems
1453 C language test questions – number of days the water problem
1454 C language test questions – sort of water problem of three numbers
1455 C language test questions – sum of the number string
water problems
1456 C language test questions – shoot the ball the water problem
1457 C language test questions – seeking a 3 * 3 matrix and the diagonal elements of the water problem
1458 C language test questions – an array of reverse water problems
1459 C test questions – seeking maximum water problems
1460 C test questions – the largest absolute value value of the water problem
1461 C language test questions – averaged water problems
1462 C language test questions – Print triangle of water problems
1463 C language test questions – the sum and maximum water problems
1464 C language test questions – simple encoding water problems
1465 C language test questions – a the number of days in a month the water problem
1466 C language test questions – you sort of water problem and the number of
1467 C language test questions – the number two biggest water problem
1468 C language test questions – find the value of water level problems
1469 Pipe II computational geometry
1470 Transmitters computational geometry
< br /> 1471 Wall computational geometry
1472 C language test questions – against the set of positive integers water problems
1473 C language test questions – to find the middle number of water issues
1474 C language test questions – integer bit of water problems
1475 C language test questions – a quadratic equation II water problems
1476 C language experimental problems – pi water problems
1477 C language test questions – cosine water problems
1478 C language test questions – print pyramid water problems
1479 C language test questions – sort of water problem
1480 C language test questions – Joseph, the problem of water problems
1481 C language test questions – saddle-point water issues < br />
1482 C language test questions – calculate the expression of water problems
1483 C language test questions – Water Tower of Hanoi problem
1484 C language test questions – String sort of water problem
1485 C language test questions – divides water questions
1486 Solitaire Search: (bi) BFS
1487 Abbreviation water problems
1488 C language test questions – to buy candy water problems
1489 C language test questions – character encoding water problems
1490 C language test questions – valid C identifier water problems
1491 C language test questions – triangle area water problems
1492 C language test questions – size write conversion water problems
1493 C language test questions – calculate water cylinder questions
1494 C language test questions – the water temperature conversion problem
1495 C language test questions – Statistics string water problems
1496 C language test questions – character filtering water problems
1497 Coin Change violent solution
< br /> 1498 Beautiful Meadow search problem
1499 C language test questions – chickens and rabbits with cage water problems
1500 Coins of Luck math: mathematical expectation
1501 Friends search: DFS
1502 Find All M ^ N Please math
1503 Incredible Cows Search: half DFS
1504 recursive calculation of the line cross-point solution
1505 Number Game dynamic programming
1506 Sort ZOJ7 string handling
1507 Find 7 Faster Than John Von Neumann precision calculations
1508 free pie dynamic programming
1509 Worm dynamic programming
1510 Common Subsequence dynamic programming
1511 to move the bedroom of dynamic programming
1512 Daydream string handling
1513 Ballroom Lights
1514 Drop the Triples
1515 Finding Seats
1516 He is offside!
1517 Justice League
1518 scattered Search
1519 against Polish notation expression evaluator: stack of applications
1520 hex precision calculations
1521 Palindromic sequence
1522 Hotel simulation title < br />
1523 Intersecting Lines computational geometry
1524 Heap Construction shortest path
1525 Pizza Anyone?
1526 Adam Genes
1527 Risk
1528 Just the Facts Number Theory
1529 Horse Shoe Scoring computational geometry
1530 Number of Goldbach conjecture on the < br />
1531 love the great significance of simple questions
1532 the school outside of the tree simulation title
1533 up to a few questions about number theory
1534 Quicksum math
1535 to find the law to fill digital math
1536 Accepted Necklace Search: DFS
1537 division expression of number theory
1538 A Walk Through the Forest of graph theory: the shortest path
1539 Accurately Say “CocaCola”! simple question
1540 Build The Electric System graph theory: minimum spanning tree
1541 Colorful Rainbows computational geometry
1542 Easy Task math
1543 Faster, Higher, Stronger simple question
< br /> 1544 Give Me the Number simulation title
1545 Hurdles of 110m dynamic programming
1546 Just Pour the Water matrix calculation
1547 Kinds of Fuwas exhaustive method
1548 complex operations simple question
1549 the number of elements sorted simple question
1550 Fiber Communications
1551 Power Hungry Cows Search: BFS
1552 Cow Cycling dynamic programming
1553 Rebuilding Roads Tree DP
1554 Triangular Pastures dynamic programming
1555 Chores dynamic programming
1556 Extra Krunch
1557 BUY LOW, BUY LOWER dynamic programming
1558 Hypnotic Milk Improvement < br />
1559 Happy Cows
1560 Unary Cow Counting
1561 Dairy Route
1562 Calf Numbers
1563 Hide and Seek
1564 Mountain Majesties
1565 Secret Milk Pipes
1566 Circus Tickets
1567 Life Cycle
1568 Wiggle Numbers
1569 Superwords
1570 Cow Brainiacs
1571 Pasture Fences
1572 New Years Party
1573 Strolling Cows
1574 Grazing Sets
1575 Factorial Power
1576 Friday the Thirteenth
1577 Beef McNuggets
1578 Calf Flac
1579 Light Bulbs
1580 Cow Math Graph Theory
1581 Cow Imposters dynamic programming
1582 Traffic Lights recursive solution
1583 Farm Tour graph theory: the shortest path
1584 Vertical Histogram simple question
1585 Cowties dynamic programming
1586 Travel Games Search: DFS
1587 Best Cow Fences dichotomy
1588 Cornfields RMQ problem
1589 Six Degrees of Cowvin Bacon simple question
1590 Herd Sums simple question
1591 Message Decoding simple question
1592 Mountain Walking half flood fill
1593 Millenium Leapcow dynamic programming
1594 Optimal Milking maximum flow dichotomy
1595 Bale Figures analog dichotomy
1596 Jumping Cows dynamic programming
1597 Lost Cows SBT tree
1598 Bovine Math Geniuses simple question
1599 Dividing the Path Dynamic Programming
1600 Fence Obstacle Course dynamic programming
1601 Cow Ski Area Graph Theory: flood fill
1602 Cleaning Shifts greedy method
1603 Bad Cowtractors maximum spanning tree
1604 Tree Cutting Tree Dynamic Programming
1605 Navigation Nightmare and check the set of
1606 Cow Marathon tree dynamic programming
1607 Distance Queries LCA, tarjan algorithm
1608 Distance Statistics floor heaven big cow “man Q8″ in a
1609 Moo University – Team Tryouts sort brute-force method
1610 Moo University – Emergency Pizza Order
1611 Moo University – Financial Aid maximum heap , the minimum heap
1612 Cube Stacking and check collection
1613 The Cow Lineup exhaustive method
1614 MooFest segment tree
December 19th, 2011 by admin
April 12, 2011
attention web2.0 operation and maintenance technology, system architecture and the underlying R
December 19th, 2011 by admin
January 12, 2011
Snmp Agent strong> extension strong> strong> The document focuses on open source projects based on net-snmp snmp agent end of the development process, first speak standard agent installation process, and then about three kinds of mib extension methods, each way corresponding to the different development needs, will eventually be ported to talk about how to arm board.
one. System environment: strong>
strong> OS: CentOS 5.4 kernel: Linux_2.6
build environment: gcc 4.1.2 version of the code: net-snmp-5.4.3.tar.gz
(Download: http://jaist.dl.sourceforge.net/project/net-snmp/n et-snmp/5.4.3 / net-snmp-5.4.3.tar.gz)
two. Install strong> net-snmp
strong> 1. Extract the package and change the directory:
# tar zxvf net-snmp-5.4.3.tar.gz
# cd net-snmp-5.4.3
2. configure configure
#. / configure – enable-mfd-rewrites – enable-embedded-perl – with-perl-modules – with-default-snmp-version = “2″ – with-sys-contact = “linux” – with-sys-location = “China”
You are prompted to take some parameters, press Enter on the line
3. compile and install
# make
# make install
now a standard snmp agent client has been installed completed (installed by default in / usr / local / share / snmp / path, snmpd is the agent)
4. configure the agent, modify the configuration file (which can be generated by snmpconf command configuration file, where I manually create a configuration file, only a simple configuration, ensure that it can work, you can set their own specific query)
# vim / usr / local / share / snmp / snpmd.conf
enter the following two lines of configuration, save (which is the default public read the password and 123456 for the read-write password)
rocommunity public
rwcommunity 123456
5 The test of our agents are working properly, enter:
# snmpwalk-v 1-c public localhost 1.3.6.1.2.1.1
prompt similar to the following information, configuration is successful
SNMPv2-MIB:: sysDescr.0 = STRING: Linux localhost 2.6.18-164.el5 # 1 SMP Thu Sep 3 03:33:56 EDT 2009 i686
SNMPv2-MIB:: sysObjectID.0 = OID: NET-SNMP-TC:: linux
DISMAN-EVENT-MIB:: sysUpTimeInstance = Timeticks: (1047697) 2:54:36.97
SNMPv2-MIB:: sysContact.0 = STRING: linux
SNMPv2-MIB:: sysName.0 = STRING: mylinux
SNMPv2-MIB: : sysLocation.0 = STRING: China
SNMPv2-MIB:: sysORLastChange.0 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB:: sysORID. 1 = OID: SNMP-FRAMEWORK-MIB:: snmpFrameworkMIBCompliance
SNMPv2-MIB:: sysORID.2 = OID: SNMP-MPD-MIB:: snmpMPDCompliance
SNMPv2-MIB :: sysORID.3 = OID: SNMP-USER-BASED-SM-MIB:: usmMIBCompliance
SNMPv2-MIB:: sysORID.4 = OID: SNMPv2-MIB:: snmpMIB
< br /> SNMPv2-MIB:: sysORID.5 = OID: TCP-MIB:: tcpMIB
SNMPv2-MIB:: sysORID.6 = OID: IP-MIB:: ip
< br /> SNMPv2-MIB:: sysORID.7 = OID: UDP-MIB:: udpMIB
SNMPv2-MIB:: sysORID.8 = OID: SNMP-VIEW-BASED-ACM-MIB:: vacmBasicGroup
SNMPv2-MIB:: sysORDescr.1 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB:: sysORDescr.2 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB:: sysORDescr.3 = STRING: The management information definitions for the SNMP User-based Security Model.
SNMPv2-MIB:: sysORDescr. 4 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB:: sysORDescr.5 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB:: sysORDescr .6 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB:: sysORDescr.7 = STRING: The MIB module for managing UDP implementations
SNMPv2- MIB:: sysORDescr.8 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB:: sysORUpTime.1 = Timeticks: (0) 0:00:00.00
< br /> SNMPv2-MIB:: sysORUpTime.2 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB:: sysORUpTime.3 = Timeticks: (0) 0:00:00.00 < br />
SNMPv2-MIB:: sysORUpTime.4 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB:: sysORUpTime.5 = Timeticks: (1) 0: 00:00.01
SNMPv2-MIB:: sysORUpTime.6 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB:: sysORUpTime.7 = Timeticks: ( 1) 0:00:00.01
SNMPv2-MIB:: sysORUpTime.8 = Timeticks: (1) 0:00:00.01
three. Expand their strong> mib
strong> above steps just completed a standard mib library contains the agent-side installation, the following describes how to add your own mib library, The following gray is strong> mib2c strong> tool to generate strong> . c strong> and strong> . h < / strong> file approach for information purposes only, individuals do not recommend, you can skip strong>
strong> 1. If the following is written in our own mib file (saved as BVCOM-SYSTEMUPTIME-MIB.txt)
BVCOM-SYSTEMUPTIME-MIB DEFINITIONS:: = BEGINIMPORTS TimeTicks FROM SNMPv2-SMI enterprises FROM SNMPv2-SMI OBJECT-TYPE, Integer32, MODULE-IDENTITY FROM SNMPv2-SMI; bvcom OBJECT IDENTIFIER:: = {enterprises 26814} ipq6800 OBJECT IDENTIFIER:: = {bvcom 6800} bvcomAgentModules OBJECT IDENTIFIER:: = {ipq6800 1} bvcomAgentModuleObject OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS read-write STATUS current DESCRIPTION ” This is an object that simply supports a writable integer when compiled into the agent. See http://www.net-snmp.org/tutorial-5/toolkit/XXX for further implementation details. “DEFVAL {1}:: = { bvcomAgentModules 1} bvcomAgentSubagentObject OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS read-write STATUS current DESCRIPTION “This is an object that simply supports a writable integer when attached to the agent. The object should be accessible when the agentx subagent containing this object is attached. See http://www.net-snmp.org/tutorial-5/toolkit/XXX for further implementation details. “DEFVAL {2}:: = {bvcomAgentModules 2} bvcomAgentPluginObject OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS read-write STATUS current DESCRIPTION “This is an object that simply supports a writable integer when attached to the agent. This object should be accessible when the dynamic plugin has been loaded into the agent. See http://www.net-snmp.org/tutorial- 5/toolkit/XXX for further implementation details. “DEFVAL {3}:: = {bvcomAgentModules 3} END2. mib library copy files to / usr / local / share / snmp / mibs /
# cp BVCOM-SYSTEMUPTIME-MIB.txt / usr / local / share / snmp / mibs / BVCOM-SYSTEMUPTIME-MIB. txt
3. mib load library (modified snmp.conf file, the file must establish their own, or through snmpconf generated)
vim / usr / local / share / snmp / snmp.conf
enter the following and save:
mibs BVCOM-SYSTEMUPTIME-MIB
4. test mib library is loaded successfully
# snmptranslate-IR-Tp bvcom
the following information that success
– bvcom (26814)
– ipq6800 (6800)
– bvcomAgentModules (1)
–RW-Integer32 bvcomAgentModuleObject (1)
–RW-Integer32 bvcomAgentSubagentObject (2)
–RW-Integer32 bvcomAgentPluginObject (3)
5. View mib2c support templates
# ls / usr / local / share / snmp /
shown below
mib2c strong>. access_functions.conf mib2c < / strong>. create-dataset.conf mib2c strong>. scalar.conf
mib2c strong>. array-user.conf mib2c strong >-data mib2c strong>. table_data.conf
mib2c strong>. check_values.conf mib2c strong>. genhtml.conf mibs
mib2c strong>. check_values_local.conf mib2c strong>. int_watch.conf snmp.conf
mib2c strong>. column_defines.conf mib2c strong>. iterate_access.conf snmp.conf ~
mib2c strong>. column_enums.conf mib2c strong>. iterate. conf snmpconf-data
mib2c strong>. column_storage.conf mib2c strong>. mfd.conf snmpd.conf
mib2c strong>. conf mib2c strong>. notify.conf snmp_perl.pl
mib2c strong>. container.conf mib2c strong> . old-api.conf snmp_perl_trapd.pl
6. generated by the template. c and. h files (since custom mib library variable of type int so the template is selected int_watch.conf, different functions in different templates)
own to create a folder example-demon, and switch to the directory,
# mib2c strong>-c < strong> mib2c strong>. int_watch.conf bvcomAgentModules
writing to –
*** Warning: only generating code for nodes of MIB type INTEGER
< br /> writing to bvcomAgentModules.h
writing to bvcomAgentModules.c
running indent on bvcomAgentModules.c
running indent on bvcomAgentModules.h < br />
so in the current directory to generate our own mib library corresponding bvcomAgentModules.c and bvcomAgentModules.h, these two documents provide only a framework, the specific content needs to read and write the content yourself
that generated by the tool strong> c strong> and strong> h strong> files, compare mode oriented, not flexible enough, is not recommended, reference source code strong> net-snmp-5.4.3/agent/mibgroup/examples strong> under strong> example . c strong> and strong> example.h strong> , the corresponding strong> mib strong> file strong> net-snmp-5.4.3/mibs / strong> NET-SNMP-EXAMPLES-MIB.txt strong>
With our mib database corresponding to the example.c and example.h document, and now we need to add snmp agent, first we snmp_agent_api write daemon example-demon.c (create a test folder, admitted example.c with example.h one), and save the following code example-demon.c
/ * Main function: * /
# include
# include
# include
# include
# include “example.h” / / This header file to include just
static int keep_running;
RETSIGTYPE
stop_server (int a) {
keep_running = 0;
}
int
main (int argc, char ** argv) {
int agentx_subagent = 0; strong> / * change this if you want to be a SNMP master agent * /
int background = 0; / * change this if you want to run in the background * /
int syslog = 0; / * change this if you want to use syslog * /
/ * print log errors to syslog or stderr * /
if (syslog)
snmp_enable_calllog ();
else
snmp_enable_stderrlog ();
/ * we e an agentx subagent? * /
< br /> if (agentx_subagent) {
/ * make us a agentx client. * /
netsnmp_ds_set_boolean (NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE, 1);
}
/ * run in background, if requested * /
if (background