Skip to main content

Posts

Install pip on Windows

If you haven't downloaded get-pip.py yet: You need to download this file from the official pip website or use curl in your command prompt. Using curl (recommended): Open Command Prompt and type: DOS curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py This will download the file to your current directory in the Command Prompt. Manual Download: Go to https://bootstrap.pypa.io/get-pip.py in your web browser, right-click on the page, select "Save as...", and save the file as get-pip.py to a location you can easily navigate to (e.g., your Downloads folder, or a dedicated Python projects folder). The file is in a different directory: You might have downloaded get-pip.py to your Downloads folder, your Desktop, or another location, but you're trying to run the command from C:\Users\gparn . Solution: Navigate to the directory where you saved get-pip.py in your Command Prompt using the cd (change directory) command. Example (if in Downloads): DOS cd C:\User...
Recent posts

What is Terraform?

  What is Terraform? Terraform is an open-source Infrastructure as Code (IaC) tool developed by HashiCorp . It allows you to provision, manage, and version infrastructure using a declarative configuration language. Key Concepts: 1. Providers Plugins that let Terraform interact with APIs of cloud platforms (e.g., AWS, Azure, GCP) or services (e.g., GitHub, Kubernetes). Example: provider "aws" { region = "us-west-2" } 2. Resources The building blocks of infrastructure (e.g., EC2 instances, S3 buckets). Declared using resource blocks. Example: hcl Copy Edit resource "aws_instance" "example" { ami = "ami-0c55b159cbfafe1f0" instance_type = "t2.micro" } 3. Variables Allow configuration flexibility. Declared using variable blocks and passed via CLI, .tfvars , or environment variables. 4. Outputs Provide information after a Terraform apply. Example: h Copy Edit output "instance_ip...

10 Minute Python Tutorial for Absolute Beginners

Python is a general-purpose programming language that is used for a wide variety of tasks, including data science, machine learning, web development, and more.   It is a popular choice for beginners because it is relatively easy to learn and has a large community of users and resources. This tutorial will teach you the basics of Python programming, so that you can start writing your own programs. We will cover topics such as variables, data types, operators, functions, and control flow. Prerequisites No prior programming experience is required A basic understanding of computers and how they work Getting Started The first step is to install Python. You can download the latest version from the Python website. Once you have installed Python, you can open a text editor and start writing your first program. Hello World The classic first program in any programming language is the "Hello World" program. This program prints the text "Hello, World!" to the console. ...

Media Interview Questions

Media Interview Questions VAST , or “Video Ad Serving Template,” is a script that gives video players information about which ad to play, how the ad should show up, how long it should last, and whether users are able to skip it. VPAID (“Video Player Ad-Serving Interface Definition”) is just code that runs within video players. It’s what jazzes up a run-of-the-mill car ad and makes it an interactive one with features like overlays that let viewers click to read more. Advertisers like ads that trigger a response from viewers so they can measure their effectiveness. MRAID , (Mobile Rich Media Ad Interface Definitions), a standard for rich-media ads that run in mobile apps. IDFA is the abbreviation for identifier for advertisers on iPhones. An IDFA is somewhat analogous to an advertising cookie, in that it enables an advertiser to understand that a user of a phone has taken an action like a click or an app install. That is called ad tracking. IDFAs take the pl...

Error The Specified driver class (org.postgres.Driver) is not available!

SQL Workbench error for PostgreSQL connection: The Specified driver class (org.postgres.Driver) is not available! Below is the error which can appears while connecting to a PostgreSQL databases in SQL workbench: This could be due to Postgres driver is not found by the Workbench tool. This could happen if the folder containing the driver is moved or deleted. Solution: To fix this issue,  1. Open Workbench and go to File - > Manage Drivers 2. Select PostgreSQL 3. Under the Library option select the Folder where the driver is located and select the driver and click on Open. you can download the latest Postgres JDBC drivers at:  https://jdbc.postgresql.org/download.html 4. Click on OK to to close the Manage Drivers window. 5. Now try to connect to the PostgreSQL database with correct credentials, it should connect.

What is a DAG

What is a DAG? Airflow refers to what we've been calling "pipelines" as  DAGs  (directed acyclic graphs). In computer science, a  directed acyclic graph  simply means a workflow which only flows in a single direction. Each "step" in the workflow (an  edge ) is reached via the previous step in the workflow until we reach the beginning. The connection of edges is called a  vertex . If this remains unclear, consider how nodes in a tree data structure relate to one another. Every node has a "parent" node, which of course means that a child node cannot be its parents' parent. That's it - there's no need for fancy language here. Edges in a DAG can have numerous "child" edges. Interestingly, a "child" edge can  also  have multiple parents (this is where our tree analogy fails us). Here's an example: An example DAG structure. In the above example, the DAG begins with edges 1, 2 and 3 kicking things off. At variou...

Databricks Spark DataFrame FAQs

DataFrame FAQs This FAQ addresses common use cases and example usage using the available APIs. For more detailed API descriptions, see the  PySpark documentation . How can I get better performance with DataFrame UDFs? If the functionality exists in the available built-in functions, using these will perform better. Example usage below. Also see the  pyspark.sql.function documentation . We use the built-in functions and the  withColumn()  API to add new columns. We could have also used  withColumnRenamed()  to replace an existing column after the transformation. Copy from pyspark.sql import functions as F from pyspark.sql.types import * # Build an example DataFrame dataset to work with. dbutils . fs . rm ( "/tmp/dataframe_sample.csv" , True ) dbutils . fs . put ( "/tmp/dataframe_sample.csv" , """id|end_date|start_date|location 1|2015-10-14 00:00:00|2015-09-14 00:00:00|CA-SF 2|2015-10-15 01:00:20|2015-08-14 00:00:00|CA-SD 3...