Sponsored Content
The Lounge What is on Your Mind? Debugging Our Computer Science Trivia Feature Post 303040596 by Neo on Friday 1st of November 2019 10:07:19 AM
Old 11-01-2019
On a specific question note (318) ....

Code:
mysql> select * from neo_open_trivia where id = 318;
+-----+----------+---------+------------+--------------------------+----------------+-------------------+-----------+----------------+------------------+------------------+----------------+--------------------+
| id  | category | type    | difficulty | question                 | correct_answer | incorrect_answers | validated | time_validated | userid_validated | userid_submitted | time_submitted | time_last_modified |
+-----+----------+---------+------------+--------------------------+----------------+-------------------+-----------+----------------+------------------+------------------+----------------+--------------------+
| 318 |       18 | boolean | easy       | MacOS is based on Linux. | False          | True              |         0 |     1572497150 |                0 |                1 |     1572151119 |         1572151119 |
+-----+----------+---------+------------+--------------------------+----------------+-------------------+-----------+----------------+------------------+------------------+----------------+--------------------+
1 row in set (0.00 sec)

A user got a wrong answer and it was not recorded (submitted) to the DB (this error was due to a bug in the browser, not in the DB):

Code:
mysql> select uid,results from neo_trivia_scoreboard where trivia_id = 318;
+-----+---------+
| uid | results |
+-----+---------+
|   0 | right   |
|   0 | right   |
|   0 | right   |
|   0 | right   |
|   0 | right   |
|   0 | right   |
|   0 | right   |
|   0 | right   |
+-----+---------+
8 rows in set (0.00 sec)

So, I am pretty sure there is still a small bug somewhere which is causing some rare errors, so I am logging every request at this time, debugging.

Javascript must be enabled in order to work properly. If your browser is blocking JS, you will get wrong answers (errors) because the app needs JS to work properly and I have not written any code yet to check for JS, etc, and block users from trivia who have JS disabled or their browser is blocking JS.
 

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
Plack::Session::Store::File(3pm)			User Contributed Perl Documentation			  Plack::Session::Store::File(3pm)

NAME
Plack::Session::Store::File - Basic file-based session store SYNOPSIS
use Plack::Builder; use Plack::Middleware::Session; use Plack::Session::Store::File; my $app = sub { return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello Foo' ] ]; }; builder { enable 'Session', store => Plack::Session::Store::File->new( dir => '/path/to/sessions' ); $app; }; # with custom serializer/deserializer builder { enable 'Session', store => Plack::Session::Store::File->new( dir => '/path/to/sessions', # YAML takes it's args the opposite order serializer => sub { YAML::DumpFile( reverse @_ ) }, deserializer => sub { YAML::LoadFile( @_ ) }, ); $app; }; DESCRIPTION
This implements a basic file based storage for session data. By default it will use Storable to serialize and deserialize the data, but this can be configured easily. This is a subclass of Plack::Session::Store and implements its full interface. METHODS
new ( %params ) The %params can include dir, serializer and deserializer options. It will check to be sure that the dir is writable for you. dir This is the directory to store the session data files in, if nothing is provided then "/tmp" is used. serializer This is a CODE reference that implements the serialization logic. The CODE ref gets two arguments, the $value, which is a HASH reference to be serialized, and the $file_path to save it to. It is not expected to return anything. deserializer This is a CODE reference that implements the deserialization logic. The CODE ref gets one argument, the $file_path to load the data from. It is expected to return a HASH reference. BUGS
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT. AUTHOR
Stevan Little <stevan.little@iinteractive.com> COPYRIGHT AND LICENSE
Copyright 2009, 2010 Infinity Interactive, Inc. <http://www.iinteractive.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.4 2011-07-27 Plack::Session::Store::File(3pm)
All times are GMT -4. The time now is 09:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy