Skip to content

Instantly share code, notes, and snippets.

View Ajay-Raj-S's full-sized avatar
👋
W0rking with Django

Ajay Raj Ajay-Raj-S

👋
W0rking with Django
View GitHub Profile
@Ajay-Raj-S
Ajay-Raj-S / is-Loop-in-List.java
Created October 15, 2019 11:58
To check for any loop existence in the Linked List
package datastructures;
import java.util.ArrayList;
public class checkLoop {
Node head = null;
Node last = null;
int size = 0;
static class Node {
@Ajay-Raj-S
Ajay-Raj-S / stack-using-LinkedList.java
Last active October 15, 2019 12:00
Stack data structure implementation using Linked List in java
package datastructures;
public class StackUsingLL {
private Node top = null;
private Node head = null;
private int size = 0;
class Node {
int data;
@Ajay-Raj-S
Ajay-Raj-S / binary-search-tree.c
Last active September 22, 2019 02:49
A complete implementation of Binary Search Tree
#include<stdio.h>
#include<stdlib.h>
struct node {
struct node* parent;
struct node* left;
int value;
struct node* right;
};
@Ajay-Raj-S
Ajay-Raj-S / queue-using-array.c
Created September 18, 2019 18:22
Queue using Array in C program.
#include<stdio.h>
#include<stdlib.h>
#define MAX 5
int front = 0;
int last = 0;
int queue[MAX];
void enqueue(int val) {
queue[last++] = val;
@Ajay-Raj-S
Ajay-Raj-S / stack-using-array.c
Created September 18, 2019 18:22
Stack using Array C Program.
#include<stdio.h>
#include<stdlib.h>
#define MAX 10
int top = -1;
int stack[MAX];
void push(int val) {
stack[++top] = val;
printf("Value Pushed!\n");
@Ajay-Raj-S
Ajay-Raj-S / circular-linked-list.c
Last active September 22, 2019 02:50
Circular Linked List Implementation
#include<stdio.h>
#include<stdlib.h>
// circular linked list using Singly Linked list
struct circular {
int value;
struct circular* next;
};
@Ajay-Raj-S
Ajay-Raj-S / doubly-linked-list.c
Last active September 17, 2019 16:05
A simple Doubly Linked List.
#include<stdio.h>
#include<stdlib.h>
struct doubly {
struct doubly* prev;
int value;
struct doubly* next;
};
typedef struct doubly* node;
@Ajay-Raj-S
Ajay-Raj-S / singly-linked-list.c
Last active September 17, 2019 16:19
A simple and explained code on singly linked list.
#include<stdio.h>
#include<stdlib.h>
struct list {
int value;
struct list* next;
};
struct list* root = NULL;
struct list* lastNodeAddr = NULL;
@majackson
majackson / migrations.md
Last active May 2, 2025 17:50
Django migrations without downtime

Django Migrations without Downtime

The following instructions describe a set of processes allowing you to run Django database migrations against a production database without having to bring the web service down.

Note that in the below instructions, migrations are all run manually at explicit points, and are not an automatic part of the deployment process.

Adding Fields or Tables

Adding a (nullable) field or a new table

  1. Make the model or column addition in your code.
@bradmontgomery
bradmontgomery / example.py
Created August 16, 2016 16:57
Example of setting a choices value for django ArrayField
# Here's your list of choices that would be displayed in a drop-down
# element on the web. It needs to be a tuple, and we define this
# as a variable just for readability/convenience.
#
# This example has 3 choices, each of which consists of two parts:
# 1. the thing that get strored in your database
# 2. the thing that you see in a dropdown list
LABEL_CHOICES = (
('this gets stored in your database', 'This item is what you see in the drop-down'),
('django', 'Django'),