Tumgik
#and the solder was cheaper by nearly a third
healthnotion · 5 years
Text
Ernest Hemingway’s Advice on Camping Out
Editor’s note: Throughout Ernest Hemingway’s life, he maintained a love for the outdoors and for outdoor pursuits. This love was inculcated early, as his father took him into the woods as soon as he was able to walk, and taught Ernest the rudiments of hunting and fishing when the boy was only a toddler. Hemingway Sr. further instructed his son in how to build fires, make wilderness shelters, tie fishing flies, and cook wild game; he always insisted that Ernest eat whatever he killed. Hemingway continued to relish hiking, backpacking, camping, and fishing as a young man, and these pursuits would prove healing after his experience in WWI and throughout his adulthood.
Before he broke through as a novelist, a twenty-something Hemingway worked as a staff writer for the Toronto Star Weekly, and penned this non-fiction piece for the paper in 1920. In it, he shares his well-earned advice for old fashioned camping, including the very best way to fry trout.
“Camping Out” By Ernest Hemingway
Thousands of people will go into the bush this summer to cut the high cost of living. A man who gets his two weeks’ salary while he is on vacation should be able to put those two weeks in fishing and camping and be able to save one week’s salary clear. He ought to be able to sleep comfortably every night, to eat well every day and to return to the city rested and in good condition.
But if he goes into the woods with a frying pan, an ignorance of black flies and mosquitoes, and a great and abiding lack of knowledge about cookery, the chances are that his return will be very different. He will come back with enough mosquito bites to make the back of his neck look like a relief map of the Caucasus. His digestion will be wrecked after a valiant battle to assimilate half-cooked or charred grub. And he won’t have had a decent night’s sleep while he has been gone.
He will solemnly raise his right hand and inform you that he has joined the grand army of never-agains. The call of the wild may be all right, but it’s a dog’s life. He’s heard the call of the tame with both ears. Waiter, bring him an order of milk toast.
In the first place, he overlooked the insects. Black flies, no-see-ums, deer flies, gnats and mosquitoes were instituted by the devil to force people to live in cities where he could get at them better. If it weren’t for them everybody would live in the bush and he would be out of work. It was a rather successful invention.
But there are lots of dopes that will counteract the pests. The simplest perhaps is oil of citronella. Two bits’ worth of this purchased at any pharmacist’s will be enough to last for two weeks in the worst fly and mosquito-ridden country.
Rub a little on the back of your neck, your forehead, and your wrists before you start fishing, and the blacks and skeeters will shun you. The odor of citronella is not offensive to people. It smells like gun oil. But the bugs do hate it.
Oil of pennyroyal and eucalyptol are also much hated by mosquitoes, and with citronella, they form the basis for many proprietary preparations. But it is cheaper and better to buy the straight citronella. Put a little on the mosquito netting that covers the front of your pup tent or canoe tent at night, and you won’t be bothered.
To be really rested and get any benefit out of a vacation a man must get a good night’s sleep every night. The first requisite for this is to have plenty of cover. It is twice as cold as you expect it will be in the bush four nights out of five, and a good plan is to take just double the bedding that you think you will need. An old quilt that you can wrap up in is as warm as two blankets.
Nearly all outdoor writers rhapsodize over the browse bed [a “mattress” made by layering the fans of evergreen boughs]. It is all right for the man who knows how to make one and has plenty of time. But in a succession of one-night camps on a canoe trip all you need is level ground for your tent floor and you will sleep all right if you have plenty of covers under you. Take twice as much cover as you think that you will need, and then put two-thirds of it under you. You will sleep warm and get your rest.
When it is clear weather you don’t need to pitch your tent if you are only stopping for the night. Drive four stakes at the head of your made-up bed and drape your mosquito bar over that, then you can sleep like a log and laugh at the mosquitoes.
Outside of insects and bum sleeping the rock that wrecks most camping trips is cooking. The average tyro’s idea of cooking is to fry everything and fry it good and plenty. Now, a frying pan is a most necessary thing to any trip, but you also need the old stew kettle and the folding reflector baker.
A pan of fried trout can’t be bettered and they don’t cost any more than ever. But there is a good and bad way of frying them.
The beginner puts his trout and his bacon in and over a brightly burning fire; the bacon curls up and dries into a dry tasteless cinder and the trout is burned outside while it is still raw inside. He eats them and it is all right if he is only out for the day and going home to a good meal at night. But if he is going to face more trout and bacon the next morning and other equally well-cooked dishes for the remainder of two weeks he is on the pathway to nervous dyspepsia.
The proper way is to cook over coals. Have several cans of Crisco or Cotosuet or one of the vegetable shortenings along that are as good as lard and excellent for all kinds of shortening. Put the bacon in and when it is about half cooked lay the trout in the hot grease, dipping them in corn meal first. Then put the bacon on top of the trout and it will baste them as it slowly cooks.
The coffee can be boiling at the same time and in a smaller skillet pancakes being made that are satisfying the other campers while they are waiting for the trout.
With the prepared pancake flours you take a cupful of pancake flour and add a cup of water. Mix the water and flour and as soon as the lumps are out it is ready for cooking. Have the skillet hot and keep it well greased. Drop the batter in and as soon as it is done on one side loosen it in the skillet and flip it over. Apple butter, syrup or cinnamon and sugar go well with the cakes.
While the crowd have taken the edge from their appetites with flapjacks the trout have been cooked and they and the bacon are ready to serve. The trout are crisp outside and firm and pink inside and the bacon is well done–but not too done. If there is anything better than that combination the writer has yet to taste it in a lifetime devoted largely and studiously to eating.
The stew kettle will cook your dried apricots when they have resumed their predried plumpness after a night of soaking, it will serve to concoct a mulligan in, and it will cook macaroni. When you are not using it, it should be boiling water for the dishes.
In the baker, mere man comes into his own, for he can make a pie that to his bush appetite will have it all over the product that mother used to make, like a tent. Men have always believed that there was something mysterious and difficult about making a pie. Here is a great secret. There is nothing to it. We’ve been kidded for years. Any man of average office intelligence can make at least as good a pie as his wife.
All there is to a pie is a cup and a half of flour, one-half teaspoonful of salt, one-half cup of lard and cold water. That will make pie crust that will bring tears of joy into your camping partner’s eyes.
Mix the salt with the flour, work the lard into the flour, make it up into a good workmanlike dough with cold water. Spread some flour on the back of a box or something flat, and pat the dough around a while. Then roll it out with whatever kind of round bottle you prefer. Put a little more lard on the surface of the sheet of dough and then slosh a little flour on and roll it up and then roll it out again with the bottle.
Cut out a piece of the rolled out dough big enough to line a pie tin. I like the kind with holes in the bottom. Then put in your dried apples that have soaked all night and been sweetened, or your apricots, or your blueberries, and then take another sheet of the dough and drape it gracefully over the top, soldering it down at the edges with your fingers. Cut a couple of slits in the top dough sheet and prick it a few times with a fork in an artistic manner.
Put it in the baker with a good slow fire for forty-five minutes and then take it out and if your pals are Frenchmen they will kiss you. The penalty for knowing how to cook is that the others will make you do all the cooking.
It is all right to talk about roughing it in the woods. But the real woodsman is the man who can be really comfortable in the bush.
The post Ernest Hemingway’s Advice on Camping Out appeared first on The Art of Manliness.
Ernest Hemingway’s Advice on Camping Out published first on https://mensproblem.tumblr.com
2 notes · View notes
viva64 · 6 years
Text
Why embedded developers should use static code analysis
I decided to briefly highlight 3 reasons why static analysis tools for program code may be useful for embedded developers.
Tumblr media
The first reason: no need to spend time on excruciating search for some specific errors
Static code analysis == cheapening the process of testing and device debugging. The earlier an error is detected, the less expensive it is to correct it. Static analysis allows to find bugs on the stage of writing the code, or at least during the night runs on the server. As a result, finding and correcting many of the errors is much cheaper.
Static analysis may be particularly useful when debugging embedded-systems. In such projects, developers deal not only with errors in programs, but also with errors in the device itself or with poor manufacturing layout (bad contact and etc.). As a result, the process of error detecting can be severely delayed because it is often not clear where to look for a bug. If a programmer supposes that code is written correctly, it can cause long searching involving designers and other colleagues, responsible for the hardware-part. So, it will be all the more unpleasant to return to the program code and finally discover a stupid typo. Stupendously inefficient consumption of time and efforts of a team. Sounds awesome, if a static analyzer finds such an error.
Here's such a situation that my friend once told me:
"Even still studying for master's degree, I started working in the company involved in customization of various small-scale devices. For example, automation of greenhouses or collecting information from sensors in the enterprise that nothing leaked or overheated nowhere.
I'm having another standard task which takes me just a couple of hours and I return it to two colleagues to firmware a device they created. Colleagues are surprised at how quickly everything was done, praising me, and I proudly declare, "Well, I'm kind of a professional in writing such things and generally everything is quite simple here". Colleagues leave with a flash drive where I recorded the binary file for microcontroller firmware.
And I forget about this task. There are other greater and more captivating challenges. Moreover, once they didn't come, then all is well.
But they came. But only a week later. Saying couldn't understand the matter. Tied themselves into knots. Our testing bench is not working. Rather, it works, but not quite as it should. We have already re-soldered it again and replaced the executive electromechanical parts. Does not work ... Maybe you'll have a look? May be, there is still something wrong in the program...
I open code and immediately see an error like this:
uchar A[3]; .... for (uchar i = 0; i != 4; i++)  average += A[i]; average /= 3;
I took another project as a base, and the code was written using a Copy-Paste method. In one place I forgot to replace 4 with 3. I was so ashamed that I made two people waste their working week".
The second reason: program updating is expensive, impossible or too late
Errors in embedded devices are extremely unpleasant that it is impossible or nearly impossible to fix them if the serial production started. If hundreds of thousands of washing machines have been already released and sent to shops, what should I do if in a certain mode, the machine is running inappropriately? Generally, it's a rhetorical question and here are two real options:
Forgive, forget and receive negative customer reviews on various sites, spoiling reputation. You can, of course, release and send application instructions "not to do so", but it's also a weak option.
Withdraw the series and do a firmware update. Costly affair.
Moreover, regardless whether the circulation is large or small, bugs fixing may be problematic or too late. The rocket fell, the error was detected, but too late. The patients died, the error was detected, but it will not return people. Antimissile weapons system begins to overshoot, the error was found, but there is nothing pleasant in this story. Cars didn't brake, errors were found, but there is no good for injured.
The conclusion is very simple. Code of embedded devices should be tested as thoroughly as possible, especially if the errors can lead to victims or serious material losses.
Static code analysis doesn't guarantee the absence of errors in code. However, you must use every opportunity to additionally verify the correctness of code. Static analyzers can point at lots of different bugs that manage to stay in the code even after several Code-Reviews.
If in your device there will be less errors thanks to static analysis, it is amazing. Perhaps, thanks to detecting these very errors, no one will die, or the company won't lose big sums of money or reputation because of client complaints.
The third reason: a developer may not know that he's doing something wrong
Errors in programs can be figuratively divided into two types. A programmer knows about the errors of first type and they appear in code accidentally, inadvertently. Errors of the second type occur when the programmer simply doesn't know that you cannot write code this or that way. In other words, he can read such code as much as he wants, but still won't find the bug.
Static analyzers have a knowledge base about the various patterns that in certain conditions cause an error. Therefore, they may indicate an error to the programmer, the existence of which he himself would hardly have guessed. An example would be using a 32-bit type time_t, which may result in malfunction of the device after 2038.
Another example is undefined behavior, which occurs because of incorrect use of shift operators <</>>. These operators are very widely used in code of microcontrollers. Unfortunately, programmers often use these operators very negligently, making the program unreliable and dependent on the version and compiler settings. Yet the program may work, but not because it is written correctly, but due to luck.
By using a static analyzer, programmers can hedge themselves against many unpleasant situations. Additionally, the analyzer can be used to monitor the quality of code in general, which is actual, when the number of project participants increases or changes. In other words, the tool helps to track, whether a novice started to write bad code.
Conclusion
There is one more reason to necessarily use a static code analyzer. This is when the project must meet a certain standard of software development of the language, such as MISRA C. However, rather, it refers to administrative measures, and is a bit away from the topic.
I wanted to show that the use of static analyzer is uniquely appropriate for any embedded project. Use this method and you will be able to:
Reduce time for searching and fixing bugs (example);
Reduce the likelihood of critical bugs;
Reduce the likelihood of necessity to update the firmware;
Monitor the overall code quality (we recommend to additionally look towards SonarQube);
Control the quality of the work of the new team members;
Monitor code quality of third-party modules/libraries.
There are no reasons not to use static code analysis, except laziness and illusion of superiority.
Tumblr media
Use static code analyzers! There are a lot of them.
Surely, we offer to pay attention to our PVS-Studio code analyzer, which has recently started to support a number of ARM-compilers.
6 notes · View notes
ntrending · 6 years
Text
How to build a solar microscope
New Post has been published on https://nexcraft.co/how-to-build-a-solar-microscope/
How to build a solar microscope
Today, we take for granted the instruments that let us look at tiny things in great detail. But back in the 18th century, the microscope was the hottest party trick in town.
Back in those days, English intellectuals would throw friendly social gatherings known as science parties. In genteel homes, over coffee and tea, men and women would engage in science discourse and see demonstrations of the latest findings and ideas.
For example, the great chemist Humphry Davy—who eventually discovered numerous elements including sodium, potassium, calcium, and magnesium—would hold rambunctious gatherings where participants would take turns inhaling nitrous oxide, better known today as laughing gas, with predictably intoxicating results.
Most science parties were a bit more sedate than Davy’s. Often, they involved the identification of local plants or scanning the dark skies for meteors and comets. Another popular pastime was building and using high-voltage electrostatic devices such as Wimshurst machines and Leyden jars.
But perhaps the queen of science parties was the solar microscope. First developed around 1750, solar microscopes became increasingly popular during the decades that followed. The instruments worked much like 1970s vintage slide projectors. However, for illumination, instead of using the not-yet-invented lightbulb, solar microscopes relied on a moveable mirror and lens system to reflect sunlight. The device then projected a much larger image of the microscopic specimen onto the wall of a darkened room.
While at one time fairly popular, solar microscopes are now mostly forgotten, and their legacy among the few science historians who study them is a bit mixed. Some view the instrument as a toy without much of a scientific legacy, a device strictly for amateurs and tinkerers. Others argue that the devices were important, sparking interest in science by offering images of previously unseen things. They showed people that the microscopic world was both interesting and important, forcing them to expand their imaginations.
Once I learned about the history and science of this wonderful little instrument, I decided to build one myself. I couldn’t easily find a great deal of information on constructing solar microscopes, but through trial and error—and reading the limited material I obtained—I came up with a DIY device that works pretty well. Plus, with the addition of a few modern twists, I made my version much easier to assemble and use.
When I placed prepared slides of plant cells and insect parts inside the solar microscope, they appeared just as the Enlightenment-era science partygoers had claimed. Although I have looked at tiny objects in a regular optical microscope before, seeing the images big and bold, projected by a machine of my own making, was immensely satisfying.
I think of this instrument as a bridge between the macroscopic and the microscopic. Because the sun acts as the light source, the solar microscope combines opposites: The tiny becomes the huge, and the very dark becomes the somewhat bright. And most strangely, astronomy becomes biology.
Crafting a solar microscope is not particularly difficult, but it does require the use of a few woodworking tools. Depending on your ability to find used parts at reasonable prices, the cost should be less than $50.
Stats
Time: About 16 hours
Cost: About $50
Difficulty: Medium
Tools
Electric drill with 1/8-inch, 5/32-inch, and 5/16-inch bits
Wood chisel
Wood glue
Glue
Three wood glue clamps
Sandpaper, cut into a 1-inch-wide strip
Hole saw, 1¾ inches in diameter
Hammer
Utility knife
If you do not rely on solar power: High-intensity flashlight
If you rely on solar power: Paint-safe tape
Materials
The precise size of your solar microscope will depend on the projection lens you select. These plans are based on a Kodak Ecktanar projection lens of 102 mm and f 2.8, which is slightly over 2 inches thick at its widest point. This lens is very common, and you can find used versions for fairly cheap prices on websites like eBay. If you end up with a different lens, then it’s important to realize that the dimensions of the box will change. The diameter of the lens will affect the width of the wood boards, and its focal length will affect their length.
Two basswood or poplar wood boards, 2¼ inches wide by 13 inches long by ¼ inches thick (You can easily cut basswood or poplar to size on a bandsaw. If a bandsaw is not available, you can use a handsaw as long as you’re careful.)
Two basswood or poplar wood boards, 3 inches wide by 13 inches long by ¼ inches thick
Eight ¼-inch diameter t-nuts (T-nuts are available at any hardware store and provide a way inserting a bolt onto a flat wood surface. Each one consists of a screw-threaded body with a flange at the top, so it resembles a T when you view it in profile.)
Projection lens from a slide projector, such as a Kodak Ecktanar 102-mm lens
Four ¼-inch thumbscrews, ½ inch long
Four ¼ inch thumbscrews, 1 inch long
Two #10 bolts, 2 inches long, with nuts and washers for each
Two wood squares, 2-and-3/16-inches by 2-and-7/16-inches by ¾-inch-thick
One wood square, 2-and-3/16-inches by 2-and-7/16-inches by ¼-inch-thick
Two plano-convex condenser lenses, 50 mm in diameter (At the time of this writing, Amazon, Aliexpress, and eBay all sell such lenses for less than $10. If you cannot find appropriate lenses, substitute a double convex lens (such as the lens from a small magnifying glass) for the two plano convex lenses for a similar result with only a small decrease in image brightness.)
If you rely on solar power: Round mirror, 2½ inches in diameter
If you rely on solar power: Magnifying glass mounted on a universal joint (This is the type of joint you see on a magnifier attached to a soldering station, or “helping hand.”)
If you rely on solar power: Opaque black cloth
The solar microscope consists of four parts: a projection lens, a box to hold the components in the correct positions, a condenser lens, and a solar reflector or a high-intensity flashlight. The latter option will depend whether or not you decide to harness the sun as your light source.
Sunlight can be an unreliable and finicky source of illumination, so I recommend that you first try this project with a flashlight. If that works, then you can purchase the parts for your solar reflector, build it, and attach it to the completed microscope.
Buy the projection lens
While it is possible to construct a projection lens from single lenses, it is much easier and cheaper to simply buy a used projector lens. Slide projectors were very popular from the 1960s through the 1990s, and most now sit unused in basements and attics. This means it’s not difficult to find a good-quality slide projector lens at nearly giveaway prices.
Measure the diameter of projection lens prior to making the box to make certain it will fit inside. If the lens is too big, increase the size of the box by using wider pieces of wood.
Construct the box
To hold all the components together, you’ll need to construct a wooden box that can accommodate them.
First, you’ll need to create a slot in the 3-inch-wide boards, forming an opening for a specimen slide. To make that cut, you’ll need the electric drill with 1/8-inch bit, chisel, and sandpaper strip.
Begin by drilling a series of holes so they form a line that’s 1-and-1/8-inches long. Then clear out the wood between the holes with the chisel. The result will be jagged, so smooth it out: Thread the 1-inch-wide strip of sandpaper through the opening and sand away the rough bits.
Next, drill four 5/16-inch holes in each 3-inch-wide board, placing them as shown in the box-assembly illustration. Place the t-nuts over the holes and hammer them home.
Now that you’ve prepared the 3-inch-wide boards, you can fit them to the 2¼-inch-wide boards to assemble the box.
Spread glue on the edges of the of the 3-inch-wide boards and press them against the 2¼-inch-wide boards. Then clamp the assembly in place while the glue dries, which should take about an hour.
After you remove the clamps, insert the thumbscrews. The 1-inch-long ones should go into the t-nuts nearest the slot, and the ½-inch-long ones into the t-nuts at the other end.
Make the condenser lens
In order to form a bright image, the sunlight from the reflecting mirror or flashlight must be focused, or condensed, onto the image which is to be projected. A condenser lens typically consists of two plano-convex lenses slightly separated and arranged in the following assembly.
To make the condenser lens, first find and mark the center of each wood square. Drill a 1¾-inch hole, centered on the mark you just made, in each of the three pieces.
Next, for the two ¾-inch-thick squares, use the utility knife to carve a lip onto one side of the drilled hole. The carving must be deep enough to prevent each lens from projecting above the plane of the wood surface.
Stack the three condenser lens pieces one atop the other and then drill two 5/32-inch holes through opposite corners of the assembly.
Place the lenses inside the holders, as shown in the condenser lens diagram. Then insert the #10 bolts through the holes. Insert washers and tighten the nuts.
Place the assembly inside the wooden box, making sure it slides in smoothly. If the condenser lens catches or binds at any point, sand away some material from the wooden lens holder until it moves easily.
Cobble together the solar reflector
If you decide to power your microscope with sunlight, you’ll need to direct these rays to the condenser lens and then through the slide specimen. This requires a solar reflector. To make it easy to attach my reflector to my microscope, I fashioned one out of a magnifying glass with a universal joint.
You can make an inexpensive solar reflector by cannibalizing a so-called “helping hand” or “third hand,” a device used to hold pieces in place when you’re soldering electrical connections. These inexpensive contraptions (they cost about $5 at tool store Harbor Freight) usually include a small magnifying glass that ends in a universal joint.
Remove the magnifier lens and glue a small mirror to its lens, as shown in the image above.
Now you can attach the solar reflector to your project. The universal joint lets you quickly adjust the angle to better reflect light into the solar microscope.
Assemble the pieces
Once the component pieces are finished, you can assemble them into the solar microscope.
Begin by inserting the projection lens into the box, at the end closest to the slide-holder slot. Gently tighten the thumbscrews to lock the projection lens in place, making sure the light can move through the lens in a line perpendicular to the open faces of the box.
Insert the condenser lens into the other side of the box. Tighten the thumbscrews.
Use the microscope
Take the solar microscope into a darkened room and point the projection lens at a white wall or screen located about 10 feet away. Insert a slide with a specimen into the slot and center it. Now, shine a flashlight (the brighter the better) into the condenser end of the box. Align the lenses and the specimen slide so the light is centered and travels perpendicularly to the surfaces of the lenses and slide.
You may need to adjust the position of either the projection lens or condenser lens to achieve a sharp focus. To do so, loosen the thumbscrews and ease the lens and lens holders back and forth until the image appears sharp and focused.
Depending on the focal length of the lens and the distance between the projection lens and the screen, you can expect a magnification of at least 25. You can increase the magnification to 50x and beyond by moving the solar microscope farther from the screen. Just be aware that doing so makes the image dimmer as well.
If you don’t mind using a flashlight or other artificial light source, then you’re all set. However, if you really want a science party, you’ll have to harness the sun. To do that, you need one end of the solar microscope to sit outside in bright light while the other end points into a darkened room.
One common method of achieving this effect relies on an open window. Place the solar microscope so the end with the condenser lens can catch the sunlight while the end with the projection lens points into your dark room. To completely separate the lighted area from the darkened one, block the external rays with a sheet of opaque black cloth and some paint-safe tape.
Once you have mounted the solar microscope in the window, take the solar reflector you made earlier and check out the alligator clamps on the assembly’s open end. You can use these to attach the mirror to the condenser-lens end of the solar microscope. Adjust the angle of the mirror so it reflects sunlight through the lenses and microscope slide. It should project an image onto a white screen inside the darkened room. Once you obtain a bright image, you can adjust both the size of the image and its focus by changing the distance between the screen and the microscope lens.
Written By William Gurstelle
0 notes