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
DANSGUARDIAN(8) 						   dansguardian 						   DANSGUARDIAN(8)

NAME
DansGuardian2 - web content filter SYNOPSIS
dansguardian [ -c config-file ] [ -v ] [ -h ] [ -N ] [ -q ] [ -Q ] [ -s ] [ -r ] [ -g ] SUMMARY
DansGuardian is a web content filtering proxy(1) for Linux, NetBSD, FreeBSD, OpenBSD, and Solaris that uses Squid(2) to do all the fetch- ing. It filters using multiple methods. These methods include URL and domain filtering, content phrase filtering, PICS filtering, MIME type fil- tering, file extension filtering, POST limiting and content (AV) scanning. The content phrase filtering will check for pages that contain profanities and phrases often associated with pornography and other undesir- able content. The POST filtering allows you to block or limit web uploads. The URL and domain filtering is able to handle huge lists and is significantly faster than squidGuard. Content scanning enables downloaded content to be passed through ClamD, KAVD, any local program with machine-parseable console output, and any other AV scanner available as an ICAP server. The filtering has configurable domain, user and source IP exception lists. SSL tunneling is supported; however, due to the encrypted nature of HTTPS requests, filtering is only supported on destination domain. The configurable logging produces a log in an easy to read format which has the option to only log the text-based pages, thus significantly reducing redundant information such as every image on a page. DansGuardian is under continuous development and so it is best to visit the web site for the latest information. (1) Technically DansGuardian is more of a filtering pass-through than a true proxy - but don't let that worry you! (2) DansGuardian should work with any proxy, not just Squid. For example, it is known to work with Oops. DOCUMENTATION
For all further information including copyright, support, FAQ, docs, mailing list - please go to: http://dansguardian.org/ Mirror: http://dansguardian.intmain.com/ Available documentation can be found at http://www.dansguardian.org/?page=documentation The DansGuardian FAQ is at http://www.dansguardian.org/?page=faq Some useful HOWTOs that cover specific implimentations of DansGuardian and caching/filtering in general can be found at http://www.dansguardian.org/?page=howto Information about Debian specific changes and configuration can be found in /usr/share/doc/dansguardian/changelog.Debian.gz . OPTIONS
-c config-file Use the given config-file. -v gives the version number and build options. -h Output a short summary of available command line options. -N Do not go into the background. -q causes DansGuardian to kill any running copy. -Q kill any running copy AND start a new one with current options. -s shows the parent process PID and exits. -r closes all connections and reloads config files by issuing a HUP, but this does not reset the maxchildren option (amongst others). -g gently restarts by not closing all current connections; only reloads filter group config files. (Issues a USR1) COPYRIGHT
DansGuardian is copyright Daniel Barron 2001. daniel@jadeb.com Daniel Barron Oct 2008 DANSGUARDIAN(8)
All times are GMT -4. The time now is 06:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy