Skip to content

Instantly share code, notes, and snippets.

@maartenl
maartenl / oracle_to_outer_join2.sql
Created February 7, 2013 14:12
Example of a transformation of an outer join from oracle syntax to normal syntax.
SELECT
last_name,
department_name
FROM
employees e,
departments d
WHERE
e.department_id = d.department_id(+);
-- changed to
@maartenl
maartenl / outer_join_with_funny_on_clause.sql
Created February 7, 2013 14:28
Outer join with a funny ON clause.
SELECT
last_name,
department_name
FROM
employees e
LEFT OUTER JOIN
departments d
ON
e.department_id = d.department_id
AND e.left_company = false;
@maartenl
maartenl / complex_outer_join.sql
Created February 7, 2013 15:18
Complex Outer Join
-- show all employees, including their departments,
-- contact information, jobtitle, salary etc.
SELECT
e.last_name,
e.salary,
e.scale,
d.department_name,
c.description,
j.title,
@maartenl
maartenl / mysqld.sh
Created February 12, 2013 08:08
/usr/lib/systemd/system/mysqld.service : The MySQL service file for systemd, taken from Fedora Core 18.
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades. If you want to customize, the
# best way is to create a file "/etc/systemd/system/mysqld.service",
# containing
# .include /lib/systemd/system/mysqld.service
# ...make your changes here...
# For more info about custom unit files, see
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
# For example, if you want to increase mysql's open-files-limit to 10000,
@maartenl
maartenl / output_systemd.txt
Created February 12, 2013 20:57
Output of systemctl status of the rc-local.service.
[root@dhcppc1 etc]# systemctl status rc-local.service
rc-local.service - /etc/rc.d/rc.local Compatibility
Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static)
Active: active (exited) since Tue 2013-02-12 21:53:03 CET; 1min 33s ago
Process: 2717 ExecStart=/etc/rc.d/rc.local start (code=exited, status=0/SUCCESS)
Feb 12 21:53:03 dhcppc1 systemd[1]: Starting /etc/rc.d/rc.local Compatibility...
Feb 12 21:53:03 dhcppc1 rc.local[2717]: Profit!
Feb 12 21:53:03 dhcppc1 systemd[1]: Started /etc/rc.d/rc.local Compatibility.
[root@dhcppc1 etc]#
@maartenl
maartenl / Version1.java
Created March 9, 2013 21:40
Version1.java
/**
* JDK 1.0
* @param args the command line arguments
*/
public static void main(String[] args)
{
Vector persons = new Vector();
persons.add(Person.gosling);
persons.add(Person.babbage);
persons.add(Person.turing);
@maartenl
maartenl / Version2.java
Created March 9, 2013 21:41
Version2.java
/**
* JDK 1.2 - Enter a List, part of the Collections framework.
* @param args the command line arguments
*/
public static void main(String[] args)
{
List persons = new ArrayList();
persons.add(Person.gosling);
persons.add(Person.babbage);
@maartenl
maartenl / Version25.java
Last active December 14, 2015 17:59
Version25.java
/**
* JDK 2.5 - Generics, the Enhanced for-loop
* and variable number of arguments
* @param args the command line arguments
*/
public static void main(String[] args)
{
List<Person> persons = new ArrayList<Person>(Arrays.asList(Person.gosling,
Person.babbage,
Person.turing,
@maartenl
maartenl / Version7.java
Created March 9, 2013 21:43
Version7.java
/**
* JDK 7 - Diamond notation
* @param args the command line arguments
*/
public static void main(String[] args)
{
List<Person> persons = new ArrayList<>(Arrays.asList(Person.gosling,
Person.babbage,
Person.turing,
Person.knuth,
@maartenl
maartenl / Version8.java
Created March 9, 2013 21:44
Version8.java
/**
* JDK 8 - Lambda expressions
*
* @param args the command line arguments
*/
public static void main(String[] args)
{
List<Person> persons = new ArrayList<>(Arrays.asList(Person.gosling,
Person.babbage,
Person.turing,