View TestsFail.swift
import XCTest
class TestsFail: XCTestCase {
func testGettingJSON() {
Request.sharedInstance.getAllData { (error, result) in
XCTAssertNil(error)
XCTAssertNotNil(result)
ex.fulfill()
View random-number.swift
let rand = Int(arc4random_uniform(10)) // numero random en base a 10
let rand2 = Int(arc4random()) // numero random
print("numero1: \(rand), numero2: \(rand2)")
View string-length.swift
var cadena : String = "Cómo saber cuantos caracteres tiene un String en SWIFT"
print(cadena.characters.count)
//Output: 54
View apache2.conf
Timeout 100
KeepAlive On
MaxKeepAliveRequests 1000
KeepAliveTimeout 5
View price-events-today.sql
SELECT DECODE (PRICE_EVENT_TYPE,
'PC',
'Cambios de Precio',
'PS',
'Inicio de Promocion',
'PE',
'Fin de Promocion') PRICE_EVENT_TYPE,
DECODE (STATUS,
'N',
'Nuevo / Por Comenzar',
View gl-accounts-ebs.sql
SELECT st.id_flex_structure_code "Chart of Account Code",
sg.id_flex_num "Chart of Account Num",
sg.segment_name "Segment Name",
sg.application_column_name "Column Name",
sg.flex_value_set_id "Value Set Id",
sg1.application_column_name "Parent Column Name"
FROM apps.fnd_id_flex_structures st
INNER JOIN
apps.fnd_id_flex_segments sg
ON st.application_id = sg.application_id
View joins-en-oracle.sql
SELECT tabla1.columna, tabla2.columna
FROM tabla1
[NATURAL JOIN tabla2] -- o
[JOIN tabla 2 USING (nombre_columna)] -- o
[JOIN tabla2
ON (tabla1.nombre_columna = tabla2.nombre_columna)] -- o
[LEFT|RIGHT|FULL OUTER JOIN tabla2
ON (tabla1.nombre_columna = tabla2.nombre_columna)] -- o
[CROSS JOIN tabla2];
View consulta-jerarquica.sql
SELECT LEVEL, COD_EMPLEADO, CARGO
FROM EMPLEADOS
START WITH COD_EMPLEADO = 1
CONNECT BY REPORTA_A = PRIOR COD_EMPLEADO;
-- OUTPUT:
-- LEVEL COD_EMPLEADO CARGO
-- ----------------- ---------------------- --------------------
-- 1 1 CEO
View sql-row.sql
create table nums as
select level as num from dual
connect by level <= 100;
-- Table created.
select count(1) as cnt from nums;
-- CNT
-- ------------
View auto_increment-oracle.sql
CREATE SEQUENCE dept_seq;
CREATE TABLE departments (
ID NUMBER(10) NOT NULL,
DESCRIPTION VARCHAR2(50) NOT NULL);
CREATE OR REPLACE TRIGGER dept_bir
BEFORE INSERT ON departments
FOR EACH ROW