Skip to content

Instantly share code, notes, and snippets.

View rmorenobello's full-sized avatar

Raúl Moreno Bello rmorenobello

View GitHub Profile
#!/usr/bin/env groovy
import groovy.grape.Grape
import groovy.sql.Sql
import groovy.swing.SwingBuilder
import java.awt.event.*
import javax.swing.*
import javax.swing.table.*
Grape.grab(group:'org.apache.derby', module:'derby', version:'10.4.2.0', classLoader:this.class.classLoader.rootLoader)
@jaseemabid
jaseemabid / git tutorials.md
Last active May 9, 2025 01:01 — forked from netroy/git tutorials.md
Awesome git tutorials I am finding here and there
@kellyrob99
kellyrob99 / openCsv.groovy
Created December 4, 2011 18:35
OpenCSV in a groovy script to read in a file, filter the content and write out the result
@Grab(group = 'net.sf.opencsv', module = 'opencsv', version = '2.3')
import au.com.bytecode.opencsv.CSVReader
import au.com.bytecode.opencsv.CSVParser
import au.com.bytecode.opencsv.CSVWriter
def TEST_FILE_NAME = 'test.csv'
def TEST_OUTPUT_FILE_NAME = 'testOut.csv'
List<String[]> rows = new CSVReader(new FileReader(new File(TEST_FILE_NAME)), CSVParser.DEFAULT_SEPARATOR, CSVParser.DEFAULT_ESCAPE_CHARACTER, CSVParser.DEFAULT_QUOTE_CHARACTER, 1).readAll()
def rowsOver100 = rows.findAll {it[1].toInteger() > 100}
@kellyrob99
kellyrob99 / OutputTransforms.groovy
Created September 22, 2012 20:01
GroovyConsole transforms file with the standard Map example and sortable JTable support for List/Set return values
import javax.swing.*
import javax.swing.table.*
transforms << { result ->
if (result instanceof Map) {
def table = new JTable(
result.collect { k, v ->
[k, v?.inspect()] as Object[]
} as Object[][],
['Key', 'Value'] as Object[])
@PascalSchumacher
PascalSchumacher / settings.gradle
Created October 23, 2013 16:39
with this modification we could still build groovy with java 5/6 and add the nio support (https://github.com/groovy/groovy-core/pull/260)
def subprojects = ['groovy-ant',
'groovy-bsf',
'groovy-console',
'groovy-docgenerator',
'groovy-groovydoc',
'groovy-groovysh',
'groovy-jmx',
'groovy-json',
'groovy-jsr223',
'groovy-servlet',
@karimkhanp
karimkhanp / bigdata_resource
Last active April 6, 2022 13:48
Bigdata resources - Do I miss something. Add and make it richer
Bigdata is like combination of bunch of subjects. Mainly require programming, analysis, nlp, MLP, mathematics.
To see links, Go : http://www.quora.com/What-are-some-good-sources-to-learn-big-data
Here are bunch of courses I came accross:
Introduction to CS Course
Notes: Introduction to Computer Science Course that provides instructions on coding.
Online Resources:
Udacity - intro to CS course,
Coursera - Computer Science 101
@susanBuck
susanBuck / programA.py
Last active January 13, 2022 10:39
Python Module Name Example
# The technical term for a text file of Python code (what we've been creating all semester) is a module.
#
# This file you're looking at right now, programA.py, is a module.
#
# The file name acts as the module name.
# I.e. for this file programA.py, the corresponding module name is `programA`.
#
# That's why if we wanted to import this file into another file, we'd just say `import programA`, not `import programA.py`
#
# Ok, now that we know what a module is, let's look towards what __name__ is...
PROJECT_DIR=/home/pentaho/projects
KETTLE_REDIRECT_STDERR=Y
KETTLE_REDIRECT_STDOUT=Y
KETTLE_MAX_LOGGING_REGISTRY_SIZE=10000
KETTLE_LOG_MARK_MAPPINGS=Y
KETTLE_JOB_LOG_SCHEMA=pentaho_dilogs
KETTLE_JOB_LOG_DB=live_logging_info
KETTLE_JOB_LOG_TABLE=job_logs
@rmorenobello
rmorenobello / CORRECT_StringConcat_predicate_Trick.sql
Last active May 22, 2024 13:51
Don't Use the String Concatenation Trick in SQL Predicates
-- NOTA: no recuerdo por qué todo esto en lugar de un simple join ?!?!?!
-- DO NOT DO THIS!!!
CREATE INDEX idx_customer_name ON customer (last_name, first_name);
SELECT *
FROM customer
WHERE first_name || last_name IN (
SELECT first_name || last_name
FROM actor
@rmorenobello
rmorenobello / multipleAggregateFunctions_SingleQuery_diffsWHEREs.sql
Last active May 6, 2017 20:33
Calculate Multiple Aggregate Functions (with diff combinations of fixed WHERE conditions) in a Single Query
-- https://dzone.com/articles/how-to-calculate-multiple-aggregate-functions-in-a?edition=297992
-- Calculate Multiple Aggregate Functions (diff WHERE conditions) in a Single Query
-- ***************** PROBLEM to solve:
-- Number of films with a given length / language_id
SELECT count(*)
FROM film
WHERE length BETWEEN 120 AND 150
AND language_id = 1;
-- Number of films with a given length / rating