ACDB  Log In
Search

READ ONLY MODE IS ACTIVATED

Post Reply
ACDB Forums :: Anime Characters Database :: Site Discussion
Posted 15 year(s) ago Re: # 5793

Kyareshi
The Plotmeister

Kyareshi Avatar
10 Stars

Joined on 01-08-09
Posts 940

13x31
Ah, the lovely world of JavaScript (*is a bit sarcastic*) I tried to dive into it, but I belly flopped and gave up... Although I did figuring out the syntax while looking at someone else's code when I was trying to make something else a couple years ago.

Java =/= JavaScript
[Image]
Top PM Kyareshi
Posted 15 year(s) ago Re: # 5795

Nori13
Shinobu's Pet Wolf

Nori13 Avatar
5 Stars
Head Admin
Joined on 05-30-10
Posts 416

Kyareshi

Java =/= JavaScript

Or in Python syntax:
Java != Javascript
lol

Wait....*Looks up Java and JavaScript* Gah... *Process data in brain* Okay, I never really thought twice about Java and JavaScript being different, of course the people who developed JavaScript had to rename it to something confusing like that (before JavaScript, it was named LiveScript). I generally stay away from any language with a confusing syntax. (Not to mention that Java, through X11, makes my MacBook run hot sometimes).

Java 'Hello World' (has no idea what the output looks like):

// Outputs "Hello, world!" and then exits
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}


Python 'Hello World' as command line (without Tkinter):

print "Hello World!"
raw_input("Press enter to exit.")


or as a callable user-defined module:

def helloworld():
print "Hello World!"
raw_input("Press enter to exit.")

Of course "helloworld" can be renamed as anything, since it's the name of the user-defined module, and the ' "Press enter to exit." ' can be any string that lets the user know that pressing enter will leave the module (and in this case exit the program). But that's all command line which I have not used in.... A while (I had to look at one of my Python CLI programs for some of the functions lol)

I didn't like JavaScript since the way it's structured hierarchically with "{" and "}" (and Java's the same way too), and in more complex programs makes it a little more difficult for me to read. Of course, Java and Python are both different in terms of functionality and human readability.

*Is now longwinded*
I picked up Python (I don't even remember how) as a step up from TI-BASIC (the programming language on the TI-83/85/etc. calculators) since I wanted to be able to actually run the programs on the computer instead of having to run them on the calculator (AAA batteries are very uncommon in my house and the rechargeable ones take too long to recharge if they aren't charged).
*Is now done*

(Edit)
I wouldn't doubt if you're working on this, but editing the character traits in the new site takes me back to the old one.

(Edit #2)
The code tags need to be left justified, it looks strange when it's centered.

[ Edited Jun 23, 2010 ]
Top PM Nori13
Posted 15 year(s) ago Re: # 5796

Rei
ダメ人間

Rei Avatar
10 Stars
Head Admin
Joined on 05-24-07
Posts 2102

--code tag--
Code tag updated in CSS. Should now be left justified, and monospace font. Tempting to do some syntax highlighting on it too. Haha.

--new thread--
New thread mode has been added to the forums. Think we are pretty close to having the exact same parsing. I even got a Duplicate Post error when posting the same thread on the new forum, then posting it again on the old forums. That's a good sign! lol (Wonders: How did it know it was a duplicate post.... there's no hash or bytes or any unique identifier that could be quickly checked in that shi--- software.)

--regexp--
I think I understand the regexp a wee bit more. I'll rewrite them when I better understand what I'm doing... for now, let the CPU burn!

System.out.println("Hello, world!");

That will print "Hello, world!\n".

I don't like JavaScript either, so you'll always find ACDB Software to be fully usable without it. ^_^ Nonetheless, JS is still on my to-learn list.


--WTCB--
Next up... adding some moderation buttons to the WTCB. And updating the theme to be more like the new forum.
[Image]

私は日本語を少し読むと書くをできます。あなたも?

[Image]
Top PM Rei
Posted 15 year(s) ago Re: # 5798

Nori13
Shinobu's Pet Wolf

Nori13 Avatar
5 Stars
Head Admin
Joined on 05-30-10
Posts 416

Hmm... It's good that the left justified works, but it's not taking the extra spaces for the necessary tabbing, since it should be (the _ will be a space-holder):
answer="No"
while answer=="No":
_____print "Are we there yet?"


Instead of:

answer="No"
while answer=="No":
print "Are we there yet?"


There's a fun infinite loop for your CPU to burn to lol.<br><br>As far as syntax highlighting, D: that might be quite the project to pull off. It shouldn't be that hard to post along with the code what language it is. I have several programming text editors that highlight the syntax, so I can just copy/paste and select the correct language. And speaking of which, I use Notepad ++ on Windows, jEdit (no, this has nothing to do with Japan lol, I think it's programmed with Java, but I could be wrong) for Mac OSX and Linux (not sure about Linux, but I don't feel like turning my Linux box on to find out and then turning it off).

Hmmm... I noticed when previewing that the post kinda turns HTML-ish inside the reply box... So just as a test for all to see if using the non-breaking space character works at all (the characters "nbsp" with a "&" before the "n" and a ";" after the "p"):

answer="No"
while answer=="No"
     print "Are we there yet?"



Uh oh... Houston, we got a problem... So using the preview button with the HTML converted tags causes problems...


So instead of using the new forum to post this, I'll be moving back to the old forum to see what happens *crosses fingers*

So the old forum doesn't take the HTML stuff eiher, but luckily I just had to retype some of this post (luckily just the bbcode code tag sections), but I can see this causing problems down the road. And I had no problems previewing this post in the old forums, all the bbcode tags were still there and no funky conversion stuff.

(Edit)
Since I had to post before I could check out what happens in the new forum with the nbsp characters, I was holding off with the rest of this.

So as everyone can see, the nbsp characters do work, so if you are able to convert all the space characters within the code and /code tags to "&"nbsp";" (minus the quotation marks) I think that will solve it.

[ Edited Jun 24, 2010 ]
Top PM Nori13
Posted 15 year(s) ago Re: # 5800

Rei
ダメ人間

Rei Avatar
10 Stars
Head Admin
Joined on 05-24-07
Posts 2102

Arg.... I never can figure out when to transform text, when not to, when double parsing happens, when tripple parsing happens, when it doesn't happen........

So I'm guessing here... The Preview should be completly transformed and BBcoded.
The stuff in the TEXTAREA should be untouched $_POST data.
Stuff in the VALUE space of an INPUT should or should not be parsed...?
[Image]

私は日本語を少し読むと書くをできます。あなたも?

[Image]
Top PM Rei
Posted 15 year(s) ago Re: # 5801

Ishikawa
紳士(に)神

Ishikawa Avatar
6 Stars

Joined on 12-03-07
Posts 510

Since you asked, I'll reply here.. sorry for going off topic!
Basically I've been moving around a lot. But now I'm *finally* in one place for a while.
While I was away I was learning Japanese full time, so I'm pretty good at that now ^_______^
Looking forward to getting involved again.
Also, if you're still all IRCing, then I'll get on there too.
働きすぎた。タバコない。無念。
Top PM Ishikawa
Posted 15 year(s) ago Re: # 5803

Nori13
Shinobu's Pet Wolf

Nori13 Avatar
5 Stars
Head Admin
Joined on 05-30-10
Posts 416

Rei

So I'm guessing here... The Preview should be completly transformed and BBcoded.
The stuff in the TEXTAREA should be untouched $_POST data.


Assuming that TEXTAREA refers to the reply box where users type into:

As long as the forums do not touch the text in the TEXTAREA, there doesn't need to be a change with the preview, since the old forums does not touch the TEXTAREA.

Rei

Stuff in the VALUE space of an INPUT should or should not be parsed...?


And which confuses me on what you're referring to when you mean "INPUT".

So after reading this:Link it seems like there should be some kind of configuration where you can define what gets parsed and what doesn't; however the article doesn't make clear how you're supposed to set it up.

It's looks like the Gaia Onine forums doesn't parse it right either:



Hmm.... I suppose you could always set up the new forum bbcode in the same way you set up the old forum... Looks like I'll be nbsp'ing for a while lol

Ha-ha! *Creates Python program to turn my spaces into nbsp's for when I need to post code into forums*

(Edit2)

And done (I just modified one of my other progs...) So I tested it out on Gaia again and then this happens:
[Image]

Lol, I guess the Gaia forums doesn't like the nbsp characters.

Well, I know the nbsp works here, so there's no need to post it.

[ Edited Jun 24, 2010 ]
Top PM Nori13
Posted 15 year(s) ago Re: # 5808

Rei
ダメ人間

Rei Avatar
10 Stars
Head Admin
Joined on 05-24-07
Posts 2102

Sorry 13x31, I was a bit too tired to make any sense when I wrote that reply.

By textarea and input, I was referring to standard HTML elements.
TEXTAREA
INPUT

Anyways, when you type in the input box, it's common to use special characters like '"& but these are special HTML characters, and need to be escaped to be used in valid HTML documents.

To explain anymore is beyond my ability, so I'll leave the problem there. Google it if you're curious. ^_^ I'm just gonna attack it with trial and error until something passes all the tests I run.

Edit: Check out this source. Stuff in the TEXTAREA is untouched, but the stuff in the Preview is fully escaped. I'll verify if this same trick wwill work on INPUT tags used for the name of a new thread...




Edit 2: So, doing this unescaped will break the HTML. Putting a double quote in the INPUT closes that early. And putting HTML in the textarea can possibly break that too.




Edit 3: Conclusion is, everything must be escaped. The preview, and the input. So I've made that change in the code and uploaded it. If there remain any issues inconsistent with the old forum... let me know, and I'll look into it again. For now, I consider the Preview and Post to work.



I'll fix the code BBCode - so you don't have to use the trick. A lot of sites use PRE tags to tell the web browser to render the text as typed. I think there exists a CSS trick to accomplish the same, so I'll enable that.

Ishikawa-san, it'd be great to see you on IRC again! All the same people idle on irc.rizon.net #acdb plus a few new regulars. I'm looking forward to practicing Japanese with you on the Nippongo forum. ^_^ Once the new forums are done (and with translated interface), our Japanese visitors should feel more welcome to join in on the forums. It'll be fun!

13x31, do you mostly program on WIndows? I was wanting to ask you what you thought of bash scripting, if you'd tried it on UNIX or Linux.

[ Edited Jun 24, 2010 ]
[Image]

私は日本語を少し読むと書くをできます。あなたも?

[Image]
Top PM Rei
Posted 15 year(s) ago Re: # 5815

Nori13
Shinobu's Pet Wolf

Nori13 Avatar
5 Stars
Head Admin
Joined on 05-30-10
Posts 416

I program with Python/Tkinter on whatever OS, since I do have all three. I haven't done (or know) much with bash scripting, since with either Mac OSX or Linux, I don't really have a use for it. For Mac OSX, the reason should be pretty obvious, and for Linux, I'm using the Linux Mint distro that has a package manager that lets me install Linux packages with that. Well, I'll check some of the changes out before I start programming another couple (maybe few) programs that I need.
Top PM Nori13
Posted 15 year(s) ago Re: # 5816

Nori13
Shinobu's Pet Wolf

Nori13 Avatar
5 Stars
Head Admin
Joined on 05-30-10
Posts 416

Okay, so the preview appears correctly now, but it still changes the text in the reply field (as shown below):
[Image]

And what I really typed was:

Top PM Nori13


Post Reply