AT16010L-10 - Atlona
CAB-DP-30MM - Gefen
DISPLPORT35L - StarTech.com
and i bought CAB-DP-30MM - Gefen , and it work fine !!!
class AutoResetEvent {
private final Object monitor = new Object();
private volatile boolean open = false;
public AutoResetEvent(boolean open) {
this.open = open;
}
public void waitOne() throws InterruptedException {
synchronized (monitor) {
while (open == false) {
monitor.wait();
}
open = false; // close for other
}
}
public void set() {
synchronized (monitor) {
open = true;
monitor.notify(); // open one
}
}
public void reset() {//close stop
open = false;
}
}
* This source code was highlighted with Source Code Highlighter.
class ManualResetEvent {
private final Object monitor = new Object();
private volatile boolean open = false;
public ManualResetEvent(boolean open) {
this.open = open;
}
public void waitOne() throws InterruptedException {
synchronized (monitor) {
while (open==false) {
monitor.wait();
}
}
}
public void set() {//open start
synchronized (monitor) {
open = true;
monitor.notifyAll();
}
}
public void reset() {//close stop
open = false;
}
}
* This source code was highlighted with Source Code Highlighter.for(int i = 0 ; i < 10 ; i++)
for(int j = 0 ; j < 4 ; j++)
for(int k = 0 ; k< 9 ; k++)
...........................
........................
Console.Write( i , j , k ....)
* This source code was highlighted with Source Code Highlighter. int[] mm = new int[] { 3, 2, 4 };
ManyFor mf = new ManyFor(mm);
for (int s = 0; s < mf.Count(); s++)
{
ReadOnlyCollection<int> r = mf.Get(s);
int i = r[0], j = r[1], k = r[2];
Console.WriteLine(i + " " + j + " " + k);
}
* This source code was highlighted with Source Code Highlighter. class ManyFor
{
readonly int[] id; // all zero : 0 0 0 0 0 0
readonly int[] max; // : 5 2 1 6 9 1
readonly int[] div;
int numberIteration = 1;
int N;
public ManyFor(int[] max)
{
N = max.Length;
this.max = new int[N];
id = new int[N];
div = new int[N];
for (int i = N - 1; i >= 0; i--)
{
if (max[i] < 0)
throw new ArgumentOutOfRangeException("max", " must be >= 0 ");
div[i] = numberIteration;
this.max[i] = max[i];
checked
{
numberIteration *= max[i];
}
}
if (N == 0) numberIteration = 0;
}
public int Count()
{
return numberIteration;
}
public ReadOnlyCollection<int> Get(int n)
{
if (n < 0 || n >= numberIteration)
throw new ArgumentOutOfRangeException("n", " n < 0 || n >= numberIteration n = " + n);
for (int i = 0; i < N; i++)
{
id[i] = n / div[i];
n -= id[i] * div[i];
}
return Array.AsReadOnly(id);
}
}
* This source code was highlighted with Source Code Highlighter. private string GetString(int[] max )
{
m = new ManyForBig(max);
StringBuilder s0 = new StringBuilder("");
for (ReadOnlyCollection<int> r = m.Next(); r != null; r = m.Next())
for (int j = 0; j < r.Count; j++)
s0.Append(r[j]);
return s0.ToString();
}
* This source code was highlighted with Source Code Highlighter.class ManyForBig
{
readonly int[] id; // all zero : 0 0 0 0 0 0
readonly int[] max; // : 5 2 1 6 9 1
private bool getFirst;
private int N;
private int index; // 0 <= index < N
public ManyForBig(int[] max)
{
N = max.Length;
this.max = (new List<int>(max)).ToArray();
id = new int[N];
index = N - 1;
getFirst = true;
if (N == 0) index = -1;
foreach (int i in max)
{
if (i < 0) throw new ArgumentOutOfRangeException("Error ManyFor i< 0");
if (i == 0)
{
index = -1;
break;
}
}
}
public ReadOnlyCollection<int> Next()
{
if (index == -1) return null;
if (getFirst)
{
getFirst = false;
return Array.AsReadOnly(id);
}
else if (id[index] + 1 == max[index])
{
for (; index >= 0 && id[index] + 1 == max[index]; index--)
{ }
if (index == -1) return null; //end
id[index]++;
for (int i = index + 1; i < N; i++)
id[i] = 0;
index = N - 1;
}
else
{
id[index]++;
}
return Array.AsReadOnly(id);
}
}
* This source code was highlighted with Source Code Highlighter. public class Token
{
public List<Token> tokens;
public IValue ivalue;
public string type;
public string value;
public string parseInfo;
}
* This source code was highlighted with Source Code Highlighter. public interface IValue
{
int Value( int x );
}
* This source code was highlighted with Source Code Highlighter. public class INT : IValue
{
int i;
public int I
{
set { i = value; }
get { return i; }
}
public INT(int i)
{
this.i = i;
}
public int Value( int x )
{
return i;
}
}
public class VARIABLE : IValue
{
public int Value( int x )
{
return x;
}
}
class ACTION : IValue
{
public string action;
public IValue v0;
public IValue v1;
public ACTION(IValue value0, string action, IValue value1)
{
this.v0 = value0;
this.v1 = value1;
this.action = string.Intern(action);
}
public int Value(int x)
{
switch (action)
{
case "&&":
if (v0.Value(x) == 0) return 0;
if (v1.Value(x) == 0) return 0;
return 1;
case "||":
if (v0.Value(x) != 0) return 1;
if (v1.Value(x) != 0) return 1;
return 0;
}
int i0 = v0.Value(x);
int i1 = v1.Value(x);
switch (action)
{
case "+":
return i0 + i1;
case "-":
return i0 - i1;
case "*":
return i0 * i1;
case "/":
return i0 / i1;
case "%":
return i0 % i1;
case "<":
return i0 < i1 ? 1 : 0;
case ">":
return i0 > i1 ? 1 : 0;
case "<=":
return i0 <= i1 ? 1 : 0;
case ">=":
return i0 >= i1 ? 1 : 0;
case "==":
return i0 == i1 ? 1 : 0;
case "!=":
return i0 != i1 ? 1 : 0;
}
throw new Exception("dsqwertyds");
}
}
class FUNCTION : IValue
{
public List<IValue> value;
public string nameFunction;
public FUNCTION(string nameFunction, List<IValue> value)
{
this.nameFunction = string.Intern(nameFunction);
this.value = value;
}
public int Value( int x)
{
int xx;
switch (nameFunction)
{
case "max":
if (value.Count == 0) throw new Exception("ERROR : function max dont have argument");
xx = int.MinValue;
int[] ii = new int[value.Count];
for (int j = 0; j < value.Count; j++)
{
int a = ii[j] = value[j].Value(x);
if (a > xx) xx = a;
}
return xx;
case "min":
if (value.Count == 0) throw new Exception("ERROR : function min dont have argument");
xx = int.MaxValue;
int[] iii = new int[value.Count];
for (int j = 0; j < value.Count; j++)
{
int a = iii[j] = value[j].Value(x);
if (a < xx) xx = a;
}
return xx;
case "abs":
if (value.Count != 1) throw new Exception("ERROR : function abs dont have argument");
xx = value[0].Value(x);
return (xx < 0) ? -xx : xx;
}
throw new Exception("function not exist : " + nameFunction);
}
}
* This source code was highlighted with Source Code Highlighter.