Results 1 to 10 of 10

Thread: My first real Ajax is live... it's fun too

  1. #1
    Flower Child stytagm's Avatar
    Join Date
    Aug 2004
    Location
    London
    Posts
    754
    Thanks
    47
    Thanked
    23 times in 18 posts

    My first real Ajax is live... it's fun too

    Hi guys,

    I've finally finished my first pet AJAX page. It's a swearing sandbox which checks what you type in real-time and highlights any swearwords it recognises. It also gives a sort of "rudeness rating" based on what you've typed. Have a go, it's fun. See what maximum score you can get.

    Swearing sand box - BannedWordList.com

    It's written using Jquery on the front end, and asp.net 2.0 (c#) on the server. If I was any good at javascript I'm sure this could be done entirely on the client side, but the object of the exercise was to play with an asynchronous client-server call.

    All comments appreciated. As I'm sure you'll notice, design is not my strong point, but I intend to add a bit of colour one day (and replace the scanned pencil drawings with proper ones).

    - Andrew

    PS - No peeking at the swear word lists on the homepage. They're the same ones used in the sandbox. But that would be cheating, and I know you wouldn't do that
    PPS - This whole site was inspired by this thread about banned word lists
    They told me I was gullible ... and I believed them.

  2. #2
    SiM
    SiM is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    London
    Posts
    7,787
    Thanks
    300
    Thanked
    633 times in 422 posts
    • SiM's system
      • Motherboard:
      • P5K Premium
      • CPU:
      • Q6600
      • Memory:
      • 8GB PC2-6400 OCZ ReaperX + Platinum
      • Storage:
      • 3 x 320gb HD322HJ single platter in Raid 0
      • Graphics card(s):
      • PNY GTX285
      • PSU:
      • Corsair TX650W
      • Case:
      • Antec 1200
      • Monitor(s):
      • 2407-HC

    Re: My first real Ajax is live... it's fun too

    After cheating, I paste this in and I only get 4 lol
    I think something has gone wrong with scoring
    warning don't click on that link unless you are old

  3. #3
    NOT Banned
    Join Date
    Jan 2007
    Posts
    5,905
    Thanks
    412
    Thanked
    278 times in 253 posts

    Re: My first real Ajax is live... it's fun too

    isn't a flange something to do with aeroplanes?

    nice ajax page stytagm

    recommend you learn some php to go with that ajax

    you can make neat things like server status checkers etc.

    Perhaps you could change it so that when the user clicks a button called lets say "Check" then the function txtEntered is called.

  4. #4
    Flower Child stytagm's Avatar
    Join Date
    Aug 2004
    Location
    London
    Posts
    754
    Thanks
    47
    Thanked
    23 times in 18 posts

    Re: My first real Ajax is live... it's fun too

    Quote Originally Posted by SiM View Post
    After cheating, I paste this in and I only get 4 lol
    I think something has gone wrong with scoring
    Ahh I think I know what's going on there. The scorer is looking for spaces separating the words, and that file only has line breaks. I'll fix it later.

    Quote Originally Posted by moogle View Post
    recommend you learn some php to go with that ajax

    you can make neat things like server status checkers etc.

    Perhaps you could change it so that when the user clicks a button called lets say "Check" then the function txtEntered is called.
    That is so, like, web 1.0

    (Seriously, the server-side's in asp.net, and ajax is all about not having buttons causing post-backs)
    They told me I was gullible ... and I believed them.

  5. #5
    SiM
    SiM is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    London
    Posts
    7,787
    Thanks
    300
    Thanked
    633 times in 422 posts
    • SiM's system
      • Motherboard:
      • P5K Premium
      • CPU:
      • Q6600
      • Memory:
      • 8GB PC2-6400 OCZ ReaperX + Platinum
      • Storage:
      • 3 x 320gb HD322HJ single platter in Raid 0
      • Graphics card(s):
      • PNY GTX285
      • PSU:
      • Corsair TX650W
      • Case:
      • Antec 1200
      • Monitor(s):
      • 2407-HC

    Re: My first real Ajax is live... it's fun too

    Quote Originally Posted by stytagm View Post
    Ahh I think I know what's going on there. The scorer is looking for spaces separating the words, and that file only has line breaks. I'll fix it later.[/SIZE]
    I added spaces all the way down the list (don't worry I didn't do it manually lol)
    I think something else is wrong...

  6. #6
    Flower Child stytagm's Avatar
    Join Date
    Aug 2004
    Location
    London
    Posts
    754
    Thanks
    47
    Thanked
    23 times in 18 posts

    Re: My first real Ajax is live... it's fun too

    Interesting. If I do that I get 19.82 (or something). If I don't bother with the spaces I get about 60 (that's the magic cheat, if there are no spaces, the scorer thinks there's only one word, but lots of swearwords, and your swearing to words ratio goes way up. It's a bit thick like that).

    <debugging mode>Could you try pasting it in again, and then typing something? It all hinges on "onkeypress" events on the textbox. Also what browser are you using?</debugging mode>
    They told me I was gullible ... and I believed them.

  7. #7
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: My first real Ajax is live... it's fun too

    Quote Originally Posted by moogle View Post
    recommend you learn some php to go with that ajax
    Teehee! its all about the MVC and rails stuff now!
    throw new ArgumentException (String, String, Exception)

  8. #8
    SiM
    SiM is offline
    Senior Member
    Join Date
    Apr 2006
    Location
    London
    Posts
    7,787
    Thanks
    300
    Thanked
    633 times in 422 posts
    • SiM's system
      • Motherboard:
      • P5K Premium
      • CPU:
      • Q6600
      • Memory:
      • 8GB PC2-6400 OCZ ReaperX + Platinum
      • Storage:
      • 3 x 320gb HD322HJ single platter in Raid 0
      • Graphics card(s):
      • PNY GTX285
      • PSU:
      • Corsair TX650W
      • Case:
      • Antec 1200
      • Monitor(s):
      • 2407-HC

    Re: My first real Ajax is live... it's fun too

    Quote Originally Posted by stytagm View Post
    Interesting. If I do that I get 19.82 (or something). If I don't bother with the spaces I get about 60 (that's the magic cheat, if there are no spaces, the scorer thinks there's only one word, but lots of swearwords, and your swearing to words ratio goes way up. It's a bit thick like that).

    <debugging mode>Could you try pasting it in again, and then typing something? It all hinges on "onkeypress" events on the textbox. Also what browser are you using?</debugging mode>
    Actually now it works... I must have done something dodgy last night...

  9. Received thanks from:

    stytagm (17-03-2008)

  10. #9
    Flower Child stytagm's Avatar
    Join Date
    Aug 2004
    Location
    London
    Posts
    754
    Thanks
    47
    Thanked
    23 times in 18 posts

    Re: My first real Ajax is live... it's fun too

    Quote Originally Posted by TheAnimus View Post
    Teehee! its all about the MVC and rails stuff now!
    I need to look into MVC at some point. In the meantime I went to the London .Net user group last week, and we had a mind expanding (I got a headache) 1.5 hour introduction to functional programming. That stuff is cool, but the first time you see it it's a big conceptual jump from the friendly OO world I'm used to.

    But anyway, when I was writing this swear word stuff, it did occur to me that all these word filtering and highlighting routines spend a lot of time iterating over collections of words, and are calling out to be done in a functional / recursive way. As I understand it, an optimising compiler or runtime could then (in theory) spawn threads to do this work in parallel. Whoosh! (technical term)
    They told me I was gullible ... and I believed them.

  11. #10
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: My first real Ajax is live... it's fun too

    indeed, i've been baning on about this since last year when i really started to play with F#, its very friendly for parralisation.

    monoRail project is quite nifty.

    Also check out PLinq, same friendly linq interface, but with simple to understand parralisation options.
    throw new ArgumentException (String, String, Exception)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 24-02-2008, 01:03 PM
  2. Xbox LIVE giving out too much personal info?
    By Nick in forum HEXUS News
    Replies: 25
    Last Post: 08-05-2006, 09:27 PM
  3. Two new Live Arcade games announced!
    By Deadlight in forum Gaming
    Replies: 5
    Last Post: 07-12-2005, 01:08 PM
  4. Replies: 25
    Last Post: 06-12-2005, 10:35 AM
  5. Live audio streaming..
    By Ivor Life in forum Software
    Replies: 3
    Last Post: 15-04-2004, 01:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •