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
PMDAMYSQL(1)						       Performance Co-Pilot						      PMDAMYSQL(1)

NAME
pmdamysql - MySQL database PMDA DESCRIPTION
pmdamysql is a Performance Co-Pilot PMDA which extracts live performance data from a running MySQL database. INSTALLATION
pmdamysql uses a configuration file from (in this order): o /etc/pcpdbi.conf o $PCP_PMDAS_DIR/mysql/mysql.conf This file can contain overridden values (Perl code) for the settings listed at the start of pmdamysql.pl, namely: o database name (see DBI(3) for details) o database user name o database pass word Once this is setup, you can access the names and values for the mysql performance metrics by doing the following as root: # cd $PCP_PMDAS_DIR/mysql # ./Install If you want to undo the installation, do the following as root: # cd $PCP_PMDAS_DIR/mysql # ./Remove pmdamysql is launched by pmcd(1) and should never be executed directly. The Install and Remove scripts notify pmcd(1) when the agent is installed or removed. Binary Status values in text Some of the status values are in the form of YES/NO or ON/OFF. Since these cannot be intepreted by tools like PMIE, they have been duplicated with a _num extension and the values of 1 (YES/ON) or 0 (NO/OFF). Eg: o mysql.slave_status.slave_io_running o mysql.slave_status.slave_io_running_num FILES
/etc/pcpdbi.conf configuration file for all PCP database monitors $PCP_PMDAS_DIR/mysql/mysql.conf configuration file for pmdamysql $PCP_PMDAS_DIR/mysql/Install installation script for the pmdamysql agent $PCP_PMDAS_DIR/mysql/Remove undo installation script for the pmdamysql agent $PCP_LOG_DIR/pmcd/mysql.log default log file for error messages from pmdamysql SEE ALSO
pmcd(1), pmdadbping.pl(1) and DBI(3). # vi: sw=4 ts=4 et: 3.8.10 Performance Co-Pilot PMDAMYSQL(1)
All times are GMT -4. The time now is 03:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy