Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Thursday, September 19, 2024

39 AI Code Tools - The Ultimate Guide in 2024

To See All Articles About Technology: Index of Lessons in Technology

What are the best AI code tools in 2024?

TL;DR - As of September 2024, most programmers achieve the best results by using Cursor with Anthropic Sonnet 3.5 or OpenAI o1.

AI coding tools are becoming standard practice for many developers. And today, you’ll learn which code generators  and tools are the best ones out there for creating high-quality code with the help of artificial intelligence.

Want to learn more? Read on!

Is it possible to code with AI tools?

Yes, it is possible to code with AI tools.  In fact, leveraging AI tools for coding is not only possible, but it can also significantly enhance productivity and accuracy.

AI code is code written by artificial intelligence (AI), often times utilizing large language models (LLMs). These AI programs can write their own programs or translate from one programming language to another. They also perform tasks like offering assistance in auto-generating documentation and finding code snippets faster.

One of the most popular tools is Open AI’s Codex, an AI system that translates natural language to code. Codex powers GitHub Copilot, another popular AI code tool.

OpenAI Codex is capable of interpreting simple commands in natural language and carrying them out for the programmer. This makes it possible to build on top of the existing application with a natural language interface.

As a general-purpose programming model, OpenAI Codex can be applied to almost any programming task. That said, the tool is in beta and so results will vary.

AlphaCode by DeepMind is another tool that is shaking up the industry. Interestingly, this tool outperforms human coders in certain situations. You see, AlphaCode outperformed 45% of programmers in coding competitions with at least 5,000 participants.

However, there are problems with code generators, too. That's why AI coding tools are used to help developers become more productive and efficient, rather than to replace them entirely.

For example, a Stanford-affiliated research team found that engineers who use AI tools are more likely to cause security vulnerabilities in their apps. Plus, questions around copyright are not entirely resolved.

In other words, AI code tools are not yet completely safe to use. That said, the popularity of these tools means that they can’t be overlooked.

What is AI code written in?

AI code is written in languages supported by the AI code generator. For example, OpenAI Codex is most fluent in Python but is also quite capable in several languages, including JavaScript, Ruby, and TypeScript.

Now, let’s take a look at the best code generators out there.

The best AI code generators and AI development tools

What are some effective AI code generators? The most popular ones include OpenAI Codex, Copilot by Github,  ChatGPT by OpenAI as well as open-source models such as Llama 3.

But there are plenty of other tools out there. I’ve listed them here below, including their features, capabilities, and which companies are behind them. Let’s dive in!

Here are the best AI code generators of 2024.

1. OpenAI (ChatGPT, GPT-4, o1)

GPT-4, OpenAI's latest AI model, is a multimodal tool that excels in programming tasks. It understands and explains code, writes new code, and outperforms existing models on Python coding tasks. Despite its ability to handle complex tasks, it has limitations like reasoning errors and potential security vulnerabilities in the code it produces.  

ChatGPT is primarily a user-friendly interface developed by OpenAI that allows you to interact conversationally with advanced language models like GPT-4 and o1-mini. While it's often referred to as a model, ChatGPT is essentially the platform that enables you to generate or debug code and perform other text-based tasks by communicating with these underlying AI models.

Update May 14th: OpenAI just releaded GPT-4o - their new flagship model that’s as smart as GPT-4 Turbo and much more efficient. With 50% reduced pricing and 2x faster latency, it achieves impressive results.

Update September 16th:  o1 is a new series of AI models designed to enhance reasoning by spending more time thinking through problems before responding, excelling in complex tasks in science, coding, and math. OpenAI o1-mini is a faster, more cost-effective model particularly effective at coding, offering an affordable solution for applications that require reasoning but not extensive world knowledge. Both models are now available in ChatGPT and via the API for users to tackle complex problems efficiently.

Price: Free or $20 for GPT Plus

2. Copilot

Copilot uses publicly available code from GitHub repositories so that users can access large datasets and quickly develop accurate code. The tool detects errors in code and recommends changes to it. You can start using GitHub Copilot by installing one of the extensions in your preferred environment.

Price: $10-$19 - GitHub Copilot is free to use for verified students, teachers, and maintainers of popular open source projects.

3. AWS Bedrock

AWS Bedrock is Amazon Web Services' fully managed service that provides developers with access to a variety of powerful foundation models for building and scaling generative AI applications. For programmers, it offers APIs to interact with models like Amazon's Titan and others from leading AI startups, enabling tasks such as code generation, debugging, and text synthesis. While AWS Bedrock simplifies integrating AI into applications, it may have limitations like model accuracy and potential security vulnerabilities in generated code, so developers should exercise caution and perform thorough testing.

Pricing information can be found here

4. AlphaCode

Another AI-based code generator is Google-backed DeepMind’s AlphaCode, which gives developers access to source code from various language libraries. With AlphaCode, developers can leverage thousands of pre-made libraries, helping them connect and use third-party APIs quickly and easily. AlphaCode is not yet available to the public.

Price: No information available

5. Tabnine

Tabnine is an AI code completion tool that utilizes deep learning algorithms to provide the user with intelligent code completion capabilities. Tabnine supports several programming languages such as Java, Python, C++, and more. This tool is open-source and is used by leading tech companies like Facebook and Google.

Price: Paid plans start from $12/month per seat

6. CodeT5

CodeT5 is an open AI code generator that helps developers to create reliable and bug-free code quickly and easily. It is also open-source and provides support for various programming languages such as Java, Python, and JavaScript. CodeT5 also has an online version as well as an offline version for data security.

Price: Free

7. Polycoder

Polycoder is an open-source alternative to OpenAI Codex. It is trained on a 249 GB codebase written in 12 programming languages. With Polycoder, users can generate code for web applications, machine learning, natural language processing and more. It is well-regarded amongst programmers because of its capability of generating code quickly.

Price: Free

8. Deepcode

DeepCode is a cloud-based AI code analysis tool that automatically scans the codebase of a project and identifies potential bugs and vulnerabilities. It offers support for multiple languages such as Java, Python, and JavaScript. DeepCode is well-regarded for its accurate bug detection.

Price: No information available

9. WPCode

WPCode is an AI-driven WordPress code generator created by Isotropic. It supports both developers and non-technical WordPress creators, allowing them to quickly generate high-quality code snippets. CodeWP supports not only HTML and CSS but languages such as Java and Python. It even includes AI assistants to suggest improvements to code snippets.

Price: Starting at $49

10. AskCodi

AskCodi is a code generator that offers a full suite of development tools to help developers build and ship projects faster. With its AI-based code generation, it helps developers write better code and shorter code blocks, with fewer mistakes. AskCodi can be used to develop both web and mobile applications.

Price: Paid plans start from $7.99/month per seat

11. Codiga

Codiga is a static analysis tool that ensures code is secure and efficient. It supports popular languages like JavaScript, Python, Ruby, Kotlin, and more. With Codiga, you can test your code for vulnerabilities and security issues in real time. It also includes an auto-fixer to quickly address any issues in the code.

Price: Paid plans start from $14/month per seat

12. Visual Studio IntelliCode

Visual Studio IntelliCode is an extension of the Visual Studio Code editor created by Microsoft that provides AI-assisted development experiences to improve developer productivity. It offers smarter IntelliSense completions and helps reduce the amount of time developers spend navigating and debugging code.

Price: Starting from $45/month

13. PyCharm

PyCharm is an AI code completion tool from JetBrains which provides developers with intelligent code completion capabilities. This tool supports various programming languages such as Java, Python, and JavaScript. PyCharm is well regarded for its accuracy and can help developers reduce the amount of time spent on coding tasks.

Price: Starting from $24.90/month per seat

14. AIXcoder

AIXcoder is an AI-powered programming pair designed to aid development teams in writing code. It supports languages such as Java, Python, and JavaScript. This tool also offers a range of features such as automated routine tasks, AI-powered code completion, real-time code analysis and error checks while typing.

Price: No information available

15. Ponicode

Ponicode is an AI-powered code assistant designed to help developers optimize their coding workflow. It uses natural language processing and machine learning to generate code from user-defined descriptions. The tool is maintained by CircleCI.

Price: No information available

16. Jedi

Jedi is an open-source option for code completion in AI. It mostly functions as a plugin for editors and IDEs that use Python static analysis tools.

Price: Free

17. Wing Python IDE Pro

Created by Wingware, Wing IDE is a Python-specific software setup that combines the code editing, code navigation, and debugging mechanisms required to Code and Test Software applications. It offers various features such as an intelligent auto-completing Editor, Refactoring, Multi-Selection, and Code Snippets, which make coding much easier and more efficient.

Price: Annual licenses starting at $179/month

18. Smol Developer

Smol is an open-source artificial intelligence agent designed to function as a personal junior developer, capable of generating an entire codebase from your specific product specifications. Unlike traditional, rigid starter templates, Smol can create any kind of application based on your unique requirements. Boasting a codebase that is simple, safe, and small, it offers the perfect blend of ease-of-understanding, customization, and a helpful, harmless, and honest approach to AI development.

Price: Smol is open-source with a MIT License.

19. Cody (Sourcegraph)

Cody (not to be confused with AskCodi), Sourcegraph's AI tool, is a comprehensive coding assistant. It understands your entire codebase, answers queries, and writes code. Beyond guidance, Cody provides detailed code explanations, locates specific components, and identifies potential issues with suggested fixes. Cody works directly in VS code with an extension.

Price: Cody is free for personal use, Sourcegraph starts at $5k/year

20. CodeWhisperer (Amazon)

CodeWhisperer is a tool developed by Amazon. It offers real-time, AI-driven code suggestions and identifies potential open-source code matches for easier review. It even scans for security vulnerabilities, suggesting immediate patches. An added bonus is its commitment to code safety, always aligning with best security practices such as OWASP guidelines.

Price: Free for personal use, $19/month professional use

21. Bard (Google)

Bard can help with programming and software development tasks, including code generation, debugging and code explanation. These capabilities are supported in more than 20 programming languages including C++, Go, Java, Javascript, Python and Typescript. And you can easily export Python code to Google Colab — no copy and paste required. Bard can also assist with writing functions for Google Sheets.

Price: Google Bard is Free

22. Code Llama (Meta)

Code Llama is a set of large language models specialized for coding, built on the Llama 2 platform. It includes different models for various needs: the general-purpose Code Llama, Code Llama - Python for Python-specific tasks, and Code Llama - Instruct for instruction-based coding. These models vary in size (7B, 13B, and 34B parameters) and can handle up to 16k token inputs, with some improvements on up to 100k tokens. The 7B and 13B models also offer content-based infilling.

Code Llama’s training recipes are available on their Github repository - Model weights are also available.

23. Claude 2 & 3, 3.5 (Anthropic)

Claude 3.5 Sonnet is the latest natural language AI model introduced by Anthropic, a firm established by Dario Amodei, formerly of OpenAI. This new iteration is engineered for enhanced input and output lengths and boasts superior performance relative to its earlier version. In an internal agentic coding evaluation, Claude 3.5 Sonnet solved 64% of problems, outperforming Claude 3 Opus which solved 38%. Users can input up to 100K tokens in each prompt, which means that Claude can work over hundreds of pages of technical documentation. The earlier version, Claude 2 scored a 71.2% up from 56.0% on the Codex HumanEval, a Python coding test.

Their evaluation tests the model’s ability to fix a bug or add functionality to an open source codebase, given a natural language description of the desired improvement. When instructed and provided with the relevant tools, Claude 3.5 Sonnet can independently write, edit, and execute code with sophisticated reasoning and troubleshooting capabilities. It handles code translations with ease, making it particularly effective for updating legacy applications and migrating codebases.

A Stability AI Membership is required for commerical application

24. Stable Code 3B

Stability AI's Stable Code 3B, a new 3 billion parameter Large Language Model specialized in code completion, which is 60% smaller yet performs similarly to the larger CodeLLaMA 7b. This model, trained on diverse programming languages and software engineering-specific data, can run in real-time on modern laptops without a GPU. Stable Code 3B is part of Stability AI's Membership program and offers advanced features like Fill in the Middle capabilities and expanded context size, demonstrating state-of-the-art performance in multi-language coding tasks.

A Stability AI Membership (Starting at $20/mo) is required for commercial applications. Free for non-commercial.

25. Replit AI

Replit AI is an innovative code completion tool designed to streamline your coding experience by offering tailored suggestions that align with the context of your current file. As you delve into coding, the tool intuitively presents inline suggestions, enhancing your efficiency and accuracy. Additionally, Replit AI offers advanced features such as the ability to refine suggestions through code comments, the application of prompt engineering for more relevant results, and the flexibility to toggle the code completion feature on or off within the editor settings, ensuring a customized coding environment tailored to your preferences.

Replit AI is available in Replit's Free tier (Limited) and in their Core tier (Advanced Model).  

26. Plandex

Plandex employs persistent agents that tackle extensive tasks spanning numerous files and involving multiple steps. It segments sizable tasks into manageable subtasks, executing each in sequence until the entire task is accomplished. This tool aids in clearing your backlog, navigating new technologies, overcoming obstacles, and reducing the time spent on mundane activities.

Plandex is open-source on Github

27. Meta AI (Meta Lama 3)

Meta has launched Meta AI, powered by the Llama 3 model with 70 billion parameters.  The model positions itself as a powerful asset for improving application functionalities, but it does not match the customization and transparency of more advanced models like GPT-4 Turbo and Claude Opus. The benefits of Meta's approach to open-source AI are multifaceted, including attracting top talent, leveraging community contributions, fostering standardization and lower costs, building goodwill, and aligning with business models that do not rely solely on AI products.  While it is described as "open weight," providing access to the model's weights, it does not include the full toolkit necessary for reproduction. They also co-developed Llama 3 with torchtune, the new PyTorch-native library for easily authoring, fine-tuning, and experimenting with LLMs.

Moreover, Meta is also currently pretraining a 405B parameter model, signaling an ambitious expansion of its AI capabilities. This larger model, set to be released later, promises even more powerful functionalities and potential industry leadership if it surpasses current leaders like GPT-4 and Claude Opus. Such a development could reshape industry standards and perceptions, especially against competitors who guard their models under the guise of safety concerns. This bold move by Meta not only showcases their commitment to advancing AI technology but also challenges the industry's more cautious narratives around the sharing and utilization of AI models, setting new benchmarks for what’s achievable in AI development.

28. MetaGPT

Not to be confused with Meta AI, MetaGPT is a tool that automates the generation of software development outputs such as user stories, competitive analysis, requirements, data structures, APIs, and documents from a single line of input. It integrates roles typically found in a software company—product managers, architects, project managers, and engineers—into its workflow. These roles are executed by large language models (LLMs) following detailed Standard Operating Procedures (SOPs). The core philosophy behind MetaGPT is "Code = SOP(Team)," emphasizing the application of SOPs to organize and direct the work of its LLM teams. This structure aims to mimic the entire process of a software company, simplifying and automating complex tasks.

MetaGPT is MIT licensed and open-source

29. AutoRegex

AutoRegex is my favorite tool to translate natural language to regex. If you're like me, you wiped all traces of regex syntax from your memory the moment ChatGPT released - this helps!

30. llama.cpp

Llama.cpp is designed to facilitate LLM inference with optimal performance and minimal initial setup across various hardware, both locally and in the cloud. It is implemented in plain C/C++ without dependencies and features extensive support for Apple silicon through ARM NEON, Accelerate, and Metal frameworks. It also supports AVX, AVX2, and AVX512 for x86 architectures and offers integer quantization from 1.5 to 8 bits to enhance inference speed and reduce memory consumption. For NVIDIA GPUs, llama.cpp includes custom CUDA kernels, with AMD GPU support through HIP. Additionally, it supports Vulkan, SYCL, and partial OpenCL backends and can perform hybrid CPU+GPU inference to manage models that exceed VRAM capacity.

31. Aider

Aider is a  command line tool  allowing you to pair program with LLMs directly in your terminal. It seamlessly integrates with your local git repository, editing code directly in your source files and crafting smart commit messages for each change.

Aider is open-source on Github

32. Codestral (Mistral)

A model fluent in 80+ programming languages, Codestral, is Mistrral's first-ever code model. Codestral is an open-weight generative AI model explicitly designed for code generation tasks. It helps developers write and interact with code through a shared instruction and completion API endpoint. As it masters code and English, it can be used to design advanced AI applications for software developers.

Codestral is a 22B open-weight model licensed under the new Mistral AI Non-Production License, which means that you can use it for research and testing purposes. Codestral can be downloaded on HuggingFace

Update July 16th: Codestral Mamba release:  For easy testing, they made Codestral Mamba available on la Plateforme (codestral-mamba-2407), alongside its big sister, Codestral 22B. While Codestral Mamba is available under the Apache 2.0 license, Codestral 22B is available under a commercial license for self-deployment or a community license for testing purposes.

33. Cursor

Cursor is an AI-enhanced code editor designed to boost productivity by enabling developers to interact with their codebase through conversational AI and natural language commands. It includes features like Copilot++, which predicts your next code edit, and Cmd-K, which allows code modifications through simple prompts.

You can try Cursor for free

34. Warp

Warp is a modern, Rust-based terminal with AI built in. Type ‘#’ on your command line and start describing the command you want to run using natural language. Warp will load AI Command Suggestions as you type.

Warp AI is free to use up to 40 requests per user per month. You can create a Team and upgrade to a Team plan to unlock higher Warp AI request limits. Visit the pricing page to learn more.

35. CodiumAI

CodiumAI is a trending tool that developers can use to enhance their coding experience with the power of AI. Key features: When compared to the other tools, CodiumAI provides a set of unique features: Precise code suggestions: CodiumAI thoroughly analyzes your code, providing tailored suggestions. These include adding docstrings, refining exception handling, and implementing best practices, directly improving your code’s quality. Code explanation: This tool offers detailed descriptions of your source code or snippets, breaking down each component and offering insights and sample usage scenarios to enhance code comprehension. Automated test generation: Testing is essential in large codebases. CodiumAI simplifies this by swiftly generating accurate and reliable unit tests without manual intervention, saving significant time and effort and ensuring thorough testing of your codebase. Code behavior coverage: Comprehensive testing means covering all possible code behaviors. CodiumAI’s “Behavior Coverage” feature generates test cases covering various code behaviors and seamlessly applies related changes to your source code. Streamlined collaboration: CodiumAI facilitates teamwork by enabling seamless collaboration among developers. Its Git platform integration allows for sharing and reviewing code suggestions and test cases within your development team, promoting efficient workflows and code quality. Seamless implementation: With CodiumAI’s intelligent auto-completion agent, implementation becomes effortless. It seamlessly integrates with your task plans, ensuring smooth execution from concept to completion of your code. Multiple language and IDE support: CodiumAI supports popular programming languages such as Python, JavaScript, and TypeScript while seamlessly integrating with leading IDEs, including VSCode, WebStorm, IntelliJ IDEA, CLion, PyCharm, and JetBrains. Pricing The pricing of CodiumAI offers free code integrity for developers at $0/user per month, while teams can access optimized collaboration for $19/user per month.

36. MutableAI

MutableAI is a tool that revolutionizes the coding experience with features such as AI autocomplete, one-click production code enhancements, prompt-driven development, test generation, and extensive language and IDE integration, empowering developers to write code more efficiently and effectively. Key features Here are the key features of MutableAI: AI Autocomplete: Minimize time spent on boilerplate code and searching for solutions on Stack Overflow with specialized neural networks providing intelligent code suggestions. Production Quality Code: Refactor, document, and add types to your code effortlessly, ensuring high-quality code output. Prompt-driven Development: Interact directly with the AI by giving instructions to modify your code, enabling a more intuitive and interactive coding experience. Test Generation: Automatically generate unit tests using AI and metaprogramming techniques, ensuring comprehensive test coverage for your code. Language and IDE Integration: Supports popular languages like Python, Go, JavaScript, TypeScript, Rust, Solidity, and more, as well as integration with IDEs like JetBrains and Visual Studio (VS) Code. Pricing MutableAI’s basic plan offers $2 per repo per month, while its premium plan offers $15 per repo per month.

37. Figstack

Figstack is an innovative AI tool that provides developers with various features to improve code understanding, translation, documentation, and optimization. Figstack caters to developers at all levels, from beginners looking to understand complex code to experienced professionals aiming to automate tedious tasks like writing documentation or measuring code efficiency. Key features Code explanation in natural language: This feature helps users easily understand the code written in any language by translating it into clear, natural language descriptions. Cross-Language code translation: Developers can easily convert code from one programming language to another. This simplifies the process of porting applications across different technology stacks. Automated function documentation: Figstack automatically generates detailed docstrings that describe the function’s purpose, parameters, and return values, ensuring that your code is always readable, maintainable, and well-documented. Time complexity analysis: The tool helps developers assess the efficiency of their code in Big O notation, pinpoint bottlenecks, and optimize their code for better performance by identifying the time complexity of a program. Pricing Figstack is free to use and includes most of the essential features.

38. CodeGeeX

CodeGeeX is an AI-powered code generation tool designed to assist developers in writing, completing, and optimizing code more efficiently. It leverages deep learning models trained on a wide variety of programming languages and codebases, where it can provide context-aware code suggestions, complete code snippets, and even generate entire functions or modules. Key features Code generation and completion: CodeGeeX offers accurate code generation capabilities based on natural language descriptions. Also, it can complete the current line or multiple lines ahead, making the development process faster. Code translation: Developers can effortlessly convert their code from one programming language to another. Automated comment generation: The tool saves time by automatically generating line-level comments, which helps improve code readability and maintainability. AI chatbot: The AI chatbot in CodeGeeX provides quick answers to technical questions directly within the development environment instead of having developers find solutions on the internet. Wide IDE and language support: CodeGeeX supports various popular IDEs, including Visual Studio Code, JetBrains IDEs and multiple programming languages, such as Python, C++, JavaScript, and Go. Pricing CodeGeeX offers their plugin completely free for individual users. If there are more advanced requirements, they provide an enterprise plan.

39. Codeium

One I personally use. Millions of engineers, including our own, use these features every single day. Autocomplete Autocomplete faster than thought. Codeium's generative code can save you time and help you ship products faster. Command Give instructions in your editor to perform inline refactors, whether it is generating code, adding comments, or something even more complex. Chat Generate boilerplate, refactor code, add documentation, explain code, suggest bug fixes, and so much more. Powered by the largest models, optimized for coding workflows and Codeium's industry-leading reasoning engine. Context All of Codeium's features are powered by an industry-leading context awareness and reasoning engine. With full repository and multi repository codebase awareness, Codeium provides 35% more value purely from providing more grounded results.

References

Tags: Technology,Artificial Intelligence,Generative AI,Large Language Models,Python,JavaScript,

Monday, July 29, 2024

Index of Quizzes (Educational)


  1. Try Out Machine Learning and Data Science Quiz Questions With Solutions
  2. Show All Interview Questions (For ML, NLP, Deep Learning)
  3. Hindi to English Learning (Version 3)
  4. Progress Report (Hindi to English Learning)
  5. Python Quiz (13 Questions, May 2023)
  6. LinkedIn's HTML Assessment Dump (Apr 2023)
  7. React Based Quiz App - Questions on JS
  8. Machine Learning Quiz (For Beginners)
  9. 20 Quiz Questions For JavaScript Beginners with Easy Difficulty (Oct 2023)
  10. Regular Expressions Quiz (12 Questions)
  11. 14 Problems on lists in Python
  12. 5 Problems on strings (Using Python)
Tags: Technology,JavaScript,Machine Learning,Deep Learning,

Thursday, July 25, 2024

React Native Books (Jul 2024)

To See All Tech Related Book Lists: Index of Book Lists And Downloads
Download Books
1.
Learning React Native: Building Native Mobile Apps with JavaScript
Bonnie Eisenman, 2015

2.
React Native in Action: Developing IOS and Android Apps with JavaScript
Nader Dabit, 2019

3.
React and React Native
Adam Boduch, 2017

4.
Fullstack React Native: Create Beautiful Mobile Apps with JavaScript and React Native
Anthony Accomazzo, 2019

5.
React Native for Mobile Development: Harness the Power of React Native to Create Stunning IOS and Android Applications
Abhishek Nalwaya, 2019

6.
React and React Native: A Complete Hands-on Guide to Modern Web and Mobile Development with React.js
Adam Boduch, 2020

7.
React Native Cookbook: Recipes for Solving Common React Native Development Problems
Dan Ward, 2019

8.
Mastering React Native: A Beginner's Guide
2022

9.
Professional React Native: Expert Techniques and Solutions for Building High-quality, Cross-platform, Production-ready Apps
Alexander Benedikt Kuttig, 2022

10.
React and React Native: Build Cross-platform JavaScript Applications with Native Power for the Web, Desktop, and Mobile
Adam Boduch, 2022

11.
Simplifying State Management in React Native: Master State Management from Hooks and Context Through to Redux, MobX, XState, Jotai and React Query
Aleksandra Desmurs-Linczewska, 2023

12.
JavaScript Everywhere: Building Cross-Platform Applications with GraphQL, React, React Native, and Electron
Adam D. Scott, 2020

13.
Practical React Native: Build Two Full Projects and One Full Game Using React Native
Frank Zammetti, 2018

14.
Mastering React Native
Cybellium Ltd

15.
React Native for IOS Development
Abhishek Nalwaya, 2015

16.
Learning React: Modern Patterns for Developing React Apps
Alex Banks, 2020

17.
React: Cross-Platform Application Development with React Native: Build 4 Real-world Apps with React Native
Emilio Rodriguez Martinez, 2018

18.
React Native By Example
Richard Kho, 2017

19.
React Native Cookbook: Bringing the Web to Native Platforms
Jonathan Lebensold, 2018

20.
React Key Concepts: Consolidate Your Knowledge of React's Core Features
Maximilian Schwarzmuller, 2022

21.
Hands-On Design Patterns with React Native: Proven Techniques and Patterns for Efficient Native Mobile Development with JavaScript
Mateusz Grzesiukiewicz, 2018

22.
React in Action
Mark Tielens Thomas, 2018

23.
React: Up & Running: Building Web Applications
Stoyan Stefanov, 2016

24.
Beginning React with Hooks
Greg Lim, 2020

25.
React Design Patterns and Best Practices
Michele Bertoli, 2017

26.
Mastering React Native
Eric Masiello, 2017

27.
React Native Cookbook
Stan Bershadskiy, 2016

28.
Beginning React (incl. Redux and React Hooks)
Greg Lim, 2017

29.
The Road to Learn React: Your Journey to Master Plain Yet Pragmatic React. Js
Robin Wieruch, 2017

30.
React Native - Building Mobile Apps with JavaScript
Vladimir Novick, 2017

31.
React Native Blueprints: Create Eight Exciting Native Cross-platform Mobile Applications with JavaScript
Emilio Rodriguez Martinez, 2017

32.
Learn All about React Native
Innoware Pjp, 2023

33.
Creating Apps with React Native: Deliver Cross-Platform 0 Crash, 5 Star Apps
M. Holmes He, 2022

34.
React Native Tutorial: How to Start with React Native. Beginners Guide Book
Nicholas Brown, 2016

35.
React: Quickstart Step-By-Step Guide to Learning React Javascript Library (React. Js, Reactjs, Learning React JS, React Javascript, React Programming)
Lionel Lopez, 2017

36.
React Quickly: Painless Web Apps with React, JSX, Redux, and GraphQL
Azat Mardan, 2017

37.
React Cookbook: Create Dynamic Web Apps with React Using Redux, Webpack, Node.js, and GraphQL
Carlos Santana Roldán, 2018

38.
React Design Patterns and Best Practices: Design, Build and Deploy Production-ready Web Applications Using Standard Industry Practices, 2nd Edition
Carlos Santana Roldán, 2019

39.
Beginning ReactJS Foundations Building User Interfaces with ReactJS: An Approachable Guide
Chris Minnick, 2022

40.
Lightning-Fast Mobile App Development with Galio: Build Stylish Cross-platform Mobile Apps with Galio and React Native
Alin Gheorghe, 2021

41.
The Road to React: With React 18 and React Hooks : Required Knowledge: JavaScript
Robin Wieruch, 2017

42.
Getting Started with React Native
Tom Bray, 2015

43.
Learning React: Functional Web Development with React and Redux
Alex Banks, 2017

44.
Fullstack React: The Complete Guide to ReactJS and Friends
Nate Murray, 2017

45.
Learning React: A Hands-On Guide to Building Web Applications Using React and Redux
Kirupa Chinnathambi, 2017

46.
Pro React 16
Adam Freeman, 2019

47.
Getting Started with React
Danillo Corvalan, 2016

48.
React Development Using TypeScript: Modern Web App Development Using Advanced React Techniques (English Edition)
Pranali Dahale, 2024

49.
React Projects: Build Advanced Cross-platform Projects with React and React Native to Become a Professional Developer
Roy Derks, 2022

50.
React Native for Mobile Development (2 in 1 eBooks)
2023
Tags: Technology,List of Books,JavaScript,React Native,

Thursday, December 28, 2023

Coding Round in Interview for Data Scientist Role at a Bank (17 Nov 2023)

Task 1

Write a function: def solution(A) that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A. For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5. Given A = [1, 2, 3], the function should return 4. Given A = [−1, −3], the function should return 1. Write an efficient algorithm for the following assumptions: N is an integer within the range [1..100,000]; each element of array A is an integer within the range [−1,000,000..1,000,000].

A brute-force solution to this problem that will fail the performance tests will look like this:

def solution(A): # a_sort = sorted(A) rtn = -1 for i in range(1, 100001): if i in A: # This is the most time consuming instruction of this code that runs repeatedly for all of i(s) continue else: rtn = i break return rtn

Task 2

Task 3

Fig 3.1
Fig 3.2
Fig 3.3

Monday, December 25, 2023

Building a Tree from a BODMAS Expression (An exercise in Recursion)

There is an expression with N variables as in A, B, C, X, Y, Z. Note that variables do not repeat. And N-1 variables which can be +,-,*, and /

For example:

Ex 1: X + Y * Z
Ex 2: X - Y * Z + A
Ex 3: X * Y - Z / A
Ex 4: X / Y / Z
Ex 5: X * Y / Z
Ex 6: Z - Y + X 

Now, can you give me a recursion based JavaScript code to create a tree with operators on non-leaf nodes and leaf nodes contains the variables based on the BODMAS evaluation of the expression.

Code Pre-read

Certainly! To represent an expression as a tree structure in JavaScript, you can use a recursive data structure. Here's a simple example of how you can create a tree with operators on non-leaf nodes and variables on leaf nodes based on BODMAS evaluation:

Code in on next slide

This code defines a TreeNode class to represent nodes in the expression tree. The buildExpressionTree function takes an expression as input and returns the root of the expression tree. The tree is built recursively based on the BODMAS rules, with operators on non-leaf nodes and variables on leaf nodes.

Note: This code assumes that the input expression is properly formatted and follows BODMAS rules.

Code to Build a Tree Node

class TreeNode {
    constructor(value) {
        this.value = value;
        this.left = null;
        this.right = null;
    }
} 

Code

function buildExpressionTree(expression) {
  // Tokenize Expression
  const tokens = expression.split(/\s/).filter(token => token.trim() !== ''); 

    
    // Helper function to build the expression tree recursively
    function buildTree(start, end) {
        if (start === end) {
            // Base case: single variable
            return new TreeNode(tokens[start]);
        }

        // Find the operator with the lowest precedence
        let minPrecedence = Infinity;
        let minIndex = -1;
        
        for (let i = start; i < end; i++) {
            if (tokens[i] === '+' || tokens[i] === '-') {
                const precedence = 1;
                if (precedence <= minPrecedence) {
                    minPrecedence = precedence;
                    minIndex = i;
                }
            } else if (tokens[i] === '*' || tokens[i] === '/') {
                const precedence = 2;
                if (precedence <= minPrecedence) {
                    minPrecedence = precedence;
                    minIndex = i;
                }
            }
        }
// Create the current node with the operator
        const currentNode = new TreeNode(tokens[minIndex]);

        // Recursively build left and right subtrees
        currentNode.left = buildTree(start, minIndex - 1);
        currentNode.right = buildTree(minIndex + 1, end);

        return currentNode;
    }

    // Build the tree starting from the root
    return buildTree(0, tokens.length - 1);
}

// Example usage:
const expression = "X + Y * Z";
const expressionTree = buildExpressionTree(expression);
console.log(expressionTree);

Explanation of the code

Certainly! Let's go through the code line by line:

TreeNode Class

class TreeNode {
    constructor(value) {
        this.value = value;
        this.left = null;
        this.right = null;
    }
}

This part defines a TreeNode class, which will be used to represent nodes in the expression tree. Each node has a value (either an operator or a variable), a left child, and a right child.
function buildExpressionTree(expression) {
    const tokens = expression.split(/\s/).filter(token => token.trim() !== ''); // Tokenize expression

    The buildExpressionTree function takes an input expression and splits it into tokens using a regular expression. The regular expression \b matches word boundaries, and filter is used to remove any empty or whitespace-only tokens.


    // Helper function to build the expression tree recursively
    function buildTree(start, end) {
        if (start === end) {
            // Base case: single variable
            return new TreeNode(tokens[start]);
        }

    The buildTree function is a helper function for building the expression tree recursively. The base case checks if start and end are the same, which means we have reached a leaf node containing a single variable. In this case, a new TreeNode is created with the variable as its value.

Operator Precedence Next, we are going to look at operator precedence. Viz: In the order DM > AS And if it’s DD or MM or DM, then left to right. // Find the operator with the lowest precedence let minPrecedence = Infinity; let minIndex = -1; for (let i = start; i < end; i++) { if (tokens[i] === '+' || tokens[i] === '-') { const precedence = 1; if (precedence <= minPrecedence) { minPrecedence = precedence; minIndex = i; } } else if (tokens[i] === '*' || tokens[i] === '/') { const precedence = 2; if (precedence <= minPrecedence) { minPrecedence = precedence; minIndex = i; } } } This part of the code searches for the operator with the lowest precedence in the given range (start to end). It iterates through the tokens, updating minPrecedence and minIndex whenever it finds an operator with lower precedence.

// Create the current node with the operator const currentNode = new TreeNode(tokens[minIndex]); // Recursively build left and right subtrees currentNode.left = buildTree(start, minIndex - 1); currentNode.right = buildTree(minIndex + 1, end); return currentNode; } Once the operator with the lowest precedence is found, a new TreeNode is created with that operator as its value. The left and right children of this node are then recursively built using the buildTree function. // Build the tree starting from the root return buildTree(0, tokens.length - 1); } Finally, the buildExpressionTree function initiates the construction of the expression tree by calling buildTree with the entire range of tokens. The function returns the root of the expression tree. // Example usage: const expression = "X + Y * Z"; const expressionTree = buildExpressionTree(expression); console.log(expressionTree); This part demonstrates the usage of the code by creating an example expression ("X + Y * Z") and building an expression tree from it. The resulting tree is then printed to the console. The example expression can be replaced with other expressions as needed. Overall, this code recursively builds an expression tree based on the BODMAS rules, where operators are placed on non-leaf nodes and variables on leaf nodes.

Prompts we tried on ChatGPT

There is an expression with N variables as in A, B, C, X, Y, Z. And N-1 variables which can be +,-,*, and /

For example:

Ex 1: X + Y * Z
Ex 2: X - Y * Z + A
Ex 3: X * Y - Z / A
Ex 4: X / Y / Z
Ex 5: X * Y / Z
Ex 6: Z - Y + X 

A problem can have from 1 to 5 operators.

Now, can you give me a recursion based Python code to create a BODMAS based parenthesized expression for the given expression.

Monday, December 11, 2023

Combinations of a set of alphabets using JavaScript (A problem of recursion)

Problem

Write a function that takes two parameters:
A: a list of distinct alphabets
n: a number that denotes the size of the selection we are going to make of the alphabets from the list A

The output of the function should be a list of lists containing all the possible combinations of size n from the list of alphabets A.

For example:
solution(['A', 'B', 'C', 'D'], 2)
Produces:

[
    [ 'A', 'B' ],
    [ 'A', 'C' ],
    [ 'A', 'D' ],
    [ 'B', 'C' ],
    [ 'B', 'D' ],
    [ 'C', 'D' ]
]
/*
Example 1:

Combinations ([A,B,C,D], 3) is equal to:
A + Combinations([B,C,D], 2) and
B + Combinations([C,D], 2)

~~~

Example 2:

Combinations(ABCDE, 3) is equal to:
A + Combinations(BCDE, 2) and
B + Combinations(CDE, 2) and
C + Combinations(DE, 2)

~~~

Example 3:

Combinations(ABCDE, 2) is equal to:
A + Combinations(BCDE, 1) and
B + Combinations(CDE, 1) and
C + Combinations(DE, 1) and
D + Combinations(E, 1)

*/

function solution(A, n) {
    if (A.length == 1 || A.length == n) { 
        return [A]; 
    } else if (n == 1) {        
        return A.map(function (i){ return [i] });
    }
    
    const resultArr = []
    for (let i = 0; i < A.length - n + 1; i++) {
        let currentElement = A[i]

        otherElements = A.slice(i+1)
        subCombinations = solution(otherElements, n-1)
        
        for (let j = 0; j < subCombinations.length; j++) {
            
            resultArr.push([currentElement].concat(subCombinations[j]))
        }
    }

    return resultArr
}

console.log(solution(['A', 'B', 'C', 'D'], 2))
console.log("~~~")

console.log(solution(['A', 'B', 'C', 'D'], 3))
console.log("~~~")

console.log(solution(['A', 'B', 'C', 'D', 'E'], 2))
console.log("~~~")


console.log(solution(['A', 'B', 'C', 'D'], 4))
console.log("~~~")

console.log(solution(['A', 'B', 'C', 'D'], 1))
console.log("~~~")

/*
[
    [ 'A', 'B' ],
    [ 'A', 'C' ],
    [ 'A', 'D' ],
    [ 'B', 'C' ],
    [ 'B', 'D' ],
    [ 'C', 'D' ]
]
~~~
[
    [ 'A', 'B', 'C' ],
    [ 'A', 'B', 'D' ],
    [ 'A', 'C', 'D' ],
    [ 'B', 'C', 'D' ]
]
~~~
[
    [ 'A', 'B' ], [ 'A', 'C' ],
    [ 'A', 'D' ], [ 'A', 'E' ],
    [ 'B', 'C' ], [ 'B', 'D' ],
    [ 'B', 'E' ], [ 'C', 'D' ],
    [ 'C', 'E' ], [ 'D', 'E' ]
]
~~~
[ [ 'A', 'B', 'C', 'D' ] ]
~~~
[ [ 'A' ], [ 'B' ], [ 'C' ], [ 'D' ] ]
~~~

*/

Permutations of a set of alphabets using JavaScript (A problem of recursion)

Problem

In the given problem statement we are asked to generate every possible permutation of the array given as input by the in JavaScript going from brute force method to optimized solution. What is Permutation of Array in JavaScript? Permutation of Array refers to the shuffling and ordering of elements present in an array. It generates all possible ways or arrangements of elements using the array as input source of it. If we have an array of n elements in javascript, it generates n! possible ways to order and output elements. The permutation of elements is the core of solving problem statement where the input and output can be visualized as follows : const arr = [ 1 , 2 , 3 ] ; // generate all permutations [ 1 , 2 , 3 ] [ 1 , 3 , 2 ] [ 2 , 1 , 3 ] [ 2 , 3 , 1 ] [ 3 , 1 , 2 ] [ 3 , 2 , 1 ]

Solution

function solution(A) { let resultArr = [] if (A.length > 1) { for (let i = 0; i < A.length; i++) { const currentElement = A[i]; otherElements = A.slice(0,i).concat(A.slice(i+1)); subPermutations = solution(otherElements); for (let j = 0; j < subPermutations.length; j++) { resultArr.push([currentElement].concat(subPermutations[j])); } } } else if(A.length == 1) { return [A] } return resultArr } console.log(solution(['A', 'B']))
[ Ref ]

Monday, October 2, 2023

Regular Expressions Quiz (12 Questions)


    
Question ()


            
            

            
 
 

Your score is:




Question: