dlresende / extreme-carpaccio Goto Github PK
View Code? Open in Web Editor NEWSlicing and coding game
Home Page: http://diegolemos.net/2016/01/07/extreme-carpaccio/
License: BSD 3-Clause "New" or "Revised" License
Slicing and coding game
Home Page: http://diegolemos.net/2016/01/07/extreme-carpaccio/
License: BSD 3-Clause "New" or "Revised" License
Today, new sellers (participants) are able to register themselves at any point of the game. Sometimes this is not desirable, because a seller with an important negative balance can simply create a new account and start from 0.
This story is about making the registration configurable, so that the facilitator can turn it off once all teams are registered and ready to play.
As is, when the url is not well formed (like http://localhost:port/path) the server clashes.
In order to encourage participants to test, it'd be great that the server starts sending bad requests. In order to not be charged with penalties, the participant should respond with the http code 400 to server. It'd be great if this feature could be activated on the fly with some frequency, like, for each 10 requests one request is wrong.
Hi diego, I would like to add python client server, can you add me as a contributor ?
Today the problem is very static and sometimes people tend to implement it "from one shot". Furthermore, this approach and the /feedback resources don't push participants to test.
After many feedbacks and discussions with others running Extreme Carpaccio, we're willing to add new taxes rules on the fly to push the problem nature from static (at the beginning) to dynamic (during the game).
To do so, at some point we'd like to change the taxes strategy leaving the fixed numbers back and start using rules for each country, like : if(total < 100) return sum * 1.2; else return sum * 1.2 + 10;
Today participants can potentially change server parameters through rest calls. We'd like to move server's configuration to a json file so that only facilitators can change server behavior.
I use jasmine-node specs/
to launch tests
Hello guys, I tried to run the server but got this error :
> [email protected] start
> node bin/www
/private/tmp/extreme-carpaccio/server/javascripts/repositories.js:4
var chalk = require('chalk')
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /private/tmp/extreme-carpaccio/server/node_modules/chalk/source/index.js from /private/tmp/extreme-carpaccio/server/javascripts/repositories.js not supported.
Instead change the require of index.js in /private/tmp/extreme-carpaccio/server/javascripts/repositories.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/private/tmp/extreme-carpaccio/server/javascripts/repositories.js:4:13) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v21.7.1
I tried with the following conditions :
It seems that the culprit is the bump of Chalk 4.1.2 -> Chalk 5.3.0
, when I checkout on commit 5859d8f80586cdde32f294e9cdf14ae9266a8470, it works.
Have a nice day. :)
It's common that people make mistake when they register, so I get 'zombie' teams and the scores are less readable.
When I facilitated the game for a large number of teams, it was annoying. For ~20 teams I got 3 or 4 'zombie' teams created by mistake with huge negative scores in the end of the game.
It would be handy to remove these teams or hide them.
Only the facilitator should be able to do that. So I would suggest a hidden HTTP REST endpoint, or a hidden button on the web interface displayed only for localhost.
Hi,
In some context, 'value generation' is not a big enough incentive for teams to change their behaviors! For example:
These work environments are far from ideal, but unfortunately, they are still very common. In order to try something new, I thought we could tweak the extreme carpaccio to estimate the stress level of the different seller teams. This way we would see that the way they work has a direct impact on their working conditions. I thought about estimating stress by summing 3 factors:
I would need to add a new graph for stress levels on the main screen. At the end of the sessions, seller teams could compare and discuss their stress graph and the way they worked.
Here are my questions:
Thanks a lot for this project.
Today, if a participant do not respond the server nothing happen. It'd be great if a responde became mandatory in order to not be charged with penalties. To do so, if the participant is not able to handle the request, he has to respond 404.
It would be nice to be able to detect when then server closes and then store current sellers with their scores in a file
Works fine in Chrome, but empty screen in Safari.
In order to motivate seller to connect him to the server a countdown could be implement before the first request.
If a seller register him to the server before the end he will be credit of 15000 euros for example.
All the clients should:
{"type": "ERROR","content": "The field \"total\" in the response is missing."}
and parse the same message leaving an JSON parsing example for participantsI would like the game state to be persisted when the game server stops.
Use-cases:
Every game iteration, the game state is saved into a LevelDB local database. On server startup, the game state is rebuilt from the state stored in LevelDB.
I have a pull request almost ready to submit.
WDYT?
Sometimes when I run npm test
on the server, I get the following failure:
1) BadRequest should randomly corrupt order
Message:
Expected { prices : [ 64.73, 29.48, 73.49, 58.88, 46.61, 65.4, 16.23 ], quantities : [ 3, 10, 6, 5, 9, 5 ], country : 'FR', reduction : 'STANDARD' } not to equal { prices : [ 64.73, 29.48, 73.49, 58.88, 46.61, 65.4, 16.23 ], quantities : [ 3, 10, 6, 5, 9, 5 ], country : 'FR', reduction : 'STANDARD' }.
Stacktrace:
Error: Expected { prices : [ 64.73, 29.48, 73.49, 58.88, 46.61, 65.4, 16.23 ], quantities : [ 3, 10, 6, 5, 9, 5 ], country : 'FR', reduction : 'STANDARD' } not to equal { prices : [ 64.73, 29.48, 73.49, 58.88, 46.61, 65.4, 16.23 ], quantities : [ 3, 10, 6, 5, 9, 5 ], country : 'FR', reduction : 'STANDARD' }.
Most often the test passes. But sometimes it fails randomly.
Run the following script to be pretty sure to see the problem:
#!/usr/bin/env bash
set -e
for i in $(seq 1 100); do
npm test
done
Tested on:
The test expects the random-generated order corruption to be different than the previous corrupted order. There is a non-null probability that the random order generator builds an identical corrupted order.
Maybe we could set the random generator seed, or mock the random. Which one do you prefer?
I'll try to make a PR.
Hi,
Where can I configure the reduction table? What are the standard options? Can I set it up?
A hug,
Jackson
I'm trying to start extreme-carpaccio server in Windows 11.
C:\Users\nicolas-delsaux\Documents\open-source\extreme-carpaccio\server>npm install
> [email protected] postinstall
> node_modules/.bin/bower install
'node_modules' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
npm ERR! code 1
npm ERR! path C:\Users\nicolas-delsaux\Documents\open-source\extreme-carpaccio\server
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node_modules/.bin/bower install
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\nicolas-delsaux\AppData\Local\npm-cache\_logs\2022-01-06T13_12_18_644Z-debug.log
NOTICE in the command trying to be run, the path has forward slashes, which are not compatible with Windows path ... I guess it's a bower bug
Server does not start when running npm run start
(npm version: 6.4.1
). Error:
internal/validators.js:113
throw err;
^
TypeError [ERR_INVALID_ARG_TYPE]: The "interval" argument must be of type number. Received type object
at StatWatcher.start (internal/fs/watchers.js:76:3)
at Object.watchFile (fs.js:1322:10)
at Configuration.watch (/home/CODE/extreme-carpaccio/server/javascripts/config.js:65:16)
at Object.<anonymous> (/home/CODE/extreme-carpaccio/server/app.js:26:15)
at Module._compile (internal/modules/cjs/loader.js:723:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Module.require (internal/modules/cjs/loader.js:659:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
It is caused by configuration.watch();
line in app.js
not passing any parameters. Due to that callback, watchOnce, interval
are undefined
and the error this thrown.
I've checked if this worked on earlier versions of npm and found out that it works in version 2.15.11
despite those parameters being undefined.
I'll create a merge request resolving this issue, but the way I do it might not be the best.
Edit:
I verified it on another machine as well - the same thing happens
In some extremely rare cases when the machine running the server automatically changes the Wi-Fi connection, the server crashes with the following error:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/7.10.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 silly lifecycle [email protected]~prestart: no script for prestart, continuing
7 info lifecycle [email protected]~start: [email protected]
8 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/diego/Projects/github.com/dlresende/extreme-carpaccio/server/node_modules/.bin:/Users/diego/go/bin:/Users/diego/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/diego/go/bin:/Users/diego/bin:/Users/diego/.fzf/bin
10 verbose lifecycle [email protected]~start: CWD: /Users/diego/Projects/github.com/dlresende/extreme-carpaccio/server
11 silly lifecycle [email protected]~start: Args: [ '-c', 'node bin/www' ]
12 silly lifecycle [email protected]~start: Returned: code: 1 signal: null
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] start: `node bin/www`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:194:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:194:7)
14 verbose stack at maybeClose (internal/child_process.js:899:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd /Users/diego/Projects/github.com/dlresende/extreme-carpaccio/server
17 error Darwin 16.4.0
18 error argv "/usr/local/Cellar/node/7.10.0/bin/node" "/usr/local/bin/npm" "start"
19 error node v7.10.0
20 error npm v4.2.0
21 error code ELIFECYCLE
22 error errno 1
23 error [email protected] start: `node bin/www`
23 error Exit status 1
24 error Failed at the [email protected] start script 'node bin/www'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the extreme-carpaccio-server package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error node bin/www
24 error You can get information on how to open an issue for this project with:
24 error npm bugs extreme-carpaccio-server
24 error Or if that isn't available, you can get their info via:
24 error npm owner ls extreme-carpaccio-server
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]
As is: 890890.08
To be: 890 890.08
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.