胖蔡叨叨叨
你听我说

Tips To Increase Your Know-how About Football

brigettethz阅读(40)

Football is actually a enjoyable sports activity to try out when you are fantastic with the abilities required to help your staff. Perhaps you would want to much better your abilities and that is why you’re on this page? Then, these write-up offers outstanding suggestions that this pros use to assist them to far better their activity and you can use them, as well.

It’s all-natural to get driven in the direction of offense as being a beginner, but the professionals know shield is when the overall game is earned or lost. Often times, shield basically victories this game. Offense may be splashier, but inadequate a solid defense, any staff is sure to lose.

When you’re dribbling the soccer ball, you ought to avoid searching down at the soccer ball. You must be able to dribble without the need of staring at the ball. When you can dribble without experiencing the golf ball, you’ll be able to keep your view on all of those other video game. This can help you to learn who seems to be available for any move or if you have the opportunity to go on a photo.

Make your moves quick and accurate. This takes process, nevertheless, you can increase your passing capabilities over time. Find a person different who wishes to boost their transferring and run drills together. Jogging all around the court completing and dribbling will eventually turn out to be 2nd character and assist you with your game.

Exercise transferring drills as a team. Baseball can be a group sport activity first of all. You’ve obtained 5 folks about the court with the same popular objective. Teams that happen to be efficient at moving can definitely break up a protection so that it is much better to go into excellent scoring jobs. You’ll undoubtedly succeed far more than you get rid of if you function together.

You must have good stability to snap nicely. Dropping once you produce a shot is just not the proper way to shoot. They may be picking the flow when this occurs. For those who have appropriate balance if you are making a chance, you will make more regular baskets after a while.

Don’t push your jumps in basketball. Try and leap as naturally as you can. When jumping and taking pictures, practice releasing the golf ball on top of the hop. Your fingertips need to merely push from the soccer ball and take it on the basket. Ensure you do not discharge whilst heading down or up inside the jump. Only relieve at the very top.

Striking cost-free throws is really a mental struggle in addition to a actual one. Obviously, you are able to show your body how you can make totally free throws. Even so, if you’re not in the correct frame of mind, you won’t be successful. Remain focused and aware to further improve your ability to make free tosses.

Make sure to practice lots of different opportunities in order that you not restriction your online game. When you might visit a zone safeguard mainly, a team can change protection to gentleman-to-person swiftly to be able to confuse you. You might drop control over this game should you aren’t equipped.

Do sprints in your exercise drills. Football is definitely a productive sport for the entire game. And occasionally inside when you really need to tug increase your previous amount of vitality for the very quick run towards the opposite area from the courtroom. Your body needs to use to sprinting, even though broken down. You merely make this happen by way of exercise.

Carry out skills, process your ball dealing with and shoot free of charge tosses when you are practicing alone. Even if you enjoy on a group, rehearsing alone will be helpful. It’s alright! You can nevertheless do a great deal all on your own. Work on free tosses and pivot movements. You could always sharpen your abilities when training alone.

To be a greater golf ball handler, the two main important stuff you ought to center on. Keeping yourself low when you dribble can certainly make it harder for foes to protect you and also to rob the ball. Shifting rates of speed is also crucial. By altering rates whilst you relocate you’ll become more unforeseen for your rival.

To come back a free have consider through the other staff, you obtain the main advantage of getting a number of individuals around the lane, instead of a few for the other crew. Make use by boxing out, putting your whole body on the person close to you and relocating him out of the basket. This provides you the greatest possibility at taking hold of a table.

If you’re enjoying the safeguard placement, getting good court perspective is an total secret weapon to success. It is best to make your eyes relocating and concentrate on what’s taking place near you. Learn to dribble the golf ball along with your go up. Looking downward whilst dribbling will mean you can’t see what’s happening around the courtroom.

Alter your rate to confound the opposition. Since you are heading towards internet, straighten up and plant down your ft .. The safeguard will believe you might be lowering rate and definately will perform the same. After they sluggish their momentum, it is possible to capture past these with a broken of speed.

To acquire the game you have to acquire good pictures. Good photographs are if you have an open arc to the goal using a substantial-amount of scoring. Hardly any other athletes on your own team needs to have a much better chance in comparison to the one particular you take. Usually, it’s not just a excellent photo.

Don’t think that an attempt must be perfect being taken. Lots of great shooters continually point out to themselves the common aim is big enough to adopt by two balls simultaneously. There’s yet another backboard that occasionally provides a privileged inflatable bounce. If you are you looking for more info in regards to 카지노 비트코인 look into our own web site. That leaves an excellent margin for error where one can create a below perfect picture but still get things.

For a baseball team to experience well jointly each and every player needs to be good at transferring the ball. Should you can’t create a simple successfully pass then its much easier for that opponent to defend you. Not only will completing support progress the golf ball down the courtroom more rapidly, it creates your teammates for large wide open pictures.

After reading the above mentioned report at this point you be aware of tactics how the professionals use to help enhance their baseball taking part in capabilities. It’s a basic video game but in order to assist your group succeed you ought to get far better. The guidelines and fantastic guidance in this article will go a long way to helping you to boost your game.

Baseball Advice For Your Novice To Learn

horacio70x阅读(45)

Understanding towards you on the baseball field can occasionally appear really difficult. Baseball is just as very much intellectual because it is actual physical. Be well prepared for your baseball experience by studying the information that are going to be provided here. You can expect to certainly see how they may assist you to improve your video game.

In order to increase your batting common, try showing up in the golf ball with the fencing as opposed to above it. You just want the baseball to look the course in which it came. Whenever you attempt to swing to the fencing you might success the tennis ball within the oxygen and frequently help it become very easy to get.

Sliding is a crucial expertise that many baseball participants have no idea the best way to do. You are unable to forget of the dirt. A great glide involves timing. You desire your feet hitting the bottom as soon as possible. Process moving everyday before you can effectively judge the best time to commence your glide for optimum length.

iStock Image

Generally dress in a batting helmet when at bat. These headwear prevent several head injuries. Look for a head protection that includes a deal with defend. This can guard you from an unsatisfactory pitch or horrible golf ball.

Don’t enable baseball dominate your daily life. You require a break from almost everything, including baseball. Time away can certainly have a rejuvenating result on your baseball ability, so make time to get pleasure from other likes and dislikes. Once you return to baseball, you’ll really feel rejuvenated and ready to defeat the entire world.

Should you be a catcher, make sure you are in the appropriate place when nobody is on foundation. This implies getting into the lowest squat and controlling your weight on the feet’s balls. Get as next to the underside of your bat as you possibly can, but make sure you is not going to get struck.

Do you know how to rob a base? When a terrible pitch is cast, it is a chance to remove for the after that basic. Even so, be sure that you have enough time to get to the foundation before taking away from. Otherwise, you will get an unnecessary out to your team.

Discover ways to properly grip a bat. When you are appropriate-handed, your left-hand has to be on the bottom with the right one on top. In the event you loved this post and you want to receive more information concerning  please visit our own site. The bats ought to be about 6 inches from the chest area. Contain the bat up as an alternative to in your shoulder blades. Distribute your hip and legs in regards to a shoulder blades-size away from each other. Don’t stand up directly up. Stay with knees slightly curved to prevent experiencing inflexible.

Finding out how to change instructions is important for outfielders. In case you are enjoying the remaining aspect of your outfield and need to perform towards centerfield, cross your right ft . over your kept feet and potential with the phase. This technique will assist you to obtain the highest burst open of speed right from the start of your own run.

Burglary your baseball glove before the process period even commences. In case you have obtained a new glove prior to the time of year will begin, expand it out a couple of weeks just before the time of year begins. Place a ball in the glove. Address it with leather material softener to make it supple. Utilizing your fist, impact the weave. If it’s shattered in, it’ll are more effective.

It can often be tough to keep your golf ball in concentration when it’s definitely warm or even the arena lights are on. To avoid finding areas, it is vital to know the best way to discover the baseball without having to gaze at the arena lighting fixtures or perhaps the sun. Just use peripheral perspective.

Training bunting, even if you are an electric power hitter. Bunting is somewhat of a dropped artwork in baseball. The theory would be to simply touch the soccer ball into perform, taking the infield, pitcher and catcher away-defend. It is a smart technique to advance a teammate over from initial to next or even to even score an infield struck. An electrical power hitter bunting is indeed unpredicted it can actually show good results.

To toss a contour golf ball, position each your index and center fingers coupled a seam of the baseball. While you throw the pitch, glide your fingers downward towards the earth in a clockwise course should you be right-handed (counterclockwise in case you are kept-handed). This movement affords the pitch its process.

Support your youngster turn into a better pitcher or baseball gamer by helping them better their left arm power. They could perform some gentle throwing and light-weight hand weights. Hose exercises are also really valuable for this function. Lengthy tosses are important, however, you have to be sure these are in order.

Baseball charge cards should be maintained within plastic-type material linens to be able to preserve them effectively. You is still capable to look at each side while keeping them from being exposed to the air. Have them from the lighting to prevent diminishing. Those charge cards which can be mint problem are typically worth a good deal more.

To hold other team’s first-basic instructor from finding the pitching symptoms which you send from powering residence platter, relocate your right joint up so it keeps your hands and fingers out of his look at. This allows you to give your signs with out him finding them and relaying those to the mixture.

If you want to focus on your swing, visit batting cages. Batting cages will help you to work on perfecting your approach, in ways that causes you to focus only on swinging. Check all around to determine what cages are the least expensive, and you might discover that your swing improves easier than you believe.

Roll your finger or shake the head to inform the catcher that you are currently not in deal together with the pitch he is calling. Should your catcher does not want to offer you the indicator for the pitch you wish to give, among you will likely be discouraged.

Is it possible to now say which you have figured out several things that will help you play far better baseball? The guidelines which were outlined for you on this page are likely to enable you to feel as if you have more control above your video game. It does take practice, but now you have several things to place into play.

Work Towards Getting Up To Velocity In Football Right here

torrihamrick04阅读(40)

Hockey is actually a uniquely American citizen sport activity, but it is now the one that is appreciated by folks worldwide. It is actually played out in virtually any nation on this planet. One particular great advantage of baseball is how straightforward it is to find started off taking part in. Keep reading for many ways to boost your capabilities around the judge.

Among the first what exactly you need to learn in terms of baseball is how you can guard the soccer ball. To help produce the skill sets required for this, check with your pals to get a friendly bet on baseball. Ask some participants that are experienced to show you how to protect the soccer ball.

To be a far better dribbler in baseball, process with your eyeballs sealed. This should help you so that you can dribble and keep a detailed watch on the act of this game. Make sure you exercise while you’re relocating too, so that you can dribble and maneuver round the the courtroom without the need of actually needing to look downward in the tennis ball.

When capturing a hockey, it is important to follow-through. Which means that you extend your biceps and triceps out completely and flick your wrists as you may release the soccer ball. This provide the golf ball added push and pace. This pressure and rate lets you make long-distance photographs which you normally wouldn’t have the capacity to make.

When taking pictures a no cost toss, keep your knee joints a little curved and peaceful for best results. This position allows you to hop up and down without the need of changing from directly to kept thus, helping you maintain a much, correct shot. Release the golf ball at the top of your bounce for additional energy for the picture.

When putting together an expense complete, it is recommended to keep the tennis ball from basically moving associated with your mind. If you, the soccer ball is simpler to rob. Furthermore, it will require lengthier to throw the business expense complete in the event you bring it powering the head. Have it from around your forehead.

To turn into a excellent rebounder, discover ways to pack from the rival effectively. The idea is whenever a picture is considered, you transform to the basket and obstruct your rival from receiving a very good situation to rebound. The ideal rebounders have learned this skill and very own the place proper close to the basket.

Keep reduced when taking part in protection. Keep the shoulder blades less than the offensive player you might be protecting provides you with an improved chance of moving faster. A reduced stance can help you play the ball too. Make an effort to remain about an arm’s size apart. When you get too far aside, other person can shoot effortlessly.

Don’t make a lot more for a online game than you are doing for any process. If you don’t tape up for training, don’t undertake it for online games. You will in a natural way get video games far more significantly than training. However, you don’t need to commence panicking more than a game by overpreparing. Have a steady and quiet schedule.

To play your very best game of football, it is essential to continue to keep centered. Regardless if the measures is just not close to your position, keep conscious of the measures and be ready to relocate fast. A positive mindset put together with being fully dedicated to what you really are undertaking can give you the aggressive benefit.

A terrific way to training the fast crack is to find the tennis ball the court in less than several dribbles. If you cherished this article and you also would like to obtain more info with regards to generously visit the site. It may look extremely hard, nevertheless the much more you training this principle, the better it will become. In the course of activity time you will notice on your own by using this to your great advantage through the quick split.

An excellent rebound participant can be a huge advantage for his crew. Rebounding is approximately frame of mind more that talent. Think of each shot as a possible overlook and be ready to position on your own to get the ball. Be warn for team members who happen to be in a good position to create the picture.

Should your defender is actively playing you lower, complete the ball to teammates using the business expense successfully pass. Keep in mind exactly where your teammate will find the soccer ball. If you throw it also very low, the soccer ball will probably be unmanageable. In the event you toss it excessive, your teammate might not exactly get the soccer ball whatsoever.

If you wish to do well in football, you should build your durability. Stamina and power are two things you should do effectively in this particular sport. The youngest players require strong arms and thighs and legs. For those who have been exercising regularly for years, it will be time and energy to present weights in the blend. Through the adulthood, weight training is critical to trying to keep on-courtroom performance in a top level.

If you are weaker with 1 fingers with regards to dribbling, only dribble with this hands. Actually, go on a soccer ball along wherever you go and practice while you are out and approximately. There are actually your talent boost the a lot more that you are able to train with the poor palm.

In order for a football staff to perform properly collectively every single participant ought to be proficient at transferring the soccer ball. Should you can’t produce a basic successfully pass then it is less difficult for your opponent to guard you. Not only can moving support progress the ball downward judge quicker, it sets up your teammates for large wide open pictures.

When a shooter is found with a area, their overlooked attempt is probably going to waft towards the complete opposite area. When someone is getting a area photo, attempt to predict where a skipped photo would property so that you can be there for your rebound.

에이티엠카지노[atm카지노]

Utilize your opponent’s some weakness to your advantage, particularly when they’re soccer ball prominent with one fingers. For example, if they’re remaining given, step in the direction of them using the correct ft . and they’ll need to move aspects. Maintain your mind reduced and be prepared to rob the tennis ball.

All you need to get moving taking part in football is really a golf ball plus a judge. Once you get started within this sport activity, you will probably find you have designed a life time passion for this game. Using the suggestions that you have read in the following paragraphs, you can display your talent every time you want.

Some Good Recommendations You Can Rely About Music Downloading

bernicecohen984阅读(48)

Music is really what many individuals have to have with their day-to-day lives to possess a very good time. It’s common and which means that many individuals really like to listen to tunes regardless of where they’re from. If you’d like some good info about audio downloads, then this article is heading to help you.

Take care when choosing websites to down load your tunes. Staying on web sites that happen to be well-known will assist you to stay away from infections or privacy breaches. It will always be finest to keep your details risk-free when you are having an not familiar website.

A good hint to think about when you’re planning to acquire music will be entirely sure that you’re accessing the right edition of whatever it is you want. You might want anything distinct, maybe the radio version of your song. It can be difficult to ensure that you down load precisely what you want.

Look at the file size when downloading tunes. Most tunes files are about two to five megabytes. In the event that a file is a lot more compact, it could be a written text document disguised like a tunes obtain. By getting it, you can be adding your personal computer at risk of viruses, jeopardizing your individual details.

When you are looking for sites for songs downloads, make sure that you are installing from the respected supplier. There has been occasions when end users have downloaded malicious software along with the music keeps track of. This can not happen at founded digital songs distributors with a decent status. Maintain this mind before you click the download key.

It is wise to have an anti-virus system if you download music on a regular basis. An anti-virus system will skim data just before it is saved, telling you whether the computer virus has a computer virus or otherwise. When a malware in some way gets into your harddrive, then the anti-virus program can reduce the effects of and remove the computer virus.

If you are looking for free, legitimate tunes downloading, consider utilizing a free tunes archive. A couple well-liked types cost nothing Tunes Archive along with the Internet Archive. These are generally not for profit internet sites that include all sorts of free of charge, legal music from many types. These are perfect for securely and legally going through new designers or benefiting from rare songs from a few of your preferred.

Any website that provides legitimate music downloading can have a copyright laws notice anywhere on the internet site. This observe shows the site’s proprietors are authorized to market and deliver the tunes legally online. This notice should likewise explain to you what you are and so are prohibited to do with the songs when you buy.

If you do would like to down load audio via peer to peer computer software, make sure to choose a respected program. In spite of this, you may find that the music you look for isn’t seen on the network you have chosen. Be extremely careful of the applications you opt to ensure you don’t get a virus.

Generally have an updated contra–computer virus program on any product that you simply download tunes on. There are many those who would love to have accessibility to the files in your program. Should you not have a very good anti–infection program on the device, you will be making oneself at risk of hacking tries and infections.

Be sure to examine the file structure before getting any tunes. You’ve obtained to make sure that the submit you get is compatible with what ever program you will be utilizing. If unsure, a good wager is usually to stick with MP3 documents. This file extension is all about as common because they arrive.

Do some research on the prospective download website prior to making a go of accessing there. If you liked this report and you would like to receive much more details about  kindly take a look at our web-page. Read other people’s reviews of the internet site as well as check on the internet community forums for posts associated with the internet site. You would like to know how respected and safe this web site really is. Other people have most likely experienced it, so benefit from their expertise.

When searching for a web site to down load audio, seek out the one that offers discount rates. Numerous audio down load websites offer discounts that are certain to the particular songs you hear. To locate these types of marketing promotions, join to acquire the website’s promotional e-zine or search the name in the site and coupons.

There are lots of community forums on the internet in which the revealing of Music takes place daily. They enable you to look at new performers and music inside the style of music you enjoy. In spite of this, be aware that data files can have computer viruses and that expressing of these tracks, except if these are posted through the manager, is against the law.

Not every free tunes is illegal tunes. Major online stores of audio records normally place out free of charge samplers for you to get pleasure from. Old music done by numerous designers might fall into public domain name. Some artists even release monitors totally free sheerly for the promotional benefits they get free from it.

To prevent acquiring conned when downloading tunes, choose a web site that may be popular including Amazon online, Rhapsody or iTunes. These popular down load professional services are generally more secure than lesser known kinds since they have to preserve their standing. For that reason, you don’t have to worry as much about getting your personal data robbed.

Will you have difficulties among deciding on mp3 downloading or streaming songs? It’s not easy to store 1000s of tunes on any given hard drive. Naturally, you can’t source songs without having to be coupled to the Web, which can be high priced. Each side has pros and cons.

Want access to a huge number of tunes without the need of blocking up your hard disk drive? Purchase a registration coming from a site like Spotify as opposed to transactions on iTunes or Amazon. This gives you unrestricted streaming of songs off their massive catalog, additionally it’s absolutely authorized. Nevertheless, you will need a web connection to hear, naturally.

If you have, or want to have, a huge Audio local library, shop it in the iCloud. This allows you usage of all of your current music from any product recorded into iTunes. As you can’t perform songs with out a web connection, you additionally don’t must wait for tunes to down load and block your product.

Individuals of all kinds adore tunes such as this post stated well before. If you’d like to get involved with installing audio, the above mentioned assistance should have you pointed from the right course. Just take the time and when all is said and done you shouldn’t have a problem using this type of by any means.

js中数组删除对象的几种方式总结

胖蔡阅读(67)

JS中数组是我们较为常用的一种数据结构,本篇文章主要是介绍js中我们常见的一些删除数组中元素的方式方法,希望可以对大家有所帮助。站长不易,感兴趣的小伙伴帮忙点个广告。

94519349c60a98a

数组中元素的删除通过删除的方法的不同可以分为:

  • 关键字删除
  • splice删除
  • 特殊位置删除

 

关键字删除

关键字删除是通过js提供的关键字 delete手动删除数组的某一项。 使用delete删除掉数组中的元素后,会把该下标出的值置为undefined,数组的长度不会变。

var arr = ['a','b','c','d'];
delete arr[1];
arr;  
//["a", undefined × 1, "c", "d"] 中间出现两个逗号,数组长度不变,有一项为undefined

 

 

splice删除

splice方法是js中较为常用的数组方法,它不仅仅可以实现数组的删除,也可以实现数组的替换、新增等。通过splice方法删除的数组,数组会发生该表(长度索引也会发生改变)。这是较为常用的数组删除方法。使用删除的方法调用格式为:array.splice(index,len,[item]) 

 

//删除起始下标为1,长度为1的一个值(len设置1,如果为0,则数组不变)
var arr = ['a','b','c','d'];
arr.splice(1,1);
console.log(arr);  
//['a','c','d']; 

//删除起始下标为1,长度为2的一个值(len设置2)
var arr2 = ['a','b','c','d']
arr2.splice(1,2);
console.log(arr2); 
//['a','d']

 

特殊位置删除

当我们只是需要删除数组的首尾数据的时候,也可以通过js的pop或者shift方法实现,这其实是两对对应的操作:添加与删除。

 

  • pushpop

通过push我们可以将元素添加到数组末尾,通过pop将末尾元素去除并返回。

const arr = [1, 2, 3, 4, 5, 6]
// 添加元素到数组末尾
arr.push(7) // arr: [1, 2, 3, 4, 5, 6, 7]
// 取出数组末尾元素并返回
const pop_res = arr.pop() // arr: [1, 2, 3, 4, 5, 6], pop_res: 7
  • unshiftshift

通过unshift可以将元素添加到数组首部,通过shift可去除数组头部元素并返回。

// 将元素添加到数组开头
arr.unshift(0) // arr: [0, 1, 2, 3, 4, 5, 6]
// 取出数组开头元素并返回
const sft_res = arr.shift() // arr: [1, 2, 3, 4, 5, 6], sft_res = 0

 

 

 

 

使用node-xlsx读取生成excel文件

胖蔡阅读(59)

node-xlsx是基于js-xlsx的实现的excel解析、生成器。这里我们通过node-xlsx实现excel的读取和生成。

安装

$ npm install node-xlsx -S

 

解析 excel文件

import xlsx from 'node-xlsx';
// Or var xlsx = require('node-xlsx').default;

// Parse a buffer
const workSheetsFromBuffer = xlsx.parse(fs.readFileSync(`${__dirname}/myFile.xlsx`));
// Parse a file
const workSheetsFromFile = xlsx.parse(`${__dirname}/myFile.xlsx`);

 

生成excel文件

import xlsx from 'node-xlsx';
// Or var xlsx = require('node-xlsx').default;

const data = [[1, 2, 3], [true, false, null, 'sheetjs'], ['foo', 'bar', new Date('2014-02-19T14:30Z'), '0.3'], ['baz', null, 'qux']];
var buffer = xlsx.build([{name: "mySheetName", data: data}]); // Returns a buffer

 

自定义excel格式


import xlsx from 'node-xlsx';
 // Or var xlsx = require('node-xlsx').default; 
// 自定义列宽
const data = [[1, 2, 3], [true, false, null, 'sheetjs'], ['foo', 'bar', new Date('2014-02-19T14:30Z'), '0.3'], ['baz', null, 'qux']] 
const options = {'!cols': [{ wch: 6 }, { wch: 7 }, { wch: 10 }, { wch: 20 } ]}; 
var buffer = xlsx.build([{name: "mySheetName", data: data}], options); // Returns a buffer


// 跨行设置
const data = [[1, 2, 3], [true, false, null, 'sheetjs'], ['foo', 'bar', new Date('2014-02-19T14:30Z'), '0.3'], ['baz', null, 'qux']];
const range = {s: {c: 0, r:0 }, e: {c:0, r:3}}; // A1:A4
const options = {'!merges': [ range ]};
var buffer = xlsx.build([{name: "mySheetName", data: data}], options); // Returns a buffer


// 跨页合并单元格


const data = [[1, 2, 3], [true, false, null, 'sheetjs'], ['foo', 'bar', new Date('2014-02-19T14:30Z'), '0.3'], ['baz', null, 'qux']]; 
const range = {s: {c: 0, r:0 }, e: {c:0, r:3}}; // A1:A4 
const options = {'!merges': [ range ]}; 
var buffer = xlsx.build([{name: "mySheetName", data: data}], options); // Returns a buffer

 

 

Vue中是用downloadjs实现文件下载

胖蔡阅读(69)

1ed72c09f5e3fb0

Vue中使用downlaodjs库实现浏览器中文件的下载,可以防止通过a标签下载导致txt,jpg等直接展示不下载的问题。

1、downloadjs下载

$ npm i downloadjs -S

 

2、 Vue中使用

创建一个vue 页面组件。

 

<template>
  <div style="margin:20px">
     <button @click="downloadText">点击下载</button>
  </div>
</template>

<script>
import download from "downloadjs";
export default {
  methods: {
    download() {
       download(this.url);
    },
  },
data() {
  return {
      url:'/test.txt',
  };
 },
};
</script>


 

3、常用api

  • 纯文本下载成文件

download("hello world", "dlText.txt", "text/plain");

  • 通过文件的dataURL下载
download("data:text/plain,hello%20world", "dlDataUrlText.txt", "text/plain");
  • 通过blob下载
download(new Blob(["hello world"]), "dlTextBlob.txt", "text/plain");
  • 通过文件的地址
download("/robots.txt");
  • 文本 UInt8 数组
var str= "hello world",	arr= new Uint8Array(str.length);
str.split("").forEach(function(a,b){
  arr[b]=a.charCodeAt();
});

download( arr, "textUInt8Array.txt", "text/plain" );

JS实现MD5加密

胖蔡阅读(76)

MD5信息摘要算法(英语:MD5 Message-Digest Algorithm),是一种常用的密码散列函数,一般常用检测文件、传输信息的完整性。MD5是由美国密码学家罗纳德·李维斯特在1992年发布。这套算法的程序在 RFC 1321 标准中被加以规范。如下,通过JS来实现MD5加密。

32769b6b1036062-132769b6b1036062

通过prototype实现MD5

String.prototype.MD5 = function(bit) {
    var sMessage = this;
    function RotateLeft(lValue, iShiftBits) { return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits)); }
    function AddUnsigned(lX, lY) {
        var lX4, lY4, lX8, lY8, lResult;
        lX8 = (lX & 0x80000000);
        lY8 = (lY & 0x80000000);
        lX4 = (lX & 0x40000000);
        lY4 = (lY & 0x40000000);
        lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
        if (lX4 & lY4) return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
        if (lX4 | lY4) {
            if (lResult & 0x40000000) return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
            else return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
        } else return (lResult ^ lX8 ^ lY8);
    }

    function F(x, y, z) { return (x & y) | ((~x) & z); }
    function G(x, y, z) { return (x & z) | (y & (~z)); }
    function H(x, y, z) { return (x ^ y ^ z); }
    function I(x, y, z) { return (y ^ (x | (~z))); }
    function FF(a, b, c, d, x, s, ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    }

    function GG(a, b, c, d, x, s, ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    }

    function HH(a, b, c, d, x, s, ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    }

    function II(a, b, c, d, x, s, ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    }

    function ConvertToWordArray(sMessage) {
        var lWordCount;
        var lMessageLength = sMessage.length;
        var lNumberOfWords_temp1 = lMessageLength + 8;
        var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64;
        var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
        var lWordArray = Array(lNumberOfWords - 1);
        var lBytePosition = 0;
        var lByteCount = 0;
        while (lByteCount < lMessageLength) {
            lWordCount = (lByteCount - (lByteCount % 4)) / 4;
            lBytePosition = (lByteCount % 4) * 8;
            lWordArray[lWordCount] = (lWordArray[lWordCount] | (sMessage.charCodeAt(lByteCount) << lBytePosition));
            lByteCount++;
        }

        lWordCount = (lByteCount - (lByteCount % 4)) / 4;
        lBytePosition = (lByteCount % 4) * 8;
        lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
        lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
        lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
        return lWordArray;
    }

    function WordToHex(lValue) {
        var WordToHexValue = "",
            WordToHexValue_temp = "",
            lByte, lCount;
        for (lCount = 0; lCount <= 3; lCount++) {
            lByte = (lValue >>> (lCount * 8)) & 255;
            WordToHexValue_temp = "0" + lByte.toString(16);
            WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
        }
        return WordToHexValue;
    }

    var x = Array();
    var k, AA, BB, CC, DD, a, b, c, d
    var S11 = 7,
        S12 = 12,
        S13 = 17,
        S14 = 22;

    var S21 = 5,
        S22 = 9,
        S23 = 14,
        S24 = 20;

    var S31 = 4,
        S32 = 11,
        S33 = 16,
        S34 = 23;

    var S41 = 6,
        S42 = 10,
        S43 = 15,
        S44 = 21;

    // Steps 1 and 2. Append padding bits and length and convert to words
    x = ConvertToWordArray(sMessage);
    // Step 3. Initialise
    a = 0x67452301;
    b = 0xEFCDAB89;
    c = 0x98BADCFE;
    d = 0x10325476;

    // Step 4. Process the message in 16-word blocks
    for (k = 0; k < x.length; k += 16) {
        AA = a;
        BB = b;
        CC = c;
        DD = d;
        a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
        d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
        c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
        b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
        a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
        d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
        c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
        b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
        a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
        d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
        c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
        b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
        a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
        d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
        c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
        b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
        a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
        d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
        c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
        b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
        a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
        d = GG(d, a, b, c, x[k + 10], S22, 0x2441453);
        c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
        b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
        a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
        d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
        c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
        b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
        a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
        d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
        c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
        b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
        a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
        d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
        c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
        b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
        a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
        d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
        c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
        b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
        a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
        d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
        c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
        b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
        a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
        d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
        c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
        b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
        a = II(a, b, c, d, x[k + 0], S41, 0xF4292244);
        d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
        c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
        b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
        a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
        d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
        c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
        b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
        a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
        d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
        c = II(c, d, a, b, x[k + 6], S43, 0xA3014314);
        b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
        a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
        d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
        c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
        b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
        a = AddUnsigned(a, AA);
        b = AddUnsigned(b, BB);
        c = AddUnsigned(c, CC);
        d = AddUnsigned(d, DD);
    }

    if (bit == 32) {
        return WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d);
    } else {
        return WordToHex(b) + WordToHex(c);
    }

}

使用JS调用

import '@/js/decoder.js';

function getMD5(str) {
    const md5_16 = str.MD5(); // 16位加密
    const md5_32 = str.MD5(32); //  32位加密方法
    $('#strForm').html(str);
    $('#md5_16_min').html(md5_16.toLowerCase());
    $('#md5_16_max').html(md5_16.toUpperCase());
    $('#md5_32_min').html(md5_32.toLowerCase());
    $('#md5_32_max').html(md5_32.toUpperCase());
}

MD5 不安全的三个原因

胖蔡阅读(68)

您可能已经阅读了该信息,并且您知道 MD5 不是最安全的散列函数
但是您知道为什么吗?你知道更安全的替代品吗?
这就是我今天要向您解释的内容。

为什么 MD5 不安全?

 

MD5 是一种密码算法,通常用于将密码存储在数据库中
但这种算法不再安全
暴力攻击比以往任何时候都快,字典表很大 MD5 算法还有其他潜在问题

 

什么是MD5?

MD5 是一种密码算法,通常用于在数据库中存储密码。
在互联网的早期,网站大多在其数据库中保存明文密码。
这不是一个好的解决方案,因此开发人员使用 MD5 来混淆数据库中的密码。

MD5 是一种算法,可从任何密码、短语或文本生成 32 个字符的十六进制字符串。
例如,如果您的密码是“qwerty”(坏主意),那么在数据库中您将拥有 d8578edf8458ce06fbc5bb76a58c5ca4。

这样一来,IT 人员就看不到您的密码,而且如果有人窃取了数据库,他们也无法直接获得所有密码。
今天,解密密码仍然不是立即的,但到目前为止还没有。
我将在接下来的部分解释原因,以及为什么您必须找到另一种存储密码的方法。

 

为什么 MD5 不安全?

1 – 对 MD5 哈希的蛮力攻击速度很快

蛮力攻击是一种通过尝试多种可能性来找到密码的方法。
要么通过猜测用户可能使用过的内容(生日、孩子的名字、宠物名称等),要么尝试所有内容(从 a、b、c 到带有特殊字符的 10 个字符的密码)。

 

MD5 算法使用起来很快。
所以在几秒钟内您可以尝试多种组合。

20 年前,为世界上最强大的计算机找到密码可能需要数年时间
今天,每个人家里都有一台超级计算机,随着处理器和图形处理器的改进,我们最多可以在几天内解密“安全”密码.
最好的计算机每秒可以尝试数十亿个密码(来源:ZDNet)。

对蛮力攻击的唯一抵抗可能是密码长度。
如果您有一个 40 个字符长的随机密码,并带有特殊字符,那么您目前可能是安全的,
但是还能持续多久呢?

2 – MD5 字典表很大

在 MD5Online 我们喜欢字典表。
通过在我们的数据库中存储超过 11,500 亿个密码,我们可以在几秒钟内提供任何哈希的答案

这是 MD5 算法的第二个问题。
它被如此广泛地使用,以至于多年来已经创建了像这样的大型数据库。
如果您的密码在里面(如果您有一个“短”密码,则很有可能),您的帐户根本就不安全。

至于蛮力方法,唯一安全的方法是使用带有特殊字符的长随机密码。
在这种数据库中拥有它的可能性太多了。
像这样的数据库占用了大量磁盘空间。即使这些年来价格越来越便宜,它仍然是一个障碍。

 

3 – MD5 有冲突

MD5 算法也已证明其加密方法存在问题。
冲突是指两个单词生成相同的哈希值。
安全算法具有良好的抗碰撞性。

也就是说,对于不同的单词,您获得相同散列的机会很小。
但MD5的抗碰撞性较低。

因此,如果您知道“abc”和“def”具有相同的生成散列(只是一个示例)。
您可以说“123abc”和“123def”也生成了相同的哈希值。
这对于加密哈希函数来说是一个糟糕的属性,因为您可以猜测出很多派生词。

有哪些解决方案?

既然您知道为什么 MD5 不安全,那么您可以做些什么来提高数据库的安全性。

使用盐

您可以尝试的第一件事是在加密密码时使用盐。
我已经写过一篇关于此的文章:什么是 MD5 盐以及如何使用它?
如果您想了解更多信息,请检查它。

基本上,盐是您将在每个密码之前和/或之后添加的词。
如果您的 salt 是“randomsaltformypassword”并且用户选择“qwerty”作为密码,您将使用“randomsaltformypasswordqwerty”作为 MD5 函数参数。

这样你就在你的数据库中加密了一个更长的密码,黑客将更难找到相应的密码。
确保选择长盐以提高安全性。

jQuery 常见选择器分类及使用方法

胖蔡阅读(70)

 

Jquery库可以通过选择器来让我们实现元素的快速定位和对选中元素的DOM操作。现在我们认识到过于频繁的DOM操作会影响应用的性能,但对于VUE、REACT框架不显的时代,Jquery的出现可以说是前端的一大神器,极大的缩减了我们的开发时间和实现难度。说是忆苦思甜也好,说是全面了解前端发展也罢,JQuery的基本操作和封装思想都是我们不可忽视。这篇文章主要是来介绍了解下常用的Jquery选择器分类和选择器使用方法。

6588348d0300eb5-1

6588348d0300eb5

Jquery选择一般的被我们分为:基本选择器、层次选择器、过滤选择器、表单选择器这四大类。

基本选择器

基本选择器是Jquery最常见的选择器,一般的我们可以通过元素的id、class、属性、元素名来定位元素。其他的所有选择器也是基于基本选择器的基础上的变形结构,常见的基本选择器类型如:

  • ID选择器
  • Class选择器
  • 元素选择器
  • 属性选择器
$("#selector")                 选择id值为selector的元素,id值是唯一的所以返回单个元素。
$("p")                         选择所有的p标签元素,返回p元素数组 
$(".myclass")                 选择使用myclass类的css的所有元素 
$("*")                        选取所有元素。
$("#test,div,.myclass")        选取多个元素。

 

层次选择器

层次选择器让我们可以通过元素的层级关系来定位元素,如果我们想通过元素之间的关系来获取特定的元素,那么层次选择器是一个非常好的选择。一般的我们会通过相应的链接符号来指代对应元素直接的层级关系,常见的层级关系如下:

  • 空格:空格指代元素的子孙元素
  • > : 指代元素的子元素
  • +,next():指代元素的兄弟节点元素(当前元素之后的同级元素),定位的为单个元素
  • ~,nextAll():指代元素的所有兄弟节点元素(当前元素之后的统计元素)
  • prev():这是不同于css的一个只想元素同级的上一个元素
  • siblings():指代元素的所有统计元素(包括上级和下级)
    $("div span")             选取<div>里的所有<span>元素
    $("div >span")             选取<div>元素下元素名是<span>的子元素
    $("#one +div")             选取id为one的元素的下一个<div>同辈元素        等同于$("#one").next("div")
    $("#one~div")              选取id为one的元素的元素后面的所有<div>同辈元素    等同于$("#one").nextAll("div")
    $("#one").siblings("div")      获取id为one的元素的所有<div>同辈元素(不管前后)
    $("#one").prev("div")        获取id为one的元素的前面紧邻的同辈<div>元素
    所以 获取元素范围大小顺序依次为:
    $("#one").siblings("div")>$("#one~div")>$("#one +div")  或是
    $("#one").siblings("div")>$("#one").nextAll("div")>$("#one").next("div")

 

过滤选择器

Jquery可以通过相应的过滤规则来过滤我们选择的部分元素,我们可以通过css中已有的伪元素、也可以通过jquery特有的伪元素、方法来过滤。通常情况下,我们可以根据过滤的方式的不同又可以将过滤选择器分为:基本过滤选择器、内容过滤选择器、可见性过滤选择器、属性过滤选择器、子元素过滤选择器以及表单对象属性过滤选择器,下面我们通过例子来了解他们的使用的不同。

  • 基本过滤选择器

基本过滤选择器一般都是通过一些常见的伪元素来过滤选择

       $("div:first")                 选取所有<div>元素中第1个<div>元素
    $("div:last")                   选取所有<div>元素中最后一个<div>元素
    $("input:not(.myClass)")        选取class不是myClass的<input>元素 
    $("input:even")                 选取索引是偶数的<input>元素(索引从0开始) 
    $("input:odd")                  选取索引是基数的<input>元素(索引从0开始) 
    $("input:eq(2)")                选取索引等于2的<input>元素 
    $("input:gt(4)")                选取索引大于4的<input>元素
    $("input:lt(4)")                选取索引小于4的<input>元素
    $(":header")                    过滤掉所有标题元素,例如:h1、h2、h3等
    $("div:animated")               选取正在执行动画的<div>元素  
    $(":focus")                     选取当前获取焦点的元素
  • 内容过滤选择器

内容过滤器中所提供的过滤伪元素,如:contains之内的都是jquery中内置式赋予能力的,属于自定义的通过元素的内容来实现元素的过滤的

    $("div:contains('Name')")       选取所有<div>中含有'Name'文本的元素 
    $("div:empty")                  选取不包含子元素(包括文本元素)的<div>空元素 
    $("div:has(p)")                 选取所有含有<p>元素的<div>元素 
    $("div:parent")                 选取拥有子元素的(包括文本元素)<div>元素
  • 可见性过滤选择器

这个通过例子比较明显的可以看出是通过元素的显示状态来进行过滤的,其实现是将集中不同的属性组合在一起,降低我们操作的复杂程度。

    $("div:hidden")                 选取所有不可见的<div>元素 
    $("div:visible")                选取所有可见的<div>元素
  • 属性过滤选择器

属性过滤选择器可以说是我们比较常见,也比较常用的方式,jquery服务我们通过元素的属性名来过滤选择的功能,属性名可以是默认的也可以是自定义的。

       $("div[id]")                  选取所有拥有属性id的元素
    $("input[name='test']")        选取所有的name属性等于'test'的<input>元素 
    $("input[name!='test']")      选取所有的name属性不等于'test'的<input>元素 
    $("input[name^='news']")        选取所有的name属性以'news'开头的<input>元素 
    $("input[name$='news']")        选取所有的name属性以'news'结尾的<input>元素 
    $("input[name*='news']")        选取所有的name属性包含'news'的<input>元素 
    $("div[title|='en']")           选取属性title等于'en'或以'en'为前缀(该字符串后跟一个连字符'-')的<div>元素
    $("div[title~='en']")           选取属性title用空格分隔的值中包含字符en的<div>元素
    $("div[id][title$='test']")     选取拥有属性id,并且属性title以'test'结束的<div>元素
  • 子元素过滤选择器
子元素过滤选择器一般是通过父元素的子元素位置、类型来过滤的,对于状态类型、列表类型的选择器使用比较方便。
    $("div .one:nth-child(2)")       选取class为'one'的<div>父元素下的第2个子元素
    $("div span:first-child")        选取每个<div>中的第1个<span>元素 
    $("div span:last-child")         选取每个<div>中的最后一个<span>元素 
    $("div button:only-child")       在<div>中选取是唯一子元素的<button>元素
  • 表单对象属性过滤选择器

这个可以被单独列为一类,可以说是和表单类组件的特有属性相关,其实这种选择我们也可以通过上述的属性过滤方式来实现,这里只是简化了书写方式,并不常用。

     $("#form1 :enabled")             选取id为'form1'的表单内所有可用元素
    $("#form2 :disabled")            选取id为'form2'的表单内所有不可用元素 
    $("input :checked")              选取所有被选中的<input>元素 
    $("select option:selected")      选取所有的select 的子元素中被选中的元素

 

表单选择器

表单选择器可以说和上述的表单过滤选择器有点类似,其主要使用还是为了让我们的表单选择操作变得更加的简便和易懂。

      $(":input")                      选取所有<input>,<textarea>,<select> 和 <button>元素 
    $(":text")                      选取所有的单行文本框
    $(":password")                   选取所有的密码框 
    $(":radio")                      选取所有单的选框 
    $(":checkbox")                   选取所有的多选框 
    $(":submit")                     选取所有的提交按钮
    $(":image")                      选取所有的图像按钮 
    $(":reset")                      选取所有的重置按钮
    $(":button")                     选取所有的按钮 
    $(":file")                       选取所有的上传域
    $(":hidden")                     选取所有不可见元素

 

 

 

上述的所有选择器或许中间存在交叉重复处,要知道对于Jquery选择器的分类其实无甚特别含义,只是为了我们更好更方便的取记忆使用罢了。所以,真正使用的时候不可过于拘泥于使用的类型,我们真正关注的只有两点:

  • 解决实现问题
  • 更好的解决实际问题