Skip to content

Instantly share code, notes, and snippets.

View leomindez's full-sized avatar
🎯
Focusing

Leonel Mendez Jimenez leomindez

🎯
Focusing
View GitHub Profile
@leomindez
leomindez / fnn_sample.py
Created July 10, 2021 04:35
File to train the model with different training and testing datasets
# -*- coding: utf-8 -*-
########################################
# Part 1 - Data Pre-Processing
#######################################
# To load a dataset file in Python, you can use Pandas. Import pandas using the line below
import pandas as pd
# Import numpy to perform operations on the dataset
import numpy as np
from sklearn.preprocessing import OneHotEncoder
@leomindez
leomindez / l3_learning.py
Created June 26, 2021 22:48
l3 learnig file pox controller rules
# Copyright 2012-2013 James McCauley
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
priority,src_mac,dst_mac,src_ip,dst_ip,src_port,dst_port,nw_proto
1,any,any,192.168.2.10,192.168.2.30,any,any,icmp
2,any,any,192.168.2.20,192.168.2.40,any,any,icmp
3,any,any,192.168.2.20,any,any,80,tcp
4,any,any,192.168.2.10,192.168.2.20,any,any,tcp
5,any,any,192.168.2.10,192.168.2.20,any,any,udp
id,mac_0,mac_1
1,00:00:00:00:00:02,00:00:00:00:00:04
/*
See LICENSE folder for this sample’s licensing information.
Abstract:
AudioSpectrogram extension for AVFoundation support.
*/
import AVFoundation
// MARK: AVCaptureAudioDataOutputSampleBufferDelegate and AVFoundation Support
private let audioEngine = AVAudioEngine()
private func startAudioEngine() {
audioEngine.prepare()
do {
try audioEngine.start()
} catch {
showAudioError()
}
}
@leomindez
leomindez / gist:927534d68e51c3d0bab9ea71252520e0
Last active December 14, 2017 00:31
Erlang list code snippet HackerRank
main() ->
{ok, [Size]} = io:fread("", "~d"),
Matrix = read_2d_linear_array(Size, "~d"),
true.
read_2d_linear_array(Size, Format) ->
read_2d_array(Size, Size, Format, []).
read_array(0, _Format, Acc) ->
lists:reverse(Acc);
@leomindez
leomindez / SharedPreferencesHelper
Last active October 6, 2016 20:13
SharedPreferencesHelper for Android
import android.content.Context;
import android.content.SharedPreferences;
public class SharedPreferencesHelper {
private static SharedPreferences mSharedPreferences = null;
private SharedPreferences.Editor mEditor;
public static final String APP_PREFERENCES_NAME = "app_preferences";
private static final int APP_PREFERENCES_SECURITY_MODE = Context.MODE_PRIVATE;
@leomindez
leomindez / average.c
Last active August 29, 2015 14:16
Calculate average by using just two variables
#include "stdio.h"
#include "stdlib.h"
double calculateAverage(int);
double* addNumers(int);
int main(int argc, char const *argv[])
{
int times = 0;
@leomindez
leomindez / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-item/paper-item.html">
<link rel="import" href="../paper-input/paper-input.html">
<polymer-element name="my-element">
<template>