Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Forum syntax highlighting is live now!

Author
Message
Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 23rd Nov 2009 17:12
Syntax highlighting is live now, and by default it is turned off. You can select your language like this:

code lang=dbp

(put that inside the regular code tags)

So far, you can use:

dbp
cpp
vb
java
html

Let me know if you run into any issues and enjoy




Senior Web Developer - Nokia
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 23rd Nov 2009 17:14 Edited at: 23rd Nov 2009 17:14

Niiiice Although the VB one seems bugged.


EDP Map Editor[2D]
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 23rd Nov 2009 17:15
Yaaay

Athlon64 2.7gHz->OC 3.9gHz, 31C, MSi 9500GT->OC 1gHz core/2gHz memory, 48C, 4Gb DDR2 667, 500Gb Seagate + 80Gb Maxtor + 40Gb Maxtor = 620Gb, XP Home
Air cooled, total cost £160
Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 23rd Nov 2009 17:15 Edited at: 23rd Nov 2009 17:18
Oopss---- you're right. I'll let Paul know about that one It's most likely my fault


Senior Web Developer - Nokia
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 23rd Nov 2009 17:16 Edited at: 23rd Nov 2009 17:20
Testing:







"everyone forgets a semi-colon sometimes." - Phaelax
Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 23rd Nov 2009 17:19 Edited at: 23rd Nov 2009 17:19
@Zotoaster - I'll check what the issue with cpp is. Sorry about that.


Senior Web Developer - Nokia
Yodaman Jer
User Banned
Posted: 23rd Nov 2009 17:32
YES!!!! Thank you Jeku, this is awesome!!

"Life is like a basketball; it has its ups and downs, and it's always controlled by people who are taller and make more money than you."
-Omega Gamer 89
Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 23rd Nov 2009 17:34 Edited at: 24th Nov 2009 02:20
Testing large section:

EDIT:No "operator" highlighting, or am I doing it wrong?

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 23rd Nov 2009 17:52 Edited at: 23rd Nov 2009 17:59
This thread takes around 30 seconds to load because of the javascript



Also, '//' comments don't show up as comments, even though DBP accepts them.

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 23rd Nov 2009 17:58
Awesome! It's not something I've seen on a lot of forums (perhaps because I don't frequent a lot of programming forums) but I think it'll be very useful here.

Quote: "This thread takes around 30 seconds to load because of the javascript"


Get a better browser.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 23rd Nov 2009 18:02
@Benjamin
Firefox is not usually slow at running javascript...

Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 23rd Nov 2009 18:08 Edited at: 23rd Nov 2009 18:09
Hmmm, this is the same API that Google uses for code.google.com, so it shouldn't be slow. That being said, I'll take a look and see if there's something that can be done.

As for the broken languages, at least DBP works for the time being. I'll have a look tonight and try and figure out the issue with the other languages

@Dar13

Looks like cpp doesn't work. lang=c will work, though, for the time being.


Senior Web Developer - Nokia
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 23rd Nov 2009 18:13
Quote: "Firefox is not usually slow at running javascript..."


It never used to be, but the past and the present are two very different things.

Athlon64 2.7gHz->OC 3.9gHz, 31C, MSi 9500GT->OC 1gHz core/2gHz memory, 48C, 4Gb DDR2 667, 500Gb Seagate + 80Gb Maxtor + 40Gb Maxtor = 620Gb, XP Home
Air cooled, total cost £160
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 23rd Nov 2009 18:18
@Jeku
Maybe if you made the javascript run asynchronously it would solve the problem You could also make it only run when you open a code snippet.

Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 23rd Nov 2009 18:29 Edited at: 23rd Nov 2009 18:30
Hmmm it appears to run asynchronously for me on this end. Did you try it out with other browsers? I'd like to know if it's just a Firefox problem.

EDIT:

Just tested it out and it runs perfect on my end with Chrome, Firefox, IE 7, Safari, and Opera.


Senior Web Developer - Nokia
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 23rd Nov 2009 19:00
@Jeku
I'm using the latest version of firefox.

MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 23rd Nov 2009 19:29 Edited at: 23rd Nov 2009 19:37
Im using Safari and its working fine here, Excellent Update for the Forum, Thanks



Everyone Be Cool, You, Be Cool.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 23rd Nov 2009 20:12
I'm using version 3.5.5 of Firefox on XP and I get a warning popup that a script is still running and whether to continue it or cancel it. I'd say 30 seconds worth of retries is accurate.

It has this part in the warning: prettify.js:841 if that helps at all.

Oh and by the way, this is freakin awesome.

I'm not a real programmer but I play one with DBPro!
Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 23rd Nov 2009 20:18
@tiresius - Thanks for that, I'll take a look tonight


Senior Web Developer - Nokia
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Nov 2009 20:21
I'm surprised TGC didn't add Geshi to the forum years ago.

Oh wait, that's PHP only isn't it? Ok, nevermind, I see why they picked the JS method.


> SELECT * FROM users WHERE clue > 0
> 0 rows returned
hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 23rd Nov 2009 20:22
The syntax highlighting is neat, but when I click the thread, Firefox hangs for about 10-15 seconds before opening it. I'm using version 3.5.5 on Windows 7.

CodeSurge
Version 1.0 finally released! Code your DBP projects in style. (And save the kittens!)
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 23rd Nov 2009 20:59 Edited at: 23rd Nov 2009 21:00
I've noticed a problem, i dont know if its in safari only, but if you check the code below, it recognises the first command from the left and no further

So Instead of Set Object Collision, it only recognises Set Object, and so on for all the commands.

Everyone Be Cool, You, Be Cool.
Yodaman Jer
User Banned
Posted: 23rd Nov 2009 21:00 Edited at: 23rd Nov 2009 21:10
I'm running Chrome and everything loads fine for me.



EDIT: I'm totally lost...how do I set it to highlight the syntax? I tried adding "code lang=dbp" in the code tags, but it didn't worky. I are uh n00berz.

-CoffeeCoder

Formerly known as Yodaman Jer
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 23rd Nov 2009 21:04 Edited at: 23rd Nov 2009 21:11
i just checked in IE, and its a problem with that aswell

also a problem in Safari only is Numbers do not change color, (Numbers black same as text), but this isn't a big problem.

CoffeeCoder
instead of [code.] use [code lang=dbp.], (Minus the Dot)

Everyone Be Cool, You, Be Cool.
Yodaman Jer
User Banned
Posted: 23rd Nov 2009 21:12
Thanks MSon! That worked perfectly.

Although there are a few commands that aren't getting highlighted, just like you are. "Rate" isn't highlighted for some reason. Ah well, it's still really freaking cool that this is now implemented!

-CoffeeCoder

Formerly known as Yodaman Jer
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 23rd Nov 2009 21:17 Edited at: 23rd Nov 2009 21:27
I assume "Rate", as in "Sync Rate"

This is what i mensioned above as it recognises Sync, so it highlights that as the first command it found, i dont know why it dosn't check further, proberley just finds the first match possable, and simply uses that, but its still pritty cool anyway, Ill still use it.

Everyone Be Cool, You, Be Cool.
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 23rd Nov 2009 21:33
Fantastic update, thanks Jeku.

I'm glad I don't use Firefox anymore It was starting to remind me of IE.


Download the game!
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 23rd Nov 2009 21:38 Edited at: 23rd Nov 2009 21:42
i just notices that "Sync On" highlights fine, so i dont know why the others dont



Everyone Be Cool, You, Be Cool.
zeroSlave
14
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 23rd Nov 2009 21:50
This is a pretty cool addition! But...

Quote: "warning: prettify.js:841"

Same here.

Quote: "The syntax highlighting is neat, but when I click the thread, Firefox hangs for about 10-15 seconds before opening it. I'm using version 3.5.5 on Windows 7."

Same here but with XP Pro sp3.

There's something in this room that makes you can't speak well.
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 23rd Nov 2009 21:51
The Sync/On/Rate thing is probably to do with the order they're in the commands list. It probably needs to be pre-sorted shortest to longest or vice-versa.

Athlon64 2.7gHz->OC 3.9gHz, 31C, MSi 9500GT->OC 1gHz core/2gHz memory, 48C, 4Gb DDR2 667, 500Gb Seagate + 80Gb Maxtor + 40Gb Maxtor = 620Gb, XP Home
Air cooled, total cost £160
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 23rd Nov 2009 21:52 Edited at: 23rd Nov 2009 21:54
Quote: "warning: prettify.js:841"

and
Quote: "The syntax highlighting is neat, but when I click the thread, Firefox hangs for about 10-15 seconds before opening it."


That must be a firefox problem only, as i've tested in IE and Safari, and im having neither problem in both.

Everyone Be Cool, You, Be Cool.
Yodaman Jer
User Banned
Posted: 23rd Nov 2009 21:56 Edited at: 23rd Nov 2009 21:57
EDIT:

Didn't work in the least. Is it possible to add support for C#?

-CoffeeCoder

Formerly known as Yodaman Jer
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 23rd Nov 2009 21:58 Edited at: 23rd Nov 2009 22:00
For c# you might as well use [code lang=c.], (Minus the Dot)



Everyone Be Cool, You, Be Cool.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 23rd Nov 2009 22:03
Quote: "This thread takes around 30 seconds to load because of the javascript"


There's no noticeable speed drop for me, using Chrome.

Jeku, these colours are much better

lazerus
15
Years of Service
User Offline
Joined: 30th Apr 2008
Location:
Posted: 23rd Nov 2009 22:15 Edited at: 23rd Nov 2009 22:15
No speed drop what so ever here.

Tested on IE, chrome, safari and firefox, All fully updated.

Seems it might be on your end people =/

Edit javascript error the same as above mention appeared on firefox as i posted this.

Seppuku Arts
Moderator
19
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 23rd Nov 2009 22:25 Edited at: 23rd Nov 2009 22:25


Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 23rd Nov 2009 22:25
Thanks for the info, everyone

As for the missing keywords, I merely took the Help file from my DBP installation and took all the keywords from that long list. Some keywords might be missing, like Sync Rate, and I can add all of those. If someone wants to make a list of missing keywords in a post here and update it, that will be really cool. Even better, if you put the list in a code lang=dbp tag, when they get updated we'll be able to tell instantly.

Hopefully the missing keywords can be added over the next few days!

As for the code slowdown, I will find out about maybe adding an option in the user profile to disable the highlighting, so for those of you who have issues with your version of Firefox, you can disable it. It's bizarre that it only happens on some Firefox versions, and not others, though.


Senior Web Developer - Nokia
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 23rd Nov 2009 22:30
ill make a list of missing keywords now

Everyone Be Cool, You, Be Cool.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 23rd Nov 2009 22:31
Oh, that's just really nice

NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 23rd Nov 2009 22:43
Quote: "As for the missing keywords, I merely took the Help file from my DBP installation and took all the keywords from that long list."


Are you sure that they're not already there, just that Sync comes before Sync Rate so Sync takes preference?

Athlon64 2.7gHz->OC 3.9gHz, 31C, MSi 9500GT->OC 1gHz core/2gHz memory, 48C, 4Gb DDR2 667, 500Gb Seagate + 80Gb Maxtor + 40Gb Maxtor = 620Gb, XP Home
Air cooled, total cost £160
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 23rd Nov 2009 22:48 Edited at: 23rd Nov 2009 22:50
Well, this isn't all of them yet, but some here wont highlight



Ill build a list of ones that dont highlight properley anyway.

Everyone Be Cool, You, Be Cool.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 23rd Nov 2009 23:04
will it be made to work with DarkPhysx and DarkAI?

Dark Physics makes any hot drink go cold.
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 23rd Nov 2009 23:16 Edited at: 23rd Nov 2009 23:22
Part 2, Sorry its to check which arnt working


Everyone Be Cool, You, Be Cool.
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 23rd Nov 2009 23:28 Edited at: 23rd Nov 2009 23:28
This is the Full List of DarkBasic Commands that dont Highlight Properly



Everyone Be Cool, You, Be Cool.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 23rd Nov 2009 23:32
also one of these ` instead of a rem makes all the rest of the text red.

Dark Physics makes any hot drink go cold.
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 23rd Nov 2009 23:41 Edited at: 23rd Nov 2009 23:45
the rems are all fine in Safari, What Browser are you using




Everyone Be Cool, You, Be Cool.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 23rd Nov 2009 23:44 Edited at: 23rd Nov 2009 23:48
using ie8.

this what I see in IE8



Dark Physics makes any hot drink go cold.

Attachments

Login to view attachments
Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 23rd Nov 2009 23:45 Edited at: 23rd Nov 2009 23:46
Thanks for that, MSon, this will be a lot easier for me now

Quote: "will it be made to work with DarkPhysx and DarkAI?"


Yes, I will see about adding the keywords from the official TGC plugins. I don't have all of them yet but for the ones I do I will make the attempt.


Senior Web Developer - Nokia
Darth Kiwi
19
Years of Service
User Offline
Joined: 7th Jan 2005
Location: On the brink of insanity.
Posted: 23rd Nov 2009 23:47
Just noticed this - thank you Jeku!

Secretary of Unknowable Knowledge for the Rock/Dink administration '08
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 24th Nov 2009 00:12 Edited at: 24th Nov 2009 00:23
Jeku
Usually when i need to list all DB or DLL Commands for my own use, usually scripting, i just write a little programme to scan an Keyword File and change it automatically, doing that you should be able to write the code to add DLL Commands for Matrix1, Blue, DarkPhysix, DarkAI, ect fairley quickley.

HowDo
Your right, i just checked in IE(v7) on my system and had the same problem so its not just you, im glad i use safari now as it seems to be working best in it.

This is what it looks like in Safari

Everyone Be Cool, You, Be Cool.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-26 06:54:55
Your offset time is: 2024-04-26 06:54:55