Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
In God we Trust!

Seyyed Hossein Hasanpour Coderx7

💭
In God we Trust!
View GitHub Profile
@Coderx7
Coderx7 / ubuntu_sim_ros_noetic.sh
Last active Aug 16, 2021
ubuntu_sim_ros_noetic.sh
View ubuntu_sim_ros_noetic.sh
#!/bin/bash
## Bash script for setting up ROS Neotic (with Gazebo 9) development environment for PX4 on Ubuntu LTS (20.04).
## It installs the common dependencies for all targets (including Qt Creator)
##
## Installs:
## - Common dependencies libraries and tools as defined in `ubuntu_sim_common_deps.sh`
## - ROS Melodic (including Gazebo9)
## - MAVROS
@Coderx7
Coderx7 / ubuntu_sim_common_deps.sh
Last active Aug 15, 2021
ubuntu_sim_common_deps.sh
View ubuntu_sim_common_deps.sh
#!/bin/bash
## Bash script for setting up a PX4 development environment on Ubuntu LTS (16.04 and above).
## It can be used for installing simulators (only) or for installing the preconditions for Snapdragon Flight or Raspberry Pi.
##
## Installs:
## - Common dependencies and tools for all targets (including: Ninja build system, latest versions of cmake, git, anaconda3, pyulog)
## - jMAVSim simulator dependencies
## - PX4/Firmware source (to ~/src/Firmware/)
View GPS SLAM Nav Goal ROS
#!/usr/bin/env python
#ROS Node to convert a GPS waypoint published on the topic "waypoint" into a 2D Navigation Goal in SLAM to achieve autonomous navigation to a GPS Waypoint
#Converts Decimal GPS Coordinates of waypoint to ROS Position Vector relative to the current gps position of the robot
#Accounts for curvature of the earth using haversine formula
#Depends rospy, std_msgs, geographic_msgs, sensor_msgs, numpy
#Written by Alex McClung, 2015, alex.mcclung@hotmail.com, To be Released Open Source under Creative Commons Attribution Share-Alike Licence
import roslib
import rospy
@Coderx7
Coderx7 / How to build dlib on windows using Visual Studio 2019
Last active Aug 16, 2020
How to build dlib on windows using Visual Studio 2019
View How to build dlib on windows using Visual Studio 2019
Here is a gif showing how to do this from the beginning to the very end
@Coderx7
Coderx7 / pytorch_cpu_perf_bkm.md
Created Jun 9, 2020 — forked from mingfeima/pytorch_cpu_perf_bkm.md
BKM for PyTorch CPU Performance
View pytorch_cpu_perf_bkm.md

General guidelines for CPU performance on PyTorch

This file serves a BKM to get better performance on CPU for PyTorch, mostly focusing on inference or deployment. Chinese version available here.

1. Use mkldnn layout

layout refers to how data is organized in a tensor. PyTorch default layout is NCHW, from optimization perspective, MKL-DNN library (renamed as DNNL recently) may choose a different layout, sometimes refered to as internal layout or primitive layout. This is actually a normal technique for acceleration libraries, common knowledge is that NHWC runs faster than NCHW for convolution, changing the default NCHW to NHWC is called a reorder. MKL-DNN may choose different internal layouts based on the input pattern and the algorithm selected, e.g. nChw16c, a.k.a. reorder a 4-dim tensor into 5-dim by chop down dimension C by 16, for vectorization purpose (AVX512 instruction length is 16x32 bit).

By default on CPU, conv2d will ru

@Coderx7
Coderx7 / main.go
Created Apr 21, 2020 — forked from LiamHaworth/main.go
Example of run an interactive process on the current user from system service on windows (Golang)
View main.go
package main
import (
"github.com/kardianos/service"
"log"
"flag"
)
type Service struct {}
@Coderx7
Coderx7 / embpython.c
Created Apr 20, 2020 — forked from bluebanboom/embpython.c
Example of embedding python in c.
View embpython.c
#include <Python.h>
#include <stdio.h>
/*
* gcc embpython.c -I/usr/include/python2.7 -lpython
**/
void loadModule()
{
/* run objects with low-level calls */
char *arg1="sir", *arg2="robin", *cstr;
printf("Load Module err!\n");
@Coderx7
Coderx7 / test.c
Created Apr 20, 2020 — forked from nad2000/test.c
Basic examples to show how to embed and extend Python in C including: creation of module in C with functions handling and building Python objects; importing and calling python functions from C.
View test.c
/* Example of embedding Python in another program */
// to compile run:
// gcc -o test $(python-config --cflags) test.c $(python-config --ldflags) && ./test
#include<stdio.h>
#include "Python.h"
void initxyzzy(void); /* Forward */
main(int argc, char **argv)
@Coderx7
Coderx7 / -1559928795563.log
Created Jun 7, 2019
vscode console log with default jedi
View -1559928795563.log
workbench.main.js:3313 [Extension Host] debugger listening on port 36301
workbench.main.js:238 [Extension Host] [vscode-icons] v8.7.0 activated!
workbench.main.js:238 [Extension Host] (node:12808) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ workbench.main.js:238
workbench.main.js:238 [Extension Host] Info Python Extension: 2019-06-07 22:02:44: Display locator refreshing progress, Class name = p, completed in 1ms, , Return Value: undefined
workbench.main.js:238 [Extension Host] Info Python Extension: 2019-06-07 22:02:44: Notify locators are locating, Class name = p, completed in 1ms, , Return Value: undefined
workbench.main.js:238 [Extension Host] Info Python Extension: 2019-06-07 22:02:44: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false
workbench.main.js:238 [Extension Host] Info Python Extension: 2019-06-07 22
@Coderx7
Coderx7 / vscode_console_log.log
Created Jun 7, 2019
vscode console log2(jedi related)
View vscode_console_log.log
workbench.main.js:3313 [Extension Host] debugger listening on port 41068
workbench.main.js:3311 Extension Host
workbench.main.js:3311 Debugger listening on ws://127.0.0.1:41068/e4a995f0-d848-45d7-836c-3acdce098a58
For help, see: https://nodejs.org/en/docs/inspector
workbench.main.js:238 [Extension Host] (node:22448) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ workbench.main.js:238
workbench.main.js:238 [Extension Host] [vscode-icons] v8.7.0 activated!
workbench.main.js:238 [Extension Host] Info Python Extension: 2019-06-07 21:52:01: Display locator refreshing progress, Class name = p, completed in 1ms, , Return Value: undefined
workbench.main.js:238 [Extension Host] Info Python Extension: 2019-06-07 21:52:01: Notify locators are locating, Class name = p, completed in 2ms, , Return Value: undefined