Why in the code i ≃ n?

i=2; while(i<n) {    write('*');    i=i*i; } 

Why $ n ≃ i$ ?

I mean suppose $ n=1000$ and so $ i= 2,4,16,32,256,65536$ is in every steps.

In the book wrote $ 2^2 power(k)$ is pattern for growing $ i$ so $ n ≃ i$ and…

Now 65536 or 256 isn’t equal to 1000 or around 1000.

But why $ n ≃ i$ ?

This chapter is about notations.

OpenID Authentication Method Reference Name for a code sent via email

Introduction:

I am currently implementing acr_values, acr & amr principles on a Open ID Provider server.

The claim amr (described in the OpenID RFC 1.0) has no standard clearly defined in this same RFC, but I would like to base the system on the RFC 8176 mentioned by IANA.

One of the server authentication method is about sending a confirmation code via email.

About the authentication method:

The server uses a cryptographically secure pseudo-random number generator and store a hash of it using argon2. It is sent to an email, then hash are compared on another request. There is a short expiration time for each code. This method is indeed not considered by the server as a secure method to prove an identity, but is still selectable when no access to any resource is required.

The question is:

What Authentication Method Reference Name would you use in this case ?

Most descriptions are quite strict so I only see mca as a possibility today. It is not an otp to me since it is not implementing https://tools.ietf.org/html/rfc4226.

Thanks for sharing.

How to make code examples accessible in a document?

I’m creating a MS Word document (and will probably convert it to PDF later on) for a visually impaired programming student.

I’m following all the guidelines about text semantics, like correctly using headers, paragraph, tables, avoiding blank lines, etc. But I don’t know what to do when it comes to code examples. I’m particularly using Python for this document, so not only there are code snippets but also interpreter examples, including the “>>>” symbols. What’s the best way to add these in my document? Should I enclose these examples in a table containing just one cell, and then adding a title to the table along the lines of “this is a code example:”? Should I add line numbers? Any other markup that I should add?

How to code an algorithm to generate a random but valid train track layout?

I am wondering if I have quantity C of curved tracks and quantity S of straight tracks, how I could write a computer program to design a “random” layout using all of those tracks, such that the following rules are satisfied:

1) The tracks, when all connected, form a closed (continuous) loop for the train to go around.

2) Ramps, bending of tracks, bumping of tracks, crossing of tracks are all not allowed.

So would the computer program have to create a geometric model and remember the exact positions of each track or is there some simpler way to code this? I want to be able to “push a button” and the computer “spits out” a valid “new” layout for me.

Do I need to give the exact measurements of the 2 types of tracks? If so, I can provide those.

I have some coding skills but I need to know an algorithm first before I can code something meaningful (other than just testing a few parts of a candidate algorithm)

Best practice for requiring an “access code” before user can use app

To put things into context, we have an app that lets users earn money by just learning.

Because of this, we have to be quite strict about which users are allowed to sign up as we obviously have limited funds and we only want “authorized” users to be able to use the app.

We’ve created an access code system and previously we’d ask how they heard about the app and then after they select an option we ask them to enter an access code. It looked like this:

enter image description here

The problem we had with this implementation was:

  • Users got confused and would sometimes drop off.
  • Users who didn’t have an access code got confused why they couldn’t access the app and left bad reviews.

So, now we’re redesigning the flow, and our idea is to just have 1 textarea where they can enter their access code:

enter image description here

With this new design we’re hoping that it’ll be a lot more clear, and for the users that select that they don’t have an access code we’re thinking about letting them use the app without being able to earn money.

I’m wondering if all you experienced UX designers have come across an implementation like this before.

Any tips or advice would be great. Thank you.

minimal distance of a self correcting code

i wonder: how can i find minimal distance of a self correcting code in following situation: if we know that a code can fix every 3 errors(if not more than 3 errors, the word is recovered) and can detect every 5 errors(if between 3 and 5 errors, the algorithm will report that the error can not be fixed), how can we find its minimal distance?

i know that a code that fixes(hamming distance properties) $ i$ number of errors costs a length of $ 2i+1$ , and for detection of $ i$ errors it costs a length of $ i+1$ . so the minimal length in this scenario is $ (2(3)+1)+(5+1)$ or should it be the larger of the two? but if it’s the larger of the two, then the number 7 seems problematic in this case and seems that it is not suffice.

what is the correct minimal hamming distance here?

Forms of magical forensics, magical investigation and code breaking using magic in D&D 3.5

I am currently in the process of writing a D&D 3.5 scenario for my players and I’m looking at producing a sort of slow burn mystery for them to solve. In the earlier stages the party may (or may not) depending upon their actions intercept a cipher as it travels from sender to recipient written in ink on a perfectly ordinary mundane piece of parchment, detect magic reveals no magical auras present. Now just considering the cipher itself leaving aside situation and circumstance and aside from the mundane usage of Decipher Script to decrypt as discussed in Complete Adventurer page 98 and spells of the Divination school presented within the Player’s Handbook, what other magical methods exist in order to gain information as to the plain text? The identity of the sender or would be recipient? I would largely appreciate any responses sourcing D&D 3.5 material published by WoTC but supplementary by 3rd party publishers is okay too.

How can I inject real php code into this website?

So I found a file uploader on example.com. The file uploader accepts every file extension and the file is uploaded inside the directory

/temp/random-numeric-id.php

I tried to upload a php file and it got uploaded, however when I access that file, the content of the file is read as html comment. For example, I uploaded a file with content <?php print(123); ?> and when I visit example.com/temp/111111111.php I see a blank page because my php code has became the following:

<!--?php print(123); -->

Is this some kind of protection mechanism? How can I bypass this to execute my print functionality with php on that server?

Does a Buffer Overflow vulnerability always mean a code execution vulnerability?

Since Buffer Overflows always let an evil hacker to write outside the buffer and overwrite the return pointer to a shellcode the evil hacker can place, does it mean that a successful exploitation of a Stack Buffer Overflow always mean the ability to invoke a shell if done the right way? At least in theory, if you assume that DEP and ASLR is not in place.