Skip to content

Instantly share code, notes, and snippets.

View mrprajesh's full-sized avatar
😎
Busy coding 🥇

Rajesh Pandian M mrprajesh

😎
Busy coding 🥇
View GitHub Profile
//~~~START:Mon, 02-Jan-2023, 16:26:44 IST
//~~~Author:Rajesh Pandian M | mrprajesh.co.in
//~ nvc++ -acc -gpu=managed -Minfo=all shuffle-2D-csr2.cpp -o shuffle-2D-csr2.out && ./shuffle-2D-csr2.out
//~ nvc++ -acc=multicore -Minfo=all -fopenmp shuffle-2D-csr2.cpp -o shuffle-2D-csr2.out && ./shuffle-2D-csr2.out
#include <iostream>
#include <random> //default rand in shuffle
#include <algorithm> // shuffle
#include <cstring> // memset
@mrprajesh
mrprajesh / gcc-compile-option.md
Last active December 29, 2022 00:24
Understanding `gcc` compile options
gcc -c -Wall main.c
gcc -c -Wall -fPIC foo.c bar.c

gcc -shared foo.o -o libfoo.so 
gcc -shared bar.o -o libbar.so 

gcc -c -Wall -fPIC foobar.c  //can be add to 2.

gcc -shared foobar.o -o libfoobar.so -L. -lfoo -lbar //ORIGINAL: note the lib is omitted
//~~~START:Wed, 19-Oct-2022, 12:50:27 IST
//~~~Author:Rajesh Pandian M | mrprajesh.co.in
#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(const vector<T> &vec){
for(const auto &v: vec)
cout << setw(2) << v << ' ';
cout<< '\n';
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mrprajesh
mrprajesh / CppLambda.md
Created October 3, 2021 17:30
Learning C++ Lambdas

This is a sample STL Usage

transform(
    v.begin(), 
    v.end(),
    r.begin(), 
    [](int i){return 2*i} 
);
@mrprajesh
mrprajesh / gist:cb82bb8139dd826fb35dda4e22ddeb41
Last active July 24, 2021 22:08
[solved]Gunrock error - terminate called after throwing an instance of ..
```
~/gunrock/build $ ./bin/sssp market ../dataset/small/test_mst.mtx
Loading Matrix-market coordinate-formatted graph ...
Reading from ../dataset/small/test_mst.mtx:
Parsing MARKET COO format (9 nodes, 17 directed edges)... Done (0 s).
Writing meta data into ../dataset/small/test_mst.mtx.meta
Writting edge pairs in binary into ../dataset/small/test_mst.mtx.coo_edge_pairs
Writting edge values in binary into ../dataset/small/test_mst.mtx.coo_edge_values
Substracting 1 from node Ids...
graph loaded as COO in 0.038475s.
# g++ -Wall -o "%e.out" "%f" -std=c++14 -lgtest -lgtest_main -lpthread
# Geany's snippets configuration file
#
# use \n or %newline% for a new line (it will be replaced by the used EOL char(s) - LF, CR/LF, CR).
# use \t or %ws% for an indentation step, it will be replaced according to the current document's indent mode.
# use \s to force whitespace at beginning or end of a value ('key= value' won't work, use 'key=\svalue').
# use %key% for all keys defined in the [Special] section.
# use %cursor% to define where the cursor should be placed after completion. You can define multiple
# %cursor% wildcards and use the "Move cursor in snippet" to jump to the next defined cursor
# position in the completed snippet.

Keybase proof

I hereby claim:

  • I am mrprajesh on github.
  • I am mrprajesh (https://keybase.io/mrprajesh) on keybase.
  • I have a public key whose fingerprint is 79B3 6A39 0B6A 4BBF A103 483B DD95 F119 EA64 BABE

To claim this, I am signing this object:

@mrprajesh
mrprajesh / Installing-Geany-Plugins.md
Last active May 11, 2022 07:04
Install Geany Plugins - workaround for most of them that did not get install easily.

Geany-plugins

It is awesome. Most of them are cool buy not well undocumented for installation as seen here https://plugins.geany.org/

If you want the below plugins to work and it is not enabled when you do configure from official tar ball then you might want to try/install the following dependancies. These are from my experiences with Linux Mint 19. In turn, this should work for any newer Ubuntu/Debian versions in my opinion.

Markdown

There was an error with include <webkit2/webkit2.h>

sudo apt-get install libwebkit2gtk-4.0-dev
@mrprajesh
mrprajesh / JobsBg.md
Created July 29, 2019 09:11
How to run jobs in background even after you exit the ssh/shell terminal

Run Jobs in Background

  1. ssh serverHostNameOrIP
  2. On server, again ssh serverHostNameOrIP
  3. run the jobs using nohup <executable> &
  4. Ctrl+D // logout
  5. Ctrl+D // logout
  6. Close the terminal window.