I need an advice for web developpment [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I want to code a website, showing 7 elements: one image (that will be changing), and 6 buttons (left, right, up, down, backwards, forwards), as shown in this example
The website should be able to "read" a 6 column file, which will have the following format example
with:
"ind_img_x" being the index for image x (numeric index)
"url_img_x" being the string containing the web address for image x
The file will control which image will appear accordingly with the button that is pressed.
For example: if the image displayed is "img_2", and the user press the "down" button, then the website will show the image 77452, and wait for the next button to be pressed.
The file will be rather big, able to contain several million lines (for example 10 million lines).
I should be able to update the file from time to time.
The web site will have to be able to get each image from the web (by means of the url in the file) The url data may consists of strings of large length. And the website has to be able to read these long strings and urls.
Would somebody please give me some advice about the best web developing language to use?
Do you think I'll be able to drop the file into the server as a text file, and ask the web site to read it each time, or will I have to put the data in a database?
I look forward to any advice that you guys may have,
Thank you!

Simplest way would be to use a webhosting service and parse the file with JavaScript. Especially because you said you already have JavaScript knowledge.
I would also suggest you to use CSV files: https://en.wikipedia.org/wiki/Comma-separated_values
Edit: When you have millions of lines you should use a database and use Nodejs libraries to connect to the database. Files are only recommended for small sets of data.

Related

the code of some page is cut when using curl or display the source code of the page [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I explain my problem to you:
When I do PHP curls on some site or want to display the source code of the page element is missing a lot. I think some part is called by a script or something. Could someone help me view the entire code with Curl PHP.
To duplicate my problem go to Facebook or LinkedIn and right click on the page and "View the source code of the page", in this you don't see all the page content but when for example you right click and "inspect an element" You can.
Thank you in advance
CURL can't do this. It's not designed to render HTML or execute JavaScript.
A lot of the content on Facebook, LinkedIn, Twitter and many other pages is loaded through different ways. (like fetch()-requests or WebSocket-Events)
Some nodes you can see in the inspector are not part of the original document (which you are viewing with "view source" or curl downloads). What you see on the inspector is everything currently held in memory, which was partially (or completely) created with a scripting language.
This is basically done to
reduce the load on servers as it doesn't have to generate the whole page on every request
reduce traffic on clients and servers (no need to reload the header-data and/or scripts over and over again)
If you need data from a rendered site, you should either check if the website provides an API which gives you the data you are looking for or use one of the cli-rendering-engines from this answer.

Simple Questions/Answer Games [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Thank you for taking the time reading this!
A quick disclaimer, I have never coded anything in my life!
I know some basics terms so you can communicate your response without defining them.
Anyways, my project is a simple game.
You press [START]
You hear a "random" word
You have a type-in box,
if you fill it right you get +5 points and get a random word .... and so on.
You fill it wrong, you lose immediately [gameover]
Although, I would deeply appreciate to code the whole game, for some of you it is relatively simple - I wish to do it myself for the learning experience and sense of accomplishment!
For now, I only need a push in the right direction.
I aim to use it on my tablet or phone (both run android)
Best,
haz
You should start by learning the fundamentals of JavaScript and HTML (should also learn CSS if you want the app to look nice). There are many sites (other than SO) that have multiple tutorials and/or full documentation (i.e. MDN, W3Schools). You could also use online teaching platforms for that.
Here are a couple of things you should consider after getting a grasp of the basic concepts:
When do you want to check if the user inserted the right input (timer, on enter, a submit button)?
Where will the sounds be stored and how will you retrieve them (a collection of sounds of files, a database with a server, a single big sound file containing all of the words)?
Regardless of how you store the sounds you will need a way to map text to the sound and the random number (Math.random()) to one of the two.
Finally create a JavaScript function that resets the text and gets a new word every time the user gets the word right or when the initial start button is clicked.
Once you reach any questions on the actual coding, search for the problem in SO (odds are it has been asked before). If you can't find an answer to your question create a new question (you should read How to ask first).

AJAX Microgames [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
If you're not familiar with the concept of a Microgame, check out this video of WarioWare Twisted.
I'm interested in setting up a site where users can play series of browser-based Microgames which are delivered to them by a server. Ideally this would allow me to crowdsource the games and have an open submission system. What sort of scheme could I use to make this work?
I'm thinking that one way to do it would be to have each game consist of:
A javascript file that defines a MicroGame object that controls a rectangular portion of the screen, gets input and timing information from the main page, then calls back to the main page with a "Success" or "Failure" message.
A folder of assets that must be downloaded before the game executes.
Is this possible to do, client-side within a browser? Where would be a good place to start figuring this out?
There are a lot of open issues here. The biggest problem is what language do they submit games in which you can execute safely on the players machines? That said, there are tools like this out there. You could look at the excellent Play My Code for inspiration.

creating Page turner effect for PDF files with angular JS [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is there a way to create page turner effect for PDF files with angular? Jquery solutions are also fine. I have seen turn.js which uses html. Can any one help out to find a way for PDF files?
If you are talking about the pages within a PDF having a page curl effect then it is not something you can do with js, html or anything else outside the PDF itself without converting the PDF to something else (ie flash, jpg images, etc).
Last time I checked the only way to achieve this within a PDF was by using Acrobat Pro or InDesign and using 'Page Transitions'.
Please note that out of the available page transitions 'Page Turn' (the curl effect you want) will cause the document to be converted to a flash file and then embedded in the PDF.
I'm sorry if this is not what you want to hear. Rather than creating fancy page curl/turn effects it is probably better to concentrate on producing a well designed, easy to navigate document with great content. This will provide much better value.

How to embed a NOT Downloable PDF in your website? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to embed a PDF in my PHP based website. The Content in my PDF is unique and written by me and i want my web site viewers to view and read content but i dont want them download those pdf file.
Can can one help me out???
If that's your goal, you cannot include the PDF data in the web page. In order for the browser to display the PDF, it has to be able to download it; at that point, all bets are off.
To do what you describe, you'd have to render the output in some form that isn't readily reused, such as an image, or by embedding a Flash or Java applet and having it render the text graphically. But doing that means the content can't readily be indexed by search engines.* And of course, anyone sufficiently-motivated can apply optical character recognition to get the text.
(* Search engines are really smart these days, but I don't think they regularly apply OCR to images in hopes of finding index-able text there.)

Categories