out

OUT or INOUT parameter not working

不羁的心 提交于 2019-12-08 07:39:02
问题 If I create a stored procedure in MySQL with an OUT or INOUT parameter, it does not work. Even if I leave the stored procedure empty. The DDL is as follows: CREATE DEFINER=`root`@`localhost` PROCEDURE `testing_inout`(`a` int,INOUT `b` int) BEGIN END The first parameter is a regular IN parameter. The second one is an INOUT paremeter (even if set as OUT the same problem persists) When I call this stored procedure, I get an error stating: OUT or INOUT argument 2 for routine db_name.testing_inout

Android; “Key dispatching timed out …”

ぐ巨炮叔叔 提交于 2019-12-07 08:23:31
问题 I've got a menu activity and a game activity which is launched from the menu. Some (most) of the times I launch the game activity; all input hangs for a few (up to 10-ish) seconds and then plays out in hyperspeed while i get this in logcat: 11-20 18:24:27.873: WARN/WindowManager(2473): Key dispatching timed out sending to southgrove.game/southgrove.game.Game 11-20 18:24:27.873: WARN/WindowManager(2473): Previous dispatch state: {{KeyEvent{action=1 code=4 repeat=0 meta=0 scancode=28 mFlags=8}

Convert a string in a List<int> using LINQ (cleaner way)

好久不见. 提交于 2019-12-06 15:56:44
I have this string: string input = "1,2,3,4,s,6"; Pay attention to the s character. I just want to convert this string in a List<int> using LINQ. I initially tried in this way: var myList = new List<int>(); input.Split(',').ToList().ForEach(n => myList.Add(int.TryParse(n, out int num) ? num : -1) ); lista.RemoveAll(e => e == -1); But I prefer not have any -1 instead of a no-number characters. So now I try with this: var myList = new List<int>(); input.Split(',').ToList() .FindAll(n => int.TryParse(n, out int _)) .ForEach(num => myList.Add(int.Parse(num))); I prefer this, but is really a shame

OUT or INOUT parameter not working

耗尽温柔 提交于 2019-12-06 15:21:20
If I create a stored procedure in MySQL with an OUT or INOUT parameter, it does not work. Even if I leave the stored procedure empty. The DDL is as follows: CREATE DEFINER=`root`@`localhost` PROCEDURE `testing_inout`(`a` int,INOUT `b` int) BEGIN END The first parameter is a regular IN parameter. The second one is an INOUT paremeter (even if set as OUT the same problem persists) When I call this stored procedure, I get an error stating: OUT or INOUT argument 2 for routine db_name.testing_inout is not a variable or NEW pseudo-variable in BEFORE trigger. This error persists even if code is

Can't pass variables of base types as out parameters?

て烟熏妆下的殇ゞ 提交于 2019-12-06 08:14:01
问题 Just noticed this doesn't work: var dict = new Dictionary<int, XElement>(); XContainer element; //... if (dict.TryGetValue(idx, out element)) { //... Then I tried this: class A { } class B : A { } class Program { static void Main() { A a; a = Ret(); // no error, ok Ref(ref a); // compiler error, ok... Out(out a); // compiler error, lolwut?! } static B Ret() { return null; } static void Ref(ref B b) { } static void Out(out B b) { b = null; } } Why do I get a compiler error in the last call?

Android; “Key dispatching timed out …”

ⅰ亾dé卋堺 提交于 2019-12-05 16:53:50
I've got a menu activity and a game activity which is launched from the menu. Some (most) of the times I launch the game activity; all input hangs for a few (up to 10-ish) seconds and then plays out in hyperspeed while i get this in logcat: 11-20 18:24:27.873: WARN/WindowManager(2473): Key dispatching timed out sending to southgrove.game/southgrove.game.Game 11-20 18:24:27.873: WARN/WindowManager(2473): Previous dispatch state: {{KeyEvent{action=1 code=4 repeat=0 meta=0 scancode=28 mFlags=8} to Window{4866c7a0 southgrove.game/southgrove.game.Game paused=false} @ 1290273811209 lw=Window

Boxing and unboxing when using out and ref parameters

风格不统一 提交于 2019-12-05 10:33:10
问题 Does boxing/unboxing occur when a method accepts an out/ref parameter of a ValueType? 回答1: For ref Keyword Its already mentioned on MSDN that : Do not confuse the concept of passing by reference with the concept of reference types. The two concepts are not the same. A method parameter can be modified by ref regardless of whether it is a value type or a reference type. There is no boxing of a value type when it is passed by reference. As for out keyword: The out keyword causes arguments to be

Out parameters in C

非 Y 不嫁゛ 提交于 2019-12-05 01:35:11
void swap(int &first, int &second){ int temp = first; first = second; second = temp; } ////// int a=3,b=2; swap(a,b); In the above example, the C compiler complaints that "void swap(int &first, int &second)" has a syntax error like missing "&" before "( / {". I don't understand why? Doesn't C support this feature? C doesn't support passing by reference. So you will need to use pointers to do what you are trying to achieve: void swap(int *first, int *second){ int temp = *first; *first = *second; *second = temp; } int a=3,b=2; swap(&a,&b); I do NOT recommend this: But I'll add it for

Python NET call C# method which has a return value and an out parameter

随声附和 提交于 2019-12-04 19:14:25
I'm having the following static C# method public static bool TryParse (string s, out double result) which I would like to call from Python using the Python NET package. import clr from System import Double r0 = Double.IsNaN(12.3) # works r1, d1 = Double.TryParse("12.3") # fails! TypeError: No method matches given arguments. This works in IronPython. d2 = 0.0 r2, d2 = Double.TryParse("12.3", d2) # fails! TypeError: No method matches given arguments Any idea? Update I found the following answer, see https://stackoverflow.com/a/19600349/7556646 . CPython using PythonNet does basically the same

Java Arry Index Out of Bound Exception

China☆狼群 提交于 2019-12-04 06:33:12
问题 I have been working on this basic java program when I need to store 5 user entered values into an array, send it to a method, and find and display the lowest value. The program is simple enough, and it runs, but when I enter the last number, I get the error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4 at minNumber.main(minNumber:14) Help? import java.util.*; class minNumber { public static void main(String args[]){ Scanner input = new Scanner(System.in); int