Tuesday, December 12, 2023

Leetcode type problem - Sub-Arrays problem

 Generate number of sub arrays with a particular sum: E.g. nums = [1,1,1] with sum 2

arr = [1,1,1]
SUM =2
#arr = [1,2,2,3,4,5]
#SUM = 5

sub_arrays = []
arr = arr.sort

arr.each_with_index do |n, index|
  if n == SUM
    sub_arrays << [n]
    next
  end
  rest_of_array = arr[(index+1)..-1]
  temp_arr = [n]

  rest_of_array.each do |m|
    temp_arr << m
    if temp_arr.sum == SUM
      # We found a sub_array!
      sub_arrays << temp_arr
      # There might be duplicates of m, so let us remove m from temp_arr and continue
      temp_arr = temp_arr[0..temp_arr.length-2]
    end
    if temp_arr.sum < SUM
      # do nothing; we can continue to add more elements
    end
    if temp_arr.sum > SUM
      # discard all elements except n
      temp_arr = [n]
    end
  end
end

puts sub_arrays.to_s

Sunday, December 10, 2023

Cryptography Foundations

 Below is an excerpt from the book - Securing Cloud Applications (manning.com)


Tuesday, November 21, 2023

Optimizing HTML to PDF in Node.js

https://blog.logrocket.com/optimizing-html-pdf-node-js

The complete guide to Kubernetes cost management in 2023

https://www.spectrocloud.com/blog/the-complete-guide-to-kubernetes-cost-management

State of Cloud Security

https://www.datadoghq.com/state-of-cloud-security/

Amazon’s free courses on generative AI

https://www.aboutamazon.com/news/aws/aws-free-ai-skills-training-courses

The Architecture Of Serverless Data Systems

https://jack-vanlightly.com/blog/2023/11/14/the-architecture-of-serverless-data-systems

Load Shedding for High Traffic Systems

https://www.codereliant.io/load-shedding/

React Server Components: A comprehensive guide

https://blog.logrocket.com/react-server-components-comprehensive-guide/

Developing an effective CI/CD pipeline for frontend apps

https://blog.logrocket.com/best-practices-ci-cd-pipeline-frontend

Wednesday, October 11, 2023

Rails and JS - No Build for JS

https://world.hey.com/dhh/you-can-t-get-faster-than-no-build-7a44131c

We're making it using vanilla ES6 with import maps for Hotwire, and vanilla CSS with nesting and variables for styling. All running on a delightfully new simple asset pipeline called Propshaft. 

Saturday, September 16, 2023

Rails: class_attribute

https://chat.openai.com/c/388e1263-46a6-4406-b16d-8094b8232dfb

In essence, whenever you find yourself thinking, "I need a class-level configuration that should have a default, but I also want the flexibility to customize it for certain subclasses or instances," class_attribute is a tool you might consider using.

Rails - ActiveRecord - inverse_of

https://chat.openai.com/share/e8f26c7d-d539-4ba9-93b3-52f702ca8909

Rails: Join multiple nested associations

Join multiple nested associations:

https://gist.github.com/abhionlyone/84dec0aa7a5d30b9e2bc6d7bd2094f20

Wednesday, February 15, 2023

How to learn Machine Learning

https://twitter.com/machsci/status/1625569733126033408?s=21&t=Urcac12Ha89dnjd31vAAIg

https://vickiboykis.com/2022/11/10/how-i-learn-machine-learning/

https://pytorch.org/tutorials/beginner/deep_learning_60min_blitz.html

https://twitter.com/jhoang314/status/1624829824782028806?s=21&t=Urcac12Ha89dnjd31vAAIg

https://www.ninoristeski.com/how-to-find-the-best-resources-on-machine-learning/

...

Start with tabular data and linear/logistic regression. Then grab lightgbm with automl, learn the common explainability methods and focus on anything BUT selecting an algorithm. When you got that, learn all other algorithms in and out and look for model innovations.

...

Just learn BigQuery and it's machine learning capabilities and read books alot and avoid youtube videos as much as possible.

...

Start with SQL, Python. Pick a popular ML library e.g. Sklearn, Keras, XGBoost and apply it to a dataset

...

Start by getting familiar with the fundamentals of machine learning, such as linear algebra, calculus and probability theory. Also read up on popular algorithms to get a better understanding of how they work.

...

Learn statistics and probability a lot of concepts require simple concepts from those fields, if you want to go a little further learn abstract geometry is going to allow you to learn about how nonlinear models implement hyperplanes.

Followers

Blog Archive