Vuefity is Material Design Component Framework for Vue. Highlights:
Ready-Made Project Scaffolding: Vuetify comes ready to go with 8 pre-made vue-cli templates. From simple html to full-blown SSR you are ready to go in minutes.
Semantic Material Components: Be prepared for an armada of specialized components at your disposal. With over 80 in total, there is a solution for any application.
Vibrant Community: When you run into a roadblock, you need assistance right away. Vuetify offers chat support in our growing community on Discord.
Create a project using Vue and Vuetify
1 2 3 4 5
npm install @vue/cli -g vue create my-app cd my-app vue add vuetify npm run serve
The rabbitmq-management plugin provides an HTTP-based API for management and monitoring of RabbitMQ nodes and clusters, along with a browser-based UI and a command line tool.
It periodically collects and aggregates data about many aspects of the system. Those metrics are exposed to both operators in the UI and monitoring systems for long term storage, alerting, visualisation, chart analysis and so on.
The management plugin is included in the RabbitMQ distribution. Like any other plugin it must be enabled before it can be used. That’s done using rabbitmq-plugins: (Node restart is not required after plugin activation.)
Using ‘RabbitMQ Command Prompt (sbin dir)’ to run the following command:
Request - Simplified HTTP client. Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.
1 2 3 4 5 6
const request = require('request'); request('https://www.google.com', function (error, response, body) { console.log('error:', error); // Print the error if one occurred console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received console.log('body:', body); // Print the HTML for the Google homepage. });
request-promise
The simplified HTTP request client ‘request’ with Promise support. Powered by Bluebird.
If you like the promise style, use this instead of the request directly.
1 2 3 4 5 6 7 8
var rp = require('request-promise'); rp('https://www.google.com') .then(function (htmlString) { // Process html… }) .catch(function (err) { // Crawling failed… });
Make sure you select a LTS(Long Time Support) version of Ubuntu server
update installed services
1
apt-get update
Webmin
Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely.
VPP means “Volume Purchase Program”. The Volume Purchase Program allows businesses and educational institutions to purchase your apps in volume and distribute them within their organizations. Contract developers can also offer customized apps to customers who have a Volume Purchase Program for Business account.
It is said ‘Whether you have ten employees or ten thousand, the Volume Purchase Program makes it simple to find, buy, and distribute apps and books to meet your every business need’. It just a way to help our customer distribute our App. Customers need to register an account from Apple to use it first. Then “Using an MDM solution, assign apps directly to your devices or invite users to participate if distributing via Apple ID.”
Develop Custom Apps for Business
It allow you to engage with business customers to design and build customized apps that work best for them. Custom B2B apps are delivered privately through the Volume Purchase Program. You can distribute to authorized buyers that you identify, giving your business customers privacy and security.
Customize Apps
Meet the unique needs of businesses by privately offering custom B2B apps to Volume Purchase Program for Business members.
Tailored look and feel, such as company logo or branding
Specific functionality for a business process or workflow
Special configuration for IT environments
Security features for sensitive or private company data
Custom features for partners, dealers, or franchises
Distribute Privately
Custom apps are distributed privately to authorized Volume Purchase Program for Business members that you identify in iTunes Connect. Customers sign in and purchase their apps on the Volume Purchase Program store.
Submit as B2B apps
Setup and develop is the same as normal apple store ones. Only the submit is a little different. Select the custom B2B distribution option in iTunes Connect. If your app contains sensitive data, provide sample data and authentication for our review team.
What Business Customers Need to Do
Enroll: Once your customer has a volume purchasing account with Apple, they can easily buy apps that meet their business needs, and get custom B2B apps you’ve built for them.
Purchase: Custom B2B apps will appear in your customer’s Volume Purchase Program account. Customers select the app and enter the quantity they want to purchase on the Volume Purchase Program store
DistributeYour business customers can use third-party Mobile Device Management (MDM) solutions to help manage and distribute their apps. Or they can provide redemption codes to their users via email or an internal website.
In JavaScript, which types are pass by reference? And which types are pass by value? How to pass a variable by reference?
Simply speaking, objects are pass by reference. Basic types are pass by value. We can pass basic types by reference using boxing technique.
Pass by reference and pass by value is a basic question. It is fundamental part to understand how does JavaScript’s memory work. It is hardly to have further discussion without understanding reference.
In coding session, we use questions like how to write a json object copy function to assess candidate.
Sometimes, we ask about the difference between == and ===. And then, true or false of [1] == [1]. Without a good foundation, candidate may make a wrong conclusion because of the wrong understanding of == and ===.
How to judge whether a interface is asynchronous? Is it asynchronous while a callback provided?
This is a open question, you can have your own way to judge.
Simply use the callback function is not asynchronous, IO operation may be asynchronous, in addition to the use of setTimeout and other ways are asynchronous.
How to implement a Sleep function?
1 2 3 4 5
functionsleep(sleepMs) { var start = Date.now(), expire = start + sleepMs; while (Date.now() < expire) ; return; }
Node.js Modules
What is V8 module
We are not talking about V8, but V8 module in Node.js. It’s used for opening built-in events and interfaces of V8 engine in Node.js. Because these interfaces are defined by underlying part of V8, so we can’t say it’s absolutely stable.
Is the Eventemitter.emit synchronous or asynchronous?
Synchronous.
Events module is a very important core module in Node.js. There are many important core APIs in the node that depend on Events , for example, Stream is implemented based on Events, and fs, net, ‘http’ are implemented based on ‘Stream’, ‘Events’ is so important to Node.js.
The EventListener calls all listeners synchronously in the order in which they were registered. This is important to ensure the proper sequencing of events and to avoid race conditions or logic errors.
And when you destroy this class, don’t forget to destroy these emitters too , because inside the class, some listener may cause memory leak.
if a website has a interface A, and in some cases, interface A can be the endless loop, unfortunately, if you triggered this endless loop, what will be the impact on your website?
If endless loop logic trigger in your website, the whole process will be blocked, and all request will timeout, asynchronous code will never be executed, and your website will be crashed.
In Node.js environment javascript code has only one single thread. Only the current code has been executed, the process will cut into the event loop, and then pop out the next callback function from the event queue to start the implementation of the code, as long as an infinite loop can block the execution of the entire js process
How to implement an async.reduce
You need to know that reduce is analyze a recursive data structure and through use of a given combining operation, recombine the results of recursively processing its constituent parts, building up a return value.
What’re the difference between child_process.fork and fork in POSIX?
In Node.js, child_process.fork() calls POSIX fork(2). You need manually manage the release of resources in the child process for fork POSIX. You don’t need to care about this problem when using child_process.fork, beacuse Node.js will automatic release, and provide options whether the child process can survive after the parent process is destroyed.
Does the death of parent process or child process affect each other? What is an orphan process?
The death of a child process will not affect the parent process. When the child process dies (the last thread of the thread group, usually when the “lead” thread dies), it will send a death signal to its parent process. On the other hand, when the parent process dies, by default, the child process will follow the death. But at this time, if the child process is in the operational state, dead state, etc., it will be adopted by process identifier 1(the init system process) and become an orphaned process. In addition, when the child process dies(“terminated” state), the parent process does not call wait() or waitpid() to return the child’s information in time, there is a PCB remaining in the process table. The child process is called a zombie process.
IPC(Inter-process communication), Before IPC channel was set up, how the parent process and the child process communicate between each other? If there is no communication, how is IPC set up?
When you create a child process via child_process, you can specify the env (environment variable) of the child process. When starting the child process in Node.js, the main process sets up the IPC channel first, then pass the fd(file descriptor) of the IPC channel to the child process via environment variable (NODE_CHANNEL_FD). Then the child process connects to the parent process via fd.
Finally, for the issue of inter-process communication (IPC), we generally do not directly ask the IPC implementation, but will ask under what conditions you need IPC, and the use of IPC to deal with any business scene.
What is Daemon Process
Daemon Process is a very basic concept of the server side. Many people may only know that we can start a process as a daemon by using tools such as pm2, but not what is a process and why using it. For excellent guys, daemon process implement should be known.
The normal process will be directly shut down after the user exits the terminal. The Process starting with & and running in the background will be shut down when the session (session group) is released. The daemon process is not dependent on the terminal(tty) process and will not be shut down because of the user exiting the terminal.
What is Buffer
Buffer is the class to handle binary data in Node.js, IO-related operations (network / file, etc.) are all based on Buffer. An instance of the Buffer class is very similar to an array of integers, but its size is fixed, And its original memory space is allocated outside the V8 stack. After the instance of the Buffer class is created, the memory size occupied by it can no longer be adjusted.
New Buffer () interface was deprecated from Node.js v6.x, The reason is that different types of parameters will return different types of Buffer objects, So when the developer does not correctly verify the parameters or does not correctly initialize the contents of the Buffer object, it will inadvertently introduce security and reliability problems to the code.
What is String Decoder
String Decoder is a module to decode buffers to strings, as a supplement to Buffer.toString, it supports multi-byte UTF-8 and UTF-16 characters. Such as:
1 2 3 4 5 6 7 8
const StringDecoder = require('string_decoder').StringDecoder; const decoder = new StringDecoder('utf8');
const euro = Buffer.from([0xE2, 0x82, 0xAC]); console.log(decoder.write(euro)); // €
What’s the current working directory of the process? What’s it for?
You can obtain the current working directory by using process.cwd(). It usually is the directory when the command line starts. It can also be specified at startup. File operations, etc. obtain the file by using the relative path which is relative to the current working directory.
Some of the third-party modules that can obtain the configuration look for the configuration file through your current directory. So if running the start script in the wrong directory, you will get wrong rusults. You can change working directory by using process.chdir() in your code.
How should I handle unexpected errors? Should I use try/catch, domains, or something else?
Here are the error handling methods in Node.js:
callback(err, data) Callback agreement
throw / try / catch
Error event of EventEmitter
What is uncaughtException
he uncaughtException event of process object will be triggered when the exception is not caught and bubbling to the Event Loop. By default, Node.js will ouput the stack trace information to the stderr and end process for such exceptions, And adding listener to uncaughtException event can override the default behavior, thus not end the process directly.
No.
In the early Node.js, try/catch is unable to capture asynchronous errors, And the error first callback is just an agreement, without mandatory and very cumbersome to write. So in order to catch the exception very well, Node.js introduces domain module in v0.8.
But domain also brought more new problems. Such as dependent modules can not inherit the domain you defined, Causing it can’t cover errors in dependent modules. Furthermore, Many people (especially new bie) didn’t understand memory / asynchronous processes and other issues in Node.js, they didn’t do well when using domain to process errors and let the code continue, this is likely to cause the project to be completely unserviceable (Any problems are possible, And all kinds of shit…)
You should first make a clear decision as to whether you need a single-page-application (SPA) or if you’d rather take a multi-page approach.
Angular
Angular is a TypeScript-based Javascript framework. Developed and maintained by Google, it’s described as a “Superheroic JavaScript MVW Framework”. Angular (also “Angular 2+”, “Angular 2” or “ng2”) is the rewritten, mostly incompatible successor to AngularJS (also “Angular.js” or “AngularJS 1.x”). While AngularJS (the old one) was initially released in October 2010, it is still getting bug-fixes, etc. — the new Angular (sans JS) was introduced in September 2016 as version 2.
Vue
The greatest benefit of Vue is it’s absence of pedigree. It is fresh and has little baggage. It has been learning from the mistakes and successes of React & Angular. The way we see it, Vue is lightweight & easy to learn.
It has got some fairly basic docs but they do a good job, and while there isn’t a great deal to learn compared to angular — this is a good thing as it’s deceptively powerful. PageKit, Python China are two of of the projects using Vue among many. Here’s the list. Also, it has two way data binding facility like Angular and Virtual DOM like React.
Compare
Long-term support & migrations
Regarding Angular, there is a blog post about versioning and releasing Angular starting with the v2 release. There will be one major update every six months, and there will be a deprecation period of at least six months (two major releases). There are some experimental APIs marked in the documentation with shorter deprecation periods. There is no official announcement yet, but according to this article, the Angular team has announced long-term-support versions starting with Angular 4. Those will be supported for at least one year beyond the next major version release. This means Angular 4 will be supported until at least September 2018 with bug-fixes and important patches. In most cases, updating Angular from v2 to v4 is as easy as updating the Angular dependencies. Angular also offers a guide with information as to whether further changes are needed.
The update process for Vue 1.x to 2.0 should be easy for a small app — the developer team has asserted that 90% of the APIs stayed the same. There is a nice upgrade-diagnostic migration-helper tool working on the console. One developer noted that the update from v1 to v2 was still no fun in a big app. Unfortunately, there is no clear (public) roadmap about the next major version or information on plans for LTS versions.
One more thing: Angular is a full framework and offers a lot of things bundled together. React is more flexible than Angular, and you will probably wind up using more independent, unsettled, fast-moving libraries — this means that you need to take care of the corresponding updates and migrations on your own. It could also be a detriment if certain packages are no longer maintained or some other package becomes the de facto standard at some point.