Apr 24, 2021React-Redux using HOCThis example code adds items to a cart using react-redux with higher order components (HOC). Let us begin with the redux workflow explanation. The work flow for redux is as follows:React9 min read
Apr 21, 20207-Tips for Starting a React Project!Input the following code inside your terminal: npx create-react-app my-app Congratulations you are done! the whole project has started! (It was a joke, but that has typically been the first command I enter to start a react project.) But let’s get serious. React is a wide JavaScript library, used by…React2 min read
Apr 13, 2020When to use classes and functional components in React!When I started coding in React I would always wonder why everything didn’t just use a class component when coding, it would make life a lot easier to follow I use to think. But, I learned that they have advantages of using each type when needed. React’s project architect is…React2 min read
Apr 6, 2020Python-algos: Sentence ReversalGiven a string of words, reverse all the words. For example: “Hi my name is Avi”, becomes “Avi is name my Hi”. def rev_word3(s): words = [] length = len(s) spaces = [' '] i = 0 while i < length…Python1 min read
Mar 31, 2020Python-algos: Largest Continuous SumGiven an array of integers (positive and negative) find the largest continuous sum. An example of an array would be the following: [7,2,-6,3,4,10,10,-10,-10] . The array’s maximum sum would be 30, summing everything until the last two -10’s are not included in the sum. def large_cont_sum(arr)…Algorithms1 min read
Mar 23, 2020Python-Algos: Find the Missing ElementConsider an array of non-negative integers. A second array is formed by shuffling the elements of the first array and deleting a random element. Given the two arrays, find which element is missing in the second array. def findt_missing(arr1,arr2): arr1.sort() arr2.sort()…Python1 min read
Mar 17, 2020Python-Algos: Array Pair SumThey’re many ways to approach this problem, but you have to consider the time it takes to run the code once the data becomes much bigger than your sample test data. The Array Pair Sum problem: Given an integer array, output all the unique pairs that sum up to a…Algorithms1 min read
Mar 10, 2020What is a Rails API?Application programming interface or API, is a software intermediary that allows for two applications to talk to each other. In other words, an API is the messenger that delivers your request and responses from the front end to the back end of your program (client side rendering). API’s are designed…Rails3 min read
Mar 3, 2020Error Deploying images on Heroku with Rails?Hey, I encountered a problem when I was deploying my first project on Heroku that I was having a hard time debugging. I created a full CRUD, MVC project using Ruby on Rails, running everything locally. localhost:3000 was running beautifully without any bugs, and I was excited to finally see…Web Development2 min read
Feb 24, 2020Ruby on Rails: AuthorizationDevise gem is a beautiful gem. Inside your gemfile, require: gem 'devise', '~> 4.7', '>= 4.7.1' Or which ever version is the most updated. Run bundle install to grab the library and any dependencies for your rails project.Next, you need to run the generator: rails generate devise:install Open the devise.rb…Rails2 min read