Skip to content

Instantly share code, notes, and snippets.

# Modified evaluation script of PointNet for DGCNN
# (unofficial)
import argparse
import math
import h5py
import numpy as np
import tensorflow as tf
import socket
import importlib
@salehjg
salehjg / tf_gpu_py3.py
Created June 19, 2018 15:10
Simple test script for TF GPU with python 3.x
import tensorflow as tf
mat1 = [0,1,2]
mat2 = [2,1,0]
with tf.device('/gpu:0'):
tn1 = tf.placeholder(dtype= tf.int32, shape=[3])
tn2 = tf.placeholder(dtype= tf.int32, shape=[3])
tn3 = tn1 + tn2
import numpy as np
a = np.zeros(shape=[33052, 10225], dtype=np.float32)
b = np.zeros(shape=[7086, 10225], dtype=np.float32)
print "Shape_a: ", a.shape
print "Shape_b: ", b.shape
print "\nProcessing..."
@salehjg
salehjg / ROS_on_ArchLinux.md
Last active October 5, 2019 14:27
Getting ROS Up and Running on ArchLinux
  1. install yay or pikaur, DO NOT use pacaur as it does not handle version specific dependecies well(github issue).

  2. install libpgm-git from aur

  3. set MAKEFLAGS option to -j8 in /etc/makepkg.conf

  4. increase sudo session timeout in /etc/sudoers :
    Defaults timestamp_timeout=600

  5. start with: yay -S ros-melodic-desktop-full

#include <stdio.h>
#define DATA_SIZE 17
#define VEC_SIZE 16
struct _float16{
float vec[VEC_SIZE];
};
void myfunc(
int *inputTn1,
int *inputTn2,
int *outputTn,
int len) {
#pragma HLS INLINE
for(int idx=0; idx<len; idx++){
#pragma HLS PIPELINE II=1
@salehjg
salehjg / 70-huawei-e3.conf
Created July 27, 2021 00:53 — forked from smarek/70-huawei-e3.conf
Raspberry / Banana Huawei E3372 network interface name
# /etc/udev/rules.d/70-huawei-e3.conf
# Necessary for network interface name
SUBSYSTEM=="net", ACTION=="add", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14dc", NAME="usb0"
# Might be duplicate to usb_modeswitch config, however it's good to have it there
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f01", RUN+="/usr/sbin/usb_modeswitch -c /etc/usb_modeswitch.d/huawei_e3.conf"

Setup Canon LBP-6030B on ArchLinux

  1. Install $ sudo pacman -S ghostscript
  2. Install $ yay -S cups
  3. Enable its service $ sudo systemctl enable cups.service
  4. Restart the service $ sudo systemctl restart cups.service
  5. Check its status $ sudo systemctl status cups.service
  6. Install $ yay -S cnrdrvcups-sfp
  7. BE AWARE THAT LBP-6030B is a UFRII-LT printer with sfp. Only use cnrdrvcups-lb package if your printer is LBP6030 (white version, USA)!!
  8. Open http://localhost:631/ in Chrome.
  9. Go to Administration and then click on Add Printer
@salehjg
salehjg / Springer.CSSP.bst
Created August 28, 2022 13:25
BibTeX Style File for Springer CSSP (Journal) - Unofficial - Use it at your own risk
%%
%% This is file `spbasic.bst',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% merlin.mbs (with options: `ay,nat,seq-lab,vonx,nm-rvx,ed-rev,jnrlst,dt-beg,yr-par,yrp-x,yrpp-xsp,note-yr,jxper,jttl-rm,thtit-a,pgsep-c,num-xser,ser-vol,jnm-x,btit-rm,bt-rm,pre-pub,doi,edparxc,blk-tit,in-col,fin-bare,pp,ed,abr,mth-bare,ord,jabr,xand,eprint,url,url-blk,em-x,nfss,')
%% ----------------------------------------
%%
%%********************************************************************************%%