Introduction:
In the ever-evolving world of technology, sometimes setbacks can lead to groundbreaking innovations. A personal experience of mine underscores this perfectly. A project that was once a labor of love during my college days, created with the guidance of my programming professor Omar Salem at Westwood College 1, was lost due to an unforeseen event: an ex-spouse selling a hard drive containing crucial data.
The Original Project:
The project in question was a “Do Not Call List Scrubber,” a tool designed to help reduce unwanted telemarketing calls. This software, painstakingly developed over a month, was more than just a class assignment; it was a potential solution to a widespread nuisance. My aim was to offer it as a public service, aiding government efforts in regulating telemarketing practices.
The Setback:
Years later, the unexpected sale of a hard drive by my ex-spouse resulted in the loss of this project. It was a devastating blow, not just personally but for the potential impact the software could have had in reducing telemarketing calls globally.
AI to the Rescue:
Fast forward to the present, and the landscape of technology has dramatically changed. AI, once a fledgling field, is now at the forefront of innovation. Embracing this advancement, I set out to rebuild the Do Not Call List Scrubber, but this time with AI at its core.
The Rebuild:
Remarkably, what initially took a month to create in college, AI enabled me to rebuild in just two hours. This new AI-powered version was not only faster to develop but more efficient and effective in scrubbing numbers against the Do Not Call list.
using System;
using System.Collections.Concurrent;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Security.Cryptography;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
class Program
{
static void Main(string[] args)
{
string configFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.ini");
ConfigurationManager configManager = new ConfigurationManager(configFilePath);
string dataStoragePath = configManager.GetDataStoragePath();
if (string.IsNullOrEmpty(dataStoragePath))
{
Console.WriteLine("Enter the data storage drive path:");
dataStoragePath = Console.ReadLine();
configManager.SetDataStoragePath(dataStoragePath);
}
DNCCleaner cleaner = new DNCCleaner(dataStoragePath);
cleaner.LoadDNCLists();
cleaner.CleanFiles();
}
}
class DNCCleaner
{
private ConcurrentDictionary dncNumbers;
private string baseDirectory;
public DNCCleaner(string baseDirectory)
{
this.baseDirectory = baseDirectory;
dncNumbers = new ConcurrentDictionary<string, bool>();
}
public void LoadDNCLists()
{
string dncPath = Path.Combine(baseDirectory, "DNC-Lists");
foreach (var file in Directory.GetFiles(dncPath))
{
foreach (var line in File.ReadLines(file))
{
dncNumbers[line.Trim()] = true;
}
}
}
public void CleanFiles()
{
string sourcePath = Path.Combine(baseDirectory, "TOBECLEANED");
string destinationPath = Path.Combine(baseDirectory, "CLEANEDDATA");
Directory.CreateDirectory(destinationPath);
var options = new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount };
Parallel.ForEach(Directory.GetFiles(sourcePath), options, file =>
{
string destFile = Path.Combine(destinationPath, Path.GetFileName(file));
using (var writer = new StreamWriter(destFile))
{
bool isFirstLine = true;
foreach (var line in File.ReadLines(file))
{
if (isFirstLine)
{
isFirstLine = false;
if (IsHeaderRow(line))
{
writer.WriteLine(line);
continue;
}
}
var columns = line.Split(',');
if (columns.Any(c => IsValidPhoneNumber(c) && dncNumbers.ContainsKey(FormatPhoneNumber(c))))
{
continue;
}
writer.WriteLine(line);
}
}
});
}
private bool IsHeaderRow(string line)
{
// Implement logic to determine if the row is a header
return line.Split(',').Any(cell => !Regex.IsMatch(cell, @"^(1|\+1)?\d{10}$"));
}
private bool IsValidPhoneNumber(string number)
{
return Regex.IsMatch(number, @"^(1|\+1)?\d{10}$");
}
private string FormatPhoneNumber(string number)
{
return Regex.Replace(number, @"[^\d]", "");
}
}
class ConfigurationManager
{
private string configFilePath;
public ConfigurationManager(string configFilePath)
{
this.configFilePath = configFilePath;
}
public string GetDataStoragePath()
{
if (File.Exists(configFilePath))
{
return File.ReadAllText(configFilePath);
}
return null;
}
public void SetDataStoragePath(string path)
{
File.WriteAllText(configFilePath, path);
}
}
Beyond Support:
This project is a testament to my journey in tech. It’s a clear indicator that my capabilities extend far beyond the confines of a support role. It’s a demonstration of resilience, adaptability, and the power of modern technology.
Conclusion:
The journey of rebuilding the Do Not Call List Scrubber is a narrative of loss, resilience, and the transformative power of AI. It’s a story that reflects my personal growth and the evolution of technology. It also serves as a reminder that sometimes, the most significant advancements come from overcoming challenges.