Skip to content

Instantly share code, notes, and snippets.

View ajaysjournal's full-sized avatar

Ajay Ramesh ajaysjournal

View GitHub Profile
@ajaysjournal
ajaysjournal / ParsingExample
Created April 17, 2015 10:47
Reads the RTF document and output in the console
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@ajaysjournal
ajaysjournal / Upload.java
Created April 23, 2016 08:11
Google App Engine - Blobstore Java API Workshop
package com.company.backend.servlets;
import com.google.appengine.api.blobstore.BlobKey;
import com.google.appengine.api.blobstore.BlobstoreFailureException;
import com.google.appengine.api.blobstore.BlobstoreService;
import com.google.appengine.api.blobstore.BlobstoreServiceFactory;
import com.google.appengine.api.images.ImagesService;
import com.google.appengine.api.images.ImagesServiceFactory;
import com.google.appengine.api.images.ServingUrlOptions;
@ajaysjournal
ajaysjournal / ParallelMatrixRowSum.c
Last active September 25, 2016 00:40
Matrix row sum using PThreads performance example
/* Read here - https://www.evernote.com/l/Ahzo8czYhypG258BubNUCe13nIajkDYlFxs
example for 2x2 matrix
A[2][2] = [ { 1,2} ,
{3,4} ]
then Matrix Row sum is stored in B matrix like below
B[2][1] = [{3}
,{7}]
*/
@ajaysjournal
ajaysjournal / NQueens.java
Last active October 31, 2016 23:57
NQueens
/**
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package csp;
/**
*
* @author ACHCHUTHAN
package examples;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.UserDefinedFileAttributeView;
@ajaysjournal
ajaysjournal / pom.xml
Created March 19, 2017 17:43
File - Sharing System
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>FileSharingSystem</groupId>
<artifactId>FileSharingSystem-1</artifactId>
<version>3.1-SNAPSHOT</version>
<packaging>jar</packaging>
@ajaysjournal
ajaysjournal / pom.xml
Last active March 19, 2017 18:46
Build with dependency
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>FileSharingSystem</groupId>
<artifactId>FileSharingSystem</artifactId>
<version>3.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>File Sharing System</name>
<url>http://maven.apache.org</url>
@ajaysjournal
ajaysjournal / git-flow.md
Created March 25, 2017 04:31
git-flow commands
  1. git clone <clone url
  2. git remote add upstream <remote url>
  3. git fetch upstream
  4. git pull --rebase upstream master
  5. git checkout -b feature-1 master
  6. git pull --rebase upstream master
  7. git push -u origin feature-1
@ajaysjournal
ajaysjournal / QuickSort.cpp
Last active July 9, 2017 17:46
CLRS implementation of Quick Sort algorithm
// Quick Sort
#include <iostream>
#include <vector>
#include <iomanip>
#include <utility>
void quickSort(std::vector<int> &A, int p, int r);
int partition(std::vector<int> &A, int p, int r);
int main() {