Personal Pocket PC Wiki

Woinowski

Active Member
Licensed User
Longtime User
Would like to help - what is the exact problem?

Hi Tony,

I just looked at your samples and without running them I think they look fine.

So, do you have more specific problems with Regexes?

Maybe a classical UNIX manpage could help you, too: regex(7): POSIX.2 regex - Linux man page

Regards
Jens
 

tsteward

Well-Known Member
Licensed User
Longtime User
The main problem is my lack of knowledge.

The regex that I have post works well. I believe that if I can convert the rest of the sub "parseBlade" (or at least most of it) to regex instead of looping through the file checking every single character, then it will be much faster.

I have attached my wikipage "Ford". On my ppc it takes around 2 minutes to load. Now with my current parseBlade sub it is down to around or under a minute.

I need help to crete regex for the unsorted lists and sorted lists which can be nested.

Thanks Heaps any and all help appreciated
 

digitaldon37

Active Member
Licensed User
Longtime User
Compressed Text

How about removing unnecessary spaces before parsing it? That seems like it would be easy to do with regex, especially if you are loading the whole file into a string.

Your test file didn't have any complicated spacing (ie two words separated by a space) so I used notepad's "replace/all" to remove the spaces and then parsed it in the older parser. The file was 1/2 the size and loaded much quicker.
 

tsteward

Well-Known Member
Licensed User
Longtime User
Thanks Don,
I didn't think of that. That removed about 2000 cycles out of the parser checking to see if those spaces needing anything doing to them. & yes regex fixed it brilliantly.

I wish I understood regex better, I could probably take over the world they are so powerful. Although there not the whole answer.

I have other even longer pages without the white space to cleanup so I will constantly be looking for ways to speed up things.

How about removing unnecessary spaces before parsing it? That seems like it would be easy to do with regex, especially if you are loading the whole file into a string.

Your test file didn't have any complicated spacing (ie two words separated by a space) so I used notepad's "replace/all" to remove the spaces and then parsed it in the older parser. The file was 1/2 the size and loaded much quicker.
 
Last edited:

tsteward

Well-Known Member
Licensed User
Longtime User
Ok I have been programming my fingers off. My head is just about fried.
The latest version has been posted back in message #1.

I have achieved pretty much what I originally set out to do. Of course now I want more. Don't we always.

Anyway although this is labeled version 0.60 consider it a beta V1 release. I now would like people to report bugs (PPC version only). Its time for me to stop adding features and cleanup things.

Version 0.60(beta 1)

  • Added speed up code for section links. They nolonger re-load the whole page and re-parse the whole page.
  • Fixed up section linking to create desciptive links.
  • Cancel button in editing nolonger re-loads and re-parses the page un-necessarily.
  • Using link button on shortcut form will give a list of of available pages if no text is highlighted
  • Fixed section and live links
  • Now uses temp html file
  • Fixed check wiki syntax menu now checks the correct menu item
  • Fixed tables again
  • Fixed wiki parser not allowing <,>,# or $ in normal text
  • Added edit short cut buttons - tourn on or off via options
  • Added Insert Contents menu option to edit menu
  • Added About form
 

tsteward

Well-Known Member
Licensed User
Longtime User
Found and Squashed Bugs for version Beta 1:
  • If you click on a section link, then click on any link to another page it only half works.
Found & Not Squashed Bugs:
  • Links to sections on a differant page - don't work at all.
 

digitaldon37

Active Member
Licensed User
Longtime User
Checklist

Tony,

Attached is a checklist I put together to help me go test all of the features. Please add/edit and add to your #1 post if you wish.

Here are a couple of things I noticed:

1. In edit mode, the "[]" always prints "[" even if I'm trying to close the tag.
2. Grey space on top after switching between landscape and portrait mode

I also noticed that when I copied the "ppcw.ini" file from desktop to pda I got an error. The problem is the ini setting for the directory - the PDA chokes on the PC directory string. We may want to use one value for WikiDir for the PC and a different one for the PPC, and use the one for that platform. Maybe "wikiDirPPC" and "wikiDirPC" and then assign to WikiDir depending if CPPC is true or not.
 
Last edited:

tsteward

Well-Known Member
Licensed User
Longtime User
Hi Don,
I don't get any grey space when switching on my ppc. I have tried in view mode and in edit mode. The only time I do is if I go into config and turn of shortcut buttons. But as stated on that screen changes will not apply until restart.

Yes the "[" situation is lazyness on my part I will fix that.

I agree with the ini problem. I was thinking like a programmer and I personally don't sync the ini file, but you can bet a user would and that would only leed to frustration for them.

Thanks for your comments

Tony,

Attached is a checklist I put together to help me go test all of the features. Please add/edit and add to your #1 post if you wish.

Here are a couple of things I noticed:

1. In edit mode, the "[]" always prints "[" even if I'm trying to close the tag.
2. Grey space on top after switching between landscape and portrait mode

I also noticed that when I copied the "ppcw.ini" file from desktop to pda I got an error. The problem is the ini setting for the directory - the PDA chokes on the PC directory string. We may want to use one value for WikiDir for the PC and a different one for the PPC, and use the one for that platform. Maybe "wikiDirPPC" and "wikiDirPC" and then assign to WikiDir depending if CPPC is true or not.
 

tsteward

Well-Known Member
Licensed User
Longtime User
Hi Don,
Sorry I have only just attempted to use this new file but it will not just pluging. You have changed the name of the sub. also declared something I cant remember at the moment.

You might like to look into this.

Regards
Tony

Attached: wiki_parser (slash syntax)
* added new syntax markup
* fixed heading markup (would trigger on dates ie 7/27/08 created /2 headings)
* added debugMode to append error message on output for invalid markup
* added calls to FormatFileName (to replace spaces with %20, etc)

To Do:

1. Add ability to combine markups (can't use links in a table for now)
2. Add external web & file handler
 

tsteward

Well-Known Member
Licensed User
Longtime User
I thought I had it fixed but alas I'm stuck.

If you click on a section link to a header in the current page it works perfect on both pc and ppc.
Then if you click on a standard link it works on the pc but on the ppc it only half works. It loads and parses the new file but does not refresh the browser. If you hold down the stylus and select refresh from the popup menu the page is then displayed. The same thing happens if you click on a section link to a new page.

Any ideas on how and where I can refresh the browser?

Current code attached.
Subs concerned are:
Sub web_navigating
Sub Parse(url)
Sub RefreshWeb
 

Cableguy

Expert
Licensed User
Longtime User
I thought I had it fixed but alas I'm stuck.
Any ideas on how and where I can refresh the browser?

Wich Browser dll are you using?
I remember that Andrews dll did miss some basic methods and properties, that shouldn't be that hard to include in a modded version dll...
 

digitaldon37

Active Member
Licensed User
Longtime User
slash parser (include file)

Attached is version .23 of the slash parser. I am using the stringsEx library so this needs to be added to the project. Also need to add these controls:
  • strb - StringsBuilder
  • stre - StringsEx

I noticed that slash linking wasn't working since we changed to using a temp HTML file for display, so I fixed that as well.

Cableguy, we are using agraham's web browser library. I think Tony may be looking for a refresh method, which I don't see in that library or the dzHtmlView one. I haven't tested what he is experiencing but it sounds like he is looking to navigate to a temp html page, and then do a refresh so that section links will work

9/8/08 update: updated parser to handle http: links and better format tables
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
This is Andrew's Browser dll with a few new props and methods...
Props
-ShowScrollBars set wether scroll bars are visible or not
-DocumentText now also retrives the current browser document
Methods
-BringToFront brings the control to the top most z-order
-Refresh reloads the current document and updates the display

Myclass.cs is the source file, and should be renamed as WikiBrowser in order to be merged in the exe..

Hope this will help...
 
Last edited:

agraham

Expert
Licensed User
Longtime User
This is Andrew's Browser dll with a few new props and methods
I deliberately retricted functionality to that available on the device. The desktop WebBrowser is far more capable than the device.

From How to: Use the WebBrowser Control in the .NET Compact Framework
The following considerations apply only to Windows Mobile 2003 for Pocket PC and Windows Mobile 2003 for Smartphone:
The Refresh method throws a NotSupportedException exception.
Refresh will only work on WM5.0 or later, I wanted to target older devices as well.
The .NET Compact Framework does not support the Document property and its related properties and events, except for the DocumentText property. You can use DocumentText to present HTML to your users, such as to provide links and a simple HTML form, but the .NET Compact Framework does not support accessing the HTML content of a Web page with this property.
DocumentText is write only on a device. Only on the desktop is it readable.
 

Cableguy

Expert
Licensed User
Longtime User
I deliberately retricted functionality to that available on the device. The desktop WebBrowser is far more capable than the device.

From How to: Use the WebBrowser Control in the .NET Compact Framework
Refresh will only work on WM5.0 or later, I wanted to target older devices as well.
Targeting device with Windows Mibile 2003SE and older is like targeting Windows95...
DocumentText is write only on a device. Only on the desktop is it readable.
Yes, but the user may need some features diferently on the desktop...
For instance, I'm trying (Still) to get the WebBrowser to ZOOM, even thought I KNOW it only works with IE7, and only in the desktop...
 

agraham

Expert
Licensed User
Longtime User
Targeting device with Windows Mibile 2003SE and older is like targeting Windows95...
Rubbish! - Basic4ppc still targets .NET 1.0/1.1 even though 3.5 is now available on the device. Stuff has to work on the installed user base not just the latest products.
 

Cableguy

Expert
Licensed User
Longtime User
I think you miss understood me....
I was not trying to say that we shouldn't target those older platforms....
However, making sure that our app is that much backward compatible, makes us unable of making the most of the newer platforms....There is now a flash reader for WM6, wich doesnt exist for WM2003SE, So WE SHOULDNT build flash enabled app's?????
 

agraham

Expert
Licensed User
Longtime User
I think you miss understood me....
I was not trying to say that we shouldn't target those older platforms....
Certainly looked like it!

Now that you have modified and reposted my code without consulting me I assume that you will now be providing the support for it in the future.
 

Cableguy

Expert
Licensed User
Longtime User
Certainly looked like it!

Now that you have modified and reposted my code without consulting me I assume that you will now be providing the support for it in the future.

Assuming that you are NOT just being pedantic, I appologise for that...
I know in first hand how much effort goes into creating a custom lib.
I never in any point did put you off or suggested that this lib was my work.
As stated it is just a mod, so the basis are still yours....all the comments are still there, and not even the version number was altered...
No mention whatsoever in the files about me...
I did wrong, am I intented no harm, nor to get you mad...I guess I was just
too eagger to help, and jumped the gun...
I can take the atachment out if you whant me to, heck i can delete all my previous post in this thread, if that what it takes...

But being this such a popular thraed, in wich you have participated in various ocasions, I didnt thought you would be so sour...

AGAIN, I AM SORRY FOR POSTING AN MODDED AGRAHAM'S DLL WITHOUT CONSULTING HIM....
 

tsteward

Well-Known Member
Licensed User
Longtime User
Wow Time Out

I really appreciate any help anyone is willing to give.

That said please take this little dispute elsewhere, maybe PM each other and sort it out there.

Again I appreciate the help and effort from everyone. Without these library's that you people spend many hours on, then donate free of charge, I would not be able to create my application, so thank you ver much, but this dispute has the ability to takeaway from this discussion and may put of people who also want to help but become afraid of commenting.

Please if you can add constructive comments, suggestions or help then do so. I need help as I am only new to B4PPC and I am not a programmer by any measure.

Thanks
Tony
 
Top