Skip to content

Instantly share code, notes, and snippets.

View alexcpn's full-sized avatar

Alex Punnen alexcpn

View GitHub Profile
@alexcpn
alexcpn / MessageSenderServlet.java
Last active August 29, 2015 14:01
Minimal POM for JBOSS AS7.0 -MDB and a message producer
package com.nokia.oss;
/*
* JBoss, Home of Professional Open Source
* Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual
* contributors by the @authors tag. See the copyright.txt in the
* distribution for a full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@alexcpn
alexcpn / view.jsp
Created July 30, 2012 13:33
Alloy UI (YUI), Graphics - Draggable Circle , Ajax, Portlet
<!-- http://jsbin.com/utucah/1 In free form -->
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui"%>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui"%>
<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet"%>
<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme"%>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui"%>
<%@ taglib uri="http://liferay.com/tld/util" prefix="liferay-util"%>
@alexcpn
alexcpn / generate_random_point.py
Created November 27, 2015 10:30
Creating a random point at an approximate distance from a given latitude and longitude
# Testing simlation of generating random points
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import host_subplot
import mpl_toolkits.axisartist as AA
def create_random_point(x0,y0,distance):
"""
Utility method for simulation of the points
@alexcpn
alexcpn / gevent_based_queue.py
Created January 20, 2016 08:47
A gevent,greenlet based simple TaskQueue
# Gevent Queue
from gevent import queue
import gevent
from enum import Enum
import time
import threading
class EventId(Enum):
event_added = 1
@alexcpn
alexcpn / override_eq.py
Created February 29, 2016 05:13
Python Proper way to override equal to and hash
# http://stackoverflow.com/questions/390250/elegant-ways-to-support-equivalence-equality-in-python-classes
# http://stackoverflow.com/questions/4352244/python-implementing-ne-operator-based-on-eq/30676267#30676267
class Test1(object):
"""
Proper way to override equality
"""
def __init__(self, str1, str2, num1):
self.str1 = str1
@alexcpn
alexcpn / BootUp.scala
Created August 29, 2016 11:46
Scala Remote Actor Communicaiton
package run
import java.io.File
import akka.actor.{Actor, ActorRef, ActorSelection, ActorSystem, Props}
import com.typesafe.config.ConfigFactory
import org.slf4j.LoggerFactory
/**
* Created by acp on 25-08-2016.
Good Reference
https://blog.jayway.com/2015/03/21/a-not-very-short-introduction-to-docker/
Whats with Images and Containers
docker images
@alexcpn
alexcpn / CMakeCache.txt
Created April 21, 2017 07:38
OpenCV with CUDA ( NVIDIA Fermi)
# This is the CMakeCache file.
# For build in directory: /media/alex/LENOVO/Coding/opencv/build2
# It was generated by CMake: /usr/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
@alexcpn
alexcpn / nginx.config
Created May 9, 2017 11:03
nginx configration for rtmp
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@alexcpn
alexcpn / simple_neural_net.ipynb
Last active January 10, 2018 10:25
A simple neural net with explanation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.