Skip to content

Instantly share code, notes, and snippets.

Paras Patel PatelParas

View GitHub Profile
View StringReverse.cpp
#include<stdio.h>
#include<string.h>
void reverse(char *string);
int main()
{
char origStr1 [] = "abcdfsdfsfd";
char origStr2 [] = "a";
char *origStr3 = NULL;
reverse(origStr1);
@PatelParas
PatelParas / StringReverse.java
Last active Mar 13, 2016
1.2 Write code to reverse a C-Style String. (C-String means that “abcd” is represented as !ve characters, including the null character.)
View StringReverse.java
public class StringReverse {
public static void main(String args[]){
String s = "this is a demo test!";
System.out.println(reverse(s));
}
public static String reverse(String input){
char[] data = input.toCharArray();
int i = 0;
int j = data.length - 1;
View currency_sop_calc.py
from decimal import *
import sys
# Define your denominations to be used
denominations = ['500', '100', '50', '20', '10', '5', '2', '1', '0.25', '0.10', '0.05', '0.01']
# Please write this denomination list in Desending order of currency value
names = {'0.25': "quarters", '0.10': "dimes", '0.05': "nickels", '0.01': "pennies"}
# Specify special nameing for your values otherwsie default is 'dollar'
amount="5532.23$" ## we may also define command line input e.g. sys.argv[1]
@PatelParas
PatelParas / gist:2366fe4e8b3acbc8d4ef
Created Sep 22, 2014
Tmux installation - CentOS
View gist:2366fe4e8b3acbc8d4ef
#!/bin/bash
wget http://downloads.sourceforge.net/tmux/tmux-1.8.tar.gz
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar zxvf tmux-1.8.tar.gz
tar zxvf libevent-2.0.21-stable.tar.gz
yum install gcc kernel-devel make ncurses-devel -y
You can’t perform that action at this time.