This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Download or clone from https://github.com/quix/linalg | |
| ( Assume installation folder is linalg ) | |
| 2. Install dependencies (Lapack, BLAS and legacy Fortran library header) | |
| $ su | |
| # yum install lapack lapack-devel blas blas-devel gcc-gfortran.i686 compat-gcc-34.i686 compat-gcc-34-g77.i686 | |
| 3. Locate the Fortran header ( g2c.h ) | |
| # updatedb | |
| # locate g2c.h | |
| /usr/lib/gcc/i686-redhat-linux/3.4.6/include/g2c.h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def upload(to_be_uploaded, upload_directory) | |
| uuid = UUIDTools::UUID.random_create | |
| uniq_name = "#{uuid}#{to_be_uploaded.original_filename}" | |
| uploaded_file = File.join(upload_directory, uniq_name) | |
| File.open(uploaded_file, "w") { |f| f.write(to_be_uploaded.read) } | |
| uploaded_file | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FastVector attributes = new FastVector(); | |
| attributes.addElement(numericAttribute); | |
| attributes.addElement(nominalAttribute); | |
| attributes.addElement(stringAttribute); | |
| attributes.addElement(anyOtherAttribute); | |
| attributes.addElement(anotherAttribute); | |
| Instances dataSet = new Instances("dataSetName", attributes, 50); | |
| dataSet.setClassIndex(dataSet.numAttributes() - 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Instances dataSet = // ... | |
| Attribute stringAttribute = // ... | |
| Attribute nominalAttribute = // ... | |
| int numberOfAttributes = 3; | |
| Instance instance = new SparseInstance(numberOfAttributes); | |
| instance.setDataset(dataSet); | |
| instance.setValue(numericAttribute, 8.8); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Instances dataSet = // ... | |
| // Showing attribute-type pairs of dataSet | |
| // Analogy with SQL: print field and field type of a table | |
| Enumeration attributes = dataSet.enumerateAttributes(); | |
| while (attributes.hasMoreElements()) { | |
| Attribute attribute = (Attribute) attributes.nextElement(); | |
| System.out.println(attribute.name() + ": " + | |
| Attribute.typeToString(attribute.type())); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FastVector validNominalValues = new FastVector(2); | |
| validNominalValues.addElement("male"); | |
| validNominalValues.addElement("female"); | |
| Attribute nominalAttribute = new Attribute("gender", validNominalValues); | |
| FastVector nullFastVector = null; | |
| Attribute stringAttribute = new Attribute("userId", nullFastVector); | |
| Attribute numericAttribute = new Attribute("humidity"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>Hello World! This is the title of the page :D</title> | |
| <!-- Style makes your page look prettier. --> | |
| <style> | |
| body {background-color:#ccc} | |
| #content {border:1px solid black} | |
| .bigger {font-size:130%} | |
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo useradd username -G gitosis,admin -d /home/username -s /bin/bash -m | |
| cat /etc/passwd | grep username | |
| # this should output the home directory for username | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // .. import statements | |
| // ViewScoped is important for AJAX | |
| @ManagedBean | |
| @ViewScoped | |
| public class SomeBean { | |
| private T[] selectedElementsFromTheList; | |
| private T[] copyOfSelectedElementsFromTheList; | |
| private List<T> theList; |