Wikipedia:Reference desk/Archives/Computing/2020 February 21

= February 21 =

How to sign up for a Weixin account as a Foreigner?
I need to ask technical questions to developpers of Chineese software who don t know me (200000 different users but not well known outside borders). And of course, the rule is no email, no GitHub, no Stack Exchange, but Weixin QR codes on the project s website which by the way isn t translated.

I read that in order to talk to mainland Chineese users, I need Weixin as WeChat is a version preventing to talk to mainland.

The problem is I don t know any Chineese user, and as I don t live in Asia, I ve no idea on how to get a Chineese mobile phone number (even temporary). 193.55.65.121 (talk) 14:33, 21 February 2020 (UTC)


 * You might ask on WP:RDL (more Chinese speakers there) if you don't get a useful response here reasonably soon. Could you use a Hong Kong VPN?  I think those are easy to get. 2601:648:8202:96B0:0:0:0:7AC0 (talk) 22:03, 21 February 2020 (UTC)
 * Location is based on mobile phone number not ip address. Do you have an idea for a Chineese mobile phone number? 37.171.180.227 (talk) 09:58, 23 February 2020 (UTC)
 * No, no, no, no, Weixin is WeChat if you're a foreigner. It's the same program except it's in English.  The userbase is identical between the two programs.  You guys are making this more complicated than you need to.  My copy of WeChat doesn't prevent me from talking with any of my students or friends in the mainland because neither my nor their account has been suspended.  Ian.thomson (talk) 22:42, 21 February 2020 (UTC)
 * Thank you. Can you help me to enroll then? [] 37.171.180.227 (talk) 09:58, 23 February 2020 (UTC)
 * I just went to their website, downloaded the app, and followed the instructions in it. That's it.  I registered my account on a US phone and have had to change the number three times since but it still works.  Just talked with some friends in Hangzhou earlier today. Ian.thomson (talk) 10:39, 23 February 2020 (UTC)
 * But as you can see on this picture from the app https://i.stack.imgur.com/ZEfG3.jpg, I need an other WeChat user to authorize me signing up. But while I want to ask questions to WeChat users. They are strangers who don t know me. So I don t know anyone who can help me.
 * Are you a mainland national? 193.55.65.121 (talk) 13:05, 24 February 2020 (UTC)
 * I think the reason for the above confusion is that WeChat has been getting stricter and stricter. If you've been using WeChat outside of China for a long time, you may have no problem. If not and want to register now, WeChat will often decide your account is suspicious and require the above mentioned process [//news.ycombinator.com/item?id=18941721] [//www.theindianwire.com/mobile-apps/verify-wechat-account-without-friend-153413/] It is true that you can also easily do stuff making it more likely [//forum.lowyat.net/topic/4769867/all] [//www.chinese-forums.com/forums/topic/58979-help-with-wechat-account-that-has-been-blocked/] [//www.quora.com/Can-anyone-help-me-with-my-WeChat-sign-up-It-says-I-need-to-contact-a-WeChat-user-from-China-who-used-it-for-more-than-6-months-then-ask-for-their-help]. And to be clear, this is just for ordinary WeChat. If you want WeChat Pay, give up. (Again if you set it up long ago in the past, maybe you'll be fine. Now....) Nil Einne (talk) 07:59, 26 February 2020 (UTC)
 * As explained above, I simply never went into China. So, the app is requiring an existing WeChat (can be anyone) user to allow me to sign up even with a Chineese temporary/shared phone number. And yes this is for ordinary WeChat. 37.165.220.176 (talk) 12:06, 26 February 2020 (UTC)

What is the problem with this code now?
Here is the relevant code:

--- Basically, I run the program. First, it's O's turn to make a move, so I say top-R. Then I do mid-R for X. Then I do mid-M for O and then low-R for X. Finally, I do low-L for O, but then the program stops or freezes for some reason.

This is what the final part of the computer terminal looks like when this program stops or freezes:

Why exactly is this happening and what exactly can I do to fix this? Basically, I'm having O win this game, but the program fails to actually register this victory and this final move for whatever reason.

Anyway, any thoughts on this? Futurist110 (talk) 22:30, 21 February 2020 (UTC)


 * You have two nested while loops. Once there is a win, the condition of the inner loop fails, so it becomes equivalent to a null statement. But since the condition of the outer loop is still true, it goes on looping. What you should do is combine the two into a single while loop, joining their conditions with . I also notice that the program will not print the final board. What you can do is put one call of   just before the while loop, and another just after the program has made the (validated) move on the board by executing  .  --Lambiam 00:03, 22 February 2020 (UTC)


 * You will learn faster if you step through your program with a debugger, because then you will see exactly what your code is doing. Using a debugger just to step through code is very simple, though you could speed up the process by learning to set breakpoints. https://docs.python.org/3/library/pdb.html is the documentation for pdb, and https://stackoverflow.com/questions/4929251/how-to-step-through-python-code-to-help-debug-issues also gives useful advice. Best of all, once you've learned how to use one debugger, the concepts will apply to any others, so if you move on to a different programming language you'll find using its debugger easy.- gadfium 01:39, 22 February 2020 (UTC)


 * The main alternative to a debugger is putting in print statements to show what it is doing as it runs. Add them strategically to make sure things are as you expect around where the program goes wrong.  That usually helps you figure out the problem.  Most of your program development time will be spent debugging rather than writing new code, so debugging is an essential skill.  Newly written code almost never works, so you have to get used to finding the errors.  It might help to sit down with an experienced programmer and have them guide you through debugging this code, and maybe refactoring it to some extent. 2601:648:8202:96B0:C8B1:B369:A439:9657 (talk) 05:19, 22 February 2020 (UTC)


 * I too would advise this alternative. Python being as interactive as it is, it is really easy to add some print statements that are tailored to helping you figure out what is how going wrong, and also to comment them out when they seem no longer needed. (Wait with deleting until you are sure everything is fine – you may need them again.) Here is another, more general remark about coding practice. Often there are different program entities that represent or determine the same conceptual entity. If the program modifies one representing entity, then usually the other needs to be adjusted too in order to maintain their proper relationship. A very simple example is a list of numbers (entity 1) together with their total (entity 2). If a number in the list is changed, or one is added to or removed from the list, the total needs to be updated. It is good to be explicitly aware of such relationships that must be kept invariant, so that the code for the necessary updates is properly added. In this case the state of the game has both an internal representation (the variable named ) and an external one (the printout). The invariant to be maintained is that they represent the same state of the game. Each change to the value of variable   (first its initialization; next each move by a player) should be accompanied by an update of the board's printout.  --Lambiam 09:56, 22 February 2020 (UTC)