Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <inttypes.h>
uint32_t rev(uint32_t x)
{
x = (x & 0x55555555) << 1 | (x >> 1) & 0x55555555;
x = (x & 0x33333333) << 2 | (x >> 2) & 0x33333333;
x = (x & 0x0F0F0F0F) << 4 | (x >> 4) & 0x0F0F0F0F;
x = (x << 24) | ((x & 0xFF00) << 8) |
(x >> 8) & 0xFF00 | (x >> 24);
@sriramster
sriramster / process_fork.c
Created February 16, 2021 05:46
Sys call experiments
#include <dirent.h>
#include <error.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <signal.h>
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#define CHAR_BIT 8
int min(int x, int y)
{
return y ^ ((x ^ y) & -(x < y)); // min(x, y)
}
int max(int x, int y)

Rosbag2 Transactions v0.1

Sqlite transaction based querying model.

Things to take care off

  • Rosbag2 sqlite plugin does'nt work based on sqlite transactions.
  • To enable optimized querying or writes within sqlite transactions are the best options.

Some URL references on transactions are below:

Sriram Raghunathan

Projects

  • Visteon [Present]

    ** Currently working and leading a team on the development of Autonomous Framework from Bangalore. ** Ported DM-verity to one of the car embedded stacks, developed the file system manager to handle verity partitions. ** Enabled secure signing features on u-boot and ported the same onto ARM targets.

@sriramster
sriramster / git_stuffs.md
Last active November 1, 2020 15:07
git flow

Git stuffs

Some basic commands. Ignore if you are already familiar with these stuffs.

Creating a new repo.

git init $PATH

Path needs to be empty or could have source files, except a .git folder.

@sriramster
sriramster / ci.md
Last active October 27, 2015 07:01
CI configuration notes
@sriramster
sriramster / colorcodes.sh
Last active November 1, 2020 15:07
Bash color codes
#Black 0;30 Dark Gray 1;30
#Red 0;31 Light Red 1;31
#Green 0;32 Light Green 1;32
#Brown/Orange 0;33 Yellow 1;33
#Blue 0;34 Light Blue 1;34
#Purple 0;35 Light Purple 1;35
#Cyan 0;36 Light Cyan 1;36
#Light Gray 0;37 White 1;37
#No color 0;
#!/bin/bash
@sriramster
sriramster / sr-ydis.el
Created June 3, 2014 10:03
Disable Yanking
;; No need to set arg's & optional's args to nil. Just doing it, #debug purpose
(defadvice kill-whole-line (around screwdriver-kill-wl (&optional arg))
(setq arg nil)
(message "disable kill-whole-line"))
(defadvice kill-rectangle (around screwdriver-kill-rectangle (start end &optional fill))
(setq start nil)
(setq end nil)
(message "disable kill-rectangle"))