+
                '
' +
                '
' +
                '' +
                cancelButtonTxt +
                '' +
                '' +
                okButtonTxt +
                '' +
                '
' +
                '

');
        confirmModal.find('#okButton').click(function (event) {
            //callback();
            deleteLegalBasisDo(brief);
            confirmModal.modal('hide');
        });
        confirmModal.modal('show');
	}
	function deleteLegalBasisDo(brief) {
		var xhr0 = new XMLHttpRequest();
		xhr0.open('DELETE', '/v1/lbasis/'+brief, true);
		xhr0.setRequestHeader("X-Bunker-Token", xtoken)
		xhr0.setRequestHeader('Content-type', 'application/json');
		xhr0.onload = function () {
			if (xhr0.status === 200) {
				$('#table2').bootstrapTable('refresh');
				$('#table').bootstrapTable('refresh');
			}
		}
		xhr0.send();
		return true;
	}
	function editProcessingActivity(activity) {
		var title0 = "Create new Processing Operation";
		if (activity) {
			title0 = "Change Processing Operation";
		}
		var applicableto = "";
		var fulldesc = "";
		var title = "";
		var code = "";
		if (activity) {
			for (jdx = 0; jdx < processingActivitiesList.length; jdx++) {
				if (processingActivitiesList[jdx].activity === activity) {
					applicableto = processingActivitiesList[jdx].applicableto;
					fulldesc = processingActivitiesList[jdx].fulldesc;
					title = processingActivitiesList[jdx].title;
					code = processingActivitiesList[jdx].script;
					break;
				}
			}
		} else {
			activity = "";
		}
        var form = `<form>

				Operation Unique Identifier *

					<input type="text" class="form-control" id="activity" aria-describedby="activityHelp" placeholder="Enter unique identifier" value="`+activity+`">
					Supported: a-z, 0-9, '-' chars. Start with a-z. Max 64 chars.

				Title

					<input type="text" class="form-control" id="title" placeholder="Processing operation title" value="`+title+`">

				Applicable to

					<input type="text" class="form-control" id="applicableto" placeholder="This activity is relevant for (ex. customers)" value="`+applicableto+`">

				Full desciption

					<textarea class="form-control" id="fulldesc" rows="2">`+fulldesc+`</textarea>

				<label for="code" cla


1, 0, 0};
    int count = steps(n, a);
    cout<<(count);
    return 0;
}

// This code is contributed by Rajput-Ji
```

## Java 语言(一种计算机语言，尤用于创建网站)

```
// Java implementation to find the
// minimum steps to make the array sum
// and the product not equal to zero
class GFG
{

// Function to to find the
// minimum steps to make the array sum
// and the product not equal to zero
static int steps(int n, int []a)
{

    // Variable to store the minimum
    // number of steps required
    int count_steps = 0;

    // Loop to iterate over the array to
    // find if there is any element in
    // array which is zero
    for(int i = 0; i < n; i++)
    {
        if(a[i] == 0)
        {
            a[i] += 1;
            count_steps += 1;
        }
    }

    // Condition to check if the sum
    // of array elements is zero
    if( sum(a) != 0)
        return count_steps;
    else
        return count_steps + 1;
}

static int sum(int[] arr)
{
    int sum = 0;
    for(int i= 0; i < arr.length; i++)
        sum += arr[i];
    return sum;
}

// Driver code
public static void main(String []args) {
    int n = 4;
    int []a = {-1, -1, 0, 0};
    int count = steps(n, a);
    System.out.println(count);
}
}

// This code is contributed by Rajput-Ji
```

## 计算机编程语言

```
# Python implementation to find the
# minimum steps to make the array sum
# and the product not equal to zero

# Function to to find the
# minimum steps to make the array sum
# and the product not equal to zero
def steps(n, a):

    # Variable to store the minimum
    # number of steps required
    count_steps = 0

    # Loop to iterate over the array to
    # find if there is any element in
    # array which is zero
    for i in range(n):
        if a[i]== 0:
            a[i] += 1
            count_steps += 1

    # Condition to check if the sum
    # of array elements is zero
    if sum(a)!= 0:
        return count_steps
    else:
        return count_steps + 1

# Driver code
if __name__ == "__main__":
    n = 4
    a = [-1, -1, 0, 0]
    count  = steps(n, a)
    print(count)
```

## C#

```
// C# implementation to find the
// minimum steps to make the array sum
// and the product not equal to zero
using System;

class GFG
{

// Function to to find the
// minimum steps to make the array sum
// and the product not equal to zero
static int steps(int n, int []a)
{

    // Variable to store the minimum
    // number of steps required
    int count_steps =


</summary>
        /// <returns>Returns true if the target is a joint target.</returns>
        bool IsJointTarget();

        /// <summary>
        /// Get the Run Type of a program to specify if a program made using the GUI will be run in simulation mode or on the real robot ("Run on robot" option).
        /// </summary>
        /// <returns>Returns ProgramExecutionType (Simulator or Robot).</returns>
        ProgramExecutionType GetRunType();

        /// <summary>
        /// Sets the linear acceleration of a robot in mm/s2
        /// </summary>
        /// <param name="value">Acceleration in mm/s2</param>
        void SetAcceleration(double value);

        /// <summary>
        /// Sets the joint acceleration of a robot
        /// </summary>
        /// <param name="value">Acceleration in deg/s2 for rotary joints and mm/s2 for linear joints</param>
        void SetAccelerationJoints(double value);

        /// <summary>
        /// Sets the joint speed of a robot
        /// </summary>
        /// <param name="value">Speed in deg/s for rotary joints and mm/s for linear joints</param>
        void SetSpeedJoints(double value);

        /// <summary>
        ///     Sets a link between this item and the specified item.
        ///     This is useful to set the relationship between programs, robots, tools and other specific projects.
        /// </summary>
        /// <param name="item">Item to link</param>
        void SetLink(IItem item);

        /// <summary>
        /// Wait until a program finishes or a robot completes its movement
        /// </summary>
        void WaitFinished();

        /// <summary>
        ///     Set a specific property name to a given value.
        ///     This is reserved for internal purposes and future compatibility.
        /// </summary>
        /// <param name="variableName">Property name</param>
        /// <param name="value">Property value</param>
        /// <returns></returns>
        Mat SetValue(string variableName, Mat value = null);

        /// <summary>
        ///     Set a specific property name to a given value.
        ///     This is reserved for internal purposes and future compatibility.
        /// <


 ```
    /// use std::f32;
    ///
    /// let positive = 4.0_f32;
    /// let negative = -4.0_f32;
    ///
    /// let abs_difference = (positive.sqrt() - 2.0).abs();
    ///
    /// assert!(abs_difference <= f32::EPSILON);
    /// assert!(negative.sqrt().is_nan());
    /// ```
    #[inline]
    fn sqrt(self) -> f32 {
        if self < 0.0 {
            NAN
        } else {
            unsafe { intrinsics::sqrtf32(self) }
        }
    }

    /// Returns `e^(self)`, (the exponential function).
    ///
    /// ```
    /// use std::f32;
    ///
    /// let one = 1.0f32;
    /// // e^1
    /// let e = one.exp();
    ///
    /// // ln(e) - 1 == 0
    /// let abs_difference = (e.ln() - 1.0).abs();
    ///
    /// assert!(abs_difference <= f32::EPSILON);
    /// ```
    #[inline]
    fn exp(self) -> f32 {
        // see notes above in `floor`
        #[cfg(target_env = "msvc")]
        return (self as f64).exp() as f32;
        #[cfg(not(target_env = "msvc"))]
        return unsafe { intrinsics::expf32(self) };
    }

    /// Returns `2^(self)`.
    ///
    /// ```
    /// use std::f32;
    ///
    /// let f = 2.0f32;
    ///
    /// // 2^2 - 4 == 0
    /// let abs_difference = (f.exp2() - 4.0).abs();
    ///
    /// assert!(abs_difference <= f32::EPSILON);
    /// ```
    #[inline]
    fn exp2(self) -> f32 {
        unsafe { intrinsics::exp2f32(self) }
    }

    /// Returns the natural logarithm of the number.
    ///
    /// ```
    /// use std::f32;
    ///
    /// let one = 1.0f32;
    /// // e^1
    /// let e = one.exp();
    ///
    /// // ln(e) - 1 == 0
    /// let abs_difference = (e.ln() - 1.0).abs();
    ///
    /// assert!(abs_difference <= f32::EPSILON);
    /// ```
    #[inline]
    fn ln(self) -> f32 {
        // see notes above in `floor`
        #[cfg(target_env = "msvc")]
        return (self as f64).ln() as f32;
        #[cfg(not(target_env = "msvc"))]
        return unsafe { intrinsics::logf32(self) };
    }

    /// Returns the logarithm of the number with respect to an arbitrary base.
    ///
    /// ```
    /// use std::f32;
    ///
    /// let ten = 10.0f32;
    /// let two = 2.0f32;
    ///
    /// // log10(10) - 1 == 0
    /// let abs_difference_10 = (ten.log(10.0) - 1.0).abs();
    ///
    /// // log2(2) - 1 == 0
    /// let abs_difference_2 = (two.log(2.0) - 1.0).abs();
    ///
    /// assert!(abs_difference_10 <= f32::EPSILON);
    /// assert!(abs_difference_2 <= f32::EPSILON);
    /// ```
    #[inline]
    fn log(self, base: f32) -> f32 {
        self.ln() / base.ln()
    }

    /// Returns the base 2 logarithm of the number.
    ///
    /// ```
    /// use std::f32;
    ///
    /// let two = 2.0f32;
    ///
    /// // log2(2) - 1 == 0
    /// let abs_difference = (two.log2() - 1.0)


a, b, x = map(int, input().split())
n, m = min(a, b), max(a, b)
v = (100 - x) / n
v += x / m
print(100 / v)


 hook that holds
// a lock.
func timeoutFlush(timeout time.Duration) {
	done := make(chan bool, 1)
	go func() {
		Flush() // calls logging.lockAndFlushAll()
		done <- true
	}()
	select {
	case <-done:
	case <-time.After(timeout):
		fmt.Fprintln(os.Stderr, "klog: Flush took longer than", timeout)
	}
}

// stacks is a wrapper for runtime.Stack that attempts to recover the data for all goroutines.
func stacks(all bool) []byte {
	// We don't know how big the traces are, so grow a few times if they don't fit. Start large, though.
	n := 10000
	if all {
		n = 100000
	}
	var trace []byte
	for i := 0; i < 5; i++ {
		trace = make([]byte, n)
		nbytes := runtime.Stack(trace, all)
		if nbytes < len(trace) {
			return trace[:nbytes]
		}
		n *= 2
	}
	return trace
}

// logExitFunc provides a simple mechanism to override the default behavior
// of exiting on error. Used in testing and to guarantee we reach a required exit
// for fatal logs. Instead, exit could be a function rather than a method but that
// would make its use clumsier.
var logExitFunc func(error)

// exit is called if there is trouble creating or writing log files.
// It flushes the logs and exits the program; there's no point in hanging around.
// l.mu is held.
func (l *loggingT) exit(err error) {
	fmt.Fprintf(os.Stderr, "log: exiting because of error: %s\n", err)
	// If logExitFunc is set, we do that instead of exiting.
	if logExitFunc != nil {
		logExitFunc(err)
		return
	}
	l.flushAll()
	os.Exit(2)
}

// syncBuffer joins a bufio.Writer to its underlying file, providing access to the
// file's Sync method and providing a wrapper for the Write method that provides log
// file rotation. There are conflicting methods, so the file cannot be embedded.
// l.mu is held for all its methods.
type syncBuffer struct {
	logger *loggingT
	*bufio.Writer
	file     *os.File
	sev      severity
	nbytes   uint64 // The number of bytes written to this file
	maxbytes uint64 // The max number of bytes this syncBuffer.file can hold before cleaning up.
}

func (sb *syncBuffer) Sync() error {
	return sb.file.Sync()
}

// CalculateMaxSize returns the real max size in bytes after considering the default max size and the flag options.
func CalculateMaxSize() uint64 {
	if logging.logFile != "" {
		if logging.logFileMaxSizeMB == 0 {
			// If logFileMaxSizeMB is zero, we don't have limitations on the log size.
			return math.MaxUint64
		}
		// Flag logFileMaxSizeMB is in MB for user convenience.
		return logging.logFileMaxSizeMB * 1024 * 1024
	}
	// If "log_file" flag is not specified, the target file (sb.file) will be cleaned up when reaches a fixed size.
	return MaxSize
}

func (sb *syncBuffer) Write(p []byte) (n int, err error) {
	if sb.nbytes+uint64(len(p)) >= sb.maxbytes {
		if err := sb.rotateFile(time.Now(), false); err != nil {
			sb.logger.exit(err)
		}
	}
	n, err = sb.Writer.Write(p)
	sb.nbytes += uint64(n)
	if err != nil {
		sb.logger.exit(err)
	}
	return
}

// rotateFile closes the syncBuffer's file and starts a new one.
// The


ું',advisoryContentType:'મુખ્ય કન્ટેન્ટ પ્રકાર',cssClasses:'સ્ટાઇલ-શીટ ક્લાસ',charset:'લિંક રિસૉર્સ કૅરિક્ટર સેટ',styles:'સ્ટાઇલ',selectAnchor:'ઍંકર પસંદ કરો',anchorName:'ઍંકર નામથી પસંદ કરો',anchorId:'ઍંકર એલિમન્ટ Id થી પસંદ કરો',emailAddress:'ઈ-મેલ સરનામું',emailSubject:'ઈ-મેલ વિષય',emailBody:'સંદેશ',noAnchors:'(ડૉક્યુમન્ટમાં ઍંકરની સંખ્યા)',noUrl:'લિંક  URL ટાઇપ કરો',noEmail:'ઈ-મેલ સરનામું ટાઇપ કરો'},anchor:{toolbar:'ઍંકર ઇન્સર્ટ/દાખલ કરવી',menu:'ઍંકરના ગુણ',title:'ઍંકરના ગુણ',name:'ઍંકરનું નામ',errorName:'ઍંકરનું નામ ટાઈપ કરો'},findAndReplace:{title:'શોધવું અને બદલવું',find:'શોધવું',replace:'રિપ્લેસ/બદલવું',findWhat:'આ શોધો',replaceWith:'આનાથી બદલો',notFoundMsg:'તમે શોધેલી ટેક્સ્ટ નથી મળી',matchCase:'કેસ સરખા રાખો',matchWord:'બઘા શબ્દ સરખા રાખો',matchCyclic:'Match cyclic',replaceAll:'બઘા બદલી ',replaceSuccessMsg:'%1 occurrence(s) replaced.'},table:{toolbar:'ટેબલ, કોઠો',title:'ટેબલ, કોઠાનું મથાળું',menu:'ટેબલ, કોઠાનું મથાળું',deleteTable:'કોઠો ડિલીટ/કાઢી નાખવું',rows:'પંક્તિના ખાના',columns:'કૉલમ/ઊભી કટાર',border:'કોઠાની બાજુ(બોર્ડર) સાઇઝ',align:'અલાઇનમન્ટ/ગોઠવાય


, 7
#elif defined (ON_BOARD_512M_DRAM_COMPONENT)
	ori t1, t1, 9
#elif defined (ON_BOARD_1024M_DRAM_COMPONENT)
	ori t1, t1, 9
#elif defined (ON_BOARD_2048M_DRAM_COMPONENT)
	ori	t1, t1, 9
#endif
#endif
	sw	t1, 0(t0)
	nop
#endif

#if defined(MT7620_FPGA_BOARD) || defined(MT7621_FPGA_BOARD)
	/* DDR initialization: DDR_CFG0 bit 12:0 (refresh interval) to 0x64
	 * Note. this may have a bad affect on efficiency if the clock rate is 40MHz
	 */
	li t1, RALINK_MEMCTRL_BASE + 0x40
	lw t2, 0(t1)
	nop
	and t2, ~(0xfff)
#if defined(ON_BOARD_DDR1)
	li t2, 0x21086141
#else
	or t2, 0x64
#endif
	sw t2, 0(t1)
	nop
#endif

#if 0
	/* data output (DQ) delay */
	li t1, RALINK_MEMCTRL_BASE + 0x60
	li t2, 0xffffffff
	sw t2, 0(t1)
	nop
	li t1, RALINK_MEMCTRL_BASE + 0x64
	li t2, 0xffffffff
	sw t2, 0(t1)
	nop
#endif

	/* DDR initialization: config size and width on reg DDR_CFG1
	 */
#if defined(ON_BOARD_DDR2)

#if defined(MT7620_ASIC_BOARD) || defined(MT7621_ASIC_BOARD)
#ifdef ON_BOARD_128M_DRAM_COMPONENT
        li t6, 0x222A3323
#elif defined (ON_BOARD_256M_DRAM_COMPONENT)
        li t6, 0x222e2323
#elif defined (ON_BOARD_512M_DRAM_COMPONENT)
        li t6, 0x22322323
#elif defined (ON_BOARD_1024M_DRAM_COMPONENT)
        li t6, 0x22362323
#elif defined (ON_BOARD_2048M_DRAM_COMPONENT)
		li t6, 0x223a2323
#else
        DRAM Component not defined
#endif
#elif defined(MT7620_FPGA_BOARD) || defined(MT7621_FPGA_BOARD)
#ifdef ON_BOARD_128M_DRAM_COMPONENT
        li t6, 0x122A3121
#elif defined (ON_BOARD_256M_DRAM_COMPONENT)
        li t6, 0x222e2323	//0x122E3121
#elif defined (ON_BOARD_512M_DRAM_COMPONENT)
        li t6, 0x12323121
#elif defined (ON_BOARD_1024M_DRAM_COMPONENT)
        li t6, 0x12363121
#endif
#endif /* defined(ON_BOARD_DDR2) */

#elif defined(ON_BOARD_DDR1)

#if defined(MT7620_ASIC_BOARD) || defined(MT7621_ASIC_BOARD)
#ifdef ON_BOARD_128M_DRAM_COMPONENT
        li t6, 0x332A3434
#elif defined (ON_BOARD_256M_DRAM_COMPONENT)
        li t6, 0x222E2324	//use aggressive cfg //0x332e2434
#elif defined (ON_BOARD_512M_DRAM_COMPONENT)
        li t6, 0x33322434
#elif defined (ON_


cell.selected {background-color:#fff5ec;}
    .aplus-v2 .apm-tablemodule-valuecell span {word-wrap:break-word;}
    .aplus-v2 .apm-tablemodule-keyhead {border-right:1px solid #dddddd;}
    .aplus-v2 .apm-tablemodule-blankkeyhead {border:0 !important; width:18%;}
    .aplus-v2 .apm-tablemodule-image {background-color:#FFFFFF; padding:0 !important; text-align:center; overflow:hidden; vertical-align:bottom;}
    .aplus-v2 .apm-tablemodule-imagerows > td > img {max-width:none !important;}
    .aplus-v2 table.apm-tablemodule-table th {padding-bottom:8px; text-align:center;}
    .aplus-v2 .apm-checked {text-align:center;}

    /* A+ Template - Module 6 Specific CSS */
    .aplus-v2 .apm-hovermodule {text-align:left; margin:0 auto; width:970px; padding: 0; background-color:#ffffff; height:300px; position:relative;}
    .aplus-v2 .apm-hovermodule-slides {background-color:#ffffff; width:970px; height:300px;}
    .aplus-v2 .apm-hovermodule-slides-inner {margin-left:345px; position:absolute; z-index:25;}
    .aplus-v2 .apm-hovermodule-slidecontrol {position:absolute; top:180px; left:345px; z-index:30;}
    .aplus-v2 .apm-hovermodule-smallimage {width:80px; height:80px; cursor:pointer; float:left; margin-right:35px; padding:0;}
    .aplus-v2 .apm-hovermodule-smallimage-bg {background-color:#ffffff; width:100px; height:80px;}
    .aplus-v2 .apm-hovermodule-smallimage-last {margin-right:0 !important;}
    .aplus-v2 .apm-hovermodule-smallimage a {text-transform:uppercase; font-size:11px; font-weight:bold; color:333333 !important;}
    .aplus-v2 .apm-hovermodule-smallimage a:hover {text-decoration:none; color:#333333 !important;}
    .aplus-v2 .apm-hovermodule-smallimage img {border:1px solid #888888;}
    .aplus-v2 .apm-hovermodule-opacitymodon a {color:888888 !important;}
    .aplus-v2 .apm-hovermodule-opacitymodon:hover {opacity:1 !important; filter:alpha(opacity=100) !important;}
    .aplus-v2 .apm-hovermodule-opacitymodon img {opacity:0.3; filter:alpha(opacity=30);}
    .aplus-v2 .apm-hovermodule-image {position:absolute; left:0; z-index: 1;}

    /*A+ Template - Module 11 Specific CSS */
    .aplus-v2 .apm-heromodule-textright {float:right; right:50px; margin-top:100px; padding:15px; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#BBBBBB,endColorstr=#FFFFFF); background-color: rgb(0,0,0); background-color:rgba(0,0,0,0.7);color:white; width:250px;}
    .aplus-v2 .apm-heromodule-textright h3{color:white}
    .aplus-v2 .module-12 .textright {float:right; right:50px; margin-top:100px; padding:15px; color:black; width:250px; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#BBBBBB,endColorstr=#FFFFFF); backgroun


9 41.7-52.5 24.6L64 285.3V436c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12z"],"fast-forward":[512,512,[],"f050","M512 76v360c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12V284.1L276.5 440.6c-20.6 17.2-52.5 2.8-52.5-24.6V284.1L52.5 440.6C31.9 457.8 0 443.4 0 416V96c0-27.4 31.9-41.7 52.5-24.6L224 226.8V96c0-27.4 31.9-41.7 52.5-24.6L448 226.8V76c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12z"],faucet:[512,512,[],"f905","M352,256H313.39c-15.71-13.44-35.46-23.07-57.39-28V180.44l-32-3.38-32,3.38V228c-21.93,5-41.68,14.6-57.39,28H16A16,16,0,0,0,0,272v96a16,16,0,0,0,16,16h92.79C129.38,421.73,173,448,224,448s94.62-26.27,115.21-64H352a32,32,0,0,1,32,32,32,32,0,0,0,32,32h64a32,32,0,0,0,32-32A160,160,0,0,0,352,256ZM81.59,159.91l142.41-15,142.41,15c9.42,1,17.59-6.81,17.59-16.8V112.89c0-10-8.17-17.8-17.59-16.81L256,107.74V80a16,16,0,0,0-16-16H208a16,16,0,0,0-16,16v27.74L81.59,96.08C72.17,95.09,64,102.9,64,112.89v30.22C64,153.1,72.17,160.91,81.59,159.91Z"],fax:[512,512,[],"f1ac","M480 160V77.25a32 32 0 0 0-9.38-22.63L425.37 9.37A32 32 0 0 0 402.75 0H160a32 32 0 0 0-32 32v448a32 32 0 0 0 32 32h320a32 32 0 0 0 32-32V192a32 32 0 0 0-32-32zM288 432a16 16 0 0 1-16 16h-32a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h32a16 16 0 0 1 16 16zm0-128a16 16 0 0 1-16 16h-32a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h32a16 16 0 0 1 16 16zm128 128a16 16 0 0 1-16 16h-32a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h32a16 16 0 0 1 16 16zm0-128a16 16 0 0 1-16 16h-32a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h32a16 16 0 0 1 16 16zm0-112H192V64h160v48a16 16 0 0 0 16 16h48zM64 128H32a32 32 0 0 0-32 32v320a32 32 0 0 0 32 32h32a32 32 0 0 0 32-32V160a32 32 0 0 0-32-32z"],feather:[512,512,[],"f52d","M467.14 44.84c-62.55-62.48-161.67-64.78-252.28 25.73-78.61 78.52-60.9


/* Definitions of target machine of Andes NDS32 cpu for GNU compiler
   Copyright (C) 2012-2025 Free Software Foundation, Inc.
   Contributed by Andes Technology Corporation.

   This file is part of GCC.

   GCC is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published
   by the Free Software Foundation; either version 3, or (at your
   option) any later version.

   GCC is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
   License for more details.

   You should have received a copy of the GNU General Public License
   along with GCC; see the file COPYING3.  If not see
   <http://www.gnu.org/licenses/>.  */

/* ------------------------------------------------------------------------ */

#define TARGET_LINUX_ABI 1

#undef  SIZE_TYPE
#define SIZE_TYPE "unsigned int"

#undef  PTRDIFF_TYPE
#define PTRDIFF_TYPE "int"

#define TARGET_OS_CPP_BUILTINS()                \
  do                                            \
    {                                           \
      GNU_USER_TARGET_OS_CPP_BUILTINS();           \
    }                                           \
  while (0)

#ifdef TARGET_BIG_ENDIAN_DEFAULT
#define LD_SO_ENDIAN_SPEC "%{mlittle-endian:le}%{!mlittle-endian:be}"
#else
#define LD_SO_ENDIAN_SPEC "%{mbig-endian:be}%{!mbig-endian:le}"
#endif

/* Record arch version in TARGET_ARCH_DEFAULT.
   0 means soft ABI;
   1 means hard ABI and using full floating-point instruction;
   2 means hard ABI and only using single-precision floating-point
   instruction.  */
#if TARGET_ARCH_DEFAULT
#define LD_SO_ABI_SPEC "%{!mabi=2:f}"
#else
#define LD_SO_ABI_SPEC "%{mabi=2fp+:f}"
#endif

#define GLIBC_DYNAMIC_LINKER \
  "/lib/ld-linux-nds32" LD_SO_ENDIAN_SPEC LD_SO_ABI_SPEC ".so.1"

/* In the configure stage we may use options --enable-default-relax,
   --enable-Os-default-ifc and --enable-Os-default-ex9.  They effect
   the default spec of passing --relax, --mifc, and --mex9 to linker.
   We use NDS32_RELAX_SPEC, NDS32_IFC_SPEC, and NDS32_EX9_SPEC
   so that we can customize them conveniently.  */
#define LINK_SPEC \
 " %{G*}" \
 " %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
 " %{shared:-shared} \
  %{!shared: \
    %{!static: \
      %{rdynamic:-export-dynamic} \
      -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
    %{static:-static}}" \
  NDS32_RELAX_SPEC

#define LINK_PIE_SPEC "%{pie:%{!fno-pie:%{!fno-PIE:%{!static:-pie}}}} "

#define CPP_SPEC "%{pthread:-D_REENTRANT}"

/* The SYNC operations are implemented as library functions, not
   INSN patterns.  As a result, the HAVE defines for the patterns are
   not defined.  We need to define them to generate the corresponding
   __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* and __GCC_ATOMIC_*_LOCK_FREE
   defines.
   Ref: https://sourceware.org/ml/libc-alpha/2014-09/msg00322.html  */
#define HAVE_sync_compare_and_swapqi 1
#define HAVE_sync_compare_and_swaphi 1
#define HAVE_sync_compare_and_swapsi 1


.acemusic.player.R;
import com.aniruddhc.acemusic.player.Helpers.TypefaceHelper;
import com.aniruddhc.acemusic.player.Helpers.UIElementsHelper;
import com.aniruddhc.acemusic.player.MainActivity.MainActivity;
import com.aniruddhc.acemusic.player.Utils.Common;

public class NavigationDrawerAdapter extends ArrayAdapter<String> {

	private Context mContext;
	private SharedPreferences sharedPreferences;
	private ArrayList<String> mTitlesList;

    public NavigationDrawerAdapter(Context context, ArrayList<String> titlesList) {
    	super(context, R.layout.sliding_menu_browsers_layout, titlesList);
    	mContext = context;
    	mTitlesList = titlesList;
    	sharedPreferences = mContext.getSharedPreferences("com.aniruddhc.acemusic.player", Context.MODE_PRIVATE);
    }

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {

    	SongsListViewHolder holder = null;
		if (convertView == null) {
			convertView = LayoutInflater.from(mContext).inflate(R.layout.sliding_menu_browsers_layout, parent, false);
			holder = new SongsListViewHolder();
			holder.title = (TextView) convertView.findViewById(R.id.nav_drawer_item_title);
			convertView.setTag(holder);
		} else {
		    holder = (SongsListViewHolder) convertView.getTag();
		}

		holder.title.setTypeface(TypefaceHelper.getTypeface(mContext, "Roboto-Regular"));
		holder.title.setText(mTitlesList.get(position));
		holder.title.setTextColor(UIElementsHelper.getThemeBasedTextColor(mContext));

		//Highlight the current browser.
		int[] colors = UIElementsHelper.getQuickScrollColors(mContext);
		if (MainActivity.mCurrentFragmentId==Common.ARTISTS_FRAGMENT &&
			mTitlesList.get(position).equals(mContext.getResources().getString(R.string.artists))) {
			holder.title.setTextColor(colors[0]);
		} else if (MainActivity.mCurrentFragmentId==Common.ALBUM_ARTISTS_FRAGMENT &&
				   mTitlesList.get(position).equals(mContext.getResources().getString(R.string.album_artists))) {
			holder.title.setTextColor(colors[0]);
		} else if (MainActivity.mCurrentFragmentId==Common.ALBUMS_FRAGMENT &&
				   mTitlesList.get(position).equals(mContext.getResources().getString(R.string.albums))) {
			holder.title.setTextColor(colors[0]);
		} else if (MainActivity.mCurrentFragmentId==Common.SONGS_FRAGMENT &&
				   mTitlesList.get(position).equals(mContext.getResources().getString(R.string.songs))) {
			holder.title.setTextColor(colors[0]);
		} else if (MainActivity.mCurrentFragmentId==Common.PLAYLISTS_FRAGMENT &&
				   mTitlesList.get(position).equals(mContext.getResources().getString(R.string.playlists))) {
			holder.title.setTextColor(colors[0]);
		} else if (MainActivity.mCurrentFragmentId==Common.GENRES_FRAGMENT &&
				   mTitlesList.get(position).equals(mContext.getResources().getString(R.string.genres))) {
			holder.title.setTextColor(colors[0]);
		} else if (MainActivity.mCurrentFragmentId==Common.FOLDERS_FRAGMENT &&
				   mTitlesList.get(position).equals(mContext.getResources().getString(R.string.folders))) {
			holder.title.setTextColor(colors[0]);
		}

		return convertView;

	}

	static class SongsListViewHolder {
	    public TextView title;
	}

}
/*
 * Copyright (C) 2014 Saravan Pantham
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *


 of health, you get 1 point of armor
					dif2 -= hold;
					dif2 += dif;

					dif = dif2;
				}
			}
		}
		else
		{	// Being triggered to be used up
			dif = 1;
			self->count = 0;
		}

		// Does player already have full health and full armor?
		if (dif > 0)
		{
//			G_Sound(self, G_SoundIndex("sound/player/suithealth.wav") );

			if ((dif >= self->count) || (self->count<1)) // use it all up?
			{
				health_shutdown(self);
			}
			// Use target when used
			if (self->spawnflags & 8)
			{
				G_UseTargets( self, activator );
			}

			self->e_UseFunc = useF_NULL;
			self->enemy = other;
			self->e_ThinkFunc = thinkF_health_think;
			self->nextthink = level.time + 50;
		}
		else
		{
//			G_Sound(self, G_SoundIndex("sound/weapons/noammo.wav") );
		}
	}
}

// --------------------------------------------------------------------
//
//   AMMO plugin functions
//
// --------------------------------------------------------------------
void ammo_use( gentity_t *self, gentity_t *other, gentity_t *activator);
int Add_Ammo2 (gentity_t *ent, int ammoType, int count);

void ammo_shutdown( gentity_t *self )
{
	if (!(self->s.eFlags & EF_ANIM_ONCE))
	{
		self->s.eFlags &= ~ EF_ANIM_ALLFAST;
		self->s.eFlags |= EF_ANIM_ONCE;

		gi.linkentity (self);
	}
}
void ammo_think( gentity_t *ent )
{
	int dif;

	// Still has ammo to give
	if (ent->count > 0 && ent->enemy )
	{
		dif = ammoData[AMMO_BLASTER].max  - ent->enemy->client->ps.ammo[AMMO_BLASTER];

		if (dif > 2 )
		{
			dif= 2;
		}
		else if (dif < 0)
		{
			dif= 0;
		}

		if (ent->count < dif)	// Can't give more than count
		{
			dif = ent->count;
		}

		// Give player ammo
		if (Add_Ammo2(ent->enemy,AMMO_BLASTER,dif) && (dif!=0))
		{
			ent->count-=dif;
			ent->nextthink = level.time + 10;
		}
		else	// User has taken all ammo he can hold
		{
			ent->e_UseFunc = useF_ammo_use;
			ent->e_ThinkFunc = thinkF_NULL;
		}
	}

	if (ent->count < 1)
	{
		ammo_shutdown(ent);
	}
}

//------------------------------------------------------------
void ammo_use( gentity_t *self, gentity_t *other, gentity_t *activator)
{
	int dif;

	G_ActivateBehavior(self,BSET_USE);

	if (self->e_ThinkFunc != thinkF_NULL)
	{
		if (self->e_UseFunc != useF_NULL)
		{
			self->e_ThinkFunc = thinkF_NULL;
		}
	}
	else
	{
		if (other->client)
		{
			dif = ammoData[AMMO_BLASTER].max - other->client->ps.ammo[AMMO_BLASTER];
		}
		else
		{	// Being triggered to be used up
			dif = 1;
			self->count = 0;
		}

		// Does player already have full ammo?
		if (dif > 0)
		{
//			G_Sound(self, G_SoundIndex("sound/p


3dh_default_server, lime_tester::OPkInitialBatchSize, callback);
				ret &= !!BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success, ++expected_success,lime_tester::wait_for_timeout));
			}
			// Create manager and device for dave
			auto daveManager = make_unique<LimeManager>(dbFilenameClaire, X3DHServerPost);
			if (!daveManager->is_user(*daveDeviceId, daveAlgos[i])) {
				daveManager->create_user(*daveDeviceId, daveAlgos[i], lime_tester::test_x3dh_default_server, lime_tester::OPkInitialBatchSize, callback);
				ret &= !!BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success, ++expected_success,lime_tester::wait_for_timeout));
			}

			// alice send a message to bob, claire and dave
			auto enc = make_shared<lime::EncryptionContext>("friends", lime_tester::messages_pattern[0], policy);
			enc->addRecipient(*bobDeviceId);
			enc->addRecipient(*claireDeviceId);
			enc->addRecipient(*daveDeviceId);
			aliceManager->encrypt(*aliceDeviceId, aliceAlgos[i], enc, callback);
			ret &= !!BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
			if (policy == lime::EncryptionPolicy::cipherMessage) {
				ret &= !!BC_ASSERT_TRUE(!enc->m_cipherMessage.empty());
			}

			// decrypt with bob Manager
			std::vector<uint8_t> receivedMessage{};
			ret &= !!BC_ASSERT_TRUE(bobManager->decrypt(*bobDeviceId, "friends", *aliceDeviceId, enc->m_recipients[0].DRmessage, enc->m_cipherMessage, receivedMessage) != lime::PeerDeviceStatus::fail);
			ret &= !!BC_ASSERT_TRUE(receivedMessage == lime_tester::messages_pattern[0]);

			// decrypt with claire Manager
			receivedMessage.clear();
			ret &= !!BC_ASSERT_TRUE(claireManager->decrypt(*claireDeviceId, "friends", *aliceDeviceId, enc->m_recipients[1].DRmessage, enc->m_cipherMessage, receivedMessage) != lime::PeerDeviceStatus::fail);
			ret &= !!BC_ASSERT_TRUE(receivedMessage == lime_tester::messages_pattern[0]);

			// decrypt with dave Manager
			receivedMessage.clear();
			ret &= !!BC_ASSERT_TRUE(daveManager->decrypt(*daveDeviceId, "friends", *aliceDeviceId, enc->m_recipients[2].DRmessage, enc->m_cipherMessage, receivedMessage) != lime::PeerDeviceStatus::fail);
			ret &= !!BC_ASSERT_TRUE(receivedMessage == lime_tester::messages_pattern[0]);

			// bob replies to alice, claire and dave
			enc = make_shared<lime::EncryptionContext>("friends", lime_tester::messages_pattern[1], policy);
			enc->addRecipient(*aliceDeviceId);
			enc->addRecipient(*claireDeviceId);
			enc->addRecipient(*daveDeviceId);
			bobManager->encrypt(*bobDeviceId, bobAlgos[i], enc, callback);
			ret &= !!BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
			if (policy == lime::EncryptionPolicy::cipherMessage) {
				ret &= !!BC_ASSERT_TRUE(!enc->m_cipherMessage.empty());
			}

			// decrypt it on alice
			receivedMessage.clear();
			ret &= !!BC_ASSERT_TRUE(ali


, unsafe依赖/泄漏, 人体工程学差)
│
├── 5. 执行器 & 运行时：分离策略
│   ├── 执行器原理 (任务管理, 调度, Waker处理, I/O集成)
│   ├── [+] 分离优势 (灵活性, 创新空间, 针对性优化, 运行时示例)
│   └── [-] 批判视角 (生态碎片化, 选择负担, 兼容性, 事实标准问题)
│
├── 6. 同步/异步边界：颜色问题
│   ├── 桥接必要性 (混合代码现实)
│   ├── 桥接机制 (spawn_blocking: Async调Sync; block_on: Sync调Async; 权衡)
│   └── [-] 批判视角 (函数"颜色"割裂, 边界成本, 认知负担, 常见陷阱)
│
├── 7. 跨架构兼容性：模型边界
│   ├── 冯诺依曼假设 (顺序执行, 统一内存, 确定状态)
│   ├── 架构冲突
│   │   ├── GPU (SIMT, 内存层次, 线程协作)
│   │   ├── 其他 (哈佛, FPGA/数据流, 量子)
│   └── [-] 批判视角 (架构特化的安全模型, 抽象泄漏, 生态碎片化)
│
├── 8. 实践与模式：复杂性应对
│   ├── 异步流 (Stream Trait, StreamExt, 组合模式)
│   ├── 取消与超时 (隐式/显式取消, timeout组合子, select!, 优雅关闭)
│   ├── 异步同步原语 (需要异步版本, Mutex, RwLock, Semaphore, Notify, Channel)
│   └── 架构跨越策略 (DSL, 分层抽象, 显式资源管理, FFI)
│
├── 9. 理论基础：形式化推理
│   ├── 调度保证 (公平性: 弱/强, 活性)
│   ├── Waker契约 (保证进展)
│   └── [-] 批判视角 (简化抽象, 理想假设, 适用性限制, 与实践差距)
│
└── 10. 结论与展望
    ├── 核心权衡 (安全 vs 性能 vs 复杂性 vs 普适性)
    └── 未来方向
        ├── 简化抽象 & 改善人体工程学 (Pin, async trait, 调试)
        ├── 标准化核心生态 (Stream, 执行器接口?)
        ├── 务实的异构计算策略 (互操作性, DSL, FFI)
        └── 形式化方法深化应用
```
---
category: functions
has_code_examples: true
last_updated: '2025-01-23'
tags:
- API
- Database
- Functions
- Queries
- Authentication
- Testing
- Quality Assurance
- Workflow Testing
- CI/CD
- Development Tools
title: 'Test Suites & Workflow Testing'
---

# Test Suites & Workflow Testing

## 📋 **Quick Summary**
Xano's Test Suites enable comprehensive workflow testing across your entire backend, allowing you to validate user flows, API endpoints, and business logic with automated test execution. Essential for maintaining quality in production applications integrated with n8n, WeWeb, and other external systems.

## 🎯 **Core Concepts**

### What is Workflow Testing?
Workflow Testing allows you to create comprehensive test suites that validate complete user journeys across multiple function stacks, APIs, and integrations. Think of it as end-to-end testing for your backend logic.

### Key Benefits
- **Flow Validation**: Test complete user journeys from start to finish
- **Regression Prevention**: Catch breaking changes before deployment
- **Integration Testing**: Verify external API and service connections
- **Performance Monitoring**: Track response times and system behavior
- **Coverage Analysis**: Understand which parts of your code are tested

## 🛠 **Building


_dist_wrapper");
}
/* ****************************************************************************
*
* Copyright (c) Microsoft Corporation.
*
* This source code is subject to terms and conditions of the Apache License, Version 2.0. A
* copy of the license can be found in the License.html file at the root of this distribution. If
* you cannot locate the Apache License, Version 2.0, please send an email to
* vspython@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
* by the terms of the Apache License, Version 2.0.
*
* You must not remove this notice, or any other, from this software.
*
* Contributor: Fabio Zadrozny
*
* Based on PyDebugAttach.cpp from PVTS. Windows only.
*
* https://github.com/Microsoft/PTVS/blob/master/Python/Product/PyDebugAttach/PyDebugAttach.cpp
*
* Initially we did an attach completely based on shellcode which got the
* GIL called PyRun_SimpleString with the needed code and was done with it
* (so, none of this code was needed).
* Now, newer version of Python don't initialize threading by default, so,
* most of this code is done only to overcome this limitation (and as a plus,
* if there's no code running, we also pause the threads to make our code run).
*
* On Linux the approach is still the simpler one (using gdb), so, on newer
* versions of Python it may not work unless the user has some code running
* and threads are initialized.
* I.e.:
*
* The user may have to add the code below in the start of its script for
* a successful attach (if he doesn't already use threads).
*
* from threading import Thread
* Thread(target=str).start()
*
* -- this is the workaround for the fact that we can't get the gil
* if there aren't any threads (PyGILState_Ensure gives an error).
* ***************************************************************************/

// Access to std::cout and std::endl
#include <iostream>
// DECLDIR will perform an export for us
#define DLL_EXPORT

#include "attach.h"
#include "stdafx.h"

#include "../common/python.h"
#include "../common/ref_utils.hpp"
#include "../common/py_utils.hpp"
#include "../common/py_settrace.hpp"

#pragma comment(lib, "kernel32.lib")
#pragma comment(lib, "user32.lib")
#pragma comment(lib, "advapi32.lib")
#pragma comment(lib, "psapi.lib")

#include "py_win_helpers.hpp"
#include "run_code_in_memory.hpp"

// _Always_ is not defined for all versions, so make it a no-op if missing.
#ifndef _Always_
#define _Always_(x) x
#endif

typedef void (PyEval_Lock)(); // Acquire/Release lock
typedef void (PyThreadState_API)(PyThreadState *); // Acquire/Release lock
typedef PyObject* (Py_CompileString)(const char *str, const char *filename, int start);
typedef PyObject* (PyEval_EvalCode)(PyObject *co, PyObject *globals, PyObject *locals);
typedef PyObject* (PyDict_GetItemString)(PyObject *p, const char *key);
typedef PyObject* (PyEval_GetBuiltins)();
typedef int (PyDict_SetItemString)(PyObject *dp, const char *key, PyObject *item);
typedef int (PyEval_ThreadsInitialized)();
typedef int (Py_AddPendingCall)(int (*func)(void *), void*);
typedef PyObject* (PyString_FromString)(const char* s);
typedef void PyEval_SetTrace(Py_tracefunc func, PyObject *obj);
typedef PyObject* (PyErr_Print)();
typedef PyObject* (PyObject_SetAttrString)(PyObject *o, const char *attr_name, PyObject* value);
typedef PyObject* (PyBool_FromLong)(long v);
typedef unsigned long (_PyEval_GetSwitchInterval)(void);
typedef void (_


//    CANAPE Core Network Testing Library
//    Copyright (C) 2017 James Forshaw
//    Based in part on CANAPE Network Testing Tool
//    Copyright (C) 2014 Context Information Security
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
using Org.BouncyCastle.Asn1;
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.Crypto.Operators;
using Org.BouncyCastle.Math;
using Org.BouncyCastle.Pkcs;
using Org.BouncyCastle.Security;
using Org.BouncyCastle.X509;
using System;
using System.IO;
using SystemX509 = System.Security.Cryptography.X509Certificates;

namespace CANAPE.Security.Cryptography.X509Certificates
{
    internal static class CertificateBuilder
    {
        /// <summary>
        /// Create a new managed RSA key, persisted into a provider
        /// </summary>
        /// <param name="keySize">Size of key to create</param>
        /// <param name="random">Specify the secure random number generator.</param>
        /// <returns>The new key</returns>
        public static AsymmetricCipherKeyPair CreateRSAKey(int keySize, SecureRandom random)
        {
            RsaKeyPairGenerator keygen = new RsaKeyPairGenerator();
            KeyGenerationParameters keygen_params = new KeyGenerationParameters(random, keySize);
            keygen.Init(keygen_params);
            return keygen.GenerateKeyPair();
        }

        private const string szOID_AUTHORITY_KEY_IDENTIFIER2 = "2.5.29.35";

        private static string HashAlgorithmToName(CertificateHashAlgorithm hashAlgorithm)
        {
            switch (hashAlgorithm)
            {

                case CertificateHashAlgorithm.Sha1:
                    return "SHA1WITHRSA";
                case CertificateHashAlgorithm.Sha256:
                    return "SHA256WITHRSA";
                case CertificateHashAlgorithm.Sha384:
                    return "SHA384WITHRSA";
                case CertificateHashAlgorithm.Sha512:
                    return "SHA512WITHRSA";
                case CertificateHashAlgorithm.Md5:
                    return "MD5WITHRSA";
                default:
                    throw new ArgumentException("hashAlgorithm");
            }
        }

        private static ISignatureFactory CreateSignatureFactory(CertificateHashAlgorithm hash_algorithm, AsymmetricCipherKeyPair key, SecureRandom random)
        {
            return new Asn1SignatureFactory(HashAlgorithmToName(hash_algorithm), key.Private, random);
        }

        ///// <summary>
        ///// Create a new certificate
        ///// </summary>
        ///// <param name="issuer">Issuer certificate, if null then self-sign</param>
        ///// <param name="subjectName">Subject name</param>
        ///// <param name="serialNumber">Serial number of certificate, if null then will generate a new one</param>
        ///// <param name="keySize">Size of RSA key</param>
        ///// <param name="notBefore">Start date of certificate</param>
        ///// <param name="notAfter">End date of certificate</param>
        ///// <param name="extensions">Array of extensions, if null then no extensions</param>
        ///// <param name="hashAlgorithm">Specify th


/*
 * nametable.c	TIPC nametable functionality.
 *
 *		This program is free software; you can redistribute it and/or
 *		modify it under the terms of the GNU General Public License
 *		as published by the Free Software Foundation; either version
 *		2 of the License, or (at your option) any later version.
 *
 * Authors:	Richard Alpe <richard.alpe@ericsson.com>
 */

#include <stdio.h>
#include <errno.h>

#include <linux/tipc_netlink.h>
#include <linux/tipc.h>
#include <linux/genetlink.h>
#include <libmnl/libmnl.h>

#include "cmdl.h"
#include "msg.h"
#include "nametable.h"

#define PORTID_STR_LEN 45 /* Four u32 and five delimiter chars */

static int nametable_show_cb(const struct nlmsghdr *nlh, void *data)
{
	int *iteration = data;
	char port_id[PORTID_STR_LEN];
	struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
	struct nlattr *info[TIPC_NLA_MAX + 1] = {};
	struct nlattr *attrs[TIPC_NLA_NAME_TABLE_MAX + 1] = {};
	struct nlattr *publ[TIPC_NLA_PUBL_MAX + 1] = {};
	const char *scope[] = { "", "zone", "cluster", "node" };

	mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
	if (!info[TIPC_NLA_NAME_TABLE])
		return MNL_CB_ERROR;

	mnl_attr_parse_nested(info[TIPC_NLA_NAME_TABLE], parse_attrs, attrs);
	if (!attrs[TIPC_NLA_NAME_TABLE_PUBL])
		return MNL_CB_ERROR;

	mnl_attr_parse_nested(attrs[TIPC_NLA_NAME_TABLE_PUBL], parse_attrs, publ);
	if (!publ[TIPC_NLA_NAME_TABLE_PUBL])
		return MNL_CB_ERROR;

	if (!*iteration)
		printf("%-10s %-10s %-10s %-26s %-10s\n",
		       "Type", "Lower", "Upper", "Port Identity",
		       "Publication Scope");
	(*iteration)++;

	snprintf(port_id, sizeof(port_id), "<%u.%u.%u:%u>",
		 tipc_zone(mnl_attr_get_u32(publ[TIPC_NLA_PUBL_NODE])),
		 tipc_cluster(mnl_attr_get_u32(publ[TIPC_NLA_PUBL_NODE])),
		 tipc_node(mnl_attr_get_u32(publ[TIPC_NLA_PUBL_NODE])),
		 mnl_attr_get_u32(publ[TIPC_NLA_PUBL_REF]));

	printf("%-10u %-10u %-10u %-26s %-12u",
	       mnl_attr_get_u32(publ[TIPC_NLA_PUBL_TYPE]),
	       mnl_attr_get_u32(publ[TIPC_NLA_PUBL_LOWER]),
	       mnl_attr_get_u32(publ[TIPC_NLA_PUBL_UPPER]),
	       port_id,
	       mnl_attr_get_u32(publ[TIPC_NLA_PUBL_KEY]));

	printf("%s\n", scope[mnl_attr_get_u32(publ[TIPC_NLA_PUBL_SCOPE])]);

	return MNL_CB_OK;
}

static int cmd_nametable_show(struct nlmsghdr *nlh, const struct cmd *cmd,
			      struct cmdl *cmdl, void *data)
{
	int iteration = 0;
	char buf[MNL_SOCKET_BUFFER_SIZE];

	if (help_flag) {
		fprintf(stderr, "Usage: %s nametable show\n", cmdl->argv[0]);
		return -EINVAL;
	}

	if (!(nlh = msg_init(buf, TIPC_NL_NAME_TABLE_GET))) {
		fprintf(stderr, "error, message initialisation failed\n");
		return -1;
	}

	return msg_dumpit(nlh, nametable_show_cb, &iteration);
}

void cmd_nametable_help(struct cmdl *cmdl)
{
	fprintf(stderr,
		"Usage: %s nametable COMMAND\n\n"
		"COMMANDS\n"
		" show                  - Show nametable\n",
		cmdl->argv[0]);
}

int cmd_nametable(struct nlmsghdr *nlh, const struct cmd *cmd, struct cmdl *cmdl,
		  void *data)
{
	const struct cmd cmds[] = {
		{ "show",	cmd_nametable_show,	NULL },
		{ NULL }
	};

	return run_cmd(nlh, cmd, cmds, cmdl, NULL);
}


errs++
			fallthrough

		case 1, 2: /* incompletely recovered error ... try again */
			Errflag = 3

			/* find a state where "error" is a legal shift action */
			for yyp >= 0 {
				row := yyParseTab[yyS[yyp].yys]
				if yyError < len(row) {
					yyn = int(row[yyError]) + yyTabOfs
					if yyn > 0 { // hit
						if yyDebug >= 2 {
							__yyfmt__.Printf("error recovery found error shift in state %d\n", yyS[yyp].yys)
						}
						yystate = yyn /* simulate a shift of "error" */
						goto yystack
					}
				}

				/* the current p has no shift on "error", pop stack */
				if yyDebug >= 2 {
					__yyfmt__.Printf("error recovery pops state %d\n", yyS[yyp].yys)
				}
				yyp--
			}
			/* there is no state on the stack with an error shift ... abort */
			if yyDebug >= 2 {
				__yyfmt__.Printf("error recovery failed\n")
			}
			goto ret1

		case 3: /* no shift yet; clobber input char */
			if yyDebug >= 2 {
				__yyfmt__.Printf("error recovery discards %s\n", yySymName(yychar))
			}
			if yychar == yyEofCode {
				goto ret1
			}

			yychar = -1
			goto yynewstate /* try again in the same state */
		}
	}

	r := -yyn
	x0 := yyReductions[r]
	x, n := x0.xsym, x0.components
	yypt := yyp
	_ = yypt // guard against "declared and not used"

	yyp -= n
	if yyp+1 >= len(yyS) {
		nyys := make([]yySymType, len(yyS)*2)
		copy(nyys, yyS)
		yyS = nyys
	}
	yyVAL = yyS[yyp+1]

	/* consult goto table to find next state */
	exState := yystate
	yystate = int(yyParseTab[yyS[yyp].yys][x]) + yyTabOfs
	/* reduction by production r */
	if yyDebug >= 2 {
		__yyfmt__.Printf("reduce using rule %v (%s), and goto state %d\n", r, yySymNames[x], yystate)
	}

	switch r {
	case 1:
		{
			lx := yylex.(*lexer)
			lx.ast = yyS[yypt-0].node
		}
	case 2:
		{
			lx := yylex.(*lexer)
			lx.ast = &TranslationUnit{
				ExternalDeclarationList: yyS[yypt-0].node.(*ExternalDeclarationList).reverse(),
				FileScope:               lx.scope,
				FileSet:                 fset,
				Model:                   lx.model,
			}
		}
	case 3:
		{
			yyVAL.node = &EnumerationConstant{
				Token: yyS[yypt-0].Token,
			}
		}
	case 4:
		{
			yyVAL.node = &ArgumentExprList{
				Expr: yyS[yypt-0].node.(*Expr),
			}
		}
	case 5:
		{
			yyVAL.node = &ArgumentExprList{
				Case:             1,
				ArgumentExprList: yyS[yypt-2].node.(*ArgumentExprList),
				Token:            yyS[yypt-1].Token,
				Expr:             y


LE
    0x0AE0: 0x25E6,  #            enopencircbullet ◦ WHITE BULLET
    0x0AE1: 0x25AB,  #          enopensquarebullet ▫ WHITE SMALL SQUARE
    0x0AE2: 0x25AD,  #              openrectbullet ▭ WHITE RECTANGLE
    0x0AE3: 0x25B3,  #             opentribulletup △ WHITE UP-POINTING TRIANGLE
    0x0AE4: 0x25BD,  #           opentribulletdown ▽ WHITE DOWN-POINTING TRIANGLE
    0x0AE5: 0x2606,  #                    openstar ☆ WHITE STAR
    0x0AE6: 0x2022,  #          enfilledcircbullet • BULLET
    0x0AE7: 0x25AA,  #            enfilledsqbullet ▪ BLACK SMALL SQUARE
    0x0AE8: 0x25B2,  #           filledtribulletup ▲ BLACK UP-POINTING TRIANGLE
    0x0AE9: 0x25BC,  #         filledtribulletdown ▼ BLACK DOWN-POINTING TRIANGLE
    0x0AEA: 0x261C,  #                 leftpointer ☜ WHITE LEFT POINTING INDEX
    0x0AEB: 0x261E,  #                rightpointer ☞ WHITE RIGHT POINTING INDEX
    0x0AEC: 0x2663,  #                        club ♣ BLACK CLUB SUIT
    0x0AED: 0x2666,  #                     diamond ♦ BLACK DIAMOND SUIT
    0x0AEE: 0x2665,  #                       heart ♥ BLACK HEART SUIT
    0x0AF0: 0x2720,  #                maltesecross ✠ MALTESE CROSS
    0x0AF1: 0x2020,  #                      dagger † DAGGER
    0x0AF2: 0x2021,  #                doubledagger ‡ DOUBLE DAGGER
    0x0AF3: 0x2713,  #                   checkmark ✓ CHECK MARK
    0x0AF4: 0x2717,  #                 ballotcross ✗ BALLOT X
    0x0AF5: 0x266F,  #                musicalsharp ♯ MUSIC SHARP SIGN
    0x0AF6: 0x266D,  #                 musicalflat ♭ MUSIC FLAT SIGN
    0x0AF7: 0x2642,  #                  malesymbol ♂ MALE SIGN
    0x0AF8: 0x2640,  #                femalesymbol ♀ FEMALE SIGN
    0x0AF9: 0x260E,  #                   telephone ☎ BLACK TELEPHONE
    0x0AFA: 0x2315,  #           telephonerecorder ⌕ TELEPHONE RECORDER
    0x0AFB: 0x2117,  #         phonographcopyright ℗ SOUND RECORDING COPYRIGHT
    0x0AFC: 0x2038,  #                       caret ‸ CARET
    0x0AFD: 0x201A,  #          singlelowquotemark ‚ SINGLE LOW-9 QUOTATION MARK
    0x0AFE: 0x201E,  #          doublelowquotemark „ DOUBLE LOW-9 QUOTATION MARK
    0x0BA3: 0x003C,  #                   leftcaret < LESS-THAN SIGN
    0x0BA6: 0x003E,  #                  rightcaret > GREATER-THAN SIGN
    0x0BA8: 0x2228,  #                   downcaret ∨ LOGICAL OR
    0x0BA9: 0x2227,  #                     upcaret ∧ LOGICAL AND
    0x0BC0: 0x00AF,  #                     overbar ¯ MACRON
    0x0BC2: 0x22A5,  #                    downtack ⊥ UP TACK
    0x0BC3: 0x2229,  #                      upshoe ∩ INTERSECTION
    0x0BC4: 0x230A,  #                   downstile ⌊ LEFT FLOOR
    0x0BC6: 0x005F,  #                    underbar _ LOW LINE
    0x0BCA: 0x2218,  #                         jot ∘ RING OPERATOR
    0x0BCC: 0x2395,  #                        quad ⎕ APL FUNCTIONAL SYMBOL QUAD
    0x0BCE: 0x22A4,  #                      uptack ⊤ DOWN TACK
    0x0BCF: 0x25CB,  #                      circle ○ WHITE CIRCLE
    0x0BD3: 0x2308,  #                     upstile ⌈ LEFT CEILING
    0x0BD6: 0x222A,  #                    downshoe ∪ UNION
    0x0BD8: 0x2283,  #                   rightshoe ⊃ SUPERSET OF
    0x0BDA: 0x2282,  #                    leftshoe ⊂ SUBSET OF
    0x0BDC: 0x22A2,  #                    lefttack ⊢ RIGHT TACK
    0x0BFC: 0x22A3,  #                   righttack ⊣ LEFT TACK
    0x0CDF: 0x2017,  #        hebrew_doublelowline ‗ DOUBLE LOW LINE
    0x0CE0: 0x05D0,  #                hebrew_aleph א HEBREW LETTER ALEF
    0x0CE1: 0x05D1,  #                  hebrew_bet ב HEBREW LETTER BET
    0x0CE2: 0x05D2,  #                hebrew_gimel ג HEBREW LETTER GIMEL
    0x0CE3: 0x05D3,  #                hebrew_dalet ד HEBREW LETTER DALET
    0x0CE4: 0x05D4,  #                   hebrew_he ה HEBREW LETTER HE
    0x0CE5: 0x05D5,  #                  hebrew_waw ו HEBREW LETTER VAV
    0x0CE6: 0x05D6,  #                 hebrew_zain ז HEBREW LETTER ZAYIN
    0x0CE7: 0x05D7,  #                 hebrew_chet ח HEBREW LETTER HET
    0x0CE8: 0x05D8,  #                  hebrew_tet ט HEBREW LETTER TET
    0x0CE9: 0x05D9,  #                  hebrew_yod י HEBREW LETTER YOD
    0x0CEA: 0x05DA,  #            hebrew_finalkaph ך HEBREW LETTER FINAL KAF
    0x0CEB: 0x05DB,  #                 hebrew_kaph כ HEBREW LETTER KAF
    0x0CEC: 0x05DC,  #                hebrew_lamed ל HEBREW LETTER LAMED
    0x0CED: 0x05DD,  #             hebrew_finalmem ם HEBREW LETTER FINAL MEM
    0x0CEE: 0x05DE,  #                  hebrew_mem מ


lish_info.user_name
                )
            except Exception as e:
                self.module.fail_json(exists=False, msg="%s" % self.get_error_message(e))
        elif library_id in self.subscribed_content_libraries:
            try:
                lib_details = self.content_service.content.SubscribedLibrary.get(library_id)
            except Exception as e:
                self.module.fail_json(exists=False, msg="%s" % self.get_error_message(e))
        else:
            self.module.fail_json(exists=False, msg="Library %s not found." % library_id)

        self.library_info.append(
            dict(
                library_name=lib_details.name,
                library_description=lib_details.description,
                library_id=lib_details.id,
                library_type=lib_details.type,
                library_creation_time=lib_details.creation_time,
                library_server_guid=lib_details.server_guid,
                library_version=lib_details.version,
                library_publish_info=lib_publish_info
            )
        )

        self.module.exit_json(exists=False, changed=False, content_lib_details=self.library_info)

def main():
    argument_spec = rest_compatible_argument_spec()
    argument_spec.update(
        library_id=dict(type='str', required=False),
    )
    module = AnsibleModule(argument_spec=argument_spec,
                           supports_check_mode=True)

    vmware_contentlib_info = VmwareContentLibInfo(module)
    if module.params.get('library_id'):
        vmware_contentlib_info.get_content_lib_details(module.params['library_id'])
    else:
        vmware_contentlib_info.get_all_content_libs()

if __name__ == '__main__':
    main()


y-testing-framework) is how.

## How am I supposed to make sense of these horrible template errors? ##

If you are confused by the compiler errors gcc threw at you,
try consulting the _Google Mock Doctor_ tool first.  What it does is to
scan stdin for gcc error messages, and spit out diagnoses on the
problems (we call them diseases) your code has.

To "install", run command:
```
alias gmd='<path to googlemock>/scripts/gmock_doctor.py'
```

To use it, do:
```
<your-favorite-build-command> <your-test> 2>&1 | gmd
```

For example:
```
make my_test 2>&1 | gmd
```

Or you can run `gmd` and copy-n-paste gcc's error messages to it.

## Can I mock a variadic function? ##

You cannot mock a variadic function (i.e. a function taking ellipsis
(`...`) arguments) directly in Google Mock.

The problem is that in general, there is _no way_ for a mock object to
know how many arguments are passed to the variadic method, and what
the arguments' types are.  Only the _author of the base class_ knows
the protocol, and we cannot look into their head.

Therefore, to mock such a function, the _user_ must teach the mock
object how to figure out the number of arguments and their types.  One
way to do it is to provide overloaded versions of the function.

Ellipsis arguments are inherited from C and not really a C++ feature.
They are unsafe to use and don't work with arguments that have
constructors or destructors.  Therefore we recommend to avoid them in
C++ as much as possible.

## MSVC gives me warning C4301 or C4373 when I define a mock method with a const parameter.  Why? ##

If you compile this using Microsoft Visual C++ 2005 SP1:
```cpp
class Foo {
  ...
  virtual void Bar(const int i) = 0;
};

class MockFoo : public Foo {
  ...
  MOCK_METHOD1(Bar, void(const int i));
};
```
You may get the following warning:
```
warning C4301: 'MockFoo::Bar': overriding virtual function only differs from 'Foo::Bar' by const/volatile qualifier
```

This is a MSVC bug.  The same code compiles fine with gcc ,for
example.  If you use Visual C++ 2008 SP1, you would get the warning:
```
warning C4373: 'MockFoo::Bar': virtual function overrides 'Foo::Bar', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers
```

In C++, if you _declare_ a function with a `const` parameter, the
`const` modifier is _ignored_.  Therefore, the `Foo` base class above
is equivalent to:
```cpp
class Foo {
  ...
  virtual void Bar(int i) = 0;  // int or const int?  Makes no difference.
};
```

In fact, you can _declare_ Bar() with an `int` parameter, and _define_
it with a `const int` parameter.  The compiler will still match them
up.

Since making a parameter `const` is meaningless in the method
_declaration_, we recommend to remove it in both `Foo` and `MockFoo`.
That should workaround the VC bug.

Note that we are talking about the _top-level_ `const` modifier here.
If the function parameter is passed by pointer or reference, declaring
the _pointee_ or _referee_ as `const` is still meaningful.  For
example, the following two declarations are _not_ equivalent:
```cpp
void Bar(int* p);        // Neither p nor *p is const.
void Bar(const int* p);  // p is not const, but *p is.
```

## I have a huge mock class, and Microsoft Visual C++ runs out of memory when compiling it.  What can I do? ##

We've noticed that when the `/clr` compiler flag is used, Visual C++
uses 5~6 times as much memory when compiling a mock class.  We suggest
to avoid `/clr` when compiling native C++ mocks.

## I can't figure out why Google Mock thinks my


etLeavesByRangeInternal(ctx context.Context, start, count int64) ([]*trillian.LogLeaf, error) {
	if count <= 0 {
		return nil, status.Errorf(codes.InvalidArgument, "invalid count %d, want > 0", count)
	}
	if start < 0 {
		return nil, status.Errorf(codes.InvalidArgument, "invalid start %d, want >= 0", start)
	}

	if t.treeType == trillian.TreeType_LOG {
		treeSize := int64(t.root.TreeSize)
		if treeSize <= 0 {
			return nil, status.Errorf(codes.OutOfRange, "empty tree")
		} else if start >= treeSize {
			return nil, status.Errorf(codes.OutOfRange, "invalid start %d, want < TreeSize(%d)", start, treeSize)
		}
		// Ensure no entries queried/returned beyond the tree.
		if maxCount := treeSize - start; count > maxCount {
			count = maxCount
		}
	}
	// TODO(pavelkalinnikov): Further clip `count` to a safe upper bound like 64k.

	args := []interface{}{start, start + count, t.treeID}
	rows, err := t.tx.QueryContext(ctx, selectLeavesByRangeSQL, args...)
	if err != nil {
		klog.Warningf("Failed to get leaves by range: %s", err)
		return nil, err
	}
	defer func() {
		if err := rows.Close(); err != nil {
			klog.Errorf("rows.Close(): %v", err)
		}
	}()

	ret := make([]*trillian.LogLeaf, 0, count)
	for wantIndex := start; rows.Next(); wantIndex++ {
		leaf := &trillian.LogLeaf{}
		var qTimestamp, iTimestamp int64
		if err := rows.Scan(
			&leaf.MerkleLeafHash,
			&leaf.LeafIdentityHash,
			&leaf.LeafValue,
			&leaf.LeafIndex,
			&leaf.ExtraData,
			&qTimestamp,
			&iTimestamp); err != nil {
			klog.Warningf("Failed to scan merkle leaves: %s", err)
			return nil, err
		}
		if leaf.LeafIndex != wantIndex {
			if wantIndex < int64(t.root.TreeSize) {
				return nil, fmt.Errorf("got unexpected index %d, want %d", leaf.LeafIndex, wantIndex)
			}
			break
		}
		leaf.QueueTimestamp = timestamppb.New(time.Unix(0, qTimestamp))
		if err := leaf.QueueTimestamp.CheckValid(); err != nil {
			return nil, fmt.Errorf("got invalid queue timestamp: %w", err)
		}
		leaf.IntegrateTimestamp = timestamppb.New(time.Unix(0, iTimestamp))
		if err := leaf.IntegrateTimestamp.CheckValid(); err != nil {
			return nil, fmt.Errorf("got invalid integrate timestamp: %w", err)
		}
		ret = append(ret, leaf)
	}
	if err := rows.Err(); err != nil {
		klog.Warningf("Failed to read returned leaves: %s", err)
		return nil, err
	}

	return ret, nil
}

func (t *logTreeTX) GetLeavesByHash(ctx context.Context, leafHashes [][]byte, orderBySequence bool) ([]*trillian.LogLeaf, error) {
	t.mu.Lock()
	defer t.mu.Unlock()

	tmpl, err := t.ls.getLeavesByMerkleHashStmt(ctx, len(leafHashes), orderBySequence)
	if err != nil {
		return nil, err
	}

	return t.getLeavesByHashInternal(ctx, leafHashes, tmpl, "merkle")
}

// getLeafDataByIdentityHash retrieves leaf data by LeafIdentityHash, returned
// as a slice of LogLeaf objects for convenience.  However, note that the
// returned LogLeaf objects will not have a valid MerkleLeafHash, LeafIndex, or IntegrateTimestamp.
func (t *logTreeTX


.buttonBrowseMouseOver{
					font-family: , Verdana, Arial, Helvetica, sans-serif;
					font-size: 9pt;
					clip:rect(   );
					height:20px;
					width:20px;
					background-color:'#9999FF';
					cursor:hand
				}
.bodyText {  font-family: , Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; font-weight: normal}
.titleText {  font-family: , Verdana, Arial, Helvetica, sans-serif; font-size: 10.5pt; font-weight: bold}
.labelTitles {  font-family: , Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; font-weight: bold}
.itemText {  font-family: , Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; font-weight: normal; line-height: 15pt}
.buttonText {  font-family: , Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; clip:    rect(   )}
.sideBtn {  font-family: , Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; line-height: 9pt}
.titleDesc {  font-family: , Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; font-weight: normal; clip:   rect(   );}
.wizlink {color:blue}

.dropdownCombo {  font-family: , Verdana; font-size: 9pt; font-weight: normal}

.buttonClass	{
					font-family: , Verdana, Arial, Helvetica, sans-serif;
					font-size: 9pt;
					clip:rect(   );
					height:20px;
					width:80px;
					background-color:silver;
					cursor:hand
				}

.buttonMouseOver{
					font-family: , Verdana, Arial, Helvetica, sans-serif;
					font-size: 9pt;
					clip:rect(   );
					height:20px;
					width:80px;
					background-color:'#9999FF';
					cursor:hand
				}

.buttonBrowse	{
					font-family: , Verdana, Arial, Helvetica, sans-serif;
					font-size: 9pt;
					clip:rect(   );
					height:20px;
					width:20px;
					background-color:silver;
					cursor:hand
				}

.buttonBrowseMouseOver{
					font-family: , Verdana, Arial, Helvetica, sans-serif;
					font-size: 9pt;
					clip:rect(   );
					height:20px;
					width:20px;
					background-color:'#9999FF';
					cursor:hand
				}
.


nsert.Values[0].Values[i+1].GetKind(), &structpb.Value_ListValue{}
				if _, ok := g.(*structpb.Value_ListValue); !ok {
					t.Fatalf("type mismatch\nGot: %v\nWant: %v", g, wList)
				}
				// The array should contain 1 NULL value.
				if gLength, wLength := len(insert.Values[0].Values[i+1].GetListValue().Values), 1; gLength != wLength {
					t.Fatalf("list value length mismatch\nGot: %v\nWant: %v", gLength, wLength)
				}
				g, w = insert.Values[0].Values[i+1].GetListValue().Values[0].GetKind(), &structpb.Value_NullValue{}
				if _, ok := g.(*structpb.Value_NullValue); !ok {
					t.Fatalf("type mismatch\nGot: %v\nWant: %v", g, w)
				}
			}

			// The second insert should contain all non-NULL values.
			insert = commit.Mutations[1].GetInsert()
			for i := 1; i < len(insert.Values[0].Values); i += 2 {
				// The non-array columns should contain non-NULL values.
				g := insert.Values[0].Values[i].GetKind()
				if _, ok := g.(*structpb.Value_NullValue); ok {
					t.Fatalf("type mismatch\nGot: %v\nWant: non-NULL value", g)
				}
				// The array columns should also be non-NULL.
				g, wList := insert.Values[0].Values[i+1].GetKind(), &structpb.Value_ListValue{}
				if _, ok := g.(*structpb.Value_ListValue); !ok {
					t.Fatalf("type mismatch\nGot: %v\nWant: %v", g, wList)
				}
				// The array should contain exactly 1 non-NULL value.
				if gLength, wLength := len(insert.Values[0].Values[i+1].GetListValue().Values), 1; gLength != wLength {
					t.Fatalf("list value length mismatch\nGot: %v\nWant: %v", gLength, wLength)
				}
				g = insert.Values[0].Values[i+1].GetListValue().Values[0].GetKind()
				if _, ok := g.(*structpb.Value_NullValue); ok {
					t.Fatalf("type mismatch\nGot: %v\nWant: non-NULL value", g)
				}
			}
		}
	}
}

func TestClient_WriteStructWithCustomTypes(t *testing.T) {
	t.Parallel()
	server, client, teardown := setupMockedTestServer(t)
	defer teardown()
	type CustomString string
	type CustomBool bool
	type CustomInt64 int64
	type CustomFloat64 float64
	type CustomTime time.Time
	type CustomDate civil.Date
	type T struct {
		ID    int64
		Col1  CustomString
		Col2  []CustomString
		Col3  CustomBool
		Col4  []CustomBool
		Col5  CustomInt64
		Col6  []CustomInt64
		Col7  CustomFloat64
		Col8  []CustomFloat64
		Col9  CustomTime
		Col10 []CustomTime
		Col11 CustomDate
		Col12 []CustomDate
	}
	t1 := T{
		ID:    1,
		Col2:  []CustomString{},
		Col4:  []CustomBool{},
		Col6:  []CustomInt64{},
		Col8:  []CustomFloat64{},
		Col10: []CustomTime{},
		Col12: []CustomDate{},
	}
	t2 := T{
		ID:    2,
		Col1:  "foo",
		Col2:  []CustomString{"foo"},


//  Desc:        Framework For Game Develop with Unity3d
//  Copyright:   Copyright (C) 2017 SnowCold. All rights reserved.
//  WebSite:     https://github.com/SnowCold/Qarth
//  Blog:        http://blog.csdn.net/snowcoldgame
//  Author:      SnowCold
//  E-mail:      snowcold.ouyang@gmail.com
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;

namespace Qarth.Editor
{
    public class ABEditorMgr
    {
        private ABFolderInfo m_RootFolder;
        private ABConfigInfo m_ABConfigInfo;
        private ABStateInfo m_ABStateInfo;

        public ABFolderInfo rootFolder
        {
            get { return m_RootFolder; }
        }

        public ABEditorMgr()
        {
            Init();
        }

        private void Init()
        {
            m_ABConfigInfo = new ABConfigInfo();
            m_ABConfigInfo.LoadFromEditorConfig("abConfig.xml");
            m_ABConfigInfo.RefreshConfig();

            m_ABStateInfo = new ABStateInfo();
            //m_ABStateInfo.LoadFromFile("abState.xml");

            m_RootFolder = new ABFolderInfo();

            var list = m_ABConfigInfo.GetRootFolderList();

            if (list != null)
            {
                for (int i = 0; i < list.Count; ++i)
                {
                    m_ABStateInfo.AddFolder(list[i].folderAssetsPath, null);
                    m_RootFolder.AddFolder(EditorUtils.AssetsPath2ABSPath(list[i].folderAssetsPath));
                }
            }
        }

        public int GetABFlag(string absPath)
        {
            var unit = m_ABConfigInfo.GetConfigUnit(absPath);
            if (unit == null)
            {
                return ABFlagDefine.FOLDER;
            }

            return unit.abFlag;
        }

        public ABConfigUnit GetConfigUnit(string absPath)
        {
            return m_ABConfigInfo.GetConfigUnit(absPath);
        }

        public ABStateUnit GetStateUnit(string absPath)
        {
            return m_ABStateInfo.GetStateUnit(absPath);
        }

        public void FixedFolder(string assetPath)
        {
            string absPath = EditorUtils.AssetsPath2ABSPath(assetPath);
            if (!Directory.Exists(absPath))
            {
                return;
            }

            AutoGenAssetNameInFolder(assetPath);

            RefreshState();
        }

        public void AddFolder(string assetsPath)
        {
            string absPath = EditorUtils.AssetsPath2ABSPath(assetsPath);

            //这里会卡住
            m_ABConfigInfo.AddFolder(assetsPath, null);
            m_ABStateInfo.AddFolder(assetsPath, null);

            m_RootFolder.AddFolder(absPath);
        }

        public void RemoveFolder(string assetsPath)
        {
            string absPath = EditorUtils.AssetsPath2ABSPath(assetsPath);

            //这里会卡住


" title="type nom::lib::std::prelude::v1::v1::Iterator::Item">Item> where
    Self::Item: Ord,

[src]

Returns the minimum element of an iterator. Read more

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item> where
    B: Ord,
    F: FnMut(&Self::Item) -> B,

1.6.0
[src]

Returns the element that gives the maximum value from the specified function. Read more

<h4 id='method.max_by' class


('Mon_Fri_wakeTime') || '07:00';
  self.wakeTime_Sat = self.config.get('Sat_wakeTime') || '07:00';
  self.wakeTime_Sun = self.config.get('Sun_wakeTime') || '07:00';
  self.startVolume = parseInt(self.config.get('startVolume'), 10) || 20;
  // Uvijek učitava `playlist` kao string
  const savedPlaylist = self.config.get('playlist');
  self.playlist = typeof savedPlaylist === 'string' ? savedPlaylist : String(savedPlaylist);
  self.writeLog('Loaded playlist: ' + self.playlist);

  self.volumeDecrease = parseInt(self.config.get('volumeDecrease'), 10) || 1;
  self.minutesFade = parseInt(self.config.get('minutesFade'), 10) || 10;
  self.volumeIncrease = parseInt(self.config.get('volumeIncrease'), 10) || 1;
  self.minutesRamp = parseInt(self.config.get('minutesRamp'), 10) || 10;

  self.writeLog('Configuration loaded:');
  self.writeLog('sleepTime_Mon_Fri: ' + self.sleepTime_Mon_Fri);
  self.writeLog('sleepTime_Sat: ' + self.sleepTime_Sat);
  self.writeLog('sleepTime_Sun: ' + self.sleepTime_Sun);
  self.writeLog('wakeTime_Mon_Fri: ' + self.wakeTime_Mon_Fri);
  self.writeLog('wakeTime_Sat: ' + self.wakeTime_Sat);
  self.writeLog('wakeTime_Sun: ' + self.wakeTime_Sun);
  self.writeLog('startVolume: ' + self.startVolume);
  self.writeLog('playlist: ' + self.playlist);
  self.writeLog('volumeDecrease: ' + self.volumeDecrease);
  self.writeLog('minutesFade: ' + self.minutesFade);
  self.writeLog('volumeIncrease: ' + self.volumeIncrease);
  self.writeLog('minutesRamp: ' + self.minutesRamp);
};

SleepWakePlugin.prototype.scheduleSleep = function () {
  const self = this;

  self.writeLog('Scheduling sleep function started...');

  const now = new Date();
  const dayOfWeek = now.getDay();
  let sleepTimeStr;

  if (dayOfWeek >= 1 && dayOfWeek <= 5) { // Monday to Friday
    sleepTimeStr = self.config.get('Mon_Fri_sleepTime') || '22:00';
  } else if (dayOfWeek === 6) { // Saturday
    sleepTimeStr = self.config.get('Sat_sleepTime') || '22:00';
  } else if (dayOfWeek === 0) { // Sunday
    sleepTimeStr = self.config.get('Sun_sleepTime') || '22:00';
  }

  let sleepTime = self.parseTime(sleepTimeStr);

  if (!sleepTime) {
    self.logger.error('SleepWakePlugin - Invalid sleep time. Sleep will not be scheduled.');
    self.writeLog('Invalid sleep time. Sleep will not be scheduled.');
    return;
  }

// check day and schedule new day if time is in the past
  if (sleepTime <= now) {
    let nextDayForSleep = new Date();
    nextDayForSleep.setDate(nextDayForSleep.getDate() + 1);
    nextDayForSleep.setHours(sleepTime.getHours());
    nextDayForSleep.setMinutes(sleepTime.getMinutes());
    nextDayForSleep.setSeconds(0);
    nextDayForSleep.setMilliseconds(0);

    self.writeLog(`Adjusted sleep time to next day: ${nextDayForSleep}`);

    // update`sleepTime` new objekt
    sleepTime = nextDayForSleep;

    // Check day in week again
    const newDayOfWeek = nextDayForSleep.getDay();
    let newSleepTimeStr;

    if (newDayOfWeek >= 1 && newDayOfWeek <= 5) { // Monday to Friday
      newSleepT


}
		}
	}
	else if (client)
	{
		if (!(targ->flags & FL_GODMODE) && (take))
		{
			targ->pain(targ, attacker, knockback, take);
		}
	}
	else if (take)
	{
		if (targ->pain)
		{
			targ->pain(targ, attacker, knockback, take);
		}
	}

	/* add to the damage inflicted on a player this frame
	   the total will be turned into screen blends and view
	   angle kicks at the end of the frame */
	if (client)
	{
		client->damage_parmor += psave;
		client->damage_armor += asave;
		client->damage_blood += take;
		client->damage_knockback += knockback;
		VectorCopy(point, client->damage_from);
	}
}

void
T_RadiusDamage(edict_t *inflictor, edict_t *attacker, float damage,
		edict_t *ignore, float radius, int mod)
{
	float points;
	edict_t *ent = NULL;
	vec3_t v;
	vec3_t dir;

	if (!inflictor || !attacker)
	{
		return;
	}

	while ((ent = findradius(ent, inflictor->s.origin, radius)) != NULL)
	{
		if (ent == ignore)
		{
			continue;
		}

		if (!ent->takedamage)
		{
			continue;
		}

		VectorAdd(ent->mins, ent->maxs, v);
		VectorMA(ent->s.origin, 0.5, v, v);
		VectorSubtract(inflictor->s.origin, v, v);
		points = damage - 0.5 * VectorLength(v);

		if (ent == attacker)
		{
			points = points * 0.5;
		}

		if (points > 0)
		{
			if (CanDamage(ent, inflictor))
			{
				VectorSubtract(ent->s.origin, inflictor->s.origin, dir);
				T_Damage(ent, inflictor, attacker, dir, inflictor->s.origin,
						vec3_origin, (int)points, (int)points, DAMAGE_RADIUS,
						mod);
			}
		}
	}
}


s}, [x12], #64
	fsub	v4.4s, v24.4s, v4.4s
	fsub	v5.4s, v25.4s, v5.4s
	fsub	v6.4s, v26.4s, v6.4s
	fsub	v7.4s, v27.4s, v7.4s

	ld1		{v24.4s, v25.4s, v26.4s, v27.4s}, [x13], #64
	fsub	v8.4s, v24.4s, v8.4s
	fsub	v9.4s, v25.4s, v9.4s
	fsub	v10.4s, v26.4s, v10.4s
	fsub	v11.4s, v27.4s, v11.4s

#if MACRO_LEVEL>=1
	.endm
#else
	ret

	FUN_END(inner_scale_m11_12x4_lib4)
#endif

// subroutine
//
// input arguments:
// x8   <- D
// x9   <- sdd
//
// output arguments:

#if MACRO_LEVEL>=1
	.macro INNER_STORE_12X4_LIB4
#else
	.align 4
	FUN_START(inner_store_12x4_lib4)
#endif

	add		x10, x8, x9
	add		x11, x10, x9

	st1		{v0.4s, v1.4s, v2.4s, v3.4s}, [x8], #64
	st1		{v4.4s, v5.4s, v6.4s, v7.4s}, [x10], #64
	st1		{v8.4s, v9.4s, v10.4s, v11.4s}, [x11], #64

#if MACRO_LEVEL>=1
	.endm
#else
	ret

	FUN_END(inner_store_12x4_lib4)
#endif

// subroutine
//
// input arguments:
// x8   <- D
// x9   <- sdd
// x10  <- km
// x11  <- kn
//
// output arguments:

#if MACRO_LEVEL>=1
	.macro INNER_STORE_12X4_VS_LIB4
#else
	.align 4
	FUN_START(inner_store_12x4_vs_lib4)
#endif

	add		x12, x8, x9
	add		x13, x12, x9

	cmp		w10, #12
	bge		1f

	ldp		q24, q25, [x13, #(0*16)]
	ldp		q26, q27, [x13, #(2*16)]

	// 4th row
	ins		v8.s[3], v24.s[3]
	ins		v9.s[3], v25.s[3]
	ins		v10.s[3], v26.s[3]
	ins		v11.s[3], v27.s[3]
	cmp		w10, #11
	bge		1f
	// 3th row
	ins		v8.s[2], v24.s[2]
	ins		v9.s[2], v25.s[2]
	ins		v10.s[2], v26.s[2]
	ins		v11.s[2], v27.s[2]
	cmp		w10, #10
	bge		1f
	// 2nd row
	ins		v8.s[1], v24.s[1]
	ins		v9.s[1], v25.s[1]
	ins		v10.s[1


buffer, size_t size, size_t nmemb, void *stream) {
			struct FtpFile *out = (struct FtpFile *)stream;

			string fullFilePath = "";
			if (out != NULL && out->filepath != NULL) {
				fullFilePath = out->filepath;
			}
			if (out != NULL && out->filename != NULL) {
				fullFilePath += out->filename;
			}

			if (SystemFlags::VERBOSE_MODE_ENABLED) printf("===> FTP Client thread writing to file [%s]\n", fullFilePath.c_str());
			//printf ("===> FTP Client thread writing to file [%s]\n",fullFilePath.c_str());

			// Abort file xfer and delete partial file
			if (out && out->ftpServer && out->ftpServer->getQuitStatus() == true) {
				if (out->stream) {
					fclose(out->stream);
					out->stream = NULL;
				}

				if (SystemFlags::VERBOSE_MODE_ENABLED) printf("===> FTP Client thread CANCELLED, deleting file for writing [%s]\n", fullFilePath.c_str());
				if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "===> FTP Client thread CANCELLED, deleting file for writing [%s]\n", fullFilePath.c_str());

				removeFile(fullFilePath);
				return 0;
			}

			if (out && out->stream == NULL) {
				if (SystemFlags::VERBOSE_MODE_ENABLED) printf("===> FTP Client thread opening file for writing [%s]\n", fullFilePath.c_str());
				if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "===> FTP Client thread opening file for writing [%s]\n", fullFilePath.c_str());

				/* open file for writing */
#ifdef WIN32
				out->stream = _wfopen(utf8_decode(fullFilePath).c_str(), L"wb");
#else
				out->stream = fopen(fullFilePath.c_str(), "wb");
#endif
				if (out->stream == NULL) {
					if (SystemFlags::VERBOSE_MODE_ENABLED) printf("===> FTP Client thread FAILED to open file for writing [%s]\n", fullFilePath.c_str());
					if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "===> FTP Client thread FAILED to open file for writing [%s]\n", fullFilePath.c_str());
					SystemFlags::OutputDebug(SystemFlags::debugError, "===> FTP Client thread FAILED to open file for writing [%s]\n", fullFilePath.c_str());
					return 0; /* failure, can't open file to write */
				}

				out->isValidXfer = true;
			} else if (out == NULL) {
				if (SystemFlags::VERBOSE_MODE_ENABLED) printf("===> #2 FTP Client thread FAILED to open file for writing [%s]\n", fullFilePath.c_str());
				if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "===> #2 FTP Client thread FAILED to open file for writing [%s]\n", fullFilePath.c_str());
				SystemFlags::OutputDebug(SystemFlags::debugError, "===> #2 FTP Client thread FAILED to open file for writing [%s]\n", fullFilePath.c_str());
				return 0; /* failure, can't open file to write */
			}

			size_t result = fwrite(buffer, size, nmemb, out->stream);
			if (result != nmemb) {
				if (SystemFlags::VERBOSE_MODE_ENABLED) printf("===> FTP Client thread FAILED to write data chunk to file [%s] nmemb =


Point} from './kity-point';
import {KityBox} from './kity-box';
// 坐标系参照物
export type MatrixRefer = 'screen' | 'doc' | 'paper' | 'view' | 'top' | 'parent' | any;

export interface MatrixValue {
  a: number; // 正常值为1，定义的是scaleX通过设置x轴的值来定义缩放。值：>=0;
  b: number; // 正常值为0，定义的是skew，定义2D倾斜
  c: number; //  正常值为0，定义的是rotate定义2D旋转角度
  d: number; // 正常值为1，定义的是scaleY通过设置Y轴的值来定义缩放。值：>=0;
  e: number; //  正常值为0，定义的是translateX通过设置X轴的值来定义左右位移。值：任意
  f: number; //  正常值为0，定义的是translateY通过设置Y轴的值来定义上下位移。值：任意
}

/**
 * 矩阵计算类
 */
export class KityMatrix {
  public static mPattern = /matrix\s*\((.+)\)/i;

  m: MatrixValue;

  public static createFrom(matrix: KityMatrix): KityMatrix {
    return new KityMatrix(matrix.m.a, matrix.m.b, matrix.m.c, matrix.m.d, matrix.m.e, matrix.m.f);
  }

  constructor(a: number = 1, b: number = 0, c: number = 0, d: number = 1, e: number = 0, f: number = 0) {
    this.setMatrix(a, b, c, d, e, f);
  }

  // 注意，合并的结果是先执行m2，再执行m1的结果
  public static mergeMatrixData(m2: MatrixValue, m1: MatrixValue): MatrixValue {
    return {
      a: m1.a * m2.a + m1.c * m2.b,
      b: m1.b * m2.a + m1.d * m2.b,
      c: m1.a * m2.c + m1.c * m2.d,
      d: m1.b * m2.c + m1.d * m2.d,
      e: m1.a * m2.e + m1.c * m2.f + m1.e,
      f: m1.b * m2.e + m1.d * m2.f + m1.f
    };
  }

  // 获得从 node 到 refer 的变换矩阵
  public static getCTM(target: any, refer: MatrixRefer = 'parent'): KityMatrix {
    let ctm = {
      a: 1,
      b: 0,
      c: 0,
      d: 1,
      e: 0,
      f: 0
    };
    const node = target.shapeNode || target.node;

    /**
     * 由于新版chrome(dev 48.0)移除了getTransformToElement这个方法可能导致报错，这里做兼容处理
     * @Date 2015-11-12
     * @Editor Naixor
     */
    const getTransformToElement = ($target, source) => {
      let matrix;
      try {
        matrix = source.getScreenCTM().inverse();
      } catch (e) {
        throw new Error('Can not inverse source element\' ctm.');
      }
      return matrix.multiply($target.getScreenCTM());
    };

    // 根据参照坐标系选区的不一样，返回不同的结果
    switch (refer) {
      case 'screen':
        // 以浏览器屏幕为参照坐标系
        ctm = node.getScreenCTM();
        break;

      case 'doc':
      case 'paper':
        // 以文档（Paper）为参照坐标系
        ctm = node.getCTM();
        break;

      case 'view':
      case 'top':
        // 以顶层绘图容器（视野）为参照坐标系
        if (target.getPaper()) {


	{
				return 0;
			}
			if (((int)z.X) != 1)
			{
				return 0;
			}
			return 100;
        }

        // Disable inlining to permit easier identification of the code
        [MethodImpl(MethodImplOptions.NoInlining)]
        unsafe static void Do1(Point* src, Point* dst)
        {
            *((Point*)dst) = *((Point*)src);
        }

        // Disable inlining to permit easier identification of the code
        [MethodImpl(MethodImplOptions.NoInlining)]
        unsafe static void Do2(Point* src, Point* dst)
        {
            *((long*)dst) = *((long*)src);
        }
    }
}


;
            const OFFSET: u8 = 3;
            ((self.bits >> OFFSET) & MASK as u32) != 0
        };
        UPFDR { bits }
    }
    #[doc = "Bits 4:5 - Pause low threshold"]
    #[inline]
    pub fn plt(&self) -> PLTR {
        let bits = {
            const MASK: u8 = 3;
            const OFFSET: u8 = 4;
            ((self.bits >> OFFSET) & MASK as u32) as u8
        };
        PLTR { bits }
    }
    #[doc = "Bit 7 - Zero-quanta pause disable"]
    #[inline]
    pub fn zqpd(&self) -> ZQPDR {
        let bits = {
            const MASK: bool = true;
            const OFFSET: u8 = 7;
            ((self.bits >> OFFSET) & MASK as u32) != 0
        };
        ZQPDR { bits }
    }
    #[doc = "Bits 16:31 - Pause time"]
    #[inline]
    pub fn pt(&self) -> PTR {
        let bits = {
            const MASK: u16 = 65535;
            const OFFSET: u8 = 16;
            ((self.bits >> OFFSET) & MASK as u32) as u16
        };
        PTR { bits }
    }
}
impl W {
    #[doc = r" Reset value of the register"]
    #[inline]
    pub fn reset_value() -> W {
        W { bits: 0 }
    }
    #[doc = r" Writes raw bits to the register"]
    #[inline]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.bits = bits;
        self
    }
    #[doc = "Bit 0 - Flow control busy/back pressure activate"]
    #[inline]
    pub fn fcb(&mut self) -> _FCBW {
        _FCBW { w: self }
    }
    #[doc = "Bit 1 - Transmit flow control enable"]
    #[inline]
    pub fn tfce(&mut self) -> _TFCEW {
        _TFCEW { w: self }
    }
    #[doc = "Bit 2 - Recieve flow control enable"]
    #[inline]
    pub fn rfce(&mut self) -> _RFCEW {
        _RFCEW { w: self }
    }
    #[doc = "Bit 3 - Unicast pause frame detect"]
    #[inline]
    pub fn upfd(&mut self) -> _UPFDW {
        _UPFDW { w: self }
    }
    #[doc = "Bits 4:5 - Pause low threshold"]
    #[inline]
    pub fn plt(&mut self) -> _PLTW {
        _PLTW { w: self }
    }
    #[doc = "Bit 7 - Zero-quanta pause disable"]
    #[inline]
    pub fn zqpd(&mut self) -> _ZQPDW {
        _ZQPDW { w: self }
    }
    #[doc = "Bits 16:31 - Pause time"]
    #[inline]
    pub fn pt(&mut self) -> _PTW {
        _PTW { w: self }
    }
}
<reponame>mdonoughe/sbzdeck
use crate::types::*;
use common::{SerdeCardSettings, SerdeProfile, SerdeProfiles};
use indexmap::IndexMap;
use sbz_switch::soundcore::SoundCoreParamValue;
use std::collections::BTreeMap;

fn convert_to_soundcore(
    value: BTreeMap<String, BTreeMap<String, serde_json::Value>>,
) -> IndexMap<String, IndexMap<String, SoundCoreParamValue>> {
    value
        .into_iter()
        .map(|(name, params)| {
            (
                name,
                params
                    .into_iter()
                    .filter_map(|(name, value)| match value {
                        serde_json::Value::Number(n) => match n.as_i64() {
                            Some(n) if n < i64::from(i32::min_value()) => None,
                            Some(n) if n <= i64::from(i32::max_value()) => {
                                Some((name, SoundCoreParamValue::I32(n as i32)))
                            }
                            Some(n) if n <= i64::from(u32::max_value()) => {
                                Some((name, SoundCoreParamValue::U32(n as u32)))


g
	jp nc,interactionIncState
	jr timeportal_updatePalette

@state2:
	ld e,Interaction.var03
	ld a,(de)
	ld b,a
	ld a,(wPortalPos)
	cp b
	jp nz,interactionDelete

	call timeportal_updatePalette
	ld a,(wLinkObjectIndex)
	rrca
	ret c
	call objectCheckCollidedWithLink_notDeadAndNotGrabbing
	ret nc
	call checkLinkCollisionsEnabled
	ret nc

	; Link touched the portal
	ld a,$ff
	ld (wPortalGroup),a

	; Fall through

;;
; Also called by INTERAC_TIMEPORTAL_SPAWNER.
interactionBeginTimewarp:
	call resetLinkInvincibility
	ld hl,w1Link
	call objectCopyPosition
	ld l,<w1Link.direction
	ld (hl),DIR_DOWN

	ld a,DISABLE_ALL_BUT_INTERACTIONS | DISABLE_LINK
	ld (wDisabledObjects),a
	ld (wDisableLinkCollisionsAndMenu),a

	call objectGetTileAtPosition
	ld (wActiveTileIndex),a
	ld a,l
	ld (wActiveTilePos),a
	inc a
	ld (wLinkTimeWarpTile),a
	ld (wcde0),a

	ld a,CUTSCENE_TIMEWARP
	ld (wCutsceneTrigger),a
	call restartSound
	jp interactionDelete

;;
timeportal_updatePalette:
	ld a,(wFrameCounter)
	and $01
	jr nz,@animate
	ld e,Interaction.oamFlags
	ld a,(de)
	inc a
	and $0b
	ld (de),a
@animate:
	jp interactionAnimate


sed."]
    MULT_INSTRS_1 = 1,
    #[doc = "2: As for 1, and adds support for the MLS instruction."]
    MULT_INSTRS_2 = 2,
}
impl From<MULT_INSTRS_A> for u8 {
    #[inline(always)]
    fn from(variant: MULT_INSTRS_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `MULT_INSTRS`"]
pub type MULT_INSTRS_R = crate::R<u8, MULT_INSTRS_A>;
impl MULT_INSTRS_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, MULT_INSTRS_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(MULT_INSTRS_A::MULT_INSTRS_0),
            1 => Val(MULT_INSTRS_A::MULT_INSTRS_1),
            2 => Val(MULT_INSTRS_A::MULT_INSTRS_2),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `MULT_INSTRS_0`"]
    #[inline(always)]
    pub fn is_mult_instrs_0(&self) -> bool {
        *self == MULT_INSTRS_A::MULT_INSTRS_0
    }
    #[doc = "Checks if the value of the field is `MULT_INSTRS_1`"]
    #[inline(always)]
    pub fn is_mult_instrs_1(&self) -> bool {
        *self == MULT_INSTRS_A::MULT_INSTRS_1
    }
    #[doc = "Checks if the value of the field is `MULT_INSTRS_2`"]
    #[inline(always)]
    pub fn is_mult_instrs_2(&self) -> bool {
        *self == MULT_INSTRS_A::MULT_INSTRS_2
    }
}
#[doc = "Indicates the supported advanced signed Multiply instructions\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum MULTS_INSTRS_A {
    #[doc = "0: None supported, ARMv7-M unused"]
    MULTS_INSTRS_0 = 0,
    #[doc = "1: Adds support for the SMULL and SMLAL instructions"]
    MULTS_INSTRS_1 = 1,
    #[doc = "2: As for 1, and adds support for the SMLABB, SMLABT, SMLALBB, SMLALBT, SMLALTB, SMLALTT, SMLATB, SMLATT, SMLAWB, SMLAWT, SMULBB, SMULBT, SMULTB, SMULTT, SMULWB, and SMULWT instructions."]
    MULTS_INSTRS_2 = 2,
    #[doc = "3: As for 2, and adds support for the SMLAD, SMLADX, SMLALD, SMLALDX, SMLSD, SMLSDX, SMLSLD, SMLSLDX, SMMLA, SMMLAR, SMMLS, SMMLSR, SMMUL, SMMULR, SMUAD, SMUADX, SMUSD, and SMUSDX instructions."]
    MULTS_INSTRS_3 = 3,
}
impl From<MULTS_INSTRS_A> for u8 {
    #[inline(always)]
    fn from(variant: MULTS_INSTRS_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `MULTS_INSTRS`"]
pub type MULTS_INSTRS_R = crate::R<u8, MULTS_INSTRS_A>;
impl MULTS_INSTRS_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, MULTS_INSTRS_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(MULTS_INSTRS_A::MULTS_INSTRS_


/*
 * Copyright 2009-2017 Alibaba Cloud All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ALIBABACLOUD_EDAS_MODEL_CREATEK8SSECRETREQUEST_H_
#define ALIBABACLOUD_EDAS_MODEL_CREATEK8SSECRETREQUEST_H_

#include <string>
#include <vector>
#include <alibabacloud/core/RoaServiceRequest.h>
#include <alibabacloud/edas/EdasExport.h>

namespace AlibabaCloud
{
	namespace Edas
	{
		namespace Model
		{
			class ALIBABACLOUD_EDAS_EXPORT CreateK8sSecretRequest : public RoaServiceRequest
			{

			public:
				CreateK8sSecretRequest();
				~CreateK8sSecretRequest();

				bool getBase64Encoded()const;
				void setBase64Encoded(bool base64Encoded);
				std::string getData()const;
				void setData(const std::string& data);
				std::string getName()const;
				void setName(const std::string& name);
				std::string get_Namespace()const;
				void set_Namespace(const std::string& _namespace);
				std::string getClusterId()const;
				void setClusterId(const std::string& clusterId);
				std::string getCertId()const;
				void setCertId(const std::string& certId);
				std::string getType()const;
				void setType(const std::string& type);
				std::string getCertRegionId()const;
				void setCertRegionId(const std::string& certRegionId);

            private:
				bool base64Encoded_;
				std::string data_;
				std::string name_;
				std::string _namespace_;
				std::string clusterId_;
				std::string certId_;
				std::string type_;
				std::string certRegionId_;

			};
		}
	}
}
#endif // !ALIBABACLOUD_EDAS_MODEL_CREATEK8SSECRETREQUEST_H_


ype.Float4:
			result, err = strict.ExpectedSQL[*pgtype.Float4](v, castx.ToJSONNumberE)
		case *pgtype.Float8:
			result, err = strict.ExpectedSQL[*pgtype.Float8](v, castx.ToJSONNumberE)
		case *pgtype.Numeric:
			result, err = strict.ExpectedSQL[*pgtype.Numeric](v, castx.ToJSONNumberE)
		default:
			result, err = strict.UnexpectedSQL(v, castx.ToJSONNumberE)
		}
	case schema.TypeBytes:
		result, err = strict.ExpectedSQL[*pgtype.Bytea](value, castx.ToByteSliceE)
	case schema.TypeBoolean:
		result, err = strict.ExpectedSQL[*pgtype.Bool](value, cast.ToBoolE)
	case schema.TypeDate:
		result, err = strict.ExpectedSQL[*Date](value, cast.ToTimeE)
	case schema.TypeDatetime:
		result, err = strict.UnexpectedSQL(value, cast.ToTimeE)
	case schema.TypeTimestamp:
		switch v := value.(type) {
		case *Timestamp:
			result, err = strict.ExpectedSQL[*Timestamp](v, cast.ToTimeE)
		case *Timestamptz:
			result, err = strict.ExpectedSQL[*Timestamptz](v, cast.ToTimeE)
		default:
			result, err = strict.UnexpectedSQL(value, cast.ToTimeE)
		}
	case schema.TypeInterval:
		result, err = strict.UnexpectedSQL(value, cast.ToDurationE)
	case schema.TypeString:
		result, err = expectedStringCast(value)
	case schema.TypeAny:
		result, err = expectedAnyCast(value, colSchema, connInfo)
	default:
		return nil, abstract.NewFatalError(xerrors.Errorf("unexpected target type %s (original type %q, value of type %T), unmarshalling is not implemented", colSchema.DataType, colSchema.OriginalType, value))
	}

	if err != nil {
		return nil, abstract.NewStrictifyError(colSchema, schema.Type(colSchema.DataType), err)
	}
	return result, nil
}

func expectedAnyCast(value any, colSchema *abstract.ColSchema, connInfo *pgtype.ConnInfo) (any, error) {
	var result any
	var err error

	// JSON marshallability for all types will be additionally ensured later
	switch v := value.(type) {
	case *pgtype.CompositeType:
		result, err = unmarshalComposite(v, connInfo)
	case *GenericArray:
		result, err = unmarshalGenericArray(v, colSchema, connInfo)
	case *pgtype.GenericText:
		result, err = strict.ExpectedSQL[*pgtype.GenericText](v, castx.ToStringE)
	case *pgtype.Varbit:
		result, err = strict.ExpectedSQL[*pgtype.Varbit](v, castx.ToStringE)
	case *pgtype.Bit:
		result, err = strict.ExpectedSQL[*pgtype.Varbit]((*pgtype.Varbit)(v), castx.ToStringE)
	case *pgtype.Record:
		result, err = unmarshalRecord(v)
	case *pgtype.JSON:
		result, err = unmarshalJSON(v)
	case *pgtype.JSONB:
		result, err = unmarshalJSON((*pgtype.JSON)(v))
	case *pgtype.CIDR:
		result, err = unmarshalCIDR(v)
	case *pgtype.Inet:
		result, err = strict.ExpectedSQL[*pgtype.Inet](v, castx.ToStringE)
	case *pgtype.Tstzrange:
		result, err = strict.ExpectedSQL[*pgtype.Tstzrange](v, castx.ToStringE)
	case *pgtype.Daterange:
		result, err = unmarshalDaterange(v)
	case driver.Valuer:
		// all possible pgtype types (which can appear in future PostgreSQL versions


             .collect(),
        })
    }

    pub fn worker_count(&self) -> usize {
        self.workers.len()
    }

    pub fn parked_workers(&self) -> usize {
        self.workers.iter().filter(|w| w.is_parked()).count()
    }

    pub fn all_parked(&self) -> bool {
        self.parked_workers() == self.worker_count()
    }

    pub fn spawn_workers(&'static self, tls: VMThread, context: &'static C) {
        for i in 0..self.worker_count() {
            let worker = &self.workers[i];
            C::spawn_worker(worker, tls, context);
        }
    }
}
extern crate base64;
extern crate csv;
extern crate regex;

use crate::detections::configs;
use crate::detections::print::MessageNotation;
use flate2::read::GzDecoder;
use std::io::prelude::*;
use std::str;
use std::string::String;

pub fn check_command(
    event_id: usize,
    commandline: &str,
    minlength: usize,
    servicecmd: usize,
    servicename: &str,
    creator: &str,
    system_time: &String,
) {
    let mut text = "".to_string();
    let mut base64 = "".to_string();

    for regex in &configs::CONFIG.whitelist_regex {
        if regex.is_match(commandline) {
            return;
        }
    }

    if commandline.len() > minlength {
        text.push_str("Long Command Line: greater than ");
        text.push_str(&minlength.to_string());
        text.push_str("bytes\n");
    }
    text.push_str(&check_obfu(commandline));
    text.push_str(&check_regex(commandline, 0));
    text.push_str(&check_creator(commandline, creator));
    if configs::CONFIG.encode_regex.is_match(commandline) {
        base64.push_str(
            &configs::CONFIG
                .encoded_command_regex
                .replace_all(commandline, ""),
        );
    } else if configs::CONFIG.base64_regex.is_match(commandline) {
        base64.push_str(
            &configs::CONFIG
                .base64_with_before_after_regex
                .replace_all(commandline, ""),
        );
        base64.push_str(
            &configs::CONFIG
                .singlequote_regex
                .replace_all(&base64.to_string(), ""),
        );
    }
    if let Ok(decoded) = base64::decode(&base64) {
        if !base64.is_empty() {
            if configs::CONFIG.compress_regex.is_match(commandline) {
                let mut d = GzDecoder::new(decoded.as_slice());
                let mut uncompressed = String::new();
                let stdout = std::io::stdout();
                let mut stdout = stdout.lock();
                d.read_to_string(&mut uncompressed).unwrap();
                MessageNotation::info_noheader(&mut stdout, format!("Decoded: {}", uncompressed))
                    .ok();
                text.push_str("Base64-encoded and compressed function\n");
            } else {
                let stdout = std::io::stdout();
                let mut stdout = stdout.lock();
                MessageNotation::info_noheader(
                    &mut stdout,
                    format!("Decoded: {}", str::from_utf8(decoded.as_slice()).unwrap()),
                )
                .ok();
                text.push_str("Base64-encoded function\n");
                text.push_str(&check_obfu(str::from_utf8(decoded.as_slice()).unwrap()));
                text.push_str(&


ber=2,
                confidence=0.90
            )
        ),
        DocumentChunk(
            id="resume_chunk_5",
            content="Designed and implemented automated testing frameworks using pytest and Jest. Achieved 95% code coverage and reduced bug reports by 70%. Established monitoring and alerting systems using Prometheus and Grafana.",
            start_index=801,
            end_index=1000,
            metadata=ChunkMetadata(
                section="quality_assurance",
                page_number=2,
                confidence=0.87
            )
        ),
        DocumentChunk(
            id="project_chunk_1",
            content="Developed a machine learning recommendation system for e-commerce platform. Used collaborative filtering and content-based algorithms to improve user engagement by 40%. Implemented A/B testing framework to measure performance improvements.",
            start_index=0,
            end_index=200,
            metadata=ChunkMetadata(
                section="ml_project",
                page_number=1,
                confidence=0.93
            )
        ),
        DocumentChunk(
            id="project_chunk_2",
            content="Created a real-time chat application with WebSocket support. Built scalable backend with Node.js and Socket.io, supporting 10,000+ concurrent users. Implemented message encryption and user authentication with JWT tokens.",
            start_index=201,
            end_index=400,
            metadata=ChunkMetadata(
                section="fullstack_project",
                page_number=1,
                confidence=0.91
            )
        )
    ]

async def demo_rag_retrieval():
    """Demonstrate RAG retrieval functionality"""
    print("🚀 RAG Retrieval System Demo")
    print("=" * 50)

    # Setup vector database
    print("\n📊 Setting up vector database...")
    vector_db = VectorDatabase(index_path="./demo_rag_data")

    # Add sample documents
    print("📄 Adding sample document chunks...")
    chunks = create_sample_documents()
    added_count = vector_db.add_chunks_batch(chunks)
    print(f"✅ Added {added_count} document chunks to vector database")

    # Create RAG service
    rag_service = RAGRetrievalService(vector_db)

    # Create sample profile
    profile = create_sample_profile()
    print(f"\n👤 Created profile for {profile.personal_info.first_name} {profile.personal_info.last_name}")
    print(f"   Target Role: {profile.target_role.title}")
    print(f"   Experience Level: {profile.target_role.level}")
    print(f"   Key Skills: {', '.join([skill.name for skill in profile.skills.technical[:3]])}")

    # Test different question categories
    categories_to_test = [
        (QuestionCategory.TECHNICAL_KNOWLEDGE, ["Python", "Django", "AWS"]),
        (QuestionCategory.BEHAVIORAL, ["leadership", "mentoring", "collaboration"]),
        (QuestionCategory.SYSTEM_DESIGN, ["architecture", "scalability", "microservices"]),
        (QuestionCategory.EXPERIENCE_BASED, ["projects", "achievements", "challenges"])
    ]

    print("\n🔍 Testing RAG retrieval for different question categories:")
    print("-" * 60)

    for category, focus_areas in categories_to_test:
        print(f"\n📋 Category: {category.value.upper()}")
        print(f"🎯 Focus Areas: {', '.join(focus_areas)}")

        # Retrieve contexts
        contexts = await rag_service.retrieve_for_question_generation(
            profile=profile,
            category=category,
            difficulty=DifficultyLevel.HARD,
            focus_areas=focus_areas,
            max_contexts=3
        )

        print(f"📊 Retrieved {len(contexts)} relevant contexts:")

        for i, context in enumerate(contexts, 1):
            print(f"\n   Context {i} (Score: {context.final_score:.3f}):")
            print(f"   📝 Content: {context.content[:100]}...")
            print(f"   🔗 Source: {context.chunk_id}")
            print(f"   📈 Relevance: {context.relevance_score:.3f}")
            print(f"   ⭐ Importance: {context.importance_score:.3f}")
            print(f"   🎨 Diversity: {context.diversity_score:.3f}")

    # Test query enhancement
    print(f"\n🔧 Testing Query Enhancement:")
    print("-" * 30)

    original_query = "software development experience"
    enhancement = rag_service.retriever.enhance_query(
        original_query,
        profile,
        QuestionCategory.TECHNICAL_KNOWLEDGE
    )

    print(f"Original Query