avatar

Andres Jaimes

Oracle Snippets

This post will be updated with snippets for Oracle. I hope you find it useful.

 

1. Change the default date format

Most useful snippet of the year! 😉

1ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY HH24:MI:SS';
2select sysdate from dual;

2. …

Create a connection to MySQL in Java

This time we are going to create a basic connection to MySQL in Java and pull some data from it.

// Compile it:
// javac Mysql.java
//
// Try it:
// java -classpath mysql-connector-java-5.1.27-bin.jar:. MySQL

import java.sql.Connection;
import …

WordPress Snippets

As a WordPress developer I have collected / created / curated many snippets that I’ve used in my projects. I hope you find them useful.

 

General HTML / WordPress tags

Get your template’s directory

1<link href="<?php echo …

How many bytes does an "int" have in c++?

Well, that depends on several things, like your current processor and compiler. The best way to know it, is by using the sizeof operator. Copy the following code, compile it and run it:

#include <iostream>

using namespace std;

int main() { …

A simple Makefile

Learning how to create a Makefile is one of those tasks every C/C++ programmer has to do. Since there are many good make tutorials on the web, I’m only going to share a simplistic makefile that you can use for your projects.

CFLAGS=-c -Wall -Iinclude …