This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stdlib.h> | |
#include <time.h> | |
using namespace std; | |
int main() | |
{ | |
time_t tiempo = time(NULL); | |
struct tm *fecha = localtime(&tiempo); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function cuanto_comprar($stock, $maquinas) | |
{ | |
$res = []; | |
foreach($maquinas as $maquina) | |
{ | |
foreach($maquina as $elemento => $valor) | |
{ | |
if($stock[ $elemento ] < $valor) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scanner ss = new Scanner(System.in); | |
String frase; | |
char letra; | |
System.out.println("Introduce una frase: "); | |
frase = ss.nextLine(); | |
System.out.println("Introduce una letra: "); | |
letra = ss.nextLine().charAt(0); | |
int cant = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var formData = new FormData($('#IdFormulario')[0]); | |
$.ajax({ | |
url: 'SERVIDOR', | |
type: 'POST', | |
success: function(resp){ | |
// Aqui va cuando todo va bien! | |
}, | |
data: formData, | |
cache: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TRIGGER BonoOutlet | |
ON Andrea.Pedido AFTER INSERT | |
AS | |
DECLARE @pedido AS int | |
SELECT TOP 1 @pedido=IdPedido FROM Pedido WHERE IdPedido != inserted.IdPedido Order By IdPedido DESC | |
IF EXISTS (SELECT * FROM Pedido p INNER JOIN PedidoDetalle pd ON p.IdPedido=pd.IdPedido INNER JOIN CatalogoProducto cp ON cp.IdProducto=pd.IdProducto INNER JOIN Catalogo c ON c.idCatalogo=cp.idCatalogo WHERE p.IdPedido = @pedido AND DATEDIFF(day, p.Fecha, inserted.Fecha) > 30 AND c.Nombre = 'Outlet') | |
BEGIN | |
UPDATE p SET p.Descuento = (p.Importe*0.05), p.Importe = (p.Importe-(p.Importe*0.05)) FROM Pedido p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static String readUrl(String urlString) throws Exception { | |
BufferedReader reader = null; | |
StringBuffer buffer = new StringBuffer(); | |
try { | |
URL url = new URL(urlString); | |
reader = new BufferedReader(new InputStreamReader(url.openStream())); | |
int read; | |
char[] chars = new char[1024]; | |
while ((read = reader.read(chars)) != -1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void addItems(){ | |
ListView listview = (ListView) findViewById(R.id.listViewConferences); | |
List<ItemString> lista = new ArrayList<>(); | |
JSONArray json = null; | |
Log.i("pp", "pRUEBA"); | |
try{ | |
json = readJsonFromUrl("http://admin.sisei.mx/api/conferencia/?format=json"); | |
if(json == null){ | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static String readAll(Reader rd) throws IOException { | |
StringBuilder sb = new StringBuilder(); | |
int cp; | |
while ((cp = rd.read()) != -1) { | |
sb.append((char) cp); | |
} | |
return sb.toString(); | |
} | |
public static JSONArrayObject readJsonFromUrl(String url) throws IOException, JSONException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package listas_project; | |
public class Nodo | |
{ | |
private int NoControl; | |
private String Nombre; | |
private int Edad; | |
public Nodo(int nocontrol, String nombre, int edad) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program piramide; | |
var | |
a: integer; | |
begin | |
ReadLn( a ); | |
for i := 1 to a do | |
begin | |
for b := 1 to i do |
NewerOlder