text:
Q: Why does Java SimpleDateFormat work on some servers and not others? Greetings Stack Overflow,
I am running into a strange issue with an application I am implementing for a foreign office located in Athens.  When built, the application is a .war file that gets deployed on a Tomcat instance.
Just for some background information, this same application works successfully on several different OS (Ubuntu 12.04, Windows Server 2012 R2, etc.) both in the US and other countries with different Java/Tomcat configurations.
However the OS I am using to install the application for Athens is Windows Server 2008 R2.  Installed on this server is Java JRE 1.8.0_111 which is utilized by Tomcat 8.5.4.  This server is located in Athens.
Everything works fine with the application except for anywhere I am submitting a date field to my controller methods.  When attempting to submit the date string to my controller throughout various different sections of the application, I get the following message:
Failed to convert the value of 'java.lang.String' to required type'java.util.Date';
nested exception is java.lang.illegalArgumentException:  Could not parse text
[7/28/2017 7:00 AM] into any available date input formats.

Keep in mind that when I deploy this application to a Tomcat instance on another server, everything works fine and I do not receive this error message.
In an attempt to get around this error, I decided to change the type of one of my Request Parameters from:
@RequestParam("date") Date date

to
@RequestParam("date") String dateString

I then used Java SimpleDateFormat to convert the String to a Date:
SimpleDateFormat sdf_date = new SimpleDateFormat("MM/dd/yyyy hh:mm a");
String startDate = dateString;
Date date = sdf_date.parse(startDate);

The date string being passed to the above function is:
11/25/2017 12:00 pm

I tested this on several test servers with different OS/Tomcat configurations and it worked like a charm.  However when testing on the Windows 2008 R2 server located in Athens I still received an error.  I no longer received the above error, but I did receive the following:
java.text.ParseException: Unparseable date: "11/25/2017 12:00 pm"

I am unsure why this same exact Java code would be able to parse the same date using the same SimpleDateFormat pattern on some servers but not others.  This seems very strange to me.
Please let me know if you need any additional information and I will be happy to clarify.
Thank you!
EDIT:  Screenshot of Server Side Debug on Server in Athens:

'dateString' that is being passed to the controller method

A: Greece doesn't use the same am/pm designations as many other countries that speak Latin based languages.  Greece instead uses π.µ. and µ.µ.  Consequently, when the SimpleDateFormat doesn't receive a locale, it assumes it is the same as the computer running the program.
To fix this, try something such as the below:
SimpleDateFormat sdf_date = new SimpleDateFormat("MM/dd/yyyy hh:mm a",  new Locale("en", "US"));
String startDate = dateString;
Date date = sdf_date.parse(startDate);

This will use the English Language with US locale on this server.  You'll still need to make sure this is the format being passed in the input in every scenario though.

A: tl;dr
Instant.parse( "2017-11-25T12:00:00Z" )

Details
The Answer by Smith is correct.
In addition, three more issues. Addressing these will eliminate your problems of wrestling localized text formats.
Time zones
You are ignoring crucial issue of time zone. If not specified, you are relying implicitly on the JVM's current default time zone. That default can vary, even during runtime(!), so better to specify explicitly you desired/expected time zone.
Generally best to use UTC unless you have a specific reason.
ISO 8601
The ISO 8601 standard defines practical unambiguous formats for text representing date-time values.
For a moment in the timeline in UTC, use YYYY-MM-DDTHH:MM:SS.SSSSSSSSSZ where the T separates the date portion from the time portion, the Z is short for Zulu and means UTC, and the time uses 24-hour clock (no AM/PM).
Use these standard formats when serializing date-time values to text.
java.time
You are using troublesome old date-time classes that are now legacy, supplanted by the modern java.time classes.
The Instant class represents a moment in the timeline in UTC, similar to java.time.Date except with a resolution of nanoseconds rather than milliseconds.
Instant instant = Instant.now() ;

The java.time classes use ISO 8601 formats by default when parsing/generating strings.
String output = instant.toString() ;

And…
Instant instant = Instant.parse( "2017-01-23T12:34:56Z" ) ;

Perhaps you meant noon on the 25th in a certain time zone rather than in UTC.
LocalDateTime.parse( "2017-11-25T12:00:00" )   // LocalDateTime has no concept of time zone or offset-from-UTC. Not on the timeline. Has no real meaning until assigned a time zone.
             .atZone( ZoneId.of( "America/New_York" ) )   // Assign a time zone to determine a moment on the timeline, a ZonedDateTime.
             .toInstant()  // Extract a Instant, always in UTC by definition.
             .toString()  // Generate a string in standard ISO 8601 format.


text:
Q: Python XML Element Tree checking issue i've an issue with my script in python. i'm using it to read an xml for e-invoice, and works fine for 99% of the field. (i' grab information from xml and put it on xls file) however, i have an issue with this part of the script. If the script find the node no issue, it will report correctly. but if not, i want the script to check the second part, of the node, and grab the information from an other field(the first field is expire date) the second field in case the first is n/a is Days for payment.
   for scadenza in obj.iterfind('FatturaElettronicaBody/DatiPagamento/DettaglioPagamento/DataScadenzaPagamento'):
                        print(scadenza.text) #print thee expiration date
                        if (not scadenza.text):
                           for scadenza1 in obj.iterfind('FatturaElettronicaBody/DatiPagamento/DettaglioPagamento/GiorniTerminiPagamento'):
                             from datetime import timedelta, date
                             d1 = datem + timedelta(days=int(scadenza1.text))
                             print(f'New Expire {d1}')
                             scadenza.text = d1

A: i did by myself.
if len(obj.findall('FatturaElettronicaBody/DatiPagamento/DettaglioPagamento/DataScadenzaPagamento')):
                        for scadenza in obj.iterfind('FatturaElettronicaBody/DatiPagamento/DettaglioPagamento/DataScadenzaPagamento'):
                            from datetime import datetime
                            print(scadenza.text)
                            self.worksheet.write(row, column + 8, scadenza.text)
                            newscad = scadenza.text[0:10]
                            scad1 = datetime.strptime(newscad, "%Y-%m-%d")
                    else:
                        for scadenza1 in obj.iterfind('FatturaElettronicaBody/DatiPagamento/DettaglioPagamento/GiorniTerminiPagamento'):
                             from datetime import timedelta, date, datetime
                             scad1= datem + timedelta(days=int(scadenza1.text))
                             print(f'New Expire {scad1}')
                             newdate = datetime.strftime(scad1, "%Y-%m-%d")
                             self.worksheet.write(row, column + 8, newdate)

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to enable options using checkboxes and saving them through local storage? I started learning jQuery and Javascript not so long ago, and I have encountered some issues with the local storage. I am trying to control select - options using checkboxes, however my code does not work with jQuery 1.11.0, as I used 1.4.4 for this before.
Result expected: When I click on any box, the option linked with it will be enabled and saved in local storage. Also, when I select manually all checkboxes, the select all checkbox will be checked (this works now, but only on first attempt), and when one checkbox is not selected, the select all element will be unchecked automatically. Also, the select/unselect all checkbox does not work as it should.
This is what I had previously http://jsfiddle.net/tfgqhxdw/, code which worked with 1.4.4 jQuery library, however I would need it to work with 1.11.0 as I have other functions that are in conflict with this old library.
Here's the code I have so far:
$(function enableall_push() {
    $(".checkbox2").click(function(){
        var b = $(".checkbox2");
        if(b.length == b.filter(":checked").length){
            $("#enableall_push").attr("checked","checked");
        } else {
            $("#enableall_push").removeAttr("checked","checked");
        }
    });

    $('#enableall_push').click(function(event) {
        if(this.checked) {
            $('.checkbox2').each(function() {
                this.checked = true;
            $('#reasonDrop option[value=101^1]').removeAttr('disabled');
            $('#reasonDrop option[value=103^1]').removeAttr('disabled');
            $('#reasonDrop option[value=105^1]').removeAttr('disabled');
                localStorage.setItem(this.value,'checked');
            });
            //FUNCTION
        } else {
            $('.checkbox2').each(function() {
                this.checked = false;

            $('#reasonDrop option[value=101^1]').attr('disabled','disabled');
            $('#reasonDrop option[value=103^1]').attr('disabled','disabled');
            $('#reasonDrop option[value=105^1]').attr('disabled','disabled');
                localStorage.setItem(this.value,'');
            });
            //FUNCTION
        }
    });
});

$(function push101 () {
    $("#push1").each(function(){
        if (localStorage.getItem(this.value) == 'checked'){
            $(this).attr("checked","true");
            $('#reasonDrop option[value=101^1]').removeAttr('disabled');
        } else {
            $('#reasonDrop option[value=101^1]').attr('disabled','disabled');
        }
    });

    $("#push1").click(function(){
        if($(this).is(":checked")) {
            $('#reasonDrop option[value=101^1]').removeAttr('disabled');
            localStorage.setItem(this.value,'checked');
        } else {
            $('#reasonDrop option[value=101^1]').attr('disabled','disabled');
            localStorage.removeItem(this.value);
        }
    });
});

$(function push103 () {
    $("#push2").each(function(){
        if (localStorage.getItem(this.value) == 'checked'){
            $(this).attr("checked","true");
            $('#reasonDrop option[value=103^1]').removeAttr('disabled');
        } else {
            $('#reasonDrop option[value=103^1]').attr('disabled','disabled');
        }
    });

    $("#push2").click(function(){
        if($(this).is(":checked")) {
            $('#reasonDrop option[value=103^1]').removeAttr('disabled');
            localStorage.setItem(this.value,'checked');
        } else {
            $('#reasonDrop option[value=103^1]').attr('disabled','disabled');
            localStorage.removeItem(this.value);
        }
    });
});

$(function push105 () {
    $("#push3").each(function(){
        if (localStorage.getItem(this.value) == 'checked'){
            $(this).attr("checked","true");
            $('#reasonDrop option[value=105^1]').removeAttr('disabled');
        } else {
            $('#reasonDrop option[value=105^1]').attr('disabled','disabled');
        }
    });

    $("#push3").click(function(){
        if($(this).is(":checked")) {
            $('#reasonDrop option[value=105^1]').removeAttr('disabled');
            localStorage.setItem(this.value,'checked');
        } else {
            $('#reasonDrop option[value=105^1]').attr('disabled','disabled');
            localStorage.removeItem(this.value);
        }
    });
});

Thanks!

A: Your select option syntax is wrong; 101^1 instead of 101_1.
You can try this.
// ENABLE ALL PUSH OPTIONS
$(function enableall_push() {
    $(".checkbox2").click(function(){
        var b = $(".checkbox2");
        if(b.length == b.filter(":checked").length){
            $("#enableall_push").attr("checked","checked");
        } else {
            $("#enableall_push").removeAttr("checked","checked");
        }
    });

    $('#enableall_push').click(function(event) {
        if(this.checked) {
            $('.checkbox2').each(function() {
                this.checked = true;
            $('#reasonDrop option[value=101_1]').removeAttr('disabled');
            $('#reasonDrop option[value=103_1]').removeAttr('disabled');
            $('#reasonDrop option[value=105_1]').removeAttr('disabled');
                localStorage.setItem(this.value,'checked');
            });
            //FUNCTION
        } else {
            $('.checkbox2').each(function() {
                this.checked = false;

            $('#reasonDrop option[value=101_1]').attr('disabled','disabled');
            $('#reasonDrop option[value=103_1]').attr('disabled','disabled');
            $('#reasonDrop option[value=105_1]').attr('disabled','disabled');
                localStorage.setItem(this.value,'');
            });
            //FUNCTION
        }
    });
});

// 101 ------------------
$(function push101 () {
    $("#push1").each(function(){
        if (localStorage.getItem(this.value) == 'checked'){
            $(this).attr("checked","true");
            $('#reasonDrop option[value=101_1]').removeAttr('disabled');
        } else {
            $('#reasonDrop option[value=101_1]').attr('disabled','disabled');
        }
    });

    $("#push1").click(function(){
        if($(this).is(":checked")) {
            $('#reasonDrop option[value=101_1]').removeAttr('disabled');
            localStorage.setItem(this.value,'checked');
        } else {
            $('#reasonDrop option[value=101_1]').attr('disabled','disabled');
            localStorage.removeItem(this.value);
        }
    });
});

// 103 ------------------
$(function push103 () {
    $("#push2").each(function(){
        if (localStorage.getItem(this.value) == 'checked'){
            $(this).attr("checked","true");
            $('#reasonDrop option[value=103_1]').removeAttr('disabled');
        } else {
            $('#reasonDrop option[value=103_1]').attr('disabled','disabled');
        }
    });

    $("#push2").click(function(){
        if($(this).is(":checked")) {
            $('#reasonDrop option[value=103_1]').removeAttr('disabled');
            localStorage.setItem(this.value,'checked');
        } else {
            $('#reasonDrop option[value=103^1]').attr('disabled','disabled');
            localStorage.removeItem(this.value);
        }
    });
});

// 105 ------------------
$(function push105 () {
    $("#push3").each(function(){
        if (localStorage.getItem(this.value) == 'checked'){
            $(this).attr("checked","true");
            $('#reasonDrop option[value=105_1]').removeAttr('disabled');
        } else {
            $('#reasonDrop option[value=105_1]').attr('disabled','disabled');
        }
    });

    $("#push3").click(function(){
        if($(this).is(":checked")) {
            $('#reasonDrop option[value=105_1]').removeAttr('disabled');
            localStorage.setItem(this.value,'checked');
        } else {
            $('#reasonDrop option[value=105_1]').attr('disabled','disabled');
            localStorage.removeItem(this.value);
        }
    });
});

A: Change all your:
 $('#reasonDrop option[value=103^1]')

to
$("#reasonDrop option[value='103^1']")

You're missing the correct quotation marks.
Working example: jsfiddle


text:
Q: How formal is "Bless [him/her]"? I am living in the UK, and I have recently started noticing quite a lot of people saying "bless [him/her]", in contexts similar to:

— He has been doing poorly.
— Oh, bless him!

— She is so cute, bless her!

British dictionaries (Ox brigde) mention that this is informal language.
How informal is this expression, actually?
Out of curiosity: is it U or non-U? Would it be appropriate to say that at work (say, in an office/executive type of job), or is it too slang-ish? What does it show through (in terms of background) when one says it? Does it depend on the actual usage (e.g., OLD gives "Sarah, bless her, had made a cup of tea." as another example)?


text:
Q: User storage not saved between conversation but same user is recognized In my Actions on Google project, I save some data (like an uuivd userId) between conversations using conv.user.storage. With my own testing account, this works fine. On another testing account, the user.storage is cleared and the data is lost. The accounts have these differences:

*

*A Google Home is connected to the account where user storage DOES works and voice match is set up, personal results is enabled.

*NO Google Home is connected to the account where user storage DOESN'T work, no voice match is set up, personal results isn't an option since no device other than iPhone is connected. This account is used on smartphone (iPhone) only.

I know the user storage will be cleared when:

*

*Voice match is set up and there is no match.

*The user disabled personal data.

But this isn't the case for either accounts. I know the user is recognized as the same account because of the lastSeen and because the userId between conversations remains the same, as can be seen in the Conv object:
at the end of the conversation:
 "user": {
    "raw": {
      "userStorage": "{\"data\":{\"userId\":\"f581e751-ad81-4a6b-9519-00a57d5e30d4\"}}",
      "lastSeen": "2019-03-13T11:58:39Z",
      "locale": "nl-NL",
      "userId": "ABwppHEOonglGmWakeizd_Stx_OpUhSNzx2K4JWETc73FW-KctZLM2vc4B7V6Fxk9OfL3RQ3n5jIgw"
    },
    "storage": {
      "userId": "f581e751-ad81-4a6b-9519-00a57d5e30d4"
    },
    "_id": "ABwppHEOonglGmWakeizd_Stx_OpUhSNzx2K4JWETc73FW-KctZLM2vc4B7V6Fxk9OfL3RQ3n5jIgw",
    "locale": "nl-NL",
    "permissions": [],
    "last": {
      "seen": "2019-03-13T11:58:39.000Z"
    },
    "name": {},
    "entitlements": [],
    "access": {},
    "profile": {}
  },

at the beginning of a new conversation:
"user": {
    "raw": {
      "lastSeen": "2019-03-13T11:59:33Z",
      "locale": "nl-NL",
      "userId": "ABwppHEOonglGmWakeizd_Stx_OpUhSNzx2K4JWETc73FW-KctZLM2vc4B7V6Fxk9OfL3RQ3n5jIgw"
    },
    "storage": {},
    "_id": "ABwppHEOonglGmWakeizd_Stx_OpUhSNzx2K4JWETc73FW-KctZLM2vc4B7V6Fxk9OfL3RQ3n5jIgw",
    "locale": "nl-NL",
    "permissions": [],
    "last": {
      "seen": "2019-03-13T11:59:33.000Z"
    },
    "name": {},
    "entitlements": [],
    "access": {},
    "profile": {}
  },

Does anyone know any other reason why user.storage might be cleared other than the ones stated above, or another way without using account linking?

A: I think I figured it out. In https://myaccount.google.com/u/3/activitycontrols?utm_source=google-account&utm_medium=web I forgot to toggle the Chrome-history and activity option.


text:
Q: Is there a conjecture with maximal prime gaps Define $M_n$ to be the $n$th maximal gap between primes. That is, $M_1=1$ thanks to $3-2=1$; $M_2=2$ thanks to $5-3=2$; $M_3=4$ thanks to $11-7=4$; and in general, $M_n = p_{i+1}-p_i$, where $p_i$ is the smallest prime such that $p_{i+1} - p_i > p_{j+1} - p_j$ for all $j < i$.
Is there a conjecture or proof with maximal prime gaps, $M_n$, which says that the gap will not more than double between one maximal to the next, $$\frac{M_{n+1}}{M_n} \le 2$$ for $n>1$, or $$\frac{M_{n+1}}{M_n} < 2$$ for $n>3$?
If yes, who wrote it?
Edit:
Currently, there are three answers, of which only one appears to try to answer the posed question "who wrote it?" or if the conjecture exist. Greg Martin answered with "I haven't seen a conjecture of this type." which seems to point towards this conjecture being an original conjecture. But, there is no one else which agreed with him or changed the statement.
While the extra information of all of the answers is nice, it appears that proving this conjecture would lead to disprove something with the "heuristic analysis using Cramér's model" and how its is used. But I digress, this would be another question.
I have also not seen a conjecture like this, so I hoped someone else may have and can state a reference that I can source.
Edit 2:
Now four nice answers, but none which answer the question.

A: I haven't seen a conjecture of this type. It is conjectured that among all primes up to $x$, the largest gap has size like $(\ln x)^2$ or a constant multiple thereof. The next time that gap occurs, each number following the gap will have a roughly $1/\ln x$ probability of being prime (by the prime number theorem). So we expect the next gap to be about $Y\ln x$ larger than the previous one, where $Y$ is a continuous random variable with a Poisson distribution with parameter $\lambda=1$. This implies that the order of magnitude of $M_{N+1}-M_n$ typically has size $\sqrt M_n$ (times a fluctuating constant); in particular, for any $\varepsilon>0$, we should have $M_{n+1}/M_n < 1+\varepsilon$ for sufficiently large $n$.

A: I pulled one of the tables of prime gaps off wikipedia and put a final column, $g/\log^2p,$ just as in the section in Guy's book. For $11 \leq p < 4 \cdot 10^{18},$ we have $g < \log^2p.$ Completely unprovable for larger $p.$ After line 3 (prime is 7) the closest we get to $1$ is line 64, $ \; g =   1132,$ $ \; p \approx 1.69 \cdot 10^{15},$ $ \; g/\log^2p \approx   0.920639.$ I believe Cramer-Granville is the conjecture that $ \; \limsup g/\log^2 p$ is nonzero but finite, and the disagreement is over whether it is more likely to be $1$ or something else.
       Stolen from
       http://users.cybercity.dk/~dsl522332/math/primegaps/maximal.htm

       the size of the gap is g

       next are the number of decimal digits in p

       for 4 * 10^18 > p >= 11, g < log^2 p = (log p)^2.

       Oh, logarithms base e == 2.718281828459

   ==================================
            g   digits of p           p    log p   g/log p  g/log^2 p
     1      1   1                      2 0.693147   1.4427    2.08137
     2      2   1                      3  1.09861  1.82048    1.65707
     3      4   1                      7  1.94591  2.05559    1.05637
     4      6   2                     23  3.13549  1.91357   0.610294
     5      8   2                     89  4.48864  1.78228   0.397065
     6     14   3                    113  4.72739  2.96147   0.626449
     7     18   3                    523  6.25958  2.87559    0.45939
     8     20   3                    887  6.78784  2.94644   0.434076
     9     22   4                   1129  7.02909  3.12985   0.445271
    10     34   4                   1327  7.19068  4.72835   0.657566
    11     36   4                   9551   9.1644  3.92824   0.428642
    12     44   5                  15683  9.66033  4.55471   0.471486
    13     52   5                  19609  9.88374  5.26116   0.532305
    14     72   5                  31397  10.3545  6.95352   0.671548
    15     86   6                 155921  11.9571  7.19238   0.601515
    16     96   6                 360653  12.7957  7.50254   0.586334
    17    112   6                 370261   12.822  8.73501   0.681254
    18    114   6                 492113  13.1065    8.698   0.663642
    19    118   7                1349533  14.1153  8.35974   0.592248
    20    132   7                1357201  14.1209  9.34782   0.661983
    21    148   7                2010733   14.514   10.197   0.702566
    22    154   7                4652353  15.3529  10.0307   0.653342
    23    180   8               17051707  16.6518  10.8097   0.649161
    24    210   8               20831323   16.852  12.4615   0.739466
    25    220   8               47326693  17.6726  12.4487   0.704405
    26    222   9              122164747  18.6209  11.9221   0.640254
    27    234   9              189695659  19.0609  12.2764   0.644062
    28    248   9              191912783  19.0726   13.003   0.681764
    29    250   9              387096133  19.7742  12.6427   0.639356
    30    282   9              436273009  19.8938  14.1753   0.712549
    31    288  10             1294268491  20.9812  13.7266   0.654231
    32    292  10             1453168141   21.097  13.8408   0.656056
    33    320  10             2300942549  21.5566  14.8447   0.688637
    34    336  10             3842610773  22.0694  15.2247   0.689855
    35    354  10             4302407359  22.1824  15.9586   0.719423
    36    382  11            10726904659   23.096  16.5396   0.716125
    37    384  11            20678048297  23.7523  16.1668   0.680642
    38    394  11            22367084959  23.8309  16.5332   0.693772
    39    456  11            25056082087  23.9444  19.0441   0.795349
    40    464  11            42652618343  24.4764  18.9571   0.774506
    41    468  12           127976334671  25.5751   18.299   0.715502
    42    474  12           182226896239  25.9285   18.281   0.705055
    43    486  12           241160624143  26.2087  18.5434   0.707529
    44    490  12           297501075799  26.4187  18.5475   0.702059
    45    500  12           303371455241  26.4382   18.912   0.715328
    46    514  12           304599508537  26.4423  19.4386   0.735133
    47    516  12           416608695821  26.7554  19.2858   0.720819
    48    532  12           461690510011  26.8582  19.8078   0.737495
    49    534  12           614487453523  27.1441  19.6728   0.724756
    50    540  12           738832927927  27.3283  19.7597   0.723048
    51    582  13          1346294310749  27.9284   20.839   0.746159
    52    588  13          1408695493609  27.9737  21.0198   0.751412
    53    602  13          1968188556461  28.3081   21.266   0.751232
    54    652  13          2614941710599  28.5923  22.8034   0.797536
    55    674  13          7177162611713  29.6019  22.7688   0.769166
    56    716  14         13829048559701  30.2578  23.6633   0.782057
    57    766  14         19581334192423  30.6056  25.0281   0.817762
    58    778  14         42842283925351  31.3885  24.7861   0.789655
    59    804  14         90874329411493  32.1405  25.0152   0.778307
    60    806  15        171231342420521   32.774  24.5926   0.750369
    61    906  15        218209405436543  33.0165  27.4408   0.831126
    62    916  16       1189459969825483  34.7123  26.3884   0.760203
    63    924  16       1686994940955803  35.0617  26.3535   0.751632
    64   1132  16       1693182318746371  35.0654  32.2825   0.920639
    65   1184  17      43841547845541059  38.3194  30.8982   0.806335
    66   1198  17      55350776431903243  38.5525  31.0745   0.806032
    67   1220  17      80873624627234849  38.9317   31.337   0.804922
    68   1224  18     203986478517455989  39.8568  30.7099   0.770506
    69   1248  18     218034721194214273  39.9234  31.2598   0.782995
    70   1272  18     305405826521087869  40.2604  31.5943   0.784749
    71   1328  18     352521223451364323  40.4039  32.8681   0.813489
    72   1356  18     401429925999153707  40.5338  33.4536   0.825325
    73   1370  18     418032645936712127  40.5743  33.7652   0.832181
    74   1442  18     804212830686677669  41.2286  34.9757   0.848335
    75   1476  19    1425172824437699411  41.8008  35.3103   0.844728
          g   digits of p             p    log p   g/log p  g/log^2 p
   ==================================

A: Here's a heuristic analysis using Cramér's model. TL;DR: the conjecture is likely false.
The expected maximal gap in this model is $\log^2n$, so suppose we're looking just after finding just such a gap. The probability that a number is prime is $x=1/\log n$ and so the probability that a given prime will have a gap of length $k+1$ is $x(1-x)^k$. The probability that a given prime will not be followed by a record gap is thus
$$
1-(1-x)^{\log^2n}=1-\left((1-1/\log n)^{\log n}\right)^{\log n}\approx1-e^{-\log n}=1-1/n.
$$
and the probability that a given prime will be followed by a record of at least $k$ times the old one is
$$
(1-x)^{k\log^2n}\approx e^{-k\log n}=n^{-k}.
$$
Combining the two, the probability that the gap will be exceeded by a factor of $k$ or more is
$$
\sum_{i=0}^\infty(1-1/n)^in^{-k}=\frac{n}{n^k}=\frac{1}{n^{k-1}}
$$
and hence $k=2$ is right on the boundary: we expect records to double the previous record infinitely often (since $\int1/n$ diverges), but records should be 2.001 times the previous record finitely often.
Now this is really taking the heuristic too far. Cramér's model is not state of the art, and has been shown to make incorrect predictions on the fine behavior of the primes ([1], [2]). But the basic idea is that there is a phase transition, probably around 2, from ratios that appear infinitely often to finitely often (or never!).
Improvement
A better version would allow the starting gap to be other than $\log^2n$. This crude version is conservative, since a distribution of values would make it easier to get large factors between the two.
In fact, if you redo the calculation supposing that the old record is only $s\log^2 n$ then you expect that gaps of size $1+1/s$ should occur infinitely often. So if you think that a positive proportion of the time the largest prime gap below $n$ is $0.99\log^2n$ then you should get records topping the previous one by a factor of 2+1/99 infinitely often.
Technical Notes
A further improvement would be to take small factors into account (a relative of the so-called W-trick). It's hard to predict the net effect but if anything it would also make larger factors happen more often.
A minor issue is that my analysis uses $1/\log n$ as though it is constant. But the interesting range is the next $n$ primes after $n$, so it suffices to look up to about $n+n\log n$ which has logarithm about $\log n+\log\log n$ which is less than $(1+\varepsilon)\log n$ for any $\varepsilon>0$ and large enough $n$.
Conclusion
The conjecture is on shaky ground. There's good reason to think big ratios of maximal gaps happen infinitely often. On the other hand, looking at the heuristics we're talking about amazingly big numbers before these sorts of events happen. Each event we're looking at is a new maximal prime gap, and a 'success' at any given maximal prime gap has asymptotic probability 0 of happening, getting positive probability only when we integrate over a large number of new maximal prime gaps. But we know only a handful of these, so it's entirely possible that we'll never see only of these megajumps.
Bibliography
[1] János Pintz, Cramér vs. Cramér. On Cramér's probabilistic model for primes, Funct. Approx. Comment. Math. 37 (2007), part 2, pp. 361–376.
[2] H. Maier, Primes in short intervals, Michigan Math. J. 32 (1985), pp. 221–225.

A: This is all some rather shaky heuristics, but here is what I think:
A random integer n is prime with probability $\frac{1}{\ln{n}}$ and composite with probability $1 - \frac{1}{\ln{n}}$.
A random integer n is followed by at least $M$ composite numbers with probability $(1 - \frac{1}{\ln{n}})^M$ which is about $\exp (-\frac{M}{\ln{n}})$. That's true for every integer $n$, including integers $n$ which are primes.
If the record gap so far is $M$, then a prime $p$ is followed by a record gap with probability $\exp (-\frac{M}{\ln{p}})$. It is followed by a gap of length $2M$ or more with probability $\exp (-\frac{2M}{\ln{p}})$. If that prime $p$ is indeed followed by a record gap, then the probability that it is followed by a gap doubling the record is $\exp (-\frac{M}{\ln{p}})$.
So the chance that a prime $p$ is followed by a record gap is the same as the chance that the record gap is twice the previous record gap. The table above shows 75 record gap up to $1.4 * 10^{18}$. The distance between two record gaps is about $8 * 10^{17}$. $\ln p$ is about 40, so the chance for a prime being followed by a record gap is about $\frac{1}{2 * 10^{16}}$. The chance that a record gap is twice the previous gap is also $\frac{1}{2 * 10^{16}}$. So this is very unlikely to happen.
Anyone who knows how to make $\frac{1}{\ln{p}}$ look nicer? See comment below.

A: This conjecture has a sequence. See OEIS A053695.
This conjecture has also has a solution:
Bounding Maximal gaps with Ramanujan primes


text:
Q: Why does ruby-debug say 'Saved frames may be incomplete' From time-to-time I get this when a breakpoint is triggered. It looks like stack frames aren't getting saved so I can't step back through the call stack - a real pain. See below for an example
--> #0 BatchProcess.add_failure_record(row_id#Fixnum, test#Struct::Test, message#String,...)
       at line server/processes/batch.rb:309
Warning: saved frames may be incomplete; compare with caller(0).
(rdb:1) pp caller
["./server/processes/batch.rb:309:in `run_tests'",
 "./server/processes/common/generic_process.rb:219:in `each'",
 "./server/processes/common/generic_process.rb:219:in `run_tests'",
 "./server/processes/common/generic_process.rb:271:in `run_plan'",
 "./server/processes/common/corrections.rb:19:in `each_with_index'",
 "./server/processes/common/generic_process.rb:266:in `each'",
 "./server/processes/common/generic_process.rb:266:in `each_with_index'",
 "./server/processes/common/generic_process.rb:266:in `run_plan'",
 "./server/processes/batch.rb:202:in `run_engine'",
 "/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'",
 "./server/processes/batch.rb:201:in `run_engine'",
 "./server/processes/common/generic_process.rb:88:in `run_dataset'",
 "./server/processes/batch.rb:210:in `run_dataset'",
 "/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'",
 "./server/processes/batch.rb:209:in `run_dataset'",
 "./server/processes/common/generic_process.rb:159:in `run'",
 "./server/processes/common/generic_process.rb:158:in `each'",
 "./server/processes/common/generic_process.rb:158:in `run'",
 "./server/processes/batch.rb:350:in `run'",
 "/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'",
 "./server/processes/batch.rb:349:in `run'",
 "server/processes/test_runs/run_tests.rb:55:in `run_one_process'",
 "server/processes/test_runs/run_tests.rb:81"]

Any ideas on how to stop this happening?

A: It means the call stack as reported by Ruby's caller() function doesn't match what the debugger has recorded as the call stack.
This can happen if the debugger tracking was activated while the call stack had more than one frame in it. It can also happen as a result of a bug in ruby-debug where it isn't tracking correctly. One "remedy" is to put this in at the very beginning of the file in main file:
  require 'ruby-debug'; Debugger.start
However the downside of this is that there is some additional overhead added right from the beginning of the program.
Somewhere in your Ruby code you have to tell Ruby to start tracking calls and returns. Typically this is done via combination of Debugger.start and Debugger.stop or Debugger.start { }. If you are running from a framework, these commands are issued somewhere for you, so the responsibility of issuing at the right place rests on the programmer who added this code.
Finally, down the line I will change the message to be a little more explicit:
Warning: saved frames may be incomplete;
compare debugger backtrace (bt) with Ruby caller(0).


text:
Q: Android : Next/Previous data details from listview items i wanna show the details data from listviews android, i did it...
but the problem is, i don't know how to make a function to show the next/previous detail data by clicking the next/previous button based on listview data.
this is my listview data layout
and this is my next/previous layout  for details data
please someone, tell me how to do this (sample code, tutorial, link)
thank in advance

A: Damn it! Play with your array-list data of listview, pass appropriate position to next activity and while press next call next data from array-list, same while pressing previous call previous data from array list, this way you can achieve your goal!
I answered one of similar question hope it will help you.
stackverflow question:How to do next button action?

A: *

*By using get and set method
my making a function in different class where activity name is stored.
You can set every prev or next activity and call it by get method.

*By calling intent.
Eg:
 `    public void onClick(View arg0) {
                // TODO Auto-generated method stub
                Intent_start1();
                finish();
            }

            private void Intent_start1() {
                // TODO Auto-generated method stub
                Intent i2 = new Intent();
                i2.setClass([Your Current Class].this,[Class where you wish to move].class);
                startActivity(i2);
            }
        }); `

Dont call finish() method
I like to use intent :)


text:
Q: What counts as information? What counts as information? In e.g. the EPR experiment why is one entangled particle knowing instantaneously the state of the other not counted as 'information'.
Edit
Following a discussion in the comments to giulio bullsaver's answer I have decided to summarise what is my main confusion:
Alice and Bob are scaled down to the quantum level* so they have analogous properties to an electron. They are also entangled so Bob will always go into the opposite state to Alice.
Alice flies of to a classical measuring device $M_A$ and Bob to another classical measuring device $M_B$.
Alice's state, $|+\rangle$ or $|-\rangle$, gets measured first with outcome $|+\rangle$ (say). Due to Bell's inequities there are no local hidden variables, so Alice must decide at the point of measurement (and not before) what state she is going to go into.
Bob get's measured at time** $t$ after Alice but he has to be measured in a state opposite to Alice (due to the entanglement) i.e. $|-\rangle$. Bob must therefore know (on the point of measurement) what state Alice decided to go into so he can go into the opposite state.
The 'information' of Alice's state must therefore be transferred to Bob faster than the speed of light. To deny this statement would be in contradiction to the Aspect experiment.
*Ignoring practicalities
**designed so the two measurement events are separated by a space-like interval.

A: The particle does not know anything. The information is what we (physicists, experimentalists) can communicate to someone else.
Ask yourself: what can $A$ do, sharing an EPR pair with $B$, to tell something (let's say $0$ or $1$) to his friend $B$ after they have left each other (but still sharing at a distance the EPR pair), in a superluminal way?
You will understand that the answer is "nothing", and that the EPR pair is for this purpose as helpful as sharing a pair of gloves ($A$ has either the left one or the right one, B has the other and none of them knows who has what when they leave each other.).
From what concerns locality the EPR pair and the gloves are the same, and so you will agree with me (since none has ever published a superluminal information transfer protocol based on a pair of gloves) that entanglement is fine with relativity.
The difference between EPR and gloves is just a quantitative one, the EPR allows a bit more correlation (see Bell Inequalities) and since Nature allows that too (see Alain Aspect experiment) the EPR is much more realistic than a description based on hidden variable (i.e. gloves-like situation).
Just another comment, that I've found very useful, do not think of the wavefunction as "something that is really there" so that an istantaneous collapse of it may appear as violation of locality (when $B$ measure his qubit he make collapse the entire wavefunction...). The wavefunction is a mathematical tool to predict probabilities, the probabilities are the only thing that are "really there" since we actually see them in experiments. And you will notice, $B$ cannot change the probabilities for $A$'s measurement.
See also the reference frame blog for very nice posts about this stuff.
EDIT -
I think the point of our disagreement is that you stick to a POV where the particle "chooses" a state after being measured and so it appears to you that the two particles have to exchange "information" in order to give coherent (correlated) answer when measured. Therefore you see a substantial difference from the classical case of gloves, where they already knew what they where (though the glove carriers didn't). This is what I think you think, but correct me if I am wrong.
Now, It seems to me that such a POV is a vestige of the so called "realism" of classical mechanics, i.e. That any physical observable has a definite value at any time. This pone a separation to what we, the experimenters, know and what the particle knows. So, for the case of the gloves, we do not know what glove it is, but the "glove" knows itself and so there is no FTL communication between them notwithstanding the same space-like perfect correlation (quoting your last comment).
In QM realism of course does not exists (as the Bell inequalities have shown) and so the above considerations have to be changed: No one, not even "the particle", knows what will be the outcome of a measurement.
Such a shift of paradigm requires to fix some terminology and boundaries on what is "physical" and what is not.
The physical content of QM are the probabilities of measurement, that we , the experimenters, can predict and observe, nothing else.
This is an idea deeply radicated in any QM theory we have about the world.
Any different calculations or object that lead to the same probabilities may be thought as "redundant", "not physical". For example in QFT the fact that there is no privileged inertial reference frame is encoded in the fact that performing a Poincarè transformation correspond to act on states with an (anti-)unitary operator, that leaves unchanged the probabilities.
To sum up: "we" are the experimenters, of a given QM system we can only predict and observe probabilities and nothing else, and causality must agree with this fact (and nothing else).
Having said this, I invite you to re-think about the EPR experience from this POV, where probabilities play the central role.
The only thing that appear as "non-local" is that when A measures his particle he istantly changes the total wave-function of the two particles, from $|\mathrm{EPR}\rangle$ to $|0\rangle|1\rangle$ (if $A$ obtains $0$, $|\mathrm{EPR}\rangle$ is the usual entangled pair). It appears as non-local since the total wave-function involves both $A$'s and $B$'s particles and they are space-like separated.
But the wave-function is not the true physical content of QM, only probabilities are. And $A$ cannot change any of $B$'s observed probabilities, so in no way $A$ can change the physics that $B$ will experience.

A: Because they have less information that you imagine. They do not have separate bits of information describing them that gets somehow "transported" between them. From an information POV they are only one particle until measured and then they acquire separate but related information describing each separately.

A: "The phrase "entangled particle knowing instantaneously.." is a crude way to understand the phenomena. Consider a entangled state shared between Alice and Bob given by
\begin{equation}
|\psi\rangle_{AB}=\frac{1}{\sqrt{2}}(|z_+\rangle_{A}|z_-\rangle_{B}-|z_-\rangle_{A}|z_+\rangle_{B})
\end{equation}
Alice can measure the spin of her particle in any direction. Then the state of Bob will reduce to a completely mixed state corresponding to the basis in which Alice measured her spin. For example, if Alice measured the spin along $x$ axis Bob's state will become
\begin{equation}
\rho_{B}=\frac{1}{2}\left(|x_+\rangle\langle x_+|+|x_-\rangle \langle x_-|\right)
\end{equation}
Similarly, if Alice measure her spin along $z$ axis Bob's state will reduce to a completely mixed state in $z$ basis. Hence, although we have mixtures of $2$ different kinds there are no objective difference between them. Which means one can not design any experiment to distinguish between completely mixed state in  two different bases (consequence of GHJW theorem). Hence, Bob can not get any information on whether or not Alice actually measured her particle or not. Although the state shared between Alice and bob collapses after Alice's measurement Bob can not get any information about it. Hence, the information in this example or in EPR example it is not an usable information.
EDIT:
Let Alice and Bob shared $2n$ copies of the entangled state. Alice measured the spin in $\sigma_{x}$ direction for the n copies and get $|+\rangle$ or $|-\rangle$ as outcome. It is true that Bob's state will reduce to $|-\rangle$ or $|+\rangle$ respectively, which is really a mixed state of $|-\rangle$ and $|+\rangle$ .  Now suppose Alice does measurement in $\sigma_{z}$ direction for the remaining $2n$ copies then Bob's state and get $|\uparrow\rangle$ or $|\downarrow\rangle$ then Bob's state will reduce to $|\downarrow\rangle$ or $|\uparrow\rangle$ respectively (again a mixed state of $|\downarrow\rangle$ and $|\uparrow\rangle$) . Now if Alice does not send the result of her experiment or the information about which basis she has done the measurement Bob cannot distinguish between these two mixed states statistically (consequence of GHJW theorem) i.e. Bob cannot do any type of measurement which distinguishes these mixed states in $x$ and $z$ direction. Because measurement outcomes are statistical property. Hence, although it seems like Bob's state has changed by faster than light signalling Bob cannot extract any information from his state.

A: In this answer we will stick totally to the Copenhagen interpretation of quantum mechanics.

*

*Before the system is measured, there is nothing physical (a consequence of realism not playing a part under this interpretation). There is only our mathematical, non-physical description of the possible measurement outcome called the wavefunction.

*On measurement the system is made to exist in a physical way. And is created in one of the eigenstates under which we are measuring.

*The system has never been in another state (since it did not exist before it was measured).

*Thus there is no need for one 'particle' to tell the other what state it is in because there is only one state which is physical.

A: One way to look at it is as follows:
Assume that in the EPR experiment, one entangled particle knowing instantaneously the state of the other not counts as 'information'. This assumption automatically entails that information has transferred from one point to another. Therefore, it has speed.
Now,considering EPR experiment and two parties involved. Alice makes a measurement A and Bob makes measurement B. Without a loss of generality, assume that Alice measures A first and then Bob measures. According to our assumption, Alice's outcome determines Bob's measurement outcome. Therefore, we get a cause-effect relation. However, this relation holds in the current reference frame. One could switch to some privileged reference frame where measuring B happens before A and then we get the effect determines the cause. Conducting the certain experiment, one can see in the second reference below, assuming the travel of information, one could achieve the lower bound for the "quantum information speed" to be $10^6C$, where $C$ is speed of light.
One could take a look at the following papers to learn more about the topic:
Testing spooky action at a distance
D. Salart, A. Baas, C. Branciard, N. Gisin, H. Zbinden
http://arxiv.org/abs/0808.3316
and
"Experimental Test of Relativistic Quantum State Collapse with Moving Reference Frames"
H. Zbinden, J. Brendel, W. Tittel, N. Gisin
http://arxiv.org/abs/quant-ph/0002031

A: Entanglement counts as information. In e.g. the EPR experiment one entangled particle "knows" the state of the other, because we humans tend to call entanglement "knowing" or "information".
After you have measured a particle, you "know something about the particle". In other words: After you have measured a particle, you and the particle are entangled.
When you "know" something about a particle, it means that if your idea about the state of the particle is examined, and the state of the particle is examined, it will be found that your idea about the state of the particle corresponds to the state of the particle, because there's that kind of entanglement between you and the particle.
Why do we say that one entangled particle knowing instantaneously the state of the other is not information? We say it for various reasons, quite often it's an attempt to set straight somebody dreaming about faster than light communication.


text:
Q: Create GeoTIFF images from TIFF image using the coordinates of the four corners I have several TIFF images which were taken from an aircraft. The images are tilted.  Hence, the orientation of the images are not in parallel to the grid system.
Please do refer to the below image:
(Image borders are in blue color, while bounding box is  in green color)
According to the image, what I have are following values:

*

*coordinate values with respect to the four corners of the image: (a1,b1),  (a2,b2),  (a3,b3),  and (a4,b4).

*from the values I can get the bounding box of the image and that would be (a2, b1), (a2, b3), (a4, b3) and (a4, b1).

I'd like to perform geo-referencing of the images using a tool like GeoTools or JAI. In GeoTools, I noted the ReferenceEnvelop class which offers the constructor that takes lower left, lower right, upper left and upper right values of the image. Thus, I reckon it works only for images which the orientation of the image as same as the orientation of the grid system.
I'd like to know how can I create GeoTIFF images from images that are not in same orientation of the grid lines. Instead, for each image, I have the corner coordinates.
I'm looking for a Java or Python technique. (Java is more favored).

A: Python and GDAL provide this functionality.  Have a look at GDAL.GCP for adding the ground control to the TIF.  See this Stack Exchange example,  the GDAL GCP class in the GDAL Python API, and this well documented link to get you started.
I see that there is also a Java/GDAL bindings.


text:
Q: Making all variables in a program modifiable at runtime by the programmer, smart idea? I was thinking of doing this with C++, basically from an external editor or something the programmer can say: MyClass::dude = "hello" where 'dude' is a static integer in 'MyClass'.
What the program does at runtime is it partitions the input to MyClass :: dude = "hello" and finds the class called 'MyClass' and assigns the dude variable in it as "hello".
The idea behind it is for it to act as a sort of a runtime debugger.
Is this safe/sane?

A: Yes, this is a typical tool used during development to help fine-tune games. It's not so often something you type in as much as a screen where you can adjust variables on the fly with a controller (that changes some class variable under the hood), but for pc games, there isn't a reason why you couldn't type in something, especially if it's text. You would, of course, need to program your own system where a class notifies some part of your engine of it's name and how to get at some of its variables.

A: Your typical debugger can already do this for all basic types.
Assigning a char string value is a bit more involved since it requires allocating memory for the actual string and assigning a pointer to it to the variable.

A: Your best bet it to use something like Boost::python, and integrate a real scripting language. This is a whole lot less work than building your own mini-language. For instance, it will already know how to deal with problem statements like "MyClass::dude = "hello" where 'dude' is a static integer in 'MyClass'."

A: although not a very elegant solution i sometimes wrap up static versions of variables which i require to change on the fly through the debugger in order to tweak stuff, then just comment out the corresponding #define when done with it, particularly helpful if load times are long and its just a few vars you need to tweak in order to test something. but then again for something like this you should probably consider data files that can be reloaded at runtime

A: I've made a simple library for such a purpose, you might find it useful:
https://github.com/miloszmaki/tunable-cpp
You can mark all the required variables using tunable(var_name) and they will be modifiable whenever you enter the interactive console with tunablecmd().

A: The description isn't very clear, can you clarify? Is this something that should happen while the program is running? Or would it run this using the variable?
One of the differences between C++ and Java is that the class names aren't really used in the executable program (unless it was specifically compiled for debugging). So there's no way a program can make a running C++ program find specifically a variable in that program.
Either way, without making the "debugged" program be compiled with enough information and functionality to do this, it's not really practical, but it's not clear what you're trying to do.
I'm also not clear what this has to do with inheritance (the title of your question).


text:
Q: How do I "refresh" element in DOM? I've got an empty DIV element in which I append images by using  function createElement("img") and append them with appendChild. So now I've got DIV element full of images.
I would like to use one button to clean this DIV and add new images in it simultaneously.
Thanks for your help

A: Are you just looking for method replaceChild? Or you could remove all child elements before adding new images:
// assuming yor div is in variable divelement
while (divelement.firstChild)
  divelement.removeChild(divelement.firstChild);

A: what do you mean by clean? If you just want to empty it, you can do
document.getElementById('mydiv').innerHTML = '';

And then add on whatever new images you want.

A: While both setting innerHTML and calling removeChild() in a loop will clear the contents out of the DIV, the innerHTML method is going to be much faster due to the nature of browsers today.


text:
Q: Beginner Question about the logic behind Ohm's Law? In all the physics i learned and practiced many subjects But understanding Ohm's law used to be a big problem for me... Here is what i mean  :
We have a 5 volt battery. And a 3 volt/ 20 mA led.
So general approach to this schema is i learned:
The led needs 3 volts. So we should control 5-3 = 2 volt with a resistor .
V = I*R  & R = V/I
Here as i assume : R = 2 V / 0.02 mA = 100 ohm resistor we need ..
I hope this is correct..
But in this formula we use the voltage that resistor will control : 2 volts .. Since this voltage is resisted against; 3 volts will reach the Led.
But we find the current in formula using the voltage resistor will control and what it has to do with the LED's required Current ? Cause only 2 volts reaching to LED.
I really do not understand the logic behind this ; connection this two unrelated values..
Usually tutorials uses Pipes analogy.. Even with pipe analogy i can not clarify this ..
Example : In a pipe system , If a narrow pipe is stopping 2/3 of water ; the water tribune placed after this will receive 1/3 of the water. So no way to use 2/3 water to calculate anything about the water tribune and no effect on this tribune at all.
Is there any logical explanation of this ?
Thanks in advance from confused person..

A: The calculation you're using is an approximation, but it's a good one. It assumes that the voltage across an LED is constant, no matter what the current is. This is not actually true, but it's close, because LEDs are diodes, and thus exhibit a characteristic diode IV curve (ignore reverse voltage for now):

Notice that as the voltage increases, the current increases very quickly. For reasonable currents, from the minimum operating current to the maximum current before the LED breaks, the voltage will remain pretty constant, +/-10%. If you have a constant voltage power supply, that means that the voltage across your resistor will also be constant, no matter the current, due to kirchoffs voltage law:

simulate this circuit – Schematic created using CircuitLab
You can see here that as we change the resistance, the voltage across the LED stays the same, so the voltage across the resistor stays the same. The current increases as we decrease the resistor.

A: Simple enough: LEDs are highly non-linear and DO NOT follow Ohm's law at all. The relationship between voltage and current of an LED is quite complicated. For most practical purposes it can be simplified to a "constant voltage drop" model.
Therefore you can't define the "resistance" of an LED. Your math is actually correct, 100 Ohms will get you roughly 20 mA through the LED.
Ohm's law simply states that for a resistor voltage and current are proportional. However, an LED behaves very different from a conventional resistor so you can't apply Ohm's law to it.

A: The LED does not behave like a resistor. The simple version of Ohms Law only applies to linear devices that don't "react back". In the pipe analogy the LED behaves like pressure reducing valve - it subtracts pressure. Here volage is analogous to pressure.

A:
We have a 5 volt battery. And a 3 volt/ 20 mA led. So general approach to this schema is I learned: The led needs 3 volts. So we should control 5-3 = 2 volt with a resistor.

OK.

V = I * R and R = V/I. Here I assume: R = 2 V / 0.02 mA = 100 ohm resistor we need .. I hope this is correct..

Correct.

But in this formula we use the voltage that resistor will control : 2 volts .. Since this voltage is resisted against; 3 volts will reach the Led. But we find the current in formula using the voltage resistor will control and what it has to do with the LED's required Current ? Cause only 2 volts reaching to LED.
... Usually tutorials uses Pipes analogy.. Even with pipe analogy i can not clarify this .. Example : In a pipe system , If a narrow pipe is stopping 2/3 of water ; the water tribune [turbine] placed after this will receive 1/3 of the water. So no way to use 2/3 water to calculate anything about the water tribune [turbine] and no effect on this tribune [turbine] at all.

Your turbine understanding is not quite correct. Let's try this:

*

*You have a turbine. It will run at maximum speed at 10 L/s. For 10 L/s I need 0.4 bar pressure difference between the input and output. That's about 4 m "head" of water. (10 m = 1 bar = 1 atmosphere.)

*You have a river and a dam. It is 8 m higher than the outlet. Now your turbine will have 0.8 bar pressure. The flow will be much faster (higher current) and your turbine will run too fast and break up. (The blades will fly off or the rotor imbalance will shake it to pieces.)

*To solve this we add a valve on the feed to add some resistance to the water and limit the current to 10 L/s. Now the turbine can run at the rated current.

simulate this circuit – Schematic created using CircuitLab
Figure 1.
(a) The correct battery (head of water) for the lamp (turbine).
(b) Double the head gives double the current. The bulb (turbine) will be destroyed.
(c) R1 limits the current (flow), introduces a voltage (pressure) drop and the lamp (turbine) is run with the correct current (flow).

... and no effect on this tribune [turbine] at all.

That is the idea. The turbine doesn't know anything about the resistance.

Figure 2. The water analogy for a diode is a one-way check valve. Source: What is an LED?
From the article:
If you look at the check-valve in the figure above, it should be clear that the spring normally keeps the ball in position and prevents back-flow. When "forward-biased" the ball shut-off can be moved against the spring but it will take some initial pressure to move the ball. This results in a pressure drop across the valve: the pressure downstream will be less than the inlet pressure.
In a similar manner the PN junction causes a voltage drop. For silicon it is about 0.7 V. Since there is a PN junction in the base-emitter of your transistor you can expect a 0.7 V drop across it when forward biased.
Pushing the analogy a little further, we can also see that further pressure drop will occur due to the constriction of the valve. The more water we push through the valve the more the pressure will drop. This will be added to the initial pressure drop required to open the valve in the first place. The resultant pressure drop graph will look remarkably like one of the I vs V curves below.

Figure 3. Typical IV curves for various colours of LEDs.
I hope that helps. (The LEDnique article is mine.)

A: Lets examine the combined I-V curve for LED to Ground, in series with resistor to +5v

simulate this circuit – Schematic created using CircuitLab


text:
Q: In Starship Troopers, why was the Surgeon NOT making a drop?
... He stopped by the man in front of me, pressed the button on his belt that gave readings on his physicals. "Fall out!" "But, Sarge, it's just a cold. The Surgeon said -- " Jelly interrupted. " `But Sarge!' " he snapped. "The Surgeon ain't making no drop -- and neither are you, with a degree and a half of fever. (Starship Troopers, Chapter 1, p.2)

How does that square with the whole point - made right there, a couple of paragraphs down in Chapter 1 - of:

In any case, in the Mobile Infantry, everybody drops and everybody fights - chaplain and cook and the Old Man's writer. Once we went down the tube there  wouldn't be a Roughneck left aboard -- except Jenkins, of course, and that not his fault.

A: "The Surgeon" is referring to the ship's Navy doc.   No one in the Navy "drops" with the MI.   They pilot boats for retrieval and sometimes non-drop landings.

A: I took it to mean that the Surgeon wasn't a Roughneck. As in, he was attached to the Starship crew, rather than to the Roughneck platoon. They don't mention the fact that the Pilot stays behind, but that's obviously so; the Roughnecks are merely hitching a ride along on a Navy transport, so the Navy crew is distinct from the Army platoon. This is reinforced in a few passages in the book (which I don't have handy to quote, sorry) that discuss the pilot, but a ship of this size likely has multiple crew-members. The surgeon appears to be one of these.


text:
Q: Conversion of space characters into space tokens I'm trying to understand how the input, the expansion, and the execution processors work together. Running TeX on
\def\foo#1{(#1)\baz}%
\def\baz{baz}%
\foo{bla} Bar
\bye

yields "(bla)baz Bar" with a space between baz and Bar. Naively I would think that \foo is expanded, and after the expansion I should have
\foo{bla} Bar → (bla)\baz Bar
with \baz now gobbling the space after it. Maybe, in the definition of \foo, \baz has been already tokenized and spaces are not gobbled after it, but that would mean that the execution processor has already processed the first line. Or maybe the whole line has been read first, in which case the space character between } and B has been already converted into a space token. Or maybe something else which I don't see :-)
For which reason isn't the space gobbled?

A: characters are normally tokenized into a character token, using the current catcode settings, but after a character of catcode 0 is seen, it is not tokenized and the following characters are used to make a csname token.
In this case the following character is b of catcode 11 so tex will read all the following catcode 11 characters upto and including the first non-catcode 11 character, or end of line.
So here the sequence of catcode 11 characters is baz and will make a csname token with name baz  the non-catcode11 character that was used to terminate the csname scan is returned to the input stream (as a character, still untokenised) unless it it is catcode 10 space character in which case it is discarded, and tex goes into its skipping blanks state, so that any following spaces are also discarded. If the scan was terminated by end of line then tex goes straight to its beginning of line state without adding the token that usually produces a space at ends of lines, and all spaces at the beginning of the next line will be discarded as usual.
so in your case the characters after \baz are } in the first definition, { in the second definition so no special space handling is involved, just in your later suggested use of explicit (bla)\baz Bar  the non-catcode 11 character is a space and discarded.
When macros are expanded the replacement texts are list of tokens so none of this character to token or catcode lookup is involved at all.

A: Let me modify your code
\def\foo#1{(#1)\baz}
\def\baz{baz}

\foo{bla} Bar\baz Gnu

\bye

The definitions are actually irrelevant. When TeX reads the input it tokenizes it; so let's count the tokens in the relevant line:

\foo • {1 • b11 • l11 • a11 • }2 • ⍽10 • B11 • a11 • r11 • \baz • G11 • n11 • u11 • ⍽10

I also added the category codes, when possible; control sequence tokens have no category code. The last space token is generated by the end line.
There is no space token after \baz, because spaces are ignored after control words during the process of tokenization.
Now TeX starts expanding macros, starting from the left. Since \foo is a one-argument macro and is followed by {1, the argument is everything up to the matching }2. Thus TeX removes all these tokens and replaces them with the replacement text saved at definition time:

(12 • b11 • l11 • a11 • )12 • \baz • ⍽10 • B11 • a11 • r11 • \baz • G11 • n11 • u11 • ⍽10

The tokens up to \baz are passed to the next stage, leaving

\baz • ⍽10 • B11 • a11 • r11 • \baz • G11 • n11 • u11 • ⍽10

Now \baz is a no-argument macro, so no lookup for undelimited arguments is done, which would ignore spaces; the replacement leaves

b11 • a11 • z11 • ⍽10 • B11 • a11 • r11 • \baz • G11 • n11 • u11 • ⍽10

Note that TeX is not doing tokenization at this stage, so spaces after control sequences are not ignored.
When the macro replacement is performed, TeX uses already formed tokens; so \baz at the beginning of the third shown token list is actually the "internal" representation of the token. A following space is not ignored.
This is necessary. Suppose you have
\def\foo#1{#1 is good}
\def\egreg{EG}

Then you want that \foo{EG} or \foo\egreg print the same, independently of what's the argument passed to \foo. The parameter in the definition is followed by a space, so also after macro replacement there will be a space.

Note, The description above is a simplification of what really happens. The line is not tokenized immediately: only the part of the line that's needed is scanned. So TeX actually starts tokenizing \foo and after having found a one-argument macro, it looks for what comes along, which is an open brace, so TeX tokenizes up to finding the matching closed brace. And so on. However, since there is no category code change involved, pretending that TeX tokenizes at once the whole line is not the truth, but a good approximation to it for the task at hand.
What would be the problem in immediately tokenizing a line? Consider
\catcode`?=\active ?

If the line were tokenized immediately, the ? would be assigned category code 12 and not 13. Instead, tokenizing when the need arises solves the problem. The second ? is tokenized after the category code assignment has been performed.

A: In your source document, you wrote:
\foo{bla} Bar

TeX's eyes will turn that into tokens. Usually, you'll get 10 tokens. They are the control sequence whose name is foo and 9 character tokens. Every character token has a category. You'll get 6 letters, one begin-group, one end-group and a space.
If instead you wrote
\foo {bla}Bar

you'll only get 9 tokens. You won't get the space. That's because TeX's eyes ignore all spaces immediately after a control sequence, such as \foo. This turns out to be helpful.
I've explained how TeX works, but not why you're confused. TeX macros don't expand text to text. They expand tokens to tokens. It's not that TeX macros create a second source document, which is then re-read. I hope this helps.
Finally, there's a line ending character at the end of the line. That's another story. (One line ending is a space, two in a row are converted to a \par.)
This answer is based on Chapter 7, How TeX Reads What You Type, in Don Knuth's The TeXbook. It's also @egreg's answer, simplified to answer just your question.

Rereading this answer, I realise the phrase control sequence is used with two meanings. This might have contributed to your confusion. Let me clarify. Call \foo, followed by a non-letter, a control sequence literal. When read by TeX's eyes, it produces a control sequence token, whose name is foo.
In Python, for example, 'Hello world' is a string literal, which when compiled produces a string (whose value is 'Hello world'). There are of course other ways in Python to get a string. For example 'Hello' + 'world'. Similarly, TeX has the \csname ... \endcsname commands.

A: Usually TeX does process input line by line:
The whole line is read and the whole line is pre-processed.

*

*One step of pre-processing the whole line is:
All characters of the character-sequence which forms that line are converted from the computer-platform's character-representation-scheme to the TeX-engine's internal character-representation-scheme.
The computer-platform's character-representation-scheme might be whatsoever character-encoding. With modern computers this often is Unicode (and often the transformation-format is UTF-8). With older machines, e.g., running under MS-DOS, this might be some 8bit encoding/byte-encoding whereof ASCII (American Standard Code for Information Interchange) is a subset; e.g., when running under Win95/Win98/NT, this might be, e.g., Windows-1252 or iso-8859-1/iso-8859-15 or whatever.
With traditional TeX-engines the TeX-engine's internal character-representation-scheme is ASCII. With XeTeX- and with LuaTeX-enginges the TeX-engine's internal character-representation-scheme is Unicode (whereof ASCII is a subset).

*Another step of pre-processing the whole line is:
All spaces, i.e., all characters whose code-point has the number 32 in the TeX-engine's internal character-representation-scheme/in ASCII/in Unicode, that occur at the right end of the line, get removed.

*Yet another step of pre-processing the whole line is:
At the right end of the line a character gets appended whose code-point-number in the TeX engine's internal character-representation-schmeme equals the value of the integer-parameter \endlinechar.

*The reading-apparatus is switched to state N(new line).

After pre-processing TeX starts tokenizing the pre-processed line.
This means TeX "looks" at the pre-processed line character by character and hereby takes the character-sequence as a set of directives for appending tokens to the token-stream. Hereby category-codes of characters play a rôle.
["Looking" at the pre-processed line character by character and appending tokens to the token-stream takes place "on demand", i.e., only when TeX needs tokens while the token-stream is empty. E.g., when the token-stream is empty while gathering macro-arguments or a ⟨balenaced text⟩,
or when "looking" whether there is more work to do as no command for ending the job—something like (plain TeX) \bye or \end or (LaTeX) \stop or \end{document}—has been encountered yet.
On the one hand assigning another value to the integer-parameter \endlinechar does affect the pre-processing of lines of input.  Thus an assignment to \endlinechar does not affect the line of input wherein it occurs (but only subsequent lines) because obviously that line is already pre-processed at the time when the assignment is carried out.
On the other hand changing category-codes may affect tokenization of things while tokenization takes place on demand after pre-processing. Therefore changing category-codes might affect the tokenizing of things that (even in the current line) appear right after the assignment for changing the category-codes.
Changing the category-code of the "endline-character" may affect how the (during the pre-processing of the current line already appended) "endline-character" of the current line gets tokenized.
You can, e.g., type "I must not talk in class!" ten times by assigning \endlinechar a nice value and making the corresponding character active and defining that active character to deliver a horizontal box holding the phrase "I must not talk in class!" and then adding ten empty lines to the .tex-input (by hitting return ten times while typeing the sourecode), yielding the insertion of ten endline-characters during compilation as each of these ten empty lines gets pre-processed—notice that the \endlinechar-assignment does not affect the line wherein it occurs (but only subsequent lines) because that line is already pre-processed at the time when that \endlinechar-assignment is carried out. Each of the ten inserted endline-characters in turn gets tokenized as the mentioned active character delivering the horizontal box with the phrase "I must not talk in class!" :
\begingroup
%  Let's make 'A' active:
\catcode`\A=13 %
% Let's have a scratch-counter for counting how many times
% the phrase "I must not talk in class!" is written:
\newcount\scratchcount
% Let's define the active-'A' to do some counting and to
% deliver the line "I must not talk in class!":
\def A{%
   % Ensure vertical mode:
   \ifvmode\else\par\fi
   % Increment the scratch-counter and place the line/
   % the horizontal box:
   \advance\scratchcount by 1 %
   \hbox{\number\scratchcount.\null\ I must not talk in class!}%
}%
% Make the character 'A' the endline-character:
\endlinechar=`\A\relax
% (The \endlinechar-assignment in the line above does not affect
% that line. It does affect subsequent lines only. It does not
% lead to appending the character 'A' to that line as at the time
% of carrying out that assignment in TeX's stomach, that line is
% already pre-processed with the old value of \endlinechar (which
% is 13, denoting the return-character) ).
%
% Now let's have ten empty lines, yielding ten endline-characters
% 'A' whereof each gets tokenized as active-'A' expanding to the
% directives for doing some counting and delivering the line with
% the phrase "I must not talk in class!".

\endgroup%
% The comment-char at the end of the line above must be as the line
% above obviously gets pre-processed _before_ carrying out \endgroup
% and thus it also will have an endlinechar-'A' appended.
% Without the comment-char that 'A' would--as at the time of gathering
% the characters that form the name of the control-word-token '\endgr...'
% the  character 'A' is not of category-code 11(letter)--not be taken for
% something that belongs to the name of that "\endgr..."-control-word-token
% and therefore would trigger termination of gathering the name of the
% '\endgr...'-control-word-token and would be put back into the input
% stream.
% After processing/carrying out the control-word-token '\endgroup', 'A'
% is of category-code 11(letter).
% Therefore processing/tokenizing the 'A' that was put back into the
% input-steam would yield an 'A'-character-token of category-code
% 11(letter), at some later stage of processing yielding a glyph 'A'
% within the output-file/within the .dvi- or .pdf-file.
%
% Now let's get the token '\bye' in a funny way:
\endlinechar=`e
\by

]
Let's look at your code:
Line 1:  \def\foo#1{(#1)\baz}%
Line 2:  \def\baz{baz}%
Line 3:  \foo{bla} Bar
Line 4:  \bye

Line 1 and 2 are code-lines without spaces, thus here no space-tokens come into being. We don't go into details here. Each of these lines ends with a percent-character while the percent-character has category-code 14(comment). With each of these lines due to the integer-parameter \endlinechar having the value 13 (13 denotes the return character in the TeX-engine's internal character-representation-scheme/in ASCII/in Unicode) a return-character will be appended behind that percent-character at the stage of pre-processing. But at the stage of tokenizing, characters of category-code 14(comment) (when not being taken for the name of a control-symbol-token) cause TeX to cease tokenizing the current line of input and to start processing the next line of input if present. Thus a percent-character within a line of input doesn't yield appending a token to the token-stream at all but causes TeX to silently "drop" it and that line of input's remainig characters. As the return-character appended due to \endlinechar also belongs to the remaining characters of that line of input, it is silently dropped as well.
Line 3 is pre-processed (by TeX's eyes) as follows:
The line is read and its single characters are converted to the TeX-engine's internal character-representation-scheme.
There are no spaces at the right end of the line. Thus there are no spaces at the right end of the line to remove.
Due to \endlinechar (usually) having the value 13 while 13 is the number of the code-point of the return-character in ASCII/in Unicode/in the TeX-engine's internal character-representation-scheme, (usually) a return-character is inserted behind the last character of the line, which is r. Usually the return-character has the category-code 5(end of line).
When TeX (in its mouth) begins tokenizing the pre-processed line, the reading-apparatus is switched to state N(new line).
(When the reading-apparatus is in state N(new line), then

*

*space-characters do not yield appending tokens to the token-stream at all but are simply dropped, and

*a character of category-code 5(end of line) yields appending the control-word-token \par to the token-stream and also causes TeX to cease tokenizing the remaining characters of the current line/and also causes TeX to drop the remaining characters of the current line and to start processing the next line of input if present.

)
Thus TeX's mouth by and by, i.e., whenever tokens are needed, tokenizes the pre-processed line/the pre-processed input-character-sequence (now converted to the TeX-engine's internal character-representation-scheme)
\foo{bla}⟨space-character⟩Bar⟨return-character⟩
as follows:

*

*Control-word-token \foo. (After appending a control-word-token to the token-stream, the reading-apparatus is switched to state S(skipping blanks).)
As \foo is a macro which processes an argument, the argument needs to be obtained by tokenizing some more input:

*Explicit character-token { (opening curly brace) of category-code 1(begin group). (After appending an explicit character-token which is not of category-code 10(space) or after appending a control-symbol-token differing from control-space (\ ), the reading-apparatus is switched to state M(middle of line).)

*Explicit character-token b  of category-code 11(letter). (After appending an explicit character-token which is not of category-code 10(space) or after appending a control-symbol-token differing from control-space (\ ), the reading-apparatus is switched to state M(middle of line).)

*Explicit character-token l  of category-code 11(letter). (After appending an explicit character-token which is not of category-code 10(space) or after appending a control-symbol-token differing from control-space (\ ), the reading-apparatus is switched to state M(middle of line).)

*Explicit character-token a  of category-code 11(letter). (After appending an explicit character-token which is not of category-code 10(space) or after appending a control-symbol-token differing from control-space (\ ), the reading-apparatus is switched to state M(middle of line).)

*Explicit character-token } (closing curly brace) of category-code 2(end group). (After appending an explicit character-token which is not of category-code 10(space) or after appending a control-symbol-token differing from control-space (\ ), the reading-apparatus is switched to state M(middle of line).)

*Thus the following tokens are now send down from TeX's mouth to TeX's stomach—on their way to the stomach the tokens go through TeX's gullet, where expansion takes place:
\foo(control-word-token){1(begin-group)b11(letter)l11(letter)a11(letter)}2(end group)
while TeX's mouth still holds the remaining pre-processed input-character-sequence
⟨space-character⟩Bar⟨return-character⟩.

*Expansion of these tokens while passing TeX's gullet yields:
\foo requires a non-delimited argument. Explicit space-tokens preceding a non-delimited macro argument get discarded while gathering the tokens that form the argument. (A non-delimited argument either is a single token (which neither is an explicit space-token nor is an explicit character-token of category-code 1(begin group) nor is an explicit character-token of category-code 2(end group) nor is an \outer-token) or consists of a pair of matching curly braces (opening brace and closing brace) wherein a brace-balanced set of non-\outer-tokens is nested. That brace-balanced set of tokens can be "empty".) If present, a pair of matching curly braces that surrounds an entire macro argument (be it a delimited or a non-delimited macro argument) gets discarded when delivering the macro's replacement-text.
Expansion of \foo yields the following replacement:
(12(other)b11(letter)l11(letter)a11(letter))12(other)\baz(control-word-token)
The mouth still holds the remaining pre-processed input-character-sequence
⟨space-character⟩Bar⟨return-character⟩.

*While these tokens are slipping down the gullet, the expandable control-word-token \baz gets expanded as well—the following tokens reach the stomach of TeX:
(12(other)b11(letter)l11(letter)a11(letter))12(other)b11(letter)a11(letter)z11(letter)
Processing these tokens in the stomach (where assignments take place and boxes are bulit and paragraphs are split across lines and lines are placed on pages etc) yields switching to horizontal mode and to adding the glyph-sequence
(bla)baz
to the horizontal list from which the next line of text for the output-file/the .pdf-file is to be constructed.
TeX's mouth still holds the remaining pre-processed input-character-sequence
⟨space-character⟩Bar⟨return-character⟩.

*There is no indication that the job is to be finished, so TeX keeps its digestive processes going:
The reading-apparatus is neither in state N(new line) nor in state S(skipping blanks) but is in state M(middle of line) and TeX is not gathering the name of a control-symbol-token. So from the remaining pre-processed input-character-sequence in its mouth
⟨space-character⟩Bar⟨return-character⟩
it tokenizes the  ⟨space-character⟩ as an explicit space-token (character-code 32, category-code 10(space)) and appends that to the token-stream/sends that down its gullet towards the stomach.
(After appending an explicit character-token of category-code 10(space) or after appending a control-space (\ ), the reading-apparatus is switched to state S(skipping blanks).)
As TeX is in horizontal mode, the space-token in the stomach causes TeX to
add horizontal glue to the horizontal list which in turn (if not discarded for some reason) yields visible horizontal empty space in the .pdf-output-file.
TeX's mouth holds the remaining pre-processed input-character-sequence
Bar⟨return-character⟩.

*There is no indication that the job is to be finished, so TeX keeps its digestive processes going:
From the remaining pre-processed input-character-sequence in its mouth it tokenizes the explicit character-token B  of category-code 11(letter) and sends that down its gullet toward the stomach. (After appending an explicit character-token which is not of category-code 10(space) or after appending a control-symbol-token differing from control-space (\ ), the reading-apparatus is switched to state M(middle of line).)
TeX's mouth holds the remaining pre-processed input-character-sequence
ar⟨return-character⟩.

*There is no indication that the job is to be finished, so TeX keeps its digestive processes going:
From the remaining pre-processed input-character-sequence in its mouth it tokenizes the explicit character-token a  of category-code 11(letter) and sends that down its gullet toward the stomach. (After appending an explicit character-token which is not of category-code 10(space) or after appending a control-symbol-token differing from control-space (\ ), the reading-apparatus is switched to state M(middle of line).)
TeX's mouth holds the remaining pre-processed input-character-sequence
r⟨return-character⟩.

*There is no indication that the job is to be finished, so TeX keeps its digestive processes going:
From the remaining pre-processed input-character-sequence in its mouth it tokenizes the explicit character-token r  of category-code 11(letter) and sends that down its gullet toward the stomach. (After appending an explicit character-token which is not of category-code 10(space) or after appending a control-symbol-token differing from control-space (\ ), the reading-apparatus is switched to state M(middle of line).)
TeX's mouth holds the remaining pre-processed input-character-sequence
⟨return-character⟩.

*There is no indication that the job is to be finished, so TeX keeps its digestive processes going:
As TeX is not gathering the name of a control-symbol-token and as the reading-apparatus is in state M(middle of line) while the return-character has category-code 5(end of line), TeX will append to the token-stream and send down its gullet an explicit space-token (character-code 32, category-code 10(space)).
(If TeX were encountering a character of category-code 5(end of line) while the reading-apparatus was in state N(new line) and TeX was not gathering the name of a control-symbol-token, then TeX would append the control-word-token \par to the token-stream.
That's why under normal circumstances
*
*empty lines in the source-code and
*lines in the source-code containing nothing but space-characters and
*lines in the source-code containing nothing but a mixture of characters of category-code 9(ignore) and 10(space), that mixture probably trailed by some space-characters
yield the control-word-token \par. (With each of these cases none of the characters (if present) in that line leads to inserting a token into the token-stream, thus the reading-apparatus still is in state N when encountering the return-character of category code 5(end of line) that got inserted due to the value of \endlinechar at the right end of the line at the stage of pre-processing the line.)
If TeX were encountering a character of category-code 5(end of line) while the reading-apparatus was in state S(skipping blanks) and TeX was not gathering the name of a control-symbol-token, then TeX would not append a token at all to the token-stream.)
When encountering a character of category-code 5(end of line) while not gathering the name of a control-symbol-token TeX in any case ceases tokenizing the current line, i.e., drops any remaining characters on the current line, and starts processing the next line if present.

*There is no indication that the job is to be finished, so TeX keeps its digestive processes going:
There are no more characters left in the mouth, so TeX's eyes start pre-processing the next line of input. The reading-apparatus is switched to state N(new line). The single characters of the pre-processed line go to TeX's mouth on demand where tokens are formed on demand. Tokens are sent from TeX's mouth towards TeX's stomach on demand. Hereby they pass TeX's gullet where expandable tokens get expanded/get replaced by their replacement-text. In the stomach assignments take place and boxes are bulit and paragraphs are split across lines and lines are placed on pages etc...


text:
Q: Unistalling Google Earth broke WIFI connection? I am using Ubuntu 16.04.
I had Google Earth installed on the machine.  I then installed Google Earth Pro-which never prompted me for a password and displayed a bunch of odd panels in weird places.  Assuming a conflict of software I uninstalled Google Earth using the instructions here: Google Earth uninstall.
Oddly, the gnome-terminal package was removed from the computer, and the WiFi stopped working (although I can tether through my Android phone).  What happened?  Where is gnome-terminal, and why did my WiFi stop working?


text:
Q: Use inotify with MinGW Is it possible to use inotify compiling on Windows with mingw?
Because I would monitor change a file that is on a Linux server, but the program will be compiled and run on Windows7 machines. I think I have to use inotify and not Win32 API FindFirstChangeNotification.
Is it possible to monitor a Linux directory from a Windows machine?
My error when I compile :
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\simon\Desktop>g++ main.c -o main.exe
main.c:5:25: fatal error: sys/inotify.h: No such file or directory
      #include <sys/inotify.h>
                     ^
compilation terminated.

A: No, inotify is a feature provided by Linux kernel, so in order to use it, program has to be run on Linux. Programs running on Windows have to use Windows APIs.
If your application runs on Windows and has access to files on Linux servers, it still does it using Windows APIs, and Linux filesystem is exposed via some network filesystem (most probably SMB or NFS), that does the job of translating APIs and sending bytes via network.
To conclude, if you want to monitor changes on remote system, first make sure your network filesystem supports change notifications, then use "local" APIs - in your case, Windows ones.


text:
Q: Logically index Data based upon two date time arrays in matlab I will jump straight into a minimal example as I find this difficult to put into words. I have the following example:
Data.Startdate=[datetime(2000,1,1,0,0,0) datetime(2000,1,2,0,0,0) datetime(2000,1,3,0,0,0) datetime(2000,1,4,0,0,0)];
Data.Enddate=[datetime(2000,1,1,24,0,0) datetime(2000,1,2,24,0,0) datetime(2000,1,3,24,0,0) datetime(2000,1,4,24,0,0)];
Data.Value=[0.5 0.1 0.2 0.4];
Event_start=[datetime(2000,1,1,12,20,0) datetime(2000,1,1,16,0,0) datetime(2000,1,4,8,0,0)];
Event_end=[datetime(2000,1,1,14,20,0) datetime(2000,1,1,23,0,0) datetime(2000,1,4,16,0,0)];

What I want to do is add a flag to the Data structure (say a 1) if any time between Data.Startdate and Data.Enddate falls between Event_start and Event_end. In the example above Data.Flag would have have the values 1 0 0 1 because from the Event_start and Event_end vectors you can see there are events on January 1st and January 4th. The idea is that I will use this flag to process the data further.
I am sure this is straightforward but would appreciate any help you can give.

A: I would convert the dates to numbers using datenum, which then allows fairly convenient comparisons using bsxfun:
isStartBeforeEvent = bsxfun(@gt,datenum(Event_start)',datenum(Data.Startdate));
isEndAfterEvent = bsxfun(@lt,datenum(Event_end)',datenum(Data.Enddate));

flag = any(isStartBeforeEvent & isEndAfterEvent, 1)


text:
Q: How to get knockout old value before binding set to new value? i am doing custom binding to display the score :
my html like like this

self.ScoreValue= ko.observable("");

binding is like that :
ko.bindingHandlers.Score = {
    init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
        var myscorevalue = valueAccessor();
        if (myscorevalue) {

            //if(myscorevalue is decrease)
            {
                $("#divarrow").hide();
            }
            //if(myscorevalue is increasing)
            {
                $("#divarrow").show();
            }
        }
    },
    update: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
        var myscorevalue = valueAccessor();
        if (myscorevalue) {

            //if(myscorevalue is decrease)
            {
                $("#divarrow").hide();
            }
            //if(myscorevalue is increasing)
            {
                $("#divarrow").show();
            }
        }
    }
};

my issue is , based on score i passed , i want to show up and down arrow !
lets see my value is = self.ScoreValue("10")
and then i updated value to self.ScoreValue("15")
then i want to show $("#divarrow").show();
if i updated value to self.ScoreValue("5")
then i want to hide $("#divarrow").hide();

A: You can create another field (ex. PreviousScoreValue)  that will have the previous score using beforeChange subscription:
self.PreviousScoreValue = ko.observable(self.ScoreValue());

self.ScoreValue.subscribe(function(value) {
    self.PreviousScoreValue(value);
}, null, 'beforeChange');

Then in the custom binding, use it to compare to new ScoreValue:
init: function (element, valueAccessor, allBindingsAccessor, viewModel,
                bindingContext) {
    var myscorevalue = valueAccessor();
    var previousvalue = bindingContext.$data.PreviousScoreValue();

    if (myscorevalue) {
        if(myscorevalue < previousvalue)
        {
            $("#divarrow").hide();
        } else if(myscorevalue > previousvalue)
        {
            $("#divarrow").show();
        }
    }
},


text:
Q: Stripe not reload/redirect page after payment I have smarty template form where is shown Stripe payment button.

        <form action="/payment.php?custom=1&sum={$sum*100}" method="POST">

        </form>

powered by stripe

Then my php file payment.php
if($_REQUEST['stripeToken']) {

    require_once('stripe_4/init.php');

    try {
      // Use Stripe's library to make requests...

        \Stripe\Stripe::setApiKey("sk_live_xxxxxxxxxx");

        $token = $_REQUEST['stripeToken'];

        if ($_GET['custom'] == 1) {
            $price = $_GET['sum'];
            $calback_url = 'ppdpam';
            $description = "Custom payment";
        }
        else {
            $_SESSION['stripe_error_message'] = "Wrong parameters!";
            header("Location: https://".SITE."/data.php?er=100$parameter");
            exit;
        }

        // Charge the user's card:
        $charge = \Stripe\Charge::create(array(
          "amount" => $price,
          "currency" => "usd",
          "description" => $description,
          "source" => $token,
        ));

    } catch(\Stripe\Error\Card $e) {
      // Since it's a decline, \Stripe\Error\Card will be caught
      $body = $e->getJsonBody();
      $err  = $body['error'];

      print('Status is:' . $e->getHttpStatus() . "\n");
      print('Type is:' . $err['type'] . "\n");
      print('Code is:' . $err['code'] . "\n");
      // param is '' in this case
      print('Param is:' . $err['param'] . "\n");
      print('Message is:' . $err['message'] . "\n");

      $_SESSION['stripe_error_message'] = $e->getMessage();
      header("Location: /data.php?er=1$parameter");
      exit;

    header("Location: https://".SITE."/data.php?".$calback_url);
    exit;
}

When I click on Stripe button I get the popup where I put data of my card. Then I click Pay i've got green tick on the popup (assuming that the payment is okay) and then nothing happens.
There is nothing in the Stripe, like the payment isn't even get there and there is no charge on my card.
It should redirect me to the URL along with the $calback_url parameter. All I got is gray Stripe button and need to manually refresh the page.

A: First off, you're using Legacy Checkout which Stripe deprecated well over 3 years ago and actively discourages using. It's not really maintained and no new integration should rely on it (though it does still work since they wouldn't break existing users).
You should be using one of Stripe's numerous newer features from Checkout to Payment Links, the Pricing Table or their "pay what you want" feature.
It is crucial to switch off as Legacy Checkout doesn't support many of the newer features such as 3D Secure, mandates for India payments, saving card details for future payments and many more.
Ultimately though, the first part of your code opens Legacy Checkout which is a modal/popup to collect card details. It doesn't accept a payment at all, it just collects card details and creates a card Token tok_123. Then your form on the page gets submitted with the Token id in $_POST['stripeToken']. Your code looks at $_REQUEST['stripeToken'] but then does nothing with it and later you reference 'source' => $token without having ever defined that variable. Unfortunately that means you have multiple PHP errors and your script must be crashing as you also don't handle any of Stripe's API errors. If you fix that, the redirect should work, but really you should never be using that code and rely on one of the options I mention above.


text:
Q: About apple rejection on "location-based APIs for emergency services" I have developed an application that tracks user Location (background Mode) with user permission for a government police service.
As Per apple Human Interface guideline:
4.3 Apps that use location-based APIs for emergency services will be rejected

*

*So Now What services include  location-based APIs for emergency services

*Can I use Location tracking for government Service
Any help is appreciated..
Thanks

A: app rejection process 4. Location under with section
4.3 Apps that use location-based APIs for dispatch, fleet management, or emergency services will be rejected.
Ans :

You can't make apps to watch your employees, or make apps that rely too heavily on location. Nobody wants an accident to happen because the device was not precise enough or didn't work correctly. Also, you can't use the iPhone to spy on people.

need additional reference follow this link

A: In case anyone else stumbles across this.  Apple has updated their guidelines and the now relevant topic is 5.1.5:

5.1.5 Location Services
Use Location services in your app only when it is directly relevant to the features and services provided by the app. Location-based APIs shouldn't be used to provide emergency services or autonomous control over vehicles, aircraft, and other devices, except for small devices such as lightweight drones and toys, or remote control car alarm systems, etc. Ensure that you notify and obtain consent before collecting, transmitting, or using location data. If your app uses location services, be sure to explain the purpose in your app; refer to the Human Interface Guidelines for best practices on doing so.

The other answer is still accurate: You cannot provide a location-based service that integrates with emergency services (police).  (unless, in the times of Covid, you work for Apple)