Code Monkey home page Code Monkey logo

software2's People

Contributors

jcortes96 avatar

software2's Issues

Johan Peralta

'<?php

session_start();
include 'conexion_bd.php';

if(isset($_SESSION['user']) && $_SESSION['tipo_usuario'] == 'cliente'){
header('Location: menu_cliente.php');

}else if(isset($_SESSION['user']) && $_SESSION['tipo_usuario'] == 'administrador'){

echo "";

}else{
header('Location: inicio.php');
die(0);
}

?>

<title>Registro admin</title>
<script type="text/javascript" src="js/ver_registro.js"></script>
<!--<link rel="stylesheet" type="text/css" href="css/estiloregusuario.css">
<link href="https://fonts.googleapis.com/css?family=K2D" rel="stylesheet">-->

<style>
	
	*{
	margin: 0;
	padding: 0; /*margen interna de las cajas*/
	list-style: none; /*quita las viñetas de las listas*/ 
	font-family: serif; /*fuente de todo el texto*/
	}	

	body{
		/*background-image: url(img/fondo6.jpg);*/
		background-repeat: no-repeat;
		background-size: 100%;
		background-color: black;

	}

	.contenedor{
		background-color: white;
		width: 550px;
		/*height: 550px;*/
		margin: 50px auto;
		line-height: 30px;
		border-style: none;
		text-align: center;	
		padding: 5px;	 
	}
	
	h1{
		color: /*#1aa095;*/ darkblue;
		font-size: 40px;
		margin:35px auto;
		font-family: 'K2D', cursive;
		 
	}	
	
	label{
		width: 200px;
		height: 20px;
		display: inline-block;
		margin:10px auto;
		font-size: 18px;
		color: black;
	}
	

	input,select{
		width: 200px;
		height: 20px;
		font-size: 16px;
	}


	


	input[type='submit'], button{	
		padding:10px;	
		font-size: 18px;
		text-align: center;		
		background-color: /*#1aa095;*/ darkblue;
		width:150px;
		height: 40px;
		margin:25px 10px;
		border: none;
		color: white;
		display: inline-block;
		cursor: pointer;
	}


</style>		
</header>

<section>

	<div class="contenedor">
		
		<h1>Registro de Administrador</h1>

		<form name="forregistroadm" action="" method="POST">

			
			<label for="cor">Correo electronico:</label>
			<input type="email" name="correo" id="cor"  required>
			<br />

			<label for="cla">Contraseña:</label>
			<input type="password" name="clave" id="cla"  required>
			<br />


			<label for="nom">Nombres:</label>
			<input type="text" name="nom_cliente" id="nom" required>
			<br />

			<label for="ape">Apellidos</label>
			<input type="text" name="ape_cliente" id="ape" required>
			<br />

								
			<label for="tdoc">Tipo de documento:</label>
			<select name="tipo_documento" id="tdoc">
				<option value="0" selected>-- Tipo de documento --</option>
				<option value="C.C">Cedula de ciudadania</option>
				<option value="C.E">Cedula de extranjeria</option>
			</select><br />


			<label for="ced">Numero de documento:</label>
			<input type="number" name="num_documento" id="ced" required>
			<br />


			<label for="fec_na">Fecha nacimiento:</label>
			<input type="date" name="fecha_nacimiento" max="2001-01-01" id="fec_na" required>
			<br />


			<label for="cel">Celular:</label>
			<input type="number" name="cel_cliente" id="cel" required>
			<br />

			
			<input type="submit" name="botonenv" value="Registrar" id="env" onclick="return valida_admin()">
			<button type="button" onclick="location.href='menu_admin.php'">Volver</button>

			<!--<button type="button" onclick="location.href='principal.php'">Tienes cuenta? Ingresa</button>-->
		</form>



	</div>

</section>

'<?php

if (isset($_POST['botonenv'])) {

include 'conexion_bd.php';

$correo = $_POST['correo'];
$clave = $_POST['clave'];
$nombre = $_POST['nom_cliente'];
$apellido = $_POST['ape_cliente'];		
$documento = $_POST['tipo_documento'];
$numdoc = $_POST['num_documento'];
$fecha_naci = $_POST['fecha_nacimiento'];
$celular = $_POST['cel_cliente'];


	$insertar = "INSERT INTO clientes values (NULL, '$correo', '$clave', '$nombre', '$apellido','$documento',     '$numdoc', '$fecha_naci','$celular','administrador')";

	$resultado = mysqli_query($conexion, $insertar);

			if(!$resultado){
			
				echo "<script> window.alert('error al registrar el usuario');</script>";
			
			}else{
				
				echo "<script> window.alert('Registrado correctamente');</script>";
				echo "<script> window.location='registro_admin.php'; </script>";

				//header('Refresh, 0');
			
			}

}

?>

1er Modulo

alert("Registrado con exito");</script>'; header("location:../index.html"); ?>

controles de teclado - Cristian Cuervo - Nicol Galindo - Valentina Tamayo

package Controller;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

/**
*

  • @author Spartan Tech
    */
    public class KeyboardController implements KeyListener
    {
    private boolean[] keyStatus;

    public KeyboardController()
    {
    keyStatus = new boolean[256];
    }

    public boolean getKeyStatus(int keyCode)
    {
    if(keyCode < 0 || keyCode > 255)
    {
    return false;
    }
    else
    {
    return keyStatus[keyCode];
    }
    }

    public void resetController()
    {
    keyStatus = new boolean[256];
    }

    @OverRide
    public void keyTyped(KeyEvent ke) {

    }

    @OverRide
    public void keyPressed(KeyEvent ke) {
    keyStatus[ke.getKeyCode()] = true;
    }

    @OverRide
    public void keyReleased(KeyEvent ke) {
    keyStatus[ke.getKeyCode()] = false;
    }

}

Activity May 5th by: Diego Sáenz y Javier Rocha

import java.io.BufferedReader;
import java.io.InputStreamReader;

// Driver program
public class AnyBaseToDecimal {
public static void main (String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    String inp = br.readLine();
    int base =  Integer.parseInt(br.readLine());

    System.out.println("Input in base " + base + " is: " + inp);
    System.out.println("Decimal value of " + inp + " is: " + convertToDecimal(inp, base));

    br.close();
}

public static String convertToDecimal(String inp_num, int base) {
    int len = inp_num.length();
    int num = 0;
    int pow = 1;

    for (int i=len-1; i>=0; i--) {
        if (valOfChar(inp_num.charAt(i)) >= base) {
            return "Invalid Number";
        }
        num += valOfChar(inp_num.charAt(i))*pow;
        pow *= base;
    }
    return String.valueOf(num);
}


public static int valOfChar(char c) {
    if (c >= '0' && c <= '9') {
        return (int)c - '0';
    }
    else {
        return (int)c - 'A' + 10;
    }
}

}

codigo daniel agudelo- anderson alcantar

// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

// TODO actually recognize syntax of TypeScript constructs

(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";

CodeMirror.defineMode("javascript", function(config, parserConfig) {
var indentUnit = config.indentUnit;
var statementIndent = parserConfig.statementIndent;
var jsonldMode = parserConfig.jsonld;
var jsonMode = parserConfig.json || jsonldMode;
var isTS = parserConfig.typescript;
var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;

// Tokenizer

var keywords = function(){
function kw(type) {return {type: type, style: "keyword"};}
var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
var operator = kw("operator"), atom = {type: "atom", style: "atom"};

var jsKeywords = {
  "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
  "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, "debugger": C,
  "var": kw("var"), "const": kw("var"), "let": kw("var"),
  "function": kw("function"), "catch": kw("catch"),
  "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
  "in": operator, "typeof": operator, "instanceof": operator,
  "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
  "this": kw("this"), "module": kw("module"), "class": kw("class"), "super": kw("atom"),
  "yield": C, "export": kw("export"), "import": kw("import"), "extends": C
};

// Extend the 'normal' keywords with the TypeScript language extensions
if (isTS) {
  var type = {type: "variable", style: "variable-3"};
  var tsKeywords = {
    // object-like things
    "interface": kw("interface"),
    "extends": kw("extends"),
    "constructor": kw("constructor"),

    // scope modifiers
    "public": kw("public"),
    "private": kw("private"),
    "protected": kw("protected"),
    "static": kw("static"),

    // types
    "string": type, "number": type, "bool": type, "any": type
  };

  for (var attr in tsKeywords) {
    jsKeywords[attr] = tsKeywords[attr];
  }
}

return jsKeywords;

}();

var isOperatorChar = /[+-*&%=<>!?|~^]/;
var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;

function readRegexp(stream) {
var escaped = false, next, inSet = false;
while ((next = stream.next()) != null) {
if (!escaped) {
if (next == "/" && !inSet) return;
if (next == "[") inSet = true;
else if (inSet && next == "]") inSet = false;
}
escaped = !escaped && next == "\";
}
}

// Used as scratch variables to communicate multiple values without
// consing up tons of objects.
var type, content;
function ret(tp, style, cont) {
type = tp; content = cont;
return style;
}
function tokenBase(stream, state) {
var ch = stream.next();
if (ch == '"' || ch == "'") {
state.tokenize = tokenString(ch);
return state.tokenize(stream, state);
} else if (ch == "." && stream.match(/^\d+(?:[eE][+-]?\d+)?/)) {
return ret("number", "number");
} else if (ch == "." && stream.match("..")) {
return ret("spread", "meta");
} else if (/[[]{}(),;:.]/.test(ch)) {
return ret(ch);
} else if (ch == "=" && stream.eat(">")) {
return ret("=>", "operator");
} else if (ch == "0" && stream.eat(/x/i)) {
stream.eatWhile(/[\da-f]/i);
return ret("number", "number");
} else if (/\d/.test(ch)) {
stream.match(/^\d*(?:.\d*)?(?:[eE][+-]?\d+)?/);
return ret("number", "number");
} else if (ch == "/") {
if (stream.eat("*")) {
state.tokenize = tokenComment;
return tokenComment(stream, state);
} else if (stream.eat("/")) {
stream.skipToEnd();
return ret("comment", "comment");
} else if (state.lastType == "operator" || state.lastType == "keyword c" ||
state.lastType == "sof" || /^[[{}(,;:]$/.test(state.lastType)) {
readRegexp(stream);
stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla
return ret("regexp", "string-2");
} else {
stream.eatWhile(isOperatorChar);
return ret("operator", "operator", stream.current());
}
} else if (ch == "`") {
state.tokenize = tokenQuasi;
return tokenQuasi(stream, state);
} else if (ch == "#") {
stream.skipToEnd();
return ret("error", "error");
} else if (isOperatorChar.test(ch)) {
stream.eatWhile(isOperatorChar);
return ret("operator", "operator", stream.current());
} else if (wordRE.test(ch)) {
stream.eatWhile(wordRE);
var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
return (known && state.lastType != ".") ? ret(known.type, known.style, word) :
ret("variable", "variable", word);
}
}

function tokenString(quote) {
return function(stream, state) {
var escaped = false, next;
if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){
state.tokenize = tokenBase;
return ret("jsonld-keyword", "meta");
}
while ((next = stream.next()) != null) {
if (next == quote && !escaped) break;
escaped = !escaped && next == "\";
}
if (!escaped) state.tokenize = tokenBase;
return ret("string", "string");
};
}

function tokenComment(stream, state) {
var maybeEnd = false, ch;
while (ch = stream.next()) {
if (ch == "/" && maybeEnd) {
state.tokenize = tokenBase;
break;
}
maybeEnd = (ch == "*");
}
return ret("comment", "comment");
}

function tokenQuasi(stream, state) {
var escaped = false, next;
while ((next = stream.next()) != null) {
if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {
state.tokenize = tokenBase;
break;
}
escaped = !escaped && next == "\";
}
return ret("quasi", "string-2", stream.current());
}

var brackets = "([{}])";
// This is a crude lookahead trick to try and notice that we're
// parsing the argument patterns for a fat-arrow function before we
// actually hit the arrow token. It only works if the arrow is on
// the same line as the arguments and there's no strange noise
// (comments) in between. Fallback is to only notice when we hit the
// arrow, and not declare the arguments as locals for the arrow
// body.
function findFatArrow(stream, state) {
if (state.fatArrowAt) state.fatArrowAt = null;
var arrow = stream.string.indexOf("=>", stream.start);
if (arrow < 0) return;

var depth = 0, sawSomething = false;
for (var pos = arrow - 1; pos >= 0; --pos) {
  var ch = stream.string.charAt(pos);
  var bracket = brackets.indexOf(ch);
  if (bracket >= 0 && bracket < 3) {
    if (!depth) { ++pos; break; }
    if (--depth == 0) break;
  } else if (bracket >= 3 && bracket < 6) {
    ++depth;
  } else if (wordRE.test(ch)) {
    sawSomething = true;
  } else if (sawSomething && !depth) {
    ++pos;
    break;
  }
}
if (sawSomething && !depth) state.fatArrowAt = pos;

}

// Parser

var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true};

function JSLexical(indented, column, type, align, prev, info) {
this.indented = indented;
this.column = column;
this.type = type;
this.prev = prev;
this.info = info;
if (align != null) this.align = align;
}

function inScope(state, varname) {
for (var v = state.localVars; v; v = v.next)
if (v.name == varname) return true;
for (var cx = state.context; cx; cx = cx.prev) {
for (var v = cx.vars; v; v = v.next)
if (v.name == varname) return true;
}
}

function parseJS(state, style, type, content, stream) {
var cc = state.cc;
// Communicate our context to the combinators.
// (Less wasteful than consing up a hundred closures on every call.)
cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;

if (!state.lexical.hasOwnProperty("align"))
  state.lexical.align = true;

while(true) {
  var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
  if (combinator(type, content)) {
    while(cc.length && cc[cc.length - 1].lex)
      cc.pop()();
    if (cx.marked) return cx.marked;
    if (type == "variable" && inScope(state, content)) return "variable-2";
    return style;
  }
}

}

// Combinator utils

var cx = {state: null, column: null, marked: null, cc: null};
function pass() {
for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
}
function cont() {
pass.apply(null, arguments);
return true;
}
function register(varname) {
function inList(list) {
for (var v = list; v; v = v.next)
if (v.name == varname) return true;
return false;
}
var state = cx.state;
if (state.context) {
cx.marked = "def";
if (inList(state.localVars)) return;
state.localVars = {name: varname, next: state.localVars};
} else {
if (inList(state.globalVars)) return;
if (parserConfig.globalVars)
state.globalVars = {name: varname, next: state.globalVars};
}
}

// Combinators

var defaultVars = {name: "this", next: {name: "arguments"}};
function pushcontext() {
cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};
cx.state.localVars = defaultVars;
}
function popcontext() {
cx.state.localVars = cx.state.context.vars;
cx.state.context = cx.state.context.prev;
}
function pushlex(type, info) {
var result = function() {
var state = cx.state, indent = state.indented;
if (state.lexical.type == "stat") indent = state.lexical.indented;
else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev)
indent = outer.indented;
state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);
};
result.lex = true;
return result;
}
function poplex() {
var state = cx.state;
if (state.lexical.prev) {
if (state.lexical.type == ")")
state.indented = state.lexical.indented;
state.lexical = state.lexical.prev;
}
}
poplex.lex = true;

function expect(wanted) {
function exp(type) {
if (type == wanted) return cont();
else if (wanted == ";") return pass();
else return cont(exp);
};
return exp;
}

function statement(type, value) {
if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex);
if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);
if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
if (type == "{") return cont(pushlex("}"), block, poplex);
if (type == ";") return cont();
if (type == "if") {
if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)
cx.state.cc.pop()();
return cont(pushlex("form"), expression, statement, poplex, maybeelse);
}
if (type == "function") return cont(functiondef);
if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
if (type == "variable") return cont(pushlex("stat"), maybelabel);
if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
block, poplex, poplex);
if (type == "case") return cont(expression, expect(":"));
if (type == "default") return cont(expect(":"));
if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
statement, poplex, popcontext);
if (type == "module") return cont(pushlex("form"), pushcontext, afterModule, popcontext, poplex);
if (type == "class") return cont(pushlex("form"), className, poplex);
if (type == "export") return cont(pushlex("form"), afterExport, poplex);
if (type == "import") return cont(pushlex("form"), afterImport, poplex);
return pass(pushlex("stat"), expression, expect(";"), poplex);
}
function expression(type) {
return expressionInner(type, false);
}
function expressionNoComma(type) {
return expressionInner(type, true);
}
function expressionInner(type, noComma) {
if (cx.state.fatArrowAt == cx.stream.start) {
var body = noComma ? arrowBodyNoComma : arrowBody;
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext);
else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);
}

var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
if (type == "function") return cont(functiondef, maybeop);
if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression);
if (type == "(") return cont(pushlex(")"), maybeexpression, comprehension, expect(")"), poplex, maybeop);
if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
if (type == "{") return contCommasep(objprop, "}", null, maybeop);
if (type == "quasi") { return pass(quasi, maybeop); }
return cont();

}
function maybeexpression(type) {
if (type.match(/[;})],]/)) return pass();
return pass(expression);
}
function maybeexpressionNoComma(type) {
if (type.match(/[;})],]/)) return pass();
return pass(expressionNoComma);
}

function maybeoperatorComma(type, value) {
if (type == ",") return cont(expression);
return maybeoperatorNoComma(type, value, false);
}
function maybeoperatorNoComma(type, value, noComma) {
var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;
var expr = noComma == false ? expression : expressionNoComma;
if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
if (type == "operator") {
if (/++|--/.test(value)) return cont(me);
if (value == "?") return cont(expression, expect(":"), expr);
return cont(expr);
}
if (type == "quasi") { return pass(quasi, me); }
if (type == ";") return;
if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
if (type == ".") return cont(property, me);
if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
}
function quasi(type, value) {
if (type != "quasi") return pass();
if (value.slice(value.length - 2) != "${") return cont(quasi);
return cont(expression, continueQuasi);
}
function continueQuasi(type) {
if (type == "}") {
cx.marked = "string-2";
cx.state.tokenize = tokenQuasi;
return cont(quasi);
}
}
function arrowBody(type) {
findFatArrow(cx.stream, cx.state);
return pass(type == "{" ? statement : expression);
}
function arrowBodyNoComma(type) {
findFatArrow(cx.stream, cx.state);
return pass(type == "{" ? statement : expressionNoComma);
}
function maybelabel(type) {
if (type == ":") return cont(poplex, statement);
return pass(maybeoperatorComma, expect(";"), poplex);
}
function property(type) {
if (type == "variable") {cx.marked = "property"; return cont();}
}
function objprop(type, value) {
if (type == "variable" || cx.style == "keyword") {
cx.marked = "property";
if (value == "get" || value == "set") return cont(getterSetter);
return cont(afterprop);
} else if (type == "number" || type == "string") {
cx.marked = jsonldMode ? "property" : (cx.style + " property");
return cont(afterprop);
} else if (type == "jsonld-keyword") {
return cont(afterprop);
} else if (type == "[") {
return cont(expression, expect("]"), afterprop);
}
}
function getterSetter(type) {
if (type != "variable") return pass(afterprop);
cx.marked = "property";
return cont(functiondef);
}
function afterprop(type) {
if (type == ":") return cont(expressionNoComma);
if (type == "(") return pass(functiondef);
}
function commasep(what, end) {
function proceed(type) {
if (type == ",") {
var lex = cx.state.lexical;
if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;
return cont(what, proceed);
}
if (type == end) return cont();
return cont(expect(end));
}
return function(type) {
if (type == end) return cont();
return pass(what, proceed);
};
}
function contCommasep(what, end, info) {
for (var i = 3; i < arguments.length; i++)
cx.cc.push(arguments[i]);
return cont(pushlex(end, info), commasep(what, end), poplex);
}
function block(type) {
if (type == "}") return cont();
return pass(statement, block);
}
function maybetype(type) {
if (isTS && type == ":") return cont(typedef);
}
function typedef(type) {
if (type == "variable"){cx.marked = "variable-3"; return cont();}
}
function vardef() {
return pass(pattern, maybetype, maybeAssign, vardefCont);
}
function pattern(type, value) {
if (type == "variable") { register(value); return cont(); }
if (type == "[") return contCommasep(pattern, "]");
if (type == "{") return contCommasep(proppattern, "}");
}
function proppattern(type, value) {
if (type == "variable" && !cx.stream.match(/^\s*:/, false)) {
register(value);
return cont(maybeAssign);
}
if (type == "variable") cx.marked = "property";
return cont(expect(":"), pattern, maybeAssign);
}
function maybeAssign(_type, value) {
if (value == "=") return cont(expressionNoComma);
}
function vardefCont(type) {
if (type == ",") return cont(vardef);
}
function maybeelse(type, value) {
if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex);
}
function forspec(type) {
if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);
}
function forspec1(type) {
if (type == "var") return cont(vardef, expect(";"), forspec2);
if (type == ";") return cont(forspec2);
if (type == "variable") return cont(formaybeinof);
return pass(expression, expect(";"), forspec2);
}
function formaybeinof(_type, value) {
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
return cont(maybeoperatorComma, forspec2);
}
function forspec2(type, value) {
if (type == ";") return cont(forspec3);
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
return pass(expression, expect(";"), forspec3);
}
function forspec3(type) {
if (type != ")") cont(expression);
}
function functiondef(type, value) {
if (value == "") {cx.marked = "keyword"; return cont(functiondef);}
if (type == "variable") {register(value); return cont(functiondef);}
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, statement, popcontext);
}
function funarg(type) {
if (type == "spread") return cont(funarg);
return pass(pattern, maybetype);
}
function className(type, value) {
if (type == "variable") {register(value); return cont(classNameAfter);}
}
function classNameAfter(type, value) {
if (value == "extends") return cont(expression, classNameAfter);
if (type == "{") return cont(pushlex("}"), classBody, poplex);
}
function classBody(type, value) {
if (type == "variable" || cx.style == "keyword") {
cx.marked = "property";
if (value == "get" || value == "set") return cont(classGetterSetter, functiondef, classBody);
return cont(functiondef, classBody);
}
if (value == "
") {
cx.marked = "keyword";
return cont(classBody);
}
if (type == ";") return cont(classBody);
if (type == "}") return cont();
}
function classGetterSetter(type) {
if (type != "variable") return pass();
cx.marked = "property";
return cont();
}
function afterModule(type, value) {
if (type == "string") return cont(statement);
if (type == "variable") { register(value); return cont(maybeFrom); }
}
function afterExport(_type, value) {
if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }
return pass(statement);
}
function afterImport(type) {
if (type == "string") return cont();
return pass(importSpec, maybeFrom);
}
function importSpec(type, value) {
if (type == "{") return contCommasep(importSpec, "}");
if (type == "variable") register(value);
return cont();
}
function maybeFrom(_type, value) {
if (value == "from") { cx.marked = "keyword"; return cont(expression); }
}
function arrayLiteral(type) {
if (type == "]") return cont();
return pass(expressionNoComma, maybeArrayComprehension);
}
function maybeArrayComprehension(type) {
if (type == "for") return pass(comprehension, expect("]"));
if (type == ",") return cont(commasep(maybeexpressionNoComma, "]"));
return pass(commasep(expressionNoComma, "]"));
}
function comprehension(type) {
if (type == "for") return cont(forspec, comprehension);
if (type == "if") return cont(expression, comprehension);
}

// Interface

return {
startState: function(basecolumn) {
var state = {
tokenize: tokenBase,
lastType: "sof",
cc: [],
lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
localVars: parserConfig.localVars,
context: parserConfig.localVars && {vars: parserConfig.localVars},
indented: 0
};
if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
state.globalVars = parserConfig.globalVars;
return state;
},

token: function(stream, state) {
  if (stream.sol()) {
    if (!state.lexical.hasOwnProperty("align"))
      state.lexical.align = false;
    state.indented = stream.indentation();
    findFatArrow(stream, state);
  }
  if (state.tokenize != tokenComment && stream.eatSpace()) return null;
  var style = state.tokenize(stream, state);
  if (type == "comment") return style;
  state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type;
  return parseJS(state, style, type, content, stream);
},

indent: function(state, textAfter) {
  if (state.tokenize == tokenComment) return CodeMirror.Pass;
  if (state.tokenize != tokenBase) return 0;
  var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;
  // Kludge to prevent 'maybelse' from blocking lexical scope pops
  if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
    var c = state.cc[i];
    if (c == poplex) lexical = lexical.prev;
    else if (c != maybeelse) break;
  }
  if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev;
  if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat")
    lexical = lexical.prev;
  var type = lexical.type, closing = firstChar == type;

  if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0);
  else if (type == "form" && firstChar == "{") return lexical.indented;
  else if (type == "form") return lexical.indented + indentUnit;
  else if (type == "stat")
    return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? statementIndent || indentUnit : 0);
  else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false)
    return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
  else if (lexical.align) return lexical.column + (closing ? 0 : 1);
  else return lexical.indented + (closing ? 0 : indentUnit);
},

electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
blockCommentStart: jsonMode ? null : "/*",
blockCommentEnd: jsonMode ? null : "*/",
lineComment: jsonMode ? null : "//",
fold: "brace",

helperType: jsonMode ? "json" : "javascript",
jsonldMode: jsonldMode,
jsonMode: jsonMode

};
});

CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/);

CodeMirror.defineMIME("text/javascript", "javascript");
CodeMirror.defineMIME("text/ecmascript", "javascript");
CodeMirror.defineMIME("application/javascript", "javascript");
CodeMirror.defineMIME("application/x-javascript", "javascript");
CodeMirror.defineMIME("application/ecmascript", "javascript");
CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true});
CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true});
CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });

});

PruebaProyecto

//
//
//
//
//<title>Sistema Academico ALlC</title>
//
//
//
//<script type="application/x-javascript">
//addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); }
//</script>
//
//
//
//
//


//Datos de Ingreso no validos.
//

//
//

//

//

//
//

Sistema Academico


//

ALLC


//

//Usuario
//
//

//

//Contraseña

//
//

//

¿..Olvido su contraseña..?


//
//
//

//

//

//
//
//
//

//

© 2017 Serverus Corporation. Todos los derechos reservados | Diseñado por: W3layouts | JFEG


//

//
//<script src="js/jquery-3.2.1.min.js"></script>
//
//<script>
//$('.form').find('input, textarea').on('keyup blur focus', function (e) {
//var $this = $(this),
//label = $this.prev('label');
//if (e.type === 'keyup') {
//if ($this.val() === '') {
//label.removeClass('active highlight');
//} else {
//label.addClass('active highlight');
//}
//} else if (e.type === 'blur') {
//if( $this.val() === '' ) {
//label.removeClass('active highlight');
//} else {
//label.removeClass('highlight');
//}
//} else if (e.type === 'focus') {
//if( $this.val() === '' ) {
//label.removeClass('highlight');
//}
//else if( $this.val() !== '' ) {
//label.addClass('highlight');
//}
//}
//});
//</script>
//<script>
//$("#formlg").submit(function(){
////alert("Submitted");
////alert("Hola Mundo 2");
//event.preventDefault();
//$.ajax({
//type: 'POST',
//url: 'main_app/login.php',
//dataType: "JSON",
//data: $(this).serialize(),
//beforeSend: function(){
//$('.botonlg').val('..Validando..');
//}
//})
//.done(function(respuesta){
// console.log('dd',respuesta);
//if(!respuesta.error){
//if(respuesta.tipo == 'Administrador'){
//location.href = 'main_app/Admin/';
//}else if(respuesta.tipo == 'Estudiante'){
//location.href = 'main_app/Usuario/';
//}
//}else{
//$('.error').slideDown('slow');
//setTimeout(function(){
//$('.error').slideUp('slow');
//},3000);
//$('.botonlg').val("...Iniciar Sesion...");
//}
//})
//.fail(function(resp){
//alert("Error",resp);
//console.log('---',resp.responseText);
//})
//.always(function(){
//console.log("Complete Always");
//});
//});
//</script>
//
//

Prueba_Software_Sonar_Cobol_Oscar_Bernal_Alicia_Londoño

      $SET RECMODE"F"
      $SET SOURCEFORMAT"FREE"

  • INDEXA ARCHIVO DE USUARIOS QUE PAGAN BUZON
  • MODIFICACIONES
  • 08-SEP-2004 INICIO DE DESARROLLO

IDENTIFICATION DIVISION.
PROGRAM-ID. 00-INDEXAMINBUZON.
AUTHOR. GFVD.
DATE-WRITTEN. SEP 2004.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.


  • ARCHIVO DE CONTROL DE ERROR

*** ARCHIVO DE CONTROL DE ERROR
SELECT OU-ERR ASSIGN TO EXTERNAL FERR
ORGANIZATION IS LINE SEQUENTIAL.
*
*** ARCHIVO DE USUARIOS QUE PAGAN BUZON
SELECT IN-BUZON ASSIGN TO EXTERNAL FBUZONORI
ORGANIZATION IS LINE SEQUENTIAL
FILE STATUS IS FS-INBUZON.
*
*** ARCHIVO INDEXADO DE USUARIOS QUE PAGAN BUZON
SELECT OU-BUZON ASSIGN TO EXTERNAL FBUZONIDX
ORGANIZATION IS INDEXED
ACCESS MODE IS RANDOM
FILE STATUS IS FS-OUBUZON
RECORD KEY IS MINESBUZON-KEY.
*
DATA DIVISION.
FILE SECTION.
*
FD OU-ERR.
01 OU-ERR-REC PIC X(1000).

FD IN-BUZON.
01 IN-BUZON-REC.
04 IN-BUZON-MIN PIC X(18).

FD OU-BUZON.
COPY "../SRC/LIB/med_minesbuzon.lib"..
*
WORKING-STORAGE SECTION.
*
01 FS-INBUZON PIC X(2).
01 FS-OUBUZON PIC X(2).
01 FIN-INBUZON PIC 9(1) VALUE 0.
01 ENV-VAR-VALUE PIC X(256) VALUE SPACES.

01 REG-LEIDOS PIC 9(6) VALUE 0.
01 REG-ESCRITOS PIC 9(6) VALUE 0.
01 TMP-MENSAJE PIC X(1000).
*
PROCEDURE DIVISION.
DECLARATIVES.
I-O-ERROR SECTION.
USE AFTER ERROR PROCEDURE IN-BUZON OU-BUZON.
END DECLARATIVES.

INICIO SECTION.
OPEN INPUT IN-BUZON
IF FS-INBUZON NOT= "00"
DISPLAY "FBUZONORI" UPON ENVIRONMENT-NAME
ACCEPT ENV-VAR-VALUE FROM ENVIRONMENT-VALUE

  INITIALIZE TMP-MENSAJE
  • "Alarma: No se encontr񟠲chivo de usuarios con buz򬟰ago $1 status: $2."
    STRING "VOZ-MED-INDX-01|" ENV-VAR-VALUE DELIMITED BY SPACES "|" FS-INBUZON  INTO TMP-MENSAJE
    PERFORM SALIR-ERROR
    

    END-IF

    READ IN-BUZON AT END
    DISPLAY "FBUZONORI" UPON ENVIRONMENT-NAME
    ACCEPT ENV-VAR-VALUE FROM ENVIRONMENT-VALUE
    CLOSE IN-BUZON

    INITIALIZE TMP-MENSAJE
    
  • "Alarma: Archivo de usuarios con buz򬟰ago vacio $1 status $2."
    STRING "VOZ-MED-INDX-02|"  ENV-VAR-VALUE  DELIMITED BY SPACES "|" FS-INBUZON  INTO TMP-MENSAJE
    PERFORM SALIR-ERROR
    

    END-READ

    OPEN OUTPUT OU-BUZON

    PERFORM UNTIL FIN-INBUZON = 1
    ADD 1 TO REG-LEIDOS
    INITIALIZE MINESBUZON-REC
    STRING "57" DELIMITED BY SIZE,
    IN-BUZON-MIN(1:10) DELIMITED BY SPACES,
    INTO MINESBUZON-KEY
    MOVE IN-BUZON-MIN(11:1) TO MINESBUZON-TIPO

    WRITE MINESBUZON-REC INVALID KEY
       DISPLAY "FBUZONORI" UPON ENVIRONMENT-NAME
       ACCEPT ENV-VAR-VALUE FROM ENVIRONMENT-VALUE
       DISPLAY "  En el archivo original de usuarios con buz򬟰ago se encontr񟤬 registro " IN-BUZON-MIN
       DISPLAY "  duplicado."
    NOT INVALID KEY
       ADD 1 TO REG-ESCRITOS
    END-WRITE
    
    READ IN-BUZON AT END
       MOVE 1 TO FIN-INBUZON
    END-READ
    

    END-PERFORM
    DISPLAY " "
    DISPLAY " Estad체icas de conversi򬟤e archivo de usuarios con buz򬠊 DISPLAY " -- Total registros originales leidos: " REG-LEIDOS
    DISPLAY " -- Total registros indexados escritos: " REG-ESCRITOS
    DISPLAY " "
    CLOSE IN-BUZON OU-BUZON
    STOP RUN.

SALIR-ERROR SECTION.
OPEN OUTPUT OU-ERR
WRITE OU-ERR-REC FROM TMP-MENSAJE
CLOSE OU-ERR
DISPLAY "MODULO_OK" UPON ENVIRONMENT-NAME
DISPLAY "0" UPON ENVIRONMENT-VALUE
STOP RUN.

Codigo Cajero Edinson - Miguel

package cajero;
/**

  • @author Edgar Galeano
    */
    import java.util.Scanner;
    import java.util.Random;
    public class Cajero {
    static boolean validar_contraseña(int contraseña) {
    Scanner sc = new Scanner(System.in);
    int cl, cl1, intentos=0;
    boolean valor_retorno;

     do {
         System.out.println ("Ingrese contraseña:");
         cl1 = sc.nextInt();
    
         if (cl1==contraseña) {  
             System.out.println ("Contraseña aceptada...");
             valor_retorno = true;
             intentos=3;
         }
         else {
             System.out.println ("La contraseña ingresada no corresponde a la cuenta. Intente de nuevo..");
             intentos++;
             valor_retorno = false;
         }
     } while (intentos<3);
     return valor_retorno;
    

    }

    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    Random rnd = new Random();

     boolean resp;
     String documento;
     int cl1=0;
     int cl2=0;
     double consignacion = 0;
     String contraseña="";
     int nocuenta=0;
     String cuenta="";
     String[][] cuentas = new String[5][5];
     //varchar cuentas[][];
     int i=0;
     int op=0;
     int op1=0;
     double retiro = 0;
     double saldo = 0;
     String nombre="";
    
     do {
         System.out.println ("\n\n");
         System.out.println ("***************************************");
         System.out.println ("***************************************");
         System.out.println ("****  Bienvenidos a su Banco PCA  *****");
         System.out.println ("******      MENU PRINCIPAL       ******");
         System.out.println ("******        Seleccione:        ******");
         System.out.println ("******   1-Apertura de cuenta    ******");
         System.out.println ("******   2-Menu transacciones    ******");
         System.out.println ("******         3-Salir           ******");
         System.out.println ("***************************************");
         System.out.println ("***************************************");
         System.out.print ("Seleccione opcion y pulse Enter : ");
    
         do {
             op = sc.nextInt();
         } while (op<1 && op>3);
        
         switch (op) {
             case 1:
                 System.out.println ("MENU DE APERTURA DE CUENTAS");
                 System.out.println ("Ingrese Nombre");
                 nombre = sc.next();
                 System.out.println ("Ingrese Nro Documento");
                 documento  = sc.next();
                 do {
                         System.out.println ("Ingrese Clave para su nueva cuenta (Valor numerico)");
                         cl1 = sc.nextInt();
                         System.out.println ("Ingrese Nuevamente la Clave para su nueva cuenta (Valor numerico)");
                         cl2 = sc.nextInt();
                         if (cl1 != cl2) {
                             System.out.println ("Error en la comprobación de la contraseña.  Intentelo nuevamente...");
                         }
                 }while (cl1 != cl2);                  
                
                 nocuenta = rnd.nextInt(100);
                 System.out.println ("Ingrese monto deposito inicial:");
                 saldo = sc.nextDouble();
                 System.out.println ("Sr (a) :"+nombre);
                 System.out.println ("Su numero de cuenta es:"+nocuenta);                          
                 System.out.println ("Su saldo es:"+saldo);                          
                 System.out.println ("Pulse cualquier numero y Enter para continuar...");                          
                 op1 = sc.nextInt();
                 break;                  
             case 2:
                 System.out.println ("\n\n");
                 System.out.println ("***************************************");
                 System.out.println ("***************************************");
                 System.out.println ("****  Bienvenidos a su Banco PCA  *****");
                 System.out.println ("****      MENU TRANSACCIONES      *****");
                 System.out.println ("****          1-Deposto:          *****");
                 System.out.println ("****          2-Retiro            *****");
                 System.out.println ("****      3-Consultar Saldo       *****");
                 System.out.println ("****      4-Cambio de clave       *****");
                 System.out.println ("**** 5-Regresar al menu principal *****");
                 System.out.println ("***************************************");
                 System.out.println ("***************************************");
                 System.out.print ("Digite opcion...:");
                 op1 = sc.nextInt();
                 switch (op1) {
                     case 1:
                         System.out.println ("Depositos:");
                         //resp = validar_contraseña(cl1);
                         if (validar_contraseña(cl1)) {
                             System.out.println ("Consignar a la cuenta "+cuenta+" De "+nombre);
                             System.out.println ("Ingrese valor consignación:");
                             consignacion = sc.nextDouble();
                             if (consignacion>0) {
                                 saldo = saldo + consignacion;
    
                                 System.out.println ("Su nuevo saldo es de : "+saldo);
                                 System.out.println ("Gracias por utilizar nuestros servicios...");
                             }
                         }
                         else {
                             System.out.println ("No se pudo verificar la información suministrada...");
                         }
                         System.out.println ("Pulse cualquier numero y Enter para continuar...");                          
                         op1 = sc.nextInt();
                         break;
                     case 2:
                         System.out.println ("Retiros");
                         if (validar_contraseña(cl1)) {
                             System.out.println ("Ingrese valor a Retirar:");
                             retiro = sc.nextDouble();
                             if (retiro>0) {
                                 saldo = saldo - retiro;
    
                                 System.out.println ("Su nuevo saldo es de:"+saldo);
                                 System.out.println ("Gracias por utilizar nuestros servicios...");
    
                                 System.out.println ("Pulse cualquier numero y Enter para continuar...");                          
                                 op1 = sc.nextInt();
                             }
                         }
                         else {
                             System.out.println ("No se pudo verificar la información suministrada...");
                         }
                         break;
                
                    
                     case 3:
                         System.out.println ("Consulta de saldo");
                         if (validar_contraseña(cl1)) {
                             System.out.println ("Su saldo es de:"+saldo);
                             System.out.println ("Gracias por utilizar nuestros servicios...");
    
                             System.out.println ("Pulse cualquier numero y Enter para continuar...");                          
                             op1 = sc.nextInt();
                         }
                         else {
                             System.out.println ("No se pudo verificar la información suministrada...");
                         }
                         break;
                        
                     case 4:
                         System.out.println ("Cambio de clave");
                         if (validar_contraseña(cl1)) {
                             System.out.println ("Cambio de clave de la cuenta "+nocuenta+" De "+nombre);
    
                             do {
                                 System.out.println ("Ingrese nueva Clave (Valor numerico)");
                                 cl1 = sc.nextInt();
                                 System.out.println ("Ingrese Nuevamente la nueva Clave (Valor numerico)");
                                 cl2 = sc.nextInt();
                                 if (cl1 != cl2) {
                                     System.out.println ("Error en la comprobación de la contraseña.  Intentelo nuevamente...");
                                 }
                             }while (cl1 != cl2);  
                             System.out.println ("Se ha asignado nueva clave a la cuenta ");
                         }
                         break;
                     default:
                     System.out.println ("Opcion no valida... Intente nuevamente");
                     break;
                 }
         }
     } while(op!=3);
     System.out.println ("Gracias por utilizar nuestros servicios...Hasta Pronto.");
    

    }
    }

software con Sonar Andrey Neira Camilo Roca

Presentado por :
Andrey Neira
Camilo roca

<title>Documento sin título</title>

Bienvenido

()


<a href="noticia.php?id=<?php echo $not['id']; ?>"><?php echo $not['titulo']; ?></a>
<br />
<?php echo $not['noticia']; ?>
<br />
<?php echo $user['usuario']; ?>
<br />
<?php echo $not['fecha']; ?>
<br />
Comentarios (<?php echo $contar; ?>)
<br />
<br />

	
	<?php
}

?>

Pruebas Sonarqube Juan Alvarez, Nicolas Gonzalez, Daniela Martin

import java.util.ArrayList ;
import java.util.Comparator ;
importar java.util.HashMap ;

público de clase HEncoder {

public  HashMap < Character , String > encoder =  new  HashMap <> (); // para codificar
public  HashMap < String , Character > decoder =  new  HashMap <> (); // para decodificar

 nodo de clase privada estática  { 

	Personaje ch;
	Frecuencia entera
	Nodo a la izquierda;
	Nodo correcto;

	 Nodecomparator final estático  público Ctor = new Nodecomparator ();   

	public  static  class  Nodecomparator  implementa  Comparator < Node > {

		@Anular
		public  int  compare ( Nodo  o1 , Nodo  o2 ) {
			devuelve o2 . freq - o1 . freq;
		}

	}
}

 HEncoder público ( alimentador de cadenas  ) {
	// 1. mapa de freq
	HashMap < Character , Integer > freqmap =  new  HashMap <> ();
	for ( int i =  0 ; i < feeder . length (); ++ i) {
		char ch = alimentador . charAt (i);
		if (freqmap . containsKey (ch)) {
			freqmap . put (ch, freqmap . get (ch) +  1 );
		} else {
			freqmap . put (ch, 1 );
		}
	}

	// 2. preparar el montón del conjunto de claves
	genericheap < Node > heap =  new genericheap < Node > ( Node . Ctor );
	ArrayList < Character > k =  new  ArrayList <> (freqmap . KeySet ());
	para ( Carácter c : k) {
		Nodo n =  nuevo  nodo ();
		n . ch = c;
		n . left =  null ;
		n . derecho =  nulo ;
		n . freq = freqmap . obtener (c);
		montón . agregar (n);
	}

	// 3.Preparar árbol, eliminar dos, fusionar, volver a agregarlo
	Nodo fn =  nuevo  nodo ();
	mientras que (montón . size () ! =  1 ) {
		Nodo n1 = montón . removeHP ();
		Nodo n2 = montón . removeHP ();
		fn =  nuevo  nodo ();

		fn . freq = n1 . freq + n2 . freq;
		fn . left = n1;
		fn . derecha = n2;

		montón . agregar (fn);
	}

	// 4. transversal

	poligonal (montón . removeHP (), " " );
}

 recorrido vacío  privado ( Nodo nodo , String osf ) {  

	if (node . left ==  null  && node . right ==  null ) {
		codificador . poner (nodo . ch, OSF);
		decodificador . put (osf, nodo . ch);
		regreso ;
	}
	atravesar (nodo . izquierda, OSF +  " 0 " );
	atravesar (nodo . derecho, OSF +  " 1 " );

}

// trabajo de compresión hecho aquí
public  String  compress ( String  str ) {
	String rv =  " " ;
	for ( int i =  0 ; i < str . length (); ++ i) {
		rv + = codificador . get (str . charAt (i));
	}
	devolver rv;
}


// para descomprimir
 Descompresión de cadena  pública ( String str ) { 
	String s =  " " ;
	Código de cadena =  " " ;
	for ( int i =  0 ; i < str . length (); ++ i) {
		código + = str . charAt (i);
		if (decodificador . containsKey (código)) {
			s + = decodificador . obtener (código);
			code =  " " ;
		}
	}

	devolver s;
}

}

Proyecto Ivan Rosales, Jesús Fernández, Duvan Galindo

`<?php

include('is_logged.php');//Archivo verifica que el usario que intenta acceder a la URL esta logueado
$session_id= session_id();
if (isset($_POST['id'])){$id=$_POST['id'];}
if (isset($_POST['cantidad'])){$cantidad=$_POST['cantidad'];}
if (isset($_POST['precio_venta'])){$precio_venta=$_POST['precio_venta'];}

/Nos conectamos a la BD/
require_once ("../config/db.php");//Contiene las variables de configuracion para conectar a la base de datos
require_once ("../config/conexion.php");//Contiene funcion que conecta a la base de datos

//Archivo de funciones PHP
include("../funciones.php");
if (!empty($id) and !empty($cantidad) and !empty($precio_venta)){
$insert_tmp=mysqli_query($con, "INSERT INTO tmp (id_producto,cantidad_tmp,precio_tmp,session_id) VALUES ('$id','$cantidad','$precio_venta','$session_id')");
}

if (isset($_GET['id'])){//codigo elimina un elemento del array

$id_tmp=intval($_GET['id']);	
$delete=mysqli_query($con, "DELETE FROM tmp WHERE id_tmp='".$id_tmp."'");

}
$simbolo_moneda="$";

?>

$precio_venta=$row['precio_tmp']; $precio_venta_f=number_format($precio_venta,0,'.','.');//Formateo variables $precio_venta_r=str_replace(".","",$precio_venta_f);//Reemplazo las comas $precio_total=$precio_venta_r*$cantidad; $precio_total_f=number_format($precio_total,0,'.','.');//Precio total formateado $precio_total_r=str_replace(".","",$precio_total_f);//Reemplazo las comas $sumador_total+=$precio_total_r;//Sumador ?> <tr> <td class='text-center'><?php echo $codigo_producto;?></td> <td class='text-center'><?php echo $cantidad;?></td> <td><?php echo $nombre_producto;?></td> <td class='text-right'><?php echo $precio_venta_f;?></td> <td class='text-right'><?php echo $precio_total_f;?></td> <td class='text-center'> <a href="#" onclick="eliminar('<?php echo $id_tmp ?>')"> <i class="glyphicon glyphicon-remove-circle"></i> </a> </td> </tr> <?php } $impuesto=get_row('perfil','impuesto', 'id_perfil', 1); $subtotal=number_format($sumador_total,2,'.',''); $total_iva=($subtotal * $impuesto )/100; $total_iva=number_format($total_iva,2,'.',''); $total_factura=$subtotal+$total_iva;

?>

REF. CANT. DESCRIPCION PRECIO UNIT. PRECIO TOTAL
SUBTOTAL
IVA ()%
TOTAL
`

ActSonarQube

Presentado por:
Angie Paola Garzon Monroy
Diana Esperanza Moreno
Nicolas Alejandro Cardoso
Ing.Software II

(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.turbojs = factory();
}
}(this, function () {

// turbo.js
// (c) turbo - github.com/turbo
// MIT licensed

"use strict";

// Mozilla reference init implementation
var initGLFromCanvas = function(canvas) {
	var gl = null;
	var attr = {alpha : false, antialias : false};

	// Try to grab the standard context. If it fails, fallback to experimental.
	gl = canvas.getContext("webgl", attr) || canvas.getContext("experimental-webgl", attr);

	// If we don't have a GL context, give up now
	if (!gl)
		throw new Error("turbojs: Unable to initialize WebGL. Your browser may not support it.");

	return gl;
}

var gl = initGLFromCanvas(document.createElement('canvas'));

// turbo.js requires a 32bit float vec4 texture. Some systems only provide 8bit/float
// textures. A workaround is being created, but turbo.js shouldn't be used on those
// systems anyway.
if (!gl.getExtension('OES_texture_float'))
	throw new Error('turbojs: Required texture format OES_texture_float not supported.');

// GPU texture buffer from JS typed array
function newBuffer(data, f, e) {
	var buf = gl.createBuffer();

	gl.bindBuffer((e || gl.ARRAY_BUFFER), buf);
	gl.bufferData((e || gl.ARRAY_BUFFER), new (f || Float32Array)(data), gl.STATIC_DRAW);

	return buf;
}

var positionBuffer = newBuffer([ -1, -1, 1, -1, 1, 1, -1, 1 ]);
var textureBuffer  = newBuffer([  0,  0, 1,  0, 1, 1,  0, 1 ]);
var indexBuffer    = newBuffer([  1,  2, 0,  3, 0, 2 ], Uint16Array, gl.ELEMENT_ARRAY_BUFFER);

var vertexShaderCode =
"attribute vec2 position;\n" +
"varying vec2 pos;\n" +
"attribute vec2 texture;\n" +
"\n" +
"void main(void) {\n" +
"  pos = texture;\n" +
"  gl_Position = vec4(position.xy, 0.0, 1.0);\n" +
"}"

var stdlib =
"\n" +
"precision mediump float;\n" +
"uniform sampler2D u_texture;\n" +
"varying vec2 pos;\n" +
"\n" +
"vec4 read(void) {\n" +
"  return texture2D(u_texture, pos);\n" +
"}\n" +
"\n" +
"void commit(vec4 val) {\n" +
"  gl_FragColor = val;\n" +
"}\n" +
"\n" +
"// user code begins here\n" +
"\n"

var vertexShader = gl.createShader(gl.VERTEX_SHADER);

gl.shaderSource(vertexShader, vertexShaderCode);
gl.compileShader(vertexShader);

// This should not fail.
if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS))
	throw new Error(
		"\nturbojs: Could not build internal vertex shader (fatal).\n" + "\n" +
		"INFO: >REPORT< THIS. That's our fault!\n" + "\n" +
		"--- CODE DUMP ---\n" + vertexShaderCode + "\n\n" +
		"--- ERROR LOG ---\n" + gl.getShaderInfoLog(vertexShader)
	);

// Transfer data onto clamped texture and turn off any filtering
function createTexture(data, size) {
	var texture = gl.createTexture();

	gl.bindTexture(gl.TEXTURE_2D, texture);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
	gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size, size, 0, gl.RGBA, gl.FLOAT, data);
	gl.bindTexture(gl.TEXTURE_2D, null);

	return texture;
}

return {
	// run code against a pre-allocated array
	run : function(ipt, code) {
		var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);

		gl.shaderSource(
			fragmentShader,
			stdlib + code
		);

		gl.compileShader(fragmentShader);

		// Use this output to debug the shader
		// Keep in mind that WebGL GLSL is **much** stricter than e.g. OpenGL GLSL
		if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
			var LOC = code.split('\n');
			var dbgMsg = "ERROR: Could not build shader (fatal).\n\n------------------ KERNEL CODE DUMP ------------------\n"

			for (var nl = 0; nl < LOC.length; nl++)
				dbgMsg += (stdlib.split('\n').length + nl) + "> " + LOC[nl] + "\n";

			dbgMsg += "\n--------------------- ERROR  LOG ---------------------\n" + gl.getShaderInfoLog(fragmentShader)

			throw new Error(dbgMsg);
		}

		var program = gl.createProgram();

		gl.attachShader(program, vertexShader);
		gl.attachShader(program, fragmentShader);
		gl.linkProgram(program);

		if (!gl.getProgramParameter(program, gl.LINK_STATUS))
			throw new Error('turbojs: Failed to link GLSL program code.');

		var uTexture = gl.getUniformLocation(program, 'u_texture');
		var aPosition = gl.getAttribLocation(program, 'position');
		var aTexture = gl.getAttribLocation(program, 'texture');

		gl.useProgram(program);

		var size = Math.sqrt(ipt.data.length) / 4;
		var texture = createTexture(ipt.data, size);

		gl.viewport(0, 0, size, size);
		gl.bindFramebuffer(gl.FRAMEBUFFER, gl.createFramebuffer());

		// Types arrays speed this up tremendously.
		var nTexture = createTexture(new Float32Array(ipt.data.length), size);

		gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, nTexture, 0);

		// Test for mobile bug MDN->WebGL_best_practices, bullet 7
		var frameBufferStatus = (gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE);

		if (!frameBufferStatus)
			throw new Error('turbojs: Error attaching float texture to framebuffer. Your device is probably incompatible. Error info: ' + frameBufferStatus.message);

		gl.bindTexture(gl.TEXTURE_2D, texture);
		gl.activeTexture(gl.TEXTURE0);
		gl.uniform1i(uTexture, 0);
		gl.bindBuffer(gl.ARRAY_BUFFER, textureBuffer);
		gl.enableVertexAttribArray(aTexture);
		gl.vertexAttribPointer(aTexture, 2, gl.FLOAT, false, 0, 0);
		gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
		gl.enableVertexAttribArray(aPosition);
		gl.vertexAttribPointer(aPosition, 2, gl.FLOAT, false, 0, 0);
		gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
		gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0);
		gl.readPixels(0, 0, size, size, gl.RGBA, gl.FLOAT, ipt.data);
		//                                 ^ 4 x 32 bit ^

		return ipt.data.subarray(0, ipt.length);
	},
	alloc: function(sz) {
		// A sane limit for most GPUs out there.
		// JS falls apart before GLSL limits could ever be reached.
		if (sz > 16777216)
			throw new Error("turbojs: Whoops, the maximum array size is exceeded!");

		var ns = Math.pow(Math.pow(2, Math.ceil(Math.log(sz) / 1.386) - 1), 2);
		return {
			data : new Float32Array(ns * 16),
			length : sz
		};
	}
};

}));

internal class Program
{
    private static void Main()
    {
        
    }
}

}

Andrea Daza- Oscar Peña- Sebastian Cardenas

package array_registros;
import java.io.;
import javax.swing.
;
import java.util.*;

public class operaciones
{
ImageIcon img=new ImageIcon(getClass().getResource("/imagen/reg.png"));
ImageIcon img2=new ImageIcon(getClass().getResource("/imagen/modi.jpg"));
ImageIcon img3=new ImageIcon(getClass().getResource("/imagen/elim.jpg"));
static int salida;
static String op;
static ArrayList struct=new ArrayList();
int i,mat;
String nom;
String matri;
String carre;

/********************************************************************************************/
void princi() throws IOException
{
    String[] menu= { "1.CAPTURAR","2.CONSULTAR","3.MODIFICAR","4.ELIMINAR","5.SALIR"};
    
    do {
        do {
    op=(String)JOptionPane.showInputDialog(null,"REGISTROS","Menu",JOptionPane.DEFAULT_OPTION,img,menu,menu[0]);
    if(op==null)
    {
        princi();
    }
    else
    
    switch (op.charAt(0)) 
    {
        case '1': captura();break;
        case '2': consultar();break;
        case '3': Modificar();break;
        case '4': eliminar();break;
        case '5':
            salida=JOptionPane.showConfirmDialog(null, "¿Esta seguro?", "Alerta!", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
            if(salida==0){
            System.exit(0);
            }
            if(salida!=0){
            princi();
            }
            break;
    }
        } while (salida == 1);
    } while(op.charAt(0) != '5'); 
}
/*********************************************************************************************/



/*********************************************************************************************/

void captura() throws IOException
{
matri = JOptionPane.showInputDialog (null, "Matricula: ","Registros",JOptionPane.PLAIN_MESSAGE);
mat=Integer.parseInt(matri);
boolean contenido=struct.contains(mat);
BufferedReader bf = new BufferedReader(new FileReader("archi.txt"));
for( i=0;i<struct.size();i++)
{
if(mat==struct.get(i).getMatricula() )
{
contenido=true;
break;
}
}
if(contenido==true)
{
JOptionPane.showMessageDialog(null,"MATRICULA EXISTENTE","Error",JOptionPane.ERROR_MESSAGE);
princi();
}
if(contenido==false)
{
nom = JOptionPane.showInputDialog (null, "Nombre: ","Registro "+(i+1),JOptionPane.PLAIN_MESSAGE);
carre = JOptionPane.showInputDialog (null, "Carrera: ","Registro "+(i+1),JOptionPane.PLAIN_MESSAGE);

  struct.add(new Variables (mat,carre,nom));

  
    guarda();}

}
/*********************************************************************************************/

/*********************************************************************************************/

void consultar()
{
int op2;

        String[] options = {"Listar","Consultar","Volver"};
    do {
        do {
            op2 = JOptionPane.showOptionDialog(null, "Seleccione la Opcion que desee", "Menu Consultar", JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE,img, options, options[0]);
            switch (op2) 
            {
                case 0:listar();break;
                case 1:B_avanzada();break;
                case 2:
                    salida = JOptionPane.showConfirmDialog(null, "¿Desea Volver al Menu principal?", "Alerta!", JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE, img);
                    break;    
            }
        } while (salida == 1);
    } while (op2 != 2);
       
}
/*********************************************************************************************/




/*********************************************************************************************/

void listar()
{
for(int i=0;i<struct.size();i++)
{
JOptionPane.showMessageDialog(null,"Matricula: "+struct.get(i).getMatricula()+"\nNombre: "+struct.get(i).getNombre()
+"\nCarrera: "+struct.get(i).getCarrera(),"Registro "+(i+1),JOptionPane.PLAIN_MESSAGE);
}

}
/*********************************************************************************************/



/*********************************************************************************************/

void B_avanzada()
{
String matri = JOptionPane.showInputDialog (null, "Matricula: ","Busqueda",JOptionPane.PLAIN_MESSAGE);
mat=Integer.parseInt(matri);

    boolean asd=struct.contains(mat);
    
    for( i=0;i<struct.size();i++)
    {
        if(mat==struct.get(i).getMatricula())
        {
            asd=true;
            break;
        }
    }
    
    if(asd==true)
    {
        JOptionPane.showMessageDialog(null,"Matricula: "+struct.get(i).getMatricula()+"\nNombre: "+struct.get(i).getNombre()
        +"\nCarrera: "+struct.get(i).getCarrera(),"Registro "+(i+1),JOptionPane.PLAIN_MESSAGE);
    }
    
    if(asd==false)
    {
        JOptionPane.showMessageDialog(null,"MATRICULA NO EXISTENTE","Error",JOptionPane.ERROR_MESSAGE);
    }   
            
}
/*********************************************************************************************/
 


void Modificar() throws IOException
{
    String matri = JOptionPane.showInputDialog (null, "Matricula: ","Busqueda",JOptionPane.PLAIN_MESSAGE);
    int mat=Integer.parseInt(matri);
    boolean contenido=struct.contains(mat);
    for( i=0;i<struct.size();i++)
    {
        if(mat==struct.get(i).getMatricula())
        {
            contenido=true;
            break;
        }
    }
    if(contenido==true)
    {
        JOptionPane.showMessageDialog(null,"Matricula: "+struct.get(i).getMatricula()+"\nNombre: "+struct.get(i).getNombre()
         +"\nCarrera: "+struct.get(i).getCarrera(),"Registro "+(i+1),JOptionPane.PLAIN_MESSAGE);
        
    String[] menu= { "1.MATRICULA","2.NOMBRE","3.CARRERA","4.VOLVER"};
    String op;
    do {
        do {
    op=(String)JOptionPane.showInputDialog(null,"¿QUE DESEA MODIFICAR?","Menu de Modificacion",JOptionPane.DEFAULT_OPTION,img2,menu,menu[0]);
    if(op==null)
    {
        princi();
    }
    else
    
    switch (op.charAt(0)) 
    {
        case '1':
            
            String N_matri="";
              
            N_matri = JOptionPane.showInputDialog(null, "Ingrese nueva matricula: ","",JOptionPane.PLAIN_MESSAGE);
            int N=Integer.parseInt(N_matri);
            boolean contenido2=struct.contains(N_matri);
            
            for( i=0;i<struct.size();i++)
            {
             if(struct.get(i).getMatricula()==N)
                {
                contenido2=true;
                break;
                }
            }   
            if(contenido2==true)
                {
                    JOptionPane.showMessageDialog(null,"MATRICULA EXISTENTE","Error",JOptionPane.ERROR_MESSAGE);
                    princi();
                }
            if(contenido2==false)
                {
                    JOptionPane.showMessageDialog(null,"MODIFICACION EXITOSA","Bien",JOptionPane.PLAIN_MESSAGE);
                    for(int i=0; i<struct.size(); i++)
                    {
                        if(struct.get(i).matricula==mat)
                        {
                          struct.get(i).setMatricula(N);
                          guarda();
                        }
                    }
                }
            break;
            
        case '2':
            
            String N_nom="";
            for(int i=0; i<struct.size(); i++)
            {
                if(struct.get(i).matricula==mat)
                {
                    N_nom = JOptionPane.showInputDialog(null, "Ingrese nuevo Nombre: ","",JOptionPane.PLAIN_MESSAGE);
                    struct.get(i).setNombre(N_nom);
                    guarda();
                } 
            }
            break;
        case '3':
            String N_carre="";
            for(int i=0; i<struct.size(); i++)
            {
                if(struct.get(i).matricula==mat)
                {
                    N_carre = JOptionPane.showInputDialog(null, "Ingrese nueva Carrera: ","",JOptionPane.PLAIN_MESSAGE);
                    struct.get(i).setCarrera(N_carre);
                    guarda();
                }
            }
            break;
        case '4': 
            salida=JOptionPane.showConfirmDialog(null, "¿Esta seguro?", "Alerta!", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
            if(salida==0){
            princi();
            }
            if(salida!=0){
            Modificar();
            }
            break;
    }
        } while (salida == 1);
    } while(op.charAt(0) != '4');
        
    }
    if(contenido==false)
    {
        JOptionPane.showMessageDialog(null,"MATRICULA NO EXISTENTE","Error",JOptionPane.ERROR_MESSAGE);
    } 

}
/*********************************************************************************************/


void eliminar() throws IOException
{
    int op;
    String[] menu= { "ELIMINAR TODO","ELIMINAR REGISTRO","VOLVER"}; 
    do {

    op = JOptionPane.showOptionDialog(null, "Seleccione la Opcion que desee", "Menu Consultar", JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE,img3, menu, menu[0]);
    
    
        
 

    
    do {

    switch (op) 
    {
        case 0:      
            
            struct.removeAll(struct);
            JOptionPane.showMessageDialog(null,"ELIMINADO CON EXITO","BIEN",JOptionPane.PLAIN_MESSAGE);
            break;
            
        case 1:
            
        String matri = JOptionPane.showInputDialog (null, "Matricula: ","Busqueda",JOptionPane.PLAIN_MESSAGE);
        int mat=Integer.parseInt(matri);
        boolean contenido=struct.contains(mat);
        for( i=0;i<struct.size();i++)
        {
            if(mat==struct.get(i).getMatricula())
            {
                contenido=true;
                break;
            }
        }
        if(contenido==true)
        {
            JOptionPane.showMessageDialog(null,"Matricula: "+struct.get(i).getMatricula()+"\nNombre: "+struct.get(i).getNombre()
             +"\nCarrera: "+struct.get(i).getCarrera(),"Registro "+(i+1),JOptionPane.PLAIN_MESSAGE);
            
            for(i=0;i<struct.size();i++)
            {
                if(struct.get(i).matricula==mat)
                {
                struct.remove(i);
                JOptionPane.showMessageDialog(null,"ELIMINADO CON EXITO","BIEN",JOptionPane.PLAIN_MESSAGE);
                }
            }
            break;
        } 
        if(contenido==false)
        {
            JOptionPane.showMessageDialog(null,"MATRICULA NO EXISTENTE","Error",JOptionPane.ERROR_MESSAGE);
        }
        break;
        
        case 2: 
            salida=JOptionPane.showConfirmDialog(null, "¿Esta seguro?", "Alerta!", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
            if(salida==0){
            princi();
            }
            if(salida!=0){
            eliminar();
            }
            break;
        }
      } while (salida == 1);
    } while(op!= 3);      
}

void guarda()
{

  try
    {
      //FileWriter re=new FileWriter("archi.txt");
      //for(int i=0;i<struct.size();i++)
      //{
      FileWriter re = new FileWriter("archi.txt", true);
      re.write(struct.get(i).matricula+" "+struct.get(i).nombre+" "+struct.get(i).carrera+"\r\n");
      //}
    re.close();
    }
    catch(Exception e){
        e.printStackTrace();
    }
  /*File TextFile = new File("EstadoVentanilla.txt"); 
    FileWriter TextOut = new FileWriter(TextFile, true);
    //TextOut.write("Prueba de Grabación de Archivo_4\r\n");
    TextOut.write("Prueba de Grabación de Archivo_2\r\n");
    TextOut.close();*/

}

void lee() throws FileNotFoundException, IOException
{
BufferedReader bf = new BufferedReader(new FileReader("archi.txt"));

    String sCadena;
    while ((sCadena = bf.readLine())!=null) {
    System.out.println(sCadena);
    }

}
}

Prueb2

Angie Paola Garzon Monroy
Diana Esperanza Moreno
Nicolas Alejandro Cardoso Daza

/*

  • To change this template, choose Tools | Templates
  • and open the template in the editor.
    */
    package facturacion;

import javax.swing.table.DefaultTableModel;

/**
*

  • @author elaprendiz http://www.youtube.com/user/JleoD7
    */
    public class Interfaz_buscarclientes extends javax.swing.JInternalFrame {

    private Object[][] datostabla;
    control_existencias ctr = new control_existencias();
    public Interfaz_buscarclientes() {
    initComponents();
    mostrar_tabla();

    }

    public void mostrar_tabla(){
    control_cliente control = new control_cliente("Documento","Tipo de documento","Nombres","Apellidos","Direccion","Ciudad","telefono");
    String[] columnas = {"Documento","Tipo de documento","Nombres","Apellidos","Direccion","Ciudad","Telefono"};
    datostabla = control.consulta_clientes();
    DefaultTableModel datos = new DefaultTableModel(datostabla,columnas);
    jTable1.setModel(datos);

}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
//
private void initComponents() {

    jScrollPane1 = new javax.swing.JScrollPane();
    jTable1 = new javax.swing.JTable();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    buscarcliente = new javax.swing.JTextField();

    setIconifiable(true);
    setMaximizable(true);
    setResizable(true);
    setTitle("Buscar clientes");

    jTable1.setModel(new javax.swing.table.DefaultTableModel(
        new Object [][] {
            {},
            {},
            {},
            {}
        },
        new String [] {

        }
    ));
    jScrollPane1.setViewportView(jTable1);

    jButton1.setText("Salir");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });

    jButton2.setText("Buscar");
    jButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
        }
    });

    buscarcliente.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            buscarclienteActionPerformed(evt);
        }
    });
    buscarcliente.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyReleased(java.awt.event.KeyEvent evt) {
            buscarclienteKeyReleased(evt);
        }
    });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addGap(29, 29, 29)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(46, 46, 46)
                    .addComponent(buscarcliente, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(233, 233, 233)
                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGroup(layout.createSequentialGroup()
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1183, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 34, Short.MAX_VALUE))))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(buscarcliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jButton2)
                .addComponent(jButton1))
            .addGap(27, 27, 27))
    );

    pack();
}// </editor-fold>                        

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
this.dispose();
}                                        

private void buscarclienteActionPerformed(java.awt.event.ActionEvent evt) {                                              

}                                             

private void buscarclienteKeyReleased(java.awt.event.KeyEvent evt) {                                          

}                                         

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
String[] columnas = {"Documento","Tipo de documento","Nombres","Apellidos","Direccion","Ciudad","Telefono"};
    datostabla = ctr.datos_cliente(buscarcliente.getText());
    DefaultTableModel datostcli = new DefaultTableModel(datostabla,columnas);
    jTable1.setModel(datostcli);
    buscarcliente.setText("");
}                                        

// Variables declaration - do not modify                     
private javax.swing.JTextField buscarcliente;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTable1;
// End of variables declaration                   

}

Ejercicio

//<?php
//function loader($class)
//{
// $file = $class . '.php';
//if (file_exists($file)) {
// require $file;
//}
//}
//spl_autoload_register('loader');

Codigo sonarqube

<script type="text/javascript"> function vaciar(control) { control.value=''; } function verificarEntrada(control) { if (control.value=='') alert('Debe ingresar datos'); } </script>

Codigo.js

//Criollo_Sandoval_Novoa
// Karma configuration
// Generated on Tue Mar 24 2015 04:20:15 GMT-0700 (Pacific Daylight Time)
// TODO: copy test file from javascript repo and invoke it in angular environment
export default (config) => {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai', 'sinon-chai'],


// list of files / patterns to load in the browser
files: [
  '../dist/titanium/pubnub.js',
  '../resources/titanium/titanium.js',
  '../test/dist/web-titanium.test.js'
],

// list of files to exclude
exclude: [
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: { 'dist/*.js': ['coverage'] },

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['spec', 'coverage'],


// web server port
port: 9898,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,

browserDisconnectTimeout: 20000,
browserNoActivityTimeout: 20000,

coverageReporter: {
  // specify a common output directory
  dir: 'coverage',
  reporters: [
    // reporters not supporting the `file` property
    { type: 'html' },
    { type: 'text-summary' },
    { type: 'lcov' }
  ]
}

});
};

Prueba

connect_errno) { die( "Fallo la conexión a MySQL: (" . $mysqli -> mysqli_connect_errno() . ") " . $mysqli -> mysqli_connect_error()); } if($link){ mysqli_select_db($link,"academ"); } //TRAYENDO LA FOTO DE LA BASE DE DATOS $query ="Select * FROM tbautos"; $resultado=$conexion->query($query); while($row = $resultado-> fetch_assoc()){ ?>
REFERENCIA MODELO COLOR PRECIO MARCA
";
?>
"; ?> ";

?>

";
?>
"; ?>
	<img src="data:image/jpg;base64,<?php echo base64_encode($row['Foto']); ?>"/>
	
</DIV>	
	
	<?php

}
//-----------------------------------FIN TRAYENDO FOTO
mysqli_close($conexion);
?>

pryecto_Miguel_pacheco_Eliana_Vargas_Elizabeth_Velasquez.cpp

//INTEGRANTES********
//ELIZABETH VELASQUEZ MAHECHA
//ELIANA VARGAS MONTENEGRO
//MIGUEL ANGEL PACHECO ALFONSO
//**********************************************************************
#include
#include
#include "stdio.h"
#include "string.h"

using namespace std;

int main()
{
int n;
int vocal=0;
char palabra[20];
char *p;
p=new char[n];
p = palabra;
cout<<"ingrese la palabra: ";
cin>>palabra;
n=strlen(p);

cout<<endl;
cout<<endl;
cout<<endl;

for(int c=0;c<=n;c++)
{
    cout<<*(p+c)<<endl;
}

for(int c=0;c<=n;c++)
{
    if(*(p+c)=='a')
    {
        vocal++;
    }
    else if(*(p+c)=='e')
    {
        vocal++;
    }
    else if(*(p+c)=='i')
    {
        vocal++;
    }
    else if(*(p+c)=='o')
    {
        vocal++;
    }
    else if(*(p+c)=='u')
    {
        vocal++;
    }
}

cout<<endl;
cout<<"numero de vocales: "<<vocal<<endl;

return 0;

}

andres alfaro-jeisson cortes -carlos poveda prueba.js

(function() {
Leap.Controller.plugin('proximityAlert', function(scope) {
var activeOscillator, context, distanceFromSegment, masterGain, oscillate, panner, playBeep, playContinuous, playingUntil, setPannerPosition, silence;
if (scope == null) {
scope = {};
}
scope.beepFrq || (scope.beepFrq = 1318.51);
scope.continuousFrq || (scope.continuousFrq = 1396.91);
scope.waveType || (scope.waveType = 0);
scope.beepDuration || (scope.beepDuration = function(distance) {
return Math.pow(0.7 - distance, 3);
});
scope.minBeepDuration || (scope.minBeepDuration = 0.02);
context = new webkitAudioContext();
panner = context.createPanner();
masterGain = context.createGain();
masterGain.connect(context.destination);
panner.connect(masterGain);
scope.setVolume = function(value) {
return masterGain.gain.value = value;
};
oscillate = function(freq, duration) {
var oscillator;
oscillator = context.createOscillator();
oscillator.type = scope.waveType;
oscillator.connect(panner);
oscillator.frequency.value = freq;
oscillator.start(0);
if (duration) {
oscillator.stop(context.currentTime + duration);
}
return oscillator;
};
playingUntil = void 0;
activeOscillator = void 0;
playBeep = function(freq, duration) {
var spacing;
spacing = duration / 2;
if (playingUntil === Infinity) {
activeOscillator.stop(0);
activeOscillator = null;
} else if (context.currentTime < playingUntil) {
return;
}
activeOscillator = oscillate(freq, duration);
return playingUntil = context.currentTime + duration + spacing;
};
playContinuous = function(freq) {
if (context.currentTime < playingUntil) {
return;
}
activeOscillator = oscillate(freq);
activeOscillator.continuous = true;
return playingUntil = Infinity;
};
silence = function() {
if (activeOscillator && activeOscillator.continuous) {
activeOscillator.stop(0);
activeOscillator = void 0;
return playingUntil = void 0;
}
};
distanceFromSegment = function(number, range) {
if (number > range[1]) {
return number - range[1];
}
if (number < range[0]) {
return range[0] - number;
}
return false;
};
setPannerPosition = function(hand) {
return panner.setPosition(hand.stabilizedPalmPosition[0] / 100, hand.stabilizedPalmPosition[1] / 100, hand.stabilizedPalmPosition[2] / 100);
};
this.on('handLost', function() {
return silence();
});
return {
hand: function(hand) {
var distance, duration, iBox, proximities, proximity, _i, _len;
if (!(iBox = hand.frame.interactionBox)) {
return;
}
proximities = iBox.normalizePoint(hand.palmPosition);
for (_i = 0, _len = proximities.length; _i < _len; _i++) {
proximity = proximities[_i];
if ((distance = distanceFromSegment(proximity, [0, 1]))) {
hand.proximity = true;
setPannerPosition(hand);
duration = scope.beepDuration(distance);
if (duration < scope.minBeepDuration) {
playContinuous(scope.continuousFrq);
} else {
playBeep(scope.beepFrq, duration);
}
return;
}
}
return silence();
}
};
});

}).call(this);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.