没有合适的资源?快使用搜索试试~ 我知道了~
首页Learn Raspberry Pi with Linux.pdf
资源详情
资源评论
资源推荐
v
Contents at a Glance
About the Authors .............................................................................................................. xv
About the Technical Reviewer .......................................................................................... xvii
Acknowledgments ............................................................................................................. xix
Introduction ....................................................................................................................... xxi
Chapter 1: Your First Bite of Raspberry Pi ■ .........................................................................1
Chapter 2: Surveying the Landscape ■ ...............................................................................31
Chapter 3: Getting Comfortable ■ .......................................................................................53
Chapter 4: The File-Paths to Success ■ ..............................................................................69
Chapter 5: Essential Commands ■ ......................................................................................89
Chapter 6: Editing Files on the Command Line ■ ..............................................................109
Chapter 7: Managing Your Pi ■ .........................................................................................129
Chapter 8: A LAMP of Your Own ■ ....................................................................................149
Chapter 9: WiPi: Wireless Computing ■ ............................................................................181
Chapter 10: The Raspberry sPi ■ ......................................................................................199
Chapter 11: Pi Media Center ■ ..........................................................................................223
Index .................................................................................................................................243
www.allitebooks.com
xxi
Introduction
Despite sounding like something Grandma would bake on Sunday afternoons or a noise that would make people
glare and tut, the Raspberry Pi is in fact a computer. at much you probably knew (although, let’s be honest, the
name and logo don’t really give much away) but the Raspberry Pi promises more than that. An awful lot more.
e venerable Commodore 64 was released in 1982, and with sales reaching upwards of 17 million, it is often
considered the best-selling computer of all time. More importantly (at least from my perspective), it was also my rst
computer. For Christmas, just before my ninth birthday (when the C64 was nearly a decade old) I received the new
model (C64C), which was identical to the classic machine in all but cosmetics. It arrived all set up and attached to a
nice new 14-inch television (it even had a remote control!). I suspect my dad had hatched what he believed to be a
most cunning plan; if he could sneak in and set everything up while I was asleep, come Christmas morning, I would
be so busy playing with the computer that my parents might get an extra few minutes of sleep.
Sadly, things did not go quite according to plan. Although everything was set up, and even though the television
was tuned to the computer’s signal, one simple but key thing had been forgotten: it hadn’t occurred to anyone to tell
me how to actually load a game. Needless to say, a lie in was not forthcoming . . .
Games came on cassette tape. is was before CDs, and at least on the C64 had to be played in a special tape
recorder called a datasette. (What do you mean what’s a CD?) Sadly, the datasette spent more time in the shop than
being attached to my computer and as it was the only way to load anything into it, I had no choice but to occupy
myself with the manual. is I used to great eect and taught myself how to program good old BASIC (Beginners All
Purpose Symbolic Instruction Code—can you believe I actually remembered that?).
While I’m sure this story is very gripping, you could be forgiven for wondering why I am boring you with it. ose
events happened more than two decades ago, so what possible relevance could they have today? Well tinkering with
that machine and then the Amiga that followed it (still my favorite machine of all time) gave me a real appreciation
for what a computer could do. e Amiga was severely underpowered compared with PCs of the same era, yet it
consistently beat them with better graphics, better reliability, and better sound. It was able to do all of this because
the hardware was exquisitely designed. Amiga enthusiasts were some of the most resourceful people I’ve ever seen.
Who’d have thought you could turn a real–time clock port into a connector for high-speed storage?
All of this was only possible because people really understood how all the parts t together. ey knew how to
get the best out of the machine because they really knew how the machine worked. ese days, I spend my working
day trying to make fast things go faster. To have any hope of success, I too need to know how everything works.
Companies need people like me to push things forward, but they’re coming across a bit of a problem. People who
really know computers inside out are getting much harder to nd—we are a dying breed, and this is the situation that
the Raspberry Pi Foundation is desperately trying to reverse.
So what happened? Well, things changed. Computers went from being the curiosity in the corner to being a basic
part of everyone’s lives. ey evolved to the point where they just work and everyone knows how to use them. is
is similar to the family car. Everyone has a rough idea how a car works, but few people are very interested. e car
takes them from place to place, and that capability is what is interesting, not how the car achieves it. Computers are
generally seen in the same light. People have a rough idea about turning them on, installing software and so forth,
but how they actually work at a low level isn’t really seen as relevant or interesting. is in turn means that not only
are fewer people getting excited by computing itself but even fewer people think that there’s more to it than double-
clicking an icon.
www.allitebooks.com
■ INTRODUCTION
xxii
is problem has drifted up through schools and into universities. Teaching programming is a relatively
challenging task. It requires a certain way of thinking that for many people is tough to get a handle on. Traditionally,
universities would start a computer science course by teaching about logic gates, how memory works, and how to
program a CPU. Only once you understood what the bare metal was doing would you try to learn C because although
C is a higher language, it reects the hardware it runs on. Understanding the hardware makes understanding C that
much easier.
But with larger class sizes, more limited teaching time, and students arriving with less and less knowledge of
computing fundamentals, universities have had to adapt. Rather than teaching all that low-level stu, now they teach
Java and other scripting languages. Because these languages handle all of the “ddly bits” for you, you can eectively
pretend that they don’t exist (although this can cause some issues; see “e Innite Memory Myth”).
is is simply fantastic from a productivity point of view, but when you do want to take it to the next level (maybe
you’re processing data and your script is just too slow), you have no idea where to turn. Worse, when someone tells
you the technique for improving that performance, you have no idea what they’re talking about.
Of course not all universities have taken this route. I’m studying at the Hong Kong Polytechnic University, and its
course on Computer Architecture is very detailed and covers a lot of ground. If you want to get the top grade, you will
need to implement a CPU cache for the CPU simulator program. Needless to say, there is a lot to learn for everyone on
this course. at said, we need more than this. It’s too late to capture people’s interest when they’re starting graduate
studies. I taught seven-year-olds how to program BBC BASIC when I was in my last year of primary school (they even
got presented certicates by the school) and they loved it. Computing lets you create a virtual world with your mind
(the children liked to create little text–based adventure games) and ultimate power rested in their hands. ey got
creative; they added spells, new roads, secret entrances, and much more. Okay, they needed a helping hand (they
were only seven) but they had the desire to create and to build cool new things.
INFINITE MEMORY MYTH
Over the years, I’ve done a lot of consultancy work with large enterprise customers and that has inevitably meant
I’ve come across Java on many occasions. One of the interesting things I have come across is what I’ve termed
the Infinite Memory Myth. This seems to crop up more in Java applications than in other languages, but that’s
probably because Java tends to be more widely used in those settings.
The short version of the myth is that developers seem to constantly create new objects, often to the point where
the application consumes huge amounts of memory or crashes altogether. They tend to have no idea how much
memory each object takes or, more worryingly, why they should care. As far as they are concerned, they request a
new object and one is provided. When an object is no longer used (i.e., nothing points to it any more), Java will at
some point get around to cleaning it up (called garbage collection). All of this is automatic; the developer doesn’t
need to do anything.
The problem is that this leads people to forget (or in many cases were never taught at all) that memory is finite,
and at some point it simply runs out. You can’t assume that you can read in every row in a table and that it will
always work. You can’t assume that just because your test file is 50MB in size that the application will never be
given a 5,000MB file to work on.
This lack of understanding stems from not being able to appreciate all the hard work Java is doing on the
programmer’s behalf. It is running about and managing memory allocation and garbage collection, and the
programmer remains blissfully unaware. A good understanding of computing fundamentals would give a
developer keen insight into what Java is doing (both the how and the why) and thus appreciate that just because
creating new objects is easy, memory itself is not free.
www.allitebooks.com
剩余272页未读,继续阅读
huangyiye
- 粉丝: 0
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- stc12c5a60s2 例程
- Android通过全局变量传递数据
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0