The Little Printf (什么是真正的程序员)

little printf电子书 little printf电子书,pdf格式的。 立即下载

原文地址:The Little Printf
中文翻译:什么是真正的程序员

“My bad opinions”

This text is a transcript of a presentation I have given on October 9, 2015, at the CityCode conference in Chicago. This content is also available in video, and as a PDF Document better suited for printing.
—
在这里插入图片描述

Chapter 1

I’ve been lucky enough to have been born before computers and video games were ubiquitous. I had the luck to play outdoors with friends and my brother, and of inventing our own games.

We could be our own heroes, use a twig that would instantly become a bow, a gun, a sword, or a telescope. It could be anything, except maybe a boomerang because once you throw the stick away, you have to go fetch it back.

在这里插入图片描述
At some point I grew up, and it became embarrassing to play that way. You can’t treat a pinecone as a grenade and pretend to have magical powers when other kids think being an adult is cool. You just don’t fit in anymore. You eventually get pressured into growing up. Still, that’s a very lucky childhood.

At some point I got the chance to play video games, and to use computers. There could be the imaginary world you had wanted all this time, materialized in front of you. It’s consuming you, and for a moment you live a different life.

But there’s something particular about most video games: you don’t create, you react, you consume. I eventually did improvisational theatre as a teenager. Then, again, it was okay to be with people and create and pretend out of nothing.

在这里插入图片描述
Of course, improvisational theatre in Quebec is different; there’s an ice rink in there — everything’s hockey.

When I got to a vocational college to study multimedia from 2005 to 2008, I eventually tripped into programming work. I found it amazing! Creativity was there again, and it could get me money! I then designed the mechanism of my first game, and it blew my mind.

在这里插入图片描述
“That’s not a real video game,” I was told. “That’s just an HTML form. You should have used an array for the text and options it would have been better. The code needs cleaning up.”

I was a bit disheartened; the game was really about the 11 pages of text I had written for the “choose your adventure” aspect of it. But I realized that if I wanted to make stuff more people thought was good, I’d have to learn a lot.

I’d have to learn “real programming”. Move from JScript in a GUI toolkit to something better, like PHP. So I learned that, along with Javascript. Then eventually I was told to learn how to do real programming again; PHP is terrible. I was told to maybe try Python, which I then learned.

But real programmers knew fancier stuff, and python’s lambdas didn’t cut it, object-oriented programming was not where you wanted to be. Reading SICP would be the next good step, I was told, because it was like the bible of computer science.

在这里插入图片描述
That got me to Scheme. And I got the K&R book because real programmers in the real world did C, and I registered for part time classes at my local university while juggling them with work, because real programmers knew data structures and math, which I learned to some extent. I started reading papers and books, because real programmers stayed up to date and knew fancy algorithms.

Somewhere through that I picked up Erlang and started making a career out of it. I wrote a book on it. Curiously enough, nobody ever questioned if I were a real author, or a real writer, or a real illustrator. Hell, I got a job teaching Erlang without ever having used it in a production system.

Chapter 2

So I lived my life flying around the world, telling people how to do things I had sometimes never done myself, while everyone suddenly seemed to believe I was a real programmer because of things I did that were mostly not related to programming in the first place.

One day, I was stuck in an airport coming back from a conference, furiously typing at a terminal, when an odd, gentle voice asked me:

“If you please, design me a system!”

“What?!”

“Design me a system!”

I looked up from my screen, surprised by the request. I looked around and saw this kid who aspired to be a developer and wanted me to call him “printf”, which I felt was very stupid and gimmicky. He looked a bit like this:

在这里插入图片描述
“I don’t know computers much yet, but it seems you do. I want to write programs and blog about them and have people use and read them. Please, design me a system!”

Now that was a surprising request, and I had been awake for 20 hours by then, not too sure I fully understood or felt like it. I told him systems were hard. I didn’t know what he wanted to do, how he wanted it to fail, how many readers it should support, where he’d want to host it, and I could therefore not design a proper system with so little information.

“That doesn’t matter. Design me a system.”

So I made the following architecture diagram:

在这里插入图片描述
He looked at it and said “No, this system is not good enough. Make me another.”

So I did:

在这里插入图片描述
and I gave him a rundown of how it would work.

My new friend smiled politely. “That is not what I want, it’s way too complex and does a lot of stuff I don’t need”

I felt a bit insulted, having considered redundancy, monitoring, backups, caches and other mechanisms to reduce load, external payment processor for legal protection, failovers, easy deployment, and so on. I could have charged decent money as a consulting fee for that! Out of patience, I just drew this:

在这里插入图片描述

And I added: “this is your design. The system you want is inside the black box,” hoping this shitty answer would have him leave me alone. But I was surprised to hear back:

“That is exactly the way I wanted it!”

And that is how I made the acquaintance of the little printf.

Chapter 3

I soon learned of this little guy’s portfolio. In his repositories were only small programs, simple web pages with forms, trivial command line utils. They would be unspectacular, would come into being, and no sooner disappear.

Then at some point, he started working on a bigger program, that used multiple modules. It needed sockets, accessed the disk, talked to an actual database. When it first built and ran properly, little printf was amazed. But the program was not enough yet.

It needed refactorings, better tests, documentation, linting and analysis. The program would run for a while, and one morning, it crashed.

And it crashed again, and again.

The configurations were wrong, the logs would not rotate, the disk had unpredictable speed, the network would get the hiccups, bugs would show up, the encodings would be confused, the database needed vacuuming, transactions would hang, certificates would expire, CVEs would keep coming, and the metrics would remain silent.

在这里插入图片描述

It kept turning to Spaghetti.

He told me: “the fact is I didn’t know anything! I ought to have judged by my needs. I got the hubris of writing a fancy system, and I spent so much time fixing it, it felt like it cancelled the time it saved me. Still, I should have known what a wonderful thing it was.”

One morning, he decided to leave his office. “Goodbye”, he said to a blinkenlight that seemed to have burnt out. He left to see what the world of software had to offer aside from his messy little server.

The logs would keep accumulating, until the hard drive would fill no more.

Chapter 4

在这里插入图片描述
He went to a workspace, looking for experienced developers from whom to get tips and help.

The first one he met was a very proud senior engineer who seemed to feel rather superior.

在这里插入图片描述
“Ah, here comes a learner! Welcome to my domain, of which I am the expert” he said.

“An expert?” Little printf asked. “Does this mean you can program anything and everything?”

“Yes!” the expert answered. He added “Well almost; I only program programs that are worth programming. I don’t lose my time on trivialities. Many programs I have never written but could write with all the ease in the world.”

“Ah, so could you help me with my system?” As soon as the little printf started explaining his business, the domain expert interrupted him:

“I’m sorry, but I don’t really see the point of doing that.”

“Why not?”

“Experience. I am good at programming the things I program, and I program things I am good at. By getting better at this fairly restricted set of things I’m already good at, I make sure I’m more valuable than ever at it. Call it job security, call it survival of the fittest, but that’s how I roll.”

“And why can’t you help me?”

“Well you see, taking my time away to help you means I divert important self-investment into furthering the progress of others — that’s a losing strategy for me. The best way to learn for you is the way I took myself: struggle very hard and figure it out yourself. It helps forge character.”

“That doesn’t seem very efficient…”

“Well you can go to school and learn, or you can learn on your own. Really what it does is weed out the lazy people who just want it easy, and forces everyone who stays here to be those who really deserve it. The moment we let moochers in, the very value of the work I produce goes down with it.”

“Do you not think cooperation or colleagues could help you?”

“Not really. I work best when left alone and not being distracted. Every time I end up forced working with others, it’s nigh impossible to get our stuff working together. Out of exasperation, I grab their work and rewrite most of it in a sane way; then it works right.”

Little printf was surprised to meet an expert who seemed so disinterested in helping others, yet so annoyed by their perceived lack of skill. It was a bit sad that this man narrowed his vision of himself to just the one area he knew, to the point where he didn’t do anything else than create problems for himself to fix!

“I see… well I guess I’m happy you won’t give me your help”, said my little friend

“What do you mean?” asked the meritocratic man, whose value seemed suddenly downgraded. “Don’t you think the work I do is interesting?”

“Oh that I do. It just seems like you would see me as a hindrance and annoyance more than anything else, and what I am looking for is help, not affliction.”

And little printf left swiftly, leaving the expert to realize he had made himself untouchable in more ways than just his job security.

Chapter 5

在这里插入图片描述On his way, little printf went in front of the door to an office occupied by a man surrounded by thick hardcover books, with fancy images on them like wizards and dragons and fractals and mathematical patterns.

“Nice books, sir”, said printf

“Thanks. I think they’re essential material for programmers. If you don’t have them, you’re not really a pro”

“I guess I’m not a pro then”, said little printf. “Which one is your favorite?”

“Oh, well I haven’t read most of them.”

“Are you not a good programmer then?”

“No, I am not.” The developer proudly added: “In fact, I’m a terrible programmer.”

“That’s a shame”, said little printf, who continued: “I’m getting better myself.”

“Have you heard of the Dunning-Kruger effect?”, asked the man.

“No, what is it?”

“It’s a cognitive bias thing. It basically says that people who are less competent tend to overestimate their qualifications, and people who are competent tend to systemically underestimate theirs.”

“So if I think I’m getting better, I’m probably not great”

“Yeah, exactly. You’re probably bad. On the other hand, I openly say I’m a terrible programmer. But according to Dunning-Kruger, I’m probably underestimating myself, and that makes me a good developer, don’t you see?”

“I guess?”

“That’s because self-deprecation is a vital tool of the developer. The moment you feel you’re good, you relax and stop improving.”

“Doesn’t this mean that the moment you feel good about yourself, you’re on your way to failure and then you should feel bad?”

“yes. But the way to go about this is to say that everything is terrible, even if you have no solutions to offer. That way you look smart, but don’t have much to contribute.”

“What do you mean?”

“Say I go online and see a project I dislike. The trick is to point out everything that is wrong, give no more information than that. You can probably subtly point ways in which the person who did the thing is an idiot and get away with it.”

“And how is anyone better for this?”

“Well I like to think they are better for knowing they’re on the wrong track, and I’m better off for showing them that. It’s a bit of smoke and mirrors. Nobody knows what they’re doing but that way it looks like I do.”

“And what happens when you are asked for help and can’t do anything about it?”

“That’s when you go back to saying everything is terrible; you have too much yak shaving to do, improving other things, and being overly pessimistic. They’re on their own.”

“So this is all posturing? You’re gaming your way through? You’re the person who pretends to be incompetent at things they know, which makes people who actually know nothing there feel even worse, and you’re the person who pretends to be competent at things you don’t know, so that people trying to improve there also feel bad.”

“In any case, competence has very little to do with it. Reputation is pretty important though. People hire friends, and people who aren’t liked and non-essential get fired first; try to change the system and you become disliked. It’s all a very social game. It’s how it works in the industry, and probably in academia too, though I wouldn’t know, now would I? It’s all about who you know, selling yourself, your own personal brand you know? That’s how you get jobs in the business.”

“If this is how things are and that you must feel bad and make others feel bad to do well, maybe I don’t want a job in the business”, said little printf, before walking out.

Chapter 6

在这里插入图片描述
During the time that would have been lunch break, Printf interrupted a person who had seemingly forgotten to eat their lunch, a sandwich growing cold by the minute, while sitting at their desk and looking at their screen.

That seemed like quite a busy person who might have known what they were doing. Printf asked:

“If a primary database can fail, can the follower fail too?”

“Everything you run”, the person said, “can and will sooner or later fail.”

“Even the things telling you things have failed?”

“Yes, even these ones. All large systems are in some state of partial failure at any given time.”

“Then, trying to make reliable systems, what use is it?”

The person did not know, for at that moment, they were trying to answer a page for the sky falling out onto their head due to a broken cloud, wondering the same thing.

“Then making reliable systems, what use is it?” pressed little Printf again

Upset as the person was dealing with a production issue, with this kid not letting go and a sandwich going to waste, the person impatiently shot back:

“It’s of no use at all. Programming is all shit anyway.”

“oh!”, he gasped.

Then there was a moment of complete silence.

在这里插入图片描述

The little guy responded, with a hint of resent:

“I don’t believe you. Programs are fragile, but programmers can make good efforts and make things better and useful.”

No answer came back. At that point the person had opened the document explaining how to boot a new copy of the whole cluster from scratch, and things seemed to go from bad to worse.

“And you actually believe good reliable prog-”

“Oh no!” the person said. “No no no! I don’t believe in good or reliable programs! Not anymore! They’re all terrible! I just told you the first thing that came to my head because I’m dealing with one of these shitty systems right now. Don’t you see I’m trying to keep this stuff running? This shit is actually of consequence.”

Printf stared back, with a shocked expression.

“Actually of consequence? You talk just like a ‘real programmer’.”

He added:

“You mix everything up, confuse everything. There’s been millions of programs, and for years they’ve been running and failing just the same. And people have used them and needed them. And I know of some programs that run nowhere but on a single laptop, and in a single mistake could destroy entire communities, without even noticing. And you think that this is not important?”

The person remained silent.

Chapter 7

在这里插入图片描述
The fourth workspace my friend visited had a man whose computer was covered in so many stickers nobody could tell what brand it was.

“motor-mvc, quadrangular JS, GoQuery, cometeor, some japanese soundy thing, …”

“Hi,” interrupted printf. “What are you doing?”

“alchemist, bongodb, mochascript, walktime.js, portasql, …”, the man kept going

“What are you doing?”, he asked again, louder this time.

“Oh, I’m trying out new frameworks, tools, databases, languages.”

“Whoa, you seem to be going fast, maybe as fast as 10 programmers put together!”

“yes! well, the industry moves so very fast!”, he looked at his phone for a second, and added “there! the cardboard.io framework came up with version 3.5 which broke compatibility with 3.4 and this yielded 4 forks in the community! I have to try them all to know which to choose!”

“and what do you do learning all of these?”

“I’m an early adopter. If you don’t stay up to date you get stuck writing COBOL or MUMPS for a living. You want to find the next big thing, and ride the wave to the top!”

“Has it ever worked?”

“Oh yes! I found out about Rails before it got big, and I figured out node.js before it was popular, and I was on the first beta copies of redis and mongodb and riak! I was the first one to use vagrant and then I got us to switch to docker but of course now it’s all about unikernels…”

“Cool, and all these things you were at the forefront of, how did it pay off?”

“oh it didn’t; by the time rails became huge I had moved on to the next big thing so I didn’t get left behind. Similarly for the other ones. Here’s hoping for unikernels though”

“I see”, added little printf, pensively. “What problems do you solve with all of these frameworks?”

“Oh, I make sure we don’t use something that is not going to be big, so that this company doesn’t get to bet on technologies that have no future. It’s very important work, because if you don’t do that, you can’t find anyone to hire except old grey beards behind the times, and you want self-motivated go-getters, who are also early adopters.”, said the man.

“That is funny”, chimed our friend.

“It is very hard! in the startup world, if you want a-players, you need good technology to bring them in! Otherwise you’re stuck with inflexible laggards. Nobody wants to be an inflexible laggard.”

The little printf interjected: “No, that’s not what I mean,” and he then added “I mean it’s funny that tools are meant to solve problems for us, but for you, the tools themselves have become a problem.”

And while the man stood there in silence (on his new cool treadmill desk), little printf hopped out of the room.

Chapter 8

在这里插入图片描述
In the next office over sat a tired employee, with dozens of empty coffee cups, slouched over, typing angrily.

“Hi,” said little printf.

The woman didn’t stop what she was doing. She kept typing furiously.

“Hello?” he asked again.

The woman stopped at once, got a flask out of a drawer in her desk, and took a swig.

“I have a terrible job,” she said. “I do devops. It started okay, where I’d mostly develop and then sometimes debug stuff, but as time moved on, it got worse and worse. I started fighting fires in our stack, and then more fires kept happening. I got rid of most of them, pulling small miracles here and there to then meet the deadlines on dev stuff I also had to do”

“And did they hire anyone to help?”

“No, that’s the thing. Small fires kept happening here and there, and because of the time I took to fight them, I couldn’t be as careful as before with the dev stuff, so I created more fires all the time. Now I’m fighting fires all day and all night and I hate my job”

“Why doesn’t your employer do anything?”

“I’m good at my job, and I managed to keep things under control long enough that everyone got used to it. When you make a habit of small miracles, people get used to it. Then you’re stuck doing miracles all the time or they will think you won’t do your job at all.”

“That sounds very sad”

“It is; and because you’re the most familiar person with these fires, you get to only work on them more and more, until your employer hires someone else to cover your old job, the one you loved. If you care hard enough about your work to be the one doing the stuff everyone else hates, you’re thanked by doing more and more of that work you don’t like, until that’s all you do. And then there’s nothing left for you to enjoy.”

“Then you’re unlucky”, said little printf.

And her pager went off again.

“That woman,” said little printf to himself, as he continued farther on his journey, “that woman would be scorned by all the others: by the senior expert, by the rockstar developer, by the serial early adopter. Nevertheless she is the only one of them all who seems helpful. Perhaps that is because she is thinking of something else besides herself.”

Chapter 9

在这里插入图片描述
At the corner of the building, printf found a large office with big windows giving a stunning view of the area. In it sat an old gentleman with reams of documentation on his desk.

“Ah, here comes a developer” exclaimed the man, as printf stood in the doorway. “Come in!”

Looking through the windows, little printf noticed that they were full of writing. With the help of a dry-erase pen, the view to the outside world was masked by tons of circles, arrows, cylinders, and clouds. While it was curious the man needed clouds drawn where real ones could be seen outdoors, the whole ensemble was more intriguing.

“What is this?”, asked our friend, pointing at the windows.

“Oh this? This is our production system!” Said the man, not once thinking the question was about the outside world. “I am a software architect.”

“What’s a software architect?”

“Mostly, it’s someone who knows how to best structure and coordinates the components of a large system so they all fit together well. It’s someone who has to know about databases, languages, frameworks, editors, serialization formats, protocols, and concepts like encapsulation and separation of concerns.”

“That is very interesting!” said little printf, “here is someone who can answer all my questions!” He glanced at the architecture diagrams. “Your system is very impressive. Is it running very fast?”

“I couldn’t tell you,” said the architect. “It should, though”

“How’s the code then, is it good?”

“I couldn’t tell you”

“Are the users happy about it?”

“I couldn’t tell you either, I’m afraid”

“But you’re a software architect!”

“Exactly! But I am not a developer. It is not the architect who goes and writes the modules and classes, combines the libraries. The software architect is much too important to go around touching code. But he talks with programmers and developers, asks them questions, provides them guidance. And if the problem is looking interesting enough, the architect takes over the planning.”

“And why is that?”

“Because we are more experienced. We know more about systems and what works or not. Developers can then be an extension of our knowledge to produce great systems!”

“But how do you know if things are going well without getting involved with code?”

“We trust the developers”

“So you trust them to implement your ideas correctly, but not enough to come up with their own ideas?”

The software architect was visibly shaken by this comment. “I guess I might have been a bit disconnected”, he finally admitted. “The problem is that after a while you are asked to work with ideas so much you don’t have a good way to get them tested or verified…” he stared down, pensively. “Sometimes a software architect does neither software nor architecture, it seems.”

Little printf left the room, and being done with his visit, exited the building.

Chapter 10

在这里插入图片描述

Little printf, once outside, met a man collecting money for some charity.

“Hi,” said the man. “how would you feel about helping someone today?”

“It would probably make me feel better,” said little printf back. “I have been in this office all day, and now I’m more confused than ever.”

“Ah I see. These people are all developers. They are not really helpful, are they? What they love to say is that they’re changing the world, and they pretty much succeed at that, in fact.”

“Why does it feel so awkward, then?” Asked little printf.

“Well, the best they do is often help convert some people’s jobs into programs, or make everyone’s leisure more leisurely. Software is eating the world and that changes its face for sure… but deep down it’s the same old world, with a mangled face. The reason it feels awkward is that changing in that way doesn’t mean things are getting any better. We have the same flaws and problems we always had, the same holes to fill deep down inside.”

“So how can I feel better?” Little Printf was visibly anxious.

The man thought for a while, and offered printf to come help him help others, as this was this man’s way of feeling better. During the afternoon, printf told the man about his problems and his adventure. After a long silence, the man said:

“The games people play, the roles and reputations they chase and entertain, the fleeting pleasure they derive from solving intricate problems, is all fun for a while. Ultimately though, if you do not solve anything worthwhile, if you forget about the people involved, it’s never gonna be truly fulfilling.”

“And that may be fine, and it might not be, and you may or may not get that from somewhere else than your workplace when you grow up. Work can be work; it can be for the money, it can be for the fun of it. That’s okay. As long as you manage to get that fulfillment somewhere in your life.”

“In the end though, it is only when you solve problems with a human face that you can feel truly right; What is essential is invisible to the computer.”

“It is the time you have spent on your system that makes it so important”, the man added, “and when you lost sight of why it made sense to spend time on it, when it became a game of pride, it caused more grief than relief.”

“Developers have often forgotten this truth; If you lose sight of things, working on your system becomes its own problem, and the most effective solution is to get rid of the system, given it’s the problem.”

“It is only when you solve problems with a human face that you can feel truly right”, repeated little printf to himself, so he would remember.

Chapter 11

在这里插入图片描述Printf, who’s now sitting right in front of me, is on his way home. Talking with him made me realize how much of what I do flies in the face of what I liked, what I started programming for. Each of the people Printf met are roles I see myself taking one day or another over time. I was encouraged by them to become them, and probably encouraged people to do the same.

Where I got dragged in the game of trying to become a real programmer, Printf didn’t. He said he was okay with not being a real programmer, that he preferred to be a programmer with a human face.

Today I’m stuck in the situation where I look back, and have to figure out if I can, too, become a programmer with a human face; or if everything I do is just a job. There doesn’t seem to be too much that’s worthwhile in-between.

In any case, where printf felt he didn’t need to be a real programmer, I think I feel the same now.

【python】geopandas库安装出现各种问题?可以看看这篇文章 geopandas的安装方法 阅读详情

相关推荐

5分钟搞懂Paris公式:如何用裂纹扩展速率预测零件寿命(附Python代码示例)

本文详细介绍了Paris公式在裂纹扩展速率预测零件寿命中的应用,通过Python代码示例展示了从理论到实践的完整流程。文章涵盖了Paris公式的工程本质、寿命预测计算流程、几何修正因子选择以及实际案例演示,帮助工程师快速掌握这一关键技术。

weixin_29309475的博客 426

小Printf的编程故事:第三章

小Printf刚开虽然只能写一写简单的程序,但是随着自己的水平慢慢提升,也尝试开发了一个较为大型的系统,使用了多种模块。但是,毕竟还是太年轻,很多问题没有处理好,导致程序不断崩溃。认识到了自己的不足,他决定走出去,向偌大的软件世界学习、求助。 - 上一章 我很快就弄清楚了这个小家伙目前的成果。他的代码仓库里面只有一些小程序,带有表格的简单网页以及一些命令行脚本。它们都没有什么出彩的地方,创建

心·随自在飞 BLOG 892

博图HMI多语言文本列表一键生成攻略:从Excel模板到TIA Portal的完整流程

本文详细介绍了如何利用Excel模板和TIA Portal API实现博图HMI多语言文本列表的一键生成。通过标准化Excel模板设计、解析TIA Portal的XML结构,并结合C#代码实现自动化导入,大幅提升多语言项目的开发效率。特别适用于需要支持多语言版本的自动化设备HMI界面开发。

weixin_26934905的博客 218

STM32 UART串口printf函数应用及浮点打印代码空间节省 (HAL)

在应用STM32的UART接口打印输出串口字符信息时,可以通过printf函数的重载和应用实现。但要打印输出浮点数据时,采用常规方式,对于Flash空间小的MCU,常常出现代码空间不够的报错,这里设计了替代的函数实现浮点转字符,从而解决空间不够报错的问题。............

Pegasus的软件博客 7726

一分钟教会你搭建steam新游幻兽帕鲁服务器

总结: 游戏对服务器搭建要求相对较高、且对服务器网络协议有要求不能封堵UDP、多开、游戏运行久、同时在线人数多了这些会很吃内存 我自己用的64G内存多开4区测试玩家同时在线50多人的情况下内存已经跑满了、对于想用服务器搭建联机的小伙伴建议根据开区数量以及玩家人数去选择配置、当然也可以直接找我阿杰购买、我可以提供技术搭建服务。注:如果用的是本地电脑局域网搭建直接输入127.0.0.1:8211就行 如果用的是服务器搭建输入自己服务器IP+端口或解析的域名+端口进入游戏。

用最简单的方式说最重要的事!服务器、存储、云计 算、A智能的大数据产品、游戏开发技术。致力于广 大开发者、政企用户、各项机构等,构建云上世界提供全方位云计算解决方案。旨在打造差异化的开放式闭环生态系统帮助用户快速构建稳定、安全的云计算环境。 2233

Maven

是一款自动化构建工具,专注于Java项目的构建、依赖的管理。

weixin_58738870的博客 2161

小printf的故事:真正的程序员?

转载出处:http://kb.cnblogs.com/page/570194/ 作者: Fred Hebert  来源: 程序师  发布时间: 2017-06-06 10:03  阅读: 3971 次  推荐: 14   原文链接   [收藏]     英文原文:The Little Printf(PDF电子书)   第一章   (推荐看完整篇文

smartcore 1256

解锁 Bootloader 不再难!HyperOS澎湃系统小米与红米手机通用

必要时,可以在工具右上角安装驱动模块,手动安装驱动。解决方法:确保手机升级到最新稳定版,登录同一个小米账号,并在。新机型解锁时需要等待一段时间,通常为 7 天。如果账号安全评分较低,解锁等待时间会更长。如果解锁失败提示权限不足,说明账号存在安全问题。出现这个错误时,通常是因为网络不稳定。如果解锁次数已满,需要等到下个月。解锁后,手机会重启,首次开机会稍微慢一些,等耐心等待即可。按钮,开始解锁过程,注意:解锁会清除手机内所有数据。7次,开启开发者选项。,右键解压到指定文件夹。,使用小米账号登录。

代码简单说 Vue、JAVA、PHP、Node.js 熟练运用,接口、架构、性能全搞定。 7215

小Printf的编程故事:第一章

原作者Fred Hebert,是一名加拿大程序员,写过一本Erlang入门书籍。这个故事的英文名叫The Little Printf,是他在今年10月份芝加哥的CityCode大会上所做的一次分享的内容,模仿了法国经典名著《小王子》,其中夹杂着他自己学习编程的一些经历。这个短篇故事一共有11章,其中的插画按照作者的介绍,应该是他自己画的。想看原作者分享的朋友可以前往YouTube。译文如有不妥之处

心·随自在飞 BLOG 1496

ABAP 7.40 FOR 表达式与 REDUCE 构造运算符深度解析:从语法新特性到真实项目实践

ABAP 7.40引入了FOR和REDUCE表达式语法,使代码更简洁和函数式。FOR支持内表迭代和条件迭代,可配合VALUE构造新内表,替代传统LOOP。REDUCE用于归约运算,将多值折叠为单一结果,如求和、拼接等。这些新特性让ABAP更现代化,与SAP新架构协同更好,提升了开发效率和代码可读性。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 315

TPAMI 2024 | MO-MIX:基于深度强化学习的多目标多智能体协同决策

深度强化学习(RL)已被广泛应用于解决复杂的决策问题。在许多现实世界的场景中,任务通常有多个相互冲突的目标,并且可能需要多个智能体进行合作,这些是多目标多智能体决策问题。然而,在这个交叉领域的研究工作还相对较少。现有的方法仅限于单独的领域,并且只能处理具有单一目标的多智能体决策,或者具有单一智能体的多目标决策。在本文中,我们提出了MO-MIX来解决多目标多智能体强化学习(MOMARL)问题。我们的方法基于集中训练与分散执行(CTDE)框架。

小白学视觉 1128

什么是真正的程序员:A Little Printf Story

转自:http://www.cnblogs.com/xueweihan/p/5220513.html 什么是真正的程序员 这篇文章的原文来自:A Little Printf Story 作者仿照《小王子》中的情节,通过小printf遇见的不同类型的程序员,最后悟出什么才是真正的程序员! 第一章 (推荐看完整篇文章,再回过头看一遍第一章) 我非常幸运出

雲泥有別 尘亦生辉 411

Python爬虫实战:Boss直聘职位数据采集实战 - Playwright + 结构化解析完整方案(附CSV导出 + SQLite持久化存储)!

我长期专注 Python 爬虫工程化实战,主理专栏 《Python爬虫实战》:从采集策略到反爬对抗,从数据清洗到分布式调度,持续输出可复用的方法论与可落地案例。内容主打一个“能跑、能用、能扩展”,让数据价值真正做到——抓得到、洗得净、用得上。

喵手的博客 2185

小printf的故事:什么是真正的程序员?

第一章 (推荐看完整篇文章,再回过头看一遍第一章) 出处:http://www.cnblogs.com/xueweihan/ 我非常幸运出生在一个电脑和电子游戏还没有普遍的时代。所以我可以和我的小伙伴们一起玩耍,同时发明属于我们的游戏。我们十分会玩:用树枝做成回旋镖。我们可以用树枝做出任何东西,除’回旋镖’。因为你把树枝扔出去,你需要自己捡回来。(作者这个故事是活跃气氛吗?) 当我们长大了,

许西城的博客 1499

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

printf中用%d输出一个float的结果

在c中如果有这样一段代码  float f = 125.5; printf("%d\n",f);  那么他输出的绝对不是125.5;原因是c不像java能够自动隐式转换,除非你在printf函数中的f前加一个(int)进行强转可以得到你想要的结果,那到底像上面那样写会得到什么结果又为什么呢?   了解一下几点知识就行 ①intel CPU是little-endien ②print...

lolichan的博客 3350

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

printf参数,little endian,初始化列表来初始化

1,假设在一个 32 位 little endian 的机器上运行下面的程序,结果是多少? 解析: 1,大端字节序:高位存储在低字节   小段字节序:低位存储在低字节 2,printf是一个库函数,C,C++中函数的参数是从右往左入栈的; 3,栈的生长方向是从高往低的 4,%d格式输出的是4个字节大小,而long long为8个字节 5,printf函数的原型是printf(c

L未若的博客 668

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

开源软件学习笔记 - little_flash + littlefs

类似SFUD,支持spi nand flash,对于nand flash,最好增加文件系统,可使用little_flash直接进行flash操作,但不推荐NAND FLASH直接操作,推荐使用文件系统littlefs。不过,注意这个little_flash是比较新的开源软件,还不是很完善,目前的版本是0.0.1。littlefs主要用在微控制器和flash上,是一种嵌入式文件系统。主要有3个特点:1)掉电恢复在写入时即使复位或者掉电也可以恢复到上一个正确的状态。2)擦写均衡。

pq的博客 1674

判断程序运行的平台是little-endian还是big-endian

#include //判断程序运行的平台是little-endian还是big-endian bool IsLittleEndian(){ int i = 1; char* p = (char*)&i; return *p;}int main(){ if(IsLittleEndian())  printf("LittleEndian/n"); else  printf("BigEndian/n")

majcos的专栏 1724

little endian c语言,c语言那些细节之little-endian和big-endian

知道大小端,但是都没有整理下,只知道网络要用到big-endian,也就是大端模式。在各种计算机体系结构中,对于字节、字等的存储机制有所不同,因而引发了计算机通信领域中一个很重要的问题,即通信双方交流的信息单元(比特、字节、字、双字等等)应该以什么样的顺序进行传送。如果不达成一致的规则,通信双方将无法进行正确的编/译码从而导致通信失败。目前在各种体系的计算机中通常采用的字节存储机制主要有两种:Bi...

weixin_35120567的博客 358

Printf可变参数使用

本文的二个重点: 1. 可变参数实际上通过首个参数的地址来获取其它参数的地址,因为是顺序存储传过来的; 2. 可变参数为了处理方便,所有的浮点型都是按照double型压栈; 因此,像printf采用的可变参数,它只需要使用%f显示double型,不需要管float型。

春夜喜雨的专栏 1469

假设在一个 32 位 little endian 的机器上运行下面的程序,结果是多少?

假设在一个 32 位 little endian 的机器上运行下面的程序,结果是多少? 1 #include <stdio.h> 2 int main(){ 3 long long a = 1, b = 2, c = 3; 4 printf("%d %d %d\n", a, b, c); 5 return 0; 6 } 1 printf()是一...

weixin_30376453的博客 760

little skill

Cons_printf(             "%s (VA=%p  %d %s)\n",             PlxSdkErrorText(rc),             Va[i],             (Size > (10 > 10) : Size,             (Size > (10             );

supenman_mwg的专栏 330

Little-endian big endian 端模式

big endian的意思就是高位在前,低位在后,little endian则相反.一言以蔽之,big-endian就是符合我们大脑的思考。而little-endian是符合机器处理的。不要想太多。 判断大头和小头的方法: #include             int   main(int   argc,   char   **argv)   {

真知在行动中沉淀,经验在学习中提升。 708
上一篇: Thinking in Java :关于Java在异常处理中的缺陷
下一篇: java 泛型中? extends Class和? super Class的意义和PECS原则
coderALEX
博客等级 码龄11年 19粉丝 53原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值