Skip to content

Instantly share code, notes, and snippets.

View rurtubia's full-sized avatar

Randy Urtubia rurtubia

View GitHub Profile
@rurtubia
rurtubia / OpenjInternalFrame.java
Created April 26, 2015 03:52
Make a jInternalFrame Visible from a jMenuItem
private void jMenuItemOpenFramePerformed(java.awt.event.ActionEvent evt) {
this.jInternalFrame1.setVisible(true);
}
@rurtubia
rurtubia / GettersSetters.java
Created April 26, 2015 04:09
Java Getters and Setters
//Numeric Data:
//Getter
public double getTotal() {
return total;
}
//Setter
public void setTotal(double total) {
this.total = total;
@rurtubia
rurtubia / TCP Ports
Last active August 29, 2015 14:19
Well-Known TCP ports
Port Number
Description
1 TCP Port Service Multiplexer (TCPMUX)
5 Remote Job Entry (RJE)
7 ECHO
18 Message Send Protocol (MSP)
20 FTP -- Data
21 FTP -- Control
22 SSH Remote Login Protocol
@rurtubia
rurtubia / ListOfExceptions.java
Created April 26, 2015 09:59
List of java Exceptions:
ArithmeticException
// Arithmetic error, such as divide-by-zero.
ArrayIndexOutOfBoundsException
// Array index is out-of-bounds.
ArrayStoreException
// Assignment to an array element of an incompatible type.
ClassCastException
@rurtubia
rurtubia / .GitCommandReference.sh
Last active August 29, 2015 14:19
Git Command Reference
Directory: A folder used for storing multiple files.
Repository: A directory where Git has been initialized to start version controlling your files.
The .git directory: It is usually hidden. It has all sorts of directories and files inside it.
We rarely ever need to do anything inside here
Staging Area: A place where we can group files together before we COMMIT them to Git.
Commit: A COMMIT is a snapshot of our repository.
This way if we ever need to look back at the changes we have made
(or if someone else does), we will see a nice timeline of all changes.
@rurtubia
rurtubia / AndroidButton.xml
Created April 27, 2015 20:53
Button for an Android Application
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/button"
android:layout_marginTop="97dp"
android:layout_below="@+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
@rurtubia
rurtubia / CreateUser.sql
Created April 27, 2015 21:41
Creates a User in Oracle
create user NOMBRE_CUENTA
identified by CONTRASEÑA
default tablespace NOMBRE_ESPACIO_DE_TABLA;
SQL>create user MUSICAL
2 identified by MIMUSICA
3 default tablespace USERS;
@rurtubia
rurtubia / ItextSharp_withImage.cs
Created April 28, 2015 00:01
Create a PDF with an image
//Crear el documento
Document document = new Document();
//Definición de la ruta
PdfWriter.GetInstance(document,
new FileStream("D:/users/Documentos/HolaMundo.pdf",
FileMode.Create));
//Abrir el documeto
document.Open();
//Agregar paragraph con el texto Hola Mundo
@rurtubia
rurtubia / 01.StringBuilder_Exercise.java
Last active August 29, 2015 14:20
StringBuilder Practice
Given:
StringBuilder b1 = new StringBuilder("snorkler");
StringBuilder b2 = new StringBuilder("yoodler");
b1.append(b2.substring(2,5).toUpperCase());
//b1 = snorkler b2 = yoodler
b1.append("odl".toUpperCase());
//b1 = snorkler b2 = yoodler
@rurtubia
rurtubia / show_tables.sql
Created May 6, 2015 09:24
Show all the tables in a database
--SQL Server 2010, 2012
select * from INFORMATION_SCHEMA.TABLES