Sponsored Content
The Lounge What is on Your Mind? Debugging Our Computer Science Trivia Feature Post 303040611 by Neo on Friday 1st of November 2019 11:12:36 PM
Old 11-02-2019
Looking at the log files and inside the DB this morning, I have added some additional string filtering for questions, for example:

Code:
<?php
$question =  filter_var($question, FILTER_SANITIZE_STRING,FILTER_FLAG_STRIP_HIGH);

because I was seeing some unprintable chars in the JSON response to the AJAX request, so hopefully, stripping out these symbols will help.

Status Update:



Total Interactions in DB (questions answered so far):

Code:
mysql> select count(*) from neo_trivia_scoreboard;
+----------+
| count(*) |
+----------+
|     3540 |
+----------+
1 row in set (0.00 sec)

Total question in DB:

Code:
mysql> select count(*) from neo_open_trivia;
+----------+
| count(*) |
+----------+
|      629 |
+----------+
1 row in set (0.00 sec)

If anyone sees any "strangeness" please take a screen shot and post it, and if possible please look into your web dev console and post any the XHR response to the API query and any JS errors in the JS console (if you know how to do it, if not just post the screen shots). I hope filtering the string will solve this tiny, occasional bug.

Top 20 interactions by country:


Code:
mysql> select country, count(country) from neo_trivia_scoreboard  group by country order by count(country) desc limit 20;
+---------+----------------+
| country | count(country) |
+---------+----------------+
| US      |            874 |
| IN      |            418 |
| TH      |            411 |  <---- my testing
| GB      |            185 |
| DE      |            131 |
| NL      |            115 |
| IT      |            111 |
| PH      |            109 |
| BR      |            105 |
| FR      |             93 |
| AU      |             82 |
| BG      |             81 |
| CA      |             79 |
| RU      |             73 |
| ES      |             60 |
| PL      |             58 |
| SE      |             48 |
| XX      |             47 |
| CH      |             44 |
| MX      |             33 |
+---------+----------------+
20 rows in set (0.00 sec)

 

7 More Discussions You Might Find Interesting

1. What is on Your Mind?

Computer Science and Information Technology

Hi, I haven't posted on the forums for a while now, I tried to find the most appropriate section for this post, but if this is in the wrong section please forgive me. First, let me say I'm a sophomore in HS. I know that job wise I definitely want to do something in computers. A while ago I was... (5 Replies)
Discussion started by: hpicracing
5 Replies

2. Programming

Is Web Development is a part of computer science ?

I am now a student in university in 2nd year. I am studying computer science. But I am not sure what type of jobs computer science provide. I know some of them are software programming or network management. Recently, I hear some about Web Development. I wonder if it is a part of computer science.... (1 Reply)
Discussion started by: Anna Hussie
1 Replies

3. Web Development

Is Web Development is a part of computer science ?

I am now a student in university in 2nd year. I am studying computer science. But I am not sure what type of jobs computer science provide. I know some of them are software programming or network management. Recently, I hear some about Web Development. I wonder if it is a part of computer... (3 Replies)
Discussion started by: Anna Hussie
3 Replies

4. What is on Your Mind?

Forum Trivial Pursuit - New Computer Science and Mathematics Trivia for UNIX.com

I have added a new experimental "Computer Science and Mathematics Trivia - True or False" section in the discussions, currently under the tags box. In the future, I plan to Expand this feature to add more trivia categories from math, science and technology. Keep track of correct and... (20 Replies)
Discussion started by: Neo
20 Replies

5. What is on Your Mind?

1000+ Computer Science Trivia Questions at UNIX.COM

The UNIX and Linux Forums now has over 1000 TRUE / FALSE computer science and computer related trivia question in our database. These questions are of relatively high quality (compared to similar sites on the web) and are fun (according to feedback by users). In the first week during the... (1 Reply)
Discussion started by: Neo
1 Replies

6. What is on Your Mind?

New Member and Country Computer Trivia Leaderboards

Thanks to Akshay, who helped me write the core MySQL queries, we now have two new draft leaderboards, by (1) member and by (2) country: https://www.unix.com/trivia_stats.php Currently milhan leads the members with a high score of 90%: ... (3 Replies)
Discussion started by: Neo
3 Replies

7. What is on Your Mind?

Computer Trivia Feature Tops 50,000 Questions Answered

Just noticed that our successful computer trivia feature (stats here) has surpassed over 50,000 questions answered by users: https://www.unix.com/trivia_stats.php This was a coding effort worth while and I'm pleased to see so many people enjoying it in such a short time since it was released... (3 Replies)
Discussion started by: Neo
3 Replies
RECEIVE(1)						      General Commands Manual							RECEIVE(1)

NAME
receive - receive files from the sendfile spool SYNOPSIS
receive [ -d ] [ -r ] [ -k ] [ -P ] [ -S ] [ -Z spool ] [ -q ] [ -ffrom ] file [...] receive -n [ -d ] [ -r ] [ -k ] [ -P ] [ -S ] [ -Z spool ] [ -q ] file-number [...] receive [ -s ] [ -l ] [ -L ] [ -R ] [ -ffrom ] receive -b user[@host] [ -k ] [ -f"from" ] file [...] receive -b user[@host] [ -k ] [ -f"from" ] -n file-number [...] receive -b user[@host] [ -k ] -a DESCRIPTION
receive files from the sendfile spool which has been sent to you. If there is already a file with the same name you will be prompted for overwriting or renaming. Allowed wildcards in file names are: * ? [abc] [^abc] CAUTION: you have to put wildcards and other special characters in '' quotes to hide them for interpretation by your shell. OPTIONS
-n receive file number(s) -d delete instead of receive -a receive (or delete or bounce) all files -r rename before receiving -k keep files in spool after receiving -P pipe files to stdout -S receive only pgp-signed files -s list files in short format -l list files -L list files and look inside archives, too -R renumber files in spool -b bounce (forward) files to another recipient -q quiet mode: no questions asked -fuser all actions refer only to files from this user -Z spool specify an alternate spool directory EXAMPLES
receive -L list all files in long format. receive 'blubb*' receive all files starting with string "blubb". receive -daf microsoft.com delete all files from microsoft.com sites. receive -b framstag@bofh '*.jpg' bounce all *.jpg-files to framstag@bofh. FILES
/var/spool/sendfile The sendfile spool directory. /var/spool/sendfile/$USER/log A log of the last transfers. /etc/sendfile.deny Users which are not allowed to receive files or messages (set by root). SEE ALSO
sendfile(1). AUTHOR
Ulli Horlacher - framstag@rus.uni-stuttgart.de 3rd Berkeley Distribution RECEIVE(1)
All times are GMT -4. The time now is 07:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy