You are not logged in or registered. Please login or register to use the full functionality of this board...
SIGN IN Join Our Community For FREE


Browser filter
07-04-2017, 10:41 AM
Post: #1
 (Print Post)
Browser filter
Code Snippet: [Select]
'browser filter.bas for FB (B+=MGA) 2017-07-04 wow 1 year since SB version!
'tabs2spaces.bas  SmallBASIC 0.12.6 [B+=MGA] 2016-07-04
#Include "file.bi"
Const XMAX = 1200
Const YMAX = 720
Const PI = Acos(-1)
Const RAD = PI/180.0
Const DEG = 180/PI
ScreenRes XMAX, YMAX
Width XMAX\8, YMAX\16      ' Use 8*16 font
Dim As String tabFile = "quick test.bas"                             '<<<<<< type name of file here
Dim As String newFile = "test forum eval 1 bplus.bas"    '<<< new file name here
Dim As String yes, fline, b, c
Dim As Integer i
If FileExists(tabFile) Then
 If tabFile = newFile Then newFile = "_" + newFile
 If FileExists(newFile) Then
  ? "The new file: "; newFile;
  Input ", already exists, press y for yes! to overwrite it > ", yes
  If yes <> "y" Then End Else ? "OK, overwriting file."
 Else
  ? "creating new file..."
 End If
Else
 ? tabFile;" file not found, press any..."
   Sleep
   End
End If
Open tabFile For Input As #1
Open newFile For Output As #2
 While EOF(1) = 0
  Line Input #1, fline
  b = ""
  For i = 1 To Len(fline)
   c = Mid(fline, i, 1)
   If Asc(c) = 9 Then
    b = b + Space(3)
   ElseIf 32 <= Asc(c) And Asc(c) <= 127 Then
    b = b + c
   Else
    b = b + " "
   End If
  Next
  Print #2, b
 Wend
Close #1
Close #2
? newFile;" is ready, press any..."
Sleep
End

This code removes unwanted characters that some browsers insert when copy/pasting code from forums. Here is FB .bas code to filter such files.

I was going to add the .exe for a general utility for everyone not just FB users but that would need more setup to type in names of files involved and more confirmations?

Suggestions towards that end of a general .exe utility?


Attached File(s)
.zip  Browser filter.zip (Size: 836 bytes / Downloads: 6)

B += _
Find all posts by this user
Like Post
07-04-2017, 09:35 PM
Post: #2
 (Print Post)
RE: Browser filter
bplus,

Some of those issues stem from the MyCode tags used in these posts which help to add features to the posts, and to help move away from pure HTML tags.

This forums MyCode does have an issue with a specific sequence of characters, but it is rare to see those.

Please help support The Joyful Programmer and The QB64 Edition by visiting our online store provided by Amazon.com. We hand-picked books related to computer programming from Amazon.com and added them to our store. When you make a purchase from our store, we do receive a small commission from the sale. Visit our store at: http://www.thejoyfulprogrammer.com/qb64/...azon-store
Find all posts by this user
Like Post
07-05-2017, 11:00 AM
Post: #3
 (Print Post)
RE: Browser filter
Hi Walter,

The filter was made for people who use browsers that insert characters into the copy of a copy/paste from any forum. You wouldn't think browsers should do that but apparently one very big comapny in Seattle thought otherwise.

BTW, this default browser that I am using, temporarily!, is having a very difficult time handling this forum. But it is doing better than Chrome on my low end Android device that can not stay connected to this forum for more than 2 secounds.

At the moment I am composing my comments in notepad because the editor at the forum is next to impossible to use.

Just some feedback,
Mark

B += _
Find all posts by this user
Like Post
07-05-2017, 02:28 PM
Post: #4
 (Print Post)
RE: Browser filter
bplus,

What device are you using to access this forum and what browsers are you using?

I access this forum only on my laptop and PC at work, so I never tested it on any other device.

Please help support The Joyful Programmer and The QB64 Edition by visiting our online store provided by Amazon.com. We hand-picked books related to computer programming from Amazon.com and added them to our store. When you make a purchase from our store, we do receive a small commission from the sale. Visit our store at: http://www.thejoyfulprogrammer.com/qb64/...azon-store
Find all posts by this user
Like Post
07-05-2017, 02:55 PM (This post was last modified: 07-05-2017 03:02 PM by bplus.)
Post: #5
 (Print Post)
RE: Browser filter
Hi Walter,

My low level Android device (With Chrome Browser, it's an Android device) is a Barnes and Noble Nook.

When my laptop lost it's hard drive, it was there to feed my forum addiction although it's not fun posting with a magnifying glass in one hand and a pop-up keyboard (no mouse) that switches between 3 pads depending of Upper case letters, lower case letters or digits.

I think I left enough clues as to what browser I am not advocating. Wink FireFox or Foxfire (FF) does pretty well with all the forum graphics, the editor has good moments and bad. I suspect it depends on how many people are on forum or trying to post or trying to monitor like our big brothers CIA, FBI their enemies Putnik ... server folks who want to sell us stuff... lots of people like to listen-in...

I hope you don't get me wrong with my feedback, I am glad to be a pioneer member of a pioneering forum designer. I am pretty sure you need to know this stuff even if not happy news.

Hey! Editor is working fine now at 2:49 PM, I just realized I typed this up without a hitch! Smile
I also just noticed, I am writing without the aid of a spellchecker so watch out guys...

B += _
Find all posts by this user
Like Post
07-05-2017, 03:18 PM
Post: #6
 (Print Post)
RE: Browser filter
Mark,

I personally would rather have only the bad news, because the good news doesn't help me fix problems. I have been this way since drama class in high-school.

It's funny you don't advocate FireFox for the Android because that is all I ever use on the PC. I prefer FireFox over Chrome or any other browser. It is easier to use in my opinion, looks better than Chrome on my laptop (thanks Microsoft!), and it has tons of web development tools that I use everyday, and can't get on other browsers. I also use a ton of other plugins as well in the browser, and many of those are not available on other browsers.

The editor everyone uses on this forum is a built in package, and I have not modified it in anyway other than the fonts used in it.

Another thing to, I am using an older version of the software so that might be the cause of some issues people are having. I am unable to update the software with losing all my modifications.

Please help support The Joyful Programmer and The QB64 Edition by visiting our online store provided by Amazon.com. We hand-picked books related to computer programming from Amazon.com and added them to our store. When you make a purchase from our store, we do receive a small commission from the sale. Visit our store at: http://www.thejoyfulprogrammer.com/qb64/...azon-store
Find all posts by this user
Like Post
07-05-2017, 03:42 PM
Post: #7
 (Print Post)
RE: Browser filter
Hi Walter,

Oops, my message was not clear.

The Browser I do not advocate is MS Edge.

FireFox (FF) is better than Chrome in my own opinion and experience.
But my experience with Chrome is from Nook and my experience with FF is from my laptop, so apples and oranges...

I am not using FireFox at moment because I lost all my settings info trying to trouble shoot a performance problem while following their guide. So I am a little peeved but will probably go back because MS Edge sucks! MS Edge is the browser that is inserting extra characters into my copies from forums.

Repeat: I do not advocate MS Edge.

Mark

B += _
Find all posts by this user
Like Post
07-05-2017, 04:08 PM
Post: #8
 (Print Post)
RE: Browser filter
Mark,

I couldn't agree more about how bad MS Edge (and MS Internet Explorer) sucks! The only time I ever use those browsers is to download FireFox on a new machine.

In my opinion, Microsoft purposedly does not keep up with today's standards like FireFox and Chrome do. Besides, why would they want to? They don't profit from their browser. The only reason in my opnion why they have the market share they do is due to them including it in their OS, which is perfectly fine in my opinion. However, if they went head-to-head with FireFox and Chrome on people having to download it outside of their OS, they would shut the project down due to a lack of interest, which again is my opinion.

Please help support The Joyful Programmer and The QB64 Edition by visiting our online store provided by Amazon.com. We hand-picked books related to computer programming from Amazon.com and added them to our store. When you make a purchase from our store, we do receive a small commission from the sale. Visit our store at: http://www.thejoyfulprogrammer.com/qb64/...azon-store
Find all posts by this user
Like Post



Forum Jump:


User(s) browsing this thread: 1 Guest(s)




QB64 Member Project - Basic Dithering
QB64 Member Project - Kings Court
QB64 Member Project - Color Rotating Text
QB64 Member Project - ARB Checkers
QB64 Member Project - Dakapo
QB64 Member Project - Rubix's Magic
QB64 Member Project - Connect Four
QB64 Member Project - Kobolts Monopoly
QB64 Member Project - Swirl
QB64 Member Project - Score 4
QB64 Member Project - Spinning Color Wheel
QB64 Member Project - Domain
QB64 Member Project - Martin Fractals version two
QB64 Member Project - Red Scrolling LED Sign
QB64 Member Project - Qubic
QB64 Member Project - MAPTRIANGLE
QB64 Member Project - Pivet version one
QB64 Member Project - Inside Moves
QB64 Member Project - Isolation
QB64 Member Project - Dreamy Clock
QB64 Member Project - Bowditch curve
QB64 Member Project - Martin Fractals version three
QB64 Member Project - Touche
QB64 Member Project - RGB Color Wheel
QB64 Member Project - Overboard
QB64 Member Project - Splatter
QB64 Member Project - Foursight
QB64 Member Project - Quarto
QB64 Member Project - Othello
QB64 Member Project - Rotating Background
QB64 Member Project - Line Thickness
QB64 Member Project - Point Blank
QB64 Member Project - Martin Fractals version four
QB64 Member Project - Algeria Weather
QB64 Member Project - Spiro Roses
QB64 Member Project - OpenGL Triangles
QB64 Member Project - Blokus
QB64 Member Project - Kings Vallery version two
QB64 Member Project - Color Triangles
QB64 Member Project - Exit
QB64 Member Project - Full Color LED Sign
QB64 Member Project - Amazon
QB64 Member Project - Martin Fractals version one
QB64 Member Project - 9 Board
QB64 Member Project - STxAxTIC 3D World
QB64 Member Project - Input
QB64 Member Project - Kings Valley verion one
QB64 Member Project - Sabotage
QB64 Member Project - Pivot version two