Skip to content

Instantly share code, notes, and snippets.

View ragnarok22's full-sized avatar
🏠
Working from home

Reinier Hernández ragnarok22

🏠
Working from home
View GitHub Profile
@ragnarok22
ragnarok22 / auth_views.py
Created September 2, 2016 14:01 — forked from stefanfoulis/auth_views.py
django: class based authentication view (login)
#-*- coding: utf-8 -*-
import urlparse
from django.contrib.auth import REDIRECT_FIELD_NAME, login
from django.contrib.auth.forms import AuthenticationForm
from django.http import HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_protect
from django.views.generic.edit import FormView
from django.conf import settings
@ragnarok22
ragnarok22 / es.lng
Created September 5, 2017 20:05
settings created by ragnarok22 - https://repl.it/KaLA/68
# esto es un comentario
setting:configuración
language:idioma # esto es otro comentario
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>jclal-deeplearning</artifactId>
<parent>
<groupId>net.sf.jclal</groupId>
<artifactId>jclal</artifactId>
org.nd4j.linalg.exception.ND4JIllegalStateException: Failed to allocate [5913600000] bytes
at org.nd4j.linalg.cpu.nativecpu.CpuMemoryManager.allocate(CpuMemoryManager.java:35)
at org.nd4j.linalg.memory.abstracts.Nd4jWorkspace.alloc(Nd4jWorkspace.java:399)
at org.nd4j.linalg.memory.abstracts.Nd4jWorkspace.alloc(Nd4jWorkspace.java:299)
at org.nd4j.linalg.api.buffer.BaseDataBuffer.<init>(BaseDataBuffer.java:635)
at org.nd4j.linalg.api.buffer.FloatBuffer.<init>(FloatBuffer.java:65)
at org.nd4j.linalg.api.buffer.factory.DefaultDataBufferFactory.createFloat(DefaultDataBufferFactory.java:257)
at org.nd4j.linalg.factory.Nd4j.createBuffer(Nd4j.java:1481)
at org.nd4j.linalg.api.ndarray.BaseNDArray.<init>(BaseNDArray.java:261)
at org.nd4j.linalg.cpu.nativecpu.NDArray.<init>(NDArray.java:126)
Exception in thread "main" java.lang.NoClassDefFoundError: com/github/os72/protobuf351/MessageOrBuilder
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
@ragnarok22
ragnarok22 / mnist_dl4j.java
Created June 13, 2018 16:25
sample code in DL4J and MNIST dataset
String dataset_home = System.getProperty("user.home") + File.separator + "datasets" + File.separator;
String mnist_home = dataset_home + "mnist_png" + File.separator;
String trainPath = mnist_home + "training";
String testPath = mnist_home + "testing";
int numRows = 28; // height
int numColumns = 28; // width
int channels = 1; // depth
int outputNum = 10;
int batchSize = 128;
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] JCLAL framework
[INFO] jclal-core
[INFO] jclal-spark
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building JCLAL framework 2.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Deep Learning integration for JCLAL Framework 1.1
[INFO] ------------------------------------------------------------------------
Downloading from libs: file://D:\Ragnarok\projects\Java\JCLAL\jclal-deeplearning/libs/nz/ac/waikato/cms/weka/weka-dev/maven-metadata.xml
Downloading from central: https://repo.maven.apache.org/maven2/nz/ac/waikato/cms/weka/weka-dev/maven-metadata.xml
Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/nz/ac/waikato/cms/weka/weka-dev/maven-metadata.xml
Downloaded from central: https://repo.maven.apache.org/maven2/nz/ac/waikato/cms/weka/weka-dev/maven-metadata.xml (682 B at 187 B/s)
Downloading from central: https://repo.maven.apache.org/maven2/nz/ac/waikato/cms/weka/multiInstanceFilters/maven-metadata.xml
395 INFO: PyInstaller: 3.3.1
395 INFO: Python: 3.6.3
396 INFO: Platform: Windows-10-10.0.16299-SP0
401 INFO: wrote D:\Ragnarok\projects\Web\paraDaniel\main.spec
405 INFO: UPX is not available.
424 INFO: Extending PYTHONPATH with paths
['D:\\Ragnarok\\projects\\Web\\paraDaniel',
'D:\\Ragnarok\\projects\\Web\\paraDaniel']
425 INFO: checking Analysis
425 INFO: Building Analysis because out00-Analysis.toc is non existent
@ragnarok22
ragnarok22 / debug.css
Created July 31, 2019 14:58
Debug style for debugging html elements. Eg: <body debug></body>
/*! debug.css | MIT License | https://gist.github.com/zaydek/6b2e55258734deabbd2b4a284321d6f6 */
[debug], [debug] *:not(g):not(path) {
color: hsla(210, 100%, 100%, 0.9) !important;
background: hsla(210, 100%, 50%, 0.5) !important;
outline: solid 0.25rem hsla(210, 100%, 100%, 0.5) !important;
box-shadow: none !important;
filter: none !important;
}