out

Capturing Audio Out

空扰寡人 提交于 2019-12-01 08:25:28
问题 I want to capture all audio that is played to the user (all sounds together). Currently I'm working on Windows but it would be nice if the code was cross-platform (but not necessarily). Is it possible to do it with OpenAL? How? Code examples would be great. Language: C++ 回答1: The only way to do this I believe is to create a replacement audio device driver that receives all audio requests, and then forwards them to the original device driver. There are a number of existing applications that

C# out parameters vs returns

折月煮酒 提交于 2019-12-01 03:29:11
So I am new to C# and I am having difficulty understanding out . As opposed to just returning something from a function using System; class ReturnTest { static double CalculateArea() { double r=5; double area = r * r * Math.PI; return area; } static void Main() { double output = CalculateArea(); Console.WriteLine("The area is {0:0.00}", output); } } compare to this using System; class ReturnTest { static void CalculateArea(out double r) { r=5; r= r * r * Math.PI; } static void Main() { double radius; CalculateArea(out radius); Console.WriteLine("The area is {0:0.00}",radius ); Console.ReadLine

Using REF & OUT keywords with Passing by Reference & Passing by Value in C#

ぐ巨炮叔叔 提交于 2019-12-01 00:59:12
问题 Here is what I understand so far: PASS BY VALUE Passing by value means a copy of an argument is passed. Changes to that copy do not change the original. PASS BY REFERENCE Passing by reference means a reference to the original is passed. changes to the reference affect the original. REF Keyword REF tells the compiler that the object is initialized before entering the function. REF means the value is already set, the method can therefore read it and modify it. REF is two ways, both in and out.

Return multiple values from a class to method

倖福魔咒の 提交于 2019-12-01 00:32:35
I have a method passing a string to a class. For testing reasons I have used a button for now. I have searched in the forum for similar questions but they refer to php and other situation that I am unable to understand. The class strips out few characters from the string and assign the value to 3 different strings depending on the header. I need to return those 3 strings back to the caller and I have coded it as following. Caller: private void button4_Click(object sender, EventArgs e) { string a, b, c; string invia = textBox8.Text.ToString(); Stripper strp = new Stripper(); strp.Distri(invia,

Does specifying the OutAttribute on ByRef internal methods currently do anything?

限于喜欢 提交于 2019-12-01 00:16:55
问题 VB.NET doesn't have out parameters, but you can specify <Out()> ByRef on COM and P/Invoke methods to get the same effect for external methods. Does specifying the same on internal methods (i.e. methods only called by .NET code) actually help the Jitter (or VB.NET compiler)? Or is it currently only useful as a programmer note. Is it possible it could be used in a future Jitter, or is this attribute lost when compiling? 回答1: I've confirmed a VB.NET <Out()> does cause a C# client to require out

Why would ref be used for array parameters in C#?

冷暖自知 提交于 2019-11-30 20:53:02
I read the page Passing Arrays Using ref and out (C# Programming Guide) and was wondering why we would need to define an array parameter as a ref parameter when it is already a reference type. Won't changes in the callee function be reflected in the caller function? Jon Skeet Won't changes in the callee function be reflected in the caller function? Changes to the contents of the array would be reflected in the caller method - but changes to the parameter itself wouldn't be. So for example: public void Foo(int[] x) { // The effect of this line is visible to the caller x[0] = 10; // This line is

Return multiple values from a class to method

这一生的挚爱 提交于 2019-11-30 19:56:54
问题 I have a method passing a string to a class. For testing reasons I have used a button for now. I have searched in the forum for similar questions but they refer to php and other situation that I am unable to understand. The class strips out few characters from the string and assign the value to 3 different strings depending on the header. I need to return those 3 strings back to the caller and I have coded it as following. Caller: private void button4_Click(object sender, EventArgs e) {

(Python) List index out of range - iteration [duplicate]

£可爱£侵袭症+ 提交于 2019-11-30 19:08:36
问题 This question already has answers here : python : list index out of range error (11 answers) How to remove items from a list while iterating? (29 answers) Closed 2 years ago . for i in range(len(lst)): if lst[i][0]==1 or lst[i][1]==1: lst.remove(lst[i]) return lst This gives "IndexError: list index out of range" Why is this happening? 回答1: You're modifying the list you're iterating over. If you do that, the size of the list shrinks, so eventually lst[i] will point beyond the list's boundaries

mysql “not a variable or NEW pseudo-variable” message

坚强是说给别人听的谎言 提交于 2019-11-30 17:47:13
I'm trying to create a procedure that will enter data and then return a message in the OUT parameter, however i'm getting this message "argument 5 for routine hospital.alextest10 is not a variable or NEW pseudo-variable in BEFORE trigger" i have this as my procedure: create procedure alextest10 (IN a_patid CHAR(3), IN a_patnam VARCHAR(12), IN a_consno CHAR(3), IN a_ward CHAR(2), OUT a_message VARCHAR(50)) BEGIN set a_message = 'Database updated'; INSERT INTO patient (patient_id, patient_name, consultant_no, ward_no) values (a_patid, a_patnam, a_consno, a_ward); end! and this as my call command

Android Index out of bounds

柔情痞子 提交于 2019-11-30 09:55:44
问题 I am trying to get the bold text next to the hour scheldule ( from http://golfnews.no/golfpaatv.php )put it in a String array , then , show it on my device's screen. I've put the Internet Access permission , so that is not the problem.The application crashes on my device . Reason : index out of bounds . I don't understand where's the problem . My code is : package com.work.webrequest; import java.io.IOException; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import