Skip to content

Instantly share code, notes, and snippets.

View 9prady9's full-sized avatar
🏠
Working from home

Pradeep Garigipati 9prady9

🏠
Working from home
View GitHub Profile
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
#!/bin/sh
# i3-get-window-criteria - Get criteria for use with i3 config commands
# To use, run this script, then click on a window.
# Output is in the format: [<name>=<value> <name>=<value> ...]
# Known problem: when WM_NAME is used as fallback for the 'title="<string>"' criterion,
# quotes in "<string>" are not escaped properly. This is a problem with the output of `xprop`,
# reported upstream: https://bugs.freedesktop.org/show_bug.cgi?id=66807
@9prady9
9prady9 / cpuinfo.cpp
Created September 15, 2015 18:32
Sample code to extract cpu information using CPUID instruction
#include <algorithm>
#include <iostream>
#include <string>
#ifdef _WIN32
#include <limits.h>
#include <intrin.h>
typedef unsigned __int32 uint32_t;
#else
#include <stdint.h>
@9prady9
9prady9 / spectral_colors.rs
Last active November 17, 2016 17:06
Rust snippet to generate visible spectrum colours based on wavelength
static GAMMA: f64 = 0.80;
static INTENSITY_MAX: f64 = 255.0;
static MAX_WVL: f64 = 780.0;
static MIN_WVL: f64 = 380.0;
/** Taken from Earl F. Glynn's web page:
* <a href="http://www.efg2.com/Lab/ScienceAndEngineering/Spectra.htm">Spectra Lab Report</a>
* */
pub fn wavelength_to_rgb(wavelength: f64) -> (u32, u32, u32) {
@9prady9
9prady9 / perlin_noise.cpp
Last active February 13, 2017 16:28
C++ Program using ArrayFire that show cases Perlin Noise Generation using GPU.
/*******************************************************
* Copyright (c) 2017, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <arrayfire.h>
@9prady9
9prady9 / multigpu-threaded.cpp
Last active June 26, 2017 10:39
An illustrative example using ArrayFire to split work across multiple GPUs - One thread launched per GPU; Thread safety is available starting v3.5.0
/*******************************************************
* Copyright (c) 2017, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <arrayfire.h>
@9prady9
9prady9 / multigpu-no-threads.cpp
Last active March 8, 2017 13:13
ArrayFire example to split work across multiple GPUs - No threads Used.
/*******************************************************
* Copyright (c) 2017, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <arrayfire.h>
/* ************************************************************************
* Copyright 2013 Advanced Micro Devices, Inc.
*
* Licensed 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
*
* Unless required by applicable law or agreed to in writing, software
@9prady9
9prady9 / itkLandweberDeconvolution.cxx
Last active July 21, 2017 14:22
Landweber Deconvolution example on grayscale images using ITK
#include "itkFFTConvolutionImageFilter.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkLandweberDeconvolutionImageFilter.h"
#include "itkCastImageFilter.h"
#include "itkMacro.h"
#include "itkMath.h"
int main(int argc, char* argv[])
{