Cleanup UseEffect Hook
useEffect( () => {
//Api function Calling
let unAmounted = false;
if (!unAmounted) {
getOrderCategory();
}
//Hook Clean Up
return () => {
unAmounted = true;
};
}, []);
welcome
welcome
useEffect( () => {
//Api function Calling
let unAmounted = false;
if (!unAmounted) {
getOrderCategory();
}
//Hook Clean Up
return () => {
unAmounted = true;
};
}, []);
Through the use of the header and footer callback manipulation functions provided by DataTables (headerCallback and footerCallback), it is possible to perform some powerful and useful data manipulation functions, such as summarising data in the table.
The example below shows a footer callback being used to total the data for a column (both the visible and the hidden data) using the column().data() API method and column().footer() for writing the value into the footer.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | $(document).ready(function() { $('#example').DataTable( { "footerCallback": function ( row, data, start, end, display ) { var api = this.api(); // Remove the formatting to get integer data for summation var intVal = function ( i ) { return typeof i === 'string' ? i.replace(/[\$,]/g, '')*1 : typeof i === 'number' ? i : 0; }; // Total over all pages total = api .column( 4 ) .data() .reduce( function (a, b) { return intVal(a) + intVal(b); }, 0 ); // Total over this page pageTotal = api .column( 4, { page: 'current'} ) .data() .reduce( function (a, b) { return intVal(a) + intVal(b); }, 0 ); // Update footer $( api.column( 4 ).footer() ).html( '$'+pageTotal +' ( $'+ total +' total)' ); } } ); } ); |
Try following script ➡️➡
$errors = array();
if (strlen($pass) < 8 || strlen($pass) > 16) {
$errors[] = "Password should be min 8 characters and max 16 characters";
}
if (!preg_match("/\d/", $pass)) {
$errors[] = "Password should contain at least one digit";
}
if (!preg_match("/[A-Z]/", $pass)) {
$errors[] = "Password should contain at least one Capital Letter";
}
if (!preg_match("/[a-z]/", $pass)) {
$errors[] = "Password should contain at least one small Letter";
}
if (!preg_match("/\W/", $pass)) {
$errors[] = "Password should contain at least one special character";
}
if (preg_match("/\s/", $pass)) {
$errors[] = "Password should not contain any white space";
}
if ($errors) {
foreach ($errors as $error) {
echo "<div class='alert alert-danger'>".$error."</div>";
}
$error = 1;
} else {
$error = 0;
}
As a developer, it is important to keep your code clean and organized. This will help make your code more efficient and easier to read and understand. In this blog post, we will discuss five ways that you can keep your code clean and organized. We will also provide some tips on how to stay productive while coding!
One way to keep your code clean is by using comments. Comments are a great way to add clarity to your code and to make sure that you and others can understand what your code is doing. When adding comments, be sure to add them in a clear and concise manner.
Another way to keep your code clean is by using proper indentation. Indentation helps to make your code more readable and easier to understand. Be sure to use consistent indentation throughout your code.
Another way to keep your code clean is by using proper naming conventions. When naming classes, variables, and methods, be sure to use clear and descriptive names. This will help make your code more readable and easier to understand. If you have a class as “fb”, and months down the line you are reviewing your code, it’ll be very difficult to figure out what “fb” is for. especially if you have 20,000 lines of code. A better solution would be, “footer-bottom”.
Using proper coding conventions is also important to keep your code clean. When coding, be sure to follow the conventions that are set forth by the programming language that you are using. This will help make your code more consistent and easier to read.
Finally, it is important to keep your code well organized. When organizing your code, be sure to group similar classes and methods together. This will help make your code more readable and easier to navigate.
By following these tips, you can help keep your code clean, organized, and efficient. So take some time to review your code and make sure that it is up to par! You will be glad that you did!
What other tips do you have for keeping your code clean and efficient? Share them with me in the comments below!
Happy coding! 🙂
To become an AI developer, you can follow the roadmap below:
1. Master programming languages: Start by learning programming languages commonly used in AI development, such as Python and R. These languages have extensive libraries and frameworks for AI and machine learning.
2. Understand mathematics and statistics: Gain a solid understanding of mathematics and statistics, as they form the foundation of AI algorithms. Topics like linear algebra, calculus, probability, and statistics are essential.
3. Learn machine learning: Familiarize yourself with machine learning concepts and algorithms. Understand supervised and unsupervised learning, regression, classification, clustering, and neural networks.
4. Explore deep learning: Deep learning is a subset of machine learning that focuses on neural networks. Learn about convolutional neural networks (CNNs), recurrent neural networks (RNNs), and deep learning frameworks like TensorFlow and PyTorch.
5. *Study natural language processing (NLP)*: NLP is a branch of AI that deals with the interaction between computers and human language. Learn about techniques like sentiment analysis, text classification, and language generation.
6. Gain experience with data handling and preprocessing: Data is crucial in AI development. Learn how to collect, clean, preprocess, and analyze data. Understand data visualization techniques to gain insights from data.
7. Work on projects: Apply your knowledge by working on AI projects. Start with small projects and gradually tackle more complex ones. Building projects will help you gain practical experience and showcase your skills.
8. Stay updated: AI is a rapidly evolving field. Stay updated with the latest research papers, industry trends, and advancements in AI technologies. Participate in online communities, attend conferences, and follow AI experts and organizations.
9. Collaborate and network: Connect with other AI developers and professionals. Collaborate on projects, join AI communities, and participate in hackathons or competitions. Networking can provide valuable learning opportunities and career prospects.
10. Continuously learn and improve: AI is a field that requires continuous learning and adaptation. Stay curious, explore new techniques, and keep refining your skills. Embrace a growth mindset and be open to learning from failures and successes.
Remember, becoming an AI developer is a journey that requires dedication, practice, and continuous learning. The roadmap provided here is a starting point, and you can tailor it based on your interests and goals. Good luck on your path to becoming an AI developer!
📚 Sources
- AI Expert Roadmap
• https://i.am.ai/roadmap/
- A Clear roadmap to complete learning AI/ML by the end of 2022 ...
• https://www.reddit.com/r/learnmachinelearning/comments/qlpcl8/a_clear_roadmap_to_complete_learning_aiml_by_the/
- Roadmap to Become an AI Engineer - DataFlair
• https://data-flair.training/blogs/how-to-become-ai-engineer/