Ejemplo n.º 1
0
        static void StringF()
        {
            string NOM;
            byte   K;

            Console.Write("DIGITE SU NOMBRE : "); NOM = Console.ReadLine();
            Console.WriteLine("LONGITUD : " + NOM.Length);                    //longitud
            Console.WriteLine("ESTA DENTRO : " + NOM.Contains("ARIEL"));      //bool contiene subcadena
            Console.WriteLine("REEMPLAZO VOCAL A: " + NOM.Replace("A", "X")); //reemplaza caracter
            Console.WriteLine("EN MINUSCULAS : " + NOM.ToLower());            //transforma a minusculas
            Console.WriteLine("EN MAYÚSCULAS : " + NOM.ToUpper());            //transforma a mayuscula
            Console.WriteLine("REMOVER 4 LETRAS : " + NOM.Remove(3, 4));      // remueve los caracteres entre los indices
            Console.WriteLine("EXTRAER 4 LETRAS : " + NOM.Substring(3, 4));   //devuelve la cadena entre los indices
            Console.WriteLine("IZQUIERDA 4 LETRAS : " + Extras.Left(NOM, 4)); //llama la funcion left
            Console.WriteLine("DERECHA 4 LETRAS : " + Extras.Right(NOM, 4));  //llama la funcion right
            Console.Write("Pulse una Tecla:"); Console.ReadLine();
            Console.WriteLine();
            Console.WriteLine("DESDE LA IZQUIERDA");
            for (K = 1; K <= NOM.Length; K++)
            {
                Console.WriteLine(Extras.Left(NOM, K));
            }
            Console.WriteLine();
            Console.WriteLine("DESDE LA DERECHA");
            for (K = 1; K <= NOM.Length; K++)
            {
                Console.WriteLine(Extras.Right(NOM, K));
            }
            Console.WriteLine("pulse una tecla:"); Console.ReadKey(); Console.Clear();
        }
Ejemplo n.º 2
0
        public static void MovCCV()
        {
            string NOM;
            string CAR;
            int    K  = 0;
            int    P  = 0;
            int    CI = 0;

            Console.Write("SU NOMBRE ES: ");
            NOM = Console.ReadLine();
            Console.Clear();
            Console.SetCursorPosition(25, 1);
            Console.Write(NOM);
            CI  = 25;
            NOM = NOM.ToUpper();
            for (P = 1; P <= NOM.Length; P++)
            {
                CAR = Extras.Mid(NOM, P - 1, 1);
                for (K = 1; K <= 22; K++)
                {
                    Console.SetCursorPosition(CI, K);
                    Console.Write(CAR);
                    // REALIZAMOS UNA PAUSA
                    System.Threading.Thread.Sleep(50);
                    Console.SetCursorPosition(CI, K);
                    Console.Write(" ");
                }
                Console.SetCursorPosition(CI, K);
                Console.Write(CAR);
                CI = CI + 1;
            }
            Console.WriteLine();
            Console.Write("Pulse una Tecla:");
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            string NOM;
            byte   K;

            Console.Write("DIGITE SU NOMBRE : "); NOM = Console.ReadLine();
            Console.WriteLine("LONGITUD : " + NOM.Length);
            Console.WriteLine("ESTA DENTRO : " + NOM.Contains("ARIEL"));
            Console.WriteLine("REEMPLAZO VOCAL A: " + NOM.Replace("A", "X"));
            Console.WriteLine("EN MINUSCULAS : " + NOM.ToLower());
            Console.WriteLine("EN MAYÚSCULAS : " + NOM.ToUpper());
            Console.WriteLine("REMOVER 4 LETRAS : " + NOM.Remove(3, 4));
            Console.WriteLine("EXTRAER 4 LETRAS : " + NOM.Substring(3, 4));
            Console.WriteLine("IZQUIERDA 4 LETRAS : " + Left(NOM, 4));
            Console.WriteLine("DERECHA 4 LETRAS : " + Right(NOM, 4));
            Console.Write("Pulse una Tecla:"); Console.ReadLine();
            Console.WriteLine();
            Console.WriteLine("DESDE LA IZQUIERDA");
            for (K = 1; K <= NOM.Length; K++)
            {
                Console.WriteLine(Left(NOM, K));
            }
            Console.WriteLine();
            Console.WriteLine("DESDE LA DERECHA");
            for (K = 1; K <= NOM.Length; K++)
            {
                Console.WriteLine(Right(NOM, K));
            }
            Console.Write("Pulse una Tecla:"); Console.ReadLine();
        }
Ejemplo n.º 4
0
        public static void MovCCH()
        {
            string NOM;
            string CAR;
            int    K  = 0;
            int    P  = 0;
            int    CI = 0;
            int    CF = 0;

            Console.Write("SU NOMBRE ES: ");
            NOM = Console.ReadLine();
            Console.SetCursorPosition(1, 12);
            Console.Write(NOM);
            CI  = NOM.Length;
            CF  = 70;
            NOM = NOM.ToUpper();
            for (P = NOM.Length; P >= 1; P--)
            {
                CAR = Extras.Mid(NOM, P - 1, 1);
                for (K = CI; K <= CF; K++)
                {
                    Console.SetCursorPosition(K, 12);
                    Console.Write(" " + CAR);
                    // REALIZAMOS UNA PAUSA
                    System.Threading.Thread.Sleep(50);
                }
                CF = CF - 1;
                CI = CI - 1;
            }
            Console.WriteLine();
            Console.Write("Pulse una Tecla:");
            Console.ReadKey();
        }
Ejemplo n.º 5
0
        private string getNewSBML()
        {
            var newValues = new List <Tuple <string, double> >();

            foreach (DataRow dataRow in (InternalDataCollectionBase)m_oParameterDataSet.Tables[0].Rows)
            {
                if ((bool)dataRow["enabled"])
                {
                    newValues.Add(new Tuple <string, double>((string)dataRow[0], (double)dataRow[3]));
                }
            }

            string result    = "";
            var    autoEvent = new AutoResetEvent(false);

            thread.QueueItem(() =>
            {
                NOM.loadSBML(m_sSBML);
                foreach (var newValue in newValues)
                {
                    NOM.setValue(newValue.Item1, newValue.Item2);
                }
                result = NOM.getSBML();
                autoEvent.Set();
            });
            autoEvent.WaitOne();
            return(result);
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            string NOM;
            string CAR;
            int    K  = 0;
            int    P  = 0;
            int    CI = 0;
            int    CF = 0;

            Console.Write("Ingrese su nombre: ");
            NOM = Console.ReadLine();
            Console.SetCursorPosition(1, 12);
            Console.Write(NOM);
            CI  = NOM.Length;
            CF  = 70;
            NOM = NOM.ToUpper();
            for (P = NOM.Length; P >= 1; P--)
            {
                CAR = Mid(NOM, P - 1, 1);
                for (K = CI; K <= CF; K++)
                {
                    Console.SetCursorPosition(K, 12);
                    Console.Write(" " + CAR);
                    Thread.Sleep(50);
                }
                CF = CF - 1;
                CI = CI - 1;
            }
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            string NOM;
            string CAR;
            int    K          = 0;
            int    P          = 0;
            int    longitud   = 0;
            int    Espderecha = 0;

            Console.Write("Ingrese su nombre: ");
            NOM = Console.ReadLine();
            Console.SetCursorPosition(1, 12);
            Console.Write(NOM);
            longitud   = NOM.Length;
            Espderecha = 25;
            NOM        = NOM.ToUpper();

            for (P = NOM.Length; P >= 1; P--)
            {
                CAR = Mid(NOM, P - 1, 1);
                for (K = longitud; K <= Espderecha; K++)
                {
                    Console.SetCursorPosition(K, 12);
                    Console.Write(" " + CAR);
                    Thread.Sleep(100);
                }
                Espderecha = Espderecha - 1;
                longitud   = longitud - 1;
            }
            Console.WriteLine();
        }
        static void Main(string[] args)
        {
            string NOM;
            int    K = 0;
            int    A = 0;
            int    E = 0;
            int    I = 0;
            int    O = 0;
            int    U = 0;
            string LE;

            Console.Write("DIGITE UNA FRASE : ");
            NOM = Console.ReadLine();
            A   = 0;
            E   = 0;
            I   = 0;
            O   = 0;
            U   = 0;
            for (K = 1; K < NOM.Length; K++)
            {
                NOM = NOM.ToUpper();
                LE  = Mid(NOM, K, 1);
                switch (LE)
                {
                case "A":
                    A = A + 1;
                    break;

                case "E":
                    E = E + 1;
                    break;

                case "I":
                    I = I + 1;
                    break;

                case "O":
                    O = O + 1;
                    break;

                case "U":
                    U = U + 1;
                    break;
                }
            }
            Console.WriteLine("EXISTEN {0} VOCALES A", A);
            Console.WriteLine("EXISTEN {0} VOCALES E", E);
            Console.WriteLine("EXISTEN {0} VOCALES I", I);
            Console.WriteLine("EXISTEN {0} VOCALES O", O);
            Console.WriteLine("EXISTEN {0} VOCALES U", U);
            Console.Write("Pulse una Tecla:");
            Console.ReadLine();
        }
Ejemplo n.º 9
0
        public static void CVocalesCerradas()
        {
            string NOM;
            int    K, SUM;
            string LE;

            Console.Write("DIGITE UNA FRASE : "); NOM = Console.ReadLine();
            SUM = 0;
            NOM = NOM.ToUpper();
            Console.Write(NOM);
            for (K = 1; K < NOM.Length; K++)
            {
                LE = Extras.Mid(NOM, K, 1);
                if (LE.Contains("U") || LE.Contains("I"))
                {
                    SUM = SUM + 1;
                }
            }
            Console.WriteLine("EXISTEN {0} VOCALES CERRADAS", SUM);
            Console.WriteLine("pulse una tecla:"); Console.ReadKey(); Console.Clear();
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            string NOM;
            int    K, SUM;
            string LE;

            Console.Write("DIGITE UNA FRASE : "); NOM = Console.ReadLine();
            SUM = 0;
            NOM = NOM.ToUpper();
            Console.Write(NOM);
            for (K = 1; K < NOM.Length; K++)
            {
                LE = Mid(NOM, K, 1);
                if (LE.Contains("U") || LE.Contains("I"))
                {
                    SUM = SUM + 1;
                }
            }
            Console.WriteLine("EXISTEN {0} VOCALES CERRADAS", SUM);
            Console.Write("Pulse una Tecla:"); Console.ReadLine();
        }
Ejemplo n.º 11
0
        public void loadSBML(string sSBML)
        {
            if (InvokeRequired)
            {
                Invoke(new loadSBMLDelegate(loadSBML), new object[1]
                {
                    sSBML
                });
            }
            else
            {
                thread.QueueItem(() =>
                {
                    m_sSBML = NOM.getParamPromotedSBML(sSBML);
                    NOM.loadSBML(m_sSBML);
                    ArrayList globalParameters   = NOM.getListOfParameters();
                    ArrayList boundarySpecies    = NOM.getListOfBoundarySpecies();
                    ArrayList floatingSpeciesIds = NOM.getListOfFloatingSpeciesIds();

                    UpdateUi(globalParameters, boundarySpecies, floatingSpeciesIds);
                });
            }
        }
Ejemplo n.º 12
0
        private void cmdSteadyState_Click(object sender, EventArgs e)
        {
            thread.QueueItem(() =>
            {
                if (m_sSBML != null)
                {
                    if (m_sSBML.Length > 0)
                    {
                        try
                        {
                            if (sim == null)
                            {
                                sim = new RoadRunner();
                            }

                            sim.loadSBML(m_sSBML);
                            sim.simulate();
                            double steadyState = sim.steadyState();
                            if (
                                MessageBox.Show(
                                    "Found steady state with sums of squares: " + steadyState +
                                    ". Do you want to use this state to be used?", "Steady state calculated",
                                    MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                            {
                                return;
                            }
                            sim.simulate();
                            ArrayList floatingSpeciesNames  = sim.getFloatingSpeciesNames();
                            double[] speciesConcentrations1 = sim.getFloatingSpeciesConcentrations();
                            ArrayList boundarySpeciesNames  = sim.getBoundarySpeciesNames();
                            double[] speciesConcentrations2 = sim.getBoundarySpeciesConcentrations();
                            ArrayList parameterTupleList    = sim.getAllGlobalParameterTupleList();
                            NOM.loadSBML(m_sSBML);
                            for (int index = 0; index < floatingSpeciesNames.Count; ++index)
                            {
                                NOM.setValue((string)floatingSpeciesNames[index], speciesConcentrations1[index]);
                            }
                            for (int index = 0; index < boundarySpeciesNames.Count; ++index)
                            {
                                NOM.setValue((string)boundarySpeciesNames[index], speciesConcentrations2[index]);
                            }
                            foreach (ArrayList arrayList in parameterTupleList)
                            {
                                NOM.setValue((string)arrayList[0], (double)arrayList[1]);
                            }
                            m_sSBML = NOM.getSBML();
                            loadSBML(m_sSBML);
                            return;
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show("Could not compute steady state due to: " + ex.Message,
                                            "Steady state could not be computed ...", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            return;
                        }
                    }
                }
                MessageBox.Show("There is no model to analyze. Load a model first.", "No Model loaded",
                                MessageBoxButtons.OK, MessageBoxIcon.Hand);
            });
        }