- Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
- Opcional: Si usamos Fetch API en el proyecto:
| create schema test; | |
| create table profesor | |
| ( | |
| facNo char(11) not null, | |
| facPrimerNombre varchar(30) null, | |
| fecApellidos varchar(30) null, | |
| facCiudad varchar(30) null, | |
| facEstado char(2) null, | |
| facCodigoPostal char(4) null, |
| package semana8; | |
| import javax.swing.JOptionPane; | |
| public class Semana8 { | |
| public static void main(String[] args) { | |
| int min, max; | |
| // request min and max | |
| min = Integer.parseInt(JOptionPane.showInputDialog("Ingrese el limite inferior")); |
| /** | |
| * Created by Awesometic | |
| * It's encrypt returns Base64 encoded, and also decrypt for Base64 encoded cipher | |
| * references: http://stackoverflow.com/questions/12471999/rsa-encryption-decryption-in-android | |
| */ | |
| import android.util.Base64; | |
| import java.nio.charset.StandardCharsets; | |
| import java.security.InvalidKeyException; | |
| import java.security.KeyFactory; |
| USE master | |
| GO | |
| SET NOCOUNT ON | |
| DECLARE @DBName varchar(50) | |
| DECLARE @spidstr varchar(8000) | |
| DECLARE @ConnKilled smallint | |
| SET @ConnKilled=0 | |
| SET @spidstr = '' | |
| CREATE PROCEDURE sp_addorupdateextendedproperty | |
| @name_ sysname, | |
| @value_ sql_variant = NULL, | |
| @level0type_ varchar(128) = NULL, | |
| @level0name_ sysname = NULL, | |
| @level1type_ varchar(128) = NULL, | |
| @level1name_ sysname = NULL, | |
| @level2type_ varchar(128) = NULL, | |
| @level2name_ sysname = NULL | |
| AS |
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import javax.servlet.http.HttpServletRequest; | |
| import org.json.JSONObject; | |
| public class HttpHelper { | |
| public static JSONObject getPayloadBody(HttpServletRequest request) throws IOException { | |
| String line; | |
| StringBuffer json = new StringBuffer(); |
| import java.math.BigDecimal; | |
| import java.math.RoundingMode; | |
| public class CurrencyFormat { | |
| public static String getCustomCurrency(double currency) { | |
| BigDecimal cc = new BigDecimal(currency); | |
| return cc.setScale(2, RoundingMode.HALF_UP).toString(); | |
| } | |
| var inBrowser = typeof window !== 'undefined'; | |
| var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform; | |
| var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase(); | |
| var UA = inBrowser && window.navigator.userAgent.toLowerCase(); | |
| var isIE = UA && /msie|trident/.test(UA); | |
| var isIE9 = UA && UA.indexOf('msie 9.0') > 0; | |
| var isEdge = UA && UA.indexOf('edge/') > 0; | |
| var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android'); | |
| var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios'); | |
| var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; |
| import org.json.JSONArray; | |
| import org.json.JSONObject; | |
| public class JSONRules { | |
| private static String errorRequired = "{} is required but not found in object."; | |
| private static String errorLength = "The value of {} exceeds the set length in rule."; | |
| private static String errorFormat = "The value of {} does not match with the format set."; | |
| public JSONRules() { |