Author: tgoettlicher
Date: Wed Jun 27 16:13:21 2007
New Revision: 5849
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5849&view=rev
Log:
Initial checkin
Added:
branches/tmp/tgoettlicher/usersaver/make (with props)
branches/tmp/tgoettlicher/usersaver/net/
branches/tmp/tgoettlicher/usersaver/net/1header
branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.c
branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.h
branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.net
branches/tmp/tgoettlicher/usersaver/net/hectic
branches/tmp/tgoettlicher/usersaver/net/idle
branches/tmp/tgoettlicher/usersaver/net/noclue
branches/tmp/tgoettlicher/usersaver/net/patterns.pat
branches/tmp/tgoettlicher/usersaver/net/reading
branches/tmp/tgoettlicher/usersaver/net/type
branches/tmp/tgoettlicher/usersaver/usersaver.c
Added: branches/tmp/tgoettlicher/usersaver/make
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/tgoettlicher/usersaver/make?rev=5849&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/usersaver/make (added)
+++ branches/tmp/tgoettlicher/usersaver/make Wed Jun 27 16:13:21 2007
@@ -0,0 +1,2 @@
+ gcc -o usersaver usersaver.c net/SNNS_NET.c -lX11 -lm
+
Added: branches/tmp/tgoettlicher/usersaver/net/1header
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/tgoettlicher/usersaver/net/1header?rev=5849&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/usersaver/net/1header (added)
+++ branches/tmp/tgoettlicher/usersaver/net/1header Wed Jun 27 16:13:21 2007
@@ -0,0 +1,9 @@
+Pattern file:
+SNNS pattern definition file V4.1
+generated at Mon Jun 27 13:11:53 CDT 2007
+
+
+No. of patterns : 34
+No. of input units : 9
+No. of output units : 5
+
Added: branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.c
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.c?rev=5849&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.c (added)
+++ branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.c Wed Jun 27 16:13:21 2007
@@ -0,0 +1,256 @@
+/*********************************************************
+ SNNS_NET.c
+ --------------------------------------------------------
+ generated at Wed Jun 27 13:18:57 2007
+ by snns2c ( Bernward Kett 1995 )
+*********************************************************/
+
+#include
+
+#define Act_Logistic(sum, bias) ( (sum+bias<10000.0) ? ( 1.0/(1.0 + exp(-sum-bias) ) ) : 0.0 )
+#define NULL (void *)0
+
+typedef struct UT {
+ float act; /* Activation */
+ float Bias; /* Bias of the Unit */
+ int NoOfSources; /* Number of predecessor units */
+ struct UT **sources; /* predecessor units */
+ float *weights; /* weights from predecessor units */
+ } UnitType, *pUnit;
+
+ /* Forward Declaration for all unit types */
+ static UnitType Units[26];
+ /* Sources definition section */
+ static pUnit Sources[] = {
+Units + 1, Units + 2, Units + 3, Units + 4, Units + 5, Units + 6, Units + 7, Units + 8, Units + 9, Units + 10,
+Units + 11, Units + 12,
+Units + 1, Units + 2, Units + 3, Units + 4, Units + 5, Units + 6, Units + 7, Units + 8, Units + 9, Units + 10,
+Units + 11, Units + 12,
+Units + 1, Units + 2, Units + 3, Units + 4, Units + 5, Units + 6, Units + 7, Units + 8, Units + 9, Units + 10,
+Units + 11, Units + 12,
+Units + 1, Units + 2, Units + 3, Units + 4, Units + 5, Units + 6, Units + 7, Units + 8, Units + 9, Units + 10,
+Units + 11, Units + 12,
+Units + 1, Units + 2, Units + 3, Units + 4, Units + 5, Units + 6, Units + 7, Units + 8, Units + 9, Units + 10,
+Units + 11, Units + 12,
+Units + 1, Units + 2, Units + 3, Units + 4, Units + 5, Units + 6, Units + 7, Units + 8, Units + 9, Units + 10,
+Units + 11, Units + 12,
+Units + 1, Units + 2, Units + 3, Units + 4, Units + 5, Units + 6, Units + 7, Units + 8, Units + 9, Units + 10,
+Units + 11, Units + 12,
+Units + 1, Units + 2, Units + 3, Units + 4, Units + 5, Units + 6, Units + 7, Units + 8, Units + 9, Units + 10,
+Units + 11, Units + 12,
+Units + 13, Units + 14, Units + 15, Units + 16, Units + 17, Units + 18, Units + 19, Units + 20,
+Units + 13, Units + 14, Units + 15, Units + 16, Units + 17, Units + 18, Units + 19, Units + 20,
+Units + 13, Units + 14, Units + 15, Units + 16, Units + 17, Units + 18, Units + 19, Units + 20,
+Units + 13, Units + 14, Units + 15, Units + 16, Units + 17, Units + 18, Units + 19, Units + 20,
+Units + 13, Units + 14, Units + 15, Units + 16, Units + 17, Units + 18, Units + 19, Units + 20,
+
+ };
+
+ /* Weigths definition section */
+ static float Weights[] = {
+1.976180, 4.981460, 4.674400, -0.902710, 0.328080, -1.099730, 2.588670, -0.126200, 0.719820, 0.051680,
+-0.149180, -0.185040,
+1.976180, 4.981460, 4.674400, -0.902710, 0.328080, -1.099730, 2.588670, -0.126200, 0.719820, 0.051680,
+-0.149180, -0.185040,
+1.976180, 4.981460, 4.674400, -0.902710, 0.328080, -1.099730, 2.588670, -0.126200, 0.719820, 0.051680,
+-0.149180, -0.185040,
+1.976180, 4.981460, 4.674400, -0.902710, 0.328080, -1.099730, 2.588670, -0.126200, 0.719820, 0.051680,
+-0.149180, -0.185040,
+1.976180, 4.981460, 4.674400, -0.902710, 0.328080, -1.099730, 2.588670, -0.126200, 0.719820, 0.051680,
+-0.149180, -0.185040,
+1.976180, 4.981460, 4.674400, -0.902710, 0.328080, -1.099730, 2.588670, -0.126200, 0.719820, 0.051680,
+-0.149180, -0.185040,
+1.976180, 4.981460, 4.674400, -0.902710, 0.328080, -1.099730, 2.588670, -0.126200, 0.719820, 0.051680,
+-0.149180, -0.185040,
+1.976180, 4.981460, 4.674400, -0.902710, 0.328080, -1.099730, 2.588670, -0.126200, 0.719820, 0.051680,
+-0.149180, -0.185040,
+-11.027530, -11.027530, -11.027530, -11.027530, -11.027530, -11.027530, -11.027530, -11.027530,
+3.092150, 3.092150, 3.092150, 3.092150, 3.092150, 3.092150, 3.092150, 3.092150,
+-0.297600, -0.297600, -0.297600, -0.297600, -0.297600, -0.297600, -0.297600, -0.297600,
+0.439710, 0.439710, 0.439710, 0.439710, 0.439710, 0.439710, 0.439710, 0.439710,
+-0.112350, -0.112350, -0.112350, -0.112350, -0.112350, -0.112350, -0.112350, -0.112350,
+
+ };
+
+ /* unit definition section (see also UnitType) */
+ static UnitType Units[26] =
+ {
+ { 0.0, 0.0, 0, NULL , NULL },
+ { /* unit 1 (Old: 1) */
+ 0.0, 0.000000, 0,
+ &Sources[0] ,
+ &Weights[0] ,
+ },
+ { /* unit 2 (Old: 2) */
+ 0.0, 0.000000, 0,
+ &Sources[0] ,
+ &Weights[0] ,
+ },
+ { /* unit 3 (Old: 3) */
+ 0.0, 0.000000, 0,
+ &Sources[0] ,
+ &Weights[0] ,
+ },
+ { /* unit 4 (Old: 4) */
+ 0.0, 0.000000, 0,
+ &Sources[0] ,
+ &Weights[0] ,
+ },
+ { /* unit 5 (Old: 5) */
+ 0.0, 0.000000, 0,
+ &Sources[0] ,
+ &Weights[0] ,
+ },
+ { /* unit 6 (Old: 6) */
+ 0.0, 0.000000, 0,
+ &Sources[0] ,
+ &Weights[0] ,
+ },
+ { /* unit 7 (Old: 7) */
+ 0.0, 0.000000, 0,
+ &Sources[0] ,
+ &Weights[0] ,
+ },
+ { /* unit 8 (Old: 8) */
+ 0.0, 0.000000, 0,
+ &Sources[0] ,
+ &Weights[0] ,
+ },
+ { /* unit 9 (Old: 9) */
+ 0.0, 0.000000, 0,
+ &Sources[0] ,
+ &Weights[0] ,
+ },
+ { /* unit 10 (Old: 10) */
+ 0.0, 0.000000, 0,
+ &Sources[0] ,
+ &Weights[0] ,
+ },
+ { /* unit 11 (Old: 11) */
+ 0.0, 0.000000, 0,
+ &Sources[0] ,
+ &Weights[0] ,
+ },
+ { /* unit 12 (Old: 12) */
+ 0.0, 0.000000, 0,
+ &Sources[0] ,
+ &Weights[0] ,
+ },
+ { /* unit 13 (Old: 13) */
+ 0.0, -3.226190, 12,
+ &Sources[0] ,
+ &Weights[0] ,
+ },
+ { /* unit 14 (Old: 14) */
+ 0.0, -3.226190, 12,
+ &Sources[12] ,
+ &Weights[12] ,
+ },
+ { /* unit 15 (Old: 15) */
+ 0.0, -3.226190, 12,
+ &Sources[24] ,
+ &Weights[24] ,
+ },
+ { /* unit 16 (Old: 16) */
+ 0.0, -3.226190, 12,
+ &Sources[36] ,
+ &Weights[36] ,
+ },
+ { /* unit 17 (Old: 17) */
+ 0.0, -3.226190, 12,
+ &Sources[48] ,
+ &Weights[48] ,
+ },
+ { /* unit 18 (Old: 18) */
+ 0.0, -3.226190, 12,
+ &Sources[60] ,
+ &Weights[60] ,
+ },
+ { /* unit 19 (Old: 19) */
+ 0.0, -3.226190, 12,
+ &Sources[72] ,
+ &Weights[72] ,
+ },
+ { /* unit 20 (Old: 20) */
+ 0.0, -3.226190, 12,
+ &Sources[84] ,
+ &Weights[84] ,
+ },
+ { /* unit 21 (Old: 21) */
+ 0.0, 6.856470, 8,
+ &Sources[96] ,
+ &Weights[96] ,
+ },
+ { /* unit 22 (Old: 22) */
+ 0.0, -22.882820, 8,
+ &Sources[104] ,
+ &Weights[104] ,
+ },
+ { /* unit 23 (Old: 23) */
+ 0.0, -0.429900, 8,
+ &Sources[112] ,
+ &Weights[112] ,
+ },
+ { /* unit 24 (Old: 24) */
+ 0.0, -2.819950, 8,
+ &Sources[120] ,
+ &Weights[120] ,
+ },
+ { /* unit 25 (Old: 25) */
+ 0.0, -0.751220, 8,
+ &Sources[128] ,
+ &Weights[128] ,
+ }
+
+ };
+
+
+
+int SNNS_NET(float *in, float *out, int init)
+{
+ int member, source;
+ float sum;
+ enum{OK, Error, Not_Valid};
+ pUnit unit;
+
+
+ /* layer definition section (names & member units) */
+
+ static pUnit Input[12] = {Units + 1, Units + 2, Units + 3, Units + 4, Units + 5, Units + 6, Units + 7, Units + 8, Units + 9, Units + 10, Units + 11, Units + 12}; /* members */
+
+ static pUnit Hidden1[8] = {Units + 13, Units + 14, Units + 15, Units + 16, Units + 17, Units + 18, Units + 19, Units + 20}; /* members */
+
+ static pUnit Output1[5] = {Units + 21, Units + 22, Units + 23, Units + 24, Units + 25}; /* members */
+
+ static int Output[5] = {21, 22, 23, 24, 25};
+
+ for(member = 0; member < 12; member++) {
+ Input[member]->act = in[member];
+ }
+
+ for (member = 0; member < 8; member++) {
+ unit = Hidden1[member];
+ sum = 0.0;
+ for (source = 0; source < unit->NoOfSources; source++) {
+ sum += unit->sources[source]->act
+ * unit->weights[source];
+ }
+ unit->act = Act_Logistic(sum, unit->Bias);
+ };
+
+ for (member = 0; member < 5; member++) {
+ unit = Output1[member];
+ sum = 0.0;
+ for (source = 0; source < unit->NoOfSources; source++) {
+ sum += unit->sources[source]->act
+ * unit->weights[source];
+ }
+ unit->act = Act_Logistic(sum, unit->Bias);
+ };
+
+ for(member = 0; member < 5; member++) {
+ out[member] = Units[Output[member]].act;
+ }
+
+ return(OK);
+}
Added: branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.h?rev=5849&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.h (added)
+++ branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.h Wed Jun 27 16:13:21 2007
@@ -0,0 +1,14 @@
+/*********************************************************
+ SNNS_NET.h
+ --------------------------------------------------------
+ generated at Wed Jun 27 13:18:57 2007
+ by snns2c ( Bernward Kett 1995 )
+*********************************************************/
+
+extern int SNNS_NET(float *in, float *out, int init);
+
+static struct {
+ int NoOfInput; /* Number of Input Units */
+ int NoOfOutput; /* Number of Output Units */
+ int(* propFunc)(float *, float*, int);
+} SNNS_NETREC = {12,5,SNNS_NET};
Added: branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.net
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.net?rev=5849&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.net (added)
+++ branches/tmp/tgoettlicher/usersaver/net/SNNS_NET.net Wed Jun 27 16:13:21 2007
@@ -0,0 +1,81 @@
+SNNS network definition file V1.4-3D
+generated at Wed Jun 27 13:16:33 2007
+
+network name : SNNS_NET
+source files :
+no. of units : 25
+no. of connections : 136
+no. of unit types : 0
+no. of site types : 0
+
+
+learning function : Std_Backpropagation
+update function : Topological_Order
+
+
+unit default section :
+
+act | bias | st | subnet | layer | act func | out func
+---------|----------|----|--------|-------|--------------|-------------
+ 0.00000 | 0.00000 | h | 0 | 1 | Act_Logistic | Out_Identity
+---------|----------|----|--------|-------|--------------|-------------
+
+
+unit definition section :
+
+no. | typeName | unitName | act | bias | st | position | act func | out func | sites
+----|----------|----------|----------|----------|----|----------|----------|----------|-------
+ 1 | | | 0.51419 | 0.00000 | i | 2, 2,32472 |||
+ 2 | | | 0.52476 | 0.00000 | i | 2, 3,32472 |||
+ 3 | | | 0.26983 | 0.00000 | i | 2, 4,32472 |||
+ 4 | | | 0.51419 | 0.00000 | i | 2, 5,32472 |||
+ 5 | | | 0.52476 | 0.00000 | i | 2, 6,32472 |||
+ 6 | | | 0.26983 | 0.00000 | i | 2, 7,32472 |||
+ 7 | | | 0.51419 | 0.00000 | i | 2, 8,32472 |||
+ 8 | | | 0.52476 | 0.00000 | i | 2, 9,32472 |||
+ 9 | | | 0.26983 | 0.00000 | i | 2,10,32472 |||
+ 10 | | | 0.00000 | 0.00000 | i | 2,11,32472 |||
+ 11 | | | 0.00000 | 0.00000 | i | 2,12,32472 |||
+ 12 | | | 0.00000 | 0.00000 | i | 2,13,32472 |||
+ 13 | | | 0.41555 | -3.22619 | h | 5, 2,32472 |||
+ 14 | | | 0.41555 | -3.22619 | h | 5, 3,32472 |||
+ 15 | | | 0.41555 | -3.22619 | h | 5, 4,32472 |||
+ 16 | | | 0.41555 | -3.22619 | h | 5, 5,32472 |||
+ 17 | | | 0.41555 | -3.22619 | h | 5, 6,32472 |||
+ 18 | | | 0.41555 | -3.22619 | h | 5, 7,32472 |||
+ 19 | | | 0.41555 | -3.22619 | h | 5, 8,32472 |||
+ 20 | | | 0.41555 | -3.22619 | h | 5, 9,32472 |||
+ 21 | | | 0.00000 | 6.85647 | o | 8, 2,32472 |||
+ 22 | | | 1.00000 | -22.88282 | o | 8, 3,32472 |||
+ 23 | | | 0.00000 | -0.42990 | o | 8, 4,32472 |||
+ 24 | | | 0.00000 | -2.81995 | o | 8, 5,32472 |||
+ 25 | | | 0.00000 | -0.75122 | o | 8, 6,32472 |||
+----|----------|----------|----------|----------|----|----------|----------|----------|-------
+
+
+connection definition section :
+
+target | site | source:weight
+-------|------|---------------------------------------------------------------------------------------------------------------------
+ 13 | | 1: 1.97618, 2: 4.98146, 3: 4.67440, 4:-0.90271, 5: 0.32808, 6:-1.09973, 7: 2.58867, 8:-0.12620, 9: 0.71982,
+ 10: 0.05168, 11:-0.14918, 12:-0.18504
+ 14 | | 1: 1.97618, 2: 4.98146, 3: 4.67440, 4:-0.90271, 5: 0.32808, 6:-1.09973, 7: 2.58867, 8:-0.12620, 9: 0.71982,
+ 10: 0.05168, 11:-0.14918, 12:-0.18504
+ 15 | | 1: 1.97618, 2: 4.98146, 3: 4.67440, 4:-0.90271, 5: 0.32808, 6:-1.09973, 7: 2.58867, 8:-0.12620, 9: 0.71982,
+ 10: 0.05168, 11:-0.14918, 12:-0.18504
+ 16 | | 1: 1.97618, 2: 4.98146, 3: 4.67440, 4:-0.90271, 5: 0.32808, 6:-1.09973, 7: 2.58867, 8:-0.12620, 9: 0.71982,
+ 10: 0.05168, 11:-0.14918, 12:-0.18504
+ 17 | | 1: 1.97618, 2: 4.98146, 3: 4.67440, 4:-0.90271, 5: 0.32808, 6:-1.09973, 7: 2.58867, 8:-0.12620, 9: 0.71982,
+ 10: 0.05168, 11:-0.14918, 12:-0.18504
+ 18 | | 1: 1.97618, 2: 4.98146, 3: 4.67440, 4:-0.90271, 5: 0.32808, 6:-1.09973, 7: 2.58867, 8:-0.12620, 9: 0.71982,
+ 10: 0.05168, 11:-0.14918, 12:-0.18504
+ 19 | | 1: 1.97618, 2: 4.98146, 3: 4.67440, 4:-0.90271, 5: 0.32808, 6:-1.09973, 7: 2.58867, 8:-0.12620, 9: 0.71982,
+ 10: 0.05168, 11:-0.14918, 12:-0.18504
+ 20 | | 1: 1.97618, 2: 4.98146, 3: 4.67440, 4:-0.90271, 5: 0.32808, 6:-1.09973, 7: 2.58867, 8:-0.12620, 9: 0.71982,
+ 10: 0.05168, 11:-0.14918, 12:-0.18504
+ 21 | | 13:-11.02753, 14:-11.02753, 15:-11.02753, 16:-11.02753, 17:-11.02753, 18:-11.02753, 19:-11.02753, 20:-11.02753
+ 22 | | 13: 3.09215, 14: 3.09215, 15: 3.09215, 16: 3.09215, 17: 3.09215, 18: 3.09215, 19: 3.09215, 20: 3.09215
+ 23 | | 13:-0.29760, 14:-0.29760, 15:-0.29760, 16:-0.29760, 17:-0.29760, 18:-0.29760, 19:-0.29760, 20:-0.29760
+ 24 | | 13: 0.43971, 14: 0.43971, 15: 0.43971, 16: 0.43971, 17: 0.43971, 18: 0.43971, 19: 0.43971, 20: 0.43971
+ 25 | | 13:-0.11235, 14:-0.11235, 15:-0.11235, 16:-0.11235, 17:-0.11235, 18:-0.11235, 19:-0.11235, 20:-0.11235
+-------|------|---------------------------------------------------------------------------------------------------------------------
Added: branches/tmp/tgoettlicher/usersaver/net/hectic
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/tgoettlicher/usersaver/net/hectic?rev=5849&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/usersaver/net/hectic (added)
+++ branches/tmp/tgoettlicher/usersaver/net/hectic Wed Jun 27 16:13:21 2007
@@ -0,0 +1,24 @@
+#input pattern hectic1
+0.514189 0.524762 0.269827 0.514189 0.524762 0.269827 0.514189 0.524762 0.269827 0.000000 0.000000 0.000000
+#output pattern hectic1
+0 1 0 0 0
+#input pattern hectic2
+0.592568 0.804762 0.476876 0.592568 0.804762 0.476876 0.592568 0.804762 0.476876 0.000000 0.000000 0.000000
+#output pattern hectic2
+0 1 0 0 0
+#input pattern hectic3
+0.657770 0.505714 0.332644 0.657770 0.804762 0.529348 0.657770 0.804762 0.529348 0.000000 0.000000 0.000000
+#output pattern hectic3
+0 1 0 0 0
+#input pattern hectic4
+0.328716 0.658095 0.216327 0.851351 0.806667 0.686757 0.851351 0.806667 0.686757 0.000000 0.000000 0.000000
+#output pattern hectic4
+0 1 0 0 0
+#input pattern hectic5
+0.462162 0.957143 0.442355 0.851351 0.957143 0.814865 0.851351 0.957143 0.814865 0.000000 0.000000 0.000000
+#output pattern hectic5
+0 1 0 0 0
+#input pattern hectic6
+0.753716 0.822857 0.620201 0.797297 0.957143 0.763127 0.851351 0.957143 0.814865 0.000000 0.000000 0.000000
+#output pattern hectic6
+0 1 0 0 0
Added: branches/tmp/tgoettlicher/usersaver/net/idle
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/tgoettlicher/usersaver/net/idle?rev=5849&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/usersaver/net/idle (added)
+++ branches/tmp/tgoettlicher/usersaver/net/idle Wed Jun 27 16:13:21 2007
@@ -0,0 +1,28 @@
+#input pattern idle1
+0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
+#output pattern idle1
+1 0 0 0 0
+#input pattern idle2
+0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
+#output pattern idle2
+1 0 0 0 0
+#input pattern idle3
+0.035135 0.072381 0.002543 0.035135 0.072381 0.002543 0.035135 0.072381 0.002543 0.000000 0.000000 0.000000
+#output pattern idle3
+1 0 0 0 0
+#input pattern idle4
+0.035135 0.072381 0.002543 0.035135 0.072381 0.002543 0.035135 0.072381 0.002543 0.000000 0.000000 0.000000
+#output pattern idle4
+1 0 0 0 0
+#input pattern idle5
+0.005068 0.026667 0.000135 0.035135 0.072381 0.002543 0.035135 0.072381 0.002543 0.000000 0.000000 0.000000
+#output pattern idle5
+1 0 0 0 0
+#input pattern idle6
+0.075338 0.011429 0.000861 0.075676 0.038095 0.002883 0.105743 0.072381 0.007654 0.000000 0.000000 0.000000
+#output pattern idle6
+1 0 0 0 0
+#input pattern idle7
+0.075338 0.011429 0.000861 0.075676 0.038095 0.002883 0.105743 0.072381 0.007654 0.000000 0.000000 0.000000
+#output pattern idle7
+1 0 0 0 0
Added: branches/tmp/tgoettlicher/usersaver/net/noclue
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/tgoettlicher/usersaver/net/noclue?rev=5849&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/usersaver/net/noclue (added)
+++ branches/tmp/tgoettlicher/usersaver/net/noclue Wed Jun 27 16:13:21 2007
@@ -0,0 +1,36 @@
+#input pattern noclue1
+0.054054 0.121905 0.006589 0.054054 0.121905 0.006589 0.054054 0.121905 0.006589 0.000000 0.000000 0.000000
+#output pattern noclue1
+0 0 0 1 0
+#input pattern noclue2
+0.645270 0.142857 0.092181 0.645270 0.142857 0.092181 0.645270 0.142857 0.092181 0.000000 0.000000 0.000000
+#output pattern noclue2
+0 0 0 1 0
+#input pattern noclue3
+0.025338 0.741905 0.018798 0.670608 0.768571 0.515410 0.670608 0.768571 0.515410 0.000000 0.000000 0.000000
+#output pattern noclue3
+0 0 0 1 0
+#input pattern noclue4
+0.026014 0.741905 0.019300 0.616216 0.752381 0.463629 0.671284 0.768571 0.515930 0.000000 0.000000 0.000000
+#output pattern noclue4
+0 0 0 1 0
+#input pattern noclue5
+0.259459 0.386667 0.100324 0.259459 0.741905 0.192494 0.671284 0.768571 0.515930 0.000000 0.000000 0.000000
+#output pattern noclue5
+0 0 0 1 0
+#input pattern noclue6
+0.685811 0.330476 0.226644 0.706757 0.741905 0.524346 0.706757 0.768571 0.543193 0.000000 0.000000 0.000000
+#output pattern noclue6
+0 0 0 1 0
+#input pattern noclue7
+0.018919 0.685714 0.012973 0.685811 0.726667 0.498356 0.706757 0.782857 0.553290 0.000000 0.000000 0.000000
+#output pattern noclue7
+0 0 0 1 0
+#input pattern noclue8
+0.531081 0.685714 0.364170 0.531081 0.686667 0.364676 0.706757 0.782857 0.553290 0.000000 0.000000 0.000000
+#output pattern noclue8
+0 0 0 1 0
+#input pattern noclue9
+0.526014 0.281905 0.148286 0.531081 0.685714 0.364170 0.706757 0.782857 0.553290 0.000000 0.000000 0.000000
+#output pattern noclue9
+0 0 0 1 0
Added: branches/tmp/tgoettlicher/usersaver/net/patterns.pat
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/tgoettlicher/usersaver/net/patterns.pat?rev=5849&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/usersaver/net/patterns.pat (added)
+++ branches/tmp/tgoettlicher/usersaver/net/patterns.pat Wed Jun 27 16:13:21 2007
@@ -0,0 +1,160 @@
+SNNS pattern definition file V3.2
+generated at Mon Jun 27 13:11:53 CDT 2007
+
+
+No. of patterns : 38
+No. of input units : 12
+No. of output units : 5
+
+#input pattern hectic1
+0.514189 0.524762 0.269827 0.514189 0.524762 0.269827 0.514189 0.524762 0.269827 0.000000 0.000000 0.000000
+#output pattern hectic1
+0 1 0 0 0
+#input pattern hectic2
+0.592568 0.804762 0.476876 0.592568 0.804762 0.476876 0.592568 0.804762 0.476876 0.000000 0.000000 0.000000
+#output pattern hectic2
+0 1 0 0 0
+#input pattern hectic3
+0.657770 0.505714 0.332644 0.657770 0.804762 0.529348 0.657770 0.804762 0.529348 0.000000 0.000000 0.000000
+#output pattern hectic3
+0 1 0 0 0
+#input pattern hectic4
+0.328716 0.658095 0.216327 0.851351 0.806667 0.686757 0.851351 0.806667 0.686757 0.000000 0.000000 0.000000
+#output pattern hectic4
+0 1 0 0 0
+#input pattern hectic5
+0.462162 0.957143 0.442355 0.851351 0.957143 0.814865 0.851351 0.957143 0.814865 0.000000 0.000000 0.000000
+#output pattern hectic5
+0 1 0 0 0
+#input pattern hectic6
+0.753716 0.822857 0.620201 0.797297 0.957143 0.763127 0.851351 0.957143 0.814865 0.000000 0.000000 0.000000
+#output pattern hectic6
+0 1 0 0 0
+#input pattern idle1
+0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
+#output pattern idle1
+1 0 0 0 0
+#input pattern idle2
+0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
+#output pattern idle2
+1 0 0 0 0
+#input pattern idle3
+0.035135 0.072381 0.002543 0.035135 0.072381 0.002543 0.035135 0.072381 0.002543 0.000000 0.000000 0.000000
+#output pattern idle3
+1 0 0 0 0
+#input pattern idle4
+0.035135 0.072381 0.002543 0.035135 0.072381 0.002543 0.035135 0.072381 0.002543 0.000000 0.000000 0.000000
+#output pattern idle4
+1 0 0 0 0
+#input pattern idle5
+0.005068 0.026667 0.000135 0.035135 0.072381 0.002543 0.035135 0.072381 0.002543 0.000000 0.000000 0.000000
+#output pattern idle5
+1 0 0 0 0
+#input pattern idle6
+0.075338 0.011429 0.000861 0.075676 0.038095 0.002883 0.105743 0.072381 0.007654 0.000000 0.000000 0.000000
+#output pattern idle6
+1 0 0 0 0
+#input pattern idle7
+0.075338 0.011429 0.000861 0.075676 0.038095 0.002883 0.105743 0.072381 0.007654 0.000000 0.000000 0.000000
+#output pattern idle7
+1 0 0 0 0
+#input pattern noclue1
+0.054054 0.121905 0.006589 0.054054 0.121905 0.006589 0.054054 0.121905 0.006589 0.000000 0.000000 0.000000
+#output pattern noclue1
+0 0 0 1 0
+#input pattern noclue2
+0.645270 0.142857 0.092181 0.645270 0.142857 0.092181 0.645270 0.142857 0.092181 0.000000 0.000000 0.000000
+#output pattern noclue2
+0 0 0 1 0
+#input pattern noclue3
+0.025338 0.741905 0.018798 0.670608 0.768571 0.515410 0.670608 0.768571 0.515410 0.000000 0.000000 0.000000
+#output pattern noclue3
+0 0 0 1 0
+#input pattern noclue4
+0.026014 0.741905 0.019300 0.616216 0.752381 0.463629 0.671284 0.768571 0.515930 0.000000 0.000000 0.000000
+#output pattern noclue4
+0 0 0 1 0
+#input pattern noclue5
+0.259459 0.386667 0.100324 0.259459 0.741905 0.192494 0.671284 0.768571 0.515930 0.000000 0.000000 0.000000
+#output pattern noclue5
+0 0 0 1 0
+#input pattern noclue6
+0.685811 0.330476 0.226644 0.706757 0.741905 0.524346 0.706757 0.768571 0.543193 0.000000 0.000000 0.000000
+#output pattern noclue6
+0 0 0 1 0
+#input pattern noclue7
+0.018919 0.685714 0.012973 0.685811 0.726667 0.498356 0.706757 0.782857 0.553290 0.000000 0.000000 0.000000
+#output pattern noclue7
+0 0 0 1 0
+#input pattern noclue8
+0.531081 0.685714 0.364170 0.531081 0.686667 0.364676 0.706757 0.782857 0.553290 0.000000 0.000000 0.000000
+#output pattern noclue8
+0 0 0 1 0
+#input pattern noclue9
+0.526014 0.281905 0.148286 0.531081 0.685714 0.364170 0.706757 0.782857 0.553290 0.000000 0.000000 0.000000
+#output pattern noclue9
+0 0 0 1 0
+#input pattern reading1
+0.244257 0.418095 0.102123 0.245608 0.418095 0.102688 0.245608 0.418095 0.102688 0.000000 0.000000 0.000000
+#output pattern reading1
+0 0 1 0 0
+#input pattern reading2
+0.202703 0.107619 0.021815 0.244257 0.420952 0.102820 0.245608 0.420952 0.103389 0.000000 0.000000 0.000000
+#output pattern reading2
+0 0 1 0 0
+#input pattern reading3
+0.222297 0.045714 0.010162 0.263851 0.456190 0.120366 0.265203 0.456190 0.120983 0.000000 0.000000 0.000000
+#output pattern reading3
+0 0 1 0 0
+#input pattern reading4
+0.221959 0.060952 0.013529 0.222297 0.168571 0.037473 0.265203 0.481905 0.127802 0.000000 0.000000 0.000000
+#output pattern reading4
+0 0 1 0 0
+#input pattern reading5
+0.207432 0.043810 0.009088 0.221959 0.104762 0.023253 0.265203 0.525714 0.139421 0.000000 0.000000 0.000000
+#output pattern reading5
+0 0 1 0 0
+#input pattern reading6
+0.212838 0.043810 0.009324 0.218243 0.069524 0.015173 0.265203 0.525714 0.139421 0.000000 0.000000 0.000000
+#output pattern reading6
+0 0 1 0 0
+#input pattern reading7
+0.220946 0.013333 0.002946 0.220946 0.046667 0.010311 0.265203 0.528571 0.140179 0.000000 0.000000 0.000000
+#output pattern reading7
+0 0 1 0 0
+#input pattern reading8
+0.211824 0.025714 0.005447 0.220946 0.059048 0.013046 0.263851 0.540952 0.142731 0.000000 0.000000 0.000000
+#output pattern reading8
+0 0 1 0 0
+#input pattern typing1
+0.193243 0.114286 0.022085 0.193243 0.114286 0.022085 0.193243 0.114286 0.022085 0.003000 0.003000 0.003000
+#output pattern typing1
+0 0 0 0 1
+#input pattern typing2
+0.209459 0.114286 0.023938 0.209459 0.114286 0.023938 0.209459 0.114286 0.023938 0.009000 0.009000 0.009000
+#output pattern typing2
+0 0 0 0 1
+#input pattern typing3
+0.412500 0.093333 0.038500 0.535473 0.166667 0.089245 0.535473 0.166667 0.089245 0.014000 0.017000 0.017000
+#output pattern typing3
+0 0 0 0 1
+#input pattern typing4
+0.397635 0.220952 0.087858 0.507095 0.220952 0.112044 0.535473 0.220952 0.118314 0.003000 0.017000 0.020000
+#output pattern typing4
+0 0 0 0 1
+#input pattern typing5
+0.397635 0.220952 0.087858 0.507095 0.220952 0.112044 0.535473 0.220952 0.118314 0.013000 0.021000 0.030000
+#output pattern typing5
+0 0 0 0 1
+#input pattern typing6
+0.000000 0.000000 0.000000 0.397635 0.220952 0.087858 0.535473 0.220952 0.118314 0.030000 0.033000 0.050000
+#output pattern typing6
+0 0 0 0 1
+#input pattern typing7
+0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.535473 0.220952 0.118314 0.004000 0.034000 0.054000
+#output pattern typing7
+0 0 0 0 1
+#input pattern typing8
+0.169595 0.215238 0.036503 0.169595 0.215238 0.036503 0.535473 0.220952 0.118314 0.011000 0.031000 0.061000
+#output pattern typing8
+0 0 0 0 1
Added: branches/tmp/tgoettlicher/usersaver/net/reading
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/tgoettlicher/usersaver/net/reading?rev=5849&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/usersaver/net/reading (added)
+++ branches/tmp/tgoettlicher/usersaver/net/reading Wed Jun 27 16:13:21 2007
@@ -0,0 +1,32 @@
+#input pattern reading1
+0.244257 0.418095 0.102123 0.245608 0.418095 0.102688 0.245608 0.418095 0.102688 0.000000 0.000000 0.000000
+#output pattern reading1
+0 0 1 0 0
+#input pattern reading2
+0.202703 0.107619 0.021815 0.244257 0.420952 0.102820 0.245608 0.420952 0.103389 0.000000 0.000000 0.000000
+#output pattern reading2
+0 0 1 0 0
+#input pattern reading3
+0.222297 0.045714 0.010162 0.263851 0.456190 0.120366 0.265203 0.456190 0.120983 0.000000 0.000000 0.000000
+#output pattern reading3
+0 0 1 0 0
+#input pattern reading4
+0.221959 0.060952 0.013529 0.222297 0.168571 0.037473 0.265203 0.481905 0.127802 0.000000 0.000000 0.000000
+#output pattern reading4
+0 0 1 0 0
+#input pattern reading5
+0.207432 0.043810 0.009088 0.221959 0.104762 0.023253 0.265203 0.525714 0.139421 0.000000 0.000000 0.000000
+#output pattern reading5
+0 0 1 0 0
+#input pattern reading6
+0.212838 0.043810 0.009324 0.218243 0.069524 0.015173 0.265203 0.525714 0.139421 0.000000 0.000000 0.000000
+#output pattern reading6
+0 0 1 0 0
+#input pattern reading7
+0.220946 0.013333 0.002946 0.220946 0.046667 0.010311 0.265203 0.528571 0.140179 0.000000 0.000000 0.000000
+#output pattern reading7
+0 0 1 0 0
+#input pattern reading8
+0.211824 0.025714 0.005447 0.220946 0.059048 0.013046 0.263851 0.540952 0.142731 0.000000 0.000000 0.000000
+#output pattern reading8
+0 0 1 0 0
Added: branches/tmp/tgoettlicher/usersaver/net/type
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/tgoettlicher/usersaver/net/type?rev=5849&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/usersaver/net/type (added)
+++ branches/tmp/tgoettlicher/usersaver/net/type Wed Jun 27 16:13:21 2007
@@ -0,0 +1,32 @@
+#input pattern typing1
+0.193243 0.114286 0.022085 0.193243 0.114286 0.022085 0.193243 0.114286 0.022085 0.003000 0.003000 0.003000
+#output pattern typing1
+0 0 0 0 1
+#input pattern typing2
+0.209459 0.114286 0.023938 0.209459 0.114286 0.023938 0.209459 0.114286 0.023938 0.009000 0.009000 0.009000
+#output pattern typing2
+0 0 0 0 1
+#input pattern typing3
+0.412500 0.093333 0.038500 0.535473 0.166667 0.089245 0.535473 0.166667 0.089245 0.014000 0.017000 0.017000
+#output pattern typing3
+0 0 0 0 1
+#input pattern typing4
+0.397635 0.220952 0.087858 0.507095 0.220952 0.112044 0.535473 0.220952 0.118314 0.003000 0.017000 0.020000
+#output pattern typing4
+0 0 0 0 1
+#input pattern typing5
+0.397635 0.220952 0.087858 0.507095 0.220952 0.112044 0.535473 0.220952 0.118314 0.013000 0.021000 0.030000
+#output pattern typing5
+0 0 0 0 1
+#input pattern typing6
+0.000000 0.000000 0.000000 0.397635 0.220952 0.087858 0.535473 0.220952 0.118314 0.030000 0.033000 0.050000
+#output pattern typing6
+0 0 0 0 1
+#input pattern typing7
+0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.535473 0.220952 0.118314 0.004000 0.034000 0.054000
+#output pattern typing7
+0 0 0 0 1
+#input pattern typing8
+0.169595 0.215238 0.036503 0.169595 0.215238 0.036503 0.535473 0.220952 0.118314 0.011000 0.031000 0.061000
+#output pattern typing8
+0 0 0 0 1
Added: branches/tmp/tgoettlicher/usersaver/usersaver.c
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/tgoettlicher/usersaver/usersaver.c?rev=5849&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/usersaver/usersaver.c (added)
+++ branches/tmp/tgoettlicher/usersaver/usersaver.c Wed Jun 27 16:13:21 2007
@@ -0,0 +1,266 @@
+/*
+ * Compile: gcc -o usersaver usersaver.c -lX11 -lm
+ *
+ * Run: usersaver displayname:0
+ *
+ * Code borrowed from xkey.c
+ *
+ */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "net/SNNS_NET.h"
+
+
+typedef struct {
+ int x;
+ int y;
+ int time;
+} MousePosition;
+
+typedef struct {
+ int keycode;
+ int time;
+} KeyStroke;
+
+
+
+
+void analyze();
+int analyzeKeyStrokes(int interval);
+void analyzeMouseMoves(int interval, int *x, int *y, int *a);
+void handleEvent(XEvent xev);
+Display *d;
+
+MousePosition mouseHistory[1000];
+int mouseHistoryMarker = 0;
+
+KeyStroke keyHistory[1000];
+int keyHistoryMarker = 0;
+
+
+
+static int ErrorHandler(Display *d, XErrorEvent *e)
+{
+ // do nothing;
+}
+
+
+
+void snoop_all_windows(Window root, unsigned long type)
+{
+ static int level = 0;
+ Window parent, *children, *child2;
+ unsigned int nchildren;
+ int stat, i,j,k;
+
+ level++;
+
+ stat = XQueryTree(d, root, &root, &parent, &children, &nchildren);
+ if (stat == FALSE)
+ return;
+
+ if (nchildren == 0)
+ return;
+
+ XSelectInput(d, root, type);
+
+ for(i=0; i < nchildren; i++)
+ {
+ XSelectInput(d, children[i], type);
+ snoop_all_windows(children[i], type);
+ }
+
+ XFree((char *)children);
+}
+
+
+int main(int argc, char **argv)
+{
+ char *hostname;
+ char *string;
+ XEvent xev;
+
+ if (argv[1] == NULL)
+ hostname = ":0";
+ else
+ hostname = argv[1];
+
+ d = XOpenDisplay(hostname);
+ if (d == NULL)
+ {
+ fprintf(stderr, "Can't open display: %s\n", hostname);
+ exit(10);
+ }
+
+
+ printf("Usersaver\n");
+
+ XSetErrorHandler(ErrorHandler);
+
+ while(1)
+ {
+ snoop_all_windows(DefaultRootWindow(d), KeyPressMask | PointerMotionMask );
+
+ while ( XCheckMaskEvent(d, KeyPressMask | PointerMotionMask, &xev) )
+ handleEvent(xev);
+
+ analyze();
+
+ }
+}
+
+void analyze()
+{
+ int x1, y1, x3, y3, x10, y10, a1, a3, a10;
+ int k1, k3, k10;
+ int i;
+ float max_emo=0;
+ int emo=0;
+ char *emos[]={ "idle","hectic","reading","no clue", "typing" };
+
+
+ float input[12];
+ float output[5];
+
+ float width=2960.0, height=1050.0;
+
+ analyzeMouseMoves(1, &x1, &y1, &a1);
+ analyzeMouseMoves(3, &x3, &y3, &a3);
+ analyzeMouseMoves(10, &x10, &y10, &a10);
+
+ k1 = analyzeKeyStrokes(1);
+ k3 = analyzeKeyStrokes(3);
+ k10 = analyzeKeyStrokes(10);
+
+/*
+ printf("%f %f %f ", x1 / width , y1 / height , a1 / width / height);
+ printf("%f %f %f ", x3 / width , y3 / height , a3 / width / height);
+ printf("%f %f %f ", x10 / width , y10 / height , a10 / width / height);
+ printf("%f %f %f\n", k1/1000.0, k3/1000.0, k10/1000.0);
+*/
+
+ input[ 0]=x1/width;
+ input[ 1]=y1/height;
+ input[ 2]=a1/height/width;
+ input[ 3]=x3/width;
+ input[ 4]=y3/height;
+ input[ 5]=a3/height/width;
+ input[ 6]=x10/width;
+ input[ 7]=y10/height;
+ input[ 8]=a10/height/width;
+ input[ 9]=k1/1000.0;
+ input[10]=k3/1000.0;
+ input[11]=k10/1000.0;
+
+ SNNS_NET ( input, output , 0);
+
+
+
+
+ for (i=0; i <5 ; ++i)
+ {
+ if (output[i] > max_emo)
+ {
+ max_emo=output[i];
+ emo=i;
+ }
+ }
+
+ printf ("%f\t%f\t%f\t%f\t%f\t[%s] \r", output[0], output[1], output[2], output[3], output[4], emos[emo]);
+
+ fflush(stdout);
+
+}
+
+
+int analyzeKeyStrokes(int interval)
+{
+ int k=0;
+ int now=time(0);
+ int i=0;
+
+ for (i=0; i<1000; ++i)
+ {
+ if (keyHistory[i].time >= now - interval)
+ k++;
+ }
+ return k;
+}
+
+
+
+void analyzeMouseMoves(int interval, int *x, int *y, int *a)
+{
+
+ int max_x=0, max_y=0;
+ int min_x=99999999, min_y=9999999; // why does MAX_INT not work
+ int i=0;
+ int now=time(0);
+
+ int delta_x = 0;
+ int delta_y = 0;
+ int delta_a = 0;
+
+ for (i=0; i<1000; ++i)
+ {
+ if (mouseHistory[i].time >= now - interval)
+ {
+ if (mouseHistory[i].x > max_x)
+ max_x = mouseHistory[i].x;
+ if (mouseHistory[i].y > max_y)
+ max_y = mouseHistory[i].y;
+ if (mouseHistory[i].x < min_x)
+ min_x = mouseHistory[i].x;
+ if (mouseHistory[i].y < min_y)
+ min_y = mouseHistory[i].y;
+ }
+ }
+
+ delta_x = max_x - min_x;
+ delta_y = max_y - min_y;
+
+ if (delta_x < 0) delta_x = 0;
+ if (delta_y < 0) delta_y = 0;
+
+
+ *x = delta_x;
+ *y = delta_y;
+ *a = delta_x* delta_y;
+
+
+
+}
+
+
+
+void handleEvent(XEvent xev)
+{
+ switch (xev.type)
+ {
+ case KeyPress:
+ keyHistory[keyHistoryMarker].keycode = xev.xkey.keycode;
+ keyHistory[keyHistoryMarker].time = time(0);
+
+ keyHistoryMarker++;
+ keyHistoryMarker%=1000;
+
+ break;
+
+ case MotionNotify:
+ mouseHistory[mouseHistoryMarker].x = xev.xkey.x_root;
+ mouseHistory[mouseHistoryMarker].y = xev.xkey.y_root;
+ mouseHistory[mouseHistoryMarker].time = time(0);
+
+ mouseHistoryMarker++;
+ mouseHistoryMarker%=1000;
+
+ break;
+ }
+}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org