Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6242679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:59:56+00:00 2026-05-24T11:59:56+00:00

I am writing puzzle bot, http server which upon hitting , renders a default

  • 0

I am writing puzzle bot, http server which upon hitting , renders a default page with text area to write code similar to http://codepad.org/. When I type in following program.

#include <stdio.h>
int main( int argc, char **argv) {
    return 0;
}

I get following response from HTTP POST.

code : %23include+%3Cstdio.h%3E%0D%0Aint+main%28+int+argc%2C+char+**argv%29+%7B%0D%0A++++return+0%3B%0D%0A%7D
lang : C

How Do I parse the information from the key code. I need to write this program in a temporary file and then compile/run.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:59:57+00:00Added an answer on May 24, 2026 at 11:59 am

    You need to decode the data, first. You could use this reference .

    All spaces are replaces with the sign +, and all numbers after % are special – 2 digit hex encoded numbers – URL encoded special symbols (like +, ,, }, etc.).

    For example, you code will be translated to :

    #include <stdio.h>\r\nint main( int argc, char **argv) {\r\n    return 0;\r\n}
    

    Where \r\n are CRLF, So, from this, you’ll finally get:

    #include <stdio.h>
    int main( int argc, char **argv) {
        return 0;
    }
    

    which is exactly your code. Then you could write it to your temp file and try to compile it.


    Some things, that come to my mind for better application like this:

    • make it multithreading – you’ll be able to handle more than one such request at the same time
    • add some queues for the received data – don’t lose the data that comes, while your program is processing the current request (kinda queue)
    • of course, synchronize the threads and be careful with that
    • I think you’re going to need IPC (Inter-Process Communication) – to communicate with your compiler’s process and extract the errors, it gives you (unless you have some special API, provided for your compiler)

    Of course, these are just some advice, that come to my mind. That would be great exercise for any developer – IPC + multithreading + network programming + http! Great 🙂

    Good luck

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an online game which allows a user to progress from one puzzle
Writing an HTTP simple server on top of Net node.js module, not using HTTP
I'm writing an algorithm in PHP to solve a given Sudoku puzzle. I've set
Writing the code for the user authentication portion of a web site (including account
Writing a JSP page, what exactly does the <c:out> do? I've noticed that the
Writing documentation in html requires some code examples. What to do with characters that
I'm writing a program in F# at the moment, which I specified in the
Hi i came across this puzzle which is a subset of famous kind of
In the program I am writing, I have something similar to the code here:
I'm writing a puzzle game to learn developing Android Apps. But now I'm stuck

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.