[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Bug reports
. . -> [Subject]  default lists for utils.multilistbox don't work properly
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: default lists for utils.multilistbox don't work properly
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  

Posted by Nick Gammon   Australia  (19,499 posts)  [Biography] bio   Forum Administrator
Date Tue 26 Jul 2011 08:44 PM (UTC)  quote  ]
Message
Twisol said:

Nick Gammon said:
What law did it break?

"This program has performed an illegal operation and will be shut down."


That reminds me of the people who call up call centers and complain that their computer told them they are doing something illegal.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (1,010 posts)  [Biography] bio   Global Moderator
Date Tue 26 Jul 2011 02:34 PM (UTC)  quote  ]

Amended on Tue 26 Jul 2011 02:36 PM (UTC) by Fiendish

Message
"You are in violation of the law!"
"You're in violation of your face!"

It seems gmail is very aggressive about blocking zipped executables.

http://aardwolfclientpackage.googlecode.com/
https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Twisol   USA  (2,230 posts)  [Biography] bio
Date Tue 26 Jul 2011 11:16 AM (UTC)  quote  ]
Message
Nick Gammon said:
What law did it break?

"This program has performed an illegal operation and will be shut down."

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (19,499 posts)  [Biography] bio   Forum Administrator
Date Tue 26 Jul 2011 10:33 AM (UTC)  quote  ]

Amended on Tue 26 Jul 2011 10:34 AM (UTC) by Nick Gammon

Message
Fiendish said:

Thanks, I got the email.


Not my original one I presume?


This Message was undeliverable due to the following reason:

Your message is larger than the destination computer is willing to
accept, so it was returned.  The error message below indicates the
size of your message and the maximum size allowed by the receiving
E-mail system.  You may be able to split your message into several
smaller pieces and have them delivered separately.

Your message was rejected by gmail-smtp-in.l.google.com for the following reason:

    5.7.0 Our system detected an illegal attachment on your message. Please
    5.7.0 visit http://mail.google.com/support/bin/answer.py?answer=6590 to
    5.7.0 review our attachment guidelines. m2si18421449pbj.63

The following recipients did not receive this message:

...


So my attachment was illegal, eh?


Illegal

contrary to or forbidden by law, esp. criminal law: illegal drugs.


What law did it break?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (19,499 posts)  [Biography] bio   Forum Administrator
Date Tue 26 Jul 2011 10:28 AM (UTC)  quote  ]
Message
I shouldn't have to pre-sort things to work around what is increasingly looking like a problem in Wine. It looks like LuaJIT is triggering the problem by the way it is hashing things, but really the core problem is that the listbox is not functioning as documented, as evidenced by its correct behaviour under Windows.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (1,010 posts)  [Biography] bio   Global Moderator
Date Tue 26 Jul 2011 07:04 AM (UTC)  quote  ]

Amended on Tue 26 Jul 2011 07:07 AM (UTC) by Fiendish

Message
Maybe presort the items? :\
At least it seems I can effectively work around this by using numeric indexes, since those are always sorted correctly directly out of Lua.

http://aardwolfclientpackage.googlecode.com/
https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (19,499 posts)  [Biography] bio   Forum Administrator
Date Tue 26 Jul 2011 06:50 AM (UTC)  quote  ]
Message
Let me briefly explain what the code is trying to do. The list box has the "sorted" attribute checked, so when you add (say) y, then x, it sorts it into x and then y order. So it gets the "new position" from the listbox insertion, and uses *that* and not the original position for modifying things like the selected flag. It also stores the original position (under the "extra data" field) so that it can relate back the original position, when chosen, and not the position it eventually ends up in the list.

And all this works, or seems to, because list boxes work regardless of the order that you add things into them, as the screen shot shows.

But maybe under Wine, the number returned is prior to sorting, or something, which defeats the effort I have put in to resolve this issue.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (19,499 posts)  [Biography] bio   Forum Administrator
Date Tue 26 Jul 2011 06:46 AM (UTC)  quote  ]
Message
Fiendish said:

Well it looks like there's something in one of the luajit updates that causes this (I bisected to http://repo.or.cz/w/luajit-2.0.git/commit/420124372b7643410a1cdd6f80b9cc8aa6ec1302), but it only breaks in Linux/WINE and not in Windows 7 for me.


I am at a bit of a loss to explain this. If it failed on all platforms I would say you have a LuaJIT problem. If it always failed on Wine I would say Wine is not handling the multi list box properly. But your combination puzzles me.

Certainly I can believe that the hashing algorithm that hashes table entries might work differently under the JIT version than the normal version, but we have seen that the table sequence doesn't seem to directly affect the problem.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (1,010 posts)  [Biography] bio   Global Moderator
Date Tue 26 Jul 2011 06:36 AM (UTC)  quote  ]
Message
Maybe this is actually a Wine bug after all and it only gets tickled because of the order change in luajit? I don't know.

http://aardwolfclientpackage.googlecode.com/
https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Fiendish   USA  (1,010 posts)  [Biography] bio   Global Moderator
Date Tue 26 Jul 2011 05:17 AM (UTC)  quote  ]

Amended on Tue 26 Jul 2011 06:10 AM (UTC) by Fiendish

Message
This problem from the ordering only happens to me under Wine, though. It doesn't seem to happen in Windows. Under Windows I get the same result as you do in that last screenshot. It's very weird to me that a system-dependent problem would manifest in this way, which is why I thought it was a luajit problem, but then the result of the lua segment is the same on both ends. :\

http://aardwolfclientpackage.googlecode.com/
https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (19,499 posts)  [Biography] bio   Forum Administrator
Date Tue 26 Jul 2011 04:48 AM (UTC)  quote  ]
Message
Let me put it this way ... using the Aardwolf Lua, this screenshot shows that the keys are being fetched in the order you showed, but the listbox looks fine:


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (19,499 posts)  [Biography] bio   Forum Administrator
Date Tue 26 Jul 2011 04:31 AM (UTC)  quote  ]
Message
This would be confirmed by running this test:


for k, v in pairs {a="a", b="b", c="c", d="d", e="e", 
                   f="f", g="g", h="h", i="i", j="j", 
                   k="k", l="l", m="m", n="n"} do
  print (k, v)
end -- for


On normal Lua I get:


a a
c c
b b
e e
d d
g g
f f
i i
h h
k k
j j
m m
l l
n n


Using the "Aardwolf Lua" I get:


i i
f f
n n
m m
c c
g g
b b
l l
j j
k k
d d
h h
a a
e e


But unless there is a big blunder in my code, I don't see how the order of getting the keys matters.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (1,010 posts)  [Biography] bio   Global Moderator
Date Tue 26 Jul 2011 02:45 AM (UTC)  quote  ]

Amended on Tue 26 Jul 2011 03:07 AM (UTC) by Fiendish

Message
Thanks, I got the email.
Findings,

items that exist with regular lua:
0 (a), 1 (c), 2 (b), 4 (d), 7 (i), 11 (m), 13 (n)

items that exist with luajit b8:
0 (i), 2 (n), 3 (m), 4 (c), 6 (b), 10 (d), 12 (a)

So they're all there, just in different order and different locations, which I guess matters somehow, because this does work for me:

Quote:

utils.multilistbox ("", "", {[1]="a", [2]="b", [3]="c", [4]="d", [5]="e", [6]="f", [7]="g", [8]="h", [9]="i", [10]="j", [11]="k", [12]="l", [13]="m", [14]="n"}, {[1]=true, [2]=true, [3]=true, [4]=true, [9]=true, [13]=true, [14]=true})


and produces
0,1,2,3,8,12,13 (a,b,c,d,i,m,n)

http://aardwolfclientpackage.googlecode.com/
https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (19,499 posts)  [Biography] bio   Forum Administrator
Date Tue 26 Jul 2011 01:42 AM (UTC)  quote  ]
Message
Looks like I can't email you files. I uploaded it and emailed you the link. I changed it to actually display the contents.

In case I want to do it again the source is:


  for (set<int>::const_iterator iter = msg.m_iDefaults.begin ();
       iter != msg.m_iDefaults.end ();
       iter++)
         {
          CKeyValuePair kv = msg.m_data [*iter];
          AfxMessageBox ((LPCTSTR) CFormat ("item %i of msg.m_iDefaults (key %s, value %s) exists", 
                         *iter, kv.sKey_.c_str (), kv.sValue_.c_str ()));
         }


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (19,499 posts)  [Biography] bio   Forum Administrator
Date Tue 26 Jul 2011 01:27 AM (UTC)  quote  ]
Message
Yeah OK, I emailed it to you. I got the number 7 from your test data, which is what I expect.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


6,465 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

[New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]