Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3rd requirement is unclear #4

Open
ZhKas opened this issue Apr 15, 2020 · 19 comments
Open

3rd requirement is unclear #4

ZhKas opened this issue Apr 15, 2020 · 19 comments

Comments

@ZhKas
Copy link

ZhKas commented Apr 15, 2020

I didn't fully understand the requirement "3. Distribute requests between variants".
So, I don't have to show different pages to a single user every time(as it's said "when a client makes a request to the Workers script, the script should roughly return each variant"), so I don't have to use cookies for this. Is seems like it's enough just to remember user and count each of 2 urls, or I could use round-robin method, 'cause each of these will give 50% probability. I know that using cookies is extra-credit task "2. Persisting variants
", but I'd like to do both ways :)

@kungpaogao
Copy link

I didn't really understand it either tbh, but I'm assuming that if you're using a random function between two numbers, it should be roughly 50/50.

@nivek
Copy link

nivek commented Apr 17, 2020

Requirement 3 is asking for you to return the variants evenly.
So if I go to your site 1000 times, I should expect to get each variant 500 times.
A good way to do this, like @kungpaogao mentioned, is utilizing a random function.

I suppose you could also do it your way and just keep count of the amount of users that call the script. But that takes up some unnecessary storage space and it's something extra to keep track of.

Cookies is extra credit. But you should still be distributing each variant 50% of the time. The only difference that cookies should make is that if I visit your site again, it'll get the same variant every time. (i.e. if I visit your site, I'll have a 50% chance to get either variant. If I visit again, I only get the variant I got the first time)

@MYANH2020
Copy link

I could not install wrangler on my Mac, anyone could help?
Thanks a lot.

@kungpaogao
Copy link

@MYANH2020 could you provide some more information about what you've tried already? Do you have npm installed?

@MYANH2020
Copy link

MYANH2020 commented Apr 17, 2020 via email

@kungpaogao
Copy link

kungpaogao commented Apr 17, 2020

@MYANH2020 what are the errors?

@nivek
Copy link

nivek commented Apr 17, 2020

I could not install wrangler on my Mac, anyone could help?
Thanks a lot.

Read through issue #3 and see if you're able to install after reading through those comments.
If you're still not able to, create a new issue.

@MYANH2020
Copy link

MYANH2020 commented Apr 17, 2020 via email

@kungpaogao
Copy link

kungpaogao commented Apr 17, 2020

@zllovesuki
Copy link

@MYANH2020 Please try to install nvm (https://github.com/nvm-sh/nvm), and then use nvm to install nodejs. Remember to source the .bashrc after you are done installing (if you are using BASH). This should solve the permissions problems. If that somehow didn’t work, please post the full error log here so we can help you further.

@rishalshah
Copy link

I could not install wrangler on my Mac, anyone could help?
Thanks a lot.

Check out this link: cloudflare/wrangler-legacy#240
Look at the answer from @younggrandpa
It worked for me.

@ssp4all
Copy link

ssp4all commented Apr 18, 2020

I could not install wrangler on my Mac, anyone could help?
Thanks a lot.
@MYANH2020
First check whether you have node installed
node -v
if not then install on mac using Homebrew
brew install node
then use
npm i @cloudflare/wrangler -g to install wrangler
I hope it helps😅

@MYANH2020
Copy link

I could not install wrangler on my Mac, anyone could help?
Thanks a lot.

Check out this link: cloudflare/wrangler#240
Look at the answer from @younggrandpa
It worked for me.
Thanks a lot it worked for me, too.
But how to generate the project? I follow the code " workers $ wrangler generate my-worker" but it does not work.

@SaipranavK
Copy link

SaipranavK commented Apr 18, 2020

But how to generate the project? I follow the code " workers $ wrangler generate my-worker" but it does not work.

Check if wrangler is installed
wrangler
To generate a project
wrangler generate <projectname>

@MYANH2020
Copy link

wrangler generate
error: -bash: syntax error near unexpected token `newline'

@SaipranavK
Copy link

wrangler generate
error: -bash: syntax error near unexpected token `newline'

wrangler generate your-project-name https://github.com/cloudflare-internship-2020/internship-application-fullstack

@MYANH2020
Copy link

wrangler generate
error: -bash: syntax error near unexpected token `newline'

wrangler generate your-project-name https://github.com/cloudflare-internship-2020/internship-application-fullstack

Thanks for help.

@kulxtreme
Copy link

Impossible to install Wrangler on newest Fedora without throwing errors when starting it


/usr/local/lib/node_modules/@cloudflare/wrangler/node_modules/binary-install/src/binary.js:60
      throw `You have not installed ${this.name ? this.name : "this package"}`;
      ^
You have not installed wrangler

@zllovesuki
Copy link

@kulxtreme I recommend you try using nvm to install your nodejs env, then install wrangler again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants