Tag:subroutine

  • The application of Perl subroutine and the importance of variable private (my) declaration in subroutine

    Time:2022-3-31

    A conversion program that simply converts a in the DNA sequence into t. in the first case, private variables are not used. Copy codeThe code is as follows: #!/bin/perl#Here is a DNA sequence$DNA=ATTATATAT;# Here is our sequence $result=A_to_T($DNA);  print “I changed all $DNA A to T, and the we get the result $result\n\n”;  sub A_to_T   […]

  • Reflection on the usage of Perl push and the return value of subroutine

    Time:2022-3-30

    Pop operation takes out the last element of the array and returns: @array=5..9;$fred=pop(@array); #$ Fred gets 9, @ array is now (5, 6, 7, 8)$barney= [email protected] ; #$ Barneygets8, @ array is now (5,6,7)[email protected] ; #@ Array is now (5, 6) (7 is discarded)In the last example, pop is used in “inavoid context”, that is, […]

  • Introduction to two reference (transfer) methods of parameters in subroutines in Perl

    Time:2022-3-4

    Here is an example: Copy codeThe code is as follows: use strict;#Here are two arrays my @i =(‘1′,’2′,’3’); my @j =(‘a’,’b’,’c’);   #Before processing, we print them out and have a look at them print “In main program before calling subroutine:i=”.”@i\n”; print “In main program before calling subroutine:j=”.”@j\n”; #Then we process it through subroutines reference_sub(@i,@j); […]

  • Perl function (subroutine) learning notes

    Time:2021-12-23

    1、 Function definition A subroutine is a separate piece of code that reduces duplication of code and makes the program easy to read In Perl, subroutines can appear anywhere in the program But it is usually placed at the beginning or end of the program   Copy codeThe code is as follows: sub subroutine{     […]

  • Learning notes of subroutines in Perl

    Time:2021-12-15

    1、 Definition Functions can be divided into system functions and user functions. A subroutine is a piece of separate code that performs a special task. It can reduce repeated code and make the program easy to read. In Perl, subroutines can appear anywhere in the program. The definition method is: Copy codeThe code is as […]

  • 186 key words and functions that must be mastered in learning programming (py form processing version)

    Time:2021-10-25

    Indexes english chinese explain effect 1 abstract class abstract class Abstract classes cannot create objects. They are mainly used to create subclasses. Abstract classes in Java are defined using the abstract modifier. 2 abstract data type ADT Abstract data type Abstract classes cannot create objects. They are mainly used to create subclasses. Abstract classes in […]

  • Piziheng embedded: using memtester program to test SDRAM on i.mxrt1060-evk

    Time:2021-4-24

    Hello everyone, I’m a ruffian Heng. I’m a serious technical ruffian. Today, ruffian Heng introduces to youUsing memtester program to test SDRAM on i.mxrt1060-evk。 We know that NXP i.mxrt1xxx series is the representative of high-performance MCU. For this monster with ultra-high dominant frequency (> = 500MHz), it’s a waste of its ability not to do […]

  • Application scenario analysis and code implementation of stack

    Time:2021-4-20

    Stack A practical requirement of stack Please enter an expression formula:[7*2*2-5+1-5+3-3]Click calculate [as shown in the figure below] Excuse me: how does the bottom layer of the computer calculate to get the result? Note that it’s not a simple list of formulas, because we look at formula 722 – 5, but how does the computer […]

  • package

    Time:2020-12-22

    Package can be arranged by using package. It contains two separate parts: package description (specification, header) and body (body). Both the package description and the package body are stored in the data dictionary. One obvious difference between packages and procedures and functions is that packages can only be stored in non local databases. To create […]

  • Python coroutine

    Time:2020-9-16

      Before the coroutine, we understand the process and thread of Python. Here, let’s talk about the coroutine Instead, the subroutine switches itself There is no overhead of thread switching. Compared with multithreading, the more threads there are, the more obvious the performance advantage of coprocessor There is no need for multi-threaded locking mechanism, because […]

  • Programming with PLSQL

    Time:2020-8-31

    Chapter 7  usePL/SQLprogramming Introduction to PL / SQL (procedure language & Structured Query Language) PL / SQL is a procedural extension of oracle on the standard SQL language. It allows embedded SQL statements, defines variables and constants, allows procedure language structures (conditional branch statements and loop statements) and allows exceptions to handle Oracle errors. It […]

  • Several common commands of window bat script

    Time:2020-6-8

    Window bat script Control statement if for set Basic identification Comment command rem :: symbol echo Echo off / on off or show echo @ @Putting the character before the command turns off echo of the command Parameter usage %I represents the parameters in the batch file %0 for batch itself, full path with extension […]