Temporarily simulate being offline programmaticallyHow to access Mathematica license server (being outside of...

Is the interior of a Bag of Holding actually an extradimensional space?

Euro sign in table with siunitx

I won a car in a poker game. How is that taxed in Canada?

Can you fix a tube with a lighter?

How should Thaumaturgy's "three times as loud as normal" be interpreted?

Entering the US with dual citizenship but US passport is long expired?

What are the map units that WGS84 uses?

If I sell my PS4 game disc and buy a digital version, can I still access my saved game?

Draw the ☣ (Biohazard Symbol)

Why there is no wireless switch?

First Number to Contain Each Letter

Are there mathematical concepts that exist in the fourth dimension, but not in the third dimension?

What quests do you need to stop at before you make an enemy of a faction for each faction?

Can you create water inside someone's mouth?

Why does the seven segment display have decimal point at the right?

Global variables and information security

Translate English to Pig Latin | PIG_LATIN.PY

SQL Always On COPY ONLY backups - what's the point if I cant restore the AG from these backups?

Matlab fmincon for a problem with many nonlinear constraints

Phrase request for "work in" in the context of gyms

Opportunity profits vs. opportunity costs

What are some countries where you can be imprisoned for reading or owning a Bible?

Types of tablet... a tablet secretion

Notation: grace note played on the beat with a chord



Temporarily simulate being offline programmatically


How to access Mathematica license server (being outside of the local network)How to change proxy settings programmatically?Connect to Socket opened by other applications






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







5












$begingroup$


Today I am running Mathematica from a computer that is permanently connected to our university network. Because of a number of reasons, I am not allowed to disconnect my computer from our network.



My conflict is that I have some code I wish to test that depends on whether the computer is connected to the Internet or otherwise. How can I pretend my computer is not connected to the Internet for testing?



I know about $NetworkConnected to check if the computer is connected, but temporarily setting it to False with Block does not seem to work.



As a simple example of code that needs an Internet connection for testing purposes, you can use CurrencyConvert.










share|improve this question







New contributor



宮元亜衣 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$





















    5












    $begingroup$


    Today I am running Mathematica from a computer that is permanently connected to our university network. Because of a number of reasons, I am not allowed to disconnect my computer from our network.



    My conflict is that I have some code I wish to test that depends on whether the computer is connected to the Internet or otherwise. How can I pretend my computer is not connected to the Internet for testing?



    I know about $NetworkConnected to check if the computer is connected, but temporarily setting it to False with Block does not seem to work.



    As a simple example of code that needs an Internet connection for testing purposes, you can use CurrencyConvert.










    share|improve this question







    New contributor



    宮元亜衣 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






    $endgroup$

















      5












      5








      5





      $begingroup$


      Today I am running Mathematica from a computer that is permanently connected to our university network. Because of a number of reasons, I am not allowed to disconnect my computer from our network.



      My conflict is that I have some code I wish to test that depends on whether the computer is connected to the Internet or otherwise. How can I pretend my computer is not connected to the Internet for testing?



      I know about $NetworkConnected to check if the computer is connected, but temporarily setting it to False with Block does not seem to work.



      As a simple example of code that needs an Internet connection for testing purposes, you can use CurrencyConvert.










      share|improve this question







      New contributor



      宮元亜衣 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      $endgroup$




      Today I am running Mathematica from a computer that is permanently connected to our university network. Because of a number of reasons, I am not allowed to disconnect my computer from our network.



      My conflict is that I have some code I wish to test that depends on whether the computer is connected to the Internet or otherwise. How can I pretend my computer is not connected to the Internet for testing?



      I know about $NetworkConnected to check if the computer is connected, but temporarily setting it to False with Block does not seem to work.



      As a simple example of code that needs an Internet connection for testing purposes, you can use CurrencyConvert.







      web-access internet






      share|improve this question







      New contributor



      宮元亜衣 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question







      New contributor



      宮元亜衣 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question






      New contributor



      宮元亜衣 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 9 hours ago









      宮元亜衣宮元亜衣

      282 bronze badges




      282 bronze badges




      New contributor



      宮元亜衣 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      宮元亜衣 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.



























          2 Answers
          2






          active

          oldest

          votes


















          7














          $begingroup$

          You can set $AllowInternet to False (or just turn off your WiFi or unplug the cable).






          share|improve this answer









          $endgroup$















          • $begingroup$
            $AllowInternet looks like it does what I need, but I did not find this in documentation.
            $endgroup$
            – 宮元亜衣
            8 hours ago










          • $begingroup$
            @宮元亜衣 You can turn off accessing the internet using the GUI in the preferences. I believe $AllowInternet does exactly the same (and toggling the GUI toggles this variable too). I don't know where it's documented. It's probably undocumented (but widely known).
            $endgroup$
            – Szabolcs
            8 hours ago












          • $begingroup$
            For limited documentation use Names["*Internet*"] followed by ??$AllowInternet
            $endgroup$
            – Bob Hanlon
            8 hours ago



















          2














          $begingroup$

          A general solution for Windows is to run an application (such as Mathematica) inside a Sandboxie sandbox, for which Sandbox Settings > Restrictions > Internet Access has been set to "No program can access the Internet."






          share|improve this answer









          $endgroup$


















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "387"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });







            宮元亜衣 is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded
















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f204839%2ftemporarily-simulate-being-offline-programmatically%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            7














            $begingroup$

            You can set $AllowInternet to False (or just turn off your WiFi or unplug the cable).






            share|improve this answer









            $endgroup$















            • $begingroup$
              $AllowInternet looks like it does what I need, but I did not find this in documentation.
              $endgroup$
              – 宮元亜衣
              8 hours ago










            • $begingroup$
              @宮元亜衣 You can turn off accessing the internet using the GUI in the preferences. I believe $AllowInternet does exactly the same (and toggling the GUI toggles this variable too). I don't know where it's documented. It's probably undocumented (but widely known).
              $endgroup$
              – Szabolcs
              8 hours ago












            • $begingroup$
              For limited documentation use Names["*Internet*"] followed by ??$AllowInternet
              $endgroup$
              – Bob Hanlon
              8 hours ago
















            7














            $begingroup$

            You can set $AllowInternet to False (or just turn off your WiFi or unplug the cable).






            share|improve this answer









            $endgroup$















            • $begingroup$
              $AllowInternet looks like it does what I need, but I did not find this in documentation.
              $endgroup$
              – 宮元亜衣
              8 hours ago










            • $begingroup$
              @宮元亜衣 You can turn off accessing the internet using the GUI in the preferences. I believe $AllowInternet does exactly the same (and toggling the GUI toggles this variable too). I don't know where it's documented. It's probably undocumented (but widely known).
              $endgroup$
              – Szabolcs
              8 hours ago












            • $begingroup$
              For limited documentation use Names["*Internet*"] followed by ??$AllowInternet
              $endgroup$
              – Bob Hanlon
              8 hours ago














            7














            7










            7







            $begingroup$

            You can set $AllowInternet to False (or just turn off your WiFi or unplug the cable).






            share|improve this answer









            $endgroup$



            You can set $AllowInternet to False (or just turn off your WiFi or unplug the cable).







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 8 hours ago









            SzabolcsSzabolcs

            171k18 gold badges467 silver badges997 bronze badges




            171k18 gold badges467 silver badges997 bronze badges















            • $begingroup$
              $AllowInternet looks like it does what I need, but I did not find this in documentation.
              $endgroup$
              – 宮元亜衣
              8 hours ago










            • $begingroup$
              @宮元亜衣 You can turn off accessing the internet using the GUI in the preferences. I believe $AllowInternet does exactly the same (and toggling the GUI toggles this variable too). I don't know where it's documented. It's probably undocumented (but widely known).
              $endgroup$
              – Szabolcs
              8 hours ago












            • $begingroup$
              For limited documentation use Names["*Internet*"] followed by ??$AllowInternet
              $endgroup$
              – Bob Hanlon
              8 hours ago


















            • $begingroup$
              $AllowInternet looks like it does what I need, but I did not find this in documentation.
              $endgroup$
              – 宮元亜衣
              8 hours ago










            • $begingroup$
              @宮元亜衣 You can turn off accessing the internet using the GUI in the preferences. I believe $AllowInternet does exactly the same (and toggling the GUI toggles this variable too). I don't know where it's documented. It's probably undocumented (but widely known).
              $endgroup$
              – Szabolcs
              8 hours ago












            • $begingroup$
              For limited documentation use Names["*Internet*"] followed by ??$AllowInternet
              $endgroup$
              – Bob Hanlon
              8 hours ago
















            $begingroup$
            $AllowInternet looks like it does what I need, but I did not find this in documentation.
            $endgroup$
            – 宮元亜衣
            8 hours ago




            $begingroup$
            $AllowInternet looks like it does what I need, but I did not find this in documentation.
            $endgroup$
            – 宮元亜衣
            8 hours ago












            $begingroup$
            @宮元亜衣 You can turn off accessing the internet using the GUI in the preferences. I believe $AllowInternet does exactly the same (and toggling the GUI toggles this variable too). I don't know where it's documented. It's probably undocumented (but widely known).
            $endgroup$
            – Szabolcs
            8 hours ago






            $begingroup$
            @宮元亜衣 You can turn off accessing the internet using the GUI in the preferences. I believe $AllowInternet does exactly the same (and toggling the GUI toggles this variable too). I don't know where it's documented. It's probably undocumented (but widely known).
            $endgroup$
            – Szabolcs
            8 hours ago














            $begingroup$
            For limited documentation use Names["*Internet*"] followed by ??$AllowInternet
            $endgroup$
            – Bob Hanlon
            8 hours ago




            $begingroup$
            For limited documentation use Names["*Internet*"] followed by ??$AllowInternet
            $endgroup$
            – Bob Hanlon
            8 hours ago













            2














            $begingroup$

            A general solution for Windows is to run an application (such as Mathematica) inside a Sandboxie sandbox, for which Sandbox Settings > Restrictions > Internet Access has been set to "No program can access the Internet."






            share|improve this answer









            $endgroup$




















              2














              $begingroup$

              A general solution for Windows is to run an application (such as Mathematica) inside a Sandboxie sandbox, for which Sandbox Settings > Restrictions > Internet Access has been set to "No program can access the Internet."






              share|improve this answer









              $endgroup$


















                2














                2










                2







                $begingroup$

                A general solution for Windows is to run an application (such as Mathematica) inside a Sandboxie sandbox, for which Sandbox Settings > Restrictions > Internet Access has been set to "No program can access the Internet."






                share|improve this answer









                $endgroup$



                A general solution for Windows is to run an application (such as Mathematica) inside a Sandboxie sandbox, for which Sandbox Settings > Restrictions > Internet Access has been set to "No program can access the Internet."







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 7 hours ago









                Mr.WizardMr.Wizard

                235k30 gold badges487 silver badges1089 bronze badges




                235k30 gold badges487 silver badges1089 bronze badges


























                    宮元亜衣 is a new contributor. Be nice, and check out our Code of Conduct.










                    draft saved

                    draft discarded

















                    宮元亜衣 is a new contributor. Be nice, and check out our Code of Conduct.













                    宮元亜衣 is a new contributor. Be nice, and check out our Code of Conduct.












                    宮元亜衣 is a new contributor. Be nice, and check out our Code of Conduct.
















                    Thanks for contributing an answer to Mathematica Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f204839%2ftemporarily-simulate-being-offline-programmatically%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

                    The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

                    Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...