Mário Rodrigues

About Mr. Jensen Huang statement

About Mr. Jensen Huang statement

Jensen Huang’s recent comments about AI rendering coding obsolete might be more about generating clout than reflecting a distinctive understanding of the future of technology.

The debate over the future of coding has recently reignited. While some, like Nvidia’s CEO Jensen Huang, believe AI will make coding obsolete, others hold a different perspective. This article is an opposing viewpoint, exploring why coding might remain relevant despite the rise of artificial intelligence.

While advancements in AI are undeniable, suggesting it will completely replace the need for coding is an overly simplistic and potentially misleading view. AI is not a silver bullet. While AI tools can automate repetitive tasks and generate code, they are not a one-size-fits-all solution.

Complex projects still require human expertise in areas like:

  1. Critical Thinking and Problem-Solving: Identifying the problem, defining its scope, and crafting the right solution are crucial steps that AI cannot fully replace.
  2. Domain Expertise: Understanding the specific industry or application is essential for creating effective and efficient code. AI, while powerful, cannot replicate the human capacity for experience and specialized knowledge.
  3. Creativity and innovation: Pushing boundaries and developing new technologies often requires human ingenuity and the ability to think outside the box.

The future of work may involve collaboration: Instead of AI replacing coding entirely, it’s more likely we’ll see a shift towards humans and AI working together. Developers may utilize AI tools to streamline tasks, allowing them to focus on higher-level aspects like design, architecture, and problem-solving.

Learning to code can still be valuable, even if the specific coding languages change or become more user-friendly, the underlying logic and problem-solving skills gained through coding remain valuable. These skills can be applied in various fields, not just programming, and foster critical thinking, analytical reasoning, and computational thinking.

Therefore, while AI brings exciting advancements, it’s crucial to maintain a nuanced understanding of its capabilities and limitations.

In conclusion, while AI undoubtedly presents exciting advancements, it is crucial to maintain a balanced perspective on its capabilities and limitations. Coding, along with its core principles, will likely continue to play a significant role in the future, even if its form and application evolve alongside AI.

read more

From OSInt to your own Database

Introduction

First of all, you may all ask what is OSInt? OSInt is the process of collecting information about a target through publicly available information. This information can be used to perform a cyber attack or to perform a social engineering attack.

This article isn’t an instruction on how to perform a cyber attack or social engineering attack, but rather a guide on how to collect information about a target.

What is a target?

A target can be a person, a company, a website, a server, a network, or anything that you want to collect information about.

What is publicly available information?

Publicly available information is any information that is available to the public. This information can be found on the internet, in the news, in the phone book, or anywhere else that is available to the public.

How to collect information about a target?

There are several ways to collect information about a target. The common ways are:

Instead of going through each of these methods, I will show you how to use them in a real life example.

Disclaimer: Any of the sites mentioned in this article are not affiliated with me in any way, and I am not responsible for any of the information that you may find on them.

Let’s start, I will show you how to collect information about a target, with 3 different examples, with 3 different types of information.

Example 1

For this example we will use the target John Doe, and let’s assume that i know him from Boston, MA.

I would start by using truthfinder.com to search for the target, in this website you can specify the city and state to narrow down the search results.

This website will list a bunch of individuals with the name John Doe in Boston, MA, with some information about them like their age, relatives, and phone number.

Then you can choose the target that you are looking for, and it will give you more information about them such as their full list of criminal records, their social media accounts, their email address, and their address history.

Based on the information mentioned above, you can now search for the target on social media, and you can also search for their email address on google to find more information about them.

There are several other websites that you can use to collect information about a target, such as beenverified.com, intelius.com, instantcheckmate.com, and spokeo.com.

Example 2

For this example we will use the target John Doe, aswell, but this time let’s assume that i only know his email address that is johndoe@gmail.com.

I would start by using epieos.com to search for the specified email address, this website will list a bunch of websites that are associated with the email address, and it will also list the social media accounts that are associated with the email address.

In case you want to store the information that you found, you can download the results as a CSV or JSON file, and insert them into a database, with a simple association.

CREATE TABLE UserData (
    email VARCHAR(255) PRIMARY KEY,
    websites TEXT,
    social_media_profiles TEXT,
    additional_info TEXT
);

so you can query them later, like this:

SELECT * FROM UserData WHERE email = 'johndoe@gmail.com';

Epieos also return a valuable information, which is if you have been pwned or not, and if you have been pwned, it will list the websites that you have been pwned on.

Example 3

For this example we will use the target John Doe, aswell, but this time let’s assume that i only know his phone number that is 555-555-5555.

I would start by using spydialer.com to search for the specified phone number, this website will list a bunch of individuals with the name John Doe, with some information about them like their age, relatives, and address.

Then you can choose the target that you are looking for, and it will give you more information about them such as their social media accounts, their email address, and their address history.

Based on the information mentioned above, you can now search for the target on social media, and you can also search for their email address on google to find more information about them.

Can I protect myself from OSInt?

Well, the short answer is no, you can’t protect yourself from OSInt, but you can make it harder for someone to collect information about you.

How can you make it harder?

Conclusion

The intention of this article isn’t to teach or hurt anyone, but rather to show you how easy it is to collect information about a target, and how to protect yourself from it.

In this article, I showed you how to collect information about a target, and save it for later use, and how to protect yourself from OSInt.

read more

How Optimizing your Code can Save you Money

Introduction

Optimizing code efficiency is not only a best practice for creating robust and responsive software but also a strategic imperative for cost-effective development. By enhancing the performance of your code, you can directly impact infrastructure costs, resource utilization, and overall system efficiency. This optimization not only leads to a more responsive and scalable application but can also translate into significant savings in terms of cloud hosting, operational expenses, and hardware requirements. In this guide, we’ll explore various tips and coding practices that empower developers to streamline their code, maximize resource utilization, and ultimately reduce associated expenses.

Code Improvements

1. Use the Right Data Structures

Choose algorithms with lower time complexity for critical operations. Consider data structures that are more efficient for the tasks at hand.

Examples:
Using a Map for Fast Key Lookup
map = %{"apple" => 1, "orange" => 2, "banana" => 3}
value = Map.get(map, "orange")
Finding Median
defmodule FindingMedian do
  def find_median_sorted_arrays1(nums1, nums2) do
    nums3 = (nums1 ++ nums2) |> Enum.sort
    if rem(length(nums3), 2) == 1 do
        Enum.at(nums3, trunc(length(nums3)/2))
    else
        num1 = Enum.at(nums3, trunc(length(nums3)/2))
        num2 = Enum.at(nums3, trunc(length(nums3)/2)-1)
        (num1+num2)/2
    end
  end

  def find_median_sorted_arrays2(nums1, nums2) do
    nums3 = (nums1 ++ nums2) |> Enum.sort
    if rem(length(nums3), 2) == 1 do
        Enum.at(nums3, trunc(length(nums3)/2))
    else
        middle = trunc(length(nums3)/2)
        num1 = Enum.at(nums3, middle)
        num2 = Enum.at(nums3, middle-1)
        (num1+num2)/2
    end
  end

  def find_median_sorted_arrays3(nums1, nums2) do
    nums3 = (nums1 ++ nums2) |> Enum.sort
    size = length(nums3)
    if rem(size, 2) == 1 do
        Enum.at(nums3, trunc(size/2))
    else
        middle = trunc(size/2)
        num1 = Enum.at(nums3, middle)
        num2 = Enum.at(nums3, middle-1)
        (num1+num2)/2
    end
  end
end

In the code above, with 3 different versions for the same code, i saved 75ms for a 5000000 integer elements list input between the first and the last version. The first version is the most naive one, the second one is a little bit better, and the last one is the best one. The difference between the first and the last one is the use of a variable to store the length of the array. This way, we don’t have to calculate the length of the array every time we need it.

2. Code Profiling and Optimization

Regularly profile your code to identify performance bottlenecks. Focus optimization efforts on the most time-consuming parts of your code.

Examples:
Using :telemetry to Profile Function Execution Time
:telemetry.attach("my_app_profile", [:my_module, :my_function], &MyProfiler.profile/3)

3. Lazy Loading and Deferred Execution

Implement lazy loading and deferred execution for resources and operations that are not immediately needed. Load data or execute operations only when necessary to conserve resources.

Examples:
Using Stream to Lazily Load Data
data_stream = Stream.resource(fn -> File.stream!("large_file.txt") end, &IO.read/1, close: &File.close/1)

4. Caching Strategies

Implement caching mechanisms to store and reuse frequently requested data. Use caching for computations or results that do not change frequently.

5. Database Optimization

Optimize database queries by indexing columns and avoiding unnecessary joins. Consider denormalization for read-heavy operations. Use connection pooling to efficiently manage database connections.

Examples:
Using Ecto with Indexing to Optimize Database Queries
query = from(u in User, where: u.age > 21, order_by: [asc: u.name], select: u)
Repo.all(query)
Ecto Async Queries with Task
# Example: Ecto Async Queries with Task
task = Task.async(fn ->
  Repo.all(from u in User, where: u.age > 21)
end)

result = Task.await(task)

6. Parallelism and Concurrency

Utilize parallel processing and concurrency to execute tasks concurrently when applicable. Take advantage of multi-core architectures to improve performance.

Examples:
Using Task to Execute Tasks Concurrently
task1 = Task.async(fn -> expensive_operation_1() end)
task2 = Task.async(fn -> expensive_operation_2() end)
{result1, result2} = {Task.await(task1), Task.await(task2)}

8. Minimize Network Requests

Reduce the number of external API calls and network requests. Implement batch processing for multiple requests to minimize the overhead of establishing connections.

Examples:
Using HTTPoison to Batch Requests
tasks = Enum.map(urls, fn url -> Task.async(fn -> HTTPoison.get(url) end) end)
responses = Enum.map(tasks, &Task.await/1)

10. Optimize Frontend Assets

Compress and minify CSS, JavaScript, and other frontend assets. Use content delivery networks (CDNs) to distribute static assets globally.

Examples:
Using Webpack to Minify JavaScript

Webpack can be configured to compress and minify frontend assets

11. Memory Management

Efficiently manage memory usage by releasing unused objects and avoiding memory leaks. Use appropriate data structures to minimize memory overhead.

Examples:
Process Registry for Resource Cleanup
:global.register_name(:my_resource, self())
:global.unregister_name(:my_resource)

12. Implement automated testing to catch performance issues early in development.

Regularly profile and benchmark your code to ensure ongoing optimization.

Examples:
Using ExUnit to Test for Performance
defmodule MyModuleTest do
  use ExUnit.Case

  test "should perform efficiently" do
    # Perform tests to ensure efficient code execution
  end
end

Let’s break this into numbers

Now, let’s break down the calculations for potential cost savings using AWS as an example. Please note that the actual cost structure may vary based on specific AWS services you are using and the pricing model applicable to those services.

Let’s assume the original response time (ORT) is 10 milliseconds, and the improved response time (IRT) is 9.6 milliseconds (10 - 0.4).

Calculate the Number of Requests per Hour:

For the original response time (ORT):

For the improved response time (IRT):

Determine the Cost per Request:

Let’s say it’s $0.000001 per request.

Calculate the Cost Savings per Request:

Cost Savings per Request = (10 - 9.6) * $0.000001 = $0.0000004

Calculate the Total Cost Savings per Hour:

Total Cost Savings per Hour = $0.0000004 * 360,000 = $0.144

Calculate the Total Cost Savings per Year:

Total Cost Savings per Year = $0.144 * 24 hours * 365 days = $1261.44

So, in this simplified example, improving the response time by 0.4 milliseconds could potentially save $0.144 per hour for 1000 requests. Keep in mind that these numbers are illustrative, and actual costs will depend on your specific AWS services and pricing. Always refer to the latest AWS pricing documentation for accurate and up-to-date information.

read more