From January 2015, she started to practice leetcode questions; she trains herself to stay focus, develops "muscle" memory when she practices those questions one by one.
2015年初, Julia开始参与做Leetcode, 开通自己第一个博客. 刷Leet code的题目, 她看了很多的代码, 每个人那学一点, 也开通Github, 发表自己的代码, 尝试写自己的一些体会.
She learns from her favorite sports – tennis, 10,000 serves practice builds up good memory for a great serve. Just keep going.
Hard work beats talent when talent fails to work hard.
MySQL is an open-source database management system, commonly installed as part of the popular LAMP or LEMP stack. It implements the relational model and SQL to manage and query data. This tutorial explains how to install MySQL on your server. Choose your operating system below to get started.
FTX's new CEO John Ray is cleaning house at the top,per The Wall Street Journal. Ray, who previously oversaw Enron's bankruptcy proceedings, has fired former CEO Sam Bankman-Fried's top deputies: FTX co-founder and chief technology officer Gary Wang, engineering director Nishad Singh, and Caroline Ellison, CEO of trading arm Alameda Research. Ray criticized the "complete failure of corporate controls" at FTX and Alameda after both acknowledged thatFTX lent billions of dollarsin customer assets to Alameda to cover a funding hole, setting up the collapse of Sam Bankman-Fried's crypto empire.
We provide three days of free trial in order to test our platform and services
with no credit card required, so I would suggest you to signup with Cloudways
and perform necessary testings.
Here are the most important traits to look for in best WordPress hosting:
Speed
Did you know that it only takes 2 seconds of loading time for your visitor to decide that they don’t want to wait any longer? Or, to put it in other terms, if your site takes more than 2 seconds to load, people will leave. Bad WordPress hosting won’t give you good results in this realm. They actually hope you’ll never find out that their platform is slow. Luckily, things like speed are easy to test, and we do just that to point you only in the direction of the best performing hosting platforms.
Security
Every year, literally millions of WordPress sites get hacked (example). If your WordPress host doesn’t care, your site can be the next victim. Good hosts have sufficient precautions and procedures set in place to avoid this kind of risk.
Scalability
What happens if one of your articles or posts goes viral and all of a sudden thousands of people go to your site to see it at the same time? Most likely your site will crash. But if your WordPress hosting setup is scalable, it will be able to handle the influx. This we’ve tested as well.
Support
In case you ever need help with anything regarding your WordPress hosting setup or even your website in general, you should be able to reach out to your hosting firm. Though, that’s not always possible in the real world. We’ve tested the support departments of many hosting companies, and simply not all of them stand up to the task. Let us show you who does.
Space
Can you have more than one website on your single hosting setup? Can you host high-quality image or video files? Well, depends on how lucky you were picking a good hosting firm.
Server location
In a nutshell, you want to be able to choose a server that’s near your target audience’s geographical location. Catering to an audience in Germany? You want a server in Germany, simple! However, not all WordPress hosting companies give you a choice.
SSL
Aka. Secure Sockets Layer or HTTPS, is a web protocol. It’s used to make sure that whatever content you’re reading on the web hasn’t been interfered with. In other words, if your site doesn’t have SSL enabled, your visitors might have second thoughts about interacting with it. What’s more, Google now actively discourages people from even visiting websites without SSL. A good host will let you enable SSL on your WordPress website.
Binance CEO Changpeng 'CZ' Zhao discusses the latest fallout from the FTX collapse and how that is expected to impact his company’s operation on ‘Varney & Co.’ #foxbusiness
‘Wild ride’: Morgan Stanley’s Mike Wilson predicts double-digit percentage drop will hit stocks in early 2023
Investors may be on the doorstep of a deep pullback.
Morgan Stanley’s Mike Wilson, who has an S&P 500 year-end target of 3,900 for next year, warns corporate America is getting ready to unleash downward earnings revisions that will pummel stocks.
“It’s the path. I mean nobody cares about what’s going to happen in 12 months. They need to deal with the next three to six months,” he told CNBC’s “Fast Money” on Tuesday. “That’s where we actually think there’s significant downside. So, while 3,900 sounds like a really boring six months. No... it’s going to be a wild ride.”
Wilson, who serves as the firm’s chief U.S. equity strategist and chief investment officer, believes the S&P could drop as much as 24% from Tuesday’s close in early 2023.
“You should expect an S&P between 3,000 and 3,300 some time in probably the first four months of the year,” he said. “That’s when we think the deacceleration on the revisions on the earnings side will kind of reach its crescendo.”
On Tuesday, the S&P 500 closed at 3,957.63, a 17% decline so far this year. Wilson’s year-end price target was 3,900 for this year, too.
“The bear market is not over,” he added. “We’ve got significantly lower lows if our earnings forecast is correct.”
And he believes the pain will be widespread.
“Most of the damage will happen in these bigger companies — not just tech, by the way. It could be consumer. It could be industrial,” Wilson said. “When those stocks had a tough time in October, the money went into these other areas. So, part of that rally has been driven just be repositioning from the money moving.”
Wilson’s forecast comes on the heels of prior pullback warnings on “Fast Money.” In July, he warned the June low was probably not the final move downward. On Oct. 13, the S&P 500 reached its 52-week low of 3,491.58.
‘Not a time to sell everything’
Yet Wilson does not consider himself a full-fledged bear.
“This is not a time to sell everything and run for the hills because that’s probably not until the earnings come down in January [and] February,” he said.
Wilson expects bullish tailwinds to push stocks higher over the next few weeks.
“It’s our job to call these tactical rallies. We’ve got this one right,” Wilson said. “I still think this tactical rally has legs into year end.”
WP Data Access is a powerful data administration, publication and development tool. An intuitive interface helps to create responsive tables and charts for back-end and front-end usage in just minutes. Highly customizable CRUD pages are generated on the fly. No programming skills required.
The plugin supports more complex features for advanced users, including remote database and file access, master-detail pages, lookups, inline editing, advanced search options, dynamic hyperlinks, WordPress media library integration, WordPress role management integration and many more. Programmers can also benefit from the WP Data Access API, which can be used to access remote databases and data files directly from their PHP code.
DATA TABLES
Use the Data Publisher to create professional data tables for back-end and front-end usage.
Use Data Projects to create data driven WordPress apps that can be executed on the back-end and front-end. Projects are highly customizable using templates.
Auto generated CRUD pages
Parent-child relationships
Lookups
Remote and local databases
WordPress role integration
WordPress media library integration
Accessible from the WordPress dashboard and public pages
DataForms – fully responsive apps for back-end and front-end (PREMIUM) [demo]
It’s not always obvious what needs doing, and the payofs of good security are at best
obscure. Who is surprised when it falls of our priority lists?
We’d like to ofer a little help if you don’t mind. And by « help » we don’t mean « pitch
you our product »—we genuinely mean it.
Sqreen’s mission is to empower engineers to build secure web applications. We’ve put our
security knowledge to work in compiling an actionable list of best practices to help you
get a grip on your DevSecOps priorities. It’s all on the following pages.
We hope your find if useful. If you do, share it with your network. And if you don’t, please
take to Twitter to complain loudly—it’s the best way to get our attention.
Use Parameterized Queries
To avoid SQL injection attacks, never concatenate or interpolate SQL strings with
external data. Use parameterized queries instead and prepared statements. These can be
used with vendor-specific libraries or by using PDO.
Read more:
• Prepared statements and stored procedures in PDO
• Mysqli Prepared Statements
• The PostgreSQL pg_query_params function
Use an ORM
Take parameterized queries and prepared statements one step further, and avoid, if at all
possible, writing SQL queries yourself, by using an ORM; one scrutinized and tested by
many security-conscious developers.
It’s not easy to become a great PHP developer which may very well take years of training and practice, but this doesn’t mean you shouldn’t do your best to not be a bad one that undermines every project he’s involved in. Based on the project experiences of my team and some recent researches done on PHP security issues, I have come up with a list of things you should know and do in your PHP code to achieve this goal. A few of them may be subjective and opinionated but most of them are actually security bottom lines that every self-deemed good PHP developer must definitely adhere to.
There are a lot more to consider other than PHP to secure your application. This is just a starting point if you are not also a system administrator who is equally responsible in maintaining a secure server (OS, web server, etc.). Oh and there’s browser security (such as phishing) that you essentially have no control over. So we will just stick to PHP here.
php.ini
Some of the default settings in php.ini in earlier PHP versions are pretty dangerous. Modify the original php.ini if you are a server administrator or create custom php.ini in the webroot (directory of the web documents, accessible to the public via web server) to override the unsafe settings or use in-code functions such as ini_set():
In most cases, you don’t have to worry about more than just the error logging part because the most up-to-date version of PHP has been well optimized in security by default. For example, register_globals and magic_quotes_gpc are turned off as factory settings, and session data is automatically stored outside of webroot. Other than these, feel free to override things by the ini_set() function when you feel obligated to.
Note that magic_quotes_gpc cannot be set by ini_set() any more after PHP version 4.2.3, you have to do it in a local php.ini or .htaccess.
.htaccess
Disable directory listing site wide by adding this line to the .htaccess file (hidden) placed in the document root of your domain:
Valuable files and sensitive data
This includes member only materials, administrator stuff and site wide configuration files containing the vital data of your site, or whatever you feel uncomfortable exposed to the public. In fact, if you are having doubts whether some file is all right to be exposed, don’t expose it at all.
Store them below (outside) webroot so they cannot be retrieved by anyone via web server requests.
Compulsory security practices when handling uploaded files:
Validate the file name in $_FILES against potential data manipulation. For instance, discard anything that’s not alphanumeric or dot in the file name string.
Validate the mime type against potential spoof and discard anything that seems not what you expect.
After validation, change the file name and move it somewhere confidential below webroot. You can also optionally tar it for storing.
Never execute / serve uploaded files with include() nor require().
Never serve files with mime types of “application/octet-stream”, “application/unknown” nor “plain/text”.
Incoming requests
Cross Site Request Forgery (CSRF) Attacks: Just as the name suggests, the request is forged / fabricated from the authenticated user’s computer yet without his awareness and acknowledgement. For example, the malicious attacker creates a sneaky link (Clickjacking) or a form and manages to trick the legally logged user to use it to submit a hidden request to your application to perform something that he doesn’t authorize at all such as deletion. To prevent it:
Create a confirmation page for the legitimate user to make a final call by clicking ‘Yes’ or ‘No’. The request is then submitted to the server by POST method. Don’t just delete something (or perform other important operations) upon a simple GET request.
Generate a unique token (whatever name = value) in the user’s session and include it in every form as a hidden field so whenever the user submits a POST request, you can check if the form contains the correct token against that in the session variable to make sure if it is submitted by the user by true intentions.
Incoming / User provided data
Always filter or sanitize incoming data in $_GET, $_POST, $_COOKIE or $_REQUEST before using them in your code. Validate that a value is just what you expect and discard any characters suspicious / unneeded. Better yet, white list a few value prototypes by regular expressions and ignore anything that doesn’t match the criteria.
Path Traversal Attacks: By browsing through and trying different combinations of path input to your application, the cracker aims to access files and directories outside of the webroot, probably with a chain of ‘../’ in the path input. To prevent the attack:
Never use user input data directly in your code before it is sanitized or tested against the white list, especially when it is used to determine the subject of file open, include / require, file create and file delete operations.
Let users select indexes rather than the literal path string / file name. For example, open file “/home/test/whatever.txt” when “7” is selected by the user.
In fact, don’t give users the chance to make the call of which file / path to be used / included at all.
Don’t disclose your directory structure to the users in any way, for example, as a hidden field in the form.
SQL Injection Attacks: Exploits of secure vulnerabilities that occur in the database layer of an application wherein user input is not filtered for reserved characters that may cause the database to falsely interpret and execute the SQL query. To prevent this attack:
You can also use PDO to prepare the SQL queries, which will automatically sanitize any literal values by escaping it before using them in the query.
Cross-Site Scripting (XSS) Attacks: Or JavaScript injection, security vulnerabilities that allow malicious users to inject HTML code into your web pages that other users can view and execute. It can mess up the page, more fatally, it can load an arbitrary JavaScript script (hosted on another domain) in the user’s browser and steal their cookies thus identity. To prevent this attack:
Optionally enforce strong passwords to your users by only accepting passwords of certain lengths and complexity.
Never store plain text passwords in your database. Instead, salt and hash the passwords. Bottom line is sha1(). Better yet, use hash() with various more advanced algorithms. Never use md5().
Regenerate the session ID every time a user’s privileges are upgraded, for example, from visitor to registered member by logging in or from registered member to administrator by further logging in the administrator control panel:
session_regenerate_id();
Completely destroy session variables (not just empty them) by:
session_destroy();
Store IP address of initial authentication in session variables and compare request source IP every time you receive a request from the user. However, IP address can unexpectedly change during a legal session and can be a public proxy in the first place.
Cookies
When you need to wipe out some cookie variable, delete it from both the user’s browser AND your server:
setcookie('SomeCookie', '', time() - 3600); // deletes it from client sideunset($_COOKIE['SomeCookie']); // deletes it from server side
Other things to consider
All helper / utility scripts in your application that helps develop and debug should be removed from the production deployment. Only necessary files are to remain.
Never talk about your application structure or any other vital information regarding it as real examples in public places such as developer / server administrator discussion boards.
Maintain your own private PHP framework to employ these security practices in a general level. So you will not need to worry about the security particulars of all the projects that derive from this framework. Or use one of the popularPHPframeworks who have gone a long way in security and have been broadly tested by thousands of projects and billions of end users.
It’s not enough to just check and fix your code against these attacks. You have to assimilate these attack prevention tips into your daily coding arsenal and make them as natural as they must be done wherever they are needed. They have to become part of your blood and just feel right to you. Bobince makes a good point on this by asking for a PHP tutorial that preaches the right thing from the very beginning. For example, when you echo something with PHP to the output, even if you are an absolute beginner, it doesn’t absolve you from escaping them first:
$str = 'Hi, I\'m on a web page.';
echo htmlentities($str);
Please don’t hesitate to tip in by commenting below to make this security checklist as complete and useful as possible. To start a serious learning session of developing secure web applications, these books will provide a kickass ride for you.