You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(60) |
Jul
(35) |
Aug
(32) |
Sep
(5) |
Oct
(5) |
Nov
(58) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(114) |
Feb
(184) |
Mar
(153) |
Apr
(90) |
May
(153) |
Jun
(59) |
Jul
(24) |
Aug
(43) |
Sep
(17) |
Oct
(34) |
Nov
(11) |
Dec
(204) |
2007 |
Jan
(84) |
Feb
(119) |
Mar
(38) |
Apr
(28) |
May
(52) |
Jun
(105) |
Jul
(64) |
Aug
(67) |
Sep
(14) |
Oct
(3) |
Nov
(28) |
Dec
(55) |
2008 |
Jan
(228) |
Feb
(55) |
Mar
(30) |
Apr
(30) |
May
(15) |
Jun
(20) |
Jul
(12) |
Aug
(3) |
Sep
(13) |
Oct
(54) |
Nov
(35) |
Dec
(35) |
2009 |
Jan
(19) |
Feb
(20) |
Mar
(34) |
Apr
(4) |
May
(60) |
Jun
(25) |
Jul
(16) |
Aug
(51) |
Sep
(19) |
Oct
(62) |
Nov
(21) |
Dec
(12) |
2010 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
(12) |
May
(23) |
Jun
(13) |
Jul
(1) |
Aug
(40) |
Sep
(18) |
Oct
(21) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(17) |
Feb
(23) |
Mar
(1) |
Apr
(10) |
May
(1) |
Jun
(5) |
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(43) |
2012 |
Jan
(5) |
Feb
(19) |
Mar
(6) |
Apr
(24) |
May
(39) |
Jun
(83) |
Jul
(29) |
Aug
(36) |
Sep
(64) |
Oct
(55) |
Nov
(12) |
Dec
(7) |
2013 |
Jan
(17) |
Feb
(10) |
Mar
(37) |
Apr
(27) |
May
(13) |
Jun
(9) |
Jul
(7) |
Aug
(61) |
Sep
(23) |
Oct
(23) |
Nov
(30) |
Dec
(16) |
2014 |
Jan
(23) |
Feb
(13) |
Mar
(9) |
Apr
(17) |
May
(2) |
Jun
(11) |
Jul
(2) |
Aug
|
Sep
(9) |
Oct
(24) |
Nov
(2) |
Dec
(14) |
2015 |
Jan
(6) |
Feb
(4) |
Mar
(17) |
Apr
|
May
(7) |
Jun
(3) |
Jul
|
Aug
|
Sep
(2) |
Oct
(21) |
Nov
(6) |
Dec
(2) |
2016 |
Jan
(4) |
Feb
(2) |
Mar
(7) |
Apr
(3) |
May
(11) |
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(4) |
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
1
(1) |
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
(2) |
12
(5) |
13
|
14
(1) |
15
|
16
(6) |
17
(2) |
18
|
19
(4) |
20
(6) |
21
(8) |
22
(4) |
23
(4) |
24
(6) |
25
(6) |
26
(4) |
27
|
28
(1) |
29
(2) |
30
|
31
|
From: lostgallifreyan <los...@gm...> - 2009-10-29 09:28:57
|
John Labenski wrote: (Wed, 28 Oct 2009 19:07:17 -0700) >On Wed, Oct 28, 2009 at 2:28 PM, lostgallifreyan ><lostgallifre...@gmail.com> wrote: >> I got it! >:) At least, I really think so.... >> >> function Main() >> local IP=wx.wxIPV4address() IP:AnyAddress() IP:Service(80) >> local SKT=wx.wxSocketServer(IP,wx.wxSOCKET_NONE) >> print("Socket OK?",SKT:Ok()) >> >> FRAME=wx.wxFrame(wx.NULL,-1,"") FRAME:SetSize(432,310) FRAME:Centre() >> >> SKT:SetEventHandler(FRAME,wx.wxEVT_SOCKET) >> SKT:SetNotify(-1,wxSOCKET_CONNECTION_FLAG) >> SKT:Notify(true) >> FRAME:Connect(-1,wx.wxEVT_SOCKET,function(E) print("!!!!!") end) >> >> FRAME:Show(true) >> end >> >> Main() >> >> >> That lets me know if I connect to the right IP and port. I'm still not >> exactly sure what prompted me to try exactly this, it was a half-baked >> interpretatiojn of something in wx.chm, but it WORKS. Question is, is it >> right? Can it be simplified? Is it formally correct? Please let me know. John >> (Labensky), you've been silent for a long time, but I'd like you to say >> something now. I got far enough on my own since Andreas Krink gave me the >> starting help with a proven example of basic socket access, so havign got >> here I want to know if I did it the right way. Please let me know if this is >> missing something I should know, or confirm that it is correct. It obviously >> works, but I didn't design this system so what works now might not always do >> so unless it fits with proper methods. > >I really don't know as I haven't used the wxWidgets socket code very >much. What you did looks fairly straightforward though. That works for me. :) Thankyou. Btw, John, remember that MIDI thing I asked about? There might be a neat way round this. (Requires yes/no answer, I won't go into detail now other than saying why I want to know..) Does wxLua allow us to set an arbitrary serial port baud setting? Like 31.25 kb? I've learned that Sparkfun's Logomatic v2 hardware can do this with two serial ports so potential fun lies that way if I learn more C, but even nicer would be doing it in wxLua if I set that baud rate. Adapting a serial port on a PC to do MIDI hardware is a lot easier than learning C. >Thanks to the >others for chiming in. > Seconded. Without Andreas' examples I don't know when, or even if, I'd have motivated myself enough to find a solution to the event connection, never mind the rest of it. Btw, two small changes seem to be needed in that code: omit IP:AnyAddress() as this is default state anyway, it allows anyone to connect unless I bind to a remote IP with some yet-unlearned function. Also, add SKT:Accept(false) to the handler function's code to either immediately handle the incoming (waiting) client request, or at least free up the socket instantly if the client isn't there, so it's ready for a new connection. |
From: John L. <jla...@gm...> - 2009-10-29 02:07:13
|
On Wed, Oct 28, 2009 at 2:28 PM, lostgallifreyan <los...@gm...> wrote: > I got it! >:) At least, I really think so.... > > function Main() > local IP=wx.wxIPV4address() IP:AnyAddress() IP:Service(80) > local SKT=wx.wxSocketServer(IP,wx.wxSOCKET_NONE) > print("Socket OK?",SKT:Ok()) > > FRAME=wx.wxFrame(wx.NULL,-1,"") FRAME:SetSize(432,310) FRAME:Centre() > > SKT:SetEventHandler(FRAME,wx.wxEVT_SOCKET) > SKT:SetNotify(-1,wxSOCKET_CONNECTION_FLAG) > SKT:Notify(true) > FRAME:Connect(-1,wx.wxEVT_SOCKET,function(E) print("!!!!!") end) > > FRAME:Show(true) > end > > Main() > > > That lets me know if I connect to the right IP and port. I'm still not exactly sure what prompted me to try exactly this, it was a half-baked interpretatiojn of something in wx.chm, but it WORKS. Question is, is it right? Can it be simplified? Is it formally correct? Please let me know. John (Labensky), you've been silent for a long time, but I'd like you to say something now. I got far enough on my own since Andreas Krink gave me the starting help with a proven example of basic socket access, so havign got here I want to know if I did it the right way. Please let me know if this is missing something I should know, or confirm that it is correct. It obviously works, but I didn't design this system so what works now might not always do so unless it fits with proper methods. I really don't know as I haven't used the wxWidgets socket code very much. What you did looks fairly straightforward though. Thanks to the others for chiming in. Regards, John |
From: lostgallifreyan <los...@gm...> - 2009-10-28 18:29:28
|
I got it! >:) At least, I really think so.... function Main() local IP=wx.wxIPV4address() IP:AnyAddress() IP:Service(80) local SKT=wx.wxSocketServer(IP,wx.wxSOCKET_NONE) print("Socket OK?",SKT:Ok()) FRAME=wx.wxFrame(wx.NULL,-1,"") FRAME:SetSize(432,310) FRAME:Centre() SKT:SetEventHandler(FRAME,wx.wxEVT_SOCKET) SKT:SetNotify(-1,wxSOCKET_CONNECTION_FLAG) SKT:Notify(true) FRAME:Connect(-1,wx.wxEVT_SOCKET,function(E) print("!!!!!") end) FRAME:Show(true) end Main() That lets me know if I connect to the right IP and port. I'm still not exactly sure what prompted me to try exactly this, it was a half-baked interpretatiojn of something in wx.chm, but it WORKS. Question is, is it right? Can it be simplified? Is it formally correct? Please let me know. John (Labensky), you've been silent for a long time, but I'd like you to say something now. I got far enough on my own since Andreas Krink gave me the starting help with a proven example of basic socket access, so havign got here I want to know if I did it the right way. Please let me know if this is missing something I should know, or confirm that it is correct. It obviously works, but I didn't design this system so what works now might not always do so unless it fits with proper methods. Also, is it likely that this business might be simplified in future? I like what appears to be a way to get a lot of versatile control, though I suspect it might be possible to simplify it conceptually, if not in practise. |
From: lostgallifreyan <los...@gm...> - 2009-10-26 16:00:50
|
Ryan Pusztai wrote: (Mon, 26 Oct 2009 06:26:46 -0700) > It is not wlua.exe flashing the console. The os.execute() command in Lua is > doing that. Indeed. I'd thought os.execute() launched whatever it pointed to directly, unless the command was dir or some other built into the Windows command interpreter, or was some other program that required a console anyway. I'd always used it whan already in a console window, hence the confusion. I thought I'd also used it in wxLua and NOT seen a console window appear briefly, but I just tested exactly for this and saw that it also does this. But wxExecute() doesn't, so I stay with wxLua. :) And now the thing that brought me back here having thought I'd be ok alone now... function Main() local IP=wx.wxIPV4address() IP:AnyAddress() IP:Service(80) local SKT=wx.wxSocketServer(IP,wx.wxSOCKET_NONE) print("Socket OK?",SKT:Ok()) FRAME=wx.wxFrame(wx.NULL,-1,"") FRAME:SetSize(432,310) FRAME:Centre() SKT:SetEventHandler(FRAME,wx.wxEVT_SOCKET) FRAME:Connect(-1,wx.wxEVT_SOCKET,function(E) print("!!!!!") end) FRAME:Show(true) end Main() That appears to run without error. Firefox can connect (as shown by Netstat -a) but I seem to be beaten by any attempt to connect a socket event. Right now I just want to flag that one has occurred, I'll sort out what kind once I have that. If someone can correct what I have here, please do. I need this because it lets me call SKT:Accept() on demand, thus avoiding freezing things up with waiting server sockets. |
From: Ryan P. <rpu...@gm...> - 2009-10-26 13:26:34
|
On Mon, Oct 26, 2009 at 4:42 AM, lostgallifreyan <los...@gm...>wrote: > Andreas Krinke wrote: > (Sun, 25 Oct 2009 13:15:08 -0700) > > > http://luabinaries.luaforge.net/manual.html says LuaBinaries provides a > > wlua5.1.exe without a console, so no need for Lua for Windows. > > Looks good but wlua5.1.exe doesn't work for me. It flashes a console window > briefly (wreaks havoc with focus of other apps running at times, as well as > looking less than good). Also I tried passing it a script containing > os.execute("C:/WINDOWS/Calc.exe") and it didn't run the Windows calculator > as any Lua process usually would, so I'll use wxLua, which has neither of > these problems. > It is not wlua.exe flashing the console. The os.execute() command in Lua is doing that. -- Regards, Ryan |
From: lostgallifreyan <los...@gm...> - 2009-10-26 08:42:44
|
Andreas Krinke wrote: (Sun, 25 Oct 2009 13:15:08 -0700) > http://luabinaries.luaforge.net/manual.html says LuaBinaries provides a > wlua5.1.exe without a console, so no need for Lua for Windows. Looks good but wlua5.1.exe doesn't work for me. It flashes a console window briefly (wreaks havoc with focus of other apps running at times, as well as looking less than good). Also I tried passing it a script containing os.execute("C:/WINDOWS/Calc.exe") and it didn't run the Windows calculator as any Lua process usually would, so I'll use wxLua, which has neither of these problems. Your fix for the Read() function worked so I'll start exploring that now. Thanks again. I'm going to vanish now to see what I can come up with, but I'll post something if it looks small, complete and useful. Or sooner if I see anyone asking for something I know at the time. |
From: John L. <jla...@gm...> - 2009-10-26 03:59:55
|
On Thu, Oct 22, 2009 at 12:06 PM, Francesco Montorsi <f18...@ya...> wrote: > [sorry for not reading the rest of the thread; I may have missed something > important] > > Hi John, Klaas, > > Klaas Holwerda ha scritto: >> John Labenski wrote: >>> The Python stuff looks easy to skip and we may have to write our own >>> @beginWxLuaOnly sections. > indeed. I think it's ok (for wx developers) to have the wx interface files > patched upstream (in wx repo) with @beginWxLuaOnly sections since there are > already wxPerl and wxPython equivalents. Ok, we'll see. I was thinking that I would only patch them locally, but if the wxWidgets people don't mind it would be nicer to have them built in. >> That is what i meant. I don't know how wxWidgets parses those >> tags/things from the headers using Doxygen, and even if they do. > if you want a simple C++ parser of the Doxygen (XML) output, please look in > wxWidgets/utils/ifacecheck. I've looked at that, it's nice, but I think it would be best to stick to an all Lua solution. Lua tables are very powerful, easy to use, and I will need to make a variety of structures. I have started a parser in Lua and it loads the XML just fine, now it is just a "simple" matter of converting the loaded table into tables of classes, functions, enums, etc... > The @beginWxPythonOnly sections are used only in the HTML output (and with the > XML output they are not needed by ifacecheck: it only checks the consistency of > the docs against the wx C++ headers, it knows nothing about python). > >> Without >> adding something extra to the doxygen setup files, they don't show up as >> extra tags in XML. >> But if possible that solves most problems i think. Maybe just ask >> Francesco, he knows. > yes, adding in wx/docs/doxygen/Doxyfile_inc some stuff it should be possible to > have those tags appear also in the XML output. > >> still need %rename for overloaded >>> functions that take int/double/enum values since Lua treats them all >>> as double so we can't tell what function the user wanted to call. How >>> can we stick that into the interface file so it ends up in the doxygen >>> XML? I'm sure there's a way... I tried to get rid of as many of the %rename functions as possible, it looks like they are mostly used to distinguish between functions that return a wxSize or wxPoint and identically named functions that take int* values and set them. For example: For wxWindow %rename GetClientSizeWH virtual void GetClientSize() const // C++ func GetClientSize(int* w, int* h) wxSize GetClientSize() const > can you make an example of which info would you like to stuff inside e.g. the > following doxygen XML snippet: > > <memberdef kind="function" > id="classwx_about_dialog_info_1a2bde3b28eb55f653e8229ea534775c24" prot="public" > static="no" const="no" explicit="no" inline="no" virt="non-virtual"> > <type>void</type> > <definition>void wxAboutDialogInfo::SetDevelopers</definition> > <argsstring>(const wxArrayString &developers)</argsstring> > <name>SetDevelopers</name> Something like this, which is not necessary for this function, see above where it would be used. <rename>SetDevelopersForLua</rename> Thanks, John |
From: Andreas K. <and...@gm...> - 2009-10-25 20:15:04
|
lostgallifreyan wrote: > Andreas Krinke wrote: >> You should be able to use binaries for Lua [1]. In the Lua for >> Windows package there is a wlua.exe that doesn't pop up a console >> window (if I remember correctly). > > I'll check that out. Very useful. I also think that TCC might be > persuaded to compile such that Lua runs without a console. I didn't > explore because at the time I think it demanded more than I knew. > Probably still does but next time I look at using TCC I'll try that. http://luabinaries.luaforge.net/manual.html says LuaBinaries provides a wlua5.1.exe without a console, so no need for Lua for Windows. > One thing I read yesterday was that Windows can have > difficulties with socketry that isn't done in the main thread, but as > far as I know, in wxLua the message loop means event driven > conditions allow many connections to be handled without > multithreading. Is it as simple and efficient as it sounds, or am I > missing something I need to know at the outset before trying things? Sorry, can't help you with that. > One other thing just cropped up.. While I was writing this, I'd left > wxLua running the above code, and some time after I'd closed Firefox > a wxLua error message came up stating that variable 'client' had > become a nil value when indexed on line 15 (client:Read(1)). Any > advice on prevention? Try this change: local client = socket:Accept(true) if client then repeat data[#data+1] = client:Read(1) until data[#data] == "\n" print(table.concat(data)) client:Write([[ <html> <body> <h1>wxLua Proxy Test</h1> </body> </html> ]]) client:Close() end |
From: lostgallifreyan <los...@gm...> - 2009-10-25 19:33:30
|
Andreas Krinke wrote: (Sun, 25 Oct 2009 09:39:44 -0700) >You should be able to use binaries for Lua [1]. In the Lua for Windows >package there is a wlua.exe that doesn't pop up a console window (if I >remember correctly). I'll check that out. Very useful. I also think that TCC might be persuaded to compile such that Lua runs without a console. I didn't explore because at the time I think it demanded more than I knew. Probably still does but next time I look at using TCC I'll try that. >function Main() > local ip = wx.wxIPV4address() > -- localhost > print(ip:AnyAddress()) > print(ip:Service(8080)) > local socket = wx.wxSocketServer(ip, wx.wxSOCKET_WAITALL) > print(socket:Ok()) > > local data > while 1 do > data = {} > print("waiting...") > local client = socket:Accept(true) > repeat > data[#data+1] = client:Read(1) > until data[#data] == "\n" > print(table.concat(data)) > client:Write([[ ><html> > <body> > <h1>wxLua Proxy Test</h1> > </body> ></html> > ]]) > client:Close() > end >end Thanks for that. :) Very fun bit of code! (And especially useful to have the same in two forms (This is ideal, it gives lots of possibilities for exploring. Only had a look at its output via Firefox for now but I now have something very good to do with my time tomorrow. One thing I read yesterday was that Windows can have difficulties with socketry that isn't done in the main thread, but as far as I know, in wxLua the message loop means event driven conditions allow many connections to be handled without multithreading. Is it as simple and efficient as it sounds, or am I missing something I need to know at the outset before trying things? One other thing just cropped up.. While I was writing this, I'd left wxLua running the above code, and some time after I'd closed Firefox a wxLua error message came up stating that variable 'client' had become a nil value when indexed on line 15 (client:Read(1)). Any advice on prevention? |
From: Andreas K. <and...@gm...> - 2009-10-25 16:39:34
|
lostgallifreyan wrote: > I'm guessing I'll have to compile Lua with LuaSocket but I think I > can do it, I managed to compile my copies of v5.1.4 Lua and Luac and > Lua.dll with TCC compiler, so that could be a nice way to go. On the > other hand, that means console windows popping up, and for something > like a web proxy based filter system it's nice if it runs very much > in the background. If I try both I'll learn more though. You should be able to use binaries for Lua [1]. In the Lua for Windows package there is a wlua.exe that doesn't pop up a console window (if I remember correctly). [1] http://luabinaries.luaforge.net/index.html Here is the same example implemented using wxLua: function Main() local ip = wx.wxIPV4address() -- localhost print(ip:AnyAddress()) print(ip:Service(8080)) local socket = wx.wxSocketServer(ip, wx.wxSOCKET_WAITALL) print(socket:Ok()) local data while 1 do data = {} print("waiting...") local client = socket:Accept(true) repeat data[#data+1] = client:Read(1) until data[#data] == "\n" print(table.concat(data)) client:Write([[ <html> <body> <h1>wxLua Proxy Test</h1> </body> </html> ]]) client:Close() end end |
From: lostgallifreyan <los...@gm...> - 2009-10-25 15:21:05
|
Andreas Krinke wrote: (Sun, 25 Oct 2009 07:19:27 -0700) > Great it works now! > Yep. :) Thankyou, that incremental read is a particularly nice idea for viewing an incoming page as it is still arriving. Though I am utterly confuzzled as to what changed, but at least if it stops I have something certain to work with. My guess is some DNS server out there went strange during the week and got fixed during the quiet time that sunday mornings allow. >lostgallifreyan wrote: >> If I carry on with this, the main thing I need to know is how to set >> up wxLua as a simple local proxy so I can design a web filter. I'll >> sort the filter details in my own time, but if someone can help me >> with a minimal template for the connections part of that, please do. >> Now that I've seen something work, I'll give it the effort it >> deserves if someone can give me that core template for connecting >> wxLua as local proxy between a browser and the net. > > Did you consider using Lua and LuaSocket [1] instead of wxLua? I think > this would simplify the whole socket and proxy programming. > I did. :) Though I wasn't sure if it was the best way. I do like to use Lua functions directly, given the choice, which is why I thought to extend Lua with LuaSocket rather than use wxLua. But I do really like wxLua! If I didn't I wouldn't be so enthusiastic one moment, disappointed the next. I do really care about wxLua. Long ago someone told me about Girder and the power it would give me in the OS at large, and I didn't get it. Now I have wxLua and I DO get it, at least well enough to frequently make my own tools, and having seen Girder since, I know where I'm better off, and I stay with wxLua. I'm guessing I'll have to compile Lua with LuaSocket but I think I can do it, I managed to compile my copies of v5.1.4 Lua and Luac and Lua.dll with TCC compiler, so that could be a nice way to go. On the other hand, that means console windows popping up, and for something like a web proxy based filter system it's nice if it runs very much in the background. If I try both I'll learn more though. All that aside, wxLua really needs nice simple examples of this stuff. In actual wxLua... I thought the whole point was to alleviate the austerity of C and platform based limitations and make consistent and highly configurable tools available to more people. Not every driver is a master mechanic, and it would be a strange world if people expected them to be in order to drive on anything but the motorways... I'm going to try a (very) minimal browser using that wxURL and an HTML control, with basic back/forward navigation, visited URL memory, a view source window. It will use a toolbar rather than a menu. If it works ok I'll post a cleaned and commented copy as an example. One thing wxLua would be well placed for is a simple FTP client. That would be a great example, as it both sends and receives with a relatively simple protocol. And a tool to do pings and traces and whois inquiries. And a minimal HTTP file server. Ideas could easily run amock, but I think a few standard core tools done in wxLua would be a valuable part of the examples library. So far the search for the word 'socket' in the text of those is singularly uninspiring. And a search for wxURL produces exactly zero results! > Here is some example code: > > -- load namespace > local socket = require "socket" > -- create a TCP socket and bind it to the local host, at port 8080 > local server = assert(socket.bind("*", 8080)) > > while 1 do > -- wait for a connection from any client > local client = server:accept() > -- receive the line > local line, err = client:receive() > -- if there was no error, send a simple webpage as example > if not err then > client:send([[ > <html> > <body> > <h1>Proxy Test</h1> > </body> > </html> > ]]) > print(line) > end > -- done with client, close the object > client:close() > end Nice one. Thanks for that, I'll try it. Nice to have something I can get my teeth into. I always prefer a three pipe problem to skating on thin ice in the dark without knowing if the edge of the pond is actually there... Got to have a few easy certainties to start with, like seeing something work before I break it. Seriously. If I break it carefully, I learn. If I've never seen it work, I do NOT learn because the foundation's not there. That's the core of my occasional dissent with wxLua. I think many who see this problem don't speak of it, they either know enough to get by, or they vanish silently and go elsewhere, in which case I think they don't know what a good thing they're missing, but I can see their point. I've seen enough to stay with it, but more diverse examples would have made that a lot easier. Reading manuals is fun when you have that, otherwise it's hell with no way to know if will work and be worth it. |
From: Andreas K. <and...@gm...> - 2009-10-25 14:19:24
|
Great it works now! lostgallifreyan wrote: > If I carry on with this, the main thing I need to know is how to set > up wxLua as a simple local proxy so I can design a web filter. I'll > sort the filter details in my own time, but if someone can help me > with a minimal template for the connections part of that, please do. > Now that I've seen something work, I'll give it the effort it > deserves if someone can give me that core template for connecting > wxLua as local proxy between a browser and the net. Did you consider using Lua and LuaSocket [1] instead of wxLua? I think this would simplify the whole socket and proxy programming. Here is some example code: -- load namespace local socket = require "socket" -- create a TCP socket and bind it to the local host, at port 8080 local server = assert(socket.bind("*", 8080)) while 1 do -- wait for a connection from any client local client = server:accept() -- receive the line local line, err = client:receive() -- if there was no error, send a simple webpage as example if not err then client:send([[ <html> <body> <h1>Proxy Test</h1> </body> </html> ]]) print(line) end -- done with client, close the object client:close() end If your browser uses the proxy (as HTTP proxy), it will send something like "GET http://www.google.com HTTP/1.1". Then you can download and process the webpage using LuaSocket and send the result with client:sent(). You can use LuaSocket with wxLua as well. [1] http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/home.html |
From: lostgallifreyan <los...@gm...> - 2009-10-25 12:39:45
|
Strange things.... I hadn't given up on it, yet, I was tinkering with the example to make it look more how I do things, so I could think more abstractedly about what might make it fail, instead of focussing on it, and it started working at 12:10 GMT or so today. Nothing I did could account for it, so I tried Andreas' original frame based example, and that worked too. So something external changed. I rebooted, and it still worked, so I think it wasn't a local or temporary change, but something at the ISP's end. NOTE: I use a registry lock and Ghost images to maintain a stable OS, so that reboot would have cleared any temporary condition. That it persisted in working means it really is an external change. I also tried substituting Google's hostname last night, with an IP fetched by Tracert's DNS inquiry. That failed last night, with error code 6, protocol negotiation failure. Today it works, though instead of the small 'page moved' linkage currently fetched by reaching Google.com, it gets the full search page code from the UK site that Google.com links to. I also tried a file:// get last night which worked, partly why I was prepared to stick at it today... So in short, I confirm that wxURL works properly on W98, though I haven't discovered what external conditions made it fail before. That all example work proves it isn't something I did, so it IS external, but that's all I know. If I carry on with this, the main thing I need to know is how to set up wxLua as a simple local proxy so I can design a web filter. I'll sort the filter details in my own time, but if someone can help me with a minimal template for the connections part of that, please do. Now that I've seen something work, I'll give it the effort it deserves if someone can give me that core template for connecting wxLua as local proxy between a browser and the net. |
From: lostgallifreyan <los...@gm...> - 2009-10-24 20:16:06
|
Andreas Krinke wrote: (Sat, 24 Oct 2009 05:43:12 -0700) > local url = wx.wxURL("http://www.google.com";) > local stream = url:GetInputStream() > while stream:CanRead() do > textCtrl:AppendText(stream:Read(78)) > end One other thing.. I added a line to get the error: local url = wx.wxURL("http://www.google.com") local stream = url:GetInputStream() print(url:GetError()) while stream:CanRead() do print(stream:Read(78)) end It printed a 3 which I checked with this: print(wx.wxURL_NOERR,wx.wxURL_SNTXERR,wx.wxURL_NOPROTO,wx.wxURL_NOHOST,wx.wxURL_NOPATH,wx.wxURL_CONNERR,wx.wxURL_PROTOERR) So it can't find the host. As this is a simple thing that a vast number of tools can do on W98 I won't be blaming the OS. Hopefully wxWidgets will become as cross-platform as its billing suggests. W98 is founded on a decades-old and extremely small, fast and useful base (DOS) and plenty of people value that even if Microsoft don't. I hope that people who support cross-platform efforts don't too readily do what Microsoft want them to do, to give up on it. |
From: lostgallifreyan <los...@gm...> - 2009-10-24 19:49:52
|
Andreas Krinke wrote: (Sat, 24 Oct 2009 05:43:12 -0700) > lostgallifreyan wrote: >> Thankyou, that looks comprehensible to me, though I got errors. >> (First had to remove the semicolon, then saw 'stream' reported as nil >> on line 3). > > Strange, in the message i sent, there was no semicolon. > Turns out to be something the Mail Archive (where I look for single answers if I don't want to wait fior the digest email) page adds after a double-quoted URL. No idea why, but there were two there once I quoted your first example. :) >> I don't know how much context this needs, but it does look like it >> needs something else to make it work. > > It does not need anything else. Just save it to a file and execute it > with wxlua on the command line. At least on Linux (wxLua 2.8.10.0) it > will print the source of the webpage. > > Here is an example using a GUI for output: > > local frame = wx.wxFrame(wx.NULL, wx.wxID_ANY, "wxURL Demo", > wx.wxDefaultPosition, wx.wxSize(450, 450), > wx.wxDEFAULT_FRAME_STYLE) > > local textCtrl = wx.wxTextCtrl(frame, wx.wxID_ANY, "", > wx.wxDefaultPosition, > wx.wxDefaultSize, > wx.wxTE_MULTILINE) > > local url = wx.wxURL("http://www.google.com";) > local stream = url:GetInputStream() > while stream:CanRead() do > textCtrl:AppendText(stream:Read(78)) > end > > frame:Show(true) I'm using Windows 98. It can be made to do plenty, but obviously NOT this. If even working code fails, then please forget I asked, I won't do it again. I'll stay with net tools that work and call them by wxExecute, either synchronously, or asynchronously, and as I have a RAM drive set up I can access files directly in RAM with very little speed loss. With that method I get things done, With anything else, all bets are null and void. Apparently the wxSocketry, and all examples, are works in progress, officially, and it's a dead cert they won't be written with W98 in mind even if they reach completion. I won't change the OS, it does too many good things to throw it out for the few it can't do especially as most of those are hardware limited anyway. |
From: dd <dro...@gm...> - 2009-10-24 16:04:21
|
Tnx for help. Problem was in mingw ( I recompilead all with MS VC ++ 2008 express and all works. |
From: Andreas K. <and...@gm...> - 2009-10-24 12:43:03
|
lostgallifreyan wrote: > Thankyou, that looks comprehensible to me, though I got errors. > (First had to remove the semicolon, then saw 'stream' reported as nil > on line 3). Strange, in the message i sent, there was no semicolon. > I don't know how much context this needs, but it does look like it > needs something else to make it work. It does not need anything else. Just save it to a file and execute it with wxlua on the command line. At least on Linux (wxLua 2.8.10.0) it will print the source of the webpage. Here is an example using a GUI for output: local frame = wx.wxFrame(wx.NULL, wx.wxID_ANY, "wxURL Demo", wx.wxDefaultPosition, wx.wxSize(450, 450), wx.wxDEFAULT_FRAME_STYLE) local textCtrl = wx.wxTextCtrl(frame, wx.wxID_ANY, "", wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxTE_MULTILINE) local url = wx.wxURL("http://www.google.com") local stream = url:GetInputStream() while stream:CanRead() do textCtrl:AppendText(stream:Read(78)) end frame:Show(true) |
From: lostgallifreyan <los...@gm...> - 2009-10-24 09:51:36
|
Andreas Krinke wrote: (Fri, 23 Oct 2009 11:58:04 -0700) > You can fetch a webpage by using: > local url = wx.wxURL("http://www.google.com";) > local stream = url:GetInputStream() > while stream:CanRead() do > print(stream:Read(78)) > end Thankyou, that looks comprehensible to me, though I got errors. (First had to remove the semicolon, then saw 'stream' reported as nil on line 3). I don't know how much context this needs, but it does look like it needs something else to make it work. THis is most important to me. I'll spend weeks picking things apart and learning, testing, trying stuff and not bothering anyone the whole time, but I can only do this if it works to start with, because that's the only way I'll ever know which errors are mine, and which are inherited and likely unsolvable. |
From: lostgallifreyan <los...@gm...> - 2009-10-24 09:46:32
|
> Please search for m_clientSocket in this C++ sample. I think you need > to call wxIPV4address::Hostname() and Service() separately. > > http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/samples/sockets/baseclient.cpp?view=markup > > Hope this helps, Not much. :) If the best translator from Greek to Roman is approached for a small translation in Roman, and instead points to 735 lines of Greek, that's not very encouraging. For now I'm staying with my fallback plan of wxExecute() to run tools properly designed and tested for internet connections. Until there are working examples, complete, tested, in wxLua, I think most people would do the same. That there is no apparent interchage of net-based wxLua work speaks volumes as it is, the silence is deafening. And it's no good expecting the least qualified newcomers to set the ball rolling. |
From: Andreas K. <and...@gm...> - 2009-10-23 18:58:01
|
You can fetch a webpage by using: local url = wx.wxURL("http://www.google.com") local stream = url:GetInputStream() while stream:CanRead() do print(stream:Read(78)) end |
From: Michael G. <sma...@ar...> - 2009-10-23 07:13:05
|
In article <a84...@ma...>, John Labenski <jla...@gm...> wrote: > On Thu, Oct 22, 2009 at 3:28 AM, Michael Gerbracht <sma...@ar...> > wrote: > > The styles are separated by a "+" sign, which is not standard lua so I do > > not know how to make a style optional. I tried to use a variable instead > > of "wx.wxTR_NO_LINES" and set it to either nil or "wx.wxTR_LINES". > These styles are simply numeric bit masks so that adding them together is > the same as using a boolean OR operator on the numbers. Instead of setting > it to nil set it to 0. Ah, ok, that solves the problem. Thank you very much! Michael |
From: John L. <jla...@gm...> - 2009-10-23 02:32:30
|
On Thu, Oct 22, 2009 at 5:18 AM, lostgallifreyan <los...@gm...> wrote: > Ok, I tried this: > > function Main() > SKT=wx.wxSocketClient() > SKT:Connect(wx.wxIPV4address("192.168.1.2:4006"),true) > end > > It gives an 'invalid argument' error... I've seen a lot like this and I'm tired of fumbling inanely in the dark! > > This NEEDS a working example. It doesn't matter if it's posted by someone who hasn't worked extensively with sockets, you only have to have done it successfully once! Please search for m_clientSocket in this C++ sample. I think you need to call wxIPV4address::Hostname() and Service() separately. http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/samples/sockets/baseclient.cpp?view=markup Hope this helps, John |
From: John L. <jla...@gm...> - 2009-10-23 02:21:07
|
On Thu, Oct 22, 2009 at 3:28 AM, Michael Gerbracht <sma...@ar...> wrote: > In article <a84...@ma...>, > John Labenski <jla...@gm...> wrote: >> On Wed, Oct 21, 2009 at 9:30 AM, Michael Gerbracht <sma...@ar...> >> wrote: > > I store the data in lua anyway so this should not be a problem. Or changes > will just apply after a restart. Still I am not sure how to set the style > upon creation. I use the following code to create it: > > local tree = wx.wxTreeCtrl(this, wx.wxID_ANY,wx.wxPoint(0,0), > wx.wxSize(160,250),wx.wxTR_DEFAULT_STYLE + wx.wxTR_NO_LINES > + wx.wxTR_HIDE_ROOT + wx.wxTR_MULTIPLE + wx.wxNO_BORDER); > > The styles are separated by a "+" sign, which is not standard lua so I do not > know how to make a style optional. I tried to use a variable instead of > "wx.wxTR_NO_LINES" and set it to either nil or "wx.wxTR_LINES". Both fail. > One possibility might be to define two sets of styles, one including > "wx.wxTR_NO_LINES" and the other one not. This works if you only want to make > one style configuarable. > > Is there a better/more flexible way to define the styles? These styles are simply numeric bit masks so that adding them together is the same as using a boolean OR operator on the numbers. Instead of setting it to nil set it to 0. wx.wxTR_LINES does not exist, I think you want wx.wxTR_LINES_AT_ROOT. http://docs.wxwidgets.org/stable/wx_wxtreectrl.html#wxtreectrl Regards, John |
From: Francesco M. <f18...@ya...> - 2009-10-22 16:07:02
|
[sorry for not reading the rest of the thread; I may have missed something important] Hi John, Klaas, Klaas Holwerda ha scritto: > John Labenski wrote: >> The Python stuff looks easy to skip and we may have to write our own >> @beginWxLuaOnly sections. indeed. I think it's ok (for wx developers) to have the wx interface files patched upstream (in wx repo) with @beginWxLuaOnly sections since there are already wxPerl and wxPython equivalents. > > That is what i meant. I don't know how wxWidgets parses those > tags/things from the headers using Doxygen, and even if they do. if you want a simple C++ parser of the Doxygen (XML) output, please look in wxWidgets/utils/ifacecheck. The @beginWxPythonOnly sections are used only in the HTML output (and with the XML output they are not needed by ifacecheck: it only checks the consistency of the docs against the wx C++ headers, it knows nothing about python). > Without > adding something extra to the doxygen setup files, they don't show up as > extra tags in XML. > But if possible that solves most problems i think. Maybe just ask > Francesco, he knows. yes, adding in wx/docs/doxygen/Doxyfile_inc some stuff it should be possible to have those tags appear also in the XML output. >> Thanks for the Doxygen sample, XML is ugly. > Sure is, but easy to parse :-) right ;) > still need %rename for overloaded >> functions that take int/double/enum values since Lua treats them all >> as double so we can't tell what function the user wanted to call. How >> can we stick that into the interface file so it ends up in the doxygen >> XML? I'm sure there's a way... > can you make an example of which info would you like to stuff inside e.g. the following doxygen XML snippet: <memberdef kind="function" id="classwx_about_dialog_info_1a2bde3b28eb55f653e8229ea534775c24" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>void</type> <definition>void wxAboutDialogInfo::SetDevelopers</definition> <argsstring>(const wxArrayString &developers)</argsstring> <name>SetDevelopers</name> <param> <type>const <ref refid="classwx_array_string" kindref="compound">wxArrayString</ref> &</type> <declname>developers</declname> </param> <briefdescription> <para>Set the list of developers of the program. </para> </briefdescription> <detaileddescription> <para><simplesect kind="see"><para><ref refid="classwx_about_dialog_info_1a26dba3b09941ae3761c452b78d37165f" kindref="member">AddDeveloper()</ref> </para></simplesect> </para> </detaileddescription> <inbodydescription> </inbodydescription> <location file="/home/frm/work/wxWidgets/interface/wx/aboutdlg.h" line="104"/> </memberdef> ? Francesco -- |
From: lostgallifreyan <los...@gm...> - 2009-10-22 09:19:02
|
Ok, I tried this: function Main() SKT=wx.wxSocketClient() SKT:Connect(wx.wxIPV4address("192.168.1.2:4006"),true) end It gives an 'invalid argument' error... I've seen a lot like this and I'm tired of fumbling inanely in the dark! This NEEDS a working example. It doesn't matter if it's posted by someone who hasn't worked extensively with sockets, you only have to have done it successfully once! Until such a working example is forthcoming, I shall take my own advice, the same as I give all others who come this way looking as I did: Forget it! Use third part commandline tools like WGET, called either synchronously or asynchronously by wxExecute() and be done with this. If someone cares to diagree with me on this I expect them to prove that wxLua on Windows is a viable method for direct use of sockets, and that means providing working code! |