Q: Pool teacher, I am not an interactive person, but you have all the articles I read, thank you very much for your guidance, I started the life of the first MBP. Now the problem is, but you can't find the right person to answer, only you, if you have time. The problem is this: I have a 32bit Unix file (open a service process), and the error message on the MAC is: Exec format error, but it can be performed on a Linux server, why? Is there a scenario on the MAC that you can run? We look forward to your reply and appreciate it.
A: Linux and OS X are different operating systems, and you can try recompiling the file in OS X.
Q: Thank you very much! If there is no file source code is not the only fate?
A: You can install Docker on the MAC and then port map the service.
A: an epiphany. Sheich teacher.
These are the conversations I had with a reader, who, after getting the answer, vanished like a wisp of soot and never appeared again.
After adding a lot of mactalk readers to a micro-letter, you often get weird questions about the workplace, about choices, about friends, about Macs, about technology, and so on. But I can answer very few. The problem is not easy to answer, the problem is too complex to answer, problem areas beyond my understanding can not answer, time-consuming too long question I also have no time to answer, is ashamed of the tight. Fortunately, occasionally can also help some small partners to solve some practical problems, psychological slightly comfort, such as the above problem.
Translating this conversation between the programmers is roughly the story:
One reader has a 32-bit Unix executable that works well on some version of a Linux server, running the file as a process, opening port, and interacting with other programs. But this file has no way to run on the Mac. Just when he was lying on the Mac Chouchangbaijie in desperation, suddenly thought of "pool teacher". Is this the old man who praised the Mac like a rose, let every programmer to pick it? Prickly now, you don't care who cares? So he sent me the message, meaning that the tube also have to tube, regardless of the tube, you see do.
It is not difficult for me to get a look at the problem. Linux and OS x although the division of the same door, are from the senior Unix graduate, but after all practice each, in Linux compiled programs can not be used on OS X, but on OS X recompile may be fine. I told the programmer the idea, the feedback is: Sorry brother, no source code!
I was shocked by this grim response and immediately realized that the idea was not an optimal solution, because the dependencies and compilation errors of the various packages were enough to make you burn in the process of recompiling, and I immediately provided plan B: Install Docker on OS X, lightweight containers Docker You can run various versions of Linux, throw files into the Docker, and then easily fix the problem with port mappings between host and Docker.
Although this will involve a lot of technical details, but the direction is no problem, so the programmer immediately said ""biu"", and then the sound of the screen disappeared in the opposite, did not leave me to say "not welcome" opportunity.
This problem can be solved by installing a Linux virtual machine, but the virtual machine is too resource intensive and not as flexible as docker, so it is not the best solution. Docker is.
As a programmer, we have to master a number of programming languages and a variety of databases, to understand front-end technology, back-end technology, familiar with the network seven-tier architecture, know TCP/IP three handshake and four wave, write beautiful code, design beautiful architecture ... In addition, we have to solve problems in research and development, program operation and product line, and are asked to solve the problem with the lowest cost ... Is it easy for us?
In addition to programming skills and program design capabilities, the resolution of the problem is a good measure of whether a programmer is one of the important factors, but also the real value of senior technical staff. In the surging tide of technology, technical information on the faces of today, a newly-graduated college student who is diligent enough to master a programming language within two or three months and write a very good software that is faster than any of us old programmers, but can only rely on time to solve problems. , experience and bitter lessons. Sometimes it takes inspiration and luck.
Many Army fans read a large number of military writings and historical novels, often envious of the style of those famous, and Hao Huan himself "untimely". But the name is not so easy to refine. In history, the names of hoot are rare, they personally hold a knife to go in pursuit of the enemy, see the battlefield of the tragic, witnessed the body of the enemy, saw his comrades killed, know that the knife fancy will bleed to death, they are ruthless, rock solid, in the army is about to collapse when the enemy's weakness and attack, in the fast-changing battlefield , after many failures from the corpses of countless soldiers to stand up again to challenge the defeated your opponents, in all the people say to you "instructor, we go on", firmly say that three words: And so on!
If you can't do this, then be a soldier who will eventually be picked by Zhang Fei's gun.
The same is true of excellent programmers, rookie often envy the master in the laughter between the trouble to ashes, but they are hard to think about the law, but they have also experienced the great names of the reign. They write code in the early morning light, in the roar of the room debugging procedures, they stay up all night to solve a bug, they have to endure data loss or online failure of the pain, silently swallow tears, ready for the next battle. Continuous learning, practice and thinking, thousands of hours later, the master began.
The same problem, the master of the solution and small ball is very different. Generally speaking, as long as not the world problem, give enough time, space and manpower, can solve. If you encounter problems to tell superiors, this issue to me, two years to do a good deal, then do not blame the project team to shoot you out, because we want to be divided into minutes, not two years. In this only fast-breaking era, we do not have so much time, so we must through reverse thinking, lessons learned, maneuver, through force and so on to minimize the cost of solving the problem quickly. This is the value of old programmers.
To take another example, a good online application after you have modified the bug to add the function of the online there are some puzzling problems, such as the use of resources to increase or run for a period of downtime and so on, how to solve?
The general practice is to locate errors by reading logs, simulating online environments, and debugging programs. Easy bugs can be basically done in these ways, but more subtle bugs can take a lot of time and manpower. What's the better way?
First, the investigation is a program or environmental issues, the online program to restore the old version of the normal operation, if there is the same problem, that is, the production environment has changed. If it works, either you introduce a new bug when you modify the old bug, or you have a problem with the newly added code.
Secondly, read the changelog of the product, according to the time line of the code submitted to build the system, through the two-point method to troubleshoot, positioning is what part of the code caused by the problem.
Third, the exclusion of all the impossible, the rest, no matter how impossible it seems, is that it does.
The above is just a simple example, the actual situation may be 100 times times more complex than this example, we need to synthesize a variety of ways to cross-compare and error-checking to solve. This is just a matter of solving problems, more of a time when you need to ask questions and solve problems, which is a higher state.
Many people learn so many programming languages, wrote more than 10-year program, eventually still can not achieve the minimum cost to solve the problem, can't help but sigh.
What is the real value of programmers? Solve the problem with minimal cost! The unity of knowledge and line can be invincible in the world.