Jump to content

sentry07

Active Members
  • Posts

    27
  • Joined

  • Last visited

sentry07's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. This seems to be an incomplete version of the UDF. It looks like the full version is here: https://raw.github.com/Silvernine0S/FolderMenu3EX/master/Include/_XMLDomWrapper_.au3 All of eltorro's links seem to be dead so hopefully that's a recent version of the UDF.
  2. I just experienced the 0x00 byte causing an EOT. I've been racking my brains over this issue and this kinda makes sense but I still don't understand it. Is using a null character part of the COM spec or was it something that Martin just put in the DLL? If I send the hex string x34x08x01x00x14x00x5A, the other end only receives x34x08x01. So basically I need to replace all single null bytes with double null bytes to solve this issue?
  3. I use a large receive buffer size (32000) so that I know I will receive everything that's being sent. I believe data will sit in the receive buffer until you call TCPRecv. If there's more data in the buffer than your TCPRecv is requesting, then it will leave the excess data in the buffer until the next time you call TCPRecv. I guess you could do a While loop until TCPRecv returns nothing every time and just append the received data to a string.
  4. I think you're missing a character set or something, Azjio. His example text doesn't have ?s in it. I believe it's Mandarin. I'm not proficient enough in RegEx to know unicode capturing. Would Mandarin characters still be picked up by the w quantifier?
  5. +1 for Dropbox. I have all my projects and sample programs and snippets saved on there so no matter where I am I can get to my code if I have web access.
  6. Back again with hopefully another quickie: I'm using a RichEdit box in my app as a communications log and a ComboBox as a command string input box. I'm using the CBS_DROPDOWN flag and storing a recent history of strings in it for recalling. The problem I'm having is when logging communication from the remote device, _GUIRichEdit_AppendText calls _WinAPI_SetFocus on the richedit which takes focus away from my combobox, so then I have to call _WinAPI_SetFocus on the combobox again. This causes the combobox to highlight everything in itself. If I'm typing when something happens in the log, I lose what I'm typing because it basically did a "Select All" and my typing overwrote the selected text. My try at two solutions: 1) I edited GuiRichEdit.au3 and removed the _WinAPI_SetFocus call in the _AppendText function. When you do this, the richedit doesn't scroll vertically automatically anymore. So I added _GUIRichEdit_ScrollLines calls and tried counting how many lines and blah blah blah and it always screws up the scroll and never works right. 2) After putting the SetFocus back in the AU3 so that scrolling works correctly, I thought to myself "I'll just get the current selection in the combobox (which should be nothing most of the time) before appending text, then set the selection again after appending and everything should be great." So I added the functions and after much debugging and cursing found the note that says you can't use GetCurEditSel/SetCurEditSel if you use the $CBS_DROPDOWN flag or it will return an error. So I'm stuck again looking for ideas. I wish I could just say "Scroll 100%" but it doesn't seem to work like that.
  7. Just chiming in here to say that I use a program to check all my RegEx strings that is free/donationware. It will also help you build the string and show you the output so you can tweak it to fit. http://www.redfernplace.com/software-projects/regex-builder/ I couldn't come up with a better way of doing this though.
  8. Still working on my terminal program, and a thought came to me. I've created a TCP server and something connects to it, how do I find out the IP address of what has connected to it? There are no functions that I can find that give me any information about the connected socket. I searched the forum but didn't find anything.
  9. You just asked if it could run faster. If I give you my code, you don't learn. j/k...knock yourself out. GeoIP.zip
  10. Reading 180,000 rows from an Excel spreadsheet using this method is incredibly slow. I converted the spreadsheet into a CSV. Reading in the file and parsing it into an array using StringSplit and StringRegExp takes around 3 seconds. Obviously the bulk of the time you're spending is in this enormous loop. There are tons of array search optimizations you can put in that would help you not have to search the whole array. For example: First off, the array is already sorted for you. You should be using this to your advantage. One timesaver I came up with off the top of my head is an array index. I saved the first value (16777216) and every time the row's low value was greater than a multiple of that number, I saved that position in the Geo array. This means later when I'm searching for the value, I know a good place to start (arrayIndex[Floor(decIP / firstvalue)]) and I should only have to search a fraction of the total array. If you do the math: (total rows / (last low value / first low value)), which in this case is a maximum of about 800 rows per log entry. Second, you need to look at the information you're searching for. There are a lot of duplicate IPs. Save what you've found and look through those first before looping through the big loop. After optimizing your code with only the above improvements, I have cut the time down to this: Geo File Read Time: 0.14s Geo File Parse Time: 2.95s Log Parse Time: 0.09s Total Time: 3.18s IPs Found: 620
  11. Alternatively, use a function to set your status bar text. Pass in the tab number as one of the parameters of the function and store the text in a global array using the tab number as the index. Then when you switch tabs and call the function to show or hide UI elements, just set the statusbar text along with it.
  12. Well, I fixed my problem, so to speak. After much tweaking and trying many different combinations, I found that the problem with scrolling occurred when the Tab control was behind the RichEdit, for whatever reason. So I resized the Tab control to be just the height of the tabs themselves since I'm managing objects on the GUI myself anyway. This also fixed the cursor blinking problem. Now I just need to figure out why the script doesn't work on Win8.
×
×
  • Create New...